        :root {
            --bg-color: #0a0a0a;
            --ui-bg: rgba(20, 20, 20, 0.95);
            --accent: #00f2ff;
            --accent-hover: #00c3cc;
            --text: #ffffff;
            --font-main: 'Outfit', sans-serif;
        }

        body {
            overflow: hidden;
            background-color: var(--bg-color);
            color: var(--text);
            font-family: var(--font-main);
            margin: 0;
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%);
            user-select: none;
        }
        body.mobile-game-active {
            overflow: hidden;
            touch-action: none;
        }

        /* Screens */
        .screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none; /* Hidden by default */
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 20;
            background: rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
        }

        .screen.active {
            display: flex;
            animation: fadeIn 0.3s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
        
        .shake { animation: shake 0.3s ease-in-out; }

        /* Game Container */
        #game-wrapper {
            perspective: 1200px;
            transition: all 0.5s ease;
            display: none; /* Hidden until game starts */
            position: relative;
        }
        #game-wrapper.active {
            display: block;
        }

        #game-container {
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 20px 50px rgba(0,0,0,0.8);
            border-radius: 8px;
        }

        .view-3d { transform: rotateX(30deg) scale(0.9); }
        .view-2d { transform: rotateX(0deg) scale(1); }

        canvas {
            display: block;
            background: #111;
        }

        /* MAIN MENU LOGO */
        .logo-gradient {
            font-size: 120px;
            margin-bottom: 20px;
            background: linear-gradient(to bottom, #00f2ff, #ffffff);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 0 20px rgba(0, 242, 255, 0.5));
        }

        /* BUTTONS */
        .btn {
            background: transparent;
            border: 2px solid var(--accent);
            color: var(--accent);
            padding: 10px 20px;
            font-size: 18px;
            font-family: var(--font-main);
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin: 5px;
            min-width: 150px;
        }
        .btn:hover {
            background: var(--accent);
            color: #000;
            box-shadow: 0 0 20px var(--accent);
            transform: scale(1.05);
        }
        .btn-small {
            padding: 5px 15px;
            font-size: 14px;
            min-width: auto;
        }

        /* GRIDS */
        .shop-grid, .level-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 15px;
            width: 90%;
            max-width: 800px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 10px;
        }

        .shop-item, .level-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 15px;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            transition: all 0.2s;
            cursor: pointer;
        }
        .shop-item:hover, .level-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
            border-color: var(--accent);
        }
        .shop-item.owned { border-color: #4caf50; }
        .shop-item.equipped { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }

        .shop-preview {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            margin-bottom: 10px;
            border: 2px solid #fff;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
        }
        
        /* SCROLLBAR */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
        ::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

        /* FOOTER */
        .footer {
            position: fixed;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            color: #888;
            z-index: 1000;
        }
        .footer img {
            height: 20px;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .footer img:hover {
            transform: scale(1.1);
        }
        @keyframes geminiSquare {
            0%, 100% { transform: rotate(0deg) scale(1); }
            25% { transform: rotate(90deg) scale(1.5); }
            50% { transform: rotate(180deg) scale(1); }
            75% { transform: rotate(270deg) scale(1.5); }
        }
        .gemini-animate {
            animation: geminiSquare 1s ease-in-out;
        }
        
        * {
            box-sizing: border-box;
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 242, 255, 0.35) transparent;
        }
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(0, 242, 255, 0.35);
            border-radius: 999px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 242, 255, 0.55);
        }

        #ui-layer {
            position: absolute;
            inset: 0;
            z-index: 5;
            pointer-events: none;
        }
        .hud-strip {
            position: absolute;
            top: 14px;
            left: 14px;
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 10px;
            width: min(670px, calc(100% - 180px));
            align-items: stretch;
        }
        .stat-box {
            min-width: 0;
            padding: 9px 10px 8px;
            border: 1px solid rgba(0, 242, 255, 0.25);
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(6, 12, 22, 0.88), rgba(5, 9, 16, 0.8));
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(4px);
        }
        .stat-label {
            display: block;
            font-size: 10px;
            letter-spacing: 1.4px;
            text-transform: uppercase;
            color: rgba(183, 228, 255, 0.76);
            margin-bottom: 3px;
        }
        .stat-value {
            font-size: 21px;
            font-weight: 700;
            color: #fff;
            line-height: 1;
            text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
        }
        .stat-area .stat-value {
            color: #9df9ff;
        }
        .stat-meter {
            display: block;
            width: 100%;
            height: 5px;
            margin-top: 8px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.15);
            overflow: hidden;
        }
        #hud-area-bar {
            display: block;
            height: 100%;
            width: 0%;
            border-radius: 999px;
            background: linear-gradient(90deg, #00e6ff 0%, #00ff9d 100%);
            box-shadow: 0 0 12px rgba(0, 255, 170, 0.5);
            transition: width 0.2s ease;
        }
        .stat-timer.is-warning .stat-value {
            color: #ffb347;
        }
        .stat-timer.is-critical .stat-value {
            color: #ff6464;
            animation: quantnum-timer-pulse 0.7s ease-in-out infinite alternate;
        }
        @keyframes quantnum-timer-pulse {
            from { text-shadow: 0 0 4px rgba(255, 60, 60, 0.4); }
            to { text-shadow: 0 0 14px rgba(255, 60, 60, 0.95); }
        }
        .stat-coins {
            position: absolute;
            top: 14px;
            right: 14px;
            text-align: right;
            min-width: 135px;
            padding: 9px 10px 8px;
        }
        .level-stars {
            margin-top: 6px;
            letter-spacing: 2px;
            color: #ffd700;
            font-size: 16px;
        }
        .game-actions {
            position: absolute;
            right: 14px;
            bottom: 12px;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            z-index: 6;
            pointer-events: auto;
        }
        #gameCanvas {
            width: 800px;
            height: 600px;
            max-width: 100%;
            max-height: 100%;
            border-radius: 8px;
        }
        #rotate-hint {
            position: fixed;
            top: max(10px, env(safe-area-inset-top));
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            background: rgba(0, 0, 0, 0.75);
            border: 1px solid rgba(0, 242, 255, 0.4);
            color: #b7fcff;
            font-size: 13px;
            padding: 8px 12px;
            border-radius: 999px;
            z-index: 1200;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        #rotate-hint.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        #mobile-controls {
            position: fixed;
            left: 0;
            right: 0;
            bottom: max(12px, env(safe-area-inset-bottom));
            display: none;
            align-items: flex-end;
            justify-content: space-between;
            gap: 14px;
            padding: 0 14px;
            z-index: 1100;
            pointer-events: none;
        }
        #mobile-controls.visible {
            display: flex;
        }
        .mobile-col {
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: center;
            pointer-events: auto;
        }
        .mobile-row {
            display: flex;
            gap: 10px;
        }
        .mobile-btn {
            width: 60px;
            height: 60px;
            border-radius: 18px;
            border: 1px solid rgba(0, 242, 255, 0.45);
            background: linear-gradient(180deg, rgba(20, 35, 48, 0.95), rgba(9, 15, 24, 0.95));
            color: #d7feff;
            font-size: 28px;
            font-weight: 700;
            text-align: center;
            touch-action: none;
            user-select: none;
            transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        }
        .mobile-btn-action {
            width: 88px;
            font-size: 16px;
            letter-spacing: 1px;
            color: #9cffe1;
            border-color: rgba(101, 255, 211, 0.55);
        }
        .mobile-btn-alt {
            width: 88px;
            font-size: 22px;
        }
        .mobile-btn.is-active,
        .mobile-btn:active {
            transform: scale(0.95);
            border-color: rgba(0, 242, 255, 0.9);
            box-shadow: 0 8px 24px rgba(0, 242, 255, 0.2);
        }

        @media (max-width: 1024px) {
            body {
                min-height: calc(var(--app-vh, 1vh) * 100);
                height: auto;
                overflow-y: auto;
                padding: 12px 10px 120px;
            }
            .logo-gradient {
                font-size: clamp(56px, 16vw, 90px);
            }
            #game-wrapper {
                width: 100%;
                max-width: 100%;
                padding-top: 8px;
            }
            #game-container {
                margin: 0 auto;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
            }
            #gameCanvas {
                width: min(100vw - 20px, 800px);
                height: auto;
                aspect-ratio: 4 / 3;
            }
            .view-3d {
                transform: none;
            }
            .game-actions {
                bottom: 10px;
                right: 10px;
            }
            .footer {
                bottom: max(8px, env(safe-area-inset-bottom));
                font-size: 12px;
            }
        }

        @media (max-width: 760px) {
            .screen {
                padding: 24px 12px;
                justify-content: flex-start;
                overflow-y: auto;
            }
            .screen h1 {
                font-size: clamp(28px, 9vw, 46px);
                margin: 0 0 14px;
            }
            #ui-layer {
                inset: 8px 8px auto 8px;
            }
            .hud-strip {
                position: relative;
                top: auto;
                left: auto;
                width: 100%;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
            }
            .hud-strip .stat-box {
                position: relative !important;
                top: auto !important;
                left: auto !important;
                right: auto !important;
                min-width: 0;
                width: 100%;
            }
            .stat-coins {
                position: relative;
                top: auto;
                right: auto;
                margin-top: 8px;
                width: 100%;
                text-align: left;
            }
            .stat-value {
                font-size: 17px;
            }
            #global-coins {
                font-size: 18px !important;
                padding: 3px 8px !important;
            }
            .btn {
                min-width: 0;
                width: min(320px, 90vw);
            }
            .shop-grid,
            .level-grid {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
                width: min(96vw, 700px);
                max-height: 48vh;
            }
            .game-actions {
                position: static;
                transform: none;
                margin-top: 12px;
                margin-bottom: 78px;
                justify-content: center;
            }
        }

        @media (max-width: 420px) {
            .mobile-btn {
                width: 54px;
                height: 54px;
                border-radius: 14px;
                font-size: 24px;
            }
            .mobile-btn-action,
            .mobile-btn-alt {
                width: 82px;
            }
            .btn {
                font-size: 16px;
                letter-spacing: 1px;
            }
        }

