
        :root {
            --bg-dark: #0a0a0a;
            --panel-bg: #121212;
            --accent-gold: #FFD700;
            --accent-green: #00ff88;
            --accent-red: #ff3333;
            --text-main: #ffffff;
            --text-dim: #888888;
            --glass: rgba(255, 255, 255, 0.05);
            --border: rgba(255, 255, 255, 0.1);
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            margin: 0;
            overflow: hidden; /* Prevent scroll on body */
            font-family: 'Montserrat', sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-main);
        }

        /* --- SPLASH SCREEN --- */
        #splash-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #000;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            transition: opacity 1s ease-out;
        }

        .splash-logo {
            font-family: 'Orbitron', sans-serif;
            font-size: 80px;
            font-weight: 900;
            color: transparent;
            background: linear-gradient(to bottom, #FFD700, #B8860B);
            -webkit-background-clip: text;
            background-clip: text;
            text-transform: uppercase;
            letter-spacing: 5px;
            margin-bottom: 40px;
            text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
            animation: pulseLogo 2s infinite ease-in-out;
            text-align: center;
        }

        .loader-container {
            position: relative;
            width: 60px;
            height: 60px;
        }

        .loader {
            width: 100%;
            height: 100%;
            border: 4px solid #333;
            border-top: 4px solid var(--accent-gold);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .loading-text {
            margin-top: 20px;
            color: #888;
            font-size: 14px;
            letter-spacing: 2px;
            text-transform: uppercase;
            animation: blink 1.5s infinite;
        }

        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        @keyframes pulseLogo { 0% { transform: scale(1); filter: brightness(100%); } 50% { transform: scale(1.05); filter: brightness(120%); } 100% { transform: scale(1); filter: brightness(100%); } }
        @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }


        /* --- NAVBAR --- */
        #navbar {
            height: 60px;
            width: 100%;
            background: #000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            border-bottom: 1px solid var(--accent-gold);
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
            z-index: 100;
            position: relative;
        }

        .logo {
            font-family: 'Orbitron', sans-serif;
            font-size: 24px;
            font-weight: 900;
            color: var(--accent-gold);
            text-transform: uppercase;
            letter-spacing: 2px;
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .nav-actions {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .nav-btn {
            background: linear-gradient(145deg, #222, #333);
            border: 1px solid var(--border);
            color: #fff;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            text-transform: uppercase;
            transition: all 0.3s;
        }

        .nav-btn:hover {
            background: #444;
            border-color: var(--accent-gold);
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
        }

        .ad-btn {
            background: linear-gradient(90deg, #11998e, #38ef7d);
            border: none;
            color: #000;
        }
        
        .ad-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 0 15px #38ef7d;
        }

        .wallet-display {
            background: #1a1a1a;
            padding: 8px 20px;
            border-radius: 50px;
            border: 1px solid var(--accent-gold);
            font-family: 'Orbitron', sans-serif;
            color: var(--accent-gold);
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* --- MAIN LAYOUT --- */
        #main-layout {
            display: flex;
            height: calc(100vh - 60px); /* Subtract Navbar height */
            width: 100vw;
        }

        #game-container {
            flex-grow: 1;
            position: relative;
            background: #87CEEB; /* Day Sky */
            overflow: hidden;
        }

        /* --- SIDEBAR --- */
        #sidebar {
            width: 300px;
            background: var(--panel-bg);
            border-left: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            padding: 15px;
            box-shadow: -5px 0 20px rgba(0,0,0,0.5);
            z-index: 50;
        }

        .section-title {
            font-size: 12px;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 5px;
            margin-top: 10px;
        }
        
        .section-title:first-child { margin-top: 0; }

        .status-box {
            background: rgba(255,255,255,0.05);
            padding: 10px;
            border-radius: 6px;
            text-align: center;
            margin-bottom: 10px;
            font-size: 13px;
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
        }
        .win-text { color: var(--accent-green); text-shadow: 0 0 5px var(--accent-green); }
        .lose-text { color: var(--accent-red); text-shadow: 0 0 5px var(--accent-red); }

        /* Bet Amount Controls */
        .bet-controls {
            display: flex;
            gap: 5px;
            margin-bottom: 10px;
            flex-direction: column;
        }
        
        .bet-input-wrapper {
            display: flex;
            align-items: center;
            background: #000;
            border: 1px solid var(--accent-gold);
            border-radius: 4px;
            padding: 0 10px;
            height: 40px;
        }
        
        .currency-symbol { color: var(--accent-gold); font-weight: bold; }
        
        #betInput {
            background: transparent;
            border: none;
            color: #fff;
            padding: 8px;
            width: 100%;
            font-family: 'Orbitron', sans-serif;
            font-weight: bold;
            outline: none;
            font-size: 16px;
        }

        .quick-amounts {
            display: flex;
            gap: 5px;
        }
        
        .chip-btn {
            flex: 1;
            background: #333;
            border: 1px solid #555;
            color: #ccc;
            padding: 8px 5px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            font-weight: bold;
        }
        .chip-btn:hover { background: #444; color: #fff; border-color: #888; }


        /* Compact Grid */
        .bet-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 15px;
        }

        .bet-btn {
            background: #2a2a2a;
            color: #fff;
            border: 1px solid var(--border);
            padding: 12px 5px;
            border-radius: 6px;
            cursor: pointer;
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
            font-weight: bold;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
        }

        .bet-btn span {
            display: block;
            font-size: 9px;
            font-family: 'Montserrat', sans-serif;
            color: #888;
            margin-top: 2px;
        }

        .bet-btn:hover { background: #333; border-color: #666; }
        
        .bet-btn.active {
            background: var(--accent-gold);
            color: #000;
            border-color: #fff;
            box-shadow: 0 0 15px var(--accent-gold);
        }
        .bet-btn.active span { color: #000; }
        .bet-btn:disabled { opacity: 0.3; cursor: not-allowed; }

        .btn-red { border-bottom: 2px solid var(--accent-red); }
        .btn-green { border-bottom: 2px solid var(--accent-green); }
        .btn-blue { border-bottom: 2px solid #00d2ff; }

        /* History Section */
        #history-section {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: rgba(0,0,0,0.3);
            border-radius: 6px;
            border: 1px solid var(--border);
            min-height: 50px;
        }

        #history-list {
            overflow-y: auto;
            flex-grow: 1;
            padding: 5px;
        }

        .history-item {
            display: flex;
            justify-content: space-between;
            padding: 6px 10px;
            font-size: 11px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .history-item:last-child { border-bottom: none; }
        .h-win { color: var(--accent-green); }
        .h-loss { color: var(--accent-red); }

        /* --- GAME OVERLAY --- */
        #ui-layer {
            position: absolute;
            top: 15px;
            left: 20px;
            pointer-events: none;
            z-index: 10;
        }
        .score-board {
            background: rgba(0,0,0,0.6);
            padding: 10px 20px;
            border-radius: 8px;
            border-left: 4px solid var(--accent-gold);
            backdrop-filter: blur(5px);
        }
        .sb-title { font-size: 10px; color: #aaa; letter-spacing: 1px; }
        .sb-score { font-size: 24px; font-weight: 900; font-family: 'Orbitron'; color: #fff; }

        #message-overlay {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            display: none;
            text-align: center;
            z-index: 20;
            width: 100%;
        }
        #msg-text {
            font-size: 100px;
            font-weight: 900;
            font-family: 'Orbitron', sans-serif;
            text-transform: uppercase;
            letter-spacing: 5px;
            -webkit-text-stroke: 3px black;
            text-shadow: 5px 5px 0px rgba(0,0,0,0.5);
        }

        /* --- MODALS (Popups) --- */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(5px);
            z-index: 200;
            display: none;
            justify-content: center;
            align-items: center;
        }

        .modal-box {
            background: #1a1a1a;
            width: 400px;
            max-width: 90%;
            border-radius: 12px;
            padding: 25px;
            border: 1px solid var(--accent-gold);
            box-shadow: 0 0 30px rgba(0,0,0,0.8);
            position: relative;
            text-align: center;
        }

        .modal-title {
            font-family: 'Orbitron';
            font-size: 22px;
            color: var(--accent-gold);
            margin-bottom: 15px;
        }

        .modal-content {
            font-size: 14px;
            color: #ccc;
            line-height: 1.6;
            margin-bottom: 20px;
            text-align: left;
        }

        .close-btn {
            position: absolute;
            top: 10px; right: 15px;
            color: #666;
            font-size: 20px;
            cursor: pointer;
        }
        .close-btn:hover { color: #fff; }

        .action-btn {
            background: var(--accent-gold);
            color: #000;
            border: none;
            padding: 10px 25px;
            font-weight: bold;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        .action-btn:disabled { background: #555; cursor: not-allowed; color: #888; }

        /* Ad Specific */
        .ad-placeholder {
            background: #000;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            border: 1px dashed #444;
            color: #555;
            flex-direction: column;
        }
        #ad-timer { font-size: 32px; font-weight: bold; color: #fff; margin-top: 10px; }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 5px; }
        ::-webkit-scrollbar-track { background: #111; }
        ::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

        /* --- MOBILE RESPONSIVE STYLES --- */
        #mob-hist-btn { display: none; } /* Default hidden on desktop */

        @media (max-width: 900px) {
            #navbar {
                padding: 0 10px;
            }
            .logo {
                font-size: 16px;
                letter-spacing: 1px;
            }
            .nav-btn {
                padding: 6px 10px;
                font-size: 10px;
            }
            .wallet-display {
                padding: 5px 12px;
                font-size: 12px;
            }
            .nav-actions {
                gap: 5px;
            }

            #mob-hist-btn { display: inline-block; } /* Show on mobile */

            #main-layout {
                flex-direction: column;
                height: calc(100vh - 60px);
                overflow: hidden;
            }

            #game-container {
                width: 100%;
                height: 45%; /* Top 45% for Game */
                flex-grow: 0;
            }

            #sidebar {
                width: 100%;
                height: 55%; /* Bottom 55% for Controls */
                border-left: none;
                border-top: 1px solid var(--border);
                padding: 10px;
                box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
            }

            /* Hide History in Sidebar on Mobile to save space */
            .hide-on-mobile { display: none !important; }

            .splash-logo {
                font-size: 40px;
            }
            
            #msg-text {
                font-size: 60px; /* Smaller text on mobile */
            }

            .bet-grid {
                gap: 5px;
            }
            
            .bet-btn {
                padding: 10px 2px;
                font-size: 12px;
            }

            .section-title {
                margin-top: 5px;
                margin-bottom: 5px;
                font-size: 10px;
            }
            
            .status-box {
                min-height: 30px;
                margin-bottom: 5px;
                padding: 5px;
                font-size: 12px;
            }

            .bet-input-wrapper {
                height: 35px;
            }
        }
    
/* Casino: narrow embedded viewport */
@media (max-width: 600px) {

#navbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding: 8px; }
.nav-actions { flex-wrap: wrap; gap: 6px; }
}
