        :root {
            --cyan: #00f2ff;
            --purple: #b400ff;
            --pink: #ff00aa;
            --gold: #ffd700;
            --bg-deep: #04040f;
            --bg-mid: #0d0d24;
            --panel: rgba(10, 10, 35, 0.85);
            --border-glow: rgba(0, 242, 255, 0.35);
            --text: #e8f4ff;
        }

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

        @keyframes scanline {
            0% { transform: translateY(-100%); }
            100% { transform: translateY(100vh); }
        }
        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(0, 242, 255, 0.3); }
            50% { box-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(0, 242, 255, 0.5), 0 0 60px rgba(0, 242, 255, 0.2); }
        }
        @keyframes title-flicker {
            0%, 95%, 100% { opacity: 1; }
            96% { opacity: 0.8; }
            97% { opacity: 1; }
            98% { opacity: 0.6; }
        }
        @keyframes float-y {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-8px); }
        }
        @keyframes spin-slow {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes rgb-shift {
            0% { filter: hue-rotate(0deg); }
            100% { filter: hue-rotate(360deg); }
        }
        @keyframes slide-in-up {
            from { transform: translateY(60px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        @keyframes bar-fill {
            from { width: 0%; }
            to { width: var(--target-width, 100%); }
        }
        @keyframes star-twinkle {
            0%, 100% { opacity: 0.2; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.4); }
        }
        @keyframes neon-border-pulse {
            0%, 100% { border-color: rgba(0, 242, 255, 0.4); }
            50% { border-color: rgba(0, 242, 255, 0.9); }
        }
        @keyframes score-pop {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); color: var(--gold); text-shadow: 0 0 20px var(--gold); }
            100% { transform: scale(1); }
        }
        @keyframes gameover-shake {
            0%, 100% { transform: translateX(0); }
            20% { transform: translateX(-10px) rotate(-1deg); }
            40% { transform: translateX(10px) rotate(1deg); }
            60% { transform: translateX(-8px); }
            80% { transform: translateX(8px); }
        }
        @keyframes dots {
            0% { content: ''; }
            25% { content: '.'; }
            50% { content: '..'; }
            75% { content: '...'; }
        }

        body, html {
            height: 100%;
            overflow: hidden;
            background: var(--bg-deep);
            font-family: 'Exo 2', sans-serif;
            color: var(--text);
            touch-action: none;
            cursor: crosshair;
        }

        #starfield {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }
        .star {
            position: absolute;
            border-radius: 50%;
            background: white;
            animation: star-twinkle var(--dur) ease-in-out infinite;
            animation-delay: var(--delay);
        }

        #scanline {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 99;
            background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.03) 50%);
            background-size: 100% 4px;
            opacity: 0.4;
        }
        #scan-beam {
            position: fixed;
            left: 0; top: 0;
            width: 100%; height: 2px;
            background: linear-gradient(transparent, rgba(0, 242, 255, 0.15), transparent);
            animation: scanline 6s linear infinite;
            pointer-events: none;
            z-index: 99;
        }

        #game-container {
            position: relative;
            width: 100vw; height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1;
        }

        canvas {
            position: relative;
            z-index: 2;
            border: 1px solid rgba(0, 242, 255, 0.25);
            border-radius: 4px;
            box-shadow:
                0 0 0 1px rgba(0, 242, 255, 0.1),
                0 0 30px rgba(0, 242, 255, 0.15),
                0 0 60px rgba(180, 0, 255, 0.1),
                inset 0 0 60px rgba(0, 0, 0, 0.4);
            max-width: 100%;
            max-height: 100%;
        }

        .overlay {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10;
        }
        .hidden { display: none !important; }

        /* PRELOADER */
        #preloader { background: var(--bg-deep); z-index: 100; }
        #preloader .logo-wrap { text-align: center; animation: float-y 3s ease-in-out infinite; }
        #preloader .logo-sub {
            font-family: 'Orbitron', monospace;
            font-size: 0.75rem; letter-spacing: 0.6em;
            color: var(--purple); text-transform: uppercase;
            margin-bottom: 12px; opacity: 0.8;
        }
        #preloader .logo-main {
            font-family: 'Orbitron', monospace;
            font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 900;
            background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
            -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
            line-height: 1;
            animation: rgb-shift 4s linear infinite;
        }
        .loader-track {
            width: 260px; height: 3px;
            background: rgba(255,255,255,0.08);
            border-radius: 99px; margin-top: 32px;
            position: relative; overflow: hidden;
        }
        .loader-track::before {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(90deg, transparent, rgba(0,242,255,0.3), transparent);
            animation: scanline 1.5s linear infinite;
        }
        #fill {
            height: 100%;
            background: linear-gradient(90deg, var(--cyan), var(--purple));
            border-radius: 99px;
            transition: width 0.08s linear;
            box-shadow: 0 0 10px var(--cyan);
        }
        #load-status {
            font-family: 'Orbitron', monospace;
            font-size: 0.65rem; letter-spacing: 0.3em;
            color: rgba(0,242,255,0.6); margin-top: 14px; text-transform: uppercase;
        }
        .loading-dots::after { content: ''; animation: dots 1.5s steps(4, end) infinite; }

        /* MAIN MENU */
        #main-menu { background: radial-gradient(ellipse at center, rgba(13,13,36,0.97) 0%, rgba(4,4,15,0.98) 100%); }
        .menu-deco-ring { position: absolute; border-radius: 50%; border: 1px solid; pointer-events: none; }
        .ring-1 { width: 500px; height: 500px; border-color: rgba(0,242,255,0.06); animation: spin-slow 30s linear infinite; }
        .ring-2 { width: 360px; height: 360px; border-color: rgba(180,0,255,0.08); animation: spin-slow 20s linear infinite reverse; }
        .ring-3 { width: 220px; height: 220px; border-color: rgba(255,0,170,0.08); animation: spin-slow 15s linear infinite; }
        .ring-1::before, .ring-2::before, .ring-3::before {
            content: ''; position: absolute;
            width: 6px; height: 6px; border-radius: 50%;
            background: var(--cyan); top: -3px; left: 50%;
            box-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan);
        }
        .ring-2::before { background: var(--purple); box-shadow: 0 0 10px var(--purple), 0 0 20px var(--purple); }
        .ring-3::before { background: var(--pink); box-shadow: 0 0 10px var(--pink), 0 0 20px var(--pink); }
        .menu-content { position: relative; z-index: 2; text-align: center; animation: slide-in-up 0.8s cubic-bezier(0.23,1,0.32,1) both; }
        .menu-eyebrow { font-family: 'Orbitron', monospace; font-size: 0.65rem; letter-spacing: 0.5em; color: var(--purple); text-transform: uppercase; margin-bottom: 8px; opacity: 0.9; }
        .menu-title {
            font-family: 'Orbitron', monospace;
            font-size: clamp(3rem, 10vw, 5.5rem); font-weight: 900; line-height: 0.9;
            background: linear-gradient(160deg, #fff 0%, var(--cyan) 40%, var(--purple) 100%);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
            filter: drop-shadow(0 0 30px rgba(0,242,255,0.4));
            animation: title-flicker 8s ease-in-out infinite;
            margin-bottom: 4px;
        }
        .menu-subtitle {
            font-family: 'Orbitron', monospace;
            font-size: clamp(0.9rem, 3vw, 1.3rem); font-weight: 400;
            color: var(--pink); letter-spacing: 0.5em; text-transform: uppercase;
            margin-bottom: 40px; text-shadow: 0 0 20px var(--pink);
        }
        .btn-primary {
            position: relative; padding: 16px 52px;
            font-family: 'Orbitron', monospace; font-size: 1rem; font-weight: 700;
            letter-spacing: 0.15em; cursor: pointer;
            border: 1px solid rgba(0,242,255,0.5); border-radius: 3px;
            background: rgba(0,242,255,0.06); color: var(--cyan);
            text-transform: uppercase; transition: all 0.25s ease; overflow: hidden; outline: none;
        }
        .btn-primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--cyan), var(--purple)); opacity: 0; transition: opacity 0.25s; }
        .btn-primary::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); transition: left 0.4s ease; }
        .btn-primary:hover { color: #fff; border-color: var(--cyan); box-shadow: 0 0 20px rgba(0,242,255,0.4), 0 0 60px rgba(0,242,255,0.2), inset 0 0 20px rgba(0,242,255,0.1); transform: translateY(-2px); }
        .btn-primary:hover::before { opacity: 0.15; }
        .btn-primary:hover::after { left: 120%; }
        .btn-primary:active { transform: translateY(1px); }
        .btn-primary span { position: relative; z-index: 1; }
        .highscore-wrap { margin: auto; display: block; margin-top: 28px; align-items: center; gap: 12px; opacity: 0.7; font-family: 'Orbitron', monospace; font-size: 0.72rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.5); }
        .hs-divider { width: 30px; height: 1px; background: rgba(255,255,255,0.2); }
        #high-score { color: var(--gold); text-shadow: 0 0 10px var(--gold); }

        /* HUD */
        #ui-layer { position: absolute; top: 0; left: 0; pointer-events: none; width: 100%; z-index: 5; display: flex; align-items: flex-start; gap: 8px; padding: 12px; }
        .hud-panel { background: var(--panel); border: 1px solid rgba(0,242,255,0.18); border-radius: 4px; padding: 8px 16px; backdrop-filter: blur(12px); animation: neon-border-pulse 3s ease-in-out infinite; position: relative; overflow: hidden; }
        .hud-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: 0.6; }
        .hud-label { font-family: 'Orbitron', monospace; font-size: 0.5rem; letter-spacing: 0.25em; color: rgba(0,242,255,0.5); text-transform: uppercase; margin-bottom: 2px; }
        .hud-value { font-family: 'Orbitron', monospace; font-size: 1.1rem; font-weight: 700; color: #fff; text-shadow: 0 0 10px rgba(0,242,255,0.5); }
        #score-val { transition: all 0.15s; }
        #score-val.pop { animation: score-pop 0.4s ease; }
        .hud-spacer { flex: 1; }
        #pause-btn { pointer-events: all; background: var(--panel); border: 1px solid rgba(0,242,255,0.18); border-radius: 4px; padding: 8px 16px; font-family: 'Orbitron', monospace; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.2em; color: rgba(0,242,255,0.7); cursor: pointer; text-transform: uppercase; transition: all 0.2s; backdrop-filter: blur(12px); }
        #pause-btn:hover { color: var(--cyan); border-color: rgba(0,242,255,0.5); box-shadow: 0 0 15px rgba(0,242,255,0.25); }

        /* PAUSE */
        #pause-overlay { background: rgba(4,4,15,0.9); backdrop-filter: blur(20px); }
        .pause-title { font-family: 'Orbitron', monospace; font-size: 3rem; font-weight: 900; color: var(--cyan); text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0,242,255,0.3); letter-spacing: 0.2em; margin-bottom: 32px; }
        .pause-line { width: 200px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); margin: 0 auto 32px; }

        /* GAME OVER */
        #gameover-overlay { background: rgba(4,4,15,0.92); backdrop-filter: blur(20px); }
        .go-title { font-family: 'Orbitron', monospace; font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 900; color: var(--pink); text-shadow: 0 0 30px var(--pink), 0 0 60px rgba(255,0,170,0.3); letter-spacing: 0.1em; margin-bottom: 12px; animation: gameover-shake 0.6s ease 0.3s both; }
        .go-score-label { font-family: 'Orbitron', monospace; font-size: 0.65rem; letter-spacing: 0.4em; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 6px; }
        .go-score-val { font-family: 'Orbitron', monospace; font-size: 3rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(255,215,0,0.4); margin-bottom: 8px; }
        .go-hs { font-family: 'Exo 2', sans-serif; font-size: 0.85rem; color: rgba(255,255,255,0.35); margin-bottom: 36px; }
        .go-hs span { color: var(--gold); font-weight: 700; }
        .bracket-box { position: relative; padding: 28px 40px; }
        .bracket-box::before, .bracket-box::after { content: ''; position: absolute; width: 20px; height: 20px; }
        .bracket-box::before { top: 0; left: 0; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
        .bracket-box::after { bottom: 0; right: 0; border-bottom: 2px solid var(--purple); border-right: 2px solid var(--purple); }

        /* NEXT PREVIEW */
        #next-preview { position: absolute; bottom: 12px; right: 12px; z-index: 5; pointer-events: none; }
        .next-label { font-family: 'Orbitron', monospace; font-size: 0.5rem; letter-spacing: 0.25em; color: rgba(0,242,255,0.4); text-transform: uppercase; text-align: center; margin-bottom: 4px; }
        #next-canvas { display: block; border: 1px solid rgba(0,242,255,0.15); border-radius: 4px; background: rgba(10,10,35,0.6); }

        /* LEVEL BADGE */
        .level-badge { background: linear-gradient(135deg, rgba(180,0,255,0.2), rgba(0,242,255,0.1)); border: 1px solid rgba(180,0,255,0.35); }
        .level-badge .hud-value { color: var(--purple); text-shadow: 0 0 10px var(--purple); }

        /* LEVEL COMPLETE */
        @keyframes lc-backdrop-in { from { opacity: 0; backdrop-filter: blur(0px); } to { opacity: 1; backdrop-filter: blur(24px); } }
        @keyframes lc-card-in { 0% { transform: scale(0.5) translateY(40px); opacity: 0; } 70% { transform: scale(1.04) translateY(-4px); opacity: 1; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
        @keyframes lc-badge-spin { 0% { transform: rotate(-15deg) scale(0); opacity: 0; } 60% { transform: rotate(8deg) scale(1.15); opacity: 1; } 100% { transform: rotate(0deg) scale(1); opacity: 1; } }
        @keyframes lc-shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
        @keyframes lc-stars-burst { 0% { transform: scale(0) rotate(0deg); opacity: 1; } 80% { transform: scale(1.2) rotate(180deg); opacity: 1; } 100% { transform: scale(1) rotate(200deg); opacity: 0.8; } }
        @keyframes lc-glow-pulse { 0%, 100% { box-shadow: 0 0 30px rgba(0,242,255,0.3), 0 0 60px rgba(180,0,255,0.2); } 50% { box-shadow: 0 0 60px rgba(0,242,255,0.6), 0 0 120px rgba(180,0,255,0.4), 0 0 180px rgba(255,0,170,0.2); } }
        @keyframes lc-stat-in { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes lc-btn-ready { 0%, 100% { box-shadow: 0 0 15px rgba(0,242,255,0.3); } 50% { box-shadow: 0 0 30px rgba(0,242,255,0.7), 0 0 60px rgba(0,242,255,0.3); } }

        #levelcomplete-overlay { background: rgba(4,4,15,0.88); animation: lc-backdrop-in 0.4s ease forwards; z-index: 20; }
        #fw-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
        .lc-card {
            position: relative; z-index: 1;
            width: min(340px, 88vw);
            background: linear-gradient(145deg, rgba(12,12,40,0.97), rgba(6,6,20,0.99));
            border: 1px solid rgba(0,242,255,0.25); border-radius: 12px;
            padding: 36px 32px 28px; text-align: center;
            animation: lc-card-in 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.1s both, lc-glow-pulse 2.5s ease-in-out 0.7s infinite;
            overflow: hidden;
        }
        .lc-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), var(--pink), transparent); animation: lc-shimmer 2s linear infinite; background-size: 200% auto; }
        .lc-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent); }
        .lc-level-badge { display: inline-block; font-family: 'Orbitron', monospace; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.35em; color: var(--purple); background: rgba(180,0,255,0.12); border: 1px solid rgba(180,0,255,0.35); border-radius: 99px; padding: 5px 18px; margin-bottom: 16px; text-transform: uppercase; animation: lc-badge-spin 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.4s both; }
        .lc-star-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; animation: lc-stars-burst 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.5s both; }
        .lc-star { font-size: 2rem; filter: drop-shadow(0 0 8px var(--gold)); }
        .lc-title { font-family: 'Orbitron', monospace; font-size: clamp(1.6rem,6vw,2.2rem); font-weight: 900; background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--purple) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.1; margin-bottom: 6px; }
        .lc-subtitle { font-family: 'Exo 2', sans-serif; font-size: 0.78rem; color: rgba(255,255,255,0.35); letter-spacing: 0.12em; margin-bottom: 26px; }
        .lc-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, rgba(0,242,255,0.2), transparent); margin-bottom: 20px; }
        .lc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
        .lc-stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 12px 10px; animation: lc-stat-in 0.4s ease both; }
        .lc-stat:nth-child(1) { animation-delay: 0.65s; }
        .lc-stat:nth-child(2) { animation-delay: 0.75s; }
        .lc-stat:nth-child(3) { animation-delay: 0.85s; }
        .lc-stat:nth-child(4) { animation-delay: 0.95s; }
        .lc-stat-label { font-family: 'Orbitron', monospace; font-size: 0.45rem; letter-spacing: 0.25em; color: rgba(0,242,255,0.45); text-transform: uppercase; margin-bottom: 4px; }
        .lc-stat-val { font-family: 'Orbitron', monospace; font-size: 1.25rem; font-weight: 900; color: #fff; }
        .lc-stat-val.gold { color: var(--gold); text-shadow: 0 0 12px var(--gold); }
        .lc-stat-val.cyan { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
        .lc-next-btn { width: 100%; padding: 15px; font-family: 'Orbitron', monospace; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.18em; cursor: pointer; border: 1px solid rgba(0,242,255,0.5); border-radius: 6px; background: linear-gradient(135deg, rgba(0,242,255,0.12), rgba(180,0,255,0.08)); color: var(--cyan); text-transform: uppercase; transition: all 0.25s; outline: none; position: relative; overflow: hidden; animation: lc-btn-ready 1.8s ease-in-out 1.2s infinite; }
        .lc-next-btn::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent); transition: left 0.5s; }
        .lc-next-btn:hover { background: linear-gradient(135deg, rgba(0,242,255,0.22), rgba(180,0,255,0.18)); color: #fff; border-color: var(--cyan); transform: translateY(-2px); }
        .lc-next-btn:hover::after { left: 120%; }
        .lc-next-btn:active { transform: translateY(1px); }
        .lc-corner { position: absolute; width: 16px; height: 16px; }
        .lc-corner.tl { top: 8px; left: 8px; border-top: 2px solid rgba(0,242,255,0.5); border-left: 2px solid rgba(0,242,255,0.5); }
        .lc-corner.tr { top: 8px; right: 8px; border-top: 2px solid rgba(180,0,255,0.5); border-right: 2px solid rgba(180,0,255,0.5); }
        .lc-corner.bl { bottom: 8px; left: 8px; border-bottom: 2px solid rgba(180,0,255,0.5); border-left: 2px solid rgba(180,0,255,0.5); }
        .lc-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid rgba(0,242,255,0.5); border-right: 2px solid rgba(0,242,255,0.5); }