        @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Courier+Prime:wght@400;700&display=swap');

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

        :root {
            --primary: #00ff88;
            --secondary: #ff006e;
            --accent: #00d4ff;
            --dark-bg: #0a0e27;
            --card-bg: rgba(15, 25, 50, 0.8);
            --text: #ffffff;
            --text-secondary: #a0aec0;
            --glow: rgba(0, 255, 136, 0.5);
            --shadow: 0 0 20px rgba(0, 255, 136, 0.3);
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #0a0e27 0%, #1a0e35 50%, #0a0e27 100%);
            font-family: 'Courier Prime', monospace;
            color: var(--text);
            overflow: hidden;
            padding: 10px;
            position: relative;
        }

        /* Animated background particles */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(circle at 20% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%);
            pointer-events: none;
            z-index: -1;
            animation: gradientShift 8s ease-in-out infinite;
        }

        @keyframes gradientShift {

            0%,
            100% {
                background:
                    radial-gradient(circle at 20% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%);
            }

            50% {
                background:
                    radial-gradient(circle at 80% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 20% 70%, rgba(255, 0, 110, 0.1) 0%, transparent 50%);
            }
        }

        .game-wrapper {
            position: relative;
            perspective: 1000px;
        }

        #gameContainer {
            position: relative;
            width: 100%;
            max-width: 380px;
            height: 640px;
            background: linear-gradient(180deg, #0f1a32 0%, #1a2a4a 50%, #0f1a32 100%);
            border-radius: 20px;
            overflow: hidden;
            box-shadow:
                0 0 30px var(--shadow),
                0 0 60px rgba(255, 0, 110, 0.2),
                inset 0 0 30px rgba(0, 255, 136, 0.05);
            border: 2px solid rgba(0, 255, 136, 0.2);
            animation: containerPulse 6s ease-in-out infinite;
        }

        @keyframes containerPulse {

            0%,
            100% {
                box-shadow:
                    0 0 30px var(--shadow),
                    0 0 60px rgba(255, 0, 110, 0.2),
                    inset 0 0 30px rgba(0, 255, 136, 0.05);
            }

            50% {
                box-shadow:
                    0 0 40px var(--shadow),
                    0 0 80px rgba(255, 0, 110, 0.3),
                    inset 0 0 30px rgba(0, 255, 136, 0.1);
            }
        }

        #gameCanvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* Preloader */
        #preloader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0a0e27 0%, #1a0e35 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            animation: fadeOut 0.6s ease-out 2.5s forwards;
        }

        @keyframes fadeOut {
            to {
                opacity: 0;
                visibility: hidden;
            }
        }

        .loader {
            width: 80px;
            height: 80px;
            position: relative;
            margin-bottom: 30px;
        }

        .loader::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 3px solid transparent;
            border-top-color: var(--primary);
            border-right-color: var(--accent);
            border-radius: 50%;
            animation: spin 1.2s linear infinite;
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
        }

        .loader::after {
            content: '';
            position: absolute;
            top: 15px;
            left: 15px;
            width: 50px;
            height: 50px;
            border: 3px solid transparent;
            border-bottom-color: var(--secondary);
            border-left-color: var(--accent);
            border-radius: 50%;
            animation: spinReverse 2s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes spinReverse {
            to {
                transform: rotate(-360deg);
            }
        }

        #preloader h2 {
            font-family: 'Orbitron', sans-serif;
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 10px;
            text-transform: uppercase;
            background: linear-gradient(90deg, var(--primary), var(--accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: 2px;
            animation: glow 2s ease-in-out infinite;
        }

        #preloader p {
            font-size: 14px;
            color: var(--text-secondary);
            letter-spacing: 1px;
            margin-top: 10px;
        }

        @keyframes glow {

            0%,
            100% {
                text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
            }

            50% {
                text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
            }
        }

        #gameUI {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 50;
        }

        /* UI Panels */
        .ui-panel {
            position: absolute;
            background: var(--card-bg);
            border: 1px solid var(--primary);
            border-radius: 10px;
            padding: 12px 16px;
            color: var(--primary);
            font-weight: bold;
            font-size: 14px;
            font-family: 'Orbitron', sans-serif;
            pointer-events: auto;
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
            backdrop-filter: blur(10px);
            letter-spacing: 1px;
            transition: all 0.3s ease;
        }

        .ui-panel:hover {
            box-shadow: 0 0 25px rgba(0, 255, 136, 0.6);
            border-color: var(--accent);
        }

        #scorePanel {
            top: 15px;
            left: 15px;
            animation: slideInLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        #speedPanel {
            top: 15px;
            right: 15px;
            background: rgba(255, 0, 110, 0.1);
            border-color: var(--secondary);
            color: var(--secondary);
            box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
            animation: slideInRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        #livesPanel {
            top: 70px;
            right: 15px;
            background: rgba(255, 0, 110, 0.1);
            border-color: var(--secondary);
            color: var(--secondary);
            box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
            animation: slideInRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
        }

        #controlsPanel {
            top: 70px;
            left: 30%;
            transform: translateX(-50%);
            text-align: center;
            font-size: 12px;
            background: var(--card-bg);
            border: 1px solid var(--accent);
            color: var(--accent);
            box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
            animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
        }

        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-30px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(30px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Game Over Screen */
        #gameOverScreen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(26, 14, 53, 0.95) 100%);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 75;
            backdrop-filter: blur(5px);
            animation: modalFadeIn 0.5s ease-out;
            pointer-events: auto;
        }

        #gameOverScreen.show {
            display: flex;
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        #gameOverScreen h2 {
            font-family: 'Orbitron', sans-serif;
            font-size: 38px;
            font-weight: 900;
            margin-bottom: 20px;
            text-transform: uppercase;
            background: linear-gradient(90deg, var(--secondary), var(--primary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: 3px;
            animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
            text-shadow: 0 0 20px rgba(255, 0, 110, 0.5);
        }

        #finalScore {
            font-size: 22px;
            margin-bottom: 40px;
            color: var(--primary);
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 2px;
            animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
        }

        @keyframes bounceIn {
            0% {
                opacity: 0;
                transform: scale(0.3) translateY(-50px);
            }

            50% {
                opacity: 1;
            }

            100% {
                transform: scale(1) translateY(0);
            }
        }

        @keyframes scaleIn {
            from {
                opacity: 0;
                transform: scale(0.8);
            }

            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Car Selection Screen */
        #carSelectionScreen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(26, 14, 53, 0.95) 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 75;
            backdrop-filter: blur(5px);
            animation: modalFadeIn 0.5s ease-out;
            pointer-events: auto;
            overflow-y: auto;
        }

        #carSelectionScreen h2 {
            font-family: 'Orbitron', sans-serif;
            font-size: 36px;
            font-weight: 700;
            margin-bottom: 20px;
            text-transform: uppercase;
            background: linear-gradient(90deg, var(--primary), var(--accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: 2px;
            text-align: center;
        }

        .car-options-container {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            padding: 20px;
            max-width: 100%;
            animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
        }

        .car-option {
            width: 100px;
            height: 140px;
            cursor: pointer;
            border: 2px solid var(--primary);
            border-radius: 12px;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            display: flex;
            justify-content: center;
            align-items: center;
            background: rgba(0, 255, 136, 0.05);
            box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
            position: relative;
            overflow: hidden;
        }

        .car-option::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(0, 255, 136, 0.3) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .car-option:hover {
            transform: scale(1.1) translateY(-5px);
            border-color: var(--accent);
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 40px rgba(0, 212, 255, 0.3);
        }

        .car-option:hover::before {
            opacity: 1;
        }

        .car-option.selected {
            border-color: var(--secondary);
            background: rgba(255, 0, 110, 0.1);
            box-shadow:
                0 0 20px rgba(255, 0, 110, 0.5),
                inset 0 0 20px rgba(255, 0, 110, 0.1);
            animation: pulse 1s ease-in-out infinite;
        }

        @keyframes pulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }
        }

        .car-preview {
            width: 70px;
            height: 100px;
            position: relative;
            filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.4));
            transition: all 0.3s;
        }

        .car-option:hover .car-preview {
            filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
        }

        /* Buttons */
        button {
            background: linear-gradient(90deg, var(--primary), var(--accent));
            color: var(--dark-bg);
            border: none;
            padding: 14px 32px;
            font-size: 16px;
            font-weight: 700;
            border-radius: 10px;
            cursor: pointer;
            pointer-events: auto;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
            font-family: 'Orbitron', sans-serif;
            margin: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
            position: relative;
            overflow: hidden;
        }

        button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.2);
            transition: left 0.5s ease;
        }

        button:hover::before {
            left: 100%;
        }

        button:hover {
            transform: translateY(-3px);
            box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 5px 15px rgba(0, 0, 0, 0.3);
        }

        button:active {
            transform: translateY(-1px);
        }

        /* Score display animations */
        .score-popup {
            position: absolute;
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 20px;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
            text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
        }

        /* ================= MOBILE CONTROLS ================= */
        #mobileControls {
            position: absolute;
            bottom: 15px;
            left: 0;
            width: 100%;
            display: none;
            justify-content: space-between;
            padding: 0 20px;
            pointer-events: auto;
            z-index: 60;
        }

        #mobileControls button {
            width: 70px;
            height: 70px;
            font-size: 26px;
            border-radius: 50%;
            background: rgba(0, 255, 136, 0.15);
            border: 2px solid var(--primary);
            color: var(--primary);
            backdrop-filter: blur(10px);
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
        }

        #mobileControls button:active {
            transform: scale(0.9);
            box-shadow: 0 0 25px rgba(0, 255, 136, 0.8);
        }

        /* Show only on mobile */
        @media (max-width: 768px) {
            #mobileControls {
                display: flex;
            }

            #controlsPanel {
                display: none;
            }

            #gameContainer {
                height: 100vh;
                max-width: 100%;
                border-radius: 0;
            }

            body {
                padding: 0;
            }
        }

        @keyframes floatUp {
            0% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }

            100% {
                opacity: 0;
                transform: translateY(-50px) scale(0.5);
            }
        }

        /* Damage flash effect */
        .damage-flash {
            animation: damageFlash 0.4s ease-out;
        }

        @keyframes damageFlash {

            0%,
            100% {
                background: transparent;
            }

            50% {
                background: rgba(255, 0, 110, 0.3);
            }
        }

        /* Particle system */
        .particle {
            position: absolute;
            pointer-events: none;
            border-radius: 50%;
            animation: particleFloat 1s ease-out forwards;
        }

        @keyframes particleFloat {
            0% {
                opacity: 1;
                transform: translate(0, 0) scale(1);
            }

            100% {
                opacity: 0;
                transform: translate(var(--tx), var(--ty)) scale(0);
            }
        }

        /* Responsive adjustments */
        @media (max-width: 600px) {
            #gameContainer {
                max-width: 100%;
                height: calc(100vh - 40px);
            }

            #gameOverScreen h2 {
                font-size: 32px;
            }

            button {
                padding: 12px 24px;
                font-size: 14px;
            }
        }