/* ------------------------------------------------------------
           CORE VISUALS
           ------------------------------------------------------------ */
        :root {
            --bg: #030303;
            --glass: rgba(10, 15, 20, 0.85);
            --border: rgba(255, 255, 255, 0.15);
            --primary: #00ff41; 
            --secondary: #008f11;
            --accent: #00e5ff;
            --alert: #ff0055;
            --gold: #ffD700;
            --font-mono: 'Fira Code', monospace;
            --font-ui: 'Rajdhani', sans-serif;
            --font-head: 'Orbitron', sans-serif;
        }

        /* THEME CLASSES */
        body.theme-pink { --primary: #ff00cc; --secondary: #99007a; --accent: #ff99eb; }
        body.theme-purple { --primary: #bc13fe; --secondary: #6a0094; --accent: #e08bff; }
        body.theme-gold { --primary: #ffd700; --secondary: #b8860b; --accent: #fffacd; }
        body.theme-cyan { --primary: #00ffff; --secondary: #008b8b; --accent: #e0ffff; }
        body.theme-blood { --primary: #ff0000; --secondary: #8a0000; --accent: #ff6666; }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            background-color: var(--bg);
            color: var(--primary);
            font-family: var(--font-mono);
            height: 100vh; width: 100vw;
            overflow: hidden;
            display: flex; flex-direction: column;
            transition: color 0.5s;
        }

        /* ------------------------------------------------------------
           LAYERS (Z-Index Management)
           ------------------------------------------------------------ */
        .layer {
            position: fixed; inset: 0; z-index: 100;
            display: flex; flex-direction: column;
            justify-content: center; align-items: center;
            background: #000;
        }
        .hidden { display: none !important; }
        .fade-out { opacity: 0; transition: 0.8s; pointer-events: none; }

        /* ------------------------------------------------------------
           1. BIOS INTRO
           ------------------------------------------------------------ */
        #bios-layer { z-index: 500; align-items: flex-start; padding: 40px; color: #ccc; font-size: 14px; background: #000; }
        .bios-line { margin-bottom: 4px; opacity: 0; animation: fadeIn 0.1s forwards; font-family: var(--font-mono); }
        @keyframes fadeIn { to { opacity: 1; } }

        /* ------------------------------------------------------------
           2. LOGIN SCREEN
           ------------------------------------------------------------ */
        #login-layer { z-index: 400; background: rgba(0,0,0,0.9); backdrop-filter: blur(15px); }
        .login-card {
            border: 1px solid var(--primary); padding: 40px; text-align: center;
            box-shadow: 0 0 60px rgba(0,255,65,0.15); background: rgba(0,0,0,0.85);
            border-radius: 12px; width: 90%; max-width: 420px; position: relative;
        }
        .avatar-frame { position: relative; width: 120px; height: 120px; margin: 0 auto 20px; }
        .avatar { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; }
        .spin-ring {
            position: absolute; inset: -8px; border-radius: 50%;
            border: 2px solid transparent; border-top-color: var(--primary);
            animation: spin 2s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        .login-title { font-family: var(--font-head); font-size: 2rem; margin-bottom: 5px; color: #fff; text-shadow: 0 0 10px var(--primary); }
        .login-input {
            background: rgba(255,255,255,0.05); border: 1px solid var(--secondary);
            color: var(--primary); font-family: var(--font-mono); font-size: 1.2rem;
            text-align: center; width: 100%; outline: none; margin: 25px 0; padding: 12px;
            border-radius: 5px; text-transform: uppercase; transition: 0.3s;
        }
        .login-input:focus { border-color: var(--primary); box-shadow: 0 0 20px var(--secondary); }
        .btn {
            background: var(--primary); color: #000; border: none; padding: 12px 30px;
            font-weight: 900; cursor: pointer; font-family: var(--font-head); font-size: 1rem;
            transition: 0.3s; text-transform: uppercase; letter-spacing: 2px;
            clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
        }
        .btn:hover { background: #fff; transform: scale(1.05); box-shadow: 0 0 20px var(--primary); }

        /* ------------------------------------------------------------
           3. MAIN DESKTOP (OS)
           ------------------------------------------------------------ */
        #ui-layer { z-index: 10; justify-content: flex-start; opacity: 0; transition: opacity 1s; }

        /* HEADER */
        #header {
            width: 100%; padding: 10px 20px;
            background: var(--glass); border-bottom: 1px solid var(--border);
            display: flex; justify-content: space-between; align-items: center;
            font-family: var(--font-ui); font-size: 1rem; backdrop-filter: blur(10px);
            z-index: 50; box-shadow: 0 5px 20px rgba(0,0,0,0.5);
        }
        .head-left { display: flex; gap: 20px; }
        .head-right { display: flex; gap: 20px; align-items: center; }
        .sys-stat { display: flex; gap: 5px; color: #aaa; align-items: center; }
        .sys-val { color: var(--primary); font-weight: bold; }
        .live-clock { color: var(--accent); font-weight: bold; font-family: var(--font-mono); }

        /* THEME PICKER */
        .theme-dots { display: flex; gap: 8px; }
        .t-dot { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; border: 1px solid rgba(255,255,255,0.3); transition: 0.2s; }
        .t-dot:hover { transform: scale(1.3); border-color: #fff; }

        /* TERMINAL AREA */
        #terminal-window {
            flex-grow: 1; width: 100%; padding: 20px 20px 100px 20px;
            overflow-y: auto; scrollbar-width: none; font-size: 0.9rem;
            display: flex; flex-direction: column; align-items: flex-start;
        }
        #terminal-window::-webkit-scrollbar { display: none; }

        .log { margin-bottom: 8px; line-height: 1.5; max-width: 900px; animation: slideIn 0.2s ease-out; }
        @keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
        
        .os-badge { background: var(--secondary); color: #000; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.7rem; margin-right: 8px; vertical-align: middle; }
        .log-cmd { color: #fff; opacity: 0.7; margin: 10px 0; border-left: 3px solid var(--primary); padding-left: 10px; font-style: italic; }
        .log-txt { color: var(--primary); }
        .log-info { color: var(--accent); }
        .log-warn { color: var(--gold); }
        .log-err { color: var(--alert); }

        /* COMMAND LIST TABLE */
        .cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; width: 100%; margin-top: 10px; }
        .cmd-item { border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 5px; display: flex; gap: 10px; }
        .cmd-key { color: var(--gold); font-weight: bold; width: 30px; }
        .cmd-val { color: var(--primary); font-weight: bold; }

        /* SOCIAL CARDS */
        .social-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
        .social-btn {
            background: rgba(255,255,255,0.05); border: 1px solid var(--secondary); padding: 10px 20px;
            color: #fff; text-decoration: none; transition: 0.3s; display: flex; align-items: center; gap: 5px;
        }
        .social-btn:hover { background: var(--primary); color: #000; transform: translateY(-3px); }

        /* INPUT BAR */
        #command-bar {
            position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
            width: 95%; max-width: 800px;
            background: rgba(10, 10, 15, 0.95); border: 1px solid var(--border);
            box-shadow: 0 10px 40px rgba(0,0,0,0.6); border-radius: 12px;
            padding: 8px 15px; display: flex; align-items: center; gap: 10px;
            backdrop-filter: blur(15px); z-index: 60;
        }
        .cmd-prompt { color: var(--primary); font-weight: bold; font-size: 1.2rem; }
        #cmd-input {
            background: transparent; border: none; color: #fff;
            font-family: var(--font-mono); font-size: 1.1rem; flex-grow: 1; outline: none;
        }
        #send-btn {
            background: var(--primary); border: none; width: 40px; height: 40px;
            border-radius: 8px; color: #000; cursor: pointer; display: flex; font-size: 1.2rem;
            justify-content: center; align-items: center; transition: 0.2s;
        }
        #send-btn:hover { background: #fff; transform: scale(1.1); }

        /* ------------------------------------------------------------
           4. GAME OVERLAYS
           ------------------------------------------------------------ */
        #game-menu { z-index: 550; background: rgba(0,0,0,0.9); display: none; text-align: center; }
        .game-card { 
            border: 1px solid var(--primary); padding: 30px; margin: 15px; width: 220px; 
            cursor: pointer; background: rgba(255,255,255,0.05); transition: 0.3s;
        }
        .game-card:hover { background: var(--primary); color: #000; transform: scale(1.05); }

        #game-overlay { z-index: 600; background: rgba(0,0,0,0.98); display: none; flex-direction: column; justify-content: center; align-items: center; }
        .game-canvas-container { border: 2px solid var(--primary); background: #000; box-shadow: 0 0 30px var(--dim); }

        /* ------------------------------------------------------------
           5. CELEBRATION
           ------------------------------------------------------------ */
        #celebration-overlay { z-index: 900; background: rgba(0,0,0,0.85); display: none; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
        .celebrate-card {
            border: 4px solid var(--gold); padding: 50px; background: rgba(10,10,10,0.95);
            box-shadow: 0 0 60px var(--gold); border-radius: 20px; width: 90%; max-width: 600px;
            animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        @keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
        .celeb-title { font-family: var(--font-head); font-size: 3rem; color: var(--gold); margin-bottom: 20px; text-shadow: 0 0 30px var(--gold); }
        .celeb-quote { font-family: var(--font-ui); font-size: 1.5rem; color: #fff; margin-bottom: 30px; font-style: italic; }

        /* ------------------------------------------------------------
           VISUALS
           ------------------------------------------------------------ */
        canvas#bg-canvas { position: fixed; inset: 0; opacity: 0.15; pointer-events: none; z-index: 1; }
        canvas#fireworks-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 800; display: none; }
        .scanline {
            width: 100%; height: 5px; background: rgba(255,255,255,0.03);
            position: fixed; animation: scan 6s linear infinite; pointer-events: none; z-index: 55;
        }
        #watermark {
            position: fixed; bottom: 85px; right: 20px; font-size: 11px;
            color: var(--primary); opacity: 0.3; pointer-events: none; z-index: 15; letter-spacing: 1px;
        }
        
        #outro-layer { z-index: 9999; display: none; background: #000; }
        .shutdown-msg { font-size: 3rem; color: var(--alert); font-family: var(--font-head); animation: blink 0.5s infinite; }

        @keyframes scan { 0% { top: -10px; } 100% { top: 100vh; } }
        @keyframes blink { 50% { opacity: 0; } }

        @media (max-width: 600px) {
            #command-bar { width: 95%; bottom: 10px; }
            .celeb-title { font-size: 2rem; }
            #header { font-size: 0.8rem; padding: 10px; }
            .head-right { display: none; }
        }