/* ═══════════════════════════════════════════════════════════
   NEON SPIN 10  |  Ultra-Premium Casino Design System v3
   Real assets used — bg.jpg, tiles.jpg, chips.jpg
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Hind:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --gold:        #d4a843;
    --gold-light:  #f5d98b;
    --gold-dark:   #8b6914;
    --gold-glow:   rgba(212, 168, 67, 0.45);
    --crimson:     #8b1a1a;
    --emerald:     #0d3d20;
    --bg-deep:     #060709;
    --bg-panel:    rgba(10, 12, 18, 0.85);
    --border-gold: rgba(212, 168, 67, 0.25);
    --text-bright: #f5ead0;
    --text-muted:  #6b7280;

    --font-casino:  'Cinzel', 'Hind', serif;
    --font-ui:      'Outfit', 'Hind', sans-serif;
    --font-digital: 'Space Grotesk', 'Hind', sans-serif;

    /* legacy compat */
    --accent: #d4a843;
    --accent-glow: rgba(212,168,67,0.4);
    --green: #10b981;
    --green-glow: rgba(16,185,129,0.4);
    --pink: #ec4899;
    --pink-glow: rgba(236,72,153,0.4);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6,182,212,0.4);
    --felt-green: #071f15;
    --felt-border: #143525;
    --text-primary: #f5ead0;
    --bg-panel-border: rgba(212,168,67,0.18);
    --font-primary: 'Outfit', 'Hind', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
html, body {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    width: 100vw; height: 100vh;
    width: 100vw; height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overscroll-behavior: none;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-bright);
    font-family: var(--font-ui);
    display: flex;
    justify-content: center;
    align-items: center;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -9999;
    background: 
        linear-gradient(rgba(6, 7, 9, 0.68), rgba(6, 7, 9, 0.82)),
        url('bg.jpg') center/cover no-repeat fixed;
    pointer-events: none;
}

/* ─── APP CONTAINER WITH IPHONE NOTCH SAFE-AREA INSET SUPPORT ─── */
.app-container {
    width: 100%;
    max-width: 1600px;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    /* Side + bottom safe area insets; TOP is handled by winners-ticker-wrap */
    padding: 0 max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   SMOOTH ORIENTATION TRANSITION
   Animates layout reflow when phone rotates
═══════════════════════════════════════════ */
.game-header,
.game-layout,
.wheel-panel,
.controls-panel,
.wheel-outer-ring,
#wheel-canvas,
.countdown-wrapper,
.stat-box,
.stats-bar,
.logo-area,
.header-controls,
.dashboard-card,
.bet-grid,
.chip-container {
    transition:
        width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.28s ease,
        opacity 0.25s ease;
}

/* Flash overlay during rotation for extra polish */
@keyframes rotateFlash {
    0%   { opacity: 1; }
    40%  { opacity: 0.6; }
    100% { opacity: 1; }
}
body.is-rotating .app-container {
    animation: rotateFlash 0.4s ease forwards;
}

/* ═══════════════════════════════════════════
   HEADER — Luxury gold-ruled bar
═══════════════════════════════════════════ */
.game-header {
    background: linear-gradient(90deg,
        rgba(8,9,14,0.95) 0%,
        rgba(20,17,10,0.95) 50%,
        rgba(8,9,14,0.95) 100%);
    border: 1px solid var(--border-gold);
    border-top: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    backdrop-filter: blur(20px);
    border-radius: 0;
    padding: 0.35rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Strict single row on all resolutions */
    gap: 0.4rem;
    box-shadow:
        0 4px 30px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(212,168,67,0.1),
        0 0 60px rgba(212,168,67,0.04);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
}

/* Brand logo */
.brand-logo, .logo-area {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.logo-icon {
    width: clamp(24px, 2.5vw, 36px);
    height: clamp(24px, 2.5vw, 36px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    box-shadow: 0 0 14px var(--gold-glow);
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-casino);
    font-size: clamp(0.75rem, 1.4vw, 1.35rem);
    font-weight: 900;
    letter-spacing: clamp(1px, 0.2vw, 3px);
    text-transform: uppercase;
    background: linear-gradient(to right, #f5d98b 0%, #d4a843 50%, #8b6914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    white-space: nowrap;
}

.logo-accent { color: var(--gold); }

.live-badge {
    font-family: var(--font-ui);
    font-size: clamp(0.45rem, 0.65vw, 0.6rem);
    font-weight: 800;
    letter-spacing: 1px;
    color: #0a0a0a;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(34,197,94,0.5);
    animation: livePulse 2s ease-in-out infinite;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%,100% { box-shadow: 0 0 8px rgba(34,197,94,0.4); }
    50%      { box-shadow: 0 0 18px rgba(34,197,94,0.8); }
}

/* Stats bar - Flexible & Non-wrapping */
.stats-bar {
    display: flex;
    gap: 0;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.stat-box {
    padding: 0 clamp(0.3rem, 1vw, 1.2rem);
    border-right: 1px solid rgba(212,168,67,0.15);
    text-align: center;
    flex-shrink: 1;
    min-width: 0;
}

.stat-box:first-child { border-left: 1px solid rgba(212,168,67,0.15); }

.stat-label {
    font-size: clamp(0.45rem, 0.6vw, 0.58rem);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.1rem;
    white-space: nowrap;
}

.stat-value {
    font-family: var(--font-digital);
    font-size: clamp(0.75rem, 1.1vw, 1.05rem);
    font-weight: 700;
    color: var(--gold);
    display: block;
    white-space: nowrap;
}

#stat-balance { color: #4ade80; }
#last-win-display { color: var(--gold); }

/* Header controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.8vw, 0.75rem);
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    color: var(--text-bright);
    flex-shrink: 0;
}

.profile-name {
    font-weight: 700;
    color: var(--gold-light);
    white-space: nowrap;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-size: clamp(0.55rem, 0.75vw, 0.65rem);
    font-weight: 800;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    cursor: pointer;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.player-badge {
    font-family: var(--font-casino);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--gold-light);
    padding: 0.3rem 0.8rem;
    background: rgba(212,168,67,0.08);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    white-space: nowrap;
}

/* Icon buttons */
.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    background: rgba(212,168,67,0.06);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(212,168,67,0.15);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Logout / small btns */
.btn-sm {
    font-family: var(--font-casino);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    background: rgba(139,26,26,0.3);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.25);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-sm:hover {
    background: rgba(139,26,26,0.5);
    box-shadow: 0 0 10px rgba(239,68,68,0.3);
}

/* ═══════════════════════════════════════════
   MAIN GAME LAYOUT
═══════════════════════════════════════════ */
.game-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
    align-items: stretch;
}

/* ─── LEFT PANEL — Wheel ─── */
.wheel-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    min-height: 0;
    justify-content: space-between;
}

.wheel-panel {
    background: 
        linear-gradient(rgba(10, 12, 18, 0.72), rgba(15, 12, 6, 0.82)),
        url('felt.jpg') center/cover;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(212,168,67,0.1),
        0 0 0 1px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.wheel-panel::before {
    content: '';
    position: absolute;
    top: -60px; left: 50%;
    transform: translateX(-50%);
    width: 300px; height: 180px;
    background: radial-gradient(ellipse, rgba(212,168,67,0.06), transparent 70%);
    pointer-events: none;
}

.wheel-outer-ring {
    position: relative;
    flex: 1;
    min-height: 0;
    min-width: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    max-width: 520px;
    max-height: 520px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: transparent;
    display: block;
    margin: 0 auto;
}

/* Lobby Announcement Marquee Banner */
.lobby-marquee-banner {
    background: rgba(212, 168, 67, 0.08);
    border-bottom: 1.5px solid rgba(212, 168, 67, 0.25);
    color: var(--gold-light);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    overflow: hidden;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: inset 0 -5px 15px rgba(0,0,0,0.5);
    z-index: 100;
    position: relative;
}
.lobby-marquee-banner marquee {
    vertical-align: middle;
}

/* Announcement banner */
.announcement-banner {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    background: rgba(212,168,67,0.05);
    border: 1px solid rgba(212,168,67,0.12);
}

.announcement-banner.win-flash {
    background: linear-gradient(135deg, rgba(212,168,67,0.15), rgba(245,217,139,0.08));
    border-color: rgba(212,168,67,0.5);
    animation: winFlash 0.5s ease-out;
    box-shadow: 0 0 30px rgba(212,168,67,0.2);
}

@keyframes winFlash {
    0%   { box-shadow: 0 0 0px rgba(212,168,67,0.6); }
    50%  { box-shadow: 0 0 40px rgba(212,168,67,0.8); }
    100% { box-shadow: 0 0 30px rgba(212,168,67,0.2); }
}

#announcement-text {
    font-family: var(--font-casino);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-light);
    text-transform: uppercase;
}

/* ─── Countdown Ring ─── */
.timer-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(212,168,67,0.1);
    border-radius: 12px;
}

.countdown-wrapper {
    position: relative;
    width: 80px; height: 80px;
    flex-shrink: 0;
    margin: 0.2rem 0;
}

.countdown-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.countdown-wrapper svg { transform: rotate(-90deg); }

.ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke: var(--gold);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 427.26;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.6s linear, stroke 0.4s;
}

.countdown-wrapper.urgent .ring-progress {
    stroke: #ef4444;
}

.countdown-wrapper.spinning .ring-progress {
    stroke: var(--cyan);
    animation: spinRing 1s linear infinite;
}

@keyframes spinRing { to { stroke-dashoffset: -427.26; } }

.countdown-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

#timer-seconds {
    font-family: var(--font-digital);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}

.countdown-wrapper.urgent #timer-seconds { color: #ef4444; text-shadow: 0 0 8px rgba(239,68,68,0.5); }
.countdown-wrapper.spinning #timer-seconds { color: var(--cyan); font-size: 1.05rem; text-shadow: 0 0 8px rgba(6,182,212,0.5); }

.countdown-label {
    font-family: var(--font-casino);
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1px;
    white-space: nowrap;
}

/* Absolute top-right close buttons on popup modals */
.modal-close-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(212, 168, 67, 0.35);
    color: var(--gold);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.modal-close-btn:hover {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.4);
}

.countdown-unit {
    font-size: 0.5rem;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}


.timer-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.timer-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════
/* ═══════════════════════════════════════════
   RIGHT PANEL — controls-panel Grid
═══════════════════════════════════════════ */
.controls-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0.4rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.history-card {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    padding: 0.3rem 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.active-bets-card {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding: 0.3rem 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.betting-card {
    grid-column: 1 / span 2;
    grid-row: 2;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chips-card {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    overflow: hidden;
}

.autobet-card {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    overflow: hidden;
}

/* Dashboard cards */
.dashboard-card {
    background: linear-gradient(135deg,
        rgba(10, 12, 18, 0.98) 0%,
        rgba(16, 12, 6, 0.98) 100%);
    border: 1.5px solid var(--gold);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    box-shadow:
        0 8px 20px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid rgba(212,168,67,0.08);
    flex-wrap: nowrap;
    gap: 0.2rem;
    white-space: nowrap;
}

.card-header h2 {
    font-family: var(--font-casino);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--gold-light);
    text-transform: uppercase;
    white-space: nowrap;
}

.helper-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ─── Spin History ─── */
.history-list {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    align-items: center;
    flex: 1;
    min-height: 0;
    padding: 0.15rem 0;
}

.history-empty {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

.history-chip {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-digital);
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid;
}

.history-chip.odd {
    background: radial-gradient(circle, #3d0e0e, #1a0606);
    border-color: rgba(220,38,38,0.5);
    color: #fca5a5;
}

.history-chip.even {
    background: radial-gradient(circle, #0d3520, #071510);
    border-color: rgba(34,197,94,0.4);
    color: #86efac;
}

.stat-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.stat-badge {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
}

.odd-badge  { background: rgba(220,38,38,0.15); color: #fca5a5; border: 1px solid rgba(220,38,38,0.3); }
.even-badge { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.25); }

/* ─── BETTING BOARD ─── */
.bet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    background: radial-gradient(circle, #092415 0%, #030e08 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 0.5rem;
    flex: 1;
    min-height: 0;
    height: 100%;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.bet-btn {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    border: 1.5px solid rgba(212, 168, 67, 0.35);
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.5), 
        inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Alternating segment colors on the betting board */
/* Odd numbers: Crimson Red segments */
.bet-btn.number-1, .bet-btn.number-3, .bet-btn.number-5, .bet-btn.number-7, .bet-btn.number-9 {
    background: linear-gradient(to bottom, #991b1b 0%, #7f1d1d 50%, #450a0a 100%);
}

/* Even numbers: Forest Emerald segments */
.bet-btn.number-2, .bet-btn.number-4, .bet-btn.number-6, .bet-btn.number-8, .bet-btn.number-10 {
    background: linear-gradient(to bottom, #065f46 0%, #064e3b 50%, #022c22 100%);
}

.bet-btn .num-val {
    display: block !important;
    font-family: var(--font-casino);
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fef08a 0%, #ca8a04 50%, #854d0e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.85));
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.bet-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2.5px solid transparent;
    border-radius: 6px;
    background: transparent;
    transition: all 0.15s ease;
    z-index: 1;
}

.bet-btn:hover::before {
    border-color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
    box-shadow: inset 0 0 10px rgba(212, 168, 67, 0.4);
}

.bet-val {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 3;
    font-family: var(--font-digital);
    font-size: 0.58rem;
    font-weight: 900;
    color: #fff;
    background: radial-gradient(circle, #ca8a04 0%, #854d0e 100%);
    border: 1.5px dashed #fef08a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.5), 
        inset 0 0.5px 0 rgba(255,255,255,0.4);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    animation: chipPlace 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chipPlace {
    from { transform: scale(1.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bet-btn:hover { transform: translateY(-4px) scale(1.05); filter: brightness(1.2); }

.bet-btn:active {
    transform: translateY(0px) scale(0.97);
}

.bet-btn.winner-highlight::before {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
    animation: tileWin 0.4s ease-out infinite alternate;
}

@keyframes tileWin {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.4); }
}

.hidden { display: none !important; }

/* ─── PLACED BIDS panel ─── */
.active-bets-list {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 0.15rem 0;
}

.active-bets-empty {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

.active-bet-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 168, 67, 0.25);
    border-radius: 20px;
    padding: 0.15rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

.active-bet-num {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 850;
    color: #fff;
}

.active-bet-num.odd { background: #991b1b; }
.active-bet-num.even { background: #064e3b; }

.active-bet-amount {
    color: #4ade80;
    font-family: var(--font-digital);
}

/* ─── CHIP SELECTOR ─── */
.chip-container {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    justify-content: space-around;
    align-items: center;
    padding: 0.45rem 0.25rem 0.35rem 0.25rem;
    background: rgba(0,0,0,0.55);
    border-radius: 40px;
    border: 1px solid rgba(212,168,67,0.18);
    margin-bottom: 0.3rem;
    overflow: visible !important;
    position: relative;
    z-index: 5;
}

.chip-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px dashed #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chip-btn .chip-inner {
    font-family: var(--font-digital);
    font-size: 0.65rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.2);
}

/* Chip color variants matching casino standard colors */
.chip-btn[data-value="10"] {
    background: radial-gradient(circle, #ef4444 0%, #b91c1c 100%);
    border-color: rgba(254, 226, 226, 0.5);
}
.chip-btn[data-value="10"] .chip-inner { background: #991b1b; }

.chip-btn[data-value="20"] {
    background: radial-gradient(circle, #3b82f6 0%, #1d4ed8 100%);
    border-color: rgba(219, 234, 254, 0.5);
}
.chip-btn[data-value="20"] .chip-inner { background: #1e40af; }

.chip-btn[data-value="50"] {
    background: radial-gradient(circle, #10b981 0%, #047857 100%);
    border-color: rgba(209, 250, 229, 0.5);
}
.chip-btn[data-value="50"] .chip-inner { background: #065f46; }

.chip-btn[data-value="100"] {
    background: radial-gradient(circle, #4b5563 0%, #1f2937 100%);
    border-color: rgba(243, 244, 246, 0.5);
}
.chip-btn[data-value="100"] .chip-inner { background: #111827; }

.chip-btn[data-value="1000"] {
    background: radial-gradient(circle, #8b5cf6 0%, #6d28d9 100%);
    border-color: rgba(212, 168, 67, 0.6);
}
.chip-btn[data-value="1000"] .chip-inner { background: #581c87; border-color: var(--gold); }

.chip-btn:hover {
    transform: translateY(-8px) scale(1.12);
    box-shadow: 
        0 12px 28px rgba(0,0,0,0.8), 
        0 0 20px var(--gold-glow);
    border-color: rgba(212, 168, 67, 0.6);
}

.chip-btn.active {
    border-color: var(--gold);
    box-shadow: 
        0 0 0 3px var(--gold-glow), 
        0 6px 16px rgba(0,0,0,0.8);
    transform: translateY(-3px) scale(1.06);
    z-index: 10;
    position: relative;
}

.chip-btn:active { transform: translateY(0) scale(0.96); }

/* ─── ACTION BUTTONS ─── */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.3rem;
}

.action-btn {
    font-family: var(--font-casino);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.45rem 0.2rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(212,168,67,0.45);
    transition: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left 0.4s ease;
}

.action-btn:hover::before { left: 100%; }

.btn-secondary {
    background: linear-gradient(to bottom, #2b271d 0%, #17140e 50%, #0d0a06 100%);
    color: var(--gold-light);
    box-shadow: 
        0 4px 0 #000, 
        0 8px 15px rgba(0,0,0,0.5), 
        inset 0 1px 0 rgba(255,255,255,0.05),
        inset 0 -1px 2px rgba(0,0,0,0.4);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #3b3527 0%, #231f15 50%, #15110b 100%);
    color: #fff;
    border-color: var(--gold);
    box-shadow: 
        0 4px 0 #000, 
        0 10px 20px rgba(0,0,0,0.6), 
        0 0 8px var(--gold-glow),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 
        0 1px 0 #000, 
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 2px 5px rgba(0,0,0,0.5);
}

.btn-primary {
    background: linear-gradient(to bottom, #d4a843 0%, #b38622 50%, #87600f 100%);
    color: #0c0802;
    font-weight: 900;
    border-color: rgba(255,255,255,0.2);
    box-shadow: 
        0 4px 0 #4f3408, 
        0 8px 15px rgba(0,0,0,0.6), 
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -1px 2px rgba(0,0,0,0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #fad26a 0%, #d4a843 50%, #ad7e18 100%);
    color: #000;
    box-shadow: 
        0 4px 0 #4f3408, 
        0 10px 20px rgba(0,0,0,0.7), 
        0 0 12px var(--gold-glow),
        inset 0 1px 0 rgba(255,255,255,0.45);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 
        0 1px 0 #4f3408, 
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 2px 5px rgba(0,0,0,0.6);
}

.action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════
   AUTO-BET PANEL
═══════════════════════════════════════════ */
.autobet-card {
    border-color: rgba(212,168,67,0.2);
    background: linear-gradient(135deg,
        rgba(8,9,14,0.97) 0%,
        rgba(20,15,5,0.97) 100%);
}

.autobet-controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    transition: opacity 0.3s;
}

.autobet-controls.autobet-running { opacity: 0.5; pointer-events: none; }

.autobet-row {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 0.4rem;
}

.autobet-field { display: flex; flex-direction: column; gap: 0.2rem; }

.autobet-field label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: var(--font-casino);
}

.autobet-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid rgba(212, 168, 67, 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.autobet-input-wrap:focus-within {
    border-color: var(--gold);
    box-shadow: 
        0 0 10px rgba(212,168,67,0.3),
        inset 0 2px 4px rgba(0,0,0,0.5);
}

.input-prefix, .input-suffix {
    padding: 0.25rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(212,168,67,0.06);
    flex-shrink: 0;
}

.autobet-input-wrap input[type="number"] {
    flex: 1; background: transparent; border: none;
    color: var(--text-bright);
    font-family: var(--font-digital);
    font-size: 0.78rem; font-weight: 700;
    padding: 0.25rem 0.4rem; outline: none;
    width: 100%; min-width: 0;
    -moz-appearance: textfield;
}

.autobet-input-wrap input[type="number"]::-webkit-outer-spin-button,
.autobet-input-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.autobet-info { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.payout-tag, .rtp-tag {
    font-size: 0.62rem; font-weight: 700;
    padding: 0.15rem 0.45rem; border-radius: 20px;
}

.payout-tag {
    background: rgba(212,168,67,0.08);
    border: 1px solid rgba(212,168,67,0.2);
    color: var(--gold);
}

.payout-tag strong { color: var(--gold-light); }

.rtp-tag {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #34d399;
}

.rtp-tag strong { color: #6ee7b7; }

/* Auto bet start button */
.autobet-btn {
    width: 100%;
    font-family: var(--font-casino);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.35rem;
    background: linear-gradient(180deg, #3d2506 0%, #2a1904 100%);
    color: var(--gold-light);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.7);
    transition: all 0.15s;
    text-transform: uppercase;
}

.autobet-btn:hover {
    background: linear-gradient(180deg, #5a3710 0%, #3d2506 100%);
    box-shadow: 0 6px 0 rgba(0,0,0,0.7), 0 0 20px rgba(212,168,67,0.2);
    transform: translateY(-2px);
}

.autobet-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.5); }

.autobet-btn.autobet-active {
    background: linear-gradient(180deg, #4a0d0d 0%, #2d0606 100%);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
    animation: autobetPulse 1.5s ease-in-out infinite;
}

@keyframes autobetPulse {
    0%,100% { box-shadow: 0 4px 0 rgba(0,0,0,0.7), 0 0 8px rgba(239,68,68,0.15); }
    50%      { box-shadow: 0 4px 0 rgba(0,0,0,0.7), 0 0 22px rgba(239,68,68,0.5); }
}

/* ═══════════════════════════════════════════
   AUTH OVERLAY
═══════════════════════════════════════════ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(6,7,9,0.82), rgba(6,7,9,0.9)),
        url('bg.jpg') center/cover;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.auth-overlay > div {
    margin: auto;
}

.auth-card {
    background: linear-gradient(160deg, rgba(10,12,18,0.98), rgba(18,14,6,0.98));
    border: 1px solid var(--border-gold);
    border-top: 2px solid var(--gold);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 60px rgba(212,168,67,0.06);
}

#auth-title {
    font-family: var(--font-casino);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--gold-light);
    text-align: center;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
}

.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }

.form-group label {
    font-family: var(--font-casino);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-group input {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,168,67,0.15);
    border-radius: 8px;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212,168,67,0.2);
}

.submit-btn {
    width: 100%;
    font-family: var(--font-casino);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    padding: 0.85rem;
    background: linear-gradient(180deg, #b8881e 0%, #7a5808 100%);
    color: #fef3c7;
    border: 1px solid rgba(212,168,67,0.4);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 4px 0 rgba(0,0,0,0.6), 0 0 16px rgba(212,168,67,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: all 0.15s;
    text-transform: uppercase;
}

.submit-btn:hover {
    background: linear-gradient(180deg, #d4a437 0%, #9a7010 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.6), 0 0 24px rgba(212,168,67,0.4);
}

.error-msg {
    font-size: 0.72rem;
    color: #fca5a5;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.switch-form-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.switch-form-link a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.switch-form-link a:hover { text-decoration: underline; }

.blur-content { filter: blur(8px); pointer-events: none; }

/* Inline Auth Loading helpers to prevent FOUC / Flashing of login screen on page refresh */
.auth-loading .auth-overlay {
    display: none !important;
}
.auth-loading .blur-content {
    filter: none !important;
    pointer-events: auto !important;
}

/* ═══════════════════════════════════════════
   RULES MODAL
═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.modal-overlay > div {
    margin: auto;
}

.modal-card {
    background: linear-gradient(160deg, rgba(10,12,18,0.99), rgba(18,14,6,0.99));
    border: 1px solid var(--border-gold);
    border-top: 2px solid var(--gold);
    border-radius: 14px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

.modal-card h3 {
    font-family: var(--font-casino);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--gold-light);
    margin-bottom: 1.25rem;
    text-align: center;
    text-transform: uppercase;
}

.modal-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.modal-card li {
    font-size: 0.82rem;
    color: var(--text-bright);
    padding: 0.5rem 0.75rem;
    background: rgba(212,168,67,0.04);
    border-left: 2px solid var(--gold);
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.modal-card li strong { color: var(--gold); }

/* ═══════════════════════════════════════════
   WHEEL HUB OVERLAY (hub center counter)
═══════════════════════════════════════════ */
.wheel-hub-overlay { display: none; }

/* ═══════════════════════════════════════════
   CORNER UTILITY BUTTONS
═══════════════════════════════════════════ */
.corner-btns {
    position: fixed;
    bottom: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1001;
}

.corner-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(10, 12, 18, 0.85);
    border: 1px solid var(--gold);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 0 10px rgba(212,168,67,0.2);
    transition: all 0.2s ease;
}

.corner-btn:hover {
    background: var(--gold);
    color: #060709;
    box-shadow: 0 0 15px rgba(212,168,67,0.6);
    transform: scale(1.05);
}

.corner-btn svg {
    width: 18px;
    height: 18px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
    body {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
    }
    .app-container {
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }
    .game-layout {
        grid-template-columns: 1fr;
    }
    .controls-panel {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    .wheel-outer-ring { width: 100%; min-width: 240px; }
    .autobet-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .stats-bar .stat-box { padding: 0 0.75rem; }
    .stat-value { font-size: 0.9rem; }
    .wheel-outer-ring { width: 100%; min-width: 210px; }
    .bet-grid { gap: 0.3rem; padding: 0.4rem; }
    .chip-btn { width: 46px; height: 46px; }
    .game-header { padding: 0.5rem 1rem; }
}

/* ═══════════════════════════════════════════
   LUXURY CASINO LOBBY LANDING SCREEN
   ═══════════════════════════════════════════ */
.lobby-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    width: 90%;
    max-width: 960px;
    height: 520px;
    background: linear-gradient(135deg, rgba(10,12,18,0.98) 0%, rgba(20,15,5,0.98) 100%);
    border: 2px solid var(--gold);
    border-radius: 24px;
    box-shadow: 
        0 24px 70px rgba(0, 0, 0, 0.9), 
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 0 40px rgba(212,168,67,0.1);
    overflow: hidden;
    animation: lobbyFade 0.4s ease-out;
}

@keyframes lobbyFade {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lobby-brand-info {
    background: radial-gradient(circle at center, rgba(16, 44, 28, 0.9) 0%, rgba(8, 10, 14, 0.98) 100%);
    border-right: 1.5px solid rgba(212,168,67,0.3);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.lobby-brand-info::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(212,168,67,0.08);
    margin: 10px;
    border-radius: 14px;
    pointer-events: none;
}

.lobby-logo {
    font-family: var(--font-casino);
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #ffd875 0%, #d4a843 50%, #926b15 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    text-shadow: 0 4px 15px rgba(212, 168, 67, 0.2);
}

.lobby-subtitle {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--gold-light);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.game-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 1.8rem;
}

.highlight-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.highlight-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.highlight-desc {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.highlight-desc strong {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.highlight-desc span {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.lobby-notice {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.35);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(212,168,67,0.1);
    line-height: 1.4;
}

.lobby-auth-card {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    background-size: 200% 100%;
    animation: loading-slide 1.2s infinite linear;
    z-index: 10;
}

@keyframes loading-slide {
    0% { background-position: 150% 0; }
    100% { background-position: -150% 0; }
}

/* ═══════════════════════════════════════════
   MOBILE ROTATION BLOCKER OVERLAY
   ═══════════════════════════════════════════ */
#orientation-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #10121a 0%, #060709 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rotation-card {
    background: linear-gradient(135deg, rgba(16,18,25,0.95) 0%, rgba(8,9,14,0.95) 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 2rem;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 30px rgba(212,168,67,0.1);
}

.phone-icon-animation {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    animation: rotatePhone 2.5s ease-in-out infinite;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-90deg); }
    70% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

.rotation-card h2 {
    font-family: var(--font-casino);
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.rotation-card p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive Lobby screen support */
@media (max-width: 768px) {
    .lobby-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow-y: visible;
        width: 92%;
    }
    .lobby-brand-info {
        border-right: none;
        border-bottom: 1.5px solid rgba(212,168,67,0.2);
        padding: 1.5rem;
    }
    .lobby-logo { font-size: 1.6rem; }
    .lobby-subtitle { margin-bottom: 1rem; }
    .game-highlights { gap: 0.75rem; margin-bottom: 1rem; }
    .lobby-auth-card { padding: 1.5rem; }
}

/* ═══════════════════════════════════════════
   LANDSCAPE MOBILE HEIGHT CONSTRAINT TUNINGS
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   LANDSCAPE MOBILE HEIGHT CONSTRAINT TUNINGS
   ═══════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 550px) {
    html, body {
        overflow: hidden;
        height: 100%;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
    }

    #app-container {
        height: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
        padding: 0.2rem 0.4rem;
        gap: 0.2rem;
        display: flex;
        flex-direction: column;
    }

    /* Header in Landscape: Single compact row, no wrapping, responsive text */
    .game-header {
        height: auto;
        min-height: 36px;
        max-height: 42px;
        padding: 0.15rem 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.35rem;
        flex-shrink: 0;
        background: rgba(10, 12, 18, 0.97);
        border-bottom: 1.5px solid rgba(212,168,67,0.35);
    }

    .logo-area { gap: 0.25rem; }
    .logo-text { font-size: 0.75rem; letter-spacing: 0.5px; white-space: nowrap; }
    .live-badge { display: none; }

    .stats-bar { gap: 0; }
    .stat-box { padding: 0.05rem 0.35rem; border-left: none !important; border-right: 1px solid rgba(212,168,67,0.15) !important; }
    .stat-box:last-child { border-right: none !important; }
    #network-status-box { display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
    .stat-label { font-size: 0.4rem; margin-bottom: 0; }
    .stat-value { font-size: 0.72rem; }

    .header-controls { gap: 0.25rem; }
    .profile-name { display: none; }
    .logout-btn { font-size: 0.5rem; padding: 0.15rem 0.35rem; border-radius: 4px; }
    .header-controls .icon-btn { width: 26px; height: 26px; border-radius: 5px; }
    .header-controls .icon-btn svg { width: 13px; height: 13px; }

    /* Layout: Left = Wheel & Banner, Right = Bet controls */
    .game-layout {
        display: grid;
        grid-template-columns: 1fr 1.05fr;
        gap: 0.25rem;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* Left side: Wheel panel */
    .wheel-panel {
        padding: 0.15rem;
        gap: 0.1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        height: 100%;
        overflow: hidden;
    }

    .wheel-outer-ring {
        width: min(220px, 56vh);
        height: min(220px, 56vh);
        min-height: 130px;
        min-width: 130px;
        padding: 0.1rem;
        flex-shrink: 0;
    }

    #wheel-canvas {
        width: 100%;
        height: 100%;
        max-width: 215px;
        max-height: 215px;
    }

    .countdown-wrapper {
        width: 52px;
        height: 52px;
        margin: 0.02rem 0;
        flex-shrink: 0;
    }
    #timer-seconds { font-size: 0.95rem; }
    .countdown-label { font-size: 0.3rem; margin-bottom: 0; }
    .countdown-unit { font-size: 0.28rem; margin-top: 0; }

    .announcement-banner {
        padding: 0.15rem 0.4rem;
        margin-top: 0.02rem;
        max-width: 100%;
        flex-shrink: 0;
    }
    #announcement-text { font-size: 0.58rem; letter-spacing: 0.4px; }

    /* Right side: Controls panel (scrollable) */
    .controls-panel {
        padding: 0.25rem;
        gap: 0.25rem;
        display: flex;
        flex-direction: column;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        box-sizing: border-box;
        height: 100%;
    }

    .dashboard-card {
        padding: 0.25rem 0.35rem !important;
        margin-bottom: 0.15rem !important;
        flex-shrink: 0;
    }
    .card-header { margin-bottom: 0.08rem !important; padding-bottom: 0.08rem !important; }
    .card-header h2 { font-size: 0.52rem !important; letter-spacing: 0.5px; }

    /* Bet grid: 2 rows of 5 buttons — TALL & PROMINENT */
    .bet-grid { gap: 0.25rem !important; padding: 0.15rem !important; }
    .bet-btn { min-height: 44px !important; padding: 0.2rem 0.1rem !important; border-radius: 6px; }
    .bet-btn .num-val { font-size: 1.05rem !important; font-weight: 900 !important; }
    .bet-btn .bet-val { font-size: 0.58rem !important; margin-top: 1px; }

    /* Chip selector & Action buttons */
    .chip-container { padding: 0.45rem 0.2rem 0.25rem 0.2rem !important; margin-bottom: 0.15rem !important; gap: 0.2rem !important; overflow: visible !important; }
    .chip-btn { width: 30px !important; height: 30px !important; border-width: 1.5px !important; }
    .chip-btn .chip-inner { width: 19px !important; height: 19px !important; font-size: 0.55rem !important; }

    /* Action buttons: Clear, Double, Rebet */
    .action-btn { padding: 0.3rem 0.3rem !important; font-size: 0.52rem !important; min-height: 26px !important; }

    /* History & stats chips */
    .history-chip { width: 20px; height: 20px; font-size: 0.55rem; }
    .active-bet-chip { padding: 0.08rem 0.25rem; font-size: 0.55rem; }

    /* Auto bet inputs — placed at bottom of scrollable panel */
    .autobet-section { margin-top: 0.1rem; }
    .autobet-section .form-group { margin-bottom: 0.12rem; }
    .autobet-section label { font-size: 0.48rem; }
    .autobet-section input { height: 26px; font-size: 0.58rem; padding: 0.12rem 0.3rem; }
    #autobet-start-btn { min-height: 28px; font-size: 0.58rem; padding: 0.2rem 0.4rem; }

    /* Auth modal & balance modal in landscape */
    .auth-card, .balance-modal-content, .profile-modal-content {
        max-height: none;
        overflow-y: visible;
        padding: 0.85rem;
    }
}

/* ═══════════════════════════════════════════
   WIN / LOSS POPUP TOAST (replaces full-screen overlay)
═══════════════════════════════════════════ */
.result-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 9999;
    max-width: 340px;
    width: calc(100% - 2rem);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.result-popup.win-popup,
.result-popup.loss-popup {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    animation: popupScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-popup.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
    pointer-events: none;
}

@keyframes popupScaleIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.75); }
    70%  { transform: translate(-50%, -50%) scale(1.04); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.result-popup-inner {
    border-radius: 18px;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.win-popup .result-popup-inner {
    background: linear-gradient(135deg, rgba(10,35,18,0.97) 0%, rgba(6,18,10,0.98) 100%);
    border: 1.5px solid #22c55e;
    box-shadow: 0 12px 40px rgba(0,0,0,0.85), 0 0 20px rgba(34,197,94,0.25);
}

.loss-popup .result-popup-inner {
    background: linear-gradient(135deg, rgba(30,8,8,0.97) 0%, rgba(16,4,4,0.98) 100%);
    border: 1.5px solid #ef4444;
    box-shadow: 0 12px 40px rgba(0,0,0,0.85), 0 0 20px rgba(239,68,68,0.2);
}

.result-popup-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 0.1rem;
}

.result-popup .result-title {
    font-family: var(--font-casino);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    -webkit-text-fill-color: unset;
    filter: none;
}

.win-popup .result-title {
    background: linear-gradient(135deg, #ffd875 0%, #d4a843 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loss-popup .result-title {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-popup .result-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin: 0;
    letter-spacing: 0.3px;
}

.win-popup .result-subtitle { color: #86efac; }
.loss-popup .result-subtitle { color: #fca5a5; }

.result-popup-details-box {
    margin: 0.35rem 0;
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    max-height: 90px;
    overflow-y: auto;
    font-weight: 500;
}

.win-popup .result-popup-details-box {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.16);
    color: #a7f3d0;
}

.loss-popup .result-popup-details-box {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.result-popup-details {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 0.1rem;
}

/* Adjust popup for small screens */
@media (max-height: 520px) {
    .result-popup {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        bottom: auto;
        right: auto;
        max-width: 260px;
    }
    .result-popup.win-popup,
    .result-popup.loss-popup {
        transform: translate(-50%, -50%) scale(1);
        animation: popupScaleInLandscape 0.3s ease-out forwards;
        pointer-events: auto;
    }
    .result-popup-inner {
        padding: 0.6rem 0.9rem;
    }
    .result-popup-icon { font-size: 1.2rem; }
    .result-popup .result-title { font-size: 0.9rem; }
    .result-popup .result-subtitle { font-size: 0.7rem; }
}

@keyframes popupScaleInLandscape {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.75); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}



/* Hide scrollbars on history and bets lists to prevent clipping and numbers hiding */
.history-list, .active-bets-list {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.history-list::-webkit-scrollbar, .active-bets-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Loader Screen Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0e2719 0%, #06070a 100%);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
    opacity: 1;
}

.loader-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.loader-logo {
    font-family: var(--font-casino);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #ffd875 0%, #d4a843 50%, #926b15 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 15px rgba(212,168,67,0.3));
}

.loader-status {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.loader-bar-wrap {
    width: 240px;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

.loader-bar-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffd875, #d4a843);
    box-shadow: 0 0 8px var(--gold-glow);
    transition: width 0.3s ease-out;
}

/* Native Portrait Mode - Stacks Wheel on top and Board at the bottom */
@media (orientation: portrait) {
    html, body {
        width: 100%;
        height: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    
    #app-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        height: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        max-width: 100% !important;
        /* Preserve safe-area for sides + bottom; top is handled by ticker */
        padding: 0 max(0px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
        gap: 0.35rem;
        box-sizing: border-box;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }


    /* ═══ MOBILE HEADER: Clean 2-Row Layout ═══
       HTML order: logo-area | stats-bar | header-controls
       Desired:    Row 1: [logo-area] -------- [header-controls]
                   Row 2: [stats-bar  full width               ]
       Achieved via: flex-wrap + CSS order property
    ═══════════════════════════════════════════ */
    .game-header {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        padding: 0;
        gap: 0;
        flex-shrink: 0;
        height: auto;
        min-height: unset;
        max-height: unset;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(6,7,9,0.98) 0%, rgba(14,11,5,0.97) 100%);
        border-top: none;
        border-left: none;
        border-right: none;
        border-bottom: 1.5px solid rgba(212,168,67,0.35);
        box-shadow: 0 3px 20px rgba(0,0,0,0.75);
    }

    /* ── Row 1 left: Logo ── */
    .logo-area {
        order: 1;           /* goes first */
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.42rem 0.5rem 0.38rem 0.65rem;
        border-bottom: 1px solid rgba(212,168,67,0.1);
    }

    /* ── Row 1 right: Icons ── */
    .header-controls {
        order: 2;           /* goes second, same row as logo */
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 0.28rem;
        padding: 0.42rem 0.55rem 0.38rem 0.3rem;
        border-bottom: 1px solid rgba(212,168,67,0.1);
    }

    /* ── Row 2: Stats bar, forced to full new row ── */
    .stats-bar {
        order: 3;           /* goes last */
        flex-basis: 100%;   /* force onto its own row */
        width: 100%;
        display: flex;
        align-items: stretch;
        gap: 0;
        padding: 0;
        min-height: 0;
    }

    /* Each stat = equal 25% column */
    .stat-box {
        flex: 1;
        padding: 0.28rem 0.1rem;
        border: none !important;
        border-right: 1px solid rgba(212,168,67,0.1) !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }
    .stat-box:last-child { border-right: none !important; }

    /* Logo text */
    .logo-area .pulse-dot { width: 6px; height: 6px; flex-shrink: 0; }

    .logo-text {
        font-size: 0.78rem;
        letter-spacing: 0.8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .live-badge {
        font-size: 0.44rem;
        padding: 0.1rem 0.26rem;
        letter-spacing: 0.4px;
        flex-shrink: 0;
    }

    /* Stat labels & values */
    .stat-label {
        font-size: 0.4rem;
        letter-spacing: 0.4px;
        margin-bottom: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        text-align: center;
    }
    .stat-value {
        font-size: 0.74rem;
        white-space: nowrap;
    }

    /* Show PING stat on mobile */
    #network-status-box {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Show all 4 stat boxes */
    .stats-bar .stat-box:nth-child(2),
    .stats-bar .stat-box:nth-child(3) { display: flex; }

    /* Profile section */
    .user-profile { gap: 0.2rem; }
    .profile-name { display: none; }

    /* LOGOUT button — compact */
    .logout-btn {
        font-size: 0.48rem;
        font-weight: 800;
        padding: 0.18rem 0.32rem;
        border-radius: 4px;
        letter-spacing: 0px;
        white-space: nowrap;
        line-height: 1.2;
    }

    /* Icon buttons */
    .header-controls .icon-btn {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    .header-controls .icon-btn svg { width: 13px; height: 13px; }

    /* Profile avatar button */
    #header-profile-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        font-size: 0.9rem !important;
        border-radius: 50% !important;
        margin-right: 0 !important;
    }

    .game-layout {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 0.35rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.25rem 0.5rem 0.25rem;
    }

    /* Top Half: Wheel panel */
    .wheel-panel {
        flex: none;
        width: 100%;
        height: auto;
        padding: 0.5rem 0.4rem;
        gap: 0.3rem;
        box-sizing: border-box;
    }

    .wheel-outer-ring {
        height: auto;
        min-height: 180px;
        min-width: 100%;
        padding: 0.5rem;
    }

    #wheel-canvas {
        width: min(336px, 84vw);
        height: min(336px, 84vw);
        max-width: 384px;
        max-height: 384px;
    }

    /* Countdown timer in portrait */
    .countdown-wrapper {
        width: 54px;
        height: 54px;
        margin: 0.1rem 0;
    }

    #timer-seconds {
        font-size: 1.1rem;
    }

    .countdown-label {
        font-size: 0.4rem;
        margin-bottom: 0px;
    }

    .countdown-unit {
        font-size: 0.35rem;
        margin-top: 0px;
    }

    /* Bottom Half: Controls & Betting Board sitting directly below top half */
    .controls-panel {
        flex: none;
        width: 100%;
        padding: 0.5rem 0.4rem;
        gap: 0.5rem;
        box-sizing: border-box;
    }

    .bet-btn {
        min-height: 52px;
        font-size: 1.2rem;
    }

    .corner-btns {
        bottom: 0.5rem;
        left: 0.5rem;
        z-index: 1001;
    }
}

/* ═══════════════════════════════════════════
   iPhone 12/13/14 Pro specific (390px wide)
   Fine-tunes the 2-row header + game content
═══════════════════════════════════════════ */
@media (orientation: portrait) and (max-width: 430px) {
    /* Header row 1 — slightly tighter */
    .logo-area {
        padding: 0.35rem 0.5rem 0.3rem 0.55rem;
    }
    .header-controls {
        padding: 0.35rem 0.4rem 0.3rem 0.25rem;
        gap: 0.22rem;
    }

    /* Logo text tighter */
    .logo-text {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }

    /* Stat row tighter */
    .stat-box {
        padding: 0.25rem 0.1rem;
    }
    .stat-label {
        font-size: 0.38rem;
    }
    .stat-value {
        font-size: 0.7rem;
    }

    /* Tighter announcement banner */
    .announcement-banner {
        padding: 0.4rem 0.5rem;
    }
    #announcement-text {
        font-size: 0.7rem;
        letter-spacing: 0.8px;
    }

    /* Wheel canvas — sized for 390px */
    #wheel-canvas {
        width: min(300px, 78vw);
        height: min(300px, 78vw);
        max-width: 330px;
        max-height: 330px;
    }

    /* Countdown ring smaller */
    .countdown-wrapper {
        width: 50px;
        height: 50px;
    }

    /* History card header */
    .card-header h2 {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    /* Chips row compact */
    .chip-container {
        gap: 0.3rem;
        padding: 0.3rem 0.4rem;
    }
    .chip-btn, .chip {
        width: 40px;
        height: 40px;
        font-size: 0.62rem;
    }

    /* Betting grid */
    .bet-btn {
        min-height: 48px;
        font-size: 1.1rem;
    }

    /* Hot/cold badges */
    .hot-badge-num, .cold-badge-num {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    /* Ticker */
    .ticker-title {
        font-size: 0.58rem;
        padding: 0.2rem 0.45rem;
        margin-right: 0.65rem;
    }
    .ticker-item {
        font-size: 0.63rem;
    }

    /* Header icon buttons */
    .header-controls .icon-btn {
        width: 24px;
        height: 24px;
        border-radius: 5px;
    }
    .header-controls .icon-btn svg {
        width: 12px;
        height: 12px;
    }
    #header-profile-btn {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        font-size: 0.85rem !important;
    }
    .logout-btn {
        font-size: 0.45rem;
        padding: 0.17rem 0.28rem;
    }
}

/* Interactive Clickable Header Balance Stat Box */
.clickable-stat-box {
    cursor: pointer;
    background: linear-gradient(135deg, rgba(212,168,67,0.15) 0%, rgba(10,12,18,0.8) 100%);
    border: 1px solid rgba(212,168,67,0.4);
    box-shadow: 0 0 12px rgba(212,168,67,0.2);
    transition: all 0.2s ease;
}
.clickable-stat-box:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(212,168,67,0.4);
}

/* Balance & Cashier Modal Styling */
.balance-modal-content {
    max-width: 580px;
    width: 92%;
    padding: 1.25rem;
}

.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212,168,67,0.2);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-header-bar h2 {
    font-family: var(--font-casino);
    font-size: 1.15rem;
    color: var(--gold);
    margin: 0;
    letter-spacing: 1px;
}

.modal-balance-badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212,168,67,0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.modal-balance-badge strong {
    font-size: 0.95rem;
    margin-left: 0.3rem;
}

/* Wallet Tab Switcher */
.modal-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    background: rgba(0,0,0,0.4);
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.wallet-tab-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-casino);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallet-tab-btn.active {
    background: linear-gradient(180deg, #ffd875 0%, #d4a843 100%);
    color: #060709;
    box-shadow: 0 2px 8px rgba(212,168,67,0.4);
}

/* Deposit Tab Layout */
.qr-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(212,168,67,0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.qr-box {
    position: relative;
    width: 130px;
    height: 130px;
    min-width: 130px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    padding: 10px;
    box-sizing: border-box;
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.qr-image.blurred-qr {
    filter: blur(14px);
    transform: scale(1.1);
}

.view-qr-overlay-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 88%;
    height: 38px;
    background: rgba(10, 12, 18, 0.88);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-casino);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.view-qr-overlay-btn:hover {
    background: var(--gold);
    color: #060709;
    box-shadow: 0 0 10px rgba(212,168,67,0.5);
}

.qr-placeholder {
    color: #333;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    padding: 0.5rem;
}

.qr-info {
    flex: 1;
}

.qr-instruction {
    font-size: 0.75rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.qr-subinstruction {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.copy-upi-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.6);
    border: 1px dashed var(--gold);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--gold);
    margin: 0.4rem 0;
}

.copy-btn {
    background: var(--gold);
    color: #060709;
    border: none;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

/* Direct Instant UPI Pay App Deep Link Buttons */
.direct-pay-apps-row {
    display: flex;
    gap: 0.35rem;
    margin: 0.4rem 0;
    flex-wrap: wrap;
}

.direct-upi-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.35rem 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.direct-upi-btn.phonepe-btn {
    background: rgba(95, 37, 159, 0.25);
    border-color: rgba(147, 51, 234, 0.4);
    color: #c084fc;
}
.direct-upi-btn.phonepe-btn:hover {
    background: #5f259f;
    color: #fff;
}

.direct-upi-btn.gpay-btn {
    background: rgba(26, 115, 232, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}
.direct-upi-btn.gpay-btn:hover {
    background: #1a73e8;
    color: #fff;
}

.direct-upi-btn.paytm-btn {
    background: rgba(0, 185, 245, 0.25);
    border-color: rgba(6, 182, 212, 0.4);
    color: #38bdf8;
}
.direct-upi-btn.paytm-btn:hover {
    background: #00b9f5;
    color: #fff;
}

.direct-upi-btn.generic-btn {
    background: rgba(212, 168, 67, 0.2);
    border-color: rgba(212, 168, 67, 0.4);
    color: var(--gold-light);
}
.direct-upi-btn.generic-btn:hover {
    background: var(--gold);
    color: #060709;
}

/* Forms & Inputs */
.wallet-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.method-selector {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.3rem;
}

.method-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.method-option.active {
    border-color: var(--gold);
    background: rgba(212,168,67,0.1);
    color: var(--gold);
}

.method-option input {
    display: none;
}

.method-details-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.85rem;
}

.disabled-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Transaction History Table */
.history-table-wrapper {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: left;
}

.tx-table th {
    background: rgba(0,0,0,0.6);
    color: var(--gold);
    padding: 0.6rem 0.75rem;
    font-family: var(--font-casino);
    border-bottom: 1px solid rgba(212,168,67,0.3);
}

.tx-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-bright);
}

.tx-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tx-badge.pending {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.tx-badge.approved {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.tx-badge.rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

@media (max-width: 480px) {
    .qr-container {
        flex-direction: column;
        text-align: center;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ─── Ultra-Fast App Preloader Overlay ─── */
.app-preloader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    width: 100vw; height: 100vh;
    width: 100vw; height: 100dvh;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

.app-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
}

.preloader-spinner-ring {
    width: 54px;
    height: 54px;
    border: 3px solid rgba(212, 168, 67, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: preloader-spin 0.6s linear infinite;
}

@keyframes preloader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preloader-logo {
    font-family: var(--font-casino);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fef08a 0%, #ca8a04 50%, #854d0e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(212,168,67,0.3));
    margin: 0;
}

.preloader-bar-bg {
    width: 220px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(212, 168, 67, 0.25);
    position: relative;
}

.preloader-bar-fill {
    width: 15%; /* start with initial visual fill */
    height: 100%;
    background: linear-gradient(
        90deg,
        #854d0e 0%,
        #ca8a04 30%,
        #fef08a 50%,
        #ca8a04 70%,
        #854d0e 100%
    );
    background-size: 200% 100%;
    box-shadow: 0 0 15px var(--gold-glow);
    border-radius: 10px;
    animation: preloader-bar-slide 1.5s linear infinite;
    transition: width 0.3s ease-out;
}

@keyframes preloader-bar-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.preloader-status {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
    animation: preloader-status-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes preloader-status-pulse {
    0% { opacity: 0.35; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); }
}

/* ─── Ultra-Fast Button Active Touch Feedback ─── */
.bet-tile:active, .chip:active, .action-btn:active, .wallet-tab-btn:active, .header-balance-btn:active {
    transform: scale(0.94) !important;
    filter: brightness(1.25) !important;
    transition: transform 0.04s ease, filter 0.04s ease !important;
}

/* ==========================================================================
   Neon Spin 10 UX Upgrades: Lockout, Ticker, Hot-Cold & Grid
   ========================================================================== */

/* 1. Lockout Overlay */
.lockout-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lockout-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: none;
}
.lockout-glow-bar {
    width: 100%;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0) 0%, rgba(239, 68, 68, 0.2) 25%, rgba(239, 68, 68, 0.8) 50%, rgba(239, 68, 68, 0.2) 75%, rgba(239, 68, 68, 0) 100%);
    border-top: 1px solid rgba(239, 68, 68, 0.5);
    border-bottom: 1px solid rgba(239, 68, 68, 0.5);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.25);
}
.lockout-overlay:not(.hidden) .lockout-glow-bar {
    transform: translateY(0);
    opacity: 1;
}
.lockout-title {
    font-family: var(--font-casino);
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 6px;
    text-shadow: 0 0 10px #ef4444, 0 0 30px #ef4444, 0 0 50px #ef4444;
    animation: neonPulse 1s ease-in-out infinite alternate;
}
.lockout-subtitle {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 3px;
    margin-top: 0.5rem;
    text-transform: uppercase;
}
@keyframes neonPulse {
    0% { text-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444, 0 0 30px #ef4444; }
    100% { text-shadow: 0 0 12px #ef4444, 0 0 25px #ef4444, 0 0 45px #ef4444, 0 0 60px #ef4444; }
}

/* 2. Live Winner Scrolling Ticker */
.winners-ticker-wrap {
    width: 100%;
    background: rgba(8, 9, 14, 0.92);
    border-bottom: 1px solid rgba(212, 168, 67, 0.12);
    /* Height + safe area inset so it sits below the iOS status bar */
    min-height: 24px;
    height: calc(24px + env(safe-area-inset-top));
    display: flex;
    align-items: flex-end;
    padding: 0 0.75rem calc(3px) 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    font-family: var(--font-ui);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.ticker-title {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #000;
    font-weight: 800;
    font-size: 0.52rem;
    letter-spacing: 0.8px;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-right: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 0 5px rgba(212, 168, 67, 0.25);
}
.ticker-content-box {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    gap: 3rem;
    animation: tickerMove 20s linear infinite;
    align-items: center;
}
.ticker-item {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.ticker-item strong {
    color: var(--gold);
}
.ticker-item span.amount {
    color: #10b981;
    font-weight: 800;
}
@keyframes tickerMove {
    0% { transform: translateX(10%); }
    100% { transform: translateX(-100%); }
}

/* 3. Hot & Cold Numbers Layout */
.hot-cold-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 1rem;
}
.hot-cold-sub {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.hot-title {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 0.5px;
}
.cold-title {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    color: #3b82f6;
    letter-spacing: 0.5px;
}
.hot-badges, .cold-badges {
    display: flex;
    gap: 0.35rem;
}
.hot-badge-num, .cold-badge-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #000;
}
.hot-badge-num {
    background: linear-gradient(135deg, #ffd875 0%, #f59e0b 100%);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.cold-badge-num {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
}

/* 4. Action Buttons Grid Layout */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.action-buttons-grid .action-btn {
    padding: 0.65rem 0.25rem !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.5px !important;
}

/* ═══════════════════════════════════════════
   QR BRANDING & EXPANDABLE BETTING HISTORY
   ═══════════════════════════════════════════ */
.qr-brand-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10121a, #060709);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.7);
    z-index: 10;
    pointer-events: none;
}
.qr-brand-logo span {
    font-family: var(--font-casino);
    font-size: 0.55rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.history-summary-row {
    cursor: pointer;
    transition: background 0.2s;
}
.history-summary-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-detail-panel {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(212, 168, 67, 0.08);
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.history-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 0.4rem;
}
.history-detail-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}
.history-detail-item strong {
    color: #fff;
}
.history-detail-item .label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 2px;
}

