:root {
    --bg-start: #07111f;
    --bg-end: #10263f;
    --panel: rgba(10, 18, 30, 0.82);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: #9eb1c7;
    --gold: #e9be62;
    --gold-strong: #ffda82;
    --red: #d94d44;
    --black: #10161d;
    --green: #1da96e;
    --button: linear-gradient(135deg, #f7c767, #d88b2b);
    --button-dim: linear-gradient(135deg, #44617f, #2b3e57);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(233, 190, 98, 0.18), transparent 28%),
        linear-gradient(180deg, var(--bg-start), var(--bg-end));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 35%),
        radial-gradient(circle at bottom right, rgba(29, 169, 110, 0.14), transparent 24%);
    pointer-events: none;
}

.app-shell {
    position: relative;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 24px 18px 36px;
}

.hero {
    padding: 10px 4px 22px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold-strong);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 12px;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 9vw, 52px);
    line-height: 0.95;
}

.subtitle {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.table-card,
.result-card {
    border: 1px solid var(--panel-border);
    background: var(--panel);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.table-card {
    padding: 24px 20px 20px;
}

.status-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.balance-card,
.claim-panel {
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.balance-card strong {
    font-size: 24px;
}

.claim-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.topup-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.claim-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.claim-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.wheel-wrap {
    position: relative;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
}

.wheel-shadow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 190, 98, 0.2), transparent 66%);
    filter: blur(12px);
}

.wheel-pointer {
    position: absolute;
    top: -2px;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid var(--gold-strong);
    z-index: 3;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

.wheel {
    position: relative;
    width: min(76vw, 280px);
    height: min(76vw, 280px);
    border-radius: 50%;
    border: 12px solid #e7d0a0;
    box-shadow:
        inset 0 0 0 10px #6b451f,
        inset 0 0 40px rgba(0, 0, 0, 0.35);
    transition: transform 4.6s cubic-bezier(0.18, 0.9, 0.2, 1);
}

.wheel::after {
    content: "";
    position: absolute;
    inset: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #f6d381, #a96a24);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.28);
}

.segment-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.controls {
    display: grid;
    gap: 12px;
}

.bet-grid {
    display: grid;
    gap: 12px;
}

.hidden {
    display: none;
}

.bet-label {
    color: var(--muted);
    font-size: 14px;
}

select,
button {
    border: 0;
    border-radius: 18px;
    font: inherit;
}

select {
    width: 100%;
    padding: 15px 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    color-scheme: dark;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select option {
    background: #132235;
    color: var(--text);
}

button {
    padding: 16px 18px;
    font-weight: 700;
    background: var(--button);
    color: #231302;
    cursor: pointer;
    box-shadow: 0 16px 26px rgba(216, 139, 43, 0.32);
}

#claim-button {
    min-width: 190px;
}

#topup-button {
    min-width: 140px;
}

button:disabled {
    opacity: 1;
    cursor: not-allowed;
    background: var(--button-dim);
    color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
}

.result-card {
    margin-top: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    align-items: center;
}

.result-title {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 13px;
}

.result-chip {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 5px solid rgba(255, 255, 255, 0.08);
    font-size: 30px;
    font-weight: 700;
}

.result-text,
#history-text {
    margin: 0;
}

.win {
    color: #8cf0a0;
}

.lose {
    color: #ff9f94;
}

@media (max-width: 480px) {
    .status-bar,
    .claim-panel,
    .result-card {
        grid-template-columns: 1fr;
    }

    .topup-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .claim-panel,
    .result-card {
        justify-items: center;
        text-align: center;
    }

    #claim-button,
    #topup-button {
        width: 100%;
    }
}
