/* SEGA RALLY 2026 — Self-Contained Arcade Motorsport UI (Zero External Fonts/CDNs) */

:root {
  --bg-deep: #090e1a;
  --bg-panel: rgba(11, 18, 33, 0.84);
  --bg-card: rgba(18, 28, 48, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.24);
  --border-bright: rgba(56, 189, 248, 0.55);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --sega-blue: #1d64f2;
  --sega-blue-hi: #3b82f6;
  --rally-red: #e11d48;
  --rally-gold: #facc15;
  --rally-green: #22c55e;
  --rally-cyan: #22d3ee;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

/* Top Command Bar */
.top-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
  flex-shrink: 0;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #ffffff;
}

.brand-year {
  color: var(--rally-gold);
}

.mode-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(29, 100, 242, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button,
select {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.36rem 0.65rem;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

button:hover,
select:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(148, 163, 184, 0.55);
}

button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--rally-gold);
  outline-offset: 2px;
}

button:active {
  transform: scale(0.97);
}

button.primary {
  background: linear-gradient(135deg, var(--sega-blue) 0%, #1e40af 100%);
  border-color: rgba(96, 165, 250, 0.7);
  color: #ffffff;
}

button.primary:hover {
  background: linear-gradient(135deg, var(--sega-blue-hi) 0%, var(--sega-blue) 100%);
}

button[aria-pressed="true"] {
  border-color: rgba(34, 211, 238, 0.65);
  color: #e0f2fe;
}

button[aria-pressed="false"] {
  opacity: 0.7;
}

button.large-cta {
  padding: 0.68rem 1.35rem;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-style: italic;
}

button.subtle-btn {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

button.danger-btn {
  background: rgba(153, 27, 27, 0.55);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

/* Main Racing Viewport */
.viewport-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #020617;
  overflow: hidden;
}

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

/* Floating Arcade HUD */
.arcade-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  z-index: 5;
}

.hud-top-row,
.hud-bottom-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hud-bottom-row {
  align-items: flex-end;
}

.hud-pod {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0.45rem 0.78rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.hud-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.hud-rank-pod {
  min-width: 112px;
}

.rank-line {
  display: flex;
  align-items: baseline;
  line-height: 1;
  margin-top: 0.12rem;
}

.rank-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--rally-gold);
  font-variant-numeric: tabular-nums;
}

.rank-suffix {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--rally-gold);
  margin-left: 2px;
}

.rank-total {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.hud-sub {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* Top Center Checkpoint Countdown */
.hud-timer-pod {
  text-align: center;
  min-width: 175px;
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(12, 20, 38, 0.85) 100%);
}

.timer-digits {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.3rem;
  line-height: 1.05;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fef08a;
  text-shadow: 0 2px 12px rgba(250, 204, 21, 0.35);
}

.hud-timer-pod.low-time {
  border-color: rgba(239, 68, 68, 0.85);
}

.hud-timer-pod.low-time .timer-digits {
  color: #ff4d5e;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.65);
  @media (prefers-reduced-motion: no-preference) {
    /* Gentle 1.5Hz pulse — well under WCAG 3Hz flash limit */
    animation: low-timer-pulse 0.66s ease-in-out infinite;
  }
}

@keyframes low-timer-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(1.04); }
}

.checkpoint-toast {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: var(--rally-green);
  color: #052e16;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hud-clock-pod {
  text-align: right;
  min-width: 146px;
}

.clock-digits {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  margin-top: 0.1rem;
}

.surface-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.surface-pill,
.rut-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.14rem 0.42rem;
  border-radius: 4px;
  background: #d97706;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.rut-pill {
  background: #7c2d12;
  color: #fed7aa;
}

/* Co-Driver Pacenote Banner */
.pacenote-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.95rem;
  border-radius: 10px;
  background: rgba(9, 14, 26, 0.86);
  border: 2px solid var(--rally-gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
}

.pacenote-banner[data-severity="easy"] { border-color: #22c55e; }
.pacenote-banner[data-severity="medium"] { border-color: #facc15; }
.pacenote-banner[data-severity="hard"] { border-color: #f97316; }
.pacenote-banner[data-severity="hairpin"] { border-color: #ef4444; }
.pacenote-banner[data-severity="hazard"] { border-color: #38bdf8; }

.pacenote-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 1.35rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
}

.pacenote-text {
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.05em;
  color: #ffffff;
  white-space: nowrap;
}

/* Center Countdown / GO! */
.center-callout {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3.4rem, 9vw, 6.2rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--rally-gold);
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 32px rgba(250, 204, 21, 0.45);
}

/* Bottom Row Pods */
.hud-map-pod {
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#minimap-canvas {
  width: 112px;
  height: 112px;
  display: block;
}

.map-stage-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #cbd5e1;
}

.hud-drift-pod {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.34rem 0.65rem;
  margin-bottom: 0.15rem;
}

.drift-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  transition: color 0.14s ease;
}

.drift-badge.active {
  color: var(--rally-gold);
}

.thruster-meter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.thruster-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--rally-cyan);
}

.thruster-bar {
  width: 92px;
  height: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
}

.thruster-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 50%, #facc15 82%, #f97316 100%);
  transition: width 0.08s linear;
}

.thruster-pct {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: #e0f2fe;
  min-width: 3.4ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.drift-badge.flying {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}

.hud-cluster-pod {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
}

#tach-canvas {
  width: 116px;
  height: 92px;
  display: block;
}

.cluster-digital {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.gear-box {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.gear-mode {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--rally-cyan);
}

.gear-num {
  font-family: var(--font-mono);
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 900;
  color: var(--rally-gold);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 6px;
  padding: 0.08rem 0.42rem;
}

.speed-box {
  display: flex;
  align-items: baseline;
  gap: 0.22rem;
}

.speed-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
}

.speed-unit {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Stage Overlay (Title / Pause / Standings / Game Over) */
.stage-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 50% 42%, rgba(9, 14, 26, 0.52), rgba(2, 6, 23, 0.84));
  z-index: 10;
}

.stage-overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(640px, 95vw);
  padding: 1.6rem 1.8rem;
  border-radius: 14px;
  background: rgba(11, 18, 33, 0.93);
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.overlay-kicker {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--rally-cyan);
}

.overlay-title {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.75rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #ffffff 15%, #fde047 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overlay-desc {
  margin: 0.65rem auto 1.1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #cbd5e1;
  max-width: 52ch;
}

.overlay-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin: 0 0 1.15rem;
}

.overlay-stats[hidden],
.overlay-hero-showcase[hidden] {
  display: none;
}

.overlay-stat-box {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid var(--border-subtle);
}

.overlay-stat-box span {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.overlay-stat-box strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--rally-gold);
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.overlay-kbd-line {
  margin: 1rem 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.65;
}

kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 4px;
}

/* Native Modal Dialogs — Modern Top-Layer Entry/Exit Transitions + Light Dismiss */
dialog {
  width: min(880px, 94vw);
  max-height: 90vh;
  padding: 1.25rem 1.4rem;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: #0d1526;
  color: var(--text-main);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
  overflow: auto;

  /* Closed / exit state (mandatory display + overlay + separate allow-discrete) */
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;

  @media (prefers-reduced-motion: no-preference) {
    transform: scale(0.95);
  }
}

dialog::backdrop {
  background-color: rgba(2, 6, 23, 0);
  backdrop-filter: blur(4px);
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog[open]):where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: scale(1);

    @starting-style {
      transform: scale(0.95);
    }
  }

  &::backdrop {
    background-color: rgba(2, 6, 23, 0.72);

    @starting-style {
      background-color: rgba(2, 6, 23, 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog,
  dialog::backdrop {
    transition-duration: 0.1s;
  }
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.dialog-kicker {
  margin: 0 0 0.18rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--rally-cyan);
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.95rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-right {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

/* Garage Modal Internals */
.garage-layout {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.garage-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #cbd5e1;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hint-note {
  font-size: 0.72rem;
  color: var(--rally-gold);
}

.pill-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
}

.select-card {
  text-align: left;
  padding: 0.65rem 0.8rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.select-card strong {
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.select-card span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.select-card.active {
  border-color: var(--rally-gold);
  background: rgba(29, 100, 242, 0.22);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.select-card:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.track-diff-pill {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.1rem 0.36rem;
  border-radius: 4px;
  color: #090e1a;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 0.6rem;
}

.car-swatch-bar {
  height: 10px;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.car-stat-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.car-stat-track {
  height: 5px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
}

.car-stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sega-blue-hi), var(--rally-gold));
}

.tuning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.6rem;
}

.tuning-group {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.tuning-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Records & Help Modals */
.records-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.records-table th,
.records-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.records-table th {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.help-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.help-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  color: var(--rally-gold);
}

.help-card ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
}

/* Touch Controls */
.touch-controls {
  display: none;
  position: absolute;
  inset-inline: 0.8rem;
  bottom: 7.4rem;
  justify-content: space-between;
  pointer-events: none;
  z-index: 8;
}

.touch-left,
.touch-right {
  display: flex;
  gap: 0.55rem;
  pointer-events: auto;
}

.touch-btn {
  min-width: 60px;
  min-height: 56px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.25);
  touch-action: none;
}

.touch-gas {
  background: rgba(22, 163, 74, 0.78);
  border-color: rgba(134, 239, 172, 0.6);
}

.touch-brake {
  background: rgba(220, 38, 38, 0.78);
  border-color: rgba(252, 165, 165, 0.6);
}

.touch-drift {
  background: rgba(202, 138, 4, 0.82);
  border-color: rgba(254, 240, 138, 0.65);
}

.touch-fly {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.88), rgba(249, 115, 22, 0.88));
  border-color: rgba(186, 230, 253, 0.8);
  color: #ffffff;
}

.overlay-hero-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 0 auto 0.65rem;
}

.hero-car-img {
  height: 76px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.65));
}

.hero-side-img {
  height: 58px;
}

.car-preview-thumb {
  width: 100%;
  height: 74px;
  object-fit: contain;
  margin-bottom: 0.35rem;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 62%, rgba(56, 189, 248, 0.18), rgba(9, 14, 26, 0.72));
  padding: 4px;
}

.hangar-intro {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.hangar-grid-16 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.hangar-tile {
  margin: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.hangar-tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-image: url("assets/tesla_sheet_16.jpg");
  background-size: 400% 400%;
  background-repeat: no-repeat;
}

.hangar-tile figcaption {
  padding: 0.3rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  background: rgba(15, 23, 42, 0.92);
}

@media (max-width: 640px) {
  .hangar-grid-16 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 860px) {
  .mode-badge {
    display: none;
  }
  .hud-map-pod,
  .hud-drift-pod {
    display: none;
  }
  .timer-digits {
    font-size: 1.75rem;
  }
  .rank-number {
    font-size: 1.5rem;
  }
}
