/* ============================================================
 * Turbo Hills — Retro 16-Bit / Pixel-Art Arcade UI Theme
 * Chunky pixel-style borders, arcade cabinet framing,
 * punchy push-button depth, and authentic retro typography.
 * ============================================================ */

:root {
  --font-pixel: "Press Start 2P", monospace;
  --font-arcade: "Pixelify Sans", "Press Start 2P", sans-serif;
  --font-num: "Barlow Condensed", sans-serif;

  /* 16-Bit Arcade Palette */
  --ink: #000000;
  --arcade-bg: #141622;
  --arcade-panel: #1b1e2e;
  --arcade-panel-light: #252b42;
  --arcade-gold: #ffcc00;
  --arcade-gold-dark: #b37400;
  --arcade-orange: #ff7700;
  --arcade-red: #ff2a4b;
  --arcade-red-dark: #99001a;
  --arcade-green: #00e676;
  --arcade-green-dark: #008f3a;
  --arcade-cyan: #00e5ff;
  --arcade-cyan-dark: #008899;
  --arcade-purple: #b042ff;
  --arcade-blue: #2979ff;
  
  --text-main: #ffffff;
  --text-dim: #9aa4bf;
  --text-gold: #ffe066;

  --pixel-border: 3px solid var(--ink);
  --pixel-shadow: 0 5px 0 var(--ink);
  --pixel-shadow-lg: 0 8px 0 var(--ink);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090a10;
  font-family: var(--font-arcade);
  color: var(--text-main);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
}

#app canvas {
  display: block;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.hidden {
  display: none !important;
}

/* ---------------- HUD (16-BIT RETRO ARCADE GAUGES) ---------------- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.hud-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hud-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-group.right {
  justify-content: flex-end;
}

/* ============================================================
 * Professional Game Telemetry & Modern Cockpit HUD
 * ============================================================ */

/* Top HUD Container */
.hud-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.hud-group.right {
  justify-content: flex-end;
}

/* ---------------- 2D ARCADE TELEMETRY PLATES WITH CORNERS ---------------- */
.hud-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 4px 14px 4px 6px;
  background: #131724;
  border: 2px solid #282f45;
  border-radius: 7px;
  box-shadow: 0 4px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.hud-chip:hover {
  border-color: #3b4564;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hud-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.hud-label {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.hud-reading {
  display: flex;
  align-items: baseline;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-unit {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
  text-transform: lowercase;
}

/* 2D Geometric Icon Badges With Corners */
.hud-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  font-size: 15px;
  line-height: 1;
  background: #1c2233;
  border: 1.5px solid #333c57;
  box-shadow: 0 2px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* Distance Chip */
.distance-chip .hud-icon {
  background: #112238;
  border-color: #2196f3;
  box-shadow: 0 2px 0 #091320, inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Coins Chip */
.hud-chip:nth-child(2) .hud-icon {
  background: #2b2108;
  border-color: #ffb300;
  box-shadow: 0 2px 0 #151004, inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hud-chip:nth-child(2) .hud-reading {
  color: #ffd54f;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Score Chip */
.hud-chip.score .hud-icon {
  background: #2b1708;
  border-color: #ff9100;
  box-shadow: 0 2px 0 #150b04, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffb74d;
}
.hud-chip.score .hud-reading {
  color: #ffb74d;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Best Record Chip */
.hud-chip.best .hud-icon {
  background: #25122e;
  border-color: #ba68c8;
  box-shadow: 0 2px 0 #130917, inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hud-chip.best .hud-reading {
  color: #ea80fc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Biome Stage Plate with Corners */
.hud-chip.biome-chip {
  height: 44px;
  padding: 0 16px;
  background: #0d1e16;
  border: 2px solid #00c853;
  border-radius: 7px;
  color: #69f0ae;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #06100b, inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  align-self: center;
}

/* Speedometer Chip */
.hud-chip.speed-chip {
  min-width: 110px;
  padding: 4px 14px 4px 14px;
  border-color: #00acc1;
  box-shadow: 0 4px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.hud-chip.speed-chip .hud-reading {
  color: #00e5ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hud-chip.speed-chip .hud-unit {
  color: rgba(0, 229, 255, 0.7);
}
.speed-track {
  display: block;
  width: 76px;
  height: 6px;
  margin-top: 3px;
  background: #0c0e17;
  border: 1px solid #282f45;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.speed-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #00e5ff 0%, #00e676 55%, #ffd600 82%, #ff1744 100%);
  box-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
  transition: width 0.1s linear;
}

/* Pop bounce on score/coin update */
.hud-chip.pop {
  animation: hud-bounce 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes hud-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(-2px); }
  100% { transform: scale(1); }
}

/* ---------------- HUD BOTTOM: AUTOMOTIVE FUEL & TELEMETRY ---------------- */

.hud-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

/* Automotive 2D Cockpit Fuel Gauge With Corners */
.fuel-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 6px 18px 6px 8px;
  background: #131724;
  border: 2px solid #282f45;
  border-radius: 8px;
  box-shadow: 0 4px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.14);
  pointer-events: auto;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.fuel-label {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 5px;
  font-size: 16px;
  background: #2e1014;
  border: 1.5px solid #ff3b30;
  box-shadow: 0 2px 0 #150608, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.fuel-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 160px;
}

.fuel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}
.fuel-heading span:last-child {
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
}

/* 2D Recessed Fuel Bar With Corners */
.fuel-bar {
  width: 100%;
  height: 8px;
  background: #0c0e17;
  border: 1px solid #282f45;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.fuel-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #00e676, #76ff03);
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.4);
  transition: width 0.15s linear, background 0.3s ease;
}

.fuel-fill.low {
  background: linear-gradient(90deg, #ff9100, #ff1744);
  box-shadow: 0 0 8px rgba(255, 23, 68, 0.6);
  animation: fuel-pulse 0.7s infinite alternate ease-in-out;
}

@keyframes fuel-pulse {
  0% { filter: brightness(0.9); }
  100% { filter: brightness(1.3); }
}

.fuel-wrap.danger {
  border-color: #ff1744;
  box-shadow: 0 4px 0 #0a0d15, 0 0 16px rgba(255, 23, 68, 0.4);
}

.fuel-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-num);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.7px;
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
}

#fuel-eta {
  color: rgba(255, 255, 255, 0.78);
}

/* Control Hints: Sleek Translucent Badges */
.hints {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  pointer-events: auto;
}

.hints span {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(14, 18, 30, 0.65);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: color 0.15s ease, border-color 0.15s ease;
}

/* Unobtrusive Compact Stunt Toast */
.toast {
  position: absolute;
  left: 50%;
  top: 54px;
  transform: translateX(-50%);
  font-family: var(--font-arcade);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 16px;
  background: rgba(14, 18, 27, 0.92);
  color: #ffd600;
  border: 1.5px solid rgba(255, 214, 0, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.toast.pop {
  animation: pro-toast-pop 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pro-toast-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.9); }
  18% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.04); }
  30% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.92); }
}

/* ---------------- Cinematic Stage Entrance Banner ---------------- */
.stage-banner {
  position: absolute;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 26px 10px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(6, 9, 16, 0.96) 100%);
  border: 2px solid #00e5ff;
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.35), 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 85;
  text-align: center;
  white-space: nowrap;
}

.stage-banner-tag {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.2px;
  color: #38bdf8;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

.stage-banner-title {
  font-family: var(--font-arcade);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.8), 0 2px 4px #000;
}

.stage-banner-sub {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fde047;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.stage-banner.pop {
  animation: stage-banner-slide 3.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stage-banner-slide {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-22px) scale(0.88);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.04);
  }
  20% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  84% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px) scale(0.94);
  }
}

/* ---------------- 16-BIT ARCADE PANELS & CABINET FRAMING ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 14, 0.82);
  z-index: 30;
  animation: overlay-fade 0.2s steps(4) ease-out;
}

@keyframes overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Arcade Cabinet Bevel Frame */
.panel {
  position: relative;
  background: var(--arcade-panel);
  border: 4px solid var(--ink);
  border-radius: 8px;
  padding: 34px 40px;
  text-align: center;
  max-width: min(92vw, 540px);
  box-shadow: 
    0 0 0 3px var(--arcade-gold),
    0 10px 0 var(--ink),
    0 24px 50px rgba(0, 0, 0, 0.8),
    inset 0 3px 0 rgba(255, 255, 255, 0.18);
  animation: panel-drop 0.25s steps(4) ease-out;
}

.panel.small {
  padding: 28px 36px;
  min-width: min(88vw, 360px);
}

@keyframes panel-drop {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Marquee Header */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: #111420;
  color: var(--arcade-cyan);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  box-shadow: 0 2px 0 var(--ink);
}

.eyebrow span {
  width: 14px;
  height: 2px;
  background: var(--arcade-cyan);
}

/* Big 16-Bit Arcade Title */
.title {
  font-family: var(--font-pixel);
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.1;
  letter-spacing: 2px;
  color: var(--arcade-gold);
  text-shadow: 
    3px 3px 0 var(--ink),
    -2px -2px 0 var(--ink),
    2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink),
    6px 6px 0 var(--arcade-orange),
    8px 8px 0 var(--ink);
  margin-bottom: 12px;
}

.title span {
  display: block;
  font-size: 0.75em;
  color: var(--arcade-red);
  letter-spacing: 6px;
  text-shadow: 
    3px 3px 0 var(--ink),
    6px 6px 0 var(--arcade-red-dark),
    8px 8px 0 var(--ink);
}

.tagline {
  font-family: var(--font-arcade);
  font-size: 14px;
  color: var(--text-dim);
  margin: 10px 0 20px;
  letter-spacing: 0.5px;
}

.panel h2 {
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--arcade-gold);
  text-shadow: 2px 2px 0 var(--ink), 4px 4px 0 var(--arcade-orange);
  margin-bottom: 16px;
}

/* Arcade High Score Strip */
.record-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-left: 6px solid var(--arcade-gold);
  border-radius: 4px;
  background: #11131c;
  box-shadow: 0 3px 0 var(--ink);
}

.record-strip > span {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.record-strip strong {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--arcade-gold);
  text-shadow: 1px 1px 0 var(--ink);
}

.record-strip small {
  font-size: 8px;
  color: var(--text-dim);
}

/* ---------------- CHUNKY 16-BIT PUSH BUTTONS ---------------- */

.btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 14px 22px;
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 3px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}

/* Primary Button: Juicy Arcade Gold */
.btn.primary {
  background: linear-gradient(180deg, #ffea75 0%, #ffbb00 45%, #e68500 100%);
  color: #1a0f00;
  text-shadow: 1px 1px 0 #fff2a3;
}

.btn.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Ghost Button: Chunky Slate Arcade Button */
.btn.ghost {
  background: linear-gradient(180deg, #37415e 0%, #20273d 100%);
  color: #ffffff;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow: 0 6px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.btn.ghost:hover {
  background: linear-gradient(180deg, #445175 0%, #29324e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink);
}

.btn.ghost:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.5);
  background: #252a3a !important;
  color: #8b95ad !important;
  border-color: #000000 !important;
  text-shadow: none !important;
  transform: none !important;
  box-shadow: 0 4px 0 var(--ink) !important;
}

/* Arcade Controls Panel Instructions */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 18px 0 14px;
  text-align: left;
}

.controls-grid > div {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #11131c;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--ink);
  font-family: var(--font-arcade);
  font-size: 13px;
  color: var(--text-dim);
}

.controls-grid span {
  margin-left: auto;
  font-size: 12px;
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 5px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ffffff;
  background: #232a3d;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 0 2px 0 var(--ink);
}

.fine-print {
  font-family: var(--font-arcade);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ============================================================
 * AUTHENTIC 2D ARCADE GARAGE & HEAVY TUNING WORKSHOP
 * Physical 3D-beveled buttons, hydraulic lift stage, hazard
 * striping, industrial stamped steel & tactile LED pip meters.
 * ============================================================ */

/* Garage Modal Backdrop */
.garage-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.5vh, 28px) clamp(10px, 2.5vw, 32px);
  background: rgba(4, 6, 11, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  animation: overlay-fade 0.18s ease-out;
  cursor: default;
}

/* Heavy Workshop Cabinet / Hangar Frame */
.garage-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 920px;
  max-height: min(92vh, 760px);
  height: auto;
  position: relative;
  background: 
    radial-gradient(circle at 50% 12%, rgba(255, 180, 0, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #181c28 0%, #10131c 50%, #0a0c14 100%);
  border: 4px solid #000000;
  border-radius: 12px;
  box-shadow: 
    0 0 0 3px #ffcc00,
    0 10px 0 #000000,
    0 24px 60px rgba(0, 0, 0, 0.95),
    inset 0 2px 0 rgba(255, 255, 255, 0.18);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ffcc00 #0d0f17;
  padding-bottom: 14px;
}

.garage-container::-webkit-scrollbar {
  width: 7px;
}
.garage-container::-webkit-scrollbar-track {
  background: #090b12;
}
.garage-container::-webkit-scrollbar-thumb {
  background: #ffcc00;
  border: 1px solid #000;
  border-radius: 4px;
}

/* ---- Garage Top Header Bar (Stamped Steel Beam) ---- */
.garage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #252b3d 0%, #171c29 100%);
  border-bottom: 4px solid #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 8px 8px 0 0;
}

.garage-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.garage-badge {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  letter-spacing: 1.5px;
  color: #ffcc00;
  text-shadow: 1px 1px 0 #000;
  font-weight: 700;
}

.garage-topbar h2 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
  margin: 0;
  letter-spacing: 1px;
}

.garage-top-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stamped Coin Safe Pill */
.wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(180deg, #131722 0%, #0a0c13 100%);
  border: 3px solid #000000;
  border-left: 5px solid #ffcc00;
  border-radius: 6px;
  box-shadow: 0 3px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #9aa4bf;
}

.wallet-badge .wallet-icon {
  font-size: 18px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.8));
}

.wallet-badge strong {
  font-size: 16px;
  color: #ffcc00;
  text-shadow: 1px 1px 0 #000;
}

.wallet-badge.gems-badge strong {
  color: #00e5ff;
  text-shadow: 1px 1px 0 #000, 0 0 8px rgba(0, 229, 255, 0.4);
}

.wallet-badge small {
  font-size: 7px;
  letter-spacing: 1px;
  color: #cbd5e1;
}

.garage-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chunky Beveled Header Buttons */
.garage-btn-nav,
.garage-top-actions .btn.ghost,
.garage-top-actions .btn-sm {
  background: linear-gradient(180deg, #37415e 0%, #1f2639 100%) !important;
  color: #e2e8f0 !important;
  border: 3px solid #000000 !important;
  border-radius: 6px !important;
  padding: 8px 14px !important;
  font-family: var(--font-pixel) !important;
  font-size: 9.5px !important;
  box-shadow: 0 4px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  cursor: pointer;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.garage-btn-nav:hover,
.garage-top-actions .btn.ghost:hover {
  background: linear-gradient(180deg, #445173 0%, #29324b 100%) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #000000 !important;
}

.garage-btn-nav:active,
.garage-top-actions .btn.ghost:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000000 !important;
}

/* Massive Glowing Juicy DRIVE Button */
.garage-btn-drive,
.garage-top-actions .btn.primary {
  background: linear-gradient(180deg, #00e676 0%, #00a844 100%) !important;
  color: #00290e !important;
  border: 3px solid #000000 !important;
  border-radius: 6px !important;
  padding: 8px 18px !important;
  font-family: var(--font-pixel) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 0 #005a22, 0 6px 16px rgba(0, 230, 118, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.garage-btn-drive:hover,
.garage-top-actions .btn.primary:hover {
  background: linear-gradient(180deg, #26ff91 0%, #00c250 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #005a22, 0 8px 20px rgba(0, 230, 118, 0.6) !important;
}

.garage-btn-drive:active,
.garage-top-actions .btn.primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #005a22 !important;
}

.garage-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #e2e8f0;
  background: linear-gradient(180deg, #37415e 0%, #1c2234 100%);
  border: 3px solid #000000;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.garage-close-btn:hover {
  background: linear-gradient(180deg, #e63946 0%, #a01a24 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #000000;
}

.garage-close-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000000;
}

/* ---- Garage Main Split Body ---- */
.garage-body {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(320px, 1fr);
  gap: 16px;
  padding: 14px 18px;
  align-items: start;
}

.garage-content-panel {
  display: flex;
  flex-direction: column;
}

.garage-showcase {
  flex-shrink: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
 * HERO VEHICLE STAGE (HYDRAULIC WORKSHOP LIFT)
 * ============================================================ */
.showcase-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 12px 14px;
  min-height: 220px;
  background: 
    radial-gradient(ellipse 65% 55% at 50% 25%, #22293d 0%, #111522 70%, #090b12 100%);
  border: 3px solid #000000;
  border-radius: 10px;
  box-shadow: 
    0 6px 0 #000000,
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -16px 36px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* Overhead Workshop Spotlight Cone */
.stage-lighting {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 60% 80% at 50% 0%,
    rgba(255, 214, 0, 0.14) 0%,
    rgba(255, 120, 0, 0.05) 50%,
    transparent 80%
  );
}

/* Heavy 3D Arcade Stage Bumper Arrows */
.stage-nav-btn {
  position: relative;
  z-index: 3;
  width: 46px;
  height: 48px;
  flex-shrink: 0;
  border: 3px solid #000000;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffb300 0%, #e67e00 100%);
  color: #1a0f00;
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #733c00, inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.stage-nav-btn:hover {
  background: linear-gradient(180deg, #ffc726 0%, #ff9500 100%);
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #733c00, 0 0 14px rgba(255, 179, 0, 0.5);
}

.stage-nav-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #733c00;
}

.stage-turntable {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  flex: 1;
}

#garage-car-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

/* Heavy Hydraulic Workshop Lift Platform */
.turntable-pedestal {
  width: 360px;
  max-width: 86vw;
  height: 16px;
  background: linear-gradient(180deg, #3d455d 0%, #1f2434 100%);
  border: 3px solid #000000;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 0 #000000, 0 12px 28px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  margin-top: -6px;
}

/* Diagonal Hazard Caution Striping */
.pedestal-hazard {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #ffcc00 0px,
    #ffcc00 12px,
    #141724 12px,
    #141724 24px
  );
  opacity: 0.85;
}

/* ---- Showcase Banner (Identity, Paint Studio & Dyno Telemetry) ---- */
.showcase-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #181d2a 0%, #0f121a 100%);
  border: 3px solid #000000;
  border-radius: 8px;
  box-shadow: 0 4px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.showcase-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.showcase-header h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000000;
  margin: 0;
  letter-spacing: 0.5px;
}

.vehicle-class-badge {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: #111420;
  color: #ffcc00;
  border: 2px solid #000000;
  border-radius: 4px;
  box-shadow: 0 2px 0 #000000;
  font-weight: 700;
}

.showcase-desc {
  font-family: var(--font-arcade);
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
}

/* Custom Paint Studio Directly on Hero Stage */
.monster-skins-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #090b12;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.7);
  flex-wrap: wrap;
}

.skins-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ffcc00;
  letter-spacing: 0.5px;
}

.skins-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* High-Gloss Circular Automotive Paint Swatches */
.skin-swatch {
  width: 24px;
  height: 24px;
  border: 2px solid #000000;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 0 #000000, inset 0 2px 3px rgba(255, 255, 255, 0.45);
  transition: transform 0.08s steps(2), border-color 0.1s, box-shadow 0.1s;
  position: relative;
  outline: none;
}

.skin-swatch:hover {
  transform: scale(1.18) translateY(-2px);
  box-shadow: 0 5px 0 #000000;
}

.skin-swatch.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 2px #ffcc00, 0 4px 0 #000000, 0 0 12px rgba(255, 204, 0, 0.8);
  transform: scale(1.22);
}

.skin-swatch.locked {
  opacity: 0.45;
  filter: grayscale(0.75);
}

.skin-swatch.locked::after {
  content: '🔒';
  font-size: 9px;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

/* Segmented Automotive Dyno Telemetry Meters */
.showcase-stat-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 10px;
  background: #090c14;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.showcase-stat-bars .stat-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.showcase-stat-bars .stat-tag {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.showcase-stat-bars output {
  font-family: var(--font-pixel);
  font-size: 8.5px;
  font-weight: 700;
}

#showcase-spd-val { color: #38bdf8; text-shadow: 0 0 6px rgba(56, 189, 248, 0.5); }
#showcase-pwr-val { color: #fb923c; text-shadow: 0 0 6px rgba(251, 146, 60, 0.5); }
#showcase-agl-val { color: #4ade80; text-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }

.showcase-stat-bars .bar-track {
  width: 100%;
  height: 9px;
  background: #04060b;
  border: 2px solid #000000;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

#showcase-spd-fill {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

#showcase-pwr-fill {
  background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.6);
}

#showcase-agl-fill {
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.showcase-action {
  width: 100%;
}

/* Big Juicy Tactile Action Button */
.showcase-main-btn {
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 20px !important;
  font-family: var(--font-pixel) !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  border: 3px solid #000000 !important;
  border-radius: 6px !important;
  box-shadow: 0 5px 0 #000000, inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
  cursor: pointer;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.showcase-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #000000 !important;
}

.showcase-main-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000000 !important;
}

.showcase-main-btn.selected-btn {
  background: linear-gradient(180deg, #15803d 0%, #0d5427 100%) !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: 0 4px 0 #062b14, inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  cursor: default;
}

/* ============================================================
 * WORKSHOP CONTROL BAY: TABS & RETRO CARDS
 * ============================================================ */
.garage-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  background: #090c14;
  padding: 5px;
  border: 3px solid #000000;
  border-radius: 8px;
  box-shadow: 0 4px 0 #000000, inset 0 2px 6px rgba(0, 0, 0, 0.7);
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 2px solid #000000;
  background: linear-gradient(180deg, #22293d 0%, #151a28 100%);
  color: #94a3b8;
  font-family: var(--font-pixel);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 0 #000000;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2), background 0.1s;
}

.tab-btn:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #2d364f 0%, #1b2133 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #000000;
}

.tab-btn.active {
  background: linear-gradient(180deg, #ffcc00 0%, #e69500 100%);
  color: #170d00;
  border-color: #000000;
  box-shadow: 0 3px 0 #734000, inset 0 2px 0 rgba(255, 255, 255, 0.45);
  font-weight: 900;
  text-shadow: none;
}

/* ---- Upgrades Workbench (The Big Parts) ---- */
.upgrade-list {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  text-align: left;
}

.upgrade-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 3px solid #000000;
  border-radius: 8px;
  background: linear-gradient(180deg, #1f2537 0%, #131722 100%);
  box-shadow: 0 4px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.upgrade-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #090c14;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.upgrade-copy h3 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000000;
  margin: 0;
}

.upgrade-copy p {
  font-family: var(--font-arcade);
  font-size: 13px;
  color: #94a3b8;
  margin: 2px 0 4px;
}

.upgrade-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.upgrade-level {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  letter-spacing: 0.5px;
  color: #ffcc00;
}

/* Authentic LED Level Pip Blocks [■][■][■] */
.upgrade-pips {
  display: flex;
  gap: 4px;
}

.upgrade-pips i {
  width: 14px;
  height: 8px;
  background: #0b0e17;
  border: 1px solid #000000;
  border-radius: 2px;
}

.upgrade-pips i.on {
  background: linear-gradient(180deg, #ffcc00 0%, #f59e0b 100%);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.7);
}

.btn.upgrade-buy {
  width: auto;
  min-width: 125px;
  margin: 0;
  padding: 10px 14px;
  font-family: var(--font-pixel);
  font-size: 9px;
  border: 3px solid #000000;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff7a00 0%, #d94b00 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #732600, inset 0 2px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.btn.upgrade-buy:hover {
  background: linear-gradient(180deg, #ff9124 0%, #f05a00 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #732600;
}

.btn.upgrade-buy:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #732600;
}

.btn.upgrade-buy:disabled {
  background: #2a3144 !important;
  color: #64748b !important;
  border-color: #000000 !important;
  box-shadow: 0 3px 0 #000000 !important;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Vehicle Fleet Cards ---- */
.vehicle-list {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  text-align: left;
}

.vehicle-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 3px solid #000000;
  border-radius: 8px;
  background: linear-gradient(180deg, #1e2436 0%, #131722 100%);
  box-shadow: 0 4px 0 #000000, inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.06s steps(2), border-color 0.1s, box-shadow 0.1s;
}

.vehicle-card:hover {
  border-color: #ffcc00;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #000000;
}

.vehicle-card.active-vehicle {
  border-color: #ffcc00;
  background: linear-gradient(180deg, #2a334d 0%, #182033 100%);
  box-shadow: 0 4px 0 #000000, 0 0 12px rgba(255, 204, 0, 0.25);
}

.vehicle-card.inspected-vehicle {
  outline: 2px solid #38bdf8;
}

.vehicle-preview-wrap {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #090c14;
  border: 2px solid #000000;
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.vehicle-info h3 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #ffffff;
  margin: 0;
}

.vehicle-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vehicle-cost-badge {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  padding: 2px 6px;
  border: 2px solid #000000;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffcc00 0%, #f59e0b 100%);
  color: #1a0f00;
  font-weight: 700;
}

.vehicle-cost-badge.free {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
}

.vehicle-info p {
  font-family: var(--font-arcade);
  font-size: 12.5px;
  color: #94a3b8;
  margin: 3px 0 0;
  line-height: 1.3;
}

.vehicle-action-btn {
  width: auto;
  min-width: 105px;
  margin: 0;
  padding: 9px 12px;
  font-family: var(--font-pixel);
  font-size: 9px;
  border: 3px solid #000000;
  border-radius: 6px;
  box-shadow: 0 3px 0 #000000;
  cursor: pointer;
}

.vehicle-action-btn.selected-btn {
  background: #14532d !important;
  color: #4ade80 !important;
  border-color: #000000 !important;
  box-shadow: 0 3px 0 #000000 !important;
  cursor: default;
}

/* ---------------- GAME OVER & PAUSE (2D RACING OVERLAYS WITH CORNERS) ---------------- */

#screen-over .panel,
#screen-pause .panel {
  background: #141724;
  border: 2.5px solid #282f45;
  border-radius: 10px;
  padding: 32px 34px;
  min-width: min(90vw, 380px);
  max-width: min(92vw, 440px);
  box-shadow: 
    0 8px 0 #0a0d15,
    0 24px 60px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: modal-enter 0.25s steps(4) ease-out;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

#screen-over h2,
#screen-pause h2 {
  font-family: var(--font-num);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: none;
}

#screen-over h2 {
  background: linear-gradient(180deg, #ffffff 0%, #ff5252 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(255, 82, 82, 0.4));
}

#screen-pause h2 {
  background: linear-gradient(180deg, #ffffff 0%, #00e5ff 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 229, 255, 0.4));
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  background: #0d101a;
  border: 1.5px solid #252b3e;
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 3px 0 #07090f, inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat:hover {
  border-color: #3b4564;
}

.stat-label {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.over-reason {
  margin: -4px 0 14px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255, 235, 190, 0.86);
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.stat.best .stat-value {
  color: #ea80fc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.new-best {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid #ffd54f;
  border-radius: 6px;
  background: #2b2108;
  color: #ffd54f;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #110d03;
  margin-bottom: 18px;
  animation: pro-best-pulse 1.4s infinite alternate ease-in-out;
}

@keyframes pro-best-pulse {
  from { transform: scale(0.98); }
  to { transform: scale(1.02); }
}

#screen-over .btn,
#screen-pause .btn {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.2px;
  margin: 10px 0;
  border: 2px solid #000000;
  box-shadow: 0 5px 0 #0a0d15;
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}

#screen-over .btn.primary,
#screen-pause .btn.primary {
  background: linear-gradient(180deg, #ffea75 0%, #ffbb00 45%, #e68500 100%);
  color: #1a0f00;
  box-shadow: 0 5px 0 #0a0d15, inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

#screen-over .btn.primary:hover,
#screen-pause .btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #0a0d15;
}

#screen-over .btn.primary:active,
#screen-pause .btn.primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0a0d15;
}

#screen-over .btn.ghost,
#screen-pause .btn.ghost {
  background: linear-gradient(180deg, #37415e 0%, #20273d 100%);
  color: #ffffff;
  box-shadow: 0 5px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#screen-over .btn.ghost:hover,
#screen-pause .btn.ghost:hover {
  background: linear-gradient(180deg, #445175 0%, #29324e 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #0a0d15;
}

#screen-over .btn.ghost:active,
#screen-pause .btn.ghost:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0a0d15;
}

/* ============================================================
 * Authentic Hill Climb Racing Topbar HUD & Cockpit Controls
 * ============================================================ */

.hidden-diag {
  display: none !important;
}

/* ---------------- HILL CLIMB RACING TOPBAR ---------------- */
.hcr-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
  z-index: 25;
}

.hcr-top-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
}

/* Staged Telemetry Column: Fuel & Turbo Nitro */
.hcr-gauges-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Authentic Fuel Meter */
.hcr-fuel-gauge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 18, 27, 0.88);
  border: 2px solid #334155;
  border-radius: 16px;
  padding: 3px 8px 3px 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.hcr-fuel-icon {
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}
.hcr-fuel-track {
  position: relative;
  width: 92px;
  height: 14px;
  background: #090c12;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}
.hcr-fuel-track .fuel-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #6ee7b7 0%, #10b981 50%, #047857 100%);
  border-radius: 6px;
  transition: width 0.12s linear;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.hcr-fuel-track .fuel-fill.low {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #b91c1c 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: hcr-fuel-pulse 0.5s infinite alternate ease-in-out;
}
@keyframes hcr-fuel-pulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}
.hcr-fuel-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arcade);
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
  letter-spacing: 0.5px;
}
.hcr-fuel-eta {
  font-family: var(--font-arcade);
  font-size: 9px;
  font-weight: 800;
  color: #34d399;
  background: rgba(6, 78, 59, 0.55);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

/* Authentic Nitro / Turbo Meter (Stacked below fuel on PC/wide displays) */
.hcr-nitro-gauge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 18, 27, 0.92);
  border: 2px solid #0284c7;
  border-radius: 16px;
  padding: 3px 8px 3px 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(56, 189, 248, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hcr-nitro-icon {
  font-size: 14px;
  line-height: 1;
  color: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.8));
}
.hcr-nitro-track {
  position: relative;
  width: 92px;
  height: 14px;
  background: #090c12;
  border-radius: 7px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}
.hcr-nitro-track .nitro-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #7dd3fc 0%, #0284c7 50%, #0369a1 100%) !important;
  border-radius: 6px;
  transition: width 0.12s linear;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}
.hcr-nitro-gauge.depleted {
  border-color: #475569;
}
.hcr-nitro-gauge.depleted .nitro-fill {
  background: linear-gradient(180deg, #64748b 0%, #475569 50%, #334155 100%) !important;
  box-shadow: none;
}
.hcr-nitro-gauge.full {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 12px rgba(56, 189, 248, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hcr-nitro-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arcade);
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
  letter-spacing: 0.5px;
}

/* Stat Pills: Gold Coins, Diamonds / Score, Best Crown */
.hcr-stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 18, 27, 0.88);
  border: 2px solid #334155;
  border-radius: 16px;
  padding: 3px 9px 3px 7px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-family: var(--font-arcade);
  color: #ffffff;
}
.hcr-coin-icon, .hcr-gem-icon, .hcr-crown-icon {
  font-size: 14px;
  line-height: 1;
}
.hcr-stat-pill.coins .hcr-stat-val {
  color: #facc15;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.hcr-stat-pill.gems .hcr-stat-val {
  color: #00e5ff;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 8px rgba(0, 229, 255, 0.4);
}
.hcr-stat-pill.score .hcr-stat-val {
  color: #38bdf8;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.hcr-stat-pill.best .hcr-stat-val {
  color: #e879f9;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.hcr-stat-pill small {
  font-size: 9px;
  color: #94a3b8;
  margin-left: 1px;
}

/* Center Distance Track Groove */
.hcr-top-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}
.hud-stage-pill {
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #93c5fd;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  background: rgba(14, 18, 27, 0.88);
  padding: 1px 8px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.hcr-track-line {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 18, 27, 0.88);
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 3px 10px 3px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 10px rgba(59, 130, 246, 0.25);
}
.hcr-track-star {
  color: #facc15;
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.6));
}
.hcr-dist-badge {
  font-family: var(--font-arcade);
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.hcr-dist-badge small {
  font-size: 9px;
  color: #93c5fd;
  margin-left: 2px;
}

/* Top Right Actions */
.hcr-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.hcr-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hcr-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 2px solid #475569;
  color: #f1f5f9;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
  padding: 0;
}
.hcr-icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* ---------------- TOUCH & COCKPIT CONTROLS ---------------- */

#touch-controls.hidden {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) and (min-height: 541px) {
  #touch-controls { display: none !important; }
}

#touch-controls {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  pointer-events: none;
  z-index: 22;
}

/* Authentic Hill Climb Racing Stamped Metallic Pedals */
.hcr-pedal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: pointer;
}

.hcr-pedal .pedal-plate {
  width: 104px;
  height: 126px;
  border-radius: 14px;
  background: linear-gradient(155deg, #d8dee9 0%, #94a3b8 24%, #475569 58%, #64748b 80%, #334155 100%);
  border: 3px solid #1e293b;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.75),
    0 4px 6px rgba(0, 0, 0, 0.5),
    inset 0 3px 2px rgba(255, 255, 255, 0.7),
    inset 0 -3px 3px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 14px;
  position: relative;
  transform-origin: bottom center;
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.06s ease;
}

/* Pedal Mounting Stem */
.hcr-pedal .pedal-stem {
  width: 22px;
  height: 16px;
  background: linear-gradient(90deg, #1e293b 0%, #475569 45%, #64748b 55%, #1e293b 100%);
  border-radius: 0 0 4px 4px;
  border: 2px solid #0f172a;
  border-top: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
  margin-top: -2px;
}

/* Stamped Metal Grip Holes (2 cols x 3 rows) */
.pedal-holes {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  grid-template-rows: repeat(3, 11px);
  gap: 8px 12px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}
.pedal-holes i {
  display: block;
  width: 22px;
  height: 11px;
  border-radius: 6px;
  background: #0f172a;
  box-shadow:
    inset 0 3px 4px rgba(0, 0, 0, 0.95),
    inset 0 -1px 2px rgba(255, 255, 255, 0.2),
    0 1px 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.8);
}

/* Stamped Embossed Pedal Text */
.pedal-text {
  font-family: var(--font-arcade);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1e293b;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 -1px 1px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
}

/* Left / Brake specific styling */
.hcr-pedal.brake .pedal-plate {
  border-color: #3b1d24;
}
.hcr-pedal.brake .pedal-text {
  color: #7f1d1d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 -1px 0 rgba(0,0,0,0.9);
}

/* Right / Gas specific styling */
.hcr-pedal.gas .pedal-plate {
  border-color: #1e3a24;
}
.hcr-pedal.gas .pedal-text {
  color: #14532d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 -1px 0 rgba(0,0,0,0.9);
}

/* Pressed State Feedback */
.hcr-pedal:active .pedal-plate,
.hcr-pedal.active .pedal-plate {
  transform: translateY(8px) scale(0.96) perspective(300px) rotateX(8deg);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.8),
    inset 0 2px 2px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  filter: brightness(0.92);
}

/* ---------------- COCKPIT DASHBOARD CLUSTER (AUTHENTIC HCR) ---------------- */
.hcr-dashboard-cluster {
  position: absolute;
  left: 50%;
  bottom: max(6px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  z-index: 22;
}

/* Authentic Tilted NOS Nitrous Bottle Button */
.hcr-nos-bottle {
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  position: relative;
  width: 52px;
  height: 58px;
  user-select: none;
  -webkit-user-select: none;
  margin-right: -2px;
  margin-bottom: 2px;
  transition: transform 0.08s ease, filter 0.08s ease;
}

/* Round Metallic Mounting Base */
.nos-mount-base {
  position: absolute;
  left: 4px;
  bottom: 2px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #475569 0%, #1e293b 70%, #0f172a 100%);
  border: 2.5px solid #64748b;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.75), inset 0 2px 4px rgba(255, 255, 255, 0.25);
}

/* Tilted Nitrous Canister (-35deg tilt) */
.nos-canister {
  position: absolute;
  left: 14px;
  bottom: 6px;
  width: 24px;
  height: 48px;
  transform: rotate(-35deg);
  transform-origin: 50% 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nos-valve {
  width: 10px;
  height: 8px;
  background: linear-gradient(90deg, #94a3b8 0%, #f1f5f9 50%, #64748b 100%);
  border-radius: 3px 3px 0 0;
  border: 1px solid #1e293b;
  position: relative;
  margin-bottom: -1px;
}

.nos-gauge-dial {
  position: absolute;
  top: -2px;
  right: -7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.nos-body {
  width: 24px;
  height: 40px;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 30%, #0369a1 70%, #075985 100%);
  border-radius: 10px 10px 4px 4px;
  border: 2px solid #082f49;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.6),
    inset 1px 1px 2px rgba(255, 255, 255, 0.6),
    inset -1px -1px 2px rgba(0, 0, 0, 0.6);
}

/* Numeric Readout Above Bottle */
.nos-psi {
  position: absolute;
  top: -6px;
  right: 0px;
  font-family: var(--font-arcade);
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    -1.5px -1.5px 0 #000,
    1.5px -1.5px 0 #000,
    -1.5px 1.5px 0 #000,
    1.5px 1.5px 0 #000,
    0 2px 4px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
  z-index: 10;
}

.hcr-nos-bottle:active {
  transform: scale(0.93) translateY(2px);
  filter: brightness(1.25);
}

/* ---------------- AUTHENTIC ARCHED GAUGES ---------------- */
.hcr-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.hcr-gauge .gauge-face {
  width: 86px;
  height: 58px;
  border-radius: 43px 43px 0 0;
  background: rgba(20, 18, 16, 0.75);
  border: 3.5px solid #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.6),
    inset 0 3px 6px rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}

/* Radial Tick Marks along perimeter */
.gauge-ticks {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  mask-image: radial-gradient(circle, transparent 64%, black 65%);
  -webkit-mask-image: radial-gradient(circle, transparent 64%, black 65%);
}

/* Redline Arc Band on Right */
.gauge-redline {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border-top: 4.5px solid #ef4444;
  border-right: 4.5px solid #ef4444;
}

/* White Needle */
.gauge-needle {
  position: absolute;
  left: calc(50% - 1.5px);
  bottom: 0px;
  width: 3px;
  height: 38px;
  background: #ffffff;
  border-radius: 3px 3px 0 0;
  transform-origin: 50% 100%;
  transform: rotate(-120deg);
  transition: transform 0.04s linear;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
  z-index: 4;
}

/* White Center Pivot Button at Bottom Center */
.gauge-cap {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8f0 60%, #94a3b8 100%);
  border: 1.5px solid #1e293b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  z-index: 5;
}

/* Embedded Label Inside Gauge at Bottom */
.gauge-name {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-arcade);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
  z-index: 6;
}

/* ---------------- RESPONSIVE ADJUSTMENTS ---------------- */

/* ---- Mobile: Full-Screen Garage Showroom ---- */
@media (max-width: 768px), (max-height: 520px) {
  .garage-screen {
    display: block;
    padding: 0;
    background: radial-gradient(ellipse at 50% 30%, #1e233a 0%, #0d0f18 70%, #060710 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
    cursor: default;
  }

  .garage-container {
    width: 100%;
    height: 100vh;
    max-height: 100dvh;
    max-width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    background: transparent;
    padding-bottom: 24px;
  }

  .garage-topbar {
    border-radius: 0;
    position: static;
  }
}

@media (max-width: 640px) {
  .hud-top {
    top: 8px; left: 8px; right: 8px;
    flex-direction: column; gap: 6px;
  }
  .hud-group { gap: 6px; }
  .hud-group.right { align-self: flex-end; }
  .hud-chip {
    height: 38px;
    padding: 3px 10px 3px 5px;
    gap: 7px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #0a0d15, inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .hud-icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
    border-radius: 4px;
    box-shadow: 0 1px 0 #0a0d15;
  }
  .hud-reading {
    font-size: 17px;
  }
  .hud-label {
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  .hud-unit {
    font-size: 9px;
  }
  .hud-chip.biome-chip {
    font-size: 11px;
    height: 38px;
    padding: 0 12px;
    letter-spacing: 1.2px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #06100b;
  }
  .hud-chip.speed-chip {
    min-width: 88px;
    padding: 3px 10px;
  }
  .speed-track {
    width: 52px;
    height: 5px;
    border-radius: 2px;
  }

  .hud-bottom {
    left: 8px; right: 8px; bottom: 85px;
  }
  .fuel-wrap {
    height: 44px;
    padding: 4px 12px 4px 6px;
    gap: 8px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #0a0d15;
  }
  .fuel-label {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 4px;
    box-shadow: 0 1px 0 #150608;
  }
  .fuel-copy {
    width: min(40vw, 130px);
  }
  .fuel-heading {
    font-size: 9px;
  }
  .fuel-heading span:last-child {
    font-size: 11px;
  }
  .fuel-bar {
    height: 6px;
    border-radius: 2px;
  }
  .hints { display: none; }

  .panel { padding: 22px 18px; }
  .title { font-size: 32px; }
  .controls-grid { grid-template-columns: 1fr; gap: 5px; }

  /* Garage responsive */
  .garage-topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .garage-topbar h2 { font-size: 14px; }
  .garage-badge { font-size: 6px; }
  .wallet-badge { padding: 6px 10px; }
  .wallet-badge strong { font-size: 13px; }
  .garage-top-actions {
    width: 100%;
    justify-content: stretch;
    display: flex;
    gap: 8px;
  }
  .garage-top-actions .btn { flex: 1; }
  .garage-close-btn {
    flex: 0 0 38px;
    height: 38px;
  }
  .garage-showcase { padding: 12px; }
  .showcase-stage { padding: 16px 0; min-height: 160px; }
  .stage-nav-btn { width: 38px; height: 38px; font-size: 14px; }
  #garage-car-canvas { width: 280px !important; height: 120px !important; }
  .turntable-pedestal { width: 240px; }
  .showcase-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
  }
  .showcase-main-btn { width: 100% !important; }
  .garage-tabs,
  .vehicle-list,
  .upgrade-list { margin-left: 12px; margin-right: 12px; }
  .garage-tabs { flex-direction: column; gap: 4px; }
  .vehicle-card { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
  .vehicle-action-btn { grid-column: 1 / -1; }

  .upgrade-card { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .btn.upgrade-buy { grid-column: 2; justify-self: start; margin-top: 4px; }
  
  .touch-btn { width: 56px; height: 56px; font-size: 16px; }
  .touch-btn.gas { width: 68px; height: 68px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
 * Trailhead refresh — warm field notes, forest green, ember orange
 * ============================================================ */
:root {
  --ink: #17352a;
  --arcade-bg: #193b31;
  --arcade-panel: #f8f0dd;
  --arcade-panel-light: #fffaf0;
  --arcade-gold: #e87832;
  --arcade-orange: #c95724;
  --arcade-green: #8fcf75;
  --arcade-green-dark: #275941;
  --text-main: #fffaf0;
  --text-dim: #b9c7b2;
  --text-gold: #ffc277;
  --font-pixel: "Trebuchet MS", system-ui, sans-serif;
  --font-arcade: "Trebuchet MS", system-ui, sans-serif;
  --font-num: "Arial Narrow", "Trebuchet MS", sans-serif;
}

body { background: #183a2f; color: var(--text-main); font-family: var(--font-arcade); }
button { font: inherit; }
button:focus-visible { outline: 3px solid #ffd08a; outline-offset: 3px; }

#app::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: .16; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,248,225,.08) 4px); mix-blend-mode: soft-light; }
.hud-top { top: 18px; left: 20px; right: 20px; }
.hud-chip { background: rgba(22,55,43,.9); border: 1px solid rgba(255,248,225,.22); border-radius: 12px; box-shadow: 0 8px 20px rgba(8,27,20,.25); }
.hud-icon { background: #295b42; border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.hud-label { color: #b9cdb7; letter-spacing: 1.4px; }
.hud-reading { text-shadow: none; }
.hud-chip.score .hud-reading, .hud-chip.speed-chip .hud-reading { color: #ffc277; }
.hud-chip.biome-chip { border-color: #8fcf75; background: rgba(27,75,51,.9); color: #c5ebae; box-shadow: 0 8px 20px rgba(8,27,20,.25); }
.hud-chip.speed-chip { border-color: #e87832; }
.speed-track, .fuel-bar { background: #102d24; border: 1px solid rgba(255,255,255,.2); }
.speed-track > span { background: linear-gradient(90deg, #8fcf75 0%, #f3c34c 65%, #e87832 100%); box-shadow: none; }
.fuel-wrap { background: rgba(22,55,43,.92); border: 1px solid rgba(255,248,225,.2); border-radius: 12px; box-shadow: 0 8px 20px rgba(8,27,20,.22); }
.fuel-label { background: #713d27; border: 1px solid #e87832; box-shadow: none; }
.fuel-fill { background: linear-gradient(90deg, #8fcf75, #cde784); box-shadow: none; }
.hints span { background: rgba(22,55,43,.76); border: 1px solid rgba(255,248,225,.2); border-radius: 8px; color: #d4dfca; box-shadow: none; }
.hints b { color: #ffc277; }
.hud-actions { display: flex; gap: 7px; align-items: center; pointer-events: auto; }
.hud-action { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 11px; border: 1px solid rgba(255,248,225,.25); border-radius: 10px; background: rgba(22,55,43,.9); color: #fff8e6; cursor: pointer; font-size: 15px; box-shadow: 0 5px 14px rgba(8,27,20,.2); transition: .16s ease; }
.hud-action span { font-size: 10px; letter-spacing: 1px; color: #b9cdb7; }
.hud-action:hover { background: #2d6749; transform: translateY(-1px); }
.hud-action.is-muted { color: #ffc277; border-color: #e87832; }

.overlay { background: rgba(14,43,32,.72); backdrop-filter: blur(8px); animation: overlay-fade .2s ease-out; }
.panel { background: linear-gradient(145deg, #fffaf0 0%, #f3e6c9 100%); color: #17352a; border: 1px solid rgba(23,53,42,.18); border-radius: 24px; padding: 38px 42px; box-shadow: 0 20px 70px rgba(7,29,21,.45), 0 5px 0 #d1b98f; animation: panel-drop .28s ease-out; }
.eyebrow { border: 0; background: transparent; color: #4b8057; font: 700 11px/1 var(--font-arcade); letter-spacing: 2.5px; box-shadow: none; }
.eyebrow span { width: 24px; height: 2px; background: #e87832; }
.title { color: #1e513a; font: 900 clamp(42px,8vw,70px)/.9 var(--font-arcade); letter-spacing: -2px; text-shadow: 2px 3px 0 #c8ddad; }
.title span { color: #e87832; letter-spacing: 1px; text-shadow: none; font-size: .74em; }
.tagline { color: #607466; font-size: 16px; }
.record-strip { background: #edf2df; border: 1px solid #c2d5b2; border-left: 5px solid #e87832; border-radius: 10px; box-shadow: none; color: #456554; }
.record-strip > span { font: 700 10px var(--font-arcade); color: #557364; }
.record-strip strong { color: #275941; text-shadow: none; }
.btn { border: 1px solid #17352a; border-radius: 11px; box-shadow: 0 4px 0 #17352a; font: 800 14px var(--font-arcade); letter-spacing: 1px; transition: transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.btn.primary { background: linear-gradient(180deg,#f6a04e,#e87832); color: #fffaf0; text-shadow: none; }
.btn.ghost { background: #2d6749; color: #fffaf0; text-shadow: none; }
.btn:hover { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 6px 0 #17352a; }
.fine-print { color: #607466; }



#screen-over .panel, #screen-pause .panel { background: #fffaf0; border: 1px solid #c2d5b2; box-shadow: 0 18px 60px rgba(7,29,21,.45), 0 5px 0 #c3d2b7; }
#screen-over h2, #screen-pause h2 { color: #1e513a; background: none; -webkit-text-fill-color: initial; filter: none; text-shadow: none; font: 900 42px var(--font-arcade); }
#screen-over h2 { color: #c95724; }
.stat { background: #edf2df; border: 1px solid #cbdcc1; box-shadow: none; }
.stat-label { color: #607466; }
.stat-value { color: #1e513a; text-shadow: none; }
.stat.best .stat-value { color: #e87832; }

@media (max-width: 640px) {
  .hud-top { top: 8px; left: 8px; right: 8px; }
  .hud-actions { gap: 5px; }
  .hud-action { height: 38px; padding: 0 8px; }
  .hud-action span { display: none; }
  .panel { padding: 28px 22px; border-radius: 18px; }
  .title { font-size: 42px; }
  .garage-container { border-radius: 0; }
  .garage-topbar { padding: 12px; }
}

/* ============================================================
 * Rally cockpit widget pass — compact telemetry, readable gauges
 * ============================================================ */
:root {
  --widget-ink: #17352a;
  --widget-panel: rgba(22, 55, 43, .94);
  --widget-panel-soft: #edf2df;
  --widget-line: rgba(255, 248, 225, .2);
  --widget-orange: #e87832;
  --widget-lime: #a9d28e;
}

.hud-chip, .fuel-wrap {
  min-width: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hud-chip { min-height: 48px; height: auto; padding: 7px 12px 7px 7px; border-color: var(--widget-line); }
.hud-chip.score { border-color: rgba(232,120,50,.7); background: linear-gradient(145deg, rgba(71,48,30,.96), var(--widget-panel)); }
.hud-chip.best { border-color: rgba(255,194,119,.55); }
.hud-chip.score .hud-reading { font-size: 25px; color: #ffd08a; }
.hud-chip.best .hud-reading { color: #ffd08a; }
.hud-icon { width: 34px; height: 34px; }
.hud-reading { font-variant-numeric: tabular-nums; }
.speed-track, .fuel-bar { position: relative; height: 10px; border-radius: 4px; padding: 1px; }
.speed-track::after, .fuel-bar::after {
  content: ""; position: absolute; inset: 1px; pointer-events: none; opacity: .34;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(255,248,225,.8) 9px 10px);
}
.speed-track > span, .fuel-fill { position: relative; z-index: 1; border-radius: 2px; }
.fuel-wrap { min-width: 242px; border-color: var(--widget-line); }
.fuel-heading span:first-child { color: #d4dfca; }
.fuel-fill.low { animation: fuel-pulse 0.7s infinite alternate ease-in-out; }
.pause-readout {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -4px 0 18px;
}
.pause-readout span { display: flex; flex-direction: column; gap: 2px; padding: 9px 6px; text-align: center; background: #edf2df; border: 1px solid #cbdcc1; border-radius: 10px; }
.pause-readout b { color: #1e513a; font: 800 20px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.pause-readout small { color: #607466; font: 700 9px/1 var(--font-arcade); letter-spacing: .8px; }
.record-strip { min-height: 60px; }
.record-strip strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.stats { gap: 9px; }
.stat { min-height: 78px; padding: 12px; }
.stat-value { font-variant-numeric: tabular-nums; }
.stat.best { border-color: #e87832; background: #fff3da; }
.stat.best::after { content: "TOP RUN"; color: #b45a28; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.stat-bar-row { min-width: 104px; gap: 6px; }
.stat-bar-row .bar-track { flex: 1; width: auto; min-width: 38px; height: 9px; border-radius: 5px; overflow: hidden; }
.stat-bar-row .bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #e87832, #f6c56c); }
.stat-bar-row output { min-width: 20px; color: #397151; font: 800 10px var(--font-num); text-align: right; font-variant-numeric: tabular-nums; }
.vehicle-card, .upgrade-card { min-width: 0; }
.vehicle-info { min-width: 0; }
.vehicle-info p, .upgrade-copy p { line-height: 1.25; }

/* Keep every widget inside a narrow portrait viewport. */
@media (max-width: 480px) {
  .hud-top { display: block; }
  .hud-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .hud-group.right { margin-top: 6px; grid-template-columns: minmax(0, 1fr) auto; }
  .hud-chip { width: 100%; }
  .hud-chip.biome-chip { grid-column: 1 / -1; justify-content: center; }
  .hud-actions { justify-content: flex-end; }
  .hud-action { min-width: 38px; }
  .hud-chip.speed-chip { min-width: 0; }
  .fuel-wrap { min-width: 0; width: min(100%, 238px); }
  .fuel-copy { width: auto; flex: 1; min-width: 0; }
  .fuel-heading { font-size: 9px; }
  .pause-readout { gap: 5px; }
  .pause-readout b { font-size: 17px; }
  #screen-over .panel, #screen-pause .panel { min-width: 0; width: calc(100vw - 20px); padding: 24px 14px; }
  #screen-over h2, #screen-pause h2 { font-size: 34px; }
  .stat { padding: 10px 8px; }
  .stat-value { font-size: 21px; }
  .garage-topbar { align-items: flex-start; }
  .garage-brand { min-width: 0; }
  .garage-topbar h2 { white-space: nowrap; }
  .vehicle-card { grid-template-columns: 44px minmax(0, 1fr); padding: 10px; gap: 8px; }
  .vehicle-preview-wrap { width: 44px; height: 44px; font-size: 22px; }
  .stat-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .stat-bar-row { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px; }
  .stat-bar-row output { grid-column: 2; text-align: left; line-height: 1; }
  .vehicle-info p { font-size: 11px; }
}

@media (max-width: 340px) {
  .hud-top { top: 5px; left: 5px; right: 5px; }
  .hud-group { gap: 4px; }
  .hud-chip { min-height: 35px; padding: 4px 7px; gap: 5px; border-radius: 8px; }
  .hud-icon { width: 25px; height: 25px; font-size: 12px; }
  .hud-label { font-size: 7px; }
  .hud-reading, .hud-chip.score .hud-reading { font-size: 16px; }
  .hud-chip.biome-chip { font-size: 9px; min-height: 32px; }
  .speed-track { width: 42px; height: 7px; }
  .hud-action { height: 34px; padding: 0 7px; font-size: 13px; }
  .hud-bottom { left: 5px; right: 5px; bottom: 78px; }
  .fuel-wrap { height: 39px; padding: 3px 8px 3px 4px; gap: 5px; }
  .fuel-label { width: 27px; height: 27px; font-size: 12px; }
  .fuel-heading span:last-child { font-size: 10px; }
  .touch-btn { width: 50px; height: 50px; }
  .touch-btn.gas { width: 61px; height: 61px; }
  .garage-topbar h2 { font-size: 12px; }
  .garage-top-actions .btn-sm { min-width: 0; padding-left: 8px !important; padding-right: 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .fuel-fill.low, .new-best { animation: none; }
}
.nitro-wrap{display:flex;align-items:center;gap:8px;min-width:200px;padding:4px 12px 4px 6px;background:#101a26;border:2px solid #1f6f8b;border-radius:7px;box-shadow:0 4px 0 #0a0d15,inset 0 1px 0 rgba(255,255,255,0.14)}
.nitro-label{font-size:20px;filter:drop-shadow(0 0 6px #00e5ff)}
.nitro-copy{flex:1;min-width:0}
.nitro-heading{display:flex;justify-content:space-between;font-family:var(--font-num);font-size:11px;letter-spacing:1px;color:#9be9ff}
.nitro-bar{height:10px;border-radius:5px;overflow:hidden;background:#06121c;border:1px solid #155e75}
.nitro-hint{margin-top:2px;font-family:var(--font-num);font-size:8.5px;letter-spacing:0.6px;color:rgba(155,233,255,0.62);text-transform:uppercase;white-space:nowrap}
.nitro-fill{height:100%;width:100%;background:linear-gradient(90deg,#00e5ff,#7CFCFF 45%,#ffd600 85%,#ff7700);box-shadow:0 0 10px #00e5ff;transition:width 0.12s linear}
.nitro-wrap.depleted{border-color:#5b2330}
.nitro-wrap.depleted .nitro-fill{filter:grayscale(0.8) brightness(0.6);box-shadow:none}
.nitro-wrap.full{animation:nitroPulse 1.2s ease-in-out infinite}
@keyframes nitroPulse{0%,100%{box-shadow:0 4px 0 #0a0d15,0 0 0 rgba(0,229,255,0)}50%{box-shadow:0 4px 0 #0a0d15,0 0 14px rgba(0,229,255,0.65)}}
.touch-btn.boost{background:linear-gradient(180deg,#0e3a4a 0%,#082433 100%);border-color:#00e5ff;color:#a5f3fc;box-shadow:0 6px 0 #062028,inset 0 2px 0 rgba(255,255,255,0.25),0 0 12px rgba(0,229,255,0.35)}
.combo-stat .stat-value{color:#00e5ff}

@media (orientation: landscape) and (max-height: 520px), (max-width: 900px) and (max-height: 520px) {
  .hints, .biome-chip, #nitro-hint, #fuel-drain, .fuel-label, .nitro-label { display: none !important; }
  .hud-top { top: 5px; left: 5px; right: 5px; gap: 6px; align-items: flex-start; }
  .hud-group { gap: 5px; flex-wrap: nowrap; }
  .hud-actions { gap: 5px; }
  .hud-action { height: 30px; min-width: 34px; padding: 0 7px; }
  .hud-action span { display: none; }
  .hud-chip { min-height: 32px; height: 32px; padding: 2px 8px 2px 5px; gap: 6px; border-width: 1px; }
  .hud-icon { width: 22px; height: 22px; font-size: 12px; }
  .hud-label { font-size: 7px; letter-spacing: .8px; }
  .hud-reading, .hud-chip.score .hud-reading { font-size: 16px; }
  .hud-unit { font-size: 9px; }
  .speed-track, .fuel-bar, .nitro-bar { height: 6px; border-radius: 3px; }
  .speed-track::after, .fuel-bar::after { opacity: .18; }
  .hud-bottom { top: 38px; left: 6px; right: auto; bottom: auto; transform: none; justify-content: flex-start; gap: 5px; }
  .fuel-wrap, .nitro-wrap { min-width: 0; width: 142px; height: 25px; padding: 2px 6px; gap: 4px; border-width: 1px; }
  .fuel-copy, .nitro-copy { width: auto; flex: 1; min-width: 0; }
  .fuel-heading, .nitro-heading { font-size: 8px; letter-spacing: .7px; }
  .fuel-heading span:last-child, #nitro-value { font-size: 10px; }
  #fuel-eta { font-size: 8px; white-space: nowrap; }
  /* HCR Topbar & Cockpit in Rotated Mobile Screen */
  .hcr-topbar {
    height: 40px;
    padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .hcr-fuel-gauge { padding: 2px 6px 2px 5px; gap: 4px; border-radius: 12px; }
  .hcr-fuel-icon { font-size: 13px; }
  .hcr-fuel-track { width: 72px; height: 11px; }
  .hcr-fuel-text { font-size: 8px; }
  .hcr-nitro-gauge { display: none; }
  .hcr-stat-pill { padding: 2px 7px 2px 5px; gap: 4px; border-radius: 12px; }
  .hcr-coin-icon, .hcr-gem-icon, .hcr-crown-icon { font-size: 12px; }
  .hcr-stat-pill .hcr-stat-val { font-size: 11px; }
  .hcr-track-line { padding: 2px 8px 2px 6px; gap: 5px; border-radius: 12px; }
  .hcr-track-star { font-size: 12px; }
  .hcr-dist-badge { font-size: 12px; }
  .hcr-icon-btn { width: 28px; height: 28px; font-size: 11px; border-radius: 6px; }

  /* HCR Pedals & Cockpit Gauges (Mobile Landscape) */
  #touch-controls {
    padding: 0 max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .hcr-pedal .pedal-plate {
    width: 86px;
    height: 104px;
    border-radius: 12px;
    padding: 10px 6px 10px;
  }
  .hcr-pedal .pedal-stem { width: 18px; height: 12px; }
  .pedal-holes {
    grid-template-columns: repeat(2, 18px);
    grid-template-rows: repeat(3, 9px);
    gap: 6px 9px;
  }
  .pedal-holes i { width: 18px; height: 9px; border-radius: 4px; }
  .pedal-text { font-size: 13px; letter-spacing: 1.5px; }

  .hcr-dashboard-cluster {
    bottom: 0px;
    gap: 10px;
  }
  .hcr-nos-bottle {
    width: 46px;
    height: 52px;
  }
  .nos-mount-base {
    width: 38px;
    height: 38px;
  }
  .nos-canister {
    width: 20px;
    height: 42px;
  }
  .nos-body {
    width: 20px;
    height: 34px;
  }
  .nos-psi {
    font-size: 14px;
    top: -6px;
  }
  .hcr-gauge .gauge-face {
    width: 76px;
    height: 50px;
    border-radius: 38px 38px 0 0;
    border-width: 3px;
  }
  .hcr-gauge .gauge-needle {
    height: 33px;
    width: 2.5px;
  }
  .hcr-gauge .gauge-cap {
    width: 14px;
    height: 14px;
    bottom: -5px;
  }
  .gauge-name {
    font-size: 10px;
    bottom: 2px;
  }
  .overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    overflow-y: auto !important;
  }

  .panel {
    max-height: calc(100dvh - 14px) !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
  }

  /* ---------------- PAUSE MENU (ROTATED MOBILE) ---------------- */
  #screen-pause .panel {
    width: min(85vw, 275px) !important;
    min-width: unset !important;
    padding: 14px 18px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #screen-pause h2 {
    font: 900 19px/1.2 var(--font-arcade) !important;
    margin: 0 0 10px 0 !important;
    color: #1e513a !important;
    text-align: center !important;
  }
  #screen-pause .pause-readout {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin: 0 0 10px 0 !important;
  }
  #screen-pause .pause-readout span {
    padding: 6px 4px !important;
    gap: 2px !important;
    border-radius: 8px !important;
  }
  #screen-pause .pause-readout b {
    font-size: 15px !important;
    line-height: 1 !important;
  }
  #screen-pause .pause-readout small {
    font-size: 7.5px !important;
    letter-spacing: 0.5px !important;
  }
  #screen-pause #btn-resume {
    display: block !important;
    width: 100% !important;
    margin: 0 0 7px 0 !important;
    padding: 9px 14px !important;
    font-size: 11px !important;
    min-height: 36px !important;
  }
  #screen-pause #btn-quit {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 11px !important;
    min-height: 34px !important;
  }

  /* ---------------- GAME OVER SCREEN (ROTATED MOBILE) ---------------- */
  #screen-over .panel {
    width: min(88vw, 305px) !important;
    min-width: unset !important;
    padding: 12px 16px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #screen-over h2 {
    font: 900 19px/1.1 var(--font-arcade) !important;
    margin: 0 0 2px 0 !important;
    color: #c95724 !important;
    text-align: center !important;
  }
  #screen-over .over-reason {
    font-size: 9px !important;
    margin: 0 0 8px 0 !important;
    color: #607466 !important;
    text-align: center !important;
  }
  #screen-over .stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
    margin: 0 0 8px 0 !important;
  }
  #screen-over .stat {
    padding: 5px 4px !important;
    min-height: unset !important;
    gap: 2px !important;
    border-radius: 6px !important;
  }
  #screen-over .stat-label {
    font-size: 7.5px !important;
    letter-spacing: 0.4px !important;
    line-height: 1 !important;
  }
  #screen-over .stat-value {
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
  }
  #screen-over .stat.best {
    grid-column: span 1 !important;
  }
  #screen-over .stat.combo-stat {
    grid-column: span 2 !important;
  }
  #screen-over .stat.best::after {
    display: none !important;
  }
  #screen-over #new-best {
    font-size: 9px !important;
    padding: 3px 6px !important;
    margin: 0 0 6px 0 !important;
    text-align: center !important;
  }
  #screen-over #btn-retry {
    display: block !important;
    width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 9px 14px !important;
    font-size: 11px !important;
    min-height: 36px !important;
  }
  #screen-over #btn-menu {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 11px !important;
    min-height: 34px !important;
  }

  /* ---------------- MAIN MENU (ROTATED MOBILE) ---------------- */
  .menu-panel {
    width: min(85vw, 290px) !important;
    padding: 12px 18px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .menu-panel .eyebrow {
    margin: 0 auto 5px auto !important;
    font-size: 7px !important;
    padding: 2px 6px !important;
  }
  .menu-panel .title {
    font-size: 22px !important;
    line-height: 1.1 !important;
    margin: 0 0 2px 0 !important;
  }
  .menu-panel .tagline {
    font-size: 9px !important;
    margin: 0 0 7px 0 !important;
    color: #607466 !important;
    line-height: 1.2 !important;
  }
  .menu-panel .record-strip {
    min-height: unset !important;
    padding: 4px 8px !important;
    margin: 0 0 8px 0 !important;
    font-size: 8px !important;
    border-radius: 6px !important;
  }
  .menu-panel .record-strip strong {
    font-size: 13px !important;
  }
  .menu-panel #btn-start {
    display: block !important;
    width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 9px 14px !important;
    font-size: 11px !important;
    min-height: 36px !important;
  }
  .menu-panel #btn-garage {
    display: block !important;
    width: 100% !important;
    margin: 0 0 5px 0 !important;
    padding: 8px 14px !important;
    font-size: 10px !important;
    min-height: 34px !important;
  }
  .menu-panel .fine-print {
    font-size: 7.5px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  /* ---------------- GARAGE / WORKSHOP (ROTATED MOBILE) ---------------- */
  .garage-screen {
    align-items: flex-start !important;
    padding: 0 !important;
  }
  .garage-container {
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    height: 100dvh !important;
    overflow-y: hidden !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  .garage-topbar {
    padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)) !important;
    border-radius: 0 !important;
  }
  .garage-topbar h2 {
    font-size: 13px !important;
  }
  .garage-body {
    display: grid !important;
    grid-template-columns: 1.1fr 1fr !important;
    gap: 10px !important;
    padding: 4px max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    height: calc(100dvh - 44px) !important;
    overflow-y: hidden !important;
  }
  .garage-showcase {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .showcase-stage {
    min-height: 125px !important;
    height: 125px !important;
    padding: 2px 4px !important;
    gap: 6px !important;
  }
  #garage-car-canvas {
    width: 285px !important;
    height: 108px !important;
  }
  .turntable-pedestal {
    width: 235px !important;
    height: 9px !important;
  }
  .stage-nav-btn {
    width: 38px !important;
    height: 42px !important;
    font-size: 13px !important;
  }
  .showcase-banner {
    padding: 6px 10px !important;
    margin-top: 0 !important;
    gap: 6px !important;
  }
  .showcase-header h3 {
    font-size: 12px !important;
  }
  .vehicle-class-badge {
    font-size: 6.5px !important;
    padding: 2px 6px !important;
  }
  .showcase-desc {
    font-size: 9px !important;
    margin: 1px 0 0 0 !important;
  }
  .monster-skins-row {
    padding: 3px 6px !important;
    margin: 2px 0 0 0 !important;
    gap: 5px !important;
  }
  .skins-label {
    font-size: 7px !important;
  }
  .skin-swatch {
    width: 19px !important;
    height: 19px !important;
  }
  .showcase-stat-bars {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    margin-top: 2px !important;
    padding: 4px 6px !important;
  }
  .showcase-stat-bars .stat-tag {
    font-size: 7px !important;
  }
  .showcase-stat-bars output {
    font-size: 8px !important;
  }
  .showcase-main-btn {
    min-width: 90px !important;
    padding: 8px 12px !important;
    font-size: 9.5px !important;
    min-height: 32px !important;
  }
  .garage-content-panel {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .garage-tabs {
    margin: 0 0 6px 0 !important;
    padding: 3px !important;
    flex-shrink: 0 !important;
  }
  .tab-btn {
    padding: 7px 8px !important;
    font-size: 8.5px !important;
  }
  .vehicle-list, .upgrade-list {
    margin: 0 !important;
    gap: 6px !important;
    padding-bottom: max(32px, env(safe-area-inset-bottom)) !important;
  }
  .vehicle-card {
    padding: 7px 9px !important;
    gap: 8px !important;
    grid-template-columns: 36px 1fr auto !important;
  }
  .vehicle-preview-wrap {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  .vehicle-info h3 {
    font-size: 10px !important;
  }
  .vehicle-cost-badge {
    font-size: 7px !important;
    padding: 2px 5px !important;
  }
  .vehicle-info p {
    display: none !important;
  }
  .vehicle-card .stat-bars {
    display: none !important;
  }
  .vehicle-action-btn {
    min-width: 80px !important;
    padding: 7px 8px !important;
    font-size: 8.5px !important;
    min-height: 28px !important;
  }
  .upgrade-card {
    padding: 7px 9px !important;
    gap: 8px !important;
    grid-template-columns: 36px 1fr auto !important;
  }
  .upgrade-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  .upgrade-copy h3 {
    font-size: 10px !important;
  }
  .upgrade-copy p {
    font-size: 8.5px !important;
    margin: 1px 0 !important;
  }
  .upgrade-meta {
    margin-top: 3px !important;
  }
  .upgrade-level {
    font-size: 7px !important;
  }
  .upgrade-pips i {
    width: 12px !important;
    height: 6px !important;
  }
  .btn.upgrade-buy {
    min-width: 95px !important;
    padding: 7px 9px !important;
    font-size: 8.5px !important;
    min-height: 28px !important;
  }
}

#rotate-prompt{display:none;position:fixed;inset:0;z-index:10000;background:#101a26;color:#f4ead0;align-items:center;justify-content:center;text-align:center;padding:24px}
.rotate-card{border:3px solid #1f6f8b;background:#131724;padding:26px 30px;border-radius:8px;max-width:330px}
.rotate-card h2{margin:10px 0 6px;font-family:var(--font-pixel);font-size:16px;letter-spacing:1px}
.rotate-card p{margin:0;color:#b9cdb7;font:600 13px system-ui,sans-serif}
.rotate-icon{display:inline-block;font-size:46px;transform:rotate(90deg)}
@media (orientation: portrait) and (max-width: 860px), (orientation: portrait) and (max-height: 620px){
  #rotate-prompt{display:flex}
  body{overflow:hidden}
}


/* ============================================================
 * SIMPLE PRELOADER STYLES
 * ============================================================ */

.preloader-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #090a10 !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.preloader-overlay.fade-out {
  opacity: 0 !important;
  transform: scale(1.02) !important;
  pointer-events: none !important;
}

.simple-loader-card {
  width: min(86vw, 340px) !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.simple-loader-title {
  font-family: var(--font-pixel) !important;
  font-size: 26px !important;
  letter-spacing: 2px !important;
  color: var(--arcade-gold) !important;
  margin-bottom: 22px !important;
  text-shadow: 2px 2px 0 var(--ink) !important;
}

.simple-loader-title span {
  color: var(--arcade-orange) !important;
}

.simple-loader-bar {
  position: relative !important;
  width: 100% !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  margin-bottom: 12px !important;
}

.simple-loader-fill {
  height: 100% !important;
  background: linear-gradient(90deg, var(--arcade-orange), var(--arcade-gold)) !important;
  border-radius: 4px !important;
  transition: width 0.1s ease-out !important;
}

.simple-loader-meta {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-family: var(--font-pixel) !important;
  font-size: 10px !important;
  color: var(--text-dim) !important;
  letter-spacing: 0.5px !important;
}

.simple-loader-meta #preloader-percent {
  color: var(--arcade-gold) !important;
}

