/* Turbo Rush 2D - Complete Styling & UI System */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,700;0,800;0,900;1,800;1,900&family=Teko:wght@600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

:root {
    --primary-blue: #00d2ff;
    --primary-orange: #ff7700;
    --primary-yellow: #ffc400;
    --neon-green: #00ff66;
    --neon-cyan: #00f0ff;
    --dark-bg: #0b0e14;
    --card-bg: rgba(18, 26, 43, 0.94);
    --border-glow: #38ef7d;
}

body {
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(0, 168, 255, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255, 87, 34, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #090d16 0%, #151a28 50%, #090d16 100%);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Master Container */
#gameWrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Arcade Cabinet Display Device */
#arcadeFrame {
    position: relative;
    width: min(100vw, 540px);
    height: min(100vh, 960px);
    aspect-ratio: 9 / 16;
    max-height: 98vh;
    border-radius: 20px;
    box-shadow: 
        0 0 0 6px #1e293b,
        0 0 0 10px #0f172a,
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(0, 210, 255, 0.25);
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* HTML5 Canvas */
#gameCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #111;
}

/* Common Modal Shell */
.modal-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 20px;
    background: #0b111e;
    backdrop-filter: blur(8px);
}

.hidden {
    display: none !important;
}

.modal-screen.hidden {
    display: none !important;
}

/* Common Header Bar */
.top-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 10;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #2a3b5c;
    border-radius: 30px;
    padding: 6px 14px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.coin-pill {
    border-color: #f59e0b;
    color: #fbbf24;
}

.coin-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.best-score-pill {
    border-color: #3b82f6;
    color: #60a5fa;
}

/* Title Screen Specifics */
#titleScreen {
    background: url('game_assets/ui/Splash.png') center/cover no-repeat;
    padding: 24px 20px 8px 20px;
    justify-content: space-between;
}

.title-menu-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    align-items: center;
    margin: 0 auto 0 auto;
    background: rgba(10, 15, 26, 0.85);
    padding: 16px 14px 16px 14px;
    border-radius: 22px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
}

/* Glossy 3D Game Buttons */
.btn-primary-play {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 14px 20px;
    font-size: 24px;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 50%, #15803d 100%);
    border: 3px solid #bbf7d0;
    border-radius: 16px;
    box-shadow: 
        0 6px 0 #14532d,
        0 12px 18px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    animation: pulsePlayBtn 2s infinite ease-in-out;
}

@keyframes pulsePlayBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 6px 0 #14532d, 0 16px 30px rgba(34, 197, 94, 0.5); }
}

.btn-primary-play:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #14532d, 0 4px 10px rgba(0, 0, 0, 0.6);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    padding: 11px 14px;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
    border: 2px solid #bae6fd;
    border-radius: 14px;
    box-shadow: 
        0 5px 0 #075985,
        0 8px 12px rgba(0, 0, 0, 0.5),
        inset 0 2px 3px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-secondary:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #075985;
}

.btn-gift-coins {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 50%, #b45309 100%);
    border-color: #fde68a;
    box-shadow: 0 6px 0 #78350f, 0 10px 15px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.btn-gift-coins:active {
    box-shadow: 0 2px 0 #78350f;
}

/* Audio Controls Bar */
.audio-controls-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.btn-audio-pill {
    background: rgba(0, 0, 0, 0.6);
    border: 1.5px solid #475569;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-audio-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* HUD Overlay */
#hudScreen {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 16px;
}

.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.hud-score-card {
    background: rgba(10, 15, 28, 0.82);
    border: 2px solid #1e293b;
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.hud-stat-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1px;
}

.hud-stat-value {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Teko', sans-serif;
    letter-spacing: 1px;
    line-height: 1;
}

.btn-hud-pause {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid #38bdf8;
    color: #ffffff;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.hud-powerup-bar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.powerup-badge {
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid #00f0ff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: badgePulse 1s infinite alternate;
}

.powerup-badge.hidden {
    display: none;
}

@keyframes badgePulse {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

/* 0. PRELOADER SCREEN */
.preloader-screen {
    background: radial-gradient(circle at 50% 35%, rgba(0, 210, 255, 0.22) 0%, transparent 65%),
                linear-gradient(135deg, #090e18 0%, #101726 50%, #070a10 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.35s ease-out;
}

.preloader-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 320px;
    text-align: center;
}

.preloader-badge {
    background: linear-gradient(90deg, #ff6a00, #ff8c00);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4);
    margin-bottom: 6px;
}

.preloader-title {
    font-family: 'Teko', sans-serif;
    font-size: 48px;
    line-height: 0.95;
    letter-spacing: 2px;
    color: #ffffff;
    margin-bottom: 16px;
    text-shadow: 0 4px 18px rgba(0, 210, 255, 0.5);
}

.preloader-title span {
    color: #00d2ff;
}

.preloader-anim-wrap {
    position: relative;
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.preloader-road-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        rgba(0, 210, 255, 0.8) 0px,
        rgba(0, 210, 255, 0.8) 20px,
        transparent 20px,
        transparent 35px
    );
    border-radius: 2px;
    animation: roadLineMove 0.6s linear infinite;
}

@keyframes roadLineMove {
    from { background-position: 0 0; }
    to { background-position: -35px 0; }
}

.preloader-car {
    width: 52px;
    height: auto;
    transform: rotate(90deg);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 10px rgba(0, 210, 255, 0.5));
    animation: carBounce 0.4s infinite alternate ease-in-out;
    z-index: 2;
}

@keyframes carBounce {
    from { transform: rotate(90deg) translateY(0); }
    to { transform: rotate(90deg) translateY(-3px); }
}

.preloader-bar-wrap {
    width: 100%;
    height: 12px;
    background: #0f172a;
    border: 1.5px solid #0284c7;
    border-radius: 8px;
    overflow: hidden;
    padding: 2px;
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.35);
    margin-bottom: 8px;
}

.preloader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0284c7 0%, #00e5ff 60%, #38ef7d 100%);
    border-radius: 5px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px #00e5ff;
}

.preloader-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

#preloaderPercent {
    color: #00e5ff;
    font-weight: 800;
}

/* Master Bottom Controls & Booster Bar (Zero Overlap, Mobile-First) */
#touchControls {
    position: absolute;
    bottom: max(22px, env(safe-area-inset-bottom, 22px));
    left: 12px;
    right: 12px;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0;
    box-sizing: border-box;
    width: calc(100% - 24px);
    pointer-events: none;
}

.touch-control-group {
    display: flex;
    gap: 6px;
    pointer-events: auto;
    flex-shrink: 0;
}

.touch-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    touch-action: none;
    user-select: none;
    overflow: hidden;
    transition: transform 0.08s, background 0.08s, border-color 0.08s;
}

.touch-btn:active {
    transform: scale(0.92);
    background: rgba(0, 210, 255, 0.5);
    border-color: #00d2ff;
}

.touch-btn.nitro {
    background: rgba(220, 38, 38, 0.9);
    border-color: #fca5a5;
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0px;
}

.touch-btn.nitro:active {
    background: #ef4444;
    border-color: #fef08a;
}

.touch-btn.brake {
    background: rgba(217, 119, 6, 0.9);
    border-color: #fde68a;
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: 0px;
}

.touch-btn.brake:active {
    background: #f59e0b;
    border-color: #ffffff;
}

/* Center Booster Bar & Speedometer Cluster (Sits safely between controls) */
.hud-center-cluster {
    flex: 1;
    max-width: 140px;
    margin: 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    pointer-events: auto;
    min-width: 0;
}

.hud-speedo-panel {
    align-self: center;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid #0284c7;
    border-radius: 6px;
    padding: 1px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.speedo-num {
    font-family: 'Teko', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #38bdf8;
    line-height: 1;
    letter-spacing: 0.5px;
}

.hud-nitro-gauge-wrap {
    width: 100%;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid #334155;
    border-radius: 8px;
    padding: 2px 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}

.hud-nitro-header {
    display: flex;
    justify-content: space-between;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 0 2px 1px 2px;
    color: #94a3b8;
}

.hud-nitro-track {
    width: 100%;
    height: 10px;
    background: #0f172a;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.hud-nitro-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #0284c7 0%, #06b6d4 40%, #f59e0b 80%, #ef4444 100%);
    border-radius: 5px;
    transition: width 0.08s linear;
}

.hud-nitro-fill.pulsing {
    animation: nitroFullGlow 0.8s infinite alternate;
}

@keyframes nitroFullGlow {
    from { filter: brightness(1) drop-shadow(0 0 4px #00f0ff); }
    to { filter: brightness(1.3) drop-shadow(0 0 10px #ff7700); }
}

/* Garage / Shop Screen */
#garageModal {
    background: #0f172a radial-gradient(circle at 50% 30%, #1e293b 0%, #090d16 100%);
    padding: 20px 16px;
    justify-content: flex-start;
    gap: 14px;
}

.garage-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.garage-title-text {
    font-family: 'Teko', sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #f8fafc;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.garage-tabs-row {
    display: flex;
    width: 100%;
    background: #1e293b;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.garage-tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.garage-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Turntable Showroom */
.showroom-pedestal {
    position: relative;
    width: 100%;
    height: 270px;
    background: radial-gradient(ellipse at 50% 65%, #334155 0%, #0f172a 70%);
    border: 2px solid #1e293b;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}

.turntable-disk {
    position: absolute;
    bottom: 25px;
    width: 280px;
    height: 90px;
    background: radial-gradient(ellipse at 50% 50%, #0284c7 0%, #0369a1 40%, #0f172a 80%);
    border-radius: 50%;
    border: 3px solid #38bdf8;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.showroom-car-img {
    position: relative;
    z-index: 5;
    height: 195px;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.7));
    animation: carFloat 3s infinite ease-in-out;
}

@keyframes carFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.btn-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid #38bdf8;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.btn-carousel-arrow.prev { left: 12px; }
.btn-carousel-arrow.next { right: 12px; }

/* Car Details Card */
.garage-car-details {
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.car-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.car-title-name {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
}

.car-tier-badge {
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 1px;
}

.car-special-perk {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
}

/* Stat Meters */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-label {
    width: 85px;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.stat-pips-container {
    flex: 1;
    display: flex;
    gap: 4px;
}

.stat-pip {
    flex: 1;
    height: 10px;
    background: #1e293b;
    border-radius: 2px;
}

.stat-pip.active {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

/* Garage Action Button */
.btn-garage-action {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 14px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.15s;
}

.btn-garage-action.select {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    border-color: #bae6fd;
    box-shadow: 0 6px 0 #075985;
    color: #ffffff;
}

.btn-garage-action.equipped {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
    cursor: default;
}

.btn-garage-action.buy {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    border-color: #bbf7d0;
    box-shadow: 0 6px 0 #14532d;
    color: #ffffff;
}

.btn-garage-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Garage Views Switch */
#garageCarsView {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#garageCarsView.hidden {
    display: none !important;
}

/* Upgrades View */
#garageUpgradesView {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 520px;
    padding-right: 4px;
}

#garageUpgradesView.hidden {
    display: none !important;
}

.btn-coin-icon {
    width: 20px;
    height: 20px;
    vertical-align: -3px;
    margin: 0 4px;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    object-fit: contain;
}

.upgrade-card {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #334155;
    border-radius: 14px;
    padding: 12px;
    gap: 12px;
}

.upgrade-icon-wrap {
    width: 60px;
    height: 60px;
    background: #1e293b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-icon {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.upgrade-info {
    flex: 1;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.upgrade-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

.upgrade-lvl-badge {
    font-size: 12px;
    font-weight: 800;
    color: #38bdf8;
}

.upgrade-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.upgrade-meter {
    display: flex;
    gap: 4px;
}

.upgrade-pip {
    flex: 1;
    height: 6px;
    background: #334155;
    border-radius: 2px;
}

.upgrade-pip.active {
    background: #00f0ff;
    box-shadow: 0 0 6px #00f0ff;
}

.btn-upgrade {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-upgrade.buy {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 3px 0 #14532d;
}

.btn-upgrade.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-upgrade.maxed {
    background: #334155;
    color: #94a3b8;
    cursor: default;
}

/* Game Over Screen */
#gameOverModal {
    background: rgba(10, 15, 26, 0.94);
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.game-over-hazard-header {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 60px;
    background: repeating-linear-gradient(
        -45deg,
        #f59e0b,
        #f59e0b 15px,
        #111827 15px,
        #111827 30px
    );
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #111;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.game-over-title {
    font-family: 'Teko', sans-serif;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ef4444;
    text-shadow: 0 2px 6px #000, 0 0 10px rgba(239, 68, 68, 0.8);
    background: #0f172a;
    padding: 2px 24px;
    border-radius: 6px;
    border: 2px solid #ef4444;
}

.game-over-stats-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #1e293b;
    border: 3px solid #475569;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}

.new-record-ribbon {
    position: absolute;
    top: -14px;
    right: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.go-stat-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #334155;
    padding-bottom: 6px;
}

.go-stat-label {
    font-size: 14px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.go-stat-val {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Teko', sans-serif;
    letter-spacing: 1px;
}

.go-stat-val.coins {
    color: #fbbf24;
}

.go-stat-val.best {
    color: #60a5fa;
}

/* Action button triad */
.go-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.btn-circle-action {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #0284c7;
    border: 3px solid #bae6fd;
    color: #ffffff;
    font-size: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 0 #075985, 0 10px 15px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.btn-circle-action:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #075985;
}

.btn-circle-action.retry {
    width: 86px;
    height: 86px;
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    border-color: #bbf7d0;
    box-shadow: 0 8px 0 #14532d, 0 14px 20px rgba(0,0,0,0.6);
    font-size: 36px;
}

.btn-circle-action.retry:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #14532d;
}

.action-caption {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    text-transform: uppercase;
}

/* How to Play Modal */
.guide-card-content {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: 480px;
}

.guide-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.guide-icon-badge {
    font-size: 28px;
}

.guide-text h4 {
    font-size: 15px;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 2px;
}

.guide-text p {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
}

/* Pause Modal */
#pauseModal {
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.pause-title {
    font-family: 'Teko', sans-serif;
    font-size: 48px;
    color: #ffffff;
    letter-spacing: 2px;
}

/* Responsive Mobile & Tablet Scaling */
@media (max-width: 768px) {
    #gameWrapper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    #arcadeFrame {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
        border: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    #touchControls {
        bottom: max(16px, env(safe-area-inset-bottom, 16px));
    }
}

@media (max-width: 480px) {
    #touchControls {
        bottom: max(20px, env(safe-area-inset-bottom, 20px));
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        padding: 0;
        gap: 5px;
    }

    .touch-control-group {
        gap: 5px;
    }

    .touch-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        max-width: 38px;
        min-height: 38px;
        max-height: 38px;
        font-size: 15px;
    }

    .touch-btn.nitro {
        font-size: 9px;
        letter-spacing: 0px;
    }

    .touch-btn.brake {
        font-size: 8px;
        letter-spacing: 0px;
    }

    .hud-center-cluster {
        margin: 0 4px;
        max-width: 130px;
        gap: 2px;
    }

    .speedo-num {
        font-size: 18px;
    }

    .hud-nitro-header {
        font-size: 8px;
    }

    .hud-nitro-track {
        height: 9px;
    }

    .title-menu-group {
        max-width: 320px;
        gap: 8px;
        padding: 12px 10px;
    }

    .btn-primary-play {
        padding: 12px;
        font-size: 20px;
    }

    .btn-secondary {
        padding: 9px;
        font-size: 12px;
    }
}

/* Screenshot Mode for 1:1 Pixel-Perfect 450x800 Exports (Zero Stretch, Zero Cutoffs) */
body.screenshot-mode {
    background: transparent !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 450px !important;
    height: 800px !important;
    display: block !important;
}

body.screenshot-mode #gameWrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 450px !important;
    height: 800px !important;
    display: block !important;
}

body.screenshot-mode #arcadeFrame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 450px !important;
    height: 800px !important;
    max-width: 450px !important;
    max-height: 800px !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    overflow: hidden !important;
}

body.screenshot-mode #touchControls {
    bottom: 22px !important;
    left: 10px !important;
    right: 10px !important;
    width: 430px !important;
    padding: 0 !important;
    gap: 6px !important;
}

body.screenshot-mode .touch-control-group {
    gap: 6px !important;
}

body.screenshot-mode .touch-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    font-size: 15px !important;
}

body.screenshot-mode .touch-btn.nitro {
    font-size: 9px !important;
}

body.screenshot-mode .touch-btn.brake {
    font-size: 8px !important;
}

body.screenshot-mode .hud-center-cluster {
    margin: 0 4px !important;
    max-width: 135px !important;
    gap: 3px !important;
}
