:root {
            --primary: #ff0055;
            --secondary: #00ffcc;
            --bg-dark: #0d0d12;
            --sidebar-w: 280px;
            --nav-h: 70px;
        }

        body { 
            margin: 0; overflow: hidden; background: #87CEEB; 
            font-family: 'Segoe UI', sans-serif; user-select: none; touch-action: none; 
            display: flex; flex-direction: column; height: 100vh;
        }

        /* NAVBAR */
        #top-nav {
            height: var(--nav-h);
            background: var(--bg-dark);
            border-bottom: 1px solid #333;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            color: white;
            z-index: 1001;
            box-shadow: 0 2px 15px rgba(0,0,0,0.5);
            flex-shrink: 0; /* Prevent shrinking */
        }

        .nav-left { display: flex; align-items: center; gap: 20px; }
        .nav-logo { font-size: 20px; font-weight: 900; color: var(--primary); letter-spacing: 2px; }
        
        .nav-center { display: flex; gap: 25px; align-items: center; }
        .nav-stat-item { font-size: 12px; color: #888; font-weight: bold; text-transform: uppercase; }
        .nav-stat-val { color: #fff; font-size: 16px; margin-left: 5px; font-family: monospace; }

        .nav-right { display: flex; align-items: center; gap: 15px; }
        
        .history-btn {
            padding: 8px 15px; background: #1a1a24; border: 1px solid #444;
            color: #ccc; cursor: pointer; border-radius: 5px; font-size: 12px; font-weight: bold;
            transition: 0.3s;
        }
        .history-btn:hover { background: #333; color: white; border-color: #666; }

        .wallet-display {
            background: #1a1a24; padding: 8px 15px; border-radius: 5px;
            border: 1px solid #444; display: flex; align-items: center;
        }
        .wallet-val { color: var(--secondary); font-weight: bold; font-size: 16px; margin-left: 10px; }

        /* SPLASH SCREEN */
        #splash-screen {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #000; z-index: 5000; display: flex; flex-direction: column;
            justify-content: center; align-items: center; transition: opacity 0.5s;
        }
        .splash-icon { 
            width: 100px; height: 100px; background: var(--primary); border-radius: 20px;
            display: flex; align-items: center; justify-content: center; font-size: 50px;
            box-shadow: 0 0 30px var(--primary); margin-bottom: 20px;
        }
        .loading-bar-bg { width: 200px; height: 4px; background: #222; border-radius: 2px; margin-top: 20px; overflow: hidden; }
        #loading-bar-fill { width: 0%; height: 100%; background: var(--primary); transition: width 0.1s; }

        /* MAIN CONTENT */
        #main-layout { display: flex; flex-grow: 1; overflow: hidden; position: relative; }

        /* OVERLAY LOBBY */
        #lobby-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.4); z-index: 100;
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            text-align: center; color: white;
        }
        .slogan { font-size: 32px; font-weight: 900; text-shadow: 0 4px 10px rgba(0,0,0,0.5); margin-bottom: 10px; }
        .how-to-btn { 
            padding: 10px 20px; background: rgba(255,255,255,0.1); border: 1px solid #fff;
            color: #fff; cursor: pointer; border-radius: 5px; font-weight: bold; transition: 0.3s;
        }
        .how-to-btn:hover { background: #fff; color: #000; }

        /* SIDEBAR */
        #right-sidebar { 
            width: var(--sidebar-w); background: var(--bg-dark); border-left: 1px solid #333; 
            display: flex; flex-direction: column; padding: 25px 20px; color: white;
            z-index: 1000; box-sizing: border-box; overflow-y: auto;
        }

        .section-header { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; border-bottom: 1px solid #222; padding-bottom: 5px; }
        .bet-input-group { margin-bottom: 20px; }
        label { display: block; margin-bottom: 8px; font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 1.5px; }
        input { width: 100%; padding: 12px; background: #000; border: 1px solid #444; color: white; border-radius: 6px; font-size: 16px; box-sizing: border-box; outline: none; transition: border-color 0.3s; }
        input:focus { border-color: var(--primary); }

        .bet-btn { width: 100%; padding: 16px; background: var(--primary); border: none; color: white; font-weight: bold; font-size: 15px; cursor: pointer; border-radius: 6px; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
        .bet-btn:hover { background: #ff1a66; transform: translateY(-2px); }
        .bet-btn:disabled { background: #222; color: #555; cursor: not-allowed; }

        .cashout-btn { 
            width: 100%; padding: 20px; background: #ffaa00; border: none; color: #000; 
            font-weight: 900; font-size: 22px; cursor: pointer; border-radius: 6px; 
            display: none; margin-bottom: 20px; box-shadow: 0 5px 20px rgba(255,170,0,0.4); 
        }

        .auto-section { background: #15151e; padding: 12px; border-radius: 8px; border: 1px solid #222; margin-bottom: 15px; }
        .auto-row { display: flex; justify-content: space-between; align-items: center; }
        .auto-row.with-input { margin-top: 10px; padding-top: 10px; border-top: 1px solid #222; }
        .auto-label { font-size: 12px; color: #aaa; font-weight: bold; }
        
        .switch { position: relative; display: inline-block; width: 40px; height: 20px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 20px; }
        .slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
        input:checked + .slider { background-color: var(--secondary); }
        input:checked + .slider:before { transform: translateX(20px); }

        #game-wrapper { position: relative; flex-grow: 1; background: #87CEEB; }
        #game-container { width: 100%; height: 100%; }

        .multiplier-display { position: absolute; top: 15%; left: 30px; font-size: 55px; font-weight: 900; color: #fff; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); display: none; pointer-events: none; z-index: 70; font-family: 'Arial Black', sans-serif; }

        /* MODALS */
        #game-over-msg, #howto-modal, #history-modal {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center;
            background: rgba(13,13,18,0.98); padding: 30px; border-radius: 20px; border: 2px solid var(--primary);
            display: none; pointer-events: auto; width: 360px; z-index: 2000; box-shadow: 0 20px 60px rgba(0,0,0,0.8);
            color: white;
        }

        .history-list-full {
            max-height: 250px; overflow-y: auto; text-align: left; margin: 15px 0;
            scrollbar-width: thin; scrollbar-color: var(--primary) #000;
        }
        .history-list-full::-webkit-scrollbar { width: 5px; }
        .history-list-full::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 5px; }
        .history-row { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #222; }
        .history-row:last-child { border-bottom: none; }
        .history-row .mult { font-weight: 900; }
        .history-row .win { color: var(--secondary); }
        .history-row .loss { color: var(--primary); }

        .missed-opportunity { color: #ffaa00; font-size: 14px; font-weight: bold; margin-top: 10px; display: block; }
        #touch-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; display: none; }

        /* MOBILE RESPONSIVE CSS */
        @media (max-width: 768px) {
            #main-layout {
                flex-direction: column;
            }
            #game-wrapper {
                height: 55vh; 
                width: 100%;
                order: 1;
            }
            #right-sidebar {
                width: 100%;
                height: 45vh; /* Scrollable area */
                border-left: none;
                border-top: 1px solid #333;
                padding: 15px;
                order: 2;
            }
            #top-nav {
                height: 50px;
                padding: 0 10px;
            }
            .nav-logo { font-size: 16px; letter-spacing: 1px; }
            .nav-stat-item { display: none; } /* Hide stats on small screens to save space */
            .history-btn { padding: 5px 10px; font-size: 10px; }
            .wallet-val { font-size: 14px; }
            
            /* Compact Modals */
            #game-over-msg, #howto-modal, #history-modal {
                width: 85%;
                max-width: 320px;
                padding: 15px;
                font-size: 13px;
            }
            #game-over-msg h1 { font-size: 24px !important; }
            #result-text { font-size: 18px !important; }
            
            .multiplier-display {
                font-size: 40px;
                top: 10px;
                left: 15px;
            }
            .history-list-full { max-height: 150px; }
        }
/* Casino: narrow embedded viewport */
@media (max-width: 600px) {

#top-nav { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding: 8px; }
.nav-right { flex-wrap: wrap; gap: 6px; }
.nav-logo { font-size: 16px; }
}
