/* ============================================================
   TurboX5 — synthwave UI shell
   ============================================================ */

/* Self-Hosted Local Font: Orbitron */
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('./vendor/fonts/orbitron.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./vendor/fonts/orbitron.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./vendor/fonts/orbitron.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('./vendor/fonts/orbitron.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('./vendor/fonts/orbitron.woff2') format('woff2');
}

:root {
  --sky-deep: #2d0b4e;
  --sky-horizon: #4a154b;
  --neon-cyan: #19f0ff;
  --neon-pink: #ff2e9a;
  --neon-gold: #ffc94a;
  --ui-font: 'Orbitron', 'Segoe UI', 'Roboto', monospace, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --banner-height: 0px;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sky-deep);
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--ui-font);
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.hidden {
  display: none !important;
}

button * {
  pointer-events: none;
}

/* ---------- cosmetic vignette ---------- */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0) 55%,
      rgba(10, 2, 24, 0.35) 100%);
  z-index: 5;
  contain: layout style paint;
}

/* ---------- HUD Left (top-left: Speed) ---------- */
#hud-left {
  position: fixed;
  top: calc(10px + var(--safe-top));
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  z-index: 20;
  pointer-events: none;
  contain: layout style;
}

#hud-left .hud-item {
  align-items: flex-start;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: calc(10px + var(--safe-top));
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  z-index: 20;
  pointer-events: none;
  contain: layout style;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 12px;
  background: rgba(18, 6, 38, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.45);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  min-width: 108px;
  contain: layout style paint;
}

#hud-volts-item {
  border-color: rgba(255, 201, 74, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.hud-value {
  font-size: clamp(20px, 4.4vw, 30px);
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.75);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hud-label {
  font-size: clamp(9px, 1.8vw, 11px);
  font-weight: 600;
  color: rgba(220, 245, 255, 0.72);
  letter-spacing: 2.5px;
}

#hud-volts-item .hud-label {
  color: rgba(255, 225, 140, 0.8);
}

.volts {
  color: var(--neon-gold) !important;
  text-shadow: 0 0 8px rgba(255, 201, 74, 0.75) !important;
}

.hud-item.bump {
  animation: hud-bump 0.25s ease;
}

@keyframes hud-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- HUD Powerup Timer Bars (Equalized Neon Blue & Neon Pink) ---------- */
.hud-powerup-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin-top: 6px;
  pointer-events: none;
  width: auto;
  contain: layout style;
}

.powerup-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(18, 6, 38, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.5);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  width: 140px;
  max-width: 140px;
  box-sizing: border-box;
  contain: layout style paint;
}

.powerup-bar-info {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  line-height: 1;
}

.powerup-bar-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(25, 240, 255, 0.65);
  white-space: nowrap;
}

.powerup-bar-time {
  display: none !important;
}

.powerup-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(10, 3, 20, 0.88);
  border: 1px solid rgba(25, 240, 255, 0.35);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.powerup-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--neon-cyan);
  transform-origin: left center;
  will-change: transform;
}

/* Overdrive Progress Bar uses Primary Action Neon Pink */
#hud-pbar-nitro {
  border-color: rgba(255, 46, 154, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

#hud-pbar-nitro .powerup-bar-name {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.75);
}

#hud-pbar-nitro .powerup-bar-track {
  border-color: rgba(255, 46, 154, 0.4);
}

#hud-pbar-nitro .powerup-bar-fill {
  background: var(--neon-pink);
}

/* ---------- title overlay ---------- */
#title-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(12vh + var(--safe-top));
  z-index: 30;
  pointer-events: none;
  contain: layout style;
}

#game-title {
  font-size: clamp(44px, 13vw, 110px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #f4e9ff;
  text-shadow:
    0 0 14px rgba(255, 46, 154, 0.9),
    0 0 42px rgba(255, 46, 154, 0.55),
    0 4px 0 rgba(38, 6, 66, 0.9);
  transform: perspective(300px) rotateX(14deg);
}

#game-title span {
  color: var(--neon-cyan);
  text-shadow:
    0 0 14px rgba(25, 240, 255, 0.95),
    0 0 42px rgba(25, 240, 255, 0.55),
    0 4px 0 rgba(6, 38, 66, 0.9);
}

#tap-prompt {
  margin-top: 7vh;
  font-size: clamp(14px, 3.4vw, 22px);
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 14px rgba(25, 240, 255, 0.85);
}

.pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- HUD Pause Button ---------- */
.hud-pause-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  margin-top: 6px;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.16), rgba(18, 6, 38, 0.90));
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  border-radius: 10px;
  color: var(--neon-cyan);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, border-color 0.15s ease;
  contain: layout style paint;
}

.hud-pause-btn:hover {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.28), rgba(35, 10, 70, 0.88));
  border-color: var(--neon-pink);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 46, 154, 0.55);
  transform: scale(1.05);
}

.hud-pause-btn:active {
  transform: scale(0.95);
}

.pause-icon {
  width: 20px;
  height: 20px;
}

/* ---------- game-over & pause modals ---------- */
#gameover-modal,
#pause-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  background: rgba(12, 3, 28, 0.86);
  padding: 16px;
  pointer-events: auto;
  box-sizing: border-box;
  contain: layout style paint;
}

.modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(92vw, 380px);
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(26, 7, 50, 0.96), rgba(14, 4, 28, 0.98));
  border: 1.5px solid rgba(25, 240, 255, 0.6);
  box-shadow:
    0 0 32px rgba(25, 240, 255, 0.28),
    0 12px 32px rgba(0, 0, 0, 0.65),
    inset 0 0 22px rgba(25, 240, 255, 0.08);
  text-align: center;
  pointer-events: auto;
  cursor: default;
  box-sizing: border-box;
  contain: layout style;
}

.pause-card {
  gap: 20px;
}

.pause-title {
  font-size: clamp(26px, 6.5vw, 38px);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 16px rgba(25, 240, 255, 0.85);
  margin: 0;
}

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

/* Equalized Button Base across Modals */
.pause-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border-radius: 12px;
  font-family: var(--ui-font);
  font-weight: 800;
  letter-spacing: 2.5px;
  font-size: clamp(14px, 3.8vw, 16px);
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  outline: none;
  box-sizing: border-box;
  /* Default = Neon Blue button */
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.14), rgba(20, 6, 42, 0.88));
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.6);
  box-shadow: 0 0 16px rgba(25, 240, 255, 0.22), 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 10px rgba(25, 240, 255, 0.1);
}

.pause-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.26), rgba(28, 10, 56, 0.94));
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(25, 240, 255, 0.5), 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 0 14px rgba(25, 240, 255, 0.2);
}

.pause-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Primary Action Buttons (RESUME in Pause, RESTART in Game Over) = Neon Pink */
.pause-btn-resume,
.gameover-actions .pause-btn-restart {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.32), rgba(155, 27, 255, 0.26));
  border: 1.5px solid var(--neon-pink);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.75);
  box-shadow: 0 0 20px rgba(255, 46, 154, 0.38), 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 12px rgba(255, 46, 154, 0.2);
}

.pause-btn-resume:hover,
.gameover-actions .pause-btn-restart:hover {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.48), rgba(155, 27, 255, 0.38));
  border-color: #ff6ec7;
  color: #ffffff;
  box-shadow: 0 0 28px rgba(255, 46, 154, 0.68), 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 0 16px rgba(255, 46, 154, 0.3);
}

.pause-btn-camera {
  gap: 10px;
}

.pause-btn-camera .pause-btn-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* Volts Reward Button (Gives user Volts -> Allowed to be Yellow/Gold) */
.pause-btn-double-volts {
  background: linear-gradient(135deg, rgba(255, 201, 74, 0.26), rgba(40, 24, 6, 0.88));
  color: var(--neon-gold);
  border: 1.5px solid var(--neon-gold);
  text-shadow: 0 0 8px rgba(255, 201, 74, 0.7);
  box-shadow: 0 0 18px rgba(255, 201, 74, 0.38), 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 10px rgba(255, 201, 74, 0.15);
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.pause-btn-double-volts:hover {
  background: linear-gradient(135deg, rgba(255, 201, 74, 0.4), rgba(55, 32, 8, 0.94));
  border-color: #FFF275;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(255, 201, 74, 0.7), 0 6px 18px rgba(0, 0, 0, 0.55);
}

.pause-btn-double-volts:active {
  transform: translateY(1px) scale(0.98);
}

.pause-btn-double-volts.claimed {
  background: rgba(20, 12, 36, 0.6);
  border-color: rgba(25, 240, 255, 0.25);
  color: rgba(25, 240, 255, 0.55);
  text-shadow: none;
  box-shadow: none;
  cursor: default;
  transform: none !important;
}

.pause-btn-double-volts .btn-volt-icon {
  width: 20px;
  height: 20px;
  color: var(--neon-gold);
}

/* Revive Ad Button (Neon Cyan with smooth draining 8s urgency progress fill) */
.pause-btn-revive {
  position: relative;
  overflow: hidden;
  gap: 10px;
  background: rgba(14, 18, 42, 0.90);
  border: 1.5px solid var(--neon-cyan);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.85);
  box-shadow: 0 0 20px rgba(25, 240, 255, 0.38), 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(25, 240, 255, 0.16);
  font-variant-numeric: tabular-nums;
}

.pause-btn-revive:hover {
  background: rgba(20, 28, 60, 0.95);
  border-color: #a4f9ff;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(25, 240, 255, 0.68), 0 6px 18px rgba(0, 0, 0, 0.6);
}

.pause-btn-revive:active {
  transform: translateY(1px) scale(0.98);
}

.revive-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(25, 240, 255, 0.38) 0%, rgba(25, 240, 255, 0.18) 100%);
  border-right: 1.5px solid rgba(25, 240, 255, 0.9);
  transform-origin: left center;
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}

.revive-btn-icon {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.revive-btn-label {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Top Banner Ad Non-Overlapping Layout (Active ONLY on Real Ad Fill) ---------- */
.top-banner-placeholder,
.ad-simulator-overlay,
.ad-toast {
  display: none !important;
}

body.has-top-banner #hud-left,
body.has-top-banner #hud {
  top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 14px);
}

body.has-top-banner #title-overlay {
  padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + max(18px, 6vh));
}

body.has-top-banner .shop-header {
  padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 14px);
}

body.has-top-banner .garage-hub {
  padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 66px);
}

body.has-top-banner .cutscene-skip-btn {
  top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 14px);
}

body.has-top-banner #cutscene-overlay {
  padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 14px);
}

body.has-top-banner #gameover-modal,
body.has-top-banner #pause-modal,
body.has-top-banner .options-modal {
  padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 56px) + 16px);
  padding-bottom: max(16px, calc(var(--safe-bottom, 0px) + 12px));
}

body.has-top-banner .modal-card,
body.has-top-banner .options-card {
  max-height: calc(100vh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - var(--banner-height, 56px) - 32px);
}

body.has-top-banner #milestone {
  top: var(--milestone-top, calc(var(--safe-top, 0px) + var(--banner-height, 56px) + max(64px, 19vh)));
}

body.has-top-banner #close-call {
  top: var(--close-call-top, calc(var(--safe-top, 0px) + var(--banner-height, 56px) + max(64px, 19vh)));
}

@media (max-height: 500px) and (orientation: landscape) {
  body.has-top-banner #title-overlay {
    padding-top: calc(var(--safe-top, 0px) + var(--banner-height, 50px) + 12px);
  }
  body.has-top-banner #milestone {
    top: var(--milestone-top, calc(var(--safe-top, 0px) + var(--banner-height, 50px) + 48px));
  }
  body.has-top-banner #close-call {
    top: var(--close-call-top, calc(var(--safe-top, 0px) + var(--banner-height, 50px) + 52px));
  }
  .modal-card {
    padding: 18px 18px 16px;
    gap: 12px;
  }
  .pause-btn {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 13px;
  }
  .pause-actions {
    gap: 8px;
  }
}


#go-reason {
  font-size: clamp(22px, 6.2vw, 34px);
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--neon-pink);
  text-shadow: 0 0 16px rgba(255, 46, 154, 0.85);
  margin: 0;
}

/* 3-Column Equalized Game-Over Stats Grid (Never wraps or squishes) */
.go-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.go-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: rgba(25, 240, 255, 0.06);
  border: 1px solid rgba(25, 240, 255, 0.28);
  border-radius: 10px;
  min-width: 0;
}

.go-stat:last-child {
  background: rgba(255, 201, 74, 0.06);
  border-color: rgba(255, 201, 74, 0.32);
}

.go-stat:last-child .hud-label {
  color: rgba(255, 225, 140, 0.85);
}

.go-volts-val {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.go-value {
  font-size: clamp(14px, 4vw, 20px);
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restart-prompt {
  font-size: clamp(12px, 3vw, 16px);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.8);
}

/* ---------- steering wheel ---------- */
#wheel-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  width: clamp(120px, 34vw, 190px);
  height: clamp(120px, 34vw, 190px);
  z-index: 25;
  touch-action: none;
  cursor: grab;
  contain: layout style;
}

#wheel-wrap:active {
  cursor: grabbing;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform;
}

/* ---------- steering tutorial prompt ---------- */
#steer-tutorial {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(16, 6, 36, 0.92);
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  border-radius: 12px;
  padding: 8px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 30;
  contain: layout style paint;
}

#steer-tutorial.hidden {
  display: none;
}

#steer-tutorial.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.steer-tutorial-text {
  font-family: var(--ui-font);
  font-size: clamp(12px, 2.8vw, 15px);
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.75), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.steer-tutorial-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 140px;
  height: 32px;
}

.steer-arrow {
  color: rgba(25, 240, 255, 0.65);
  font-size: 22px;
  font-family: var(--ui-font);
  line-height: 1;
  user-select: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.steer-arrow-left {
  left: 6px;
}

.steer-arrow-right {
  right: 6px;
}

.steer-finger-track {
  position: relative;
  width: 80px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steer-finger {
  width: 28px;
  height: 28px;
  fill: var(--neon-cyan);
  animation: steer-swipe 1.5s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes steer-swipe {
  0% {
    transform: translateX(-30px);
  }
  100% {
    transform: translateX(30px);
  }
}

/* landscape: tuck the wheel a bit lower / smaller so it hides less road */
@media (orientation: landscape) and (max-height: 500px) {
  #wheel-wrap {
    width: clamp(100px, 22vh, 150px);
    height: clamp(100px, 22vh, 150px);
    bottom: calc(10px + var(--safe-bottom));
  }

  #steer-tutorial {
    bottom: calc(100% + 8px);
    padding: 6px 14px;
    gap: 4px;
  }

  .steer-tutorial-text {
    font-size: 11px;
  }

  .steer-tutorial-anim {
    height: 24px;
    width: 120px;
  }

  .steer-finger {
    width: 22px;
    height: 22px;
  }

  #cutscene-overlay.warlord {
    padding: 0 16px var(--warlord-bottom, 45vh);
  }

  #cutscene-overlay.warlord .subtitle-box {
    padding: 8px 16px;
    gap: 2px;
  }
}

/* ---------- distance milestone & powerup popup ---------- */
#milestone {
  position: fixed;
  top: var(--milestone-top, calc(15vh + var(--safe-top)));
  left: 0;
  right: 0;
  padding: 0 14px;
  text-align: center;
  z-index: 22;
  pointer-events: none;
  font-size: clamp(24px, 6.8vw, 56px);
  font-weight: 900;
  letter-spacing: clamp(2px, 0.8vw, 4px);
  line-height: 1.1;
  color: var(--neon-cyan);
  text-shadow:
    0 0 16px rgba(25, 240, 255, 0.9),
    0 0 46px rgba(25, 240, 255, 0.45);
  opacity: 0;
  visibility: hidden;
  contain: layout style;
}

body.hud-active #milestone {
  top: var(--milestone-top, calc(max(198px, 23vh) + var(--safe-top)));
}

body.has-top-banner.hud-active #milestone {
  top: var(--milestone-top, calc(var(--safe-top, 0px) + var(--banner-height, 56px) + max(198px, 21vh)));
}

#milestone.pink {
  color: var(--neon-pink);
  text-shadow:
    0 0 16px rgba(255, 46, 154, 0.95),
    0 0 46px rgba(255, 46, 154, 0.65),
    0 4px 0 rgba(70, 8, 40, 0.9);
}

#milestone.gold {
  color: var(--neon-pink);
  text-shadow:
    0 0 16px rgba(255, 46, 154, 0.95),
    0 0 46px rgba(255, 46, 154, 0.65),
    0 4px 0 rgba(56, 8, 52, 0.9);
}

#milestone.pop {
  visibility: visible;
  animation: milestone-pop 2.1s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes milestone-pop {
  0% { opacity: 0; transform: translateY(14px) scale(0.76); }
  16% { opacity: 1; transform: translateY(0) scale(1.08); }
  28% { transform: translateY(-4px) scale(1.03); }
  38% { transform: translateY(0) scale(1); }
  74% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.92); }
}

/* ---------- close call near-miss popup ---------- */
#close-call {
  position: fixed;
  top: var(--close-call-top, calc(23vh + var(--safe-top)));
  left: 50%;
  transform: translate(-50%, 0);
  width: max-content;
  max-width: 88vw;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(16, 6, 36, 0.90);
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  text-align: center;
  z-index: 21;
  pointer-events: none;
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 800;
  letter-spacing: 2.4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  contain: layout style paint;
}

#close-call.pink,
#close-call.gold,
#close-call.mint {
  color: var(--neon-pink);
  border-color: rgba(255, 46, 154, 0.65);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

#close-call .close-call-score {
  display: inline-block;
  margin-left: 8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.95), 0 0 20px rgba(25, 240, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

#close-call.pop {
  visibility: visible;
  animation: close-call-pop 1.15s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes close-call-pop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.82); }
  14% { opacity: 1; transform: translate(-50%, -2px) scale(1.06); }
  26% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  74% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(0.94); }
}

/* ---------- transition fade ---------- */
#fade {
  position: fixed;
  inset: 0;
  background: var(--sky-deep);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
  z-index: 55;
}

#fade.on {
  opacity: 1;
  visibility: visible;
}

/* ---------- Cyber tank jet blast heat overlay ---------- */
#heat-overlay {
  position: fixed;
  inset: 0;
  background-color: #FF5500;
  background-image: radial-gradient(circle at 50% 55%, #FF7700 0%, #FF5500 45%, #FF4400 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

/* ---------- Cinematic Camera / Photo Mode Overlay ---------- */
#cinematic-cam-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  user-select: none;
  -webkit-user-select: none;
  contain: layout style;
}

#cinematic-cam-overlay.hidden {
  display: none !important;
}

/* UI Hidden transition for screenshot capture */
#cinematic-cam-overlay.ui-hidden .cinematic-top-bar,
#cinematic-cam-overlay.ui-hidden .cinematic-zoom-dock,
#cinematic-cam-overlay.ui-hidden .cinematic-bottom-hints {
  opacity: 0;
  pointer-events: none !important;
}

.cinematic-top-bar {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-left, 16px)) 0 max(16px, env(safe-area-inset-right, 16px));
  pointer-events: auto;
  transition: opacity 0.22s ease-in-out;
  box-sizing: border-box;
  contain: layout style;
}

.cinematic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 92px;
  padding: 0 16px;
  border-radius: 12px;
  font-family: var(--ui-font);
  font-weight: 800;
  font-size: clamp(12px, 3.2vw, 14px);
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.16), rgba(16, 6, 36, 0.92));
  border: 1.5px solid rgba(25, 240, 255, 0.7);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.6);
  box-shadow: 0 0 18px rgba(25, 240, 255, 0.25), 0 4px 14px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
  contain: layout style paint;
}

.cinematic-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.28), rgba(24, 8, 48, 0.95));
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(25, 240, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.6);
}

.cinematic-btn:active {
  transform: translateY(1px) scale(0.98);
}

.cinematic-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cinematic-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cinematic-btn-traffic {
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cinematic-btn-mode.btn-active {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.22), rgba(26, 8, 40, 0.95));
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.7);
  box-shadow: 0 0 18px rgba(255, 46, 154, 0.35), 0 4px 14px rgba(0, 0, 0, 0.55);
}

.cinematic-btn-mode.btn-active:hover {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.35), rgba(36, 10, 56, 0.98));
  border-color: #ff5eb2;
  color: #ffffff;
}

.cinematic-btn-traffic.btn-off {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.18), rgba(26, 8, 40, 0.92));
  border-color: rgba(255, 46, 154, 0.75);
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.65);
  box-shadow: 0 0 16px rgba(255, 46, 154, 0.28), 0 4px 14px rgba(0, 0, 0, 0.55);
}

.cinematic-btn-traffic.btn-off:hover {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.32), rgba(36, 10, 56, 0.95));
  border-color: var(--neon-pink);
  color: #ffffff;
}

@media (max-width: 600px) {
  .cinematic-title-box {
    display: none !important;
  }
  .cinematic-top-actions {
    gap: 5px;
  }
  .cinematic-btn {
    height: 36px;
    min-width: 0;
    padding: 0 7px;
    font-size: 10px;
    letter-spacing: 0.5px;
    gap: 4px;
  }
  .cinematic-icon {
    width: 14px;
    height: 14px;
  }
}

.cinematic-badge {
  font-family: var(--ui-font);
  font-weight: 900;
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.8);
  background: rgba(14, 4, 30, 0.90);
  border: 1.5px solid rgba(25, 240, 255, 0.5);
  border-radius: 20px;
  padding: 8px 18px;
  box-shadow: 0 0 16px rgba(25, 240, 255, 0.25);
  contain: layout style paint;
}

/* Right-side vertical Zoom Dock */
.cinematic-zoom-dock {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 16px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(14, 4, 30, 0.92);
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  border-radius: 26px;
  padding: 14px 8px;
  box-shadow: 0 0 24px rgba(25, 240, 255, 0.3), 0 8px 28px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  touch-action: none;
  transition: opacity 0.22s ease-in-out;
  z-index: 56;
  min-width: 48px;
  box-sizing: border-box;
  contain: layout style paint;
}

.cinematic-zoom-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cinematic-zoom-title {
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(25, 240, 255, 0.7);
}

.cinematic-zoom-val {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.8);
}

.cinematic-zoom-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cinematic-zoom-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 240, 255, 0.14);
  border: 1.5px solid rgba(25, 240, 255, 0.6);
  border-radius: 50%;
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.cinematic-zoom-btn:hover {
  background: rgba(25, 240, 255, 0.3);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.cinematic-zoom-btn:active {
  transform: scale(0.92);
}

.cinematic-slider-container {
  position: relative;
  width: 32px;
  height: clamp(140px, 32vh, 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: pointer;
}

.cinematic-zoom-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 24px;
  height: 100%;
  cursor: pointer;
  accent-color: var(--neon-cyan);
  background: transparent;
  outline: none;
  touch-action: none;
}

/* Bottom Hint Pills */
.cinematic-bottom-hints {
  position: fixed;
  bottom: calc(18px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.22s ease-in-out;
  z-index: 56;
  contain: layout style;
}

.cinematic-hint-pill {
  background: rgba(14, 4, 30, 0.90);
  border: 1px solid rgba(25, 240, 255, 0.45);
  border-radius: 14px;
  padding: 6px 12px;
  font-family: var(--ui-font);
  font-size: clamp(10px, 2.4vw, 11px);
  font-weight: 700;
  color: #d1dded;
  letter-spacing: 1px;
  box-shadow: 0 0 12px rgba(25, 240, 255, 0.15);
  contain: layout style paint;
}

.cinematic-hint-pill b {
  color: var(--neon-cyan);
}

/* Hidden UI Notification Toast */
.cinematic-hidden-toast {
  position: fixed;
  top: calc(24px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 3, 28, 0.94);
  border: 1.5px solid rgba(25, 240, 255, 0.6);
  border-radius: 20px;
  padding: 10px 22px;
  font-family: var(--ui-font);
  font-size: clamp(11px, 2.6vw, 12px);
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.6);
  box-shadow: 0 0 24px rgba(25, 240, 255, 0.35);
  pointer-events: none;
  z-index: 60;
  animation: cinematicToastFade 2.4s ease forwards;
  contain: layout style paint;
}

.cinematic-hidden-toast.hidden {
  display: none !important;
}

@keyframes cinematicToastFade {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

@media (pointer: coarse) {
  .desktop-only {
    display: none !important;
  }
}

/* ---------- boot / loading screen with random screenshot & cyber progress bar ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  background: #080618;
  opacity: 1;
  transition: opacity 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  contain: layout style paint;
}

#loading.loading-fade-out {
  opacity: 0;
  pointer-events: none;
}

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

.loading-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform 1.2s ease-out;
  z-index: 1;
}

.loading-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(8, 6, 24, 0.42) 0%,
    rgba(8, 6, 24, 0.12) 35%,
    rgba(8, 6, 24, 0.6) 72%,
    rgba(8, 6, 24, 0.94) 100%
  );
  pointer-events: none;
}

.loading-ui-wrap {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  padding-bottom: max(32px, env(safe-area-inset-bottom, 24px));
}

.loading-card {
  width: min(94vw, 380px);
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.14), rgba(16, 6, 36, 0.94));
  border: 1.5px solid rgba(25, 240, 255, 0.6);
  border-radius: 14px;
  padding: 14px 18px 16px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.75), 0 0 24px rgba(25, 240, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
  contain: layout style paint;
}

.loading-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-title {
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(25, 240, 255, 0.85);
  line-height: 1.1;
  text-align: center;
}

.loading-accent {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.85);
}

.loading-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  border: 1px solid rgba(255, 46, 154, 0.35);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.loading-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink), 0 0 16px rgba(255, 46, 154, 0.6);
  transition: width 0.16s ease-out;
  position: relative;
}

#webgl-error {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  z-index: 70;
  background: var(--sky-deep);
  color: #f4e9ff;
  font-size: clamp(13px, 3vw, 18px);
  padding: 24px;
  text-align: center;
}

/* ---------- Cinematic Cutscene Overlay & Subtitles ---------- */
#cutscene-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 20px 48px;
  pointer-events: none;
  z-index: 45;
  transition: opacity 0.5s ease;
  contain: layout style;
}

#cutscene-overlay.warlord {
  justify-content: flex-end;
  padding: 0 20px var(--warlord-bottom, 50vh);
}

#cutscene-overlay.warlord .subtitle-box {
  border-left: 4px solid var(--neon-pink);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 46, 154, 0.3);
}

#cutscene-overlay.warlord .subtitle-speaker {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.85);
}

.cutscene-skip-btn {
  position: fixed;
  top: calc(20px + var(--safe-top));
  right: 20px;
  pointer-events: auto;
  z-index: 50;
  background: rgba(16, 6, 36, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 14px rgba(25, 240, 255, 0.2);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  contain: layout style paint;
}

.cutscene-skip-btn:hover {
  background: rgba(25, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 20px rgba(25, 240, 255, 0.5);
  transform: translateY(-1px);
}

.subtitle-box {
  width: 100%;
  max-width: 680px;
  background: rgba(14, 6, 32, 0.92);
  border: 1.5px solid rgba(25, 240, 255, 0.45);
  border-left: 4px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 16px 22px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(25, 240, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  contain: layout style paint;
}

.subtitle-box.bump {
  animation: subtitle-reveal 0.35s ease-out both;
}

.subtitle-speaker {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.8);
}

.subtitle-speaker.pilot {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.8);
}

.subtitle-text {
  font-size: clamp(15px, 2.8vw, 19px);
  line-height: 1.45;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

@keyframes subtitle-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Power-Up Shop & Title Menu Button
   ============================================================ */

/* Main Menu Action Stack (Row 1: Settings | Skill Points | Highscores, Row 2: Garage alone) */
.title-menu-actions {
  pointer-events: auto;
  position: absolute;
  bottom: calc(var(--safe-bottom) + 8vh);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: min(94vw, 430px);
  z-index: 35;
  box-sizing: border-box;
  contain: layout style;
}

.title-menu-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.title-options-circle.title-top-half-btn {
  flex: 1 1 0%;
  width: auto;
  min-width: 0;
  padding: 0 14px;
  gap: 8px;
}

.title-sp-btn-text {
  font-family: var(--ui-font);
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.65);
  white-space: nowrap;
  transition: color 0.18s ease;
}

.title-options-circle.title-top-half-btn:hover .title-sp-btn-text,
.title-options-circle.title-top-half-btn:focus-visible .title-sp-btn-text {
  color: #ffffff;
}

/* Garage Button — Primary Action in Neon Pink (25% taller, full width on bottom row) */
.title-shop-btn {
  flex: 1;
  width: 100%;
  min-height: 68px;
  height: 68px;
  padding: 18px 24px 18px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.38), rgba(110, 12, 78, 0.90));
  border: 1.5px solid var(--neon-pink);
  border-radius: 14px;
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: clamp(17px, 4.4vw, 20px);
  font-weight: 800;
  letter-spacing: 3px;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.85);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(255, 46, 154, 0.4),
    inset 0 0 14px rgba(255, 46, 154, 0.2);
  transition: transform 0.16s ease, border-color 0.16s ease;
  touch-action: manipulation;
  white-space: nowrap;
  box-sizing: border-box;
  contain: layout style paint;
}

.title-shop-btn:hover,
.title-shop-btn:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.48), rgba(170, 20, 115, 0.88));
  border-color: #ff6ec4;
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.75),
    0 0 28px rgba(255, 46, 154, 0.65),
    inset 0 0 18px rgba(255, 46, 154, 0.3);
}

.title-shop-btn:active {
  transform: translateY(1px) scale(0.98);
}

.shop-btn-icon {
  width: 23px;
  height: 23px;
  fill: currentColor;
  color: var(--neon-pink);
  flex-shrink: 0;
}

.shop-btn-text {
  color: #ffffff;
  margin-right: -3px;
}

/* Options Button — Default/Secondary Action in Neon Blue */
.title-options-circle {
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  flex: 0 0 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.18), rgba(16, 6, 36, 0.92));
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.65),
    0 0 16px rgba(25, 240, 255, 0.25),
    inset 0 0 12px rgba(25, 240, 255, 0.12);
  transition: transform 0.18s ease, border-color 0.18s ease;
  touch-action: manipulation;
  box-sizing: border-box;
  contain: layout style paint;
}

.title-options-circle:hover,
.title-options-circle:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.28), rgba(20, 14, 52, 0.96));
  border-color: var(--neon-cyan);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(25, 240, 255, 0.55),
    inset 0 0 16px rgba(25, 240, 255, 0.22);
}

.title-options-circle:active {
  transform: translateY(1px) scale(0.96);
}

.title-options-circle .options-gear-icon {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  color: var(--neon-cyan);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease;
}

.title-options-circle:hover .options-gear-icon {
  transform: rotate(60deg);
  color: #ffffff;
}

.title-options-circle:hover .trophy-btn-icon {
  transform: scale(1.1);
  color: #ffffff;
}

@media (max-width: 420px) {
  .title-menu-actions {
    width: 92vw;
    gap: 10px;
  }
  .title-menu-row {
    gap: 10px;
  }
  .title-shop-btn {
    min-height: 63px;
    height: 63px;
    padding: 15px 20px 15px 14px;
    gap: 8px;
    font-size: 17px;
    letter-spacing: 2.5px;
  }
  .title-shop-btn .shop-btn-text {
    margin-right: -2px;
  }
  .title-options-circle {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    flex: 0 0 50px;
  }
  .title-options-circle.title-top-half-btn {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    padding: 0 10px;
    gap: 7px;
  }
  .title-sp-btn-text {
    font-size: 13px;
    letter-spacing: 1.5px;
  }
  .title-options-circle .options-gear-icon {
    width: 23px;
    height: 23px;
  }
}

/* ============================================================
   Options Modal Styles (100% Unified Neon Blue Palette)
   ============================================================ */
.options-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 3, 22, 0.88);
  pointer-events: auto;
  padding: 16px;
  box-sizing: border-box;
  contain: layout style paint;
}

.options-card {
  width: min(94vw, 440px);
  max-height: min(90vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 10, 48, 0.96), rgba(12, 4, 26, 0.98));
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.8),
    0 0 28px rgba(25, 240, 255, 0.25),
    inset 0 0 20px rgba(25, 240, 255, 0.08);
  box-sizing: border-box;
  text-align: left;
  contain: layout style;
}

.options-card::-webkit-scrollbar {
  width: 5px;
}

.options-card::-webkit-scrollbar-thumb {
  background: rgba(25, 240, 255, 0.4);
  border-radius: 4px;
}

.options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(25, 240, 255, 0.25);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.options-title {
  font-family: var(--ui-font);
  font-size: clamp(22px, 5.5vw, 26px);
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 14px rgba(25, 240, 255, 0.8);
  margin: 0;
}

.options-close-x {
  background: rgba(25, 240, 255, 0.1);
  border: 1.5px solid rgba(25, 240, 255, 0.45);
  color: var(--neon-cyan);
  font-size: 26px;
  line-height: 1;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  border-radius: 10px;
  box-sizing: border-box;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
}

.options-close-x:hover {
  transform: translateY(-1px);
  background: rgba(25, 240, 255, 0.22);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(25, 240, 255, 0.5);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
}

.options-list::-webkit-scrollbar {
  width: 5px;
}

.options-list::-webkit-scrollbar-thumb {
  background: rgba(25, 240, 255, 0.4);
  border-radius: 4px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 8, 36, 0.72);
  border: 1.5px solid rgba(25, 240, 255, 0.28);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  contain: layout style paint;
}

.option-row:hover {
  border-color: rgba(25, 240, 255, 0.55);
  background: rgba(25, 240, 255, 0.08);
  box-shadow: 0 0 14px rgba(25, 240, 255, 0.15);
}

.option-icon-box,
.haptics-icon-box,
.sfx-icon-box,
.music-icon-box,
.crt-icon-box,
.wheel-icon-box,
.fullscreen-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(25, 240, 255, 0.14);
  border: 1px solid rgba(25, 240, 255, 0.38);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(25, 240, 255, 0.2);
}

.option-svg {
  width: 20px;
  height: 20px;
}

.option-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.option-label {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.45);
}

.option-desc {
  font-size: 11px;
  font-weight: 500;
  color: rgba(220, 238, 255, 0.72);
  line-height: 1.25;
}

/* Custom Cyberpunk Sliding Toggle (Neon Blue) */
.synth-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.synth-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(14, 8, 32, 0.9);
  border: 1.5px solid rgba(25, 240, 255, 0.32);
  border-radius: 28px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3.5px;
  background: rgba(25, 240, 255, 0.4);
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.synth-toggle input:checked + .toggle-slider {
  background: rgba(25, 240, 255, 0.22);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(25, 240, 255, 0.45);
}

.synth-toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan), 0 0 4px #A4F9FF;
}

/* Graphics Quality 3-Pill Selector (100% Unified Neon Blue Palette) */
.option-row-quality {
  cursor: default;
}

.opt-quality-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 4, 24, 0.9);
  border: 1px solid rgba(25, 240, 255, 0.32);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.opt-quality-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(25, 240, 255, 0.58);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 8px;
  min-width: 40px;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  touch-action: manipulation;
}

.opt-quality-btn:hover {
  color: var(--neon-cyan);
  background: rgba(25, 240, 255, 0.1);
}

.opt-quality-btn.active {
  background: rgba(25, 240, 255, 0.24);
  border-color: var(--neon-cyan);
  color: #ffffff;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.85);
  box-shadow: 0 0 10px rgba(25, 240, 255, 0.35);
}

/* Live Performance & Polygon Profiler Overlay */
.perf-overlay {
  position: fixed;
  top: calc(var(--safe-top, 0px) + max(var(--banner-height, 0px), 52px) + 64px);
  left: max(10px, var(--safe-left, 0px));
  z-index: 65;
  pointer-events: none;
  background: rgba(8, 4, 20, 0.90);
  border: 1px solid rgba(25, 240, 255, 0.48);
  border-radius: 8px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.25;
  color: #dcfeff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  font-variant-numeric: tabular-nums;
  contain: layout style paint;
}

.perf-overlay.hidden {
  display: none !important;
}

.perf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.perf-header-row {
  border-bottom: 1px solid rgba(25, 240, 255, 0.22);
  padding-bottom: 2px;
  margin-bottom: 1px;
}

.perf-fps {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--neon-cyan);
}

.perf-stat {
  color: rgba(220, 245, 255, 0.9);
  font-weight: 600;
}

.perf-badge {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(25, 240, 255, 0.16);
  border: 1px solid rgba(25, 240, 255, 0.45);
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

/* Disable expensive GPU backdrop-filter blur on overlays in Low quality */
body.quality-low * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.options-footer {
  margin-top: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Username Modal & Leaderboard Modal ---------- */
#username-modal {
  z-index: 58;
}

#leaderboard-modal {
  z-index: 56;
}

.username-card {
  width: min(94vw, 400px);
}

.username-modal-desc {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(220, 238, 255, 0.8);
  margin-bottom: 14px;
  line-height: 1.4;
}

.username-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.username-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(12, 5, 28, 0.94);
  border: 1.5px solid rgba(25, 240, 255, 0.6);
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.username-input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.35);
}

.username-random-btn {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.18), rgba(16, 6, 36, 0.92));
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  color: var(--neon-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.username-random-btn:hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.username-random-btn:active {
  transform: translateY(1px) scale(0.96);
}

.leaderboard-card {
  width: min(94vw, 440px);
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
}

.leaderboard-tab {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  background: rgba(16, 8, 36, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.4);
  color: rgba(25, 240, 255, 0.75);
  transition: transform 0.14s ease, border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
  box-sizing: border-box;
  contain: layout style paint;
}

.leaderboard-tab:hover {
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.leaderboard-tab.active {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.34), rgba(140, 16, 96, 0.88));
  border-color: var(--neon-pink);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.85);
  box-shadow: 0 0 16px rgba(255, 46, 154, 0.32), inset 0 0 10px rgba(255, 46, 154, 0.18);
}

.leaderboard-status {
  width: 100%;
  padding: 28px 12px;
  text-align: center;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.5);
  box-sizing: border-box;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 8, 36, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.32);
  border-radius: 11px;
  font-family: var(--ui-font);
  box-sizing: border-box;
  contain: layout style paint;
}

.leaderboard-row.is-self {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.24), rgba(24, 8, 46, 0.92));
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.28);
}

.lb-rank {
  min-width: 34px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

.leaderboard-row.is-self .lb-rank {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.7);
}

.lb-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-row.is-self .lb-score {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.8);
}

.leaderboard-self-divider {
  text-align: center;
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(25, 240, 255, 0.55);
  line-height: 1;
  padding: 2px 0;
  user-select: none;
}

/* ---------- Skill Points Modal & Unlock Toast ---------- */
#skillpoints-modal {
  z-index: 57;
}

.skillpoints-card {
  width: min(95vw, 480px);
  max-height: min(88vh, 660px);
  overflow: hidden;
}

.skillpoints-header-titles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  margin-right: 10px;
}

.skillpoints-progress-badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 46, 154, 0.2);
  border: 1px solid rgba(255, 46, 154, 0.65);
  color: var(--neon-pink);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.6);
  white-space: nowrap;
}

.skillpoints-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
}

.skillpoints-list::-webkit-scrollbar {
  width: 5px;
}

.skillpoints-list::-webkit-scrollbar-thumb {
  background: rgba(25, 240, 255, 0.4);
  border-radius: 4px;
}

.skillpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(14, 7, 32, 0.90);
  border: 1.5px solid rgba(25, 240, 255, 0.26);
  border-radius: 12px;
  box-sizing: border-box;
  contain: layout style paint;
}

.skillpoint-row.unlocked {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.22), rgba(20, 8, 42, 0.94));
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.24);
}

.sp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.sp-title {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.45);
  line-height: 1.2;
}

.skillpoint-row.unlocked .sp-title {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.75);
}

.skillpoint-row.hidden-locked .sp-title {
  color: rgba(25, 240, 255, 0.55);
  letter-spacing: 2px;
}

.sp-desc {
  font-size: 11px;
  font-weight: 500;
  color: rgba(220, 238, 255, 0.76);
  line-height: 1.3;
}

.skillpoint-row.hidden-locked .sp-desc {
  color: rgba(180, 210, 240, 0.48);
  font-style: italic;
}

.sp-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  min-width: 54px;
  padding-left: 6px;
  border-left: 1px solid rgba(25, 240, 255, 0.18);
}

.sp-pct {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--neon-cyan);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.skillpoint-row.unlocked .sp-pct {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.65);
}

.sp-pct-label {
  font-family: var(--ui-font);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(25, 240, 255, 0.6);
}

.skillpoint-toast {
  position: fixed;
  top: calc(var(--safe-top, 0px) + max(var(--banner-height, 0px), 16px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(28, 8, 48, 0.96), rgba(12, 4, 26, 0.96));
  border: 1.5px solid var(--neon-pink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 20px rgba(255, 46, 154, 0.45);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  contain: layout style paint;
}

.skillpoint-toast.hidden {
  display: none !important;
}

.sp-toast-tag {
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.75);
}

.sp-toast-name {
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 46, 154, 0.9);
  white-space: nowrap;
}

.options-btn-done {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.22), rgba(14, 30, 64, 0.85));
  border: 1.5px solid rgba(25, 240, 255, 0.75);
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2.5px;
  cursor: pointer;
  touch-action: manipulation;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.65);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(25, 240, 255, 0.25),
    inset 0 0 12px rgba(25, 240, 255, 0.12);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  outline: none;
  box-sizing: border-box;
  contain: layout style paint;
}

.options-btn-done:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.34), rgba(20, 46, 92, 0.92));
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(25, 240, 255, 0.5),
    inset 0 0 16px rgba(25, 240, 255, 0.22);
}

.options-btn-done:active {
  transform: translateY(1px) scale(0.98);
}

/* ---------- Power-Up Shop Overlay ---------- */
#shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--ui-font);
  color: #ffffff;
  overflow: hidden;
  contain: layout style;
}

/* Global SVG Volt Icon (Allowed Yellow/Gold for Volts) */
.volt-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  color: var(--neon-gold);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.hud-volts-val {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.hud-volts-val .volt-icon {
  width: clamp(14px, 3.2vw, 20px);
  height: clamp(14px, 3.2vw, 20px);
}

/* Shop Header (Top bar — equalized with in-game HUD: 10px radius & 1.5px outline) */
.shop-header {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: transparent;
  gap: 12px;
  z-index: 46;
  contain: layout style;
}

.shop-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(16, 6, 36, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  border-radius: 10px;
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  min-height: 40px;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.75);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 12px rgba(25, 240, 255, 0.15);
  contain: layout style paint;
}

.shop-nav-btn:hover {
  background: rgba(25, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 18px rgba(25, 240, 255, 0.45);
}

.shop-nav-btn:active {
  transform: translateY(1px);
}

/* Wallet Card — Displays Volts, so uses Gold border/glow matching #hud-volts-item */
.shop-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 6, 36, 0.88);
  border: 1.5px solid rgba(255, 201, 74, 0.55);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 201, 74, 0.16);
  min-height: 40px;
  contain: layout style paint;
}

.shop-wallet-val {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-wallet-val .hud-value {
  font-size: clamp(16px, 3.8vw, 22px);
  line-height: 1;
}

.shop-wallet-val .volt-icon {
  width: 16px;
  height: 16px;
}

/* ---------- Garage Hub Category Menu ---------- */
.garage-hub {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  padding: 0 16px max(24px, calc(var(--safe-bottom) + 16px));
  box-sizing: border-box;
  animation: garage-hub-fade-in 0.25s ease-out;
  contain: layout style;
}

@keyframes garage-hub-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.garage-hub.hidden {
  display: none !important;
}

.garage-hub-content {
  pointer-events: auto;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.garage-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.garage-category-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  min-height: 64px;
  border-radius: 14px;
  background: rgba(16, 6, 36, 0.90);
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), 0 0 14px rgba(25, 240, 255, 0.18);
  color: #ffffff;
  font-family: var(--ui-font);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  outline: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
  text-align: left;
  contain: layout style paint;
}

.garage-category-banner.active {
  border-color: rgba(25, 240, 255, 0.65);
  box-shadow:
    0 0 16px rgba(25, 240, 255, 0.25),
    0 6px 20px rgba(0, 0, 0, 0.65);
}

@media (hover: hover) {
  .garage-category-banner.active:hover {
    border-color: var(--neon-pink);
    background: rgba(40, 12, 68, 0.94);
    box-shadow:
      0 0 24px rgba(255, 46, 154, 0.45),
      0 8px 24px rgba(0, 0, 0, 0.75);
    transform: translateY(-2px);
  }
  .garage-category-banner.active:hover .category-banner-icon {
    background: rgba(255, 46, 154, 0.2);
    border-color: rgba(255, 46, 154, 0.55);
    color: var(--neon-pink);
    box-shadow: 0 0 12px rgba(255, 46, 154, 0.45);
  }
  .garage-category-banner.active:hover .category-banner-arrow {
    color: var(--neon-pink);
    transform: translateX(3px);
  }
}

.garage-category-banner.active:active {
  transform: translateY(1px) scale(0.98);
  border-color: var(--neon-pink);
}

.category-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.garage-category-banner.active .category-banner-icon {
  background: rgba(25, 240, 255, 0.15);
  border: 1px solid rgba(25, 240, 255, 0.4);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(25, 240, 255, 0.28);
}

.cat-icon-svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.category-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.category-banner-title {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.45);
}

.category-banner-desc {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(220, 238, 255, 0.72);
}

.category-banner-arrow {
  color: var(--neon-cyan);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.cat-arrow-svg {
  width: 20px;
  height: 20px;
}

/* Locked Categories */
.garage-category-banner.locked {
  background: rgba(14, 5, 28, 0.80);
  border-color: rgba(25, 240, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  cursor: default;
  opacity: 0.85;
}

.garage-category-banner.locked .category-banner-icon {
  background: rgba(25, 240, 255, 0.06);
  color: rgba(25, 240, 255, 0.35);
}

.garage-category-banner.locked .category-banner-title {
  color: rgba(25, 240, 255, 0.55);
}

.garage-category-banner.locked .category-banner-desc {
  color: rgba(220, 238, 255, 0.4);
}

.category-banner-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--neon-cyan);
  background: rgba(25, 240, 255, 0.12);
  border: 1px solid rgba(25, 240, 255, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Navigation Arrows (Anchored right above Bottom UI Card) */
.shop-side-arrow-btn {
  position: absolute;
  bottom: calc(100% + 14px);
  z-index: 50;
  pointer-events: auto;
  width: clamp(46px, 11vw, 52px);
  height: clamp(46px, 11vw, 52px);
  border-radius: 14px;
  background: rgba(16, 6, 36, 0.90);
  border: 1.5px solid rgba(25, 240, 255, 0.65);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  box-shadow:
    0 0 16px rgba(25, 240, 255, 0.35),
    0 6px 18px rgba(0, 0, 0, 0.65);
  touch-action: manipulation;
  user-select: none;
  outline: none;
  contain: layout style paint;
}

.shop-arrow-svg {
  width: clamp(22px, 5vw, 25px);
  height: clamp(22px, 5vw, 25px);
  display: block;
  pointer-events: none;
  transition: transform 0.16s ease;
}

.shop-arrow-left {
  left: 14px;
}

.shop-arrow-right {
  right: 14px;
}

@media (hover: hover) {
  .shop-side-arrow-btn:hover {
    border-color: var(--neon-pink);
    color: #ffffff;
    background: rgba(45, 14, 75, 0.94);
    box-shadow:
      0 0 24px rgba(255, 46, 154, 0.65),
      0 8px 24px rgba(0, 0, 0, 0.75);
    transform: translateY(-2px);
  }
  .shop-arrow-left:hover .shop-arrow-svg {
    transform: translateX(-2px);
  }
  .shop-arrow-right:hover .shop-arrow-svg {
    transform: translateX(2px);
  }
}

.shop-side-arrow-btn:active {
  border-color: var(--neon-pink);
  background: rgba(45, 14, 75, 0.96);
  box-shadow:
    0 0 24px rgba(255, 46, 154, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.75);
  transform: scale(0.95);
}

/* Garage Top-Up Ad Button (Anchored between Left & Right Arrows above Bottom Sheet, Volts Gold) */
.shop-topup-ad-btn {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: auto;
  height: clamp(46px, 11vw, 52px);
  max-width: calc(100% - 144px);
  padding: 0 clamp(12px, 3.2vw, 18px);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 201, 74, 0.26), rgba(32, 18, 6, 0.94));
  border: 1.5px solid var(--neon-gold);
  color: var(--neon-gold);
  font-family: var(--ui-font);
  font-size: clamp(11px, 3.1vw, 14px);
  font-weight: 800;
  letter-spacing: 1.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(255, 201, 74, 0.7);
  box-shadow:
    0 0 18px rgba(255, 201, 74, 0.38),
    0 6px 18px rgba(0, 0, 0, 0.65),
    inset 0 0 10px rgba(255, 201, 74, 0.15);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  touch-action: manipulation;
  user-select: none;
  outline: none;
  box-sizing: border-box;
  contain: layout style paint;
}

@media (hover: hover) {
  .shop-topup-ad-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 201, 74, 0.42), rgba(48, 28, 8, 0.96));
    border-color: #FFF275;
    color: #ffffff;
    box-shadow:
      0 0 26px rgba(255, 201, 74, 0.7),
      0 8px 22px rgba(0, 0, 0, 0.75);
  }
}

.shop-topup-ad-btn:active {
  transform: translateX(-50%) translateY(1px) scale(0.97);
}

.shop-topup-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(12, 4, 26, 0.65);
  border: 1px solid rgba(255, 201, 74, 0.48);
  border-radius: 8px;
  color: var(--neon-gold);
  font-variant-numeric: tabular-nums;
}

.shop-topup-reward .volt-icon {
  width: 14px;
  height: 14px;
}

/* Mobile-First Bottom Sheet (Clean, Spacious, Uncluttered) */
.shop-sheet {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(24, 10, 48, 0.96) 0%, rgba(12, 4, 26, 0.99) 100%);
  border-top: 1.5px solid rgba(25, 240, 255, 0.65);
  border-radius: 24px 24px 0 0;
  padding: 20px 22px calc(var(--safe-bottom) + 20px) 22px;
  box-shadow:
    0 -14px 40px rgba(0, 0, 0, 0.8),
    0 -2px 20px rgba(25, 240, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  contain: layout style;
}

.shop-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-detail-names {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-item-name {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  line-height: 1.15;
  text-shadow: 0 0 14px rgba(25, 240, 255, 0.65);
}

.shop-item-desc {
  font-size: clamp(11px, 2.7vw, 13px);
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(220, 238, 255, 0.75);
  line-height: 1.25;
}

.shop-detail-badge {
  padding: 4px 10px;
  min-width: 22px;
  text-align: center;
  background: rgba(25, 240, 255, 0.16);
  border: 1.5px solid var(--neon-cyan);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(25, 240, 255, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Level Meter (10 Pips — Unified in Neon Blue) */
.shop-meter-container {
  display: flex;
  flex-direction: column;
  margin: 2px 0;
}

.shop-pips {
  display: flex;
  gap: 6px;
  height: 12px;
}

.shop-pip {
  flex: 1;
  background: rgba(25, 240, 255, 0.12);
  border: 1px solid rgba(25, 240, 255, 0.22);
  border-radius: 3px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.shop-pip.filled,
.shop-pip.filled.nitro,
.shop-pip.filled.shield,
.shop-pip.filled.emp,
.shop-pip.filled.magnet {
  background: var(--neon-cyan);
  border-color: #a4f9ff;
  box-shadow: 0 0 8px rgba(25, 240, 255, 0.85);
}

/* Vehicle Performance Stats (Progress Bars + Right-Side Values, Unified Neon Blue) */
.shop-car-stats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 2px 0;
  contain: layout style paint;
}

.car-stat-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
}

.car-stat-label {
  font-family: var(--ui-font);
  font-size: clamp(10px, 2.5vw, 11px);
  font-weight: 800;
  letter-spacing: 0.9px;
  color: rgba(220, 242, 255, 0.88);
  white-space: nowrap;
}

.car-stat-track {
  height: 8px;
  background: rgba(10, 4, 24, 0.92);
  border: 1px solid rgba(25, 240, 255, 0.28);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.car-stat-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(25, 240, 255, 0.45), var(--neon-cyan));
  box-shadow: 0 0 8px rgba(25, 240, 255, 0.75);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.car-stat-val {
  font-family: var(--ui-font);
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.55);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 400px) {
  .car-stat-row {
    grid-template-columns: 88px minmax(0, 1fr) 68px;
    gap: 8px;
  }
}

/* Action Buttons */
.shop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.shop-upgrade-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.34), rgba(140, 16, 96, 0.72));
  border: 1.5px solid var(--neon-pink);
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.85);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(255, 46, 154, 0.35),
    inset 0 0 14px rgba(255, 46, 154, 0.2);
  transition: transform 0.16s ease, border-color 0.16s ease;
  touch-action: manipulation;
  box-sizing: border-box;
  contain: layout style paint;
}

.shop-upgrade-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.48), rgba(170, 20, 115, 0.82));
  border-color: #ff6ec4;
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.7),
    0 0 26px rgba(255, 46, 154, 0.6),
    inset 0 0 18px rgba(255, 46, 154, 0.3);
}

.shop-upgrade-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.shop-upgrade-btn:disabled {
  background: rgba(20, 10, 38, 0.65);
  border-color: rgba(25, 240, 255, 0.22);
  color: rgba(220, 238, 255, 0.45);
  text-shadow: none;
  box-shadow: none;
  cursor: not-allowed;
}

.shop-upgrade-btn.maxed {
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.22), rgba(14, 30, 64, 0.82));
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.7);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(25, 240, 255, 0.35),
    inset 0 0 12px rgba(25, 240, 255, 0.14);
  cursor: default;
}

/* Cost tag displays Volts — allowed to be Yellow/Gold */
.upgrade-cost-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(12, 4, 26, 0.65);
  border: 1px solid rgba(255, 201, 74, 0.45);
  border-radius: 8px;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 800;
  color: var(--neon-gold);
  text-shadow: 0 0 8px rgba(255, 201, 74, 0.65);
  flex-shrink: 0;
}

.upgrade-cost-tag .volt-icon {
  width: 14px;
  height: 14px;
}

.shop-tool-btn {
  padding: 10px 16px;
  min-height: 52px;
  background: rgba(16, 6, 36, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.55);
  border-radius: 12px;
  color: var(--neon-cyan);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  touch-action: manipulation;
  white-space: nowrap;
  contain: layout style paint;
}

.shop-tool-btn:hover {
  background: rgba(25, 240, 255, 0.2);
  border-color: var(--neon-cyan);
}

/* Mobile Optimizations */
@media (max-width: 480px) {
  .shop-sheet {
    padding: 16px 16px calc(var(--safe-bottom) + 16px) 16px;
    gap: 12px;
  }
  .shop-details {
    gap: 10px;
  }
}

/* ==========================================================================
   Special Powers HUD Action Button (Middle between Steering Wheel & Screen Left)
   ========================================================================== */

#hud-special-power {
  position: fixed;
  left: max(calc(var(--safe-left, 0px) + 52px), calc(var(--safe-left, 0px) * 0.5 + 25% - clamp(30px, 8.5vw, 47.5px)));
  bottom: max(34px, calc(var(--safe-bottom) + 34px));
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

#hud-special-power.hidden {
  display: none !important;
}

.special-power-group {
  display: contents;
}

@media (min-width: 901px) and (orientation: landscape) and (max-height: 500px) {
  #hud-special-power {
    bottom: max(18px, calc(var(--safe-bottom) + 18px));
    left: max(calc(var(--safe-left, 0px) + 52px), calc(var(--safe-left, 0px) * 0.5 + 25% - clamp(25px, 5.5vh, 37.5px)));
    gap: 8px;
  }
}

.phase-shift-btn {
  position: relative;
  width: 72px;
  height: 48px;
  background: rgba(20, 6, 40, 0.88);
  border: 1.5px solid rgba(25, 240, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  outline: none;
  box-sizing: border-box;
  contain: layout style;
}

.phase-shift-btn:hover:not(.empty) {
  transform: translateY(-2px);
  border-color: #19F0FF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(25, 240, 255, 0.45);
}

.phase-shift-btn:active:not(.empty) {
  transform: translateY(1px) scale(0.97);
}

/* Empty state (0 charges) */
.phase-shift-btn.empty {
  opacity: 0.42;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}

/* Available state (has charges ready to trigger) */
.phase-shift-btn.available {
  opacity: 1.0;
  border-color: #19F0FF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(25, 240, 255, 0.4);
}

/* Active state (currently phased into quantum realm) */
.phase-shift-btn.active {
  opacity: 1.0;
  border-color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 255, 231, 0.8);
  animation: phase-shift-pulse 1s ease-in-out infinite alternate;
}

.phase-shift-car-svg {
  width: 52px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.phase-shift-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--neon-cyan);
  color: #060312;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  contain: layout style paint;
}

.phase-shift-btn.empty .phase-shift-badge {
  background: #3B384A;
  color: #8C88A0;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.phase-shift-key-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(25, 240, 255, 0.6);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}

@media (pointer: coarse) {
  .phase-shift-key-hint {
    display: none;
  }
}

@keyframes phase-shift-pulse {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Apache Helicopter Special Power HUD Button
   ========================================================================== */

.apache-btn {
  position: relative;
  width: 72px;
  height: 48px;
  background: rgba(28, 14, 16, 0.88);
  border: 1.5px solid rgba(255, 136, 0, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  outline: none;
  box-sizing: border-box;
  contain: layout style;
}

.apache-btn:hover:not(.empty) {
  transform: translateY(-2px);
  border-color: #FF8800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 136, 0, 0.5);
}

.apache-btn:active:not(.empty) {
  transform: translateY(1px) scale(0.97);
}

/* Empty state (0 charges) */
.apache-btn.empty {
  opacity: 0.42;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}

/* Available state (has charges ready to trigger) */
.apache-btn.available {
  opacity: 1.0;
  border-color: #FF8800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 136, 0, 0.4);
}

/* Active state (currently in gunship strike dash) */
.apache-btn.active {
  opacity: 1.0;
  border-color: #FF3344;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 51, 68, 0.85);
  animation: apache-strike-pulse 0.9s ease-in-out infinite alternate;
}

.apache-heli-svg {
  width: 52px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.apache-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #FF8800;
  color: #060312;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  contain: layout style paint;
}

.apache-btn.empty .apache-badge {
  background: #3B384A;
  color: #8C88A0;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.apache-key-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 136, 0, 0.75);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}

@media (pointer: coarse) {
  .apache-key-hint {
    display: none;
  }
}

@keyframes apache-strike-pulse {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Hover Flight Special Power HUD Button (Sky Blue Theme)
   ========================================================================== */

.hover-btn {
  position: relative;
  width: 72px;
  height: 48px;
  background: rgba(10, 24, 42, 0.88);
  border: 1.5px solid rgba(0, 162, 255, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  outline: none;
  box-sizing: border-box;
  contain: layout style;
}

.hover-btn:hover:not(.empty) {
  transform: translateY(-2px);
  border-color: #00A2FF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 162, 255, 0.5);
}

.hover-btn:active:not(.empty) {
  transform: translateY(1px) scale(0.97);
}

.hover-btn.empty {
  opacity: 0.42;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}

.hover-btn.available {
  opacity: 1.0;
  border-color: #00A2FF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 162, 255, 0.4);
}

.hover-btn.active {
  opacity: 1.0;
  border-color: #00FFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 255, 255, 0.85);
  animation: hover-pulse 0.9s ease-in-out infinite alternate;
}

.hover-car-svg {
  width: 52px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.hover-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #00A2FF;
  color: #060312;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  contain: layout style paint;
}

.hover-btn.empty .hover-badge {
  background: #3B384A;
  color: #8C88A0;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.hover-key-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(0, 162, 255, 0.75);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}

@media (pointer: coarse) {
  .hover-key-hint {
    display: none;
  }
}

@keyframes hover-pulse {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Cryo Frost Blast Special Power HUD Button (Sub-Zero Frost Cyan Theme)
   ========================================================================== */

.cryo-btn {
  position: relative;
  width: 72px;
  height: 48px;
  background: rgba(14, 28, 40, 0.88);
  border: 1.5px solid rgba(128, 216, 255, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  outline: none;
  box-sizing: border-box;
  contain: layout style;
}

.cryo-btn:hover:not(.empty) {
  transform: translateY(-2px);
  border-color: #80D8FF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(128, 216, 255, 0.5);
}

.cryo-btn:active:not(.empty) {
  transform: translateY(1px) scale(0.97);
}

.cryo-btn.empty {
  opacity: 0.42;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}

.cryo-btn.available {
  opacity: 1.0;
  border-color: #80D8FF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(128, 216, 255, 0.4);
}

.cryo-btn.active {
  opacity: 1.0;
  border-color: #E0F7FA;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(224, 247, 250, 0.85);
  animation: cryo-pulse 0.8s ease-in-out infinite alternate;
}

.cryo-blast-svg {
  width: 52px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.cryo-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #80D8FF;
  color: #060312;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  contain: layout style paint;
}

.cryo-btn.empty .cryo-badge {
  background: #3B384A;
  color: #8C88A0;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.cryo-key-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(128, 216, 255, 0.75);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}

@media (pointer: coarse) {
  .cryo-key-hint {
    display: none;
  }
}

@keyframes cryo-pulse {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Hyperspace Blink Special Power HUD Button (Quantum Magenta Theme)
   ========================================================================== */

.blink-btn {
  position: relative;
  width: 72px;
  height: 48px;
  background: rgba(30, 8, 36, 0.88);
  border: 1.5px solid rgba(255, 0, 170, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  outline: none;
  box-sizing: border-box;
  contain: layout style;
}

.blink-btn:hover:not(.empty) {
  transform: translateY(-2px);
  border-color: #FF00AA;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 0, 170, 0.5);
}

.blink-btn:active:not(.empty) {
  transform: translateY(1px) scale(0.97);
}

.blink-btn.empty {
  opacity: 0.42;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}

.blink-btn.available {
  opacity: 1.0;
  border-color: #FF00AA;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 0, 170, 0.4);
}

.blink-btn.active {
  opacity: 1.0;
  border-color: #FF66CC;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 0, 170, 0.85);
  animation: blink-pulse 0.6s ease-in-out infinite alternate;
}

.blink-svg {
  width: 52px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.blink-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #FF00AA;
  color: #FFFFFF;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  contain: layout style paint;
}

.blink-btn.empty .blink-badge {
  background: #3B384A;
  color: #8C88A0;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.blink-key-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 0, 170, 0.75);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}

@media (pointer: coarse) {
  .blink-key-hint {
    display: none;
  }
}

@keyframes blink-pulse {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.05);
  }
}

/* ==========================================================================
   Special Powers HUD Action Buttons - Mobile Split View Layout
   2 buttons (left side) - Steering Wheel (center) - 3 buttons (right side)
   ========================================================================== */

@media (max-width: 900px), (pointer: coarse) {
  #hud-special-power {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(18px + var(--safe-bottom));
    width: 100%;
    transform: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 max(8px, var(--safe-left, 0px)) 0 max(8px, var(--safe-right, 0px));
    pointer-events: none;
    z-index: 30;
    gap: 0;
    box-sizing: border-box;
  }

  .special-power-group {
    display: flex;
    pointer-events: auto;
    z-index: 31;
  }

  /* Portrait / narrow mobile: vertical columns beside steering wheel */
  .special-power-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-left: 2px;
  }

  .special-power-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding-right: 2px;
  }

  /* Mobile button sizing - compact and ergonomic */
  .phase-shift-btn,
  .apache-btn,
  .hover-btn,
  .cryo-btn,
  .blink-btn {
    width: 66px;
    height: 42px;
  }

  .phase-shift-car-svg,
  .apache-heli-svg,
  .hover-car-svg,
  .cryo-blast-svg,
  .blink-svg {
    width: 48px;
    height: 26px;
  }

  .phase-shift-badge,
  .apache-badge,
  .hover-badge,
  .cryo-badge,
  .blink-badge {
    min-width: 18px;
    height: 16px;
    font-size: 9px;
    top: -4px;
    right: -4px;
    padding: 0 4px;
  }

  .phase-shift-key-hint,
  .apache-key-hint,
  .hover-key-hint,
  .cryo-key-hint,
  .blink-key-hint {
    display: none !important;
  }
}

/* Mobile Landscape: 2 buttons on left in a row, 3 buttons on right in a row */
@media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
  #hud-special-power {
    bottom: calc(10px + var(--safe-bottom));
    padding: 0 max(16px, var(--safe-left, 0px)) 0 max(16px, var(--safe-right, 0px));
  }

  .special-power-left,
  .special-power-right {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
  }
}

/* Extra small portrait phones (<= 360px wide) */
@media (max-width: 360px) and (orientation: portrait) {
  .phase-shift-btn,
  .apache-btn,
  .hover-btn,
  .cryo-btn,
  .blink-btn {
    width: 58px;
    height: 38px;
  }

  .phase-shift-car-svg,
  .apache-heli-svg,
  .hover-car-svg,
  .cryo-blast-svg,
  .blink-svg {
    width: 42px;
    height: 23px;
  }
}

/* ==========================================================================
   High Score Celebration Interstitial Overlay (Subway Surfers-inspired)
   Strictly Neon Blue (#19F0FF) & Neon Pink (#FF2E9A) per UI Design System
   ========================================================================== */
.highscore-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-top) + max(var(--banner-height, 0px), 58px) + 18px) 20px calc(var(--safe-bottom) + 28px);
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  contain: layout style paint;
}

.highscore-overlay.hidden {
  display: none !important;
}

.hs-radial-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(25, 240, 255, 0.0) 42%, rgba(8, 3, 22, 0.38) 82%, rgba(5, 2, 14, 0.72) 100%),
    linear-gradient(180deg, rgba(8, 3, 22, 0.68) 0%, rgba(8, 3, 22, 0.0) 24%, rgba(8, 3, 22, 0.0) 70%, rgba(8, 3, 22, 0.78) 100%);
  pointer-events: none;
  z-index: 0;
}

.hs-top-banner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: hs-banner-slam 0.55s cubic-bezier(0.18, 1.35, 0.4, 1) both;
}

.hs-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  transform: skewX(-8deg) rotate(-2deg);
  animation: hs-title-pulse 0.9s ease-in-out infinite alternate;
}

.hs-title-top {
  font-family: var(--display-font);
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 900;
  letter-spacing: 6px;
  color: #19F0FF;
  text-shadow:
    0 0 12px rgba(25, 240, 255, 0.95),
    0 0 28px rgba(25, 240, 255, 0.65),
    0 4px 0 #060312;
}

.hs-title-main {
  font-family: var(--display-font);
  font-size: clamp(36px, 8.5vw, 66px);
  font-weight: 900;
  letter-spacing: 3px;
  color: #FFFFFF;
  text-shadow:
    0 0 14px #FF2E9A,
    0 0 32px #FF2E9A,
    0 0 58px rgba(255, 46, 154, 0.85),
    0 5px 0 #060312;
}

.hs-bottom-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, 92vw);
  animation: hs-bottom-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.hs-car-badge {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #19F0FF;
  background: rgba(8, 4, 20, 0.88);
  border: 1px solid rgba(25, 240, 255, 0.55);
  border-radius: 6px;
  padding: 4px 14px;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.7);
  box-shadow: 0 0 14px rgba(25, 240, 255, 0.25);
  contain: layout style paint;
}

.hs-score-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px 14px;
  background: linear-gradient(135deg, rgba(16, 10, 36, 0.92) 0%, rgba(10, 6, 24, 0.95) 100%);
  border: 2px solid #FF2E9A;
  border-radius: 16px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.75),
    0 0 26px rgba(255, 46, 154, 0.55),
    inset 0 0 18px rgba(25, 240, 255, 0.22);
  transform: skewX(-5deg);
  transition: transform 0.2s cubic-bezier(0.18, 1.4, 0.4, 1), border-color 0.2s ease;
  contain: layout style paint;
}

.hs-score-card.locked {
  border-color: #19F0FF;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.8),
    0 0 34px rgba(25, 240, 255, 0.85),
    0 0 60px rgba(255, 46, 154, 0.55),
    inset 0 0 24px rgba(25, 240, 255, 0.35);
  animation: hs-card-lock-pop 0.42s cubic-bezier(0.18, 1.5, 0.4, 1);
}

.hs-score-label {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2px;
}

.hs-score-value {
  font-family: var(--display-font);
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.05;
  color: #FFFFFF;
  text-shadow:
    0 0 14px #19F0FF,
    0 0 28px rgba(25, 240, 255, 0.8),
    0 0 46px rgba(255, 46, 154, 0.65);
  font-variant-numeric: tabular-nums;
}

.hs-skip-hint {
  margin-top: 4px;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: rgba(25, 240, 255, 0.78);
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.5);
  animation: hs-hint-fade 1.1s ease-in-out infinite alternate;
}

@keyframes hs-banner-slam {
  0% {
    opacity: 0;
    transform: translateY(-60px) scale(0.65);
  }
  70% {
    opacity: 1;
    transform: translateY(6px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1.0);
  }
}

@keyframes hs-bottom-rise {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1.0);
  }
}

@keyframes hs-title-pulse {
  0% {
    transform: skewX(-8deg) rotate(-2deg) scale(1.0);
  }
  100% {
    transform: skewX(-8deg) rotate(-1deg) scale(1.05);
  }
}

@keyframes hs-card-lock-pop {
  0% {
    transform: skewX(-5deg) scale(1.0);
  }
  45% {
    transform: skewX(-5deg) scale(1.12);
  }
  100% {
    transform: skewX(-5deg) scale(1.0);
  }
}

@keyframes hs-star-spin {
  0% {
    transform: rotate(0deg) scale(1.0);
  }
  50% {
    transform: rotate(180deg) scale(1.25);
  }
  100% {
    transform: rotate(360deg) scale(1.0);
  }
}

@keyframes hs-hint-fade {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.95;
  }
}

/* Compact landscape adjustments so center 3D car remains completely unobstructed */
@media (max-height: 520px) and (orientation: landscape) {
  .highscore-overlay {
    padding: calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 10px);
  }
  .hs-kicker-pill {
    padding: 3px 12px;
    font-size: 10px;
    margin-bottom: 4px;
  }
  .hs-title-top {
    font-size: 20px;
  }
  .hs-title-main {
    font-size: 32px;
  }
  .hs-bottom-panel {
    gap: 4px;
    width: min(360px, 80vw);
  }
  .hs-score-card {
    padding: 6px 18px 8px;
  }
  .hs-score-value {
    font-size: 28px;
  }
}

/* ============================================================
   Debug / Cheat Engine Modal Styles
   ============================================================ */
#debug-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 3, 22, 0.90);
  pointer-events: auto;
  padding: 14px;
  box-sizing: border-box;
  contain: layout style paint;
}

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

.debug-card {
  width: min(96vw, 560px);
  max-height: min(92vh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 8, 44, 0.98), rgba(10, 3, 22, 0.99));
  border: 1.5px solid rgba(25, 240, 255, 0.7);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.85),
    0 0 32px rgba(25, 240, 255, 0.28),
    inset 0 0 24px rgba(25, 240, 255, 0.08);
  box-sizing: border-box;
  text-align: left;
  contain: layout style;
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(25, 240, 255, 0.25);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.debug-title-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.debug-tag {
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 154, 0.65);
}

.debug-title {
  font-family: var(--ui-font);
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(25, 240, 255, 0.75);
  margin: 0;
}

.debug-scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.debug-scroll-area::-webkit-scrollbar {
  width: 5px;
}
.debug-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(25, 240, 255, 0.4);
  border-radius: 4px;
}

.debug-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(16, 6, 32, 0.65);
  border: 1px solid rgba(25, 240, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  contain: layout style paint;
}

.debug-section-title {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  opacity: 0.95;
  text-transform: uppercase;
}

.debug-subsection-label {
  font-family: var(--ui-font);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: rgba(25, 240, 255, 0.72);
  text-transform: uppercase;
  margin-top: 4px;
}

.debug-warp-row {
  display: flex;
  gap: 6px;
}

.debug-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  background: rgba(6, 2, 14, 0.85);
  border: 1px solid rgba(25, 240, 255, 0.45);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
}

.debug-speed-input {
  flex: 0.75;
}

.debug-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(25, 240, 255, 0.4);
}

.debug-action-btn,
.debug-toggle-btn,
.debug-biome-btn,
.debug-car-btn,
.debug-power-btn {
  font-family: var(--ui-font);
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.debug-action-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.22), rgba(14, 4, 30, 0.92));
  border: 1.5px solid var(--neon-cyan);
  color: #ffffff;
  text-shadow: 0 0 8px rgba(25, 240, 255, 0.6);
  white-space: nowrap;
}

.debug-action-btn:hover {
  background: linear-gradient(135deg, rgba(25, 240, 255, 0.35), rgba(24, 8, 48, 0.95));
  box-shadow: 0 0 16px rgba(25, 240, 255, 0.4);
  transform: translateY(-1px);
}

.debug-action-btn.volts-btn {
  background: linear-gradient(135deg, rgba(255, 201, 74, 0.22), rgba(26, 18, 4, 0.92));
  border-color: #ffc94a;
  color: #ffc94a;
  text-shadow: 0 0 8px rgba(255, 201, 74, 0.6);
}

.debug-action-btn.volts-btn:hover {
  background: linear-gradient(135deg, rgba(255, 201, 74, 0.35), rgba(36, 24, 6, 0.95));
  box-shadow: 0 0 16px rgba(255, 201, 74, 0.45);
}

.debug-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.debug-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.debug-biome-btn,
.debug-car-btn {
  height: 32px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 0.7px;
  background: rgba(25, 240, 255, 0.1);
  border: 1px solid rgba(25, 240, 255, 0.4);
  color: var(--neon-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-biome-btn:hover,
.debug-car-btn:hover {
  background: rgba(25, 240, 255, 0.25);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.debug-car-btn.btn-active {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.24), rgba(26, 8, 40, 0.95));
  border: 1.5px solid var(--neon-pink);
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.7);
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.32);
}

.debug-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}

.debug-toggle-btn {
  height: 34px;
  padding: 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.9px;
  background: rgba(25, 240, 255, 0.1);
  border: 1.5px solid rgba(25, 240, 255, 0.5);
  color: var(--neon-cyan);
}

.debug-toggle-btn.btn-active {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.24), rgba(26, 8, 40, 0.95));
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.7);
  box-shadow: 0 0 16px rgba(255, 46, 154, 0.35);
}

.debug-powers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.debug-power-btn {
  height: 34px;
  padding: 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.9px;
  background: rgba(25, 240, 255, 0.1);
  border: 1.5px solid rgba(25, 240, 255, 0.45);
  color: var(--neon-cyan);
}

.debug-power-btn:hover {
  background: rgba(25, 240, 255, 0.25);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.debug-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Clean HUD Mode for Trailer Video Recording:
   Hides all HUD overlays, steering wheel, and popups visually while keeping
   touch steering and the top-right invisible pause button interactive! */
body.trailer-clean-hud #hud .hud-top-center,
body.trailer-clean-hud #hud #hud-powerups,
body.trailer-clean-hud #hud-special-power,
body.trailer-clean-hud #milestone,
body.trailer-clean-hud #close-call,
body.trailer-clean-hud #steer-tutorial,
body.trailer-clean-hud #debug-toast {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.trailer-clean-hud #hud-pause-btn,
body.trailer-clean-hud #wheel-wrap {
  opacity: 0 !important;
}

.debug-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: rgba(18, 6, 36, 0.96);
  border: 1.5px solid var(--neon-pink);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px rgba(255, 46, 154, 0.8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 46, 154, 0.4);
  pointer-events: none;
  transition: opacity 0.3s ease;
  contain: layout style paint;
}

.title-debug-btn {
  background: rgba(255, 46, 154, 0.15) !important;
  border-color: rgba(255, 46, 154, 0.65) !important;
  color: var(--neon-pink) !important;
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.25) !important;
}

.title-debug-btn:hover {
  background: rgba(255, 46, 154, 0.3) !important;
  border-color: var(--neon-pink) !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(255, 46, 154, 0.5) !important;
}

.pause-btn-debug {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.18), rgba(26, 8, 40, 0.90)) !important;
  border-color: rgba(255, 46, 154, 0.75) !important;
  color: var(--neon-pink) !important;
}

.pause-btn-debug:hover {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.32), rgba(36, 10, 56, 0.95)) !important;
  border-color: var(--neon-pink) !important;
  color: #ffffff !important;
}

