/* ==========================================================================
   LIVESOCCER PRO PLAY & WIN (CLEAN LIGHT-MODE FIRST + DARK MODE ADAPTIVE)
   ========================================================================== */

.pw-page {
    background: var(--bg-body);
    color: var(--text-primary);
    padding-bottom: 24px;
}

/* 1. Header & Wallet Dashboard */
.pw-deck {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pw-deck-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

/* Segmented Currency Switcher */
.pw-toggle-cur {
    display: inline-flex;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.pw-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.pw-toggle-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.pw-toggle-btn.is-active[data-cur="COINS"] {
    background: #FFF;
    color: #B45309;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.pw-toggle-btn.is-active[data-cur="UGX"] {
    background: #FFF;
    color: #047857;
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="COINS"] {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.45);
}

html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="UGX"] {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.45);
}

.pw-val-num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* Free Coins Refill Button */

/* Profile Row */

/* 2. Broadcast Live Winners Ticker */
.pw-ticker-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 12px;
    color: var(--text-secondary);
}
.pw-ticker-bar::-webkit-scrollbar { display: none; }

.pw-tick-badge {
    background: var(--green-soft);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
html[data-theme="dark"] .pw-tick-badge { color: #34D399; }

.pw-tick-items {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.pw-item-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pw-item-chip b { color: var(--text-primary); font-weight: 700; }
.pw-item-chip em { color: #059669; font-style: normal; font-weight: 700; }
html[data-theme="dark"] .pw-item-chip em { color: #34D399; }
.pw-item-tag {
    font-size: 12px;
    font-weight: 700;
    color: #B45309;
    text-transform: none;
}
html[data-theme="dark"] .pw-item-tag { color: #FBBF24; }

/* 3. Game Navigation Bar */
.pw-nav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 10px 4px;
}

.pw-mode-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 6px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    transition: all 0.15s ease;
}

.pw-mode-btn .m-ico {
    font-size: 17px;
    line-height: 1;
}

.pw-mode-btn .m-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.pw-mode-btn .m-sub {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.pw-mode-btn.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
}
.pw-mode-btn.is-active .m-title {
    color: var(--primary);
}
.pw-mode-btn.is-active .m-sub {
    color: var(--primary);
    opacity: 0.85;
}

/* 4. Game Arena Box */
.pw-arena-card {
    margin: 8px 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pw-game-pane { display: none; }
.pw-game-pane.is-active { display: block; }

/* Penalty Ladder */
.pen-ladder-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.pen-ladder-step {
    text-align: center;
    padding: 5px 2px;
    border-radius: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.pen-ladder-step small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    opacity: 0.8;
}
.pen-ladder-step em {
    display: block;
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.pen-ladder-step.is-next {
    border-color: #F59E0B;
    color: #B45309;
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}
.pen-ladder-step.is-next em { color: #B45309; font-weight: 700; }
html[data-theme="dark"] .pen-ladder-step.is-next,
html[data-theme="dark"] .pen-ladder-step.is-next em { color: #FBBF24; }

.pen-ladder-step.is-cleared {
    border-color: #10B981;
    background: var(--green-soft);
    color: #047857;
}
.pen-ladder-step.is-cleared em { color: #047857; }
html[data-theme="dark"] .pen-ladder-step.is-cleared,
html[data-theme="dark"] .pen-ladder-step.is-cleared em { color: #34D399; }

/* Stadium Pitch SVG Stage */
.pen-stage {
    position: relative;
    background: radial-gradient(circle at 50% 20%, #0A192F 0%, #060D1A 100%);
    padding: 6px;
    overflow: hidden;
}
.pen-stage.is-goal::after,
.pen-stage.is-save::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: pwFlash 0.65s ease-out forwards;
}
.pen-stage.is-goal::after {
    background: radial-gradient(circle at 50% 35%, rgba(16, 185, 129, 0.35), transparent 70%);
}
.pen-stage.is-save::after {
    background: radial-gradient(circle at 50% 35%, rgba(239, 68, 68, 0.35), transparent 70%);
}
.pen-stage.is-save {
    animation: pwShake 0.42s;
}
#pen-net-group.is-ripple {
    animation: penNetRipple 0.48s ease-out;
    transform-origin: 180px 68px;
}
@keyframes penNetRipple {
    0% { transform: scale(1); }
    35% { transform: scale(1.035, 1.06); }
    70% { transform: scale(0.99, 0.985); }
    100% { transform: scale(1); }
}

.pen-svg-frame {
    width: 100%;
    height: auto;
    display: block;
}

.pen-target-reticle {
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease;
}

.pen-stage:not(.is-live-round) .pen-target-reticle {
    opacity: 0.38;
    cursor: default;
}

.pen-target-reticle circle.ret-circle {
    fill: rgba(0, 86, 210, 0.4);
    stroke: #38BDF8;
    stroke-width: 2;
    stroke-dasharray: 4 2;
    transition: fill 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease, r 0.15s ease;
}

.pen-stage.is-live-round .pen-target-reticle:hover circle.ret-circle,
.pen-stage.is-live-round .pen-target-reticle:active circle.ret-circle {
    fill: rgba(16, 185, 129, 0.62);
    stroke: #34D399;
    stroke-width: 3px;
    stroke-dasharray: none;
}

.pen-target-reticle text {
    fill: #FFFFFF;
    font-size: 9px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    letter-spacing: 0.4px;
}

.pen-hud-row {
    padding: 8px 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    flex-wrap: wrap;
}
.pen-lucky-btn {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.pen-lucky-btn:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.pen-lucky-btn:active:not(:disabled) { transform: scale(0.97); }
.pen-lucky-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Kickoff Crash Arena */
.crash-stage {
    position: relative;
    background: var(--bg-surface);
    padding: 12px;
}

.crash-pill-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.crash-pill-strip::-webkit-scrollbar { display: none; }

.crash-history-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
}

.crash-history-pill.is-high {
    background: var(--green-soft);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.35);
}
html[data-theme="dark"] .crash-history-pill.is-high { color: #34D399; }

.crash-history-pill.is-epic {
    background: rgba(245, 158, 11, 0.15);
    color: #B45309;
    border-color: rgba(245, 158, 11, 0.4);
}
html[data-theme="dark"] .crash-history-pill.is-epic { color: #FBBF24; }

.crash-history-pill.is-mega {
    background: rgba(225, 29, 72, 0.15);
    color: #BE123C;
    border-color: rgba(225, 29, 72, 0.4);
}
html[data-theme="dark"] .crash-history-pill.is-mega { color: #FB7185; }

.crash-telemetry-box {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.crash-mult-readout {
    font-size: 46px;
    font-weight: 700;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1;
}

.crash-mult-readout.is-busted {
    color: #DC2626;
}

.crash-mult-readout.is-cashed {
    color: #059669;
}
html[data-theme="dark"] .crash-mult-readout.is-cashed { color: #34D399; }

.crash-telemetry-sub {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 5px;
    text-transform: none;
    letter-spacing: 0.5px;
}
.crash-live-win {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(52, 211, 153, 0.45);
    color: #6EE7B7;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.crash-live-win[hidden] { display: none; }
.crash-auto-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}
.crash-auto-presets {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.crash-preset-btn {
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: #CBD5E1;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.crash-preset-btn:hover,
.crash-preset-btn.is-active {
    border-color: #FBBF24;
    background: rgba(245, 158, 11, 0.2);
    color: #FDE68A;
}

/* Lucky Wheel Arena */
.wheel-stage {
    padding: 14px 12px;
    text-align: center;
    background: radial-gradient(120% 90% at 50% 0%, rgba(245, 158, 11, 0.09) 0%, var(--bg-surface) 70%);
    position: relative;
}
.wheel-hist-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    min-height: 22px;
}
.wheel-hist-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.wheel-hist-pill.is-win {
    border-color: rgba(16, 185, 129, 0.45);
    color: #059669;
    background: var(--green-soft);
}
html[data-theme="dark"] .wheel-hist-pill.is-win { color: #34D399; }
.wheel-hist-pill.is-jp {
    border-color: rgba(225, 29, 72, 0.5);
    color: #E11D48;
    background: rgba(225, 29, 72, 0.12);
}

.wheel-disc-wrap {
    position: relative;
    width: 262px;
    height: 262px;
    max-width: 88vw;
    margin: 0 auto 10px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.wheel-needle {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: 50% 8px;
    z-index: 10;
    pointer-events: none;
    line-height: 0;
    transition: transform 0.08s ease-out;
}
.wheel-needle.is-tick {
    transform: translateX(-50%) rotate(-18deg);
}

.wheel-svg-plate {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 8px 26px rgba(0,0,0,0.24), 0 0 0 3px rgba(245, 158, 11, 0.22);
    transition: transform 3.8s cubic-bezier(0.12, 0.88, 0.24, 1);
    transform-origin: 50% 50%;
    -webkit-transform-origin: 50% 50%;
    transform-box: view-box;
    will-change: transform;
    touch-action: manipulation;
}
.wheel-stud-a { animation: wheelStudPulse 1.4s infinite alternate; }
.wheel-stud-b { animation: wheelStudPulse 1.4s 0.7s infinite alternate; }
@keyframes wheelStudPulse {
    0% { opacity: 0.45; }
    100% { opacity: 1; }
}

.wheel-tap-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(0, 86, 210, 0.22);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 86, 210, 0.08);
}

.wheel-tap-pill:hover,
.wheel-tap-pill:active {
    background: rgba(0, 86, 210, 0.16);
    transform: scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 86, 210, 0.15);
}

.wheel-center-btn {
    cursor: pointer;
    touch-action: manipulation;
    transition: filter 0.2s ease, transform 0.15s ease;
    transform-origin: 130px 130px;
}

.wheel-center-btn:hover {
    filter: drop-shadow(0 0 10px #F59E0B);
}

.wheel-center-btn:active {
    filter: drop-shadow(0 0 14px #F59E0B) brightness(1.15);
}

/* Wheel Picks & Multipliers Quick Grid */
.wheel-picks-tray {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
@media (max-width: 440px) {
    .wheel-picks-tray {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
}
.wheel-pick-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.wheel-pick-pill.is-jackpot {
    border-color: rgba(225, 29, 72, 0.4);
    background: rgba(225, 29, 72, 0.05);
}
.wheel-pick-pill.is-won {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0, 86, 210, 0.2);
}
.wheel-pick-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wheel-pick-mult {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
}
.wheel-pick-pill.is-jackpot .wheel-pick-mult {
    color: #E11D48;
}
.wheel-pick-name {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.3px;
    margin-left: auto;
}

/* 5. Betting Cockpit Slip Controls */
.pw-slip {
    padding: 12px 14px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.pw-slip-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pw-input-box {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pw-input-box label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0.4px;
}

.pw-input-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    text-align: right;
    outline: none;
    font-variant-numeric: tabular-nums;
    width: 120px;
}

/* Quick Chips */
.pw-chips-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.pw-chip-opt {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pw-chip-opt:hover {
    background: var(--border);
    color: var(--text-primary);
}
.pw-chip-opt.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

/* Potential win & mode preview strip inside the betting slip */
.pw-slip-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle, var(--border));
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.pw-slip-win {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
}
.pw-slip-win b {
    color: var(--gold);
    font-weight: 700;
}
.pw-slip-switch {
    border: none;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}
.pw-slip-switch:hover { text-decoration: underline; }

/* Main CTA Button */
.pw-btn-main {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.4px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(0, 86, 210, 0.28);
    transition: all 0.15s ease;
}

.pw-btn-main:hover {
    filter: brightness(1.05);
}

.pw-btn-main:active {
    transform: scale(0.99);
}

.pw-btn-main.is-ready {
    background: #EBF2FF;
    color: var(--primary);
    border: 1.5px dashed var(--primary);
    box-shadow: 0 2px 10px rgba(0, 86, 210, 0.15);
    cursor: default;
    animation: pwReadyPulse 2s infinite ease-in-out;
}

@keyframes pwReadyPulse {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 0.75; }
}

.pw-btn-main.is-cashout {
    background: #F59E0B;
    color: #0F172A;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
    animation: pwCashoutPulse 1.4s infinite;
}

@keyframes pwCashoutPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.65); }
}

.pw-btn-main:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* 6. Real-Time Rounds History & Global Leaderboard */
.pw-sub-card {
    margin: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.pw-sub-nav {
    display: flex;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.pw-nav-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pw-nav-tab.is-active {
    color: var(--primary);
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
}

.pw-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pw-tbl th, .pw-tbl td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.pw-tbl th {
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    color: var(--text-muted);
}

/* Modals */
.pw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pw-modal-overlay.is-open { display: flex; }

.pw-modal-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.pw-modal-box h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pw-modal-box p.info-sub {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.pw-form-group { margin-bottom: 12px; }
.pw-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.pw-form-group input, .pw-form-group select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.pw-form-group input:focus, .pw-form-group select:focus {
    border-color: var(--primary);
}

/* ---- Game appeal pass ---- */
/* Crash: a night-stadium stage whose colour climbs with the multiplier */
.crash-stage {
    --crash-col: #38BDF8;
    --text-primary: #F8FAFC; --text-secondary: #CBD5E1; --text-muted: #94A3B8;
    --border: rgba(148,163,184,.28); --bg-card: rgba(255,255,255,.07);
    background: radial-gradient(120% 90% at 50% 0%, #17387a 0%, #0b1a3a 55%, #060d1f 100%);
    color: #E2E8F0;
    overflow: hidden;
    isolation: isolate;
}
.crash-stage::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 38px, transparent 38px 76px);
}
.crash-stage.crash-t2 { --crash-col: #34D399; }
.crash-stage.crash-t3 { --crash-col: #FBBF24; }
.crash-stage.crash-t4 { --crash-col: #FB7185; }
/* Glow is a second, wider stroke (cheap) instead of a blur filter that would be re-rendered on every frame */
.crash-stage #crash-curve { stroke: var(--crash-col); }
.crash-stage #crash-glow { stroke: var(--crash-col); stroke-opacity: .22; fill: none; stroke-linecap: round; }
.crash-stage #crash-fill { fill: var(--crash-col); fill-opacity: .16; }
.crash-stage #crash-ball > circle:first-child { fill: var(--crash-col); fill-opacity: .35; }
.crash-stage #crash-ball > circle:last-child { fill: #fff; stroke: var(--crash-col); }
.crash-stage .crash-telemetry-box::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 170px; height: 90px; transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, var(--crash-col), transparent); opacity: .26; z-index: -1; pointer-events: none;
}
.crash-stage .crash-mult-readout { color: #fff; }
.crash-stage .crash-mult-readout.is-busted { color: #FB7185; }
.crash-stage .crash-mult-readout.is-cashed { color: #34D399; }
.crash-stage .crash-history-pill { background: rgba(255,255,255,.08); color: #E2E8F0; border-color: rgba(148,163,184,.28); }
.crash-stage .crash-history-pill.is-high { background: rgba(16,185,129,.18); color: #34D399; border-color: rgba(52,211,153,.4); }
.crash-stage .crash-history-pill.is-epic { background: rgba(245,158,11,.18); color: #FBBF24; border-color: rgba(251,191,36,.45); }
.crash-stage .crash-history-pill.is-mega { background: rgba(225,29,72,.2); color: #FB7185; border-color: rgba(251,113,133,.5); }
.crash-stage #crash-auto-input { color: #FBBF24 !important; border-color: rgba(148,163,184,.35) !important; }
.crash-stage.is-bust { animation: pwShake .45s; }
.crash-stage.is-bust::after, .crash-stage.is-cash::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; animation: pwFlash .7s ease-out forwards;
}
.crash-stage.is-bust::after { background: radial-gradient(circle, rgba(251,113,133,.35), transparent 70%); }
.crash-stage.is-cash::after { background: radial-gradient(circle, rgba(52,211,153,.35), transparent 70%); }
@keyframes pwShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes pwFlash { from { opacity: 1; } to { opacity: 0; } }

/* Performance: no blur layers behind the moving games, and no always-on animations that repaint every frame */
html.zone-play .header,
html.zone-play .bp-bottom-nav {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--bg-card);
}
.pw-btn-main { transition: transform .12s ease, filter .12s ease; }
.pw-btn-main.is-cashout { animation: none; box-shadow: 0 0 16px rgba(245, 158, 11, 0.55); }

/* Controls (stake, quick chips, Start / Cash out / Spin) stay pinned to the bottom of the screen while the game is
   on screen: just above the tab bar on phones, at the bottom edge on desktop. */
.pw-arena-card { overflow: clip; }   /* "clip" (not "hidden") so the pinned bar can stick to the screen */
.pw-controls {
    position: sticky; bottom: 0; z-index: 40; background: var(--bg-card);
    border-top: 1px solid var(--border); box-shadow: 0 -8px 16px rgba(15, 23, 42, .08);
}
.pw-slip { padding-bottom: 8px; border-top: 0; }
.pw-cta { padding: 0 12px 12px; }
@media (max-width: 1023px) {
    .pw-controls { bottom: var(--pw-bnav, calc(70px + env(safe-area-inset-bottom, 0px))); }   /* --pw-bnav = measured tab bar height (play.js) */
    .pw-slip { padding: 8px 12px 6px; }
    .pw-slip-input-row { margin-bottom: 6px; }
    .pw-slip .pw-input-box { padding: 4px 12px; }
    .pw-slip .pw-chip-opt { padding: 6px 12px; }
    .pw-slip-input-row .pw-chip-opt { padding: 8px 14px !important; }
    .pw-cta { padding: 0 12px 10px; }
    .pw-cta .pw-btn-main { padding: 11px 16px; }
}
/* Short phones: keep the stake box and the button, fold away the chip row so the game keeps its room */
@media (max-width: 1023px) and (max-height: 520px) {
    .pw-slip .pw-chips-bar { display: none; }
}

/* Win banner over the arena */
.pw-arena-card { position: relative; }
.pw-winbanner {
    position: absolute; left: 50%; top: 9%; transform: translateX(-50%); z-index: 30; pointer-events: none;
    text-align: center; padding: 10px 22px; border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, #0b57d0, #0a2f7a); border: 1px solid rgba(255,255,255,.28);
    box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 3px rgba(251,191,36,.35);
    animation: pwBannerIn 2.6s ease forwards;
}
.pw-winbanner b { display: block; font-size: 20px; font-weight: 700; letter-spacing: .2px; color: #FDE68A; }
.pw-winbanner span { display: block; font-size: 15px; font-weight: 700; margin-top: 2px; }
.pw-winbanner small { display: block; font-size: 12px; margin-top: 4px; opacity: .85; }
.pw-winbanner.is-huge { background: linear-gradient(135deg, #b45309, #7c2d12); }
.pw-winbanner.is-jackpot { background: linear-gradient(135deg, #be123c, #5b0a26); }
@keyframes pwBannerIn {
    0% { opacity: 0; transform: translateX(-50%) scale(.6); }
    12% { opacity: 1; transform: translateX(-50%) scale(1.08); }
    22% { transform: translateX(-50%) scale(1); }
    82% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .crash-stage.is-bust { animation: none; }
    .crash-stage.is-bust::after, .crash-stage.is-cash::after { display: none; }
    .pw-winbanner { animation: none; transform: translateX(-50%); }
}

.pw-wallet-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.pw-wallet-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.pw-wallet-history h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.pw-wallet-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pw-wallet-history li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); }
.pw-wallet-history .wh-st { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border); }
.pw-wallet-history .wh-st.is-completed { color: #0a7a4b; border-color: currentColor; }
.pw-wallet-history .wh-st.is-failed { color: #b42318; border-color: currentColor; }
.pw-wallet-history .wh-st.is-pending { color: var(--primary); border-color: currentColor; }

.pw-phone-row {
    display: flex;
    gap: 6px;
}
.pw-phone-row select { width: 126px; flex-shrink: 0; }

/* ==========================================================================
   "Two Zones" blue Play zone overrides — gold is reserved for stake / win
   ========================================================================== */
.pw-btn-main {
    background: var(--gold);
    color: var(--gold-text);
    box-shadow: none;
}
.pw-btn-main.is-ready {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}
.pw-btn-main.is-cashout { background: var(--gold); color: var(--gold-text); }
.pw-deck, .pw-arena-card { box-shadow: none; }
.pw-toggle-btn.is-active[data-cur="COINS"],
.pw-toggle-btn.is-active[data-cur="UGX"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="COINS"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="UGX"] {
    background: var(--primary);
    color: var(--text-on-primary);
    border: 1px solid var(--primary);
    box-shadow: none;
}
.pw-tick-badge, html[data-theme="dark"] .pw-tick-badge {
    background: var(--gold);
    color: var(--gold-text);
    border-color: transparent;
}
.pw-item-chip em, html[data-theme="dark"] .pw-item-chip em,
.pw-item-tag, html[data-theme="dark"] .pw-item-tag { color: var(--gold); }
.pw-mode-btn.is-active { background: var(--primary); border-color: var(--primary); }
.pw-mode-btn.is-active .m-title, .pw-mode-btn.is-active .m-sub { color: var(--text-on-primary); opacity: 1; }

/* Pro cleanup: one account row (wraps on phones), quieter labels, plain-text winners */
.pw-deck { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; }
.pw-deck .pw-deck-row { margin: 0; flex: 1 1 auto; }
.pw-toggle-btn { font-size: 13px; font-weight: 500; padding: 6px 12px; }
.pw-toggle-btn .pw-val-num { font-weight: 600; }
.pw-ticker-bar { font-size: 13px; gap: 10px; }
.pw-tick-badge { font-size: 12px; font-weight: 600; text-transform: none; }
.pw-item-chip { border: none; background: transparent; padding: 0; gap: 4px; }
.pw-item-chip + .pw-item-chip::before { content: '\00B7'; color: var(--text-muted); margin-right: 6px; }
.pw-item-chip b { font-weight: 600; }
.pw-item-tag { font-size: 12px; font-weight: 500; text-transform: none; color: var(--text-secondary) !important; }
.pw-mode-btn .m-title { font-weight: 600; }
.pw-mode-btn .m-sub { font-weight: 400; }
.pw-btn-main { font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.pw-nav-tab { font-size: 13px; font-weight: 500; text-transform: none; }

/* ---- Decluttered, pro Play layout ---------------------------------------- */
/* Account bar: one row — balance switch | icon actions */
.pw-deck { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.pw-deck .pw-deck-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin: 0; flex-wrap: wrap;
}
/* UGX / Coins selector: crisp, aligned segmented control */
.pw-toggle-cur {
    display: inline-grid; grid-template-columns: repeat(2, minmax(0, auto)); align-items: center;
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 3px; gap: 3px; height: 38px; box-sizing: border-box;
    flex: 0 0 auto; max-width: 100%; overflow: hidden;
}
.pw-toggle-btn,
.pw-toggle-btn.is-active[data-cur="COINS"],
.pw-toggle-btn.is-active[data-cur="UGX"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="COINS"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="UGX"] {
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px; box-sizing: border-box;
    border: none; border-radius: 7px; padding: 0 12px;
    font-size: 13px; font-weight: 600; line-height: 1; gap: 6px;
    background: transparent; color: var(--text-secondary); box-shadow: none;
    white-space: nowrap; flex: 0 0 auto;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.pw-cur-lbl {
    font-size: 11px; font-weight: 700; letter-spacing: 0.35px;
    text-transform: uppercase; opacity: 0.78; line-height: 1;
}
.pw-toggle-btn .pw-val-num {
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.pw-toggle-btn.is-active[data-cur="COINS"],
.pw-toggle-btn.is-active[data-cur="UGX"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="COINS"],
html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="UGX"] {
    background: var(--primary); color: var(--text-on-primary); font-weight: 700;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.28);
}
.pw-toggle-btn.is-active .pw-cur-lbl { opacity: 0.92; font-weight: 700; }
.pw-deck-actions {
    display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px;
    flex: 0 0 auto; margin-left: auto;
}
.pw-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; min-width: 38px; padding: 0 10px; box-sizing: border-box;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-card); color: var(--text-primary);
    font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.pw-icon-btn svg { display: block; flex-shrink: 0; }
.pw-icon-btn:hover { background: var(--bg-surface); }
.pw-icon-btn.is-guest { border-color: var(--primary); color: var(--primary); }
.pw-icon-lbl { display: none; }

/* Game switcher: clear 3-card control on phones with icons & multiplier badges */
.pw-nav-tabs {
    grid-template-columns: repeat(3, 1fr); gap: 6px;
    margin: 10px 12px 0; padding: 4px;
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
}
.pw-mode-btn {
    border: none; background: transparent; border-radius: 9px; padding: 7px 6px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.pw-mode-btn .m-ico { display: inline-flex; align-items: center; color: var(--text-secondary); }
.pw-mode-btn .m-title { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.15; }
.pw-mode-btn .m-sub { display: block; font-size: 11px; font-weight: 600; color: var(--gold); line-height: 1.15; }
.pw-mode-btn.is-active { background: var(--primary); border: none; box-shadow: 0 2px 6px rgba(29, 78, 216, 0.28); }
.pw-mode-btn.is-active .m-ico,
.pw-mode-btn.is-active .m-title { color: var(--text-on-primary); font-weight: 700; }
.pw-mode-btn.is-active .m-sub { color: #FDE68A; opacity: 1; }

/* Arena: tighter ladder, quiet status line, fewer extras */
.pw-arena-card { margin: 10px 12px 12px; border-radius: 12px; }
.pen-ladder-bar { padding: 6px 8px; gap: 4px; }
.pen-ladder-step { padding: 4px 2px; font-size: 13px; font-weight: 600; border-radius: 6px; }
.pen-ladder-step small { font-size: 12px; font-weight: 400; opacity: 0.75; }
.pen-hud-row { font-size: 13px; padding: 8px 12px; }
#pen-status-txt, #spin-status-txt { font-weight: 400; }
.pw-slip { padding: 12px; }
.pw-chips-bar { gap: 6px; }
.pw-chip-opt { font-size: 13px; font-weight: 500; }

/* Live wins sits below the game on phones, as a quiet line */
.pw-item-empty { color: var(--text-muted); }
.pw-tick-badge, html[data-theme="dark"] .pw-tick-badge {
    background: transparent; color: var(--text-primary); border: none;
    padding: 0; font-size: 13px; font-weight: 600;
}
.pw-ticker-bar { padding: 9px 12px; }
#lbl-stake-cur { white-space: nowrap; font-size: 12px; }
.wheel-tap-pill { display: none; } /* duplicate of the hint under the wheel */

/* Rewarding feel: free-coins-ready pulse, balance glow on wins, confetti layer */
.pw-icon-btn.is-ready { border-color: var(--gold); color: var(--gold); position: relative; }
.pw-icon-btn.is-ready::after {
    content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--gold); box-shadow: 0 0 0 2px var(--bg-card); animation: pwReadyDot 1.6s ease-in-out infinite;
}
@keyframes pwReadyDot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.pw-val-num { transition: color 0.3s ease; }
.pw-val-num.is-up { color: var(--gold); }
.pw-toggle-btn.is-active .pw-val-num.is-up { color: #FDE68A; }
.pw-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }
@media (prefers-reduced-motion: reduce) { .pw-icon-btn.is-ready::after { animation: none; } }

@media (max-width: 1023px) {
    .pw-page { display: flex; flex-direction: column; }
    .pw-deck { order: 1; }
    .pw-nav-tabs { order: 2; }
    .pw-arena-card { order: 3; }
    .pw-ticker-bar { order: 4; margin: 0 12px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
    .pw-sub-card { order: 5; margin: 0 12px; }
    .wheel-picks-tray { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; padding-top: 10px; }
    .wheel-pick-pill { flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 6px; }
    .wheel-pick-name { margin-left: 0; font-size: 10px; }
}

/* Desktop: icon buttons show their labels; game list keeps icons and subtitles */
@media (min-width: 1024px) {
    .pw-icon-lbl { display: inline; }
    .pw-icon-btn { padding: 0 12px; }
    .pw-nav-tabs { margin: 0; padding: 0; background: transparent; border: none; gap: 8px; }
    .pw-mode-btn { border: 1px solid var(--border); background: var(--bg-card); padding: 12px 14px; border-radius: 10px; align-items: flex-start; }
    .pw-mode-btn .m-ico { display: inline-flex; }
    .pw-mode-btn .m-sub { display: block; }
    .pw-mode-btn.is-active { background: var(--primary); border-color: var(--primary); box-shadow: none; }
    .pw-mode-btn.is-active .m-title { color: var(--text-on-primary); }
    .pw-mode-btn.is-active .m-sub { color: #FDE68A; }
}

/* Desktop: three panels — game list | game stage | recent wins + history/leaderboard */
@media (min-width: 1024px) {
    .pw-page {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr) 330px;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "deck  deck  deck"
            "games stage wins"
            "games stage side";
        gap: 16px;
        align-items: start;
        background: transparent;
        padding-bottom: 8px;
    }
    .pw-deck { grid-area: deck; border: 1px solid var(--border); border-radius: 12px; }
    .pw-deck .pw-deck-row:last-child { margin-bottom: 0; }

    .pw-nav-tabs {
        grid-area: games;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0;
        position: sticky;
        top: 72px;
    }
    .pw-nav-tabs::before {
        content: 'Games';
        font-size: 12px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: none;
        letter-spacing: 0.5px;
        padding: 0 4px 2px;
    }
    .pw-mode-btn {
        display: grid;
        grid-template-columns: 22px 1fr;
        grid-template-rows: auto auto;
        column-gap: 10px;
        align-items: center;
        text-align: left;
        padding: 12px 14px;
        border-radius: 10px;
    }
    .pw-mode-btn .m-ico { grid-row: 1 / span 2; display: inline-flex; justify-content: center; }
    .pw-mode-btn .m-title { font-size: 13px; }
    .pw-mode-btn .m-sub { font-size: 12px; }

    .pw-arena-card { grid-area: stage; margin: 0; }

    /* Winners ticker becomes the vertical "Recent wins" card */
    .pw-ticker-bar {
        grid-area: wins;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow: hidden;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
    }
    .pw-tick-badge,
    html[data-theme="dark"] .pw-tick-badge {
        align-self: stretch;
        justify-content: flex-start;
        gap: 8px;
        border-radius: 0;
        padding: 10px 12px;
        font-size: 13px;
        font-weight: 700;
        text-transform: none;
        background: transparent;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-subtle);
    }
    .pw-tick-items {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        white-space: normal;
        max-height: 300px;
        overflow-y: auto;
    }
    .pw-item-chip {
        border: none;
        border-top: 1px solid var(--border-subtle);
        border-radius: 0;
        padding: 8px 12px;
        font-size: 13px;
        flex-wrap: wrap;
    }
    .pw-item-chip:first-child { border-top: none; }
    .pw-item-chip + .pw-item-chip::before { content: none; }

    .pw-sub-card { grid-area: side; margin: 0; }
    .pw-sub-card .pw-tbl { font-size: 12px; }
    .pw-sub-card .pw-tbl th, .pw-sub-card .pw-tbl td { padding: 7px 6px; }
    /* Fairness hash column is too wide for the side panel; full seed stays in the tooltip on mobile */
    #sec-pane-history .pw-tbl th:nth-child(5), #sec-pane-history .pw-tbl td:nth-child(5) { display: none; }
}

/* ==========================================================================
   New player path: see Deposit, pay from one sheet, then bet
   ========================================================================== */
/* Deposit is the primary highlighted action in the account bar */
.pw-btn-deposit {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 38px; padding: 0 14px; box-sizing: border-box; border: none; border-radius: 10px;
    background: var(--gold); color: var(--gold-text);
    font: inherit; font-size: 13px; font-weight: 700; line-height: 1;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}
.pw-btn-deposit:active { transform: scale(0.98); }
#btn-claim-coins .pw-icon-lbl-sm { display: inline; font-size: 12px; font-weight: 600; line-height: 1; }
@media (min-width: 1024px) {
    #btn-claim-coins .pw-icon-lbl-sm { display: none; }
}
@media (max-width: 560px) {
    .pw-deck { padding: 8px 10px; }
    .pw-toggle-cur { height: 34px; padding: 2px; gap: 2px; }
    .pw-toggle-btn,
    .pw-toggle-btn.is-active[data-cur="COINS"],
    .pw-toggle-btn.is-active[data-cur="UGX"],
    html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="COINS"],
    html[data-theme="dark"] .pw-toggle-btn.is-active[data-cur="UGX"] {
        height: 28px; padding: 0 9px; font-size: 12px; gap: 5px;
    }
    .pw-cur-lbl { font-size: 10.5px; }
    .pw-toggle-btn .pw-val-num { font-size: 12px; }
    .pw-deck-actions { gap: 5px; }
    .pw-icon-btn { height: 34px; min-width: 34px; padding: 0 8px; }
    .pw-btn-deposit { height: 34px; padding: 0 11px; font-size: 12px; }
    #btn-claim-coins .pw-icon-lbl-sm { display: none; }
}

/* Mobile Money badges (MTN MoMo & Airtel Money) */
.pw-momo-badges { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pw-momo-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.3;
}
.pw-momo-pill.is-mtn { background: #FFCC00; color: #111827; }
.pw-momo-pill.is-airtel { background: #E11D48; color: #FFFFFF; }

/* New-user onboarding banner: 1-2-3 path to deposit & win real UGX */
.pw-start {
    display: flex; align-items: stretch; gap: 6px; margin-top: 10px;
}
.pw-start[hidden] { display: none; }
.pw-start-steps {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px; border: 1px solid rgba(245, 158, 11, 0.45); border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.10) 0%, var(--bg-surface) 75%);
    color: var(--text-primary);
    font: inherit; text-align: left; cursor: pointer;
    transition: border-color 0.15s ease, transform 0.12s ease;
}
.pw-start-steps:hover { border-color: var(--gold); }
.pw-start-steps:active { transform: scale(0.995); }
.pw-start-top {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.pw-start-headline {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.pw-start-cta {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--gold); color: var(--gold-text);
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pw-start-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
.pw-step { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pw-step i {
    flex: none; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
}
.pw-step.is-now i { background: var(--gold); border-color: transparent; color: var(--gold-text); }
.pw-step-txt { min-width: 0; }
.pw-step-txt b { display: block; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-step-txt small { display: block; font-size: 11px; line-height: 1.25; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-start-x {
    flex: none; width: 28px; border: none; background: transparent; color: var(--text-muted);
    font: inherit; font-size: 18px; line-height: 1; cursor: pointer; border-radius: 8px;
}
.pw-start-x:hover { background: var(--bg-surface); color: var(--text-primary); }

/* Sheets: forms slide up from the bottom on phones, with inputs big enough to tap (16px stops iOS zooming in) */
.pw-modal-box { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.pw-modal-box h3 .icon-toggle { flex: none; }
.pw-form-group input, .pw-form-group select { font-size: 16px; padding: 11px 12px; border-radius: 10px; }
.pw-form-group small { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; color: var(--text-secondary); }
.pw-more { margin: 0 0 12px; }
.pw-more summary { font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; padding: 6px 0; }
.pw-more[open] summary { margin-bottom: 8px; }
@media (max-width: 640px) {
    .pw-modal-overlay { align-items: flex-end; padding: 0; }
    .pw-modal-box {
        max-width: none; border-radius: 18px 18px 0 0; border-bottom: 0;
        padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        max-height: 92vh; max-height: 92dvh;
        animation: pwSheetUp 0.22s ease-out;
    }
}
@keyframes pwSheetUp { from { transform: translateY(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pw-modal-box { animation: none; } }

/* Cash wallet sheet */
.pw-wallet-bal { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; }
.pw-wallet-bal b { color: var(--text-primary); font-size: 15px; font-variant-numeric: tabular-nums; }
.pw-seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin-bottom: 14px;
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
}
.pw-seg-btn {
    border: none; background: transparent; color: var(--text-secondary);
    font: inherit; font-size: 14px; font-weight: 500; padding: 9px 8px; border-radius: 8px; cursor: pointer;
}
.pw-seg-btn.is-active { background: var(--primary); color: var(--text-on-primary); font-weight: 600; }
.pw-wallet-from {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface);
    font-size: 13px; color: var(--text-secondary);
}
.pw-wallet-from[hidden], #wallet-link[hidden] { display: none; }
.pw-wallet-from b { color: var(--text-primary); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pw-wallet-change {
    border: 1px solid var(--border); background: var(--bg-card); color: var(--primary);
    font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer;
}
.pw-wallet-change:hover { background: var(--primary-soft); }
.pw-label-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px;
}
.pw-label-row label { margin-bottom: 0; }
.pw-phone-cc {
    flex: none; display: inline-flex; align-items: center; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface);
    color: var(--text-secondary); font-size: 16px; font-weight: 600;
}
.pw-amt-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.pw-amt-chips:empty { display: none; }
.pw-amt-chip {
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary);
    font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
    padding: 10px 4px; border-radius: 10px; cursor: pointer;
}
.pw-amt-chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pw-wallet-how { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-secondary); text-align: center; }
.pw-wallet-wait {
    display: grid; justify-items: center; gap: 8px; text-align: center;
    padding: 18px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface);
}
.pw-wallet-wait[hidden] { display: none; }
.pw-wallet-wait b { font-size: 16px; }
.pw-wallet-wait span { font-size: 13px; line-height: 1.45; color: var(--text-secondary); max-width: 310px; }
.pw-wait-actions {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; margin-top: 6px;
}
.pw-wait-btn {
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary);
    font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer;
}
.pw-wait-btn.is-primary {
    border-color: var(--primary); background: var(--primary); color: var(--text-on-primary);
}
.pw-wait-btn:hover { filter: brightness(1.04); }
.pw-spin {
    width: 28px; height: 28px; border-radius: 50%; margin-bottom: 4px;
    border: 3px solid var(--border); border-top-color: var(--gold); animation: pwSpin 0.9s linear infinite;
}
@keyframes pwSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pw-spin { animation-duration: 3s; } }

/* Messages show at the top, clear of the pinned Start / Cash out bar, the sheet buttons and the tab bar */
.pw-toast-notice { max-width: calc(100vw - 24px); width: max-content; text-align: center; border-radius: 14px; line-height: 1.35; bottom: auto !important; top: calc(12px + env(safe-area-inset-top, 0px)); }
@media (min-width: 1024px) {
    .pw-toast-notice { top: 76px; max-width: 520px; }
}

/* Stake controls while a round is running: clearly locked, and the row fits inside the card on narrow phones */
.pw-chip-opt:disabled, #pw-stake-input:disabled { opacity: 0.45; cursor: not-allowed; }
.pw-slip.is-locked #lbl-stake-cur::after { content: " 🔒"; font-weight: 500; }
.pw-slip-input-row .pw-input-box { min-width: 0; }
.pw-slip-input-row .pw-input-box input { width: auto; min-width: 0; flex: 1; }
.pw-slip-input-row > div:last-child { flex: none; }

/* Light play zone: white text on the default amber is only 3.2:1. A deeper amber reads clearly (5:1). */
html.zone-play:not([data-theme="dark"]) { --gold: #B45309; }

/* Small phones: the first screen should show the game, not three rows of chrome */
@media (max-width: 420px) {
    .pw-toggle-btn:not(.is-active) .pw-val-num { display: none; }   /* balance of the side you are not playing */
    .pw-start-headline .pw-momo-badges { display: none; }
    .pw-start-steps { padding: 8px 10px; gap: 6px; }
    .pw-start { margin-top: 8px; }
}
@media (max-width: 1023px) {
    /* The pinned bar keeps stake + chips + button; the payout line stays, the duplicate "switch" link goes
       (the balance switch and Deposit button above do the same job) */
    .pw-slip-switch { display: none; }
    .pw-slip-meta { padding: 5px 10px; min-height: 0; }
    .pw-nav-tabs { margin-top: 8px; }
    .pw-mode-btn .m-sub { font-size: 11px; }

    /* First screen on a phone: balance, Start controls and the game together, no scrolling */
    .pw-start-grid { display: none; }                         /* the 1-2-3 steps; the Deposit button and banner stay */
    .pw-start-steps { padding: 7px 10px; gap: 0; }
    .pw-start { margin-top: 6px; }
    .pw-mode-btn .m-ico { display: none; }
    .pw-mode-btn { padding: 6px 4px; }
    .pw-nav-tabs { margin: 6px 12px 0; }
    .pw-arena-card { margin-top: 8px; margin-bottom: 8px; }
    .pen-ladder-bar { padding: 5px 6px; }
    .pen-ladder-step small { display: none; }                 /* "Kick 1" label: the order is obvious */
    .pen-ladder-step { padding: 3px 2px; }
    .pw-cta .pw-btn-main { padding: 10px 16px; }
}
@media (max-width: 1023px) and (max-height: 780px) {
    .pw-slip-meta { display: none; }                          /* payout line: the ladder above already shows the payouts */
}
@media (max-width: 1023px) and (max-height: 780px) {
    /* The wheel shrinks with the screen height so it is never hidden behind the pinned Spin bar */
    .wheel-disc-wrap { width: clamp(160px, calc(100vh - 448px), 262px); height: clamp(160px, calc(100vh - 448px), 262px); }
}
@media (max-width: 1023px) and (max-height: 700px) {
    .pw-start { display: none; }                              /* very short screens: the Deposit button is enough */
    #crash-svg { max-height: 150px; }
}
@media (max-width: 420px) {
    #crash-auto-input { display: none; }   /* the 1.5x to 10x presets cover it; keeps auto cash-out on one line */
}

.pw-toast-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #0F172A;
    color: #F8FAFC;
    border: 1px solid var(--green);
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    z-index: 300;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    display: none;
}
