        :root {
            --bg-casino: #05140d;
            --bg-gradient-inner: #0e3320;
            --bg-gradient-outer: #030d08;
            --felt-green: #0a3a22;
            --felt-border: #145835;
            --card-bg: #0f2218;
            --gold-primary: #ffd700;
            --gold-glow: rgba(255, 215, 0, 0.35);
            --neon-cyan: #00f0ff;
            --neon-pink: #ff0055;
            --neon-green: #00ff66;
            --text-light: #f8fafc;
            --text-muted: #a3b8cc;
            --panel-sunken: rgba(0, 0, 0, 0.4);
            --panel-floating: rgba(0, 0, 0, 0.6);
            --on-gold-text: #000000;
            --font-casino: 'Cinzel', serif;
            --font-arcade: 'Orbitron', sans-serif;
            --font-body: 'Rajdhani', sans-serif;
            --font-mono: 'Share Tech Mono', monospace;
            --shadow-deep: rgba(0, 0, 0, 0.85);

            /* Shared kit mapping */
            --kit-accent: var(--gold-primary);
            --kit-accent-ink: #241900;
            --kit-accent-glow: var(--gold-glow);
            --kit-surface: var(--panel-sunken);
            --kit-border: var(--felt-border);
            --kit-input-bg: var(--card-bg);
            --kit-error: var(--neon-pink);
        }

        /* TRUE LIGHT THEME — a bright ivory casino lobby look, not a second
           dark palette. (Previously this block just swapped in a different
           dark brown scheme, so "Light Mode" looked just as dark as
           "Dark Mode" — that was the bug.) */
        body.light-mode {
            --bg-casino: #f8f1de;
            --bg-gradient-inner: #fffaf0;
            --bg-gradient-outer: #f1e6c8;
            --felt-green: #eaf4ec;
            --felt-border: #b7d9c1;
            --card-bg: #ffffff;
            --gold-primary: #a8620a;
            --gold-glow: rgba(168, 98, 10, 0.2);
            --neon-cyan: #0e7490;
            --neon-pink: #be123c;
            --neon-green: #15803d;
            --text-light: #241a0c;
            --text-muted: #6b5a3e;
            --panel-sunken: rgba(120, 72, 12, 0.07);
            --panel-floating: rgba(255, 255, 255, 0.88);
            --on-gold-text: #ffffff;

            /* Shared kit mapping (redeclared here — see dark-block comment) */
            --kit-accent: var(--gold-primary);
            --kit-accent-ink: var(--on-gold-text);
            --kit-accent-glow: var(--gold-glow);
            --kit-surface: var(--panel-sunken);
            --kit-border: var(--felt-border);
            --kit-input-bg: var(--card-bg);
            --kit-error: var(--neon-pink);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
        }

        body {
            background-color: var(--bg-casino);
            background-image: radial-gradient(circle at center, var(--bg-gradient-inner) 0%, var(--bg-gradient-outer) 100%);
            color: var(--text-light);
            font-family: var(--font-body);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }

        /* Top Controls */
        .top-controls {
            position: fixed;
            top: 16px;
            right: 20px;
            z-index: 1000;
        }

        .theme-toggle-btn {
            background: var(--panel-floating);
            color: var(--gold-primary);
            border: 2px solid var(--gold-primary);
            padding: 8px 16px;
            border-radius: 4px;
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 0.85rem;
            cursor: pointer;
            box-shadow: 0 0 10px var(--gold-glow);
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .theme-toggle-btn:hover {
            background: var(--gold-primary);
            color: var(--on-gold-text);
        }

        /* Main Casino Table Container */
        .casino-table {
            width: 100%;
            max-width: 1050px;
            background: var(--felt-green);
            border: 10px solid #2d1b0e;
            outline: 3px solid var(--gold-primary);
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 20px 50px var(--shadow-deep), inset 0 0 80px rgba(0, 0, 0, 0.6);
            position: relative;
            min-height: 660px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .casino-title {
            font-family: var(--font-casino);
            font-size: 2.2rem;
            color: var(--gold-primary);
            text-align: center;
            letter-spacing: 3px;
            text-shadow: 0 0 15px var(--gold-glow), 2px 2px 4px #000;
            text-transform: uppercase;
        }

        .casino-subtitle {
            font-family: var(--font-mono);
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
            margin-bottom: 16px;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        /* Status HUD Bar */
        .hud-status-bar {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            background: var(--panel-sunken);
            border: 2px solid var(--felt-border);
            padding: 10px 16px;
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: inset 0 0 10px rgba(0,0,0,0.25);
        }

        .hud-item {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .hud-label {
            font-family: var(--font-mono);
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
        }

        .hud-value {
            font-family: var(--font-arcade);
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--gold-primary);
            text-shadow: 0 0 8px var(--gold-glow);
        }

        /* Layout Grid */
        .table-grid {
            display: grid;
            grid-template-columns: 350px 1fr;
            gap: 24px;
            align-items: center;
        }

        @media (max-width: 880px) {
            .table-grid { grid-template-columns: 1fr; }
        }

        /* Column holding whichever mini-game visual is active this round.
           Fixed min-height keeps the table-grid from jumping between a
           round wheel/dice/cards. */
        .game-visual-column {
            min-height: 350px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Canvas Wheel Wrapper */
        .wheel-wrapper {
            position: relative;
            width: 330px;
            height: 330px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--panel-sunken);
            border-radius: 50%;
            padding: 10px;
            border: 4px solid var(--gold-primary);
            box-shadow: 0 0 25px var(--gold-glow);
        }

        /* ---------------- Mini-Game 2: Dice Tower ---------------- */
        .dice-wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 18px;
            background: var(--panel-sunken);
            border-radius: 20px;
            padding: 30px 10px;
            border: 4px solid var(--gold-primary);
            box-shadow: 0 0 25px var(--gold-glow);
        }

        .dice-tray {
            display: flex;
            gap: 24px;
            align-items: center;
            justify-content: center;
        }

        .die {
            width: 78px;
            height: 78px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            background: var(--card-bg);
            border: 3px solid var(--gold-primary);
            border-radius: 16px;
            padding: 10px;
            box-shadow: 0 6px 16px var(--shadow-deep);
        }

        .die .pip {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--gold-primary);
            justify-self: center;
            align-self: center;
        }

        @keyframes diceTumble {
            0%   { transform: rotate(0deg) scale(1); }
            25%  { transform: rotate(90deg) scale(1.08); }
            50%  { transform: rotate(180deg) scale(0.94); }
            75%  { transform: rotate(270deg) scale(1.08); }
            100% { transform: rotate(360deg) scale(1); }
        }

        .die.tumbling {
            animation: diceTumble 0.4s linear infinite;
        }

        /* ---------------- Mini-Game 3: Card Table ---------------- */
        .cards-wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 18px;
            background: var(--panel-sunken);
            border-radius: 20px;
            padding: 26px 10px;
            border: 4px solid var(--gold-primary);
            box-shadow: 0 0 25px var(--gold-glow);
        }

        .deck-stack {
            position: relative;
            width: 90px;
            height: 60px;
            transition: transform 0.15s ease;
        }

        .deck-card {
            position: absolute;
            top: 0; left: 0;
            width: 90px;
            height: 128px;
            border-radius: 10px;
            background: var(--card-bg);
            border: 2px solid var(--gold-primary);
            box-shadow: 0 4px 10px var(--shadow-deep);
        }

        .deck-card:nth-child(1) { transform: rotate(-6deg) translateY(2px); }
        .deck-card:nth-child(2) { transform: rotate(3deg) translateY(1px); }
        .deck-card:nth-child(3) { transform: rotate(-1deg); }

        @keyframes deckShuffle {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-6px) rotate(-2deg); }
            50% { transform: translateX(6px) rotate(2deg); }
            75% { transform: translateX(-4px) rotate(-1deg); }
        }

        .deck-stack.shuffling { animation: deckShuffle 0.35s ease-in-out infinite; }

        .flip-card {
            width: 130px;
            height: 182px;
            perspective: 800px;
        }

        .flip-card-inner {
            position: relative;
            width: 100%;
            height: 100%;
            transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
            transform-style: preserve-3d;
        }

        .flip-card.flipped .flip-card-inner {
            transform: rotateY(180deg);
        }

        .flip-card-front,
        .flip-card-back {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            border: 3px solid var(--gold-primary);
            background: var(--card-bg);
            backface-visibility: hidden;
            box-shadow: 0 6px 18px var(--shadow-deep);
        }

        .flip-card-front {
            font-size: 3.2rem;
            color: var(--gold-primary);
        }

        .flip-card-back {
            transform: rotateY(180deg);
            flex-direction: column;
            gap: 2px;
            font-family: var(--font-arcade);
        }

        .flip-card-back .card-number {
            font-size: 2.4rem;
            font-weight: 900;
            line-height: 1;
        }

        .flip-card-back .card-suit {
            font-size: 1.8rem;
            line-height: 1;
        }

        .game-readout {
            font-family: var(--font-mono);
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-light);
            text-align: center;
            min-height: 22px;
        }

        canvas {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 50%;
        }

        .wheel-pointer {
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 14px solid transparent;
            border-right: 14px solid transparent;
            border-top: 26px solid var(--neon-pink);
            z-index: 10;
            filter: drop-shadow(0 3px 6px rgba(0,0,0,0.9));
        }

        /* Dealer Terminal Panel */
        .terminal-panel {
            background: var(--card-bg);
            border: 2px solid var(--felt-border);
            border-radius: 12px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            box-shadow: 0 8px 24px var(--shadow-deep);
        }

        .dealer-prompt-box {
            background: var(--panel-sunken);
            border: 1px solid var(--gold-primary);
            border-left: 5px solid var(--gold-primary);
            padding: 14px 18px;
            border-radius: 6px;
        }

        .dealer-title {
            font-family: var(--font-casino);
            font-size: 0.85rem;
            color: var(--gold-primary);
            letter-spacing: 1.5px;
            margin-bottom: 6px;
            text-transform: uppercase;
        }

        .dealer-text {
            font-size: 1.15rem;
            line-height: 1.5;
            font-weight: 600;
        }

        /* Typed Probability Answer Row */
        .prob-input-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .prob-input-prefix {
            font-family: var(--font-arcade);
            font-weight: 800;
            color: var(--gold-primary);
        }

        .prob-answer-input {
            flex: 1;
            min-width: 0;
            background: var(--panel-sunken);
            color: var(--text-light);
            border: 1px solid var(--felt-border);
            border-radius: 6px;
            padding: 12px;
            font-family: var(--font-arcade);
            font-size: 1rem;
            font-weight: 700;
        }

        .prob-answer-input:focus {
            outline: none;
            border-color: var(--neon-cyan);
            box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
        }

        .prob-check-btn {
            background: var(--neon-cyan);
            color: #00121a;
            border: none;
            padding: 12px 16px;
            border-radius: 6px;
            font-family: var(--font-arcade);
            font-size: 0.85rem;
            font-weight: 800;
            cursor: pointer;
            white-space: nowrap;
        }

        .prob-check-btn:hover {
            filter: brightness(1.1);
        }

        .prob-check-btn:disabled {
            background: var(--felt-border);
            color: var(--text-muted);
            cursor: not-allowed;
        }

        .prob-input-feedback {
            font-family: var(--font-mono);
            font-size: 0.8rem;
            font-weight: 700;
            min-height: 18px;
            margin-top: 6px;
        }

        .dealer-quip-line {
            font-family: var(--font-body);
            font-size: 0.85rem;
            font-style: italic;
            color: var(--text-muted);
            margin-top: 8px;
            min-height: 18px;
        }

        .dealer-quip-audit {
            margin-top: 10px;
            font-style: italic;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        /* Betting Table Board */
        .betting-board {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .bet-spot {
            background: var(--panel-sunken);
            border: 2px dashed var(--felt-border);
            padding: 12px;
            border-radius: 8px;
            text-align: center;
            cursor: pointer;
        }

        .bet-spot:hover {
            border-color: var(--gold-primary);
        }

        .bet-spot.active {
            border: 2px solid var(--gold-primary);
            background: var(--gold-glow);
            box-shadow: 0 0 15px var(--gold-glow);
        }

        .bet-spot-title {
            font-family: var(--font-casino);
            font-size: 0.95rem;
            color: var(--gold-primary);
            margin-bottom: 2px;
        }

        .bet-spot-odds {
            font-family: var(--font-mono);
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Chips Controls */
        .chip-selector {
            display: flex;
            justify-content: center;
            gap: 14px;
        }

        .chip-btn {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 3px dashed #ffffff;
            background: radial-gradient(circle, #2a1003 0%, #0f0501 100%);
            color: var(--gold-primary);
            font-family: var(--font-arcade);
            font-size: 0.85rem;
            font-weight: 900;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px var(--shadow-deep);
        }

        .chip-btn.selected {
            border-style: solid;
            background: radial-gradient(circle, #ffd700 0%, #b45309 100%);
            color: #000;
            box-shadow: 0 0 16px var(--gold-glow);
            transform: scale(1.08);
        }

        /* Action Spin Button */
        .spin-btn {
            background: linear-gradient(135deg, #ff0055 0%, #b3003b 100%);
            color: #ffffff;
            border: none;
            padding: 16px;
            font-family: var(--font-arcade);
            font-size: 1.1rem;
            font-weight: 900;
            letter-spacing: 2px;
            text-transform: uppercase;
            cursor: pointer;
            border-radius: 6px;
            box-shadow: 0 4px 18px rgba(255, 0, 85, 0.4);
            width: 100%;
        }

        .spin-btn:hover {
            opacity: 0.95;
            transform: translateY(-2px);
        }

        .spin-btn:disabled {
            background: var(--felt-border);
            color: var(--text-muted);
            box-shadow: none;
            cursor: not-allowed;
            transform: none;
        }

        /* Feedback Status */
        .feedback-line {
            font-family: var(--font-mono);
            text-align: center;
            font-size: 0.95rem;
            font-weight: 700;
            min-height: 24px;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .text-success { color: var(--neon-green); }
        .text-error { color: var(--neon-pink); }

        /* MODAL / EXPLANATION CARD STYLES */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.85);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 16px;
        }

        .audit-card {
            background: var(--card-bg);
            border: 3px solid var(--gold-primary);
            border-radius: 12px;
            max-width: 580px;
            width: 100%;
            padding: 24px;
            box-shadow: 0 0 35px var(--gold-glow);
            font-family: var(--font-body);
            position: relative;
        }

        .audit-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 4px;
            font-family: var(--font-arcade);
            font-size: 0.8rem;
            font-weight: 800;
            text-transform: uppercase;
            margin-bottom: 12px;
        }

        .badge-correct {
            background: var(--neon-green);
            color: #000;
        }

        .badge-incorrect {
            background: var(--neon-pink);
            color: #fff;
        }

        .audit-title {
            font-family: var(--font-casino);
            color: var(--gold-primary);
            font-size: 1.4rem;
            margin-bottom: 12px;
            border-bottom: 1px solid var(--felt-border);
            padding-bottom: 8px;
        }

        .audit-math-box {
            background: var(--panel-sunken);
            border: 1px solid var(--felt-border);
            padding: 14px;
            border-radius: 6px;
            margin: 14px 0;
            font-size: 1.05rem;
            line-height: 1.6;
        }

        .audit-close-btn {
            background: var(--gold-primary);
            color: var(--on-gold-text);
            border: none;
            padding: 12px 28px;
            font-family: var(--font-arcade);
            font-weight: 900;
            font-size: 0.95rem;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-top: 10px;
        }

        .audit-close-btn:hover {
            background: #fff;
            color: #000;
        }

        /* Screens Helpers */
        .screen-center {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 10px 0;
        }

        .primary-btn {
            background: var(--gold-primary);
            color: var(--on-gold-text);
            border: none;
            padding: 14px 40px;
            font-family: var(--font-arcade);
            font-size: 1rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            cursor: pointer;
            margin-top: 20px;
            border-radius: 4px;
            box-shadow: 0 4px 16px var(--gold-glow);
        }

        .briefing-box {
            background: var(--card-bg);
            border: 1px solid var(--felt-border);
            padding: 22px 28px;
            text-align: left;
            margin: 20px 0;
            max-width: 680px;
            line-height: 1.7;
            font-size: 1rem;
            border-radius: 8px;
        }

        .briefing-box ul { padding-left: 20px; }
        .briefing-box li { margin-bottom: 8px; }

        .disclaimer-card {
            background: rgba(255, 215, 0, 0.05);
            border: 2px dashed var(--gold-primary);
            padding: 22px 26px;
            margin: 20px 0;
            text-align: center;
            max-width: 680px;
            border-radius: 8px;
        }

        .disclaimer-card h3 {
            font-family: var(--font-casino);
            color: var(--gold-primary);
            font-size: 1.2rem;
            margin-bottom: 8px;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        footer {
            margin-top: 20px;
            font-family: var(--font-mono);
            font-size: 0.8rem;
            color: var(--text-muted);
            text-align: center;
        }
