body {
    background: #0d1117;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.game {
    width: 100%;
    height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

.game-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: #0d1117;
}

.hud {
    width: 100%;
    min-height: 56px;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.96) 0%, rgba(14, 19, 32, 0.92) 100%);
    border-bottom: 2.5px solid #ff3344;
    box-shadow: 0 4px 18px rgba(255, 51, 68, 0.4), 0 10px 25px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
    z-index: 30;
    box-sizing: border-box;
    gap: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hud-left,
.hud-center,
.hud-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hud-center {
    flex: 1;
    justify-content: center;
    max-width: 440px;
}

.hud-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.hud-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: #8da2ba;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.score {
    font-weight: 900;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    background: linear-gradient(180deg, #ffe082 0%, #ffca28 45%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 183, 77, 0.65));
    letter-spacing: 0.5px;
}

.coins-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.coin-medallion {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff7b2, #ffd54f 45%, #ff8f00 85%);
    box-shadow: 0 0 10px rgba(255, 213, 79, 0.85), inset 0 1px 2px #fff;
    border: 1.5px solid #ffe082;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: coinPulseGlow 2s infinite alternate ease-in-out;
}

.coin-disc {
    font-size: 0.85rem;
    font-weight: 900;
    color: #5d4037;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.coins-count {
    font-weight: 900;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #ffca28;
    text-shadow: 0 0 10px rgba(255, 202, 40, 0.7);
}

.speed-stat {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.speed {
    font-weight: 900;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    color: #00f3ff;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.85), 0 0 20px rgba(0, 243, 255, 0.4);
}

.speed-unit {
    font-size: 0.8rem;
    font-weight: 800;
    color: #8da2ba;
    letter-spacing: 0.5px;
}

.nitro-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
    max-width: 220px;
}

.nitro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.nitro-label {
    color: #00f3ff;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.8);
}

.nitro-percent {
    color: #79ebfc;
    font-weight: 800;
}

.nitro-bar-track {
    width: 100%;
    height: 11px;
    background: rgba(3, 10, 20, 0.9);
    border-radius: 999px;
    overflow: hidden;
    border: 1.5px solid rgba(0, 243, 255, 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 243, 255, 0.35);
    position: relative;
}

.nitro-lightning-aura {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 15px,
        rgba(0, 243, 255, 0.25) 15px,
        rgba(0, 243, 255, 0.25) 20px
    );
    pointer-events: none;
    animation: lightningSurge 1.2s infinite linear;
}

.nitro-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0072ff 0%, #00f3ff 70%, #ffffff 100%);
    border-radius: 999px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 12px #00f3ff, 0 0 20px rgba(0, 243, 255, 0.6);
}

.nitro-bar-fill.active-burning {
    background: linear-gradient(90deg, #ff1744 0%, #ff5252 50%, #ffd700 100%);
    box-shadow: 0 0 15px #ff1744, 0 0 25px #ffd700;
    animation: flameStrobe 0.15s infinite alternate;
}

.nitro-action-btn {
    padding: 6px 16px;
    background: rgba(0, 243, 255, 0.08);
    border: 2px solid #00f3ff;
    border-radius: 999px;
    color: #00f3ff;
    font-weight: 900;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.35), inset 0 0 6px rgba(0, 243, 255, 0.15);
}

.nitro-action-btn.ready {
    background: linear-gradient(135deg, rgba(0, 114, 255, 0.35) 0%, rgba(0, 243, 255, 0.45) 100%);
    color: #ffffff;
    border-color: #00f3ff;
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.8), inset 0 0 10px rgba(0, 243, 255, 0.4);
    animation: readyPulse 1.2s infinite ease-in-out;
    text-shadow: 0 0 8px #00f3ff;
}

.nitro-action-btn.boosting {
    background: linear-gradient(135deg, #ff1744 0%, #ff6d00 100%);
    color: #ffffff;
    border-color: #ffd700;
    box-shadow: 0 0 18px rgba(255, 23, 68, 0.9), 0 0 28px rgba(255, 109, 0, 0.6);
    animation: flamePulse 0.3s infinite alternate;
}

.lives-container {
    display: flex;
    align-items: center;
    gap: 3px;
}

.lives-label {
    color: #8da2ba;
    font-size: 0.85rem;
    font-weight: 800;
    margin-right: 2px;
}

.lives-paren {
    color: #8da2ba;
    font-size: 0.95rem;
    font-weight: 800;
}

.lives {
    display: flex;
    gap: 3px;
    align-items: center;
}

.life-heart {
    font-size: 1rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 23, 68, 0.8));
    transition: all 0.3s ease;
}

.life-heart.lost {
    opacity: 0.25;
    filter: grayscale(1);
    transform: scale(0.9);
}

.pause-btn,
.audio-btn {
    width: 34px;
    height: 34px;
    background: rgba(15, 24, 40, 0.85);
    border: 1.5px solid rgba(0, 243, 255, 0.3);
    border-radius: 6px;
    color: #00f3ff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.pause-btn:hover,
.audio-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    border-color: #00f3ff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    transform: scale(1.05);
}

.audio-btn.muted {
    opacity: 0.6;
    border-color: rgba(255, 51, 68, 0.5);
    color: #ff5252;
}

.game-arena-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: calc(100vh - 56px);
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #151922 0%, #0d1017 100%);
}

.road {
    position: relative;
    width: min(720px, 86vw);
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: #2b2d33;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
    z-index: 2;
}

.asphalt-texture {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%, #3e4249 0%, #2b2c31 70%, #1f2024 100%),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.04) 0px, rgba(0, 0, 0, 0.04) 2px, transparent 2px, transparent 4px);
    pointer-events: none;
    z-index: 1;
}

.road-curb {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    background: repeating-linear-gradient(
        140deg,
        #d32f2f 0px,
        #d32f2f 22px,
        #f8f9fa 22px,
        #f8f9fa 44px
    );
    background-position-y: var(--road-shift, 0px);
    z-index: 4;
    pointer-events: none;
}

.road-curb-left {
    left: 0;
    border-right: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset -2px 0 6px rgba(0, 0, 0, 0.5);
}

.road-curb-right {
    right: 0;
    border-left: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset 2px 0 6px rgba(0, 0, 0, 0.5);
}

.skid-marks-layer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 75% 45%, rgba(0, 0, 0, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse at 25% 65%, rgba(0, 0, 0, 0.25) 0%, transparent 55%);
    pointer-events: none;
    z-index: 2;
}

.lane-marking {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #f0f3f6 0,
        #f0f3f6 30px,
        transparent 30px,
        transparent 58px
    );
    background-position-y: var(--road-shift, 0px);
    opacity: 0.92;
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.lane-1 {
    left: 33.333%;
    transform: translateX(-50%);
}

.lane-2 {
    left: 66.667%;
    transform: translateX(-50%);
}

.speed-lines-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 243, 255, 0.12) 0px,
        rgba(0, 243, 255, 0.12) 4px,
        transparent 4px,
        transparent 45px
    );
}

.road.nitro-speed-mode .speed-lines-overlay {
    opacity: 1;
    animation: speedWarp 0.18s linear infinite;
}

.collectible-coin {
    position: absolute;
    width: clamp(34px, 8vw, 44px);
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    z-index: 5;
    perspective: 500px;
    filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.8)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.coin-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffde7, #ffd54f 50%, #ff8f00 90%);
    border: 2px solid #fff;
    box-shadow: 0 0 16px rgba(255, 217, 61, 0.9), inset 0 2px 3px rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: coinSpin 1.4s infinite linear;
}

.coin-symbol {
    font-size: 1.15rem;
    font-weight: 900;
    color: #6d4c41;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.collectible-nitro {
    position: absolute;
    width: clamp(34px, 8.5vw, 44px);
    aspect-ratio: 1 / 1.4;
    transform: translateX(-50%);
    z-index: 5;
    filter: drop-shadow(0 0 14px rgba(0, 243, 255, 0.9));
    animation: nitroFloat 1s infinite alternate ease-in-out;
}

.nitro-bottle {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00d2ff 0%, #0072ff 100%);
    border-radius: 8px 8px 12px 12px;
    border: 2px solid #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5);
}

.nitro-bottle::before {
    content: '';
    position: absolute;
    top: -6px;
    width: 45%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px 3px 0 0;
    border: 1px solid #999;
}

.nitro-flame {
    font-size: 0.95rem;
    line-height: 1;
    color: #ffd93d;
}

.nitro-text {
    font-size: 0.65rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.collectible-coin.collected,
.collectible-nitro.collected {
    transform: translateX(-50%) scale(1.5);
    opacity: 0;
    transition: all 0.22s ease-out;
}

.floating-pickup {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 900;
    text-align: center;
    pointer-events: none;
    z-index: 20;
    animation: floatUpFade 1.3s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-pickup.coin-pickup {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-pickup.coin-pickup .bonus-score {
    font-size: clamp(1.4rem, 3.2vw, 1.8rem);
    font-weight: 900;
    color: #ffbe3b;
    line-height: 1;
    text-shadow: 0 0 12px rgba(255, 190, 59, 0.9), 0 2px 4px #000;
}

.floating-pickup.coin-pickup .bonus-sub {
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    font-weight: 900;
    color: #ffca28;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255, 202, 40, 0.8), 0 2px 4px #000;
    margin-top: 2px;
}

.floating-pickup.nitro-pickup {
    color: #00f3ff;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    text-shadow: 0 0 14px rgba(0, 243, 255, 0.95), 0 2px 4px #000;
}

.floating-pickup.smash-pickup {
    color: #ff1744;
    font-size: clamp(1.2rem, 3.2vw, 1.5rem);
    text-shadow: 0 0 16px rgba(255, 23, 68, 1), 0 2px 4px #000;
}

.floating-pickup.damage-pickup {
    color: #ff3344;
    font-size: clamp(1.1rem, 2.8vw, 1.35rem);
    text-shadow: 0 0 14px rgba(255, 51, 68, 0.95), 0 2px 4px #000;
}

.player-car,
.enemy-car {
    position: absolute;
    width: clamp(42px, 11%, 58px);
    aspect-ratio: 1 / 2;
    transform: translateX(-50%);
    z-index: 5;
    transition: left 0.1s ease-out;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
}

.player-car {
    bottom: 5%;
    background-image: url('../assets/cars/player_car.svg');
}

.exhaust-sparks {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 20px;
    pointer-events: none;
}

.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffab00;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff6d00, 0 0 10px #ffd600;
    animation: sparkFly 0.25s infinite alternate;
}

.spark.s1 { left: 14px; animation-delay: 0.05s; }
.spark.s2 { left: 18px; animation-delay: 0.12s; }
.spark.s3 { right: 18px; animation-delay: 0.08s; }
.spark.s4 { right: 14px; animation-delay: 0.18s; }

@keyframes sparkFly {
    0% { transform: translateY(0) scale(1); opacity: 0.9; }
    100% { transform: translateY(12px) scale(0.3); opacity: 0; }
}

.player-car.nitro-active {
    filter: drop-shadow(0 0 18px #00f3ff) drop-shadow(0 0 30px rgba(0, 243, 255, 0.9));
    animation: carNitroVibrate 0.08s infinite alternate;
}

.exhaust-flames {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    display: flex;
    justify-content: space-around;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.player-car.nitro-active .exhaust-flames {
    opacity: 1;
}

.flame {
    width: 8px;
    height: 20px;
    background: linear-gradient(to bottom, #00f3ff 0%, #0072ff 60%, transparent 100%);
    border-radius: 50% 50% 20% 20%;
    filter: drop-shadow(0 0 8px #00f3ff);
    animation: flameFlicker 0.1s infinite alternate;
}

.enemy-car {
    background-image: url('../assets/cars/enemy_red.svg');
}

.enemy-car.smashed {
    animation: enemySmash 0.45s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}

.enemy-car.traffic-wrecked {
    animation: trafficWreck 0.4s forwards ease-out;
    pointer-events: none;
}

.player-car.player-wrecked,
.player-car.collision {
    animation: playerWreck 0.85s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    z-index: 10;
}

.player-car.invulnerable {
    animation: playerBlink 0.18s infinite ease-in-out;
}

.road.crash-shake {
    animation: screenCrashShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.road.smash-shake {
    animation: screenSmashShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.mobile-controls {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 10;
    pointer-events: none;
}

.steer-btn,
.mobile-nitro-btn {
    pointer-events: auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(13, 14, 28, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.steer-btn:active {
    background: rgba(30, 144, 255, 0.6);
    border-color: #1e90ff;
    transform: scale(0.92);
}

.mobile-nitro-btn {
    width: auto;
    height: 48px;
    padding: 0 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    background: rgba(0, 229, 255, 0.2);
    border-color: rgba(0, 229, 255, 0.5);
    color: #00e5ff;
}

.mobile-nitro-btn.ready {
    background: linear-gradient(135deg, #0072ff 0%, #00e5ff 100%);
    color: #0d0e1c;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
}

.mobile-nitro-btn.boosting {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #fff;
    border-color: #ffd93d;
}

@media (min-width: 768px) {
    .mobile-controls {
        display: none;
    }
}

.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
}

.countdown-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.countdown-label {
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    font-weight: 800;
    letter-spacing: 6px;
    color: #a0aec0;
    margin-bottom: 12px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
}

.countdown-number {
    font-size: clamp(5.5rem, 20vw, 9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 4px;
    animation: countdownPulse 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    text-shadow: 0 0 50px currentColor;
}

.countdown-number.count-3 {
    color: #ff4757;
}

.countdown-number.count-2 {
    color: #ffa502;
}

.countdown-number.count-1 {
    color: #2ed573;
}

.countdown-number.count-go {
    color: #00e5ff;
    font-size: clamp(5rem, 18vw, 8rem);
    animation: countdownGo 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.25);
        opacity: 0;
    }
    35% {
        transform: scale(1.18);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

@keyframes countdownGo {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    35% {
        transform: scale(1.25);
        opacity: 1;
    }
    75% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.game-over-screen,
.pause-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.game-over-content,
.pause-content {
    position: relative;
    z-index: 1;
    text-align: center;
    background: #0f172a;
    border: 2px solid rgba(255, 71, 87, 0.65);
    border-radius: 20px;
    padding: 28px 24px 24px;
    max-width: 440px;
    width: min(92%, 440px);
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.25), 0 20px 40px rgba(0, 0, 0, 0.8);
    animation: modalScaleUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalScaleUp {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-over-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
}

.game-over-title {
    font-size: clamp(2rem, 7vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 5px;
    color: #ff4757;
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
    margin-bottom: 2px;
}

.new-record-badge {
    display: inline-block;
    background: #ff9800;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 14px;
    margin-top: 6px;
    box-shadow: 0 0 14px rgba(255, 152, 0, 0.6);
    animation: pulseRecord 1.2s ease-in-out infinite alternate;
}

@keyframes pulseRecord {
    0% { transform: scale(0.97); opacity: 0.9; }
    100% { transform: scale(1.03); opacity: 1; }
}

.game-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background: rgba(22, 30, 49, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: border-color 0.2s ease;
}

.stat:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.stat.highlight-stat {
    grid-column: span 2;
    background: rgba(255, 71, 87, 0.1);
    border: 1.5px solid rgba(255, 71, 87, 0.4);
    padding: 14px 10px;
}

.stat.career-stat {
    grid-column: span 2;
    background: rgba(0, 212, 255, 0.08);
    border: 1.5px solid rgba(0, 212, 255, 0.35);
    padding: 12px 10px;
}

.stat-label {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 4px;
}

.final-score {
    font-size: clamp(2.2rem, 6vw, 2.8rem);
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1.1;
}

.final-coins,
.best-coins,
.distance,
.top-speed {
    font-size: clamp(1.25rem, 3.2vw, 1.55rem);
    font-weight: 800;
    color: #ffd93d;
    letter-spacing: 1px;
}

.best-score {
    font-size: clamp(1.4rem, 3.8vw, 1.75rem);
    font-weight: 900;
    color: #00d4ff;
    letter-spacing: 1.5px;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.retry-btn,
.home-btn,
.resume-btn,
.restart-btn,
.quit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    font-size: clamp(0.9rem, 2.4vw, 1rem);
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    flex: 1;
}

.retry-btn {
    background: linear-gradient(180deg, #ff8c00 0%, #ff6f00 45%, #e65100 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(230, 81, 0, 0.5);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230, 81, 0, 0.7);
    filter: brightness(1.08);
}

.home-btn {
    background: rgba(30, 41, 59, 0.85);
    color: #cbd5e1;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
}

.home-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}

.pause-content {
    border-color: rgba(0, 212, 255, 0.7);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.25), 0 20px 40px rgba(0, 0, 0, 0.8);
    max-width: 420px;
}

.pause-header {
    margin-bottom: 18px;
}

.pause-title {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    font-weight: 900;
    letter-spacing: 4px;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.pause-hints {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
    background: rgba(22, 30, 49, 0.75);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.hint-highlight.yellow {
    color: #ffd93d;
    font-weight: 700;
}

.hint-highlight.cyan {
    color: #00e5ff;
    font-weight: 700;
}

.pause-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.resume-btn {
    background: linear-gradient(180deg, #00d4ff 0%, #0099ff 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 18px rgba(0, 212, 255, 0.45);
    width: 100%;
}

.resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.65);
    filter: brightness(1.06);
}

.restart-btn {
    background: linear-gradient(180deg, #ff8c00 0%, #e65100 100%);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 5px 18px rgba(255, 140, 0, 0.4);
    width: 100%;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.65);
    filter: brightness(1.06);
}

.quit-btn {
    background: rgba(30, 41, 59, 0.85);
    color: #cbd5e1;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    width: 100%;
}

.quit-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes nitroFloat {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-6px); }
}

@keyframes floatUpFade {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.75);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -10px) scale(1.08);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -18px) scale(1);
    }
    75% {
        opacity: 0.9;
        transform: translate(-50%, -40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -60px) scale(0.95);
    }
}

@keyframes carNitroVibrate {
    0% { transform: translateX(-51%); }
    100% { transform: translateX(-49%); }
}

@keyframes flameFlicker {
    0% { height: 16px; opacity: 0.8; }
    100% { height: 24px; opacity: 1; }
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }
    50% { box-shadow: 0 0 20px rgba(0, 229, 255, 1); transform: scale(1.03); }
}

@keyframes flamePulse {
    0% { box-shadow: 0 0 12px rgba(255, 75, 43, 0.8); }
    100% { box-shadow: 0 0 22px rgba(255, 217, 61, 1); }
}

@keyframes flameStrobe {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.4); }
}

@keyframes speedWarp {
    0% { background-position-y: 0px; }
    100% { background-position-y: 80px; }
}

@keyframes playerWreck {
    0% {
        transform: translateX(-50%) rotate(0deg) scale(1);
        filter: brightness(4) contrast(2) drop-shadow(0 0 35px #ff1744);
    }
    15% {
        transform: translateX(calc(-50% - 14px)) translateY(12px) rotate(-18deg) scale(0.92);
        filter: brightness(3) contrast(1.8) drop-shadow(0 0 40px #ff0000);
    }
    30% {
        transform: translateX(calc(-50% + 14px)) translateY(6px) rotate(16deg) scale(0.95);
        filter: brightness(3) contrast(1.6) drop-shadow(0 0 30px #ff1744);
    }
    45% {
        transform: translateX(calc(-50% - 8px)) translateY(2px) rotate(-10deg) scale(0.98);
        filter: brightness(2) drop-shadow(0 0 20px #ff1744);
    }
    60% {
        transform: translateX(calc(-50% + 6px)) rotate(6deg);
        filter: brightness(1.6) drop-shadow(0 0 15px #ff1744);
    }
    80% {
        transform: translateX(calc(-50% - 2px)) rotate(-2deg);
        filter: brightness(1.2);
    }
    100% {
        transform: translateX(-50%) rotate(0deg) scale(1);
        filter: none;
    }
}

@keyframes trafficWreck {
    0% {
        transform: translateX(-50%) scale(1) rotate(0deg);
        filter: brightness(3) drop-shadow(0 0 20px #ff1744);
        opacity: 1;
    }
    50% {
        transform: translateX(calc(-50% + 20px)) translateY(-20px) scale(0.8) rotate(20deg);
        filter: brightness(2);
        opacity: 0.5;
    }
    100% {
        transform: translateX(calc(-50% + 40px)) translateY(-40px) scale(0.2) rotate(45deg);
        opacity: 0;
    }
}

@keyframes playerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes enemySmash {
    0% {
        transform: translateX(-50%) scale(1.2) rotate(0deg);
        filter: brightness(4) drop-shadow(0 0 35px #ff6b6b);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(-50px) scale(1.3) rotate(240deg);
        filter: brightness(3) drop-shadow(0 0 25px #ffd93d);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-50%) translateY(-120px) scale(0.1) rotate(720deg);
        opacity: 0;
    }
}

@keyframes screenCrashShake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-8px, 6px); }
    30% { transform: translate(8px, -6px); }
    45% { transform: translate(-5px, 4px); }
    60% { transform: translate(5px, -4px); }
    75% { transform: translate(-2px, 2px); }
}

@keyframes screenSmashShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-5px, -3px); }
    50% { transform: translate(5px, 3px); }
    75% { transform: translate(-2px, 2px); }
}

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

@media (max-width: 640px) {
    .hud {
        padding: 4px 8px;
        gap: 6px;
    }

    .hud-label, .speed-unit, .lives-label {
        font-size: 0.7rem;
    }

    .score, .speed, .coins-count {
        font-size: 1.15rem;
    }

    .roadside {
        max-width: 10%;
    }

    .road {
        width: 80%;
    }

    .nitro-action-btn {
        display: none;
    }

    .nitro-container {
        min-width: 85px;
        max-width: 130px;
    }
}
