:root {
            --neon-blue: #00f3ff;
            --neon-red: #ff0055;
            --neon-gold: #ffaa00;
            --bg-dark: #050505;
            --sidebar-width: 300px;
        }

        body {
            margin: 0;
            overflow: hidden;
            background-color: var(--bg-dark);
            color: #fff;
            font-family: 'Rajdhani', sans-serif;
            width: 100vw;
            height: 100vh;
        }

        /* --- 3D Canvas --- */
        #canvas-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        /* --- FX Overlays --- */
        .fx-overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none; z-index: 2; opacity: 0;
            transition: opacity 0.5s ease;
        }
        .ice-fx { background: radial-gradient(circle at 30% 50%, transparent 20%, rgba(100, 200, 255, 0.1) 90%); }
        .fire-fx { background: radial-gradient(circle at 30% 50%, transparent 20%, rgba(255, 50, 0, 0.1) 90%); mix-blend-mode: screen; }

        /* --- UI Layer (Main Game) --- */
        #ui-layer {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 10; pointer-events: none;
            display: none; /* Hidden initially */
        }
        .interactive { pointer-events: auto; }

        /* --- Screens (Splash & Menu) --- */
        .fullscreen-layer {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #050505; z-index: 2000;
            display: flex; flex-direction: column;
            justify-content: center; align-items: center;
            transition: opacity 0.5s;
        }

        /* Splash Screen */
        #splash-screen { z-index: 3000; }
        .splash-logo {
            font-family: 'Orbitron'; font-size: 3rem; font-weight: 900;
            background: linear-gradient(90deg, var(--neon-blue), #fff, var(--neon-red));
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            margin-bottom: 20px; animation: glow 2s infinite alternate;
        }
        .loader {
            width: 50px; height: 50px;
            border: 5px solid rgba(255,255,255,0.1);
            border-top: 5px solid var(--neon-gold);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Menu Screen */
        #menu-screen { 
            background: radial-gradient(circle, rgba(10,20,40,0.9), #000); 
            z-index: 2000; display: none;
        }
        .menu-title {
            font-family: 'Orbitron'; font-size: 4rem; font-weight: 900;
            text-shadow: 0 0 20px rgba(255,255,255,0.5);
            margin-bottom: 50px; color: #fff;
        }
        .menu-btn {
            background: transparent; border: 2px solid var(--neon-blue);
            color: var(--neon-blue); padding: 15px 40px; font-family: 'Orbitron';
            font-size: 1.2rem; font-weight: bold; margin: 10px; cursor: pointer;
            border-radius: 50px; transition: 0.3s; width: 250px; text-align: center;
        }
        .menu-btn:hover {
            background: var(--neon-blue); color: #000;
            box-shadow: 0 0 20px var(--neon-blue);
        }
        .menu-btn.secondary {
            border-color: #fff; color: #fff;
        }
        .menu-btn.secondary:hover {
            background: #fff; color: #000; box-shadow: 0 0 20px #fff;
        }

        /* Animations */
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        @keyframes glow { from { text-shadow: 0 0 10px rgba(255,255,255,0.5); } to { text-shadow: 0 0 30px rgba(255,255,255,0.8); } }


        /* --- Navbar --- */
        .header {
            position: absolute; top: 0; left: 0; width: 100%; height: 50px;
            display: flex; justify-content: space-between; align-items: center;
            background: rgba(5, 5, 10, 0.9); backdrop-filter: blur(10px);
            padding: 0 15px; border-bottom: 1px solid rgba(255,255,255,0.1);
            z-index: 20; box-sizing: border-box;
        }
        .header-left { display: flex; align-items: center; gap: 15px; }
        .logo { font-family: 'Orbitron'; font-weight: 900; font-size: 1.1rem; color: #fff; }
        .balance-box { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--neon-gold); }
        .nav-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.7rem; font-family: 'Orbitron'; transition:0.3s; }
        .nav-btn:hover { background: rgba(255,255,255,0.2); }

        /* --- Sidebar --- */
        .sidebar {
            position: absolute; right: 0; top: 50px; bottom: 0;
            width: var(--sidebar-width);
            background: rgba(10, 15, 25, 0.95);
            border-left: 1px solid rgba(255,255,255,0.1);
            padding: 15px;
            display: flex; flex-direction: column; gap: 10px;
            z-index: 15; box-sizing: border-box; overflow-y: auto;
        }

        .control-group { display: flex; flex-direction: column; gap: 3px; }
        .label { font-size: 0.7rem; color: #889; text-transform: uppercase; font-weight: 600; }
        
        .game-input {
            background: #151a25; border: 1px solid #334; color: #fff;
            padding: 8px; border-radius: 4px; font-family: 'Orbitron'; font-size: 0.9rem;
            width: 100%; outline: none; box-sizing: border-box;
        }

        .pred-container { display: flex; gap: 8px; }
        .pred-btn {
            flex: 1; padding: 10px; border: 1px solid #444; border-radius: 6px;
            font-family: 'Orbitron'; font-weight: 700; font-size: 0.8rem;
            cursor: pointer; opacity: 0.5; color: #fff; background: #222;
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            transition: 0.2s;
        }
        .pred-btn.active { opacity: 1; transform: scale(1.02); border-width: 2px; }
        .btn-heat.active { background: #4a0011; border-color: var(--neon-red); box-shadow: 0 0 10px var(--neon-red); }
        .btn-cool.active { background: #002233; border-color: var(--neon-blue); box-shadow: 0 0 10px var(--neon-blue); }

        .play-btn {
            width: 100%; padding: 12px; background: #fff; color: #000;
            border: none; border-radius: 6px; font-family: 'Orbitron'; font-weight: 900;
            cursor: pointer; font-size: 1rem; margin-top: 5px;
            box-shadow: 0 0 10px rgba(255,255,255,0.3);
            transition: 0.3s;
        }
        .play-btn:disabled { background: #555; color: #888; cursor: not-allowed; box-shadow: none; }

        /* --- Ad Box --- */
        .ad-container {
            width: 250px;
            height: 300px;
            background: #111;
            border: 1px dashed #444;
            margin: 10px auto 0 auto;
            display: flex; justify-content: center; align-items: center;
            color: #555; font-size: 0.8rem; text-align: center;
            border-radius: 8px; flex-shrink: 0;
        }

        /* --- Center Multiplier --- */
        .center-display {
            position: absolute; top: 20%; left: 35%; /* Left aligned */
            transform: translate(-50%, -50%);
            text-align: center; z-index: 5; pointer-events: none;
            transition: left 0.3s;
        }
        #multiplier-text {
            font-family: 'Orbitron'; font-size: 4rem; font-weight: 900;
            text-shadow: 0 0 20px rgba(0,0,0,0.8); margin: 0; line-height: 1;
        }
        .status-label { font-size: 0.8rem; letter-spacing: 2px; color: #aaa; margin-top: 5px; }

        /* --- Responsive --- */
        @media (max-width: 900px) {
            .sidebar {
                top: auto; bottom: 0; left: 0; width: 100%; height: auto;
                max-height: 50vh; border-left: none; border-top: 1px solid #333;
                flex-direction: row; flex-wrap: wrap; justify-content: center;
                padding: 10px;
            }
            .ad-container { display: none; }
            .control-group { width: 30%; }
            .play-btn { width: 100%; }
            .center-display { left: 50%; top: 20%; }
            #canvas-container { bottom: 50vh; }
            .menu-title { font-size: 2.5rem; }
        }

        /* Result Popup */
        .modal {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85); display: none;
            justify-content: center; align-items: center; z-index: 100;
        }
        .modal-content {
            background: #111; border: 1px solid #333; padding: 30px;
            border-radius: 12px; text-align: center; width: 80%; max-width: 300px;
            transform: scale(0); transition: transform 0.3s;
        }

        /* History Modal */
        #history-modal-content {
            width: 90%; max-width: 400px; max-height: 70vh;
            display: flex; flex-direction: column;
        }
        .history-list {
            flex: 1; overflow-y: auto; margin-top: 15px; border-top: 1px solid #333;
        }
        .hist-row {
            display: flex; justify-content: space-between; padding: 10px;
            border-bottom: 1px solid #222; font-size: 0.9rem;
        }
        .hist-win { color: #0f0; }
        .hist-lose { color: #f00; }
        
        /* Watch & Earn Modal Specifics */
        .ad-timer {
            font-size: 2rem;
            color: var(--neon-gold);
            font-family: 'Orbitron';
            margin: 20px 0;
        }
        .ad-preview {
            width: 100%; height: 150px; background: #000;
            border: 1px dashed #444; display: flex; justify-content: center; align-items: center;
            color: #555; margin-bottom: 10px;
        }

        /* How To Play Modal */
        .tutorial-text {
            text-align: left; font-size: 0.9rem; line-height: 1.6; color: #ccc;
        }
        .tut-step { margin-bottom: 10px; display: flex; gap: 10px; }
        .tut-icon { width: 25px; color: var(--neon-blue); text-align: center; }