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

html, body {
    height: 100%;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 400px;
    height: 600px;
    border-radius: 12px;
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.3),
        0 0 80px rgba(0, 212, 255, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    max-width: 100vw;
    max-height: 100vh;
}

#game-canvas {
    display: block;
    background-color: #2d2d2d;
    border: 4px solid #333;
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

#game-canvas-3d {
    display: block;
    border: 4px solid #333;
    border-radius: 10px;
    touch-action: none;
    position: absolute;
    top: 0;
    left: 0;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg,
        rgba(10, 15, 30, 0.98) 0%,
        rgba(5, 10, 25, 0.99) 100%);
    color: #fff;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    overflow: hidden;
}

/* =============================================
   MENU BACKGROUND EFFECTS
   ============================================= */

.menu-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.road-lines {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 100%;
    background: repeating-linear-gradient(
        to top,
        transparent 0px,
        transparent 30px,
        rgba(255, 255, 255, 0.1) 30px,
        rgba(255, 255, 255, 0.1) 60px
    );
    animation: roadScroll 2s linear infinite;
    opacity: 0.5;
}

@keyframes roadScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 60px; }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #00d4ff 0%, transparent 70%);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #ff6b00 0%, transparent 70%);
    bottom: 20%;
    right: -30px;
    animation-delay: -3s;
}

.orb-3 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #00ff88 0%, transparent 70%);
    bottom: -20px;
    left: 20%;
    animation-delay: -5s;
}

.glow-orb.red {
    background: radial-gradient(circle, #ff4444 0%, transparent 70%);
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(10px, -15px) scale(1.1); }
    50% { transform: translate(-5px, 10px) scale(0.95); }
    75% { transform: translate(15px, 5px) scale(1.05); }
}

/* =============================================
   LOGO SECTION
   ============================================= */

.logo-section {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.logo-icon {
    position: relative;
    width: 80px;
    height: 40px;
    margin: 0 auto 15px;
}

.car-silhouette {
    position: absolute;
    width: 50px;
    height: 20px;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border-radius: 5px 15px 3px 3px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.6),
        0 0 40px rgba(0, 212, 255, 0.3);
}

.car-silhouette::before {
    content: '';
    position: absolute;
    width: 25px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px 8px 0 0;
    top: -8px;
    left: 12px;
}

.speed-trail {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00d4ff);
    border-radius: 2px;
    animation: trailPulse 1s ease-in-out infinite;
}

.speed-trail::before,
.speed-trail::after {
    content: '';
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5));
    border-radius: 2px;
}

.speed-trail::before {
    width: 15px;
    top: -6px;
    left: 5px;
}

.speed-trail::after {
    width: 18px;
    bottom: -6px;
    left: 3px;
}

@keyframes trailPulse {
    0%, 100% { opacity: 0.5; width: 20px; }
    50% { opacity: 1; width: 30px; }
}

.game-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1.2;
    margin: 0;
}

.title-word {
    display: block;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 2px 0 rgba(0, 0, 0, 0.3);
}

.title-word.accent {
    font-size: 3rem;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 50%, #00d4ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 0.75rem !important;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-top: 10px;
    margin-bottom: 0 !important;
}

/* =============================================
   MENU HIGH SCORE
   ============================================= */

.menu-highscore {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 8px 20px;
    margin: 15px 0;
    z-index: 1;
}

.hs-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.hs-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

/* =============================================
   PLAY BUTTON (Premium Style)
   ============================================= */

.play-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 60px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
    margin: 20px 0;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.play-btn .btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #00d4ff 100%);
    background-size: 200% 200%;
    border-radius: 50px;
    z-index: -1;
    animation: btnGradient 3s ease-in-out infinite;
    box-shadow:
        0 5px 25px rgba(0, 212, 255, 0.4),
        0 0 50px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #00d4ff, #00ff88, #00d4ff);
    background-size: 200% 200%;
    border-radius: 52px;
    z-index: -2;
    animation: btnGradient 3s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes btnGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.play-btn .btn-text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.play-btn .btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.play-btn:hover .btn-icon {
    transform: translateX(5px);
}

.play-btn:hover .btn-bg {
    box-shadow:
        0 8px 35px rgba(0, 212, 255, 0.5),
        0 0 70px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.play-btn:active {
    transform: scale(0.98);
}

.play-btn:active .btn-bg {
    box-shadow:
        0 2px 15px rgba(0, 212, 255, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Retry button variant */
.retry-btn .btn-bg {
    background: linear-gradient(135deg, #ff6b00 0%, #ff4444 50%, #ff6b00 100%);
    background-size: 200% 200%;
}

.retry-btn::before {
    background: linear-gradient(135deg, #ff6b00, #ffaa00, #ff6b00);
    background-size: 200% 200%;
}

/* =============================================
   CONTROLS INFO (Premium)
   ============================================= */

.controls-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    z-index: 1;
    padding: 0;
    background: transparent;
    border: none;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.key-icon, .tap-icon, .swipe-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================
   MENU FOOTER
   ============================================= */

.menu-footer {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.version {
    font-size: 0.65rem !important;
    color: rgba(255, 255, 255, 0.2) !important;
    letter-spacing: 2px;
    margin: 0 !important;
}

/* =============================================
   GAME OVER SCREEN (Premium)
   ============================================= */

.gameover-bg {
    background: linear-gradient(180deg,
        rgba(50, 10, 10, 0.3) 0%,
        transparent 100%);
}

.gameover-header {
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
}

.gameover-title {
    font-size: 2.5rem !important;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ff4444 !important;
    text-shadow:
        0 0 20px rgba(255, 68, 68, 0.8),
        0 0 40px rgba(255, 68, 68, 0.4),
        0 4px 0 rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 5px !important;
    animation: gamoverPulse 2s ease-in-out infinite;
}

@keyframes gamoverPulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 68, 68, 0.8), 0 0 40px rgba(255, 68, 68, 0.4); }
    50% { text-shadow: 0 0 30px rgba(255, 68, 68, 1), 0 0 60px rgba(255, 68, 68, 0.6); }
}

.crash-line {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
    margin: 0 auto;
    border-radius: 2px;
}

#final-score-container {
    position: relative;
    z-index: 1;
    margin: 10px 0;
}

.big-score {
    font-size: 4.5rem !important;
    font-weight: 900;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    margin: 5px 0 !important;
    animation: scoreReveal 0.5s ease-out;
}

#new-high-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: bold;
    color: #ffdd00;
    text-shadow: 0 0 15px rgba(255, 221, 0, 0.8);
    animation: highScoreFlash 0.5s ease-in-out infinite alternate;
    margin-top: 10px;
}

.crown-icon {
    color: #ffdd00;
    animation: crownSpin 1s ease-in-out infinite;
}

@keyframes crownSpin {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.2); }
}

/* =============================================
   STATS GRID (Premium)
   ============================================= */

#game-stats {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    z-index: 1;
    width: auto;
    max-width: none;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 18px;
    min-width: 80px;
}

.stat-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.stat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Remove old stat-row styles override */
.stat-row {
    display: none;
}

.btn {
    padding: 16px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #0a1628;
    background: linear-gradient(180deg, #00e5ff 0%, #00b8d4 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 
        0 4px 15px rgba(0, 212, 255, 0.4),
        0 0 30px rgba(0, 212, 255, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    background: linear-gradient(180deg, #4df0ff 0%, #00d4ff 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 212, 255, 0.5),
        0 0 40px rgba(0, 212, 255, 0.3);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 10px rgba(0, 212, 255, 0.4),
        0 0 20px rgba(0, 212, 255, 0.2);
}

.controls-info {
    margin-top: 35px;
    padding: 18px 25px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.controls-info p {
    margin: 0;
    font-size: 1rem;
    color: #7dd3fc;
    letter-spacing: 1px;
}

/* Show appropriate controls info based on device */
.mobile-controls {
    display: none;
}

/* HUD */
#hud {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

#score-display,
#speed-display {
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(20, 20, 40, 0.9) 100%);
    color: #00d4ff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    letter-spacing: 1px;
}

/* Touch Controls */
#touch-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
    z-index: 100;
}

.touch-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.3) 0%, 
        rgba(0, 150, 200, 0.4) 100%);
    border: 3px solid rgba(0, 212, 255, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
}

.touch-btn:active,
.touch-btn.active {
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.6) 0%, 
        rgba(0, 180, 220, 0.7) 100%);
    transform: scale(0.95);
    border-color: rgba(0, 212, 255, 0.9);
}

/* Arrow icons */
.arrow-left,
.arrow-right {
    width: 0;
    height: 0;
    border-style: solid;
}

.arrow-left {
    border-width: 15px 22px 15px 0;
    border-color: transparent rgba(255, 255, 255, 0.9) transparent transparent;
    margin-right: 5px;
}

.arrow-right {
    border-width: 15px 0 15px 22px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
    margin-left: 5px;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Final score styling */
#final-score {
    color: #00d4ff;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(0, 212, 255, 0.8),
        0 0 20px rgba(0, 212, 255, 0.5);
    display: block;
    margin-top: 10px;
}

/* Game over specific */
#game-over-screen h1 {
    color: #ff4757;
    text-shadow: 
        0 0 10px rgba(255, 71, 87, 0.8),
        0 0 20px rgba(255, 71, 87, 0.5),
        0 0 30px rgba(255, 71, 87, 0.3);
}

/* Decorative elements */
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.5) 50%, 
        transparent 100%);
}

.screen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.5) 50%, 
        transparent 100%);
}

/* =============================================
   MOBILE RESPONSIVE STYLES
   ============================================= */

@media (max-width: 500px), (max-height: 700px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    #game-container {
        width: 100vw;
        height: 100vh;
        height: -webkit-fill-available;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
        max-height: none;
    }

    #game-canvas,
    #game-canvas-3d {
        border-radius: 0;
        border: none;
    }

    .screen {
        border-radius: 0;
    }

    .screen h1 {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .screen p {
        font-size: 1rem;
    }

    .btn {
        padding: 14px 40px;
        font-size: 1.1rem;
    }

    .controls-info {
        padding: 12px 18px;
        margin-top: 25px;
    }

    /* Show mobile controls info, hide desktop */
    .desktop-controls {
        display: none;
    }

    .mobile-controls {
        display: block;
    }

    #hud {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    #score-display,
    #speed-display {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Larger touch buttons on mobile */
    #touch-controls {
        bottom: 30px;
        padding: 0 20px;
    }

    .touch-btn {
        width: 90px;
        height: 90px;
    }

    .arrow-left {
        border-width: 18px 26px 18px 0;
    }

    .arrow-right {
        border-width: 18px 0 18px 26px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .screen h1 {
        font-size: 1.7rem;
        letter-spacing: 3px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .touch-btn {
        width: 75px;
        height: 75px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .screen h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .screen p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .btn {
        padding: 10px 30px;
        font-size: 1rem;
        margin-top: 10px;
    }

    .controls-info {
        margin-top: 15px;
        padding: 8px 15px;
    }

    #touch-controls {
        bottom: 10px;
    }

    .touch-btn {
        width: 60px;
        height: 60px;
    }

    .arrow-left {
        border-width: 12px 18px 12px 0;
    }

    .arrow-right {
        border-width: 12px 0 12px 18px;
    }
}

/* Prevent text selection on game elements */
#game-container,
#game-canvas,
#game-canvas-3d,
.touch-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =============================================
   SCREEN EFFECT OVERLAYS
   ============================================= */

#vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    transition: opacity 0.3s ease;
}

#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
    background: rgba(255, 255, 255, 0.8);
    transition: opacity 0.1s ease-out;
}

#damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 55;
    opacity: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 0, 0, 0.6) 100%);
    transition: opacity 0.3s ease-out;
}

#speed-lines-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 45;
    opacity: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0%,
            transparent 48%,
            rgba(255, 255, 255, 0.03) 49%,
            rgba(255, 255, 255, 0.03) 51%,
            transparent 52%,
            transparent 100%
        );
    transition: opacity 0.5s ease;
}

/* =============================================
   COMBO DISPLAY
   ============================================= */

#combo-display {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

#combo-multiplier {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff6b00;
    text-shadow:
        0 0 10px rgba(255, 107, 0, 0.8),
        0 0 20px rgba(255, 107, 0, 0.5),
        0 0 30px rgba(255, 107, 0, 0.3),
        2px 2px 0 #000;
    animation: comboPulse 0.5s ease-in-out infinite;
}

#combo-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffaa00;
    letter-spacing: 4px;
    text-shadow: 1px 1px 0 #000;
}

#combo-timer-bar {
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    margin: 5px auto 0;
    overflow: hidden;
}

#combo-timer-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b00, #ffaa00);
    transition: width 0.1s linear;
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Combo color variations */
#combo-display.combo-2x #combo-multiplier { color: #ff6b00; }
#combo-display.combo-3x #combo-multiplier { color: #ff4500; }
#combo-display.combo-4x #combo-multiplier { color: #ff0066; }
#combo-display.combo-5x #combo-multiplier {
    color: #ff00ff;
    animation: comboRainbow 0.3s ease-in-out infinite;
}

@keyframes comboRainbow {
    0% { color: #ff00ff; text-shadow: 0 0 20px #ff00ff; }
    33% { color: #00ffff; text-shadow: 0 0 20px #00ffff; }
    66% { color: #ffff00; text-shadow: 0 0 20px #ffff00; }
    100% { color: #ff00ff; text-shadow: 0 0 20px #ff00ff; }
}

/* =============================================
   SCORE POPUPS
   ============================================= */

#score-popup-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 90;
    overflow: hidden;
}

.score-popup {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff88;
    text-shadow:
        0 0 10px rgba(0, 255, 136, 0.8),
        2px 2px 0 #000;
    pointer-events: none;
    animation: scoreFloat 0.8s ease-out forwards;
}

.score-popup.bonus {
    color: #ffaa00;
    font-size: 1.8rem;
    text-shadow:
        0 0 15px rgba(255, 170, 0, 0.8),
        2px 2px 0 #000;
}

.score-popup.near-miss {
    color: #ff6b00;
    font-size: 2rem;
    text-shadow:
        0 0 15px rgba(255, 107, 0, 0.8),
        2px 2px 0 #000;
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* =============================================
   MILESTONE CELEBRATION
   ============================================= */

#milestone-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.milestone-popup {
    font-size: 3rem;
    font-weight: 900;
    color: #ffdd00;
    text-shadow:
        0 0 20px rgba(255, 221, 0, 0.8),
        0 0 40px rgba(255, 221, 0, 0.5),
        3px 3px 0 #000;
    animation: milestoneBurst 1.2s ease-out forwards;
    text-align: center;
}

.milestone-popup span {
    display: block;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 3px;
    margin-top: 5px;
}

@keyframes milestoneBurst {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    40% {
        transform: scale(0.95);
    }
    60% {
        transform: scale(1.05);
    }
    80% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* =============================================
   ENHANCED HUD
   ============================================= */

#score-display,
#speed-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}

.hud-label {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

#score-display #score,
#speed-display #speed {
    font-size: 1.4rem;
    transition: transform 0.1s ease;
}

#score-display #score.pulse {
    transform: scale(1.2);
    color: #00ff88;
}

#speed-gauge {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

#speed-gauge-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ffff00, #ff6600, #ff0000);
    transition: width 0.2s ease;
    border-radius: 2px;
}

/* =============================================
   GAME OVER SCREEN ENHANCEMENTS
   ============================================= */

#final-score-container {
    margin-bottom: 20px;
}

.score-label {
    font-size: 1rem;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.big-score {
    font-size: 4rem !important;
    margin: 0 !important;
    animation: scoreReveal 0.5s ease-out;
}

@keyframes scoreReveal {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

#new-high-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffdd00;
    text-shadow:
        0 0 10px rgba(255, 221, 0, 0.8),
        0 0 20px rgba(255, 221, 0, 0.5);
    animation: highScoreFlash 0.5s ease-in-out infinite alternate;
    margin-bottom: 15px;
}

@keyframes highScoreFlash {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

#game-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 15px 0;
    width: 80%;
    max-width: 250px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 0.95rem;
}

.stat-row span:first-child {
    color: #888;
}

.stat-row span:last-child {
    color: #00d4ff;
    font-weight: bold;
}

#high-scores-list {
    width: 80%;
    max-width: 250px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
}

#high-scores-list h3 {
    font-size: 0.9rem;
    color: #ffaa00;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.high-score-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.high-score-row.current {
    color: #00ff88;
    font-weight: bold;
}

/* =============================================
   AUDIO TOGGLE BUTTON
   ============================================= */

#audio-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.4);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 150;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#audio-toggle:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.8);
}

#audio-toggle.muted {
    opacity: 0.5;
}

#audio-toggle.muted #audio-icon::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 20px;
    background: #ff4444;
    transform: rotate(45deg);
}

/* =============================================
   START SCREEN ANIMATIONS
   ============================================= */

#start-screen h1 {
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow:
            0 0 10px rgba(0, 212, 255, 0.8),
            0 0 20px rgba(0, 212, 255, 0.5),
            0 0 30px rgba(0, 212, 255, 0.3);
    }
    100% {
        text-shadow:
            0 0 20px rgba(0, 212, 255, 1),
            0 0 40px rgba(0, 212, 255, 0.7),
            0 0 60px rgba(0, 212, 255, 0.5);
    }
}

#start-btn {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(0, 212, 255, 0.4),
            0 0 30px rgba(0, 212, 255, 0.2);
    }
    50% {
        box-shadow:
            0 4px 25px rgba(0, 212, 255, 0.6),
            0 0 50px rgba(0, 212, 255, 0.4);
    }
}

/* =============================================
   MOBILE RESPONSIVE UPDATES
   ============================================= */

@media (max-width: 500px) {
    #combo-display {
        top: 50px;
    }

    #combo-multiplier {
        font-size: 2rem;
    }

    .milestone-popup {
        font-size: 2.2rem;
    }

    .big-score {
        font-size: 3rem !important;
    }

    #audio-toggle {
        top: 8px;
        right: 8px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    #game-stats {
        padding: 10px 15px;
    }

    .stat-row {
        font-size: 0.85rem;
    }
}