/* style.css - Responsive Driver-Style Retro Arcade HUD & Mobile Touch Controls */

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

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for modern Android & iOS */
    overflow: hidden;
    background-color: #0b0f19;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   UNIVERSAL SCROLLBAR HIDING (Mouse Wheel & Swipe Scrolling Intact)
   ========================================================= */
* {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE & Edge */
}

*::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Opera */
    width: 0 !important;
    height: 0 !important;
}

/* Enable smooth swipe and wheel scrolling on all scrollable modal containers */
.skins-modal-card,
.settings-modal-card,
.missions-modal-card,
.missions-list-container,
.modes-modal-card,
.garage-modal-card,
.garage-cars-grid,
.shop-modal-card,
.shop-tab-content,
.modal-card {
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scrollbar-width: none !important;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 1;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    touch-action: none;
}

/* =========================================================
   HUD LAYOUT (Responsive Flex/Percentage Based)
   ========================================================= */

#hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(8px, 2vw, 16px);
    padding-top: max(clamp(8px, 2vw, 16px), env(safe-area-inset-top));
    padding-bottom: max(clamp(8px, 2vw, 16px), env(safe-area-inset-bottom));
    padding-left: max(clamp(8px, 2vw, 16px), env(safe-area-inset-left));
    padding-right: max(clamp(8px, 2vw, 16px), env(safe-area-inset-right));
}

/* Top Bar: Minimap, Wanted Level, Missions */
.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.hud-top-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 2D Minimap Radar */
#hud-minimap-container {
    width: 135px;
    height: 135px;
    border-radius: 50%;
    border: 3px solid #00ffcc;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 255, 204, 0.35);
    background: #0f141d;
    overflow: hidden;
    backdrop-filter: blur(6px);
    position: relative;
}

#hud-minimap-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Wanted Level Stars (Integrated inside Speedometer Cluster) */
#hud-wanted-container {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 8px;
}

.wanted-star {
    font-size: 1.05rem;
    color: #323d50;
    opacity: 0.35;
    transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    line-height: 1;
}

.wanted-star.active {
    color: #ffcc00 !important;
    text-shadow: 0 0 10px #ffaa00, 0 0 18px #ff5500;
    transform: scale(1.15);
    opacity: 1.0 !important;
}

/* Mission Objective & GPS Navigation Banner (Centered cleanly below top bar so it NEVER overlaps toolbar buttons) */
#hud-mission-banner {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(16, 22, 34, 0.95), rgba(8, 12, 20, 0.98));
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 255, 204, 0.2);
    display: none;
    flex-direction: column;
    min-width: 220px;
    max-width: min(340px, 48vw);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-top: 3px solid #00ffcc;
    z-index: 20;
}

.hud-mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

#hud-mission-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

#hud-mission-desc {
    font-size: 0.78rem;
    color: #c0c6d4;
    margin-bottom: 8px;
    line-height: 1.25;
}

.mission-stats {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
}

#hud-mission-timer {
    color: #ffaa00;
    font-weight: 800;
}

#hud-mission-dist {
    color: #00ffcc;
    font-weight: 800;
}

/* GPS Turn-by-turn guidance indicator */
#hud-nav-instruction {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 204, 0.12);
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 2px;
}

#hud-nav-icon {
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: navPulse 1s infinite alternate ease-in-out;
}

#hud-nav-text {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

@keyframes navPulse {
    from { transform: scale(1.0); }
    to { transform: scale(1.22); }
}

/* Top Right Toolbar Buttons */
.hud-top-right {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.hud-pill-btn {
    background: rgba(20, 26, 40, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.hud-pill-btn:hover, .hud-pill-btn:active {
    background: rgba(40, 52, 75, 0.95);
    border-color: #ffaa00;
    color: #ffaa00;
}

/* Center Drift & Slip Gauge */
.hud-center-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#hud-drift-score {
    font-size: 1.8rem;
    font-weight: 900;
    font-style: italic;
    color: #ffbb00;
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.8), 2px 2px 0 #000;
    letter-spacing: 2px;
    display: none;
}

#hud-drift-gauge {
    width: 140px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#hud-drift-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffaa00, #ff2200);
    transition: width 0.05s ease;
}

/* Bottom Bar: Speedometer, Health */
.hud-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

/* Speedometer Cluster */
#hud-speedo-cluster {
    background: radial-gradient(circle, rgba(20, 26, 38, 0.9) 0%, rgba(10, 14, 20, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 10px 18px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    backdrop-filter: blur(8px);
}

#hud-speed-val {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}

#hud-speed-unit {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffaa00;
    cursor: pointer;
    pointer-events: auto;
}

#hud-gear-val {
    font-size: 1.3rem;
    font-weight: 900;
    color: #00ffcc;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 8px;
}

/* Health Gauge */
#hud-health-container {
    width: 150px;
    background: rgba(15, 20, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-health-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #aaa;
}

#hud-health-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
}

#hud-health-fill {
    width: 100%;
    height: 100%;
    background-color: #00ff88;
    transition: width 0.15s ease, background-color 0.2s ease;
}

/* NITRO / NOS Boost Gauge */
#hud-nitro-container {
    width: 155px;
    background: rgba(10, 18, 32, 0.88);
    border: 1px solid rgba(0, 200, 255, 0.35);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 160, 255, 0.15);
}

.hud-nitro-title {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #00ddff;
    display: flex;
    justify-content: space-between;
}

#hud-nitro-timer-text {
    color: #ffea00;
    font-size: 0.65rem;
    font-weight: 800;
}

#hud-nitro-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
}

#hud-nitro-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #0088ff, #00ffcc, #ffea00);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.7);
    transition: width 0.08s linear;
}

/* =========================================================
   TOUCH CONTROLS (Rendered for Mobile & Tablet)
   ========================================================= */

#touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    display: none; /* Enabled via JS platform detector */
}

/* Touch Controls Root Variable Sizing (Default Medium) */
:root {
    --touch-btn-size: 76px;
    --touch-font-size: 2.2rem;
    --touch-hb-width: 80px;
    --touch-hb-height: 64px;
    --touch-wheel-size: 160px;
}

body.touch-size-small {
    --touch-btn-size: 62px;
    --touch-font-size: 1.8rem;
    --touch-hb-width: 68px;
    --touch-hb-height: 54px;
    --touch-wheel-size: 135px;
}

body.touch-size-large {
    --touch-btn-size: 94px;
    --touch-font-size: 2.7rem;
    --touch-hb-width: 96px;
    --touch-hb-height: 76px;
    --touch-wheel-size: 190px;
}

/* Steering Style Visibility: Steer Buttons vs Steering Wheel */
body.steer-mode-wheel #touch-steer-zone {
    display: none !important;
}

body.steer-mode-wheel #touch-wheel-zone {
    display: flex !important;
}

body.steer-mode-buttons #touch-steer-zone {
    display: flex !important;
}

body.steer-mode-buttons #touch-wheel-zone {
    display: none !important;
}

/* =========================================================
   CIRCULAR STEERING WHEEL (Real Car Wheel Placed in Right Zone)
   ========================================================= */
#touch-wheel-zone {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: auto !important;
    touch-action: none !important;
    user-select: none;
    -webkit-user-select: none;
}

#steering-wheel {
    width: var(--touch-wheel-size);
    height: var(--touch-wheel-size);
    border-radius: 50%;
    position: relative;
    cursor: grab;
    touch-action: none !important;
    pointer-events: auto !important;
    transform-origin: center center;
    transition: transform 0.04s ease-out;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.75));
}

#steering-wheel.active {
    cursor: grabbing;
    transition: none;
}

/* Heavy Perforated Leather Outer Rim */
.wheel-outer-rim {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 14px solid #141923;
    background: radial-gradient(circle, rgba(16, 22, 33, 0.7) 0%, rgba(8, 12, 18, 0.95) 70%, #0d121b 100%);
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.9),
        0 0 0 2px rgba(255, 255, 255, 0.18),
        0 4px 15px rgba(0, 0, 0, 0.7);
    position: relative;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* Racing Red Top Center Alignment Marker (Like Rally / Supercars) */
.wheel-top-marker {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #ff2222;
    box-shadow: 0 0 8px rgba(255, 34, 34, 0.8);
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
}

/* Textured Side Hand Grips (9 o'clock & 3 o'clock) */
.wheel-grip {
    position: absolute;
    width: 18px;
    height: 38px;
    background: #252e42;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
    pointer-events: none;
}

.wheel-grip.grip-left {
    left: -16px;
    top: calc(50% - 19px);
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.6);
}

.wheel-grip.grip-right {
    right: -16px;
    top: calc(50% - 19px);
    box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.6);
}

/* Metallic Brushed Spokes */
.wheel-spoke {
    position: absolute;
    background: linear-gradient(180deg, #3d4960, #1c2331);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 2;
    pointer-events: none;
}

.wheel-spoke.spoke-left {
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 38%;
    height: 14px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.wheel-spoke.spoke-right {
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 38%;
    height: 14px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.wheel-spoke.spoke-bottom {
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 40%;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Center Horn Button Hub */
.wheel-hub {
    width: 44%;
    height: 44%;
    border-radius: 50%;
    background: radial-gradient(circle, #2a3449 0%, #101622 100%);
    border: 3px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 4;
    pointer-events: none;
}

.wheel-horn-logo {
    font-size: 1.3rem;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
    pointer-events: none;
}

/* Wheel Angle Degree Indicator */
#wheel-angle-indicator {
    font-size: 0.72rem;
    font-weight: 800;
    color: #00ffcc;
    letter-spacing: 1px;
    background: rgba(10, 15, 25, 0.75);
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
    pointer-events: none;
}

/* =========================================================
   TOUCH CONTROLS LAYOUT (User Customized Layout)
   - Left Side: UP / DOWN buttons (Gas & Reverse/Brake)
   - Right Side: LEFT / RIGHT buttons + NITRO + BRAKE
   ========================================================= */

/* Left Side: UP / DOWN Drive Zone + BRAKE / DRIFT Button */
#touch-left-zone {
    position: absolute;
    bottom: clamp(12px, 3.5vh, 28px);
    left: clamp(12px, 3.5vw, 28px);
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: clamp(8px, 1.8vw, 14px);
    pointer-events: auto !important;
    touch-action: none !important;
    user-select: none;
    -webkit-user-select: none;
    z-index: 50;
}

.touch-pedals-column {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.8vh, 12px);
    align-items: center;
}

/* Right Side: Steer (Left/Right) + Nitro */
#touch-right-zone {
    position: absolute;
    bottom: clamp(12px, 3.5vh, 28px);
    right: clamp(12px, 3.5vw, 28px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: clamp(8px, 1.8vh, 14px);
    pointer-events: auto !important;
    touch-action: none !important;
    user-select: none;
    -webkit-user-select: none;
    z-index: 50;
}

/* Right Side Aux Row: NITRO button above steer buttons */
.touch-right-aux {
    display: flex;
    gap: clamp(8px, 1.8vw, 14px);
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

/* Steering Buttons Row: LEFT (◀) and RIGHT (▶) */
#touch-steer-zone {
    display: flex;
    gap: clamp(8px, 2vw, 16px);
    align-items: center;
    pointer-events: auto !important;
}

/* Base Universal Touch Control Button */
.touch-ctrl-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-radius: clamp(12px, 2.5vw, 18px);
    cursor: pointer;
    touch-action: none !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), inset 0 2px 2px rgba(255, 255, 255, 0.25);
    transition: transform 0.05s ease, filter 0.05s ease, box-shadow 0.05s ease;
}

.touch-ctrl-btn .ctrl-icon {
    font-size: clamp(1.3rem, 3.8vw, 1.8rem);
    line-height: 1;
    pointer-events: none;
}

.touch-ctrl-btn .ctrl-label {
    font-size: clamp(0.55rem, 1.6vw, 0.72rem);
    font-weight: 900;
    letter-spacing: 1px;
    pointer-events: none;
}

.touch-ctrl-btn.active {
    transform: scale(0.92);
    filter: brightness(1.35);
}

/* Left Side Up/Gas Button */
.touch-btn-gas {
    width: clamp(62px, 15vw, 84px);
    height: clamp(68px, 17vh, 96px);
    background: linear-gradient(145deg, #1b5e20, #0d3813);
    border: 2.5px solid #00e676;
    color: #b9f6ca;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 230, 118, 0.35);
}

.touch-btn-gas.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 230, 118, 0.85);
}

/* Left Side Down/Reverse Button */
.touch-btn-down {
    width: clamp(62px, 15vw, 84px);
    height: clamp(60px, 15vh, 84px);
    background: linear-gradient(145deg, #424242, #212121);
    border: 2.5px solid #9e9e9e;
    color: #e0e0e0;
}

.touch-btn-down.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(255, 255, 255, 0.6);
}

/* Right Side Steer Buttons (◀ and ▶) */
.touch-btn-arrow {
    width: clamp(64px, 15vw, 86px);
    height: clamp(64px, 15vw, 86px);
    background: linear-gradient(145deg, #1a237e, #0d1340);
    border: 2.5px solid #2979ff;
    color: #82b1ff;
    border-radius: clamp(14px, 2.5vw, 20px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 16px rgba(41, 121, 255, 0.35);
}

.touch-btn-arrow .ctrl-icon {
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
}

.touch-btn-arrow.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(41, 121, 255, 0.85);
}

/* Right Side NITRO Button */
.touch-btn-nitro {
    width: clamp(62px, 15vw, 82px);
    height: clamp(44px, 10vh, 58px);
    background: linear-gradient(145deg, #0091ea, #005b9f);
    border: 2px solid #00e5ff;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 229, 255, 0.45);
}

.touch-btn-nitro.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 229, 255, 0.9);
}

.touch-btn-nitro.cooldown {
    filter: grayscale(0.8) opacity(0.5);
    cursor: not-allowed;
}

/* Left Side BRAKE (Handbrake / Drift) Button */
.touch-btn-brake {
    width: clamp(62px, 15vw, 80px);
    height: clamp(68px, 17vh, 96px);
    background: linear-gradient(145deg, #b71c1c, #7f0000);
    border: 2.5px solid #ff1744;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 23, 68, 0.45);
}

.touch-btn-brake.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 23, 68, 0.9);
}

/* Touch Quick Action buttons (Cam & Reset) */
.touch-action-btn {
    width: clamp(42px, 9vw, 54px);
    height: clamp(42px, 9vw, 54px);
    border-radius: 50%;
    background: rgba(25, 32, 45, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: clamp(1.0rem, 2.2vw, 1.3rem);
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.touch-action-btn.active {
    transform: scale(0.9);
    background: rgba(50, 65, 90, 0.95);
}

#touch-btn-cam {
    position: absolute;
    top: clamp(60px, 12vh, 80px);
    right: clamp(10px, 2.5vw, 18px);
}

#touch-btn-reset {
    position: absolute;
    top: clamp(110px, 22vh, 140px);
    right: clamp(10px, 2.5vw, 18px);
}

/* =========================================================
   MODAL OVERLAY (Win, Fail, Pause, Info)
   ========================================================= */

#modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 14, 0.75);
    backdrop-filter: blur(10px);
    z-index: 50;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: linear-gradient(145deg, #182030, #0f1420);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    max-width: 440px;
    width: 100%;
    padding: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#modal-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffaa00;
    letter-spacing: 2px;
}

#modal-desc {
    font-size: 0.95rem;
    color: #d0d7de;
    line-height: 1.5;
}

.modal-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

#modal-action-btn {
    background: linear-gradient(90deg, #ffaa00, #ff6600);
    color: #111;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 120, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
    width: 100%;
}

#modal-action-btn:hover, #modal-action-btn:active {
    transform: scale(1.02);
}

.modal-secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e6edf3;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    width: 100%;
}

.modal-secondary-btn:hover, .modal-secondary-btn:active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* Mobile Responsiveness Rules */
@media (max-width: 600px) {
    #hud-minimap-container {
        width: 90px;
        height: 90px;
    }
    #hud-speed-val {
        font-size: 2.2rem;
    }
    #hud-drift-score {
        font-size: 1.4rem;
    }
    .touch-pedal {
        width: 62px;
        height: 100px;
    }
}

/* =========================================================
   STARTUP SCREEN: Traffic Wonders Presents Loading Screen
   ========================================================= */
#startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #151b29 0%, #080c14 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.startup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.startup-logo-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: carBounce 1.5s infinite ease-in-out;
}

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

.startup-brand {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: #ffaa00;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

.startup-presents {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: #8899b0;
    margin-top: 4px;
    margin-bottom: 12px;
}

.startup-game-title {
    font-size: 2.3rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.4), 2px 2px 0 #000;
    margin-bottom: 30px;
}

.startup-loading-wrap {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.startup-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

#startup-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffaa00, #ff3300, #ffea00);
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 12px rgba(255, 150, 0, 0.8);
    animation: barShine 1s linear infinite;
}

@keyframes barShine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

#startup-loading-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #a0b2c6;
}

#startup-start-btn {
    background: linear-gradient(90deg, #ffaa00, #ff5500);
    color: #111;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.7), 0 4px 15px rgba(0, 0, 0, 0.6);
    animation: startPulse 1.2s infinite ease-in-out;
    margin-top: 6px;
    touch-action: manipulation;
}

@keyframes startPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(255, 170, 0, 0.7); }
    50% { transform: scale(1.06); box-shadow: 0 0 35px rgba(255, 200, 0, 0.95); }
}

/* =========================================================
   ANDROID ORIENTATION NOTICE OVERLAY
   ========================================================= */
#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 15, 0.95);
    backdrop-filter: blur(14px);
    z-index: 150;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.orientation-card {
    background: linear-gradient(145deg, #1b2438, #111726);
    border: 2px solid #ffaa00;
    border-radius: 18px;
    padding: 30px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.orientation-icon {
    font-size: 2.8rem;
    animation: rotatePhone 2.5s infinite ease-in-out;
}

@keyframes rotatePhone {
    0%, 10% { transform: rotate(0deg); }
    40%, 60% { transform: rotate(-90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.orientation-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffaa00;
    letter-spacing: 1px;
}

.orientation-text {
    font-size: 0.95rem;
    color: #d2dbe8;
    line-height: 1.5;
}

#orientation-dismiss-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s ease;
}

#orientation-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* =========================================================
   MAIN MENU SCREEN: Car Driving (Dynamic City Pursuit Backdrop)
   ========================================================= */
#main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Cinematic Night Street Racing Wallpaper with Atmospheric Gradients */
    background: 
        linear-gradient(180deg, rgba(6, 10, 20, 0.65) 0%, rgba(10, 14, 25, 0.85) 100%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2) 0%, rgba(5, 8, 15, 0.75) 100%),
        url('assets/main_menu_bg.jpg') no-repeat center center / cover;
    z-index: 85;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.menu-card {
    background: linear-gradient(145deg, rgba(20, 28, 44, 0.94), rgba(10, 15, 24, 0.98));
    border: 2px solid rgba(255, 170, 0, 0.45);
    border-radius: 24px;
    padding: 24px 32px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 170, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: menuFadeIn 0.3s ease-out;
    max-height: 94vh;
    overflow-y: auto;
}

/* 3D Rotating Car Preview Showcase Container */
.menu-car-preview-container, .skins-car-preview-container {
    width: 100%;
    max-width: 520px;
    height: 140px;
    background: radial-gradient(circle at 50% 60%, rgba(35, 48, 75, 0.5) 0%, rgba(12, 17, 28, 0.9) 80%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

#menu-car-preview-canvas, #skins-car-preview-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.preview-drag-hint, .preview-skin-label {
    position: absolute;
    bottom: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #00ffcc;
    background: rgba(10, 15, 25, 0.7);
    padding: 2px 10px;
    border-radius: 10px;
    pointer-events: none;
}

.preview-skin-label {
    color: #ffaa00;
}

/* =========================================================
   DEFEAT / VEHICLE TOTALED MODAL
   ========================================================= */
#defeat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(40, 10, 10, 0.9) 0%, rgba(10, 5, 5, 0.98) 100%);
    z-index: 99;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(12px);
    animation: defeatPulse 2s infinite ease-in-out;
}

@keyframes defeatPulse {
    0%, 100% { box-shadow: inset 0 0 60px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.6); }
}

.defeat-card {
    background: linear-gradient(145deg, #241416, #14090b);
    border: 2px solid #ff3333;
    border-radius: 20px;
    padding: 36px 30px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 30, 30, 0.4);
    animation: menuFadeIn 0.35s ease-out;
}

.defeat-icon {
    font-size: 3.2rem;
    animation: carBounce 1.2s infinite ease-in-out;
}

.defeat-title {
    font-size: 2.0rem;
    font-weight: 900;
    color: #ff4444;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    margin: 0;
}

.defeat-desc {
    font-size: 0.95rem;
    color: #d8c2c4;
    line-height: 1.5;
}

.defeat-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.menu-header {
    margin-bottom: 14px;
}

.menu-badge {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    color: #00ffcc;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.menu-title {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffaa00;
    text-shadow: 0 0 20px rgba(255, 170, 0, 0.45);
    margin: 0;
}

.menu-subtitle {
    font-size: 0.82rem;
    color: #9cb1d0;
    margin-top: 4px;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.menu-btn-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.menu-btn-grid-row > .menu-btn:only-child {
    grid-column: 1 / -1;
}

.menu-btn {
    background: rgba(26, 36, 56, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 11px 16px;
    color: #fff;
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.menu-btn:hover {
    background: rgba(45, 60, 92, 0.95);
    border-color: #ffaa00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.menu-btn-primary {
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    border: none;
    color: #0d121c;
    box-shadow: 0 4px 18px rgba(255, 136, 0, 0.35);
    padding: 13px 20px;
    font-size: 1.02rem;
}

.menu-btn-primary:hover {
    background: linear-gradient(135deg, #ffbb22, #ff7700);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 24px rgba(255, 136, 0, 0.55);
}

.play-start-btn {
    background: linear-gradient(135deg, #2b3955, #1b263b);
    border-color: rgba(0, 255, 204, 0.3);
}

.play-start-btn:hover {
    border-color: #00ffcc;
    box-shadow: 0 4px 16px rgba(0, 255, 204, 0.25);
}

.play-continue-btn {
    background: linear-gradient(135deg, #153e35, #0d2822);
    border-color: rgba(0, 255, 170, 0.4);
    color: #00ffaa;
}

.play-continue-btn:hover {
    border-color: #00ffaa;
    box-shadow: 0 4px 16px rgba(0, 255, 170, 0.35);
}

.menu-btn-layout-pill {
    background: rgba(18, 25, 40, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #9ab0cc;
}

.menu-btn-layout-pill:hover {
    border-style: solid;
    color: #fff;
}

.menu-btn.disabled, .menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.8);
}

.menu-footer {
    margin-top: 14px;
    font-size: 0.78rem;
    color: #7b8ea8;
}

/* =========================================================
   CAR SKINS MODAL
   ========================================================= */
#skins-modal-overlay, #settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 18, 0.88);
    z-index: 95;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.skins-modal-card, .settings-modal-card {
    background: linear-gradient(145deg, #1b253b, #101625);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 28px 24px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.skins-modal-title, .settings-modal-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #ffaa00;
    letter-spacing: 1px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #8899b0;
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.modal-close-btn:hover {
    color: #fff;
}

.skins-modal-desc {
    font-size: 0.88rem;
    color: #a0b4d0;
}

.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 8px 0;
}

.skin-card {
    background: rgba(15, 22, 35, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.skin-card:hover {
    border-color: #00ffcc;
    transform: translateY(-2px);
}

.skin-card.selected {
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.12);
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.35);
}

.skin-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.skin-stripe {
    position: absolute;
    width: 100%;
    height: 14px;
    top: 18px;
    transform: rotate(45deg);
}

.skin-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
}

/* =========================================================
   SETTINGS MODAL
   ========================================================= */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 20, 32, 0.7);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.settings-desc {
    font-size: 0.75rem;
    color: #8899b0;
}

.settings-ctrl {
    display: flex;
    gap: 6px;
}

.settings-ctrl-wrap {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 320px;
}

.settings-toggle-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-toggle-pill.active {
    background: #ffaa00;
    color: #0b101c;
    border-color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
}

.settings-btn-danger {
    background: rgba(220, 40, 40, 0.2);
    border: 1px solid #ff4444;
    color: #ff6666;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-btn-danger:hover {
    background: #ff3333;
    color: #fff;
}

/* =========================================================
   MISSIONS & MULTI-MAP SELECTION MODAL
   ========================================================= */
#missions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(14px);
    z-index: 120;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.missions-modal-card {
    background: linear-gradient(155deg, #182236 0%, #0c121e 100%);
    border: 2px solid rgba(255, 170, 0, 0.35);
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 170, 0, 0.2);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.missions-modal-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffaa00;
    letter-spacing: 2px;
}

.missions-modal-desc {
    font-size: 0.88rem;
    color: #9cb0c7;
    margin-top: -6px;
}

.map-tabs-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
}

@media (max-width: 600px) {
    .map-tabs-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.map-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-tab-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #00ffcc;
}

.map-tab-btn.active {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.25), rgba(255, 100, 0, 0.15));
    border-color: #ffaa00;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.map-tab-icon {
    font-size: 1.5rem;
}

.map-tab-label {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #e0e8f0;
    text-align: center;
}

.missions-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 4px;
}

.mission-select-card {
    background: rgba(14, 20, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}

.mission-select-card:hover {
    border-color: #00ffcc;
    background: rgba(20, 30, 48, 0.95);
    transform: translateX(3px);
}

.mission-select-card.parking-card {
    border-color: rgba(255, 200, 0, 0.45);
    background: rgba(30, 24, 12, 0.75);
}

.mission-select-card.parking-card:hover {
    border-color: #ffcc00;
    box-shadow: 0 0 16px rgba(255, 200, 0, 0.35);
}

.mission-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.mission-card-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-type-tag {
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
    background: rgba(0, 255, 204, 0.2);
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.4);
}

.mission-type-tag.parking {
    background: rgba(255, 200, 0, 0.25);
    color: #ffcc00;
    border-color: #ffcc00;
}

.mission-type-tag.escape {
    background: rgba(255, 50, 70, 0.25);
    color: #ff3355;
    border-color: #ff3355;
}

.mission-time-tag {
    font-size: 0.72rem;
    color: #8fa0b5;
    font-weight: 700;
}

.mission-card-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.mission-card-desc {
    font-size: 0.8rem;
    color: #9cb0c7;
    line-height: 1.35;
}

.mission-card-play-btn {
    background: linear-gradient(90deg, #00ffcc, #00bbff);
    color: #081018;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mission-card-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
}

.mission-select-card.parking-card .mission-card-play-btn {
    background: linear-gradient(90deg, #ffaa00, #ff6600);
    color: #111;
}

.mission-select-card.parking-card .mission-card-play-btn:hover {
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
}

/* =========================================================
   GAME MODES MODAL (3 MODS: Free Roam, Multiplayer, Become a Cop)
   ========================================================= */
#modes-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(14px);
    z-index: 120;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modes-modal-card {
    background: linear-gradient(155deg, #182236 0%, #0c121e 100%);
    border: 2px solid rgba(0, 255, 204, 0.35);
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 204, 0.2);
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.modes-modal-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #00ffcc;
    letter-spacing: 2px;
}

.modes-modal-desc {
    font-size: 0.88rem;
    color: #9cb0c7;
    margin-top: -6px;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .modes-grid {
        grid-template-columns: 1fr;
    }
}

.mode-card {
    background: rgba(18, 25, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mode-card:hover {
    transform: translateY(-3px);
    border-color: #00ffcc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 255, 204, 0.2);
}

.mode-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.mode-badge.free {
    background: rgba(0, 255, 204, 0.15);
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.4);
}

.mode-badge.multi {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.4);
}

.mode-badge.cop {
    background: rgba(255, 50, 50, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 50, 50, 0.4);
}

.mode-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.mode-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    margin: 0;
}

.mode-desc {
    font-size: 0.8rem;
    color: #a6b8ce;
    line-height: 1.35;
    flex-grow: 1;
}

.mode-map-select-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #8fa0b5;
}

.mode-map-dropdown {
    background: #0f1624;
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.mode-multiplayer-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multi-room-input {
    background: #0f1624;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
}

.multi-room-input:focus {
    border-color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

.multi-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.mode-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    padding: 8px 4px;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-action-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.mode-action-btn.primary {
    background: linear-gradient(90deg, #ffaa00, #ff6600);
    border: none;
    color: #111;
}

.multi-status-text {
    font-size: 0.72rem;
    color: #00ffcc;
    font-style: italic;
}

.mode-cop-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(255, 50, 50, 0.08);
    border: 1px solid rgba(255, 50, 50, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.72rem;
    color: #cfd8e3;
}

.mode-cop-stats b {
    color: #ff5555;
}

.mode-start-btn {
    width: 100%;
    margin-top: 4px;
    padding: 10px 14px;
    font-size: 0.88rem;
}

.mode-start-btn.cop-btn {
    background: linear-gradient(135deg, #0055ff, #00ccff);
    box-shadow: 0 4px 15px rgba(0, 100, 255, 0.4);
    color: #fff;
}

/* =========================================================================
   CURRENCY BADGES & PILLS (Coins & Diamonds)
   ========================================================================= */
.hud-currency-bar, .menu-currency-row, .garage-wallet-badges, .shop-wallet-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.currency-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.currency-pill.coins {
    background: linear-gradient(135deg, #2b2005, #141002);
    border: 1px solid #ffd700;
    color: #ffe066;
}

.currency-pill.diamonds {
    background: linear-gradient(135deg, #05232d, #021217);
    border: 1px solid #00f0ff;
    color: #a6f6ff;
}

.currency-icon {
    font-size: 1rem;
}

.hud-pill-btn.shop-glow {
    background: linear-gradient(135deg, #ff8800, #ff4400);
    color: #fff;
    border: none;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(255, 100, 0, 0.4);
}

.hud-pill-btn.garage-glow {
    background: linear-gradient(135deg, #0088ff, #0055ff);
    color: #fff;
    border: none;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(0, 120, 255, 0.4);
}

.menu-btn-double-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.menu-btn.garage-btn {
    background: linear-gradient(135deg, #0f2538, #071521);
    border-color: #00a2ff;
}

.menu-btn.shop-btn {
    background: linear-gradient(135deg, #332009, #1c1103);
    border-color: #ffaa00;
}

/* =========================================================================
   GARAGE & SHOWROOM MODAL STYLING
   ========================================================================= */
#garage-modal-overlay, #shop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(3, 7, 15, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2vw, 24px);
}

.garage-modal-card, .shop-modal-card {
    background: #0d121d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    max-height: 94dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(14px, 2vw, 22px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.garage-header-left, .shop-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.garage-modal-title, .shop-modal-title {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
}

.garage-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    margin-top: 12px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 768px) {
    .garage-layout {
        grid-template-columns: 1fr;
    }
}

.garage-preview-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.garage-canvas-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    background: radial-gradient(circle at center, #1b263b 0%, #090e18 70%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garage-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.garage-car-category {
    position: absolute;
    top: 10px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #00d4ff;
    letter-spacing: 1px;
}

.garage-details-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.garage-car-name {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
}

.garage-car-desc {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #9cb0c8;
}

.garage-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0;
}

.stat-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 65px;
    align-items: center;
    gap: 8px;
}

.stat-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: #cfd8e3;
    letter-spacing: 0.5px;
}

.stat-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffaa00, #ff3300);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-fill.nitro {
    background: linear-gradient(90deg, #00d4ff, #0055ff);
}

.stat-num {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    text-align: right;
}

.garage-action-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 10px;
    margin-top: 4px;
}

.garage-action-btn.owned {
    background: linear-gradient(135deg, #22bb33, #118822);
    box-shadow: 0 4px 15px rgba(34, 187, 51, 0.3);
}

.garage-action-btn.buy-coin {
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
    color: #111;
}

.garage-action-btn.buy-diamond {
    background: linear-gradient(135deg, #00f0ff, #0077ff);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
    color: #fff;
}

.garage-cars-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.garage-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #cfd8e3;
}

.garage-cars-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 440px;
    padding-right: 4px;
}

.garage-car-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}

.garage-car-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.garage-car-item.selected {
    background: rgba(0, 212, 255, 0.12);
    border-color: #00d4ff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

.garage-item-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.garage-item-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: #fff;
}

.garage-item-category {
    font-size: 0.72rem;
    color: #8899aa;
}

.garage-item-price {
    font-size: 0.82rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 6px;
}

.garage-item-price.free {
    background: rgba(34, 187, 51, 0.15);
    color: #44dd55;
}

.garage-item-price.coin {
    background: rgba(255, 170, 0, 0.15);
    color: #ffc107;
}

.garage-item-price.diamond {
    background: rgba(0, 240, 255, 0.15);
    color: #00f0ff;
}

/* =========================================================================
   SHOP & PACKS STYLING
   ========================================================================= */
.shop-tabs-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.shop-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ccc;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shop-tab-btn.active {
    background: linear-gradient(135deg, #ffaa00, #ff5500);
    color: #111;
    border-color: #ffaa00;
}

.shop-tab-content {
    display: none;
    overflow-y: auto;
    flex: 1;
}

.shop-tab-content.active {
    display: block;
}

.shop-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    padding: 4px;
}

.shop-pack-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.shop-pack-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.shop-pack-card.combo-card {
    background: linear-gradient(145deg, #171d2b, #0e131d);
    border-color: rgba(255, 170, 0, 0.3);
}

.shop-pack-card.combo-card.vip {
    border-color: rgba(0, 150, 255, 0.4);
}

.shop-pack-card.combo-card.mythic {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.pack-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.pack-badge.hot {
    background: #ff4400;
    color: #fff;
}

.pack-badge.vip {
    background: #0077ff;
    color: #fff;
}

.pack-badge.mythic {
    background: linear-gradient(90deg, #00f0ff, #9900ff);
    color: #fff;
}

.pack-icon {
    font-size: 2.2rem;
    margin-bottom: 2px;
}

.pack-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
}

.pack-amount {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffaa00;
}

.combo-contents {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.78rem;
    color: #cfd8e3;
}

.combo-contents b {
    color: #fff;
}

.pack-desc {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #8fa0b5;
    flex: 1;
}

.shop-buy-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    color: #111;
    transition: all 0.15s ease;
}

.shop-buy-btn.diamond {
    background: linear-gradient(135deg, #00f0ff, #0066ff);
    color: #fff;
}

.shop-buy-btn.combo {
    background: linear-gradient(135deg, #ffaa00, #ff3300);
    color: #fff;
}

.shop-buy-btn.combo.mythic {
    background: linear-gradient(135deg, #00f0ff, #8800ff);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
    color: #fff;
}

/* =========================================================
   MOBILE RESPONSIVE HUD & FULLSCREEN OPTIMIZATIONS
   ========================================================= */

/* Make Fullscreen button stand out with glowing cyan border */
#hud-btn-fullscreen {
    background: linear-gradient(135deg, rgba(0, 80, 120, 0.85), rgba(10, 25, 45, 0.95)) !important;
    border: 1.5px solid #00f0ff !important;
    color: #00f0ff !important;
    font-weight: 800 !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35) !important;
    order: -1; /* Place first or near the front so it's never cut off */
}

#hud-btn-fullscreen:active {
    background: #00f0ff !important;
    color: #000 !important;
    transform: scale(0.95);
}

.hud-top-right-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 65vw;
}

.hud-top-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 100%;
}

/* Responsive adjustment for Mobile screens (<= 820px or Android mode) */
@media (max-width: 820px) {
    .hud-top-bar {
        align-items: flex-start;
        gap: 6px;
    }

    #hud-minimap-container {
        width: 100px;
        height: 100px;
    }

    .hud-top-right-group {
        max-width: 62vw;
        gap: 4px;
    }

    .hud-currency-bar {
        display: flex;
        gap: 4px;
        transform: scale(0.85);
        transform-origin: right top;
    }

    .hud-top-right {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        max-width: 62vw;
        padding-bottom: 2px;
    }

    .hud-top-right::-webkit-scrollbar {
        display: none;
    }

    .hud-pill-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #hud-btn-fullscreen {
        font-size: 0.72rem;
        padding: 4px 10px;
    }

    /* Compact Mission & GPS Navigation Banner for Android Mobile */
    #hud-mission-banner {
        top: 52px;
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        max-width: 260px;
        padding: 4px 8px;
        border-radius: 6px;
        background: rgba(14, 18, 28, 0.94);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
        z-index: 20;
    }

    #hud-mission-title {
        font-size: 0.74rem;
    }

    #hud-mission-desc {
        display: none; /* Hide long description on mobile to keep road visible! */
    }

    .mission-stats {
        font-size: 0.68rem;
        gap: 6px;
    }

    #hud-nav-instruction {
        padding: 2px 6px;
        gap: 4px;
        margin-top: 2px;
    }

    #hud-nav-icon {
        font-size: 0.85rem;
    }

    #hud-nav-text {
        font-size: 0.66rem;
        letter-spacing: 0.3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }
}

/* Also apply compact banner whenever ANDROID layout mode is active */
body.layout-android #hud-mission-banner {
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    max-width: 260px;
    padding: 4px 8px;
    z-index: 20;
}

body.layout-android #hud-mission-desc {
    display: none;
}

body.layout-android #hud-mission-title {
    font-size: 0.74rem;
}

body.layout-android #hud-nav-instruction {
    padding: 2px 6px;
}

body.layout-android #hud-nav-text {
    font-size: 0.66rem;
}

/* ANDROID / TOUCH SCREEN HUD REORGANIZATION (Clean layout without overlapping buttons) */
body.layout-android #touch-controls {
    display: block !important;
}

body.layout-android #touch-left-zone {
    bottom: 16px;
    left: 16px;
    z-index: 60;
}

body.layout-android #touch-right-zone {
    bottom: 16px;
    right: 16px;
    z-index: 60;
}

/* Move Speedometer cluster cleanly under minimap with safe gap (minimap is 100px + padding) */
body.layout-android #hud-speedo-cluster {
    position: absolute;
    top: 156px;
    left: 16px;
    bottom: auto;
    padding: 3px 8px;
    gap: 5px;
    background: rgba(12, 16, 26, 0.90);
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    z-index: 30;
    pointer-events: none;
}

body.layout-android #hud-speed-val {
    font-size: 1.5rem;
    font-weight: 900;
}

body.layout-android #hud-speed-unit {
    font-size: 0.65rem;
}

body.layout-android #hud-gear-val {
    font-size: 0.90rem;
    padding-left: 5px;
}

/* Position Quick Action Buttons (Cam & Reset) vertically on the right side with clearance */
body.layout-android #touch-btn-cam {
    top: auto;
    bottom: 230px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
    z-index: 55;
}

body.layout-android #touch-btn-reset {
    top: auto;
    bottom: 175px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
    z-index: 55;
}

/* Center bottom: Nitro Bar sits cleanly at the very bottom center */
body.layout-android #hud-nitro-container {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    padding: 4px 8px;
    z-index: 25;
    pointer-events: none;
}

/* Damage Integrity Health bar sits cleanly ABOVE Nitro Boost in bottom center */
body.layout-android #hud-health-container {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    padding: 4px 8px;
    z-index: 25;
    pointer-events: none;
}

@media (max-width: 820px) {
    #touch-left-zone {
        bottom: 16px;
        left: 16px;
        z-index: 60;
    }

    #touch-right-zone {
        bottom: 16px;
        right: 16px;
        z-index: 60;
    }

    #touch-btn-cam {
        top: auto;
        bottom: 230px;
        right: 16px;
        width: 46px;
        height: 46px;
        font-size: 1.05rem;
        z-index: 55;
    }

    #touch-btn-reset {
        top: auto;
        bottom: 175px;
        right: 16px;
        width: 46px;
        height: 46px;
        font-size: 1.05rem;
        z-index: 55;
    }

    #hud-speedo-cluster {
        position: absolute;
        top: 156px;
        left: 16px;
        bottom: auto;
        padding: 3px 8px;
        gap: 5px;
        background: rgba(12, 16, 26, 0.90);
        border-radius: 8px;
        border: 1.5px solid rgba(255, 255, 255, 0.2);
        z-index: 30;
        pointer-events: none;
    }

    #hud-speed-val {
        font-size: 1.5rem;
        font-weight: 900;
    }

    #hud-speed-unit {
        font-size: 0.65rem;
    }

    #hud-gear-val {
        font-size: 0.90rem;
        padding-left: 5px;
    }

    #hud-nitro-container {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 140px;
        padding: 4px 8px;
        z-index: 25;
        pointer-events: none;
    }

    #hud-health-container {
        position: absolute;
        bottom: 58px;
        left: 50%;
        transform: translateX(-50%);
        width: 140px;
        padding: 4px 8px;
        z-index: 25;
        pointer-events: none;
    }
}

