/* F1 Racing — game-specific styles */

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

body {
  background: #0b0b12;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#gameContainer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ================================================================
   MENU SYSTEM — retro arcade + tagwhy style
   ================================================================ */

/* 3D car background canvas */
.menu-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Shared screen layer */
.menu-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  /* semi-transparent so 3D car shows through */
  background: radial-gradient(ellipse at 60% 50%,
    rgba(11, 11, 18, 0.65) 0%,
    rgba(11, 11, 18, 0.88) 60%,
    rgba(11, 11, 18, 0.95) 100%
  );
}

.menu-inner {
  width: 100%;
  max-width: 440px;
  padding: 40px 30px;
  text-align: center;
}

.menu-inner-wide {
  max-width: 700px;
}

/* -------- Title -------- */

.menu-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 36px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  text-shadow:
    0 0 10px rgba(138, 124, 255, 0.6),
    0 0 40px rgba(138, 124, 255, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.8);
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 10px rgba(138, 124, 255, 0.6), 0 0 40px rgba(138, 124, 255, 0.3), 0 4px 20px rgba(0,0,0,0.8); }
  50% { text-shadow: 0 0 16px rgba(138, 124, 255, 0.9), 0 0 60px rgba(138, 124, 255, 0.5), 0 4px 20px rgba(0,0,0,0.8); }
}

.menu-tagline {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #8a7cff);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 36px;
  opacity: 0.7;
}

/* -------- Hub layout (main menu) -------- */

.menu-inner-hub {
  max-width: 880px;
}

/* Mode cards — three large clickable tiles for the primary modes. */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 28px 18px 22px;
  min-height: 240px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
  color: var(--text, #e9e9f1);
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mode-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent, #8a7cff);
  background: linear-gradient(180deg, rgba(138, 124, 255, 0.10) 0%, rgba(138, 124, 255, 0.02) 100%);
  box-shadow: 0 0 24px rgba(138, 124, 255, 0.18);
}

.mode-card:active:not(:disabled) {
  transform: translateY(0);
}

.mode-card-icon {
  width: 56px;
  height: 56px;
  color: var(--accent, #8a7cff);
  margin-top: 4px;
  filter: drop-shadow(0 0 6px rgba(138, 124, 255, 0.35));
}

.mode-card-title {
  font-size: 14px;
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin: 0;
}

.mode-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  max-width: 26ch;
}

/* Disabled (Career — coming soon) */
.mode-card-disabled {
  opacity: 0.5;
  cursor: default;
}
.mode-card-disabled:hover {
  transform: none;
  border-color: var(--line, #24243b);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  box-shadow: none;
}

.mode-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  text-transform: uppercase;
}

/* Manage row — Cars / Shop / Account. Half-height of the mode cards
 * so they read as supporting actions rather than competing with the
 * primary modes. Same chrome family. */
.manage-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.manage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  min-height: 110px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
  color: var(--text, #e9e9f1);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.manage-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent, #8a7cff);
  background: rgba(138, 124, 255, 0.08);
  box-shadow: 0 0 18px rgba(138, 124, 255, 0.15);
}

.manage-card:active:not(:disabled) { transform: translateY(0); }

.manage-card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent, #8a7cff);
}

.manage-card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.manage-card-disabled {
  opacity: 0.5;
  cursor: default;
}
.manage-card-disabled:hover {
  transform: none;
  border-color: var(--line, #24243b);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

/* Secondary icon nav (Best Times / How to Play / Settings / Credits) */
.menu-secondary {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.menu-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #a7a7c2);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-icon-btn svg {
  width: 16px;
  height: 16px;
}

.menu-icon-btn:hover {
  color: #fff;
  border-color: var(--accent, #8a7cff);
  background: rgba(138, 124, 255, 0.08);
}

.menu-icon-btn-muted {
  opacity: 0.6;
}
.menu-icon-btn-muted:hover {
  opacity: 1;
}

/* -------- Legacy nav buttons (used on sub-screens like trackSelect) -------- */

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.menu-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--text, #e9e9f1);
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s ease;
}

.menu-btn:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.09));
  border-color: var(--accent, #8a7cff);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(138, 124, 255, 0.15);
}

.menu-btn:active {
  transform: translateY(0);
}

.menu-btn-primary {
  background: linear-gradient(135deg, rgba(138, 124, 255, 0.2), rgba(138, 124, 255, 0.08));
  border-color: var(--accent, #8a7cff);
  color: #fff;
  box-shadow: 0 0 20px rgba(138, 124, 255, 0.12);
}

.menu-btn-primary:hover {
  background: linear-gradient(135deg, rgba(138, 124, 255, 0.35), rgba(138, 124, 255, 0.15));
  box-shadow: 0 0 28px rgba(138, 124, 255, 0.25);
}

.menu-btn-primary:disabled {
  opacity: 0.35;
  cursor: default;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border-color: var(--line, #24243b);
  box-shadow: none;
  transform: none;
}

.menu-btn-small {
  padding: 10px 24px;
  font-size: 10px;
  opacity: 0.6;
}

.menu-btn-small:hover {
  opacity: 1;
}

.menu-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'Press Start 2P', monospace;
  animation: hintBlink 1.8s step-end infinite;
}

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

/* -------- Back button -------- */

.menu-back {
  display: inline-block;
  margin-bottom: 20px;
  padding: 8px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--muted, #a7a7c2);
  background: none;
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-back:hover {
  color: #fff;
  border-color: var(--accent, #8a7cff);
}

/* -------- Sub-screen heading -------- */

.menu-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 24px;
  text-shadow: 0 0 12px rgba(138, 124, 255, 0.4);
}

.menu-muted {
  font-size: 13px;
  color: var(--muted, #a7a7c2);
  padding: 20px 0;
}

/* -------- Track select -------- */

.track-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-height: 50vh;
  overflow-y: auto;
  text-align: left;
}

.track-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.track-card:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.09));
  border-color: rgba(138, 124, 255, 0.4);
}

.track-card.selected {
  background: rgba(138, 124, 255, 0.1);
  border-color: var(--accent, #8a7cff);
  box-shadow: 0 0 20px rgba(138, 124, 255, 0.15);
}

.track-card-preview {
  flex: 0 0 80px;
  width: 80px;
  height: 60px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  overflow: hidden;
}

.track-card-preview canvas {
  width: 100%;
  height: 100%;
}

.track-card-info { flex: 1; min-width: 0; }

.track-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #fff;
  margin-bottom: 6px;
}

.track-card-desc {
  font-size: 12px;
  color: var(--muted, #a7a7c2);
  line-height: 1.4;
}

.track-card-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

.track-card-record {
  font-size: 11px;
  color: #00dd44;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.track-select-footer {
  text-align: center;
}

/* -------- Controls / How to Play -------- */

.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
}

.control-key {
  flex: 0 0 100px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--accent, #8a7cff);
  text-align: center;
}

.control-desc {
  font-size: 13px;
  color: var(--text, #e9e9f1);
}

.how-tips {
  text-align: left;
  padding: 16px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
}

.how-tips h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--accent, #8a7cff);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.how-tips p {
  font-size: 13px;
  color: var(--muted, #a7a7c2);
  line-height: 1.6;
}

/* -------- Settings -------- */

/* Section title used inside the slimmed Settings page (Game / Controls). */
.settings-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #8a7cff);
  margin: 22px 0 10px;
  text-align: left;
  opacity: 0.8;
}
.settings-section-title:first-of-type { margin-top: 6px; }

/* Tighter controls list when shown in Settings (vs. the standalone
 * How-to-Play screen). 2-column grid on wide viewports so the key
 * reference doesn't run a long column. */
.controls-grid-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.controls-grid-settings .control-row {
  padding: 8px 12px;
}
@media (max-width: 600px) {
  .controls-grid-settings { grid-template-columns: 1fr; }
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
}

.setting-row label {
  font-size: 13px;
  color: var(--text, #e9e9f1);
}

.setting-row select,
.setting-row input[type="range"] {
  min-width: 120px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
}

.setting-row select:focus {
  border-color: var(--accent, #8a7cff);
  outline: none;
}

.setting-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  border: none;
  padding: 0;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #8a7cff);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(138, 124, 255, 0.4);
}

/* Reset-data button — destructive action, so the hover tints toward
 * a warning red. Idle state is muted to avoid screaming for attention. */
.setting-action-btn {
  padding: 8px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #a7a7c2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.setting-action-btn:hover {
  color: #ff7070;
  border-color: rgba(255, 112, 112, 0.4);
  background: rgba(255, 112, 112, 0.08);
}

/* -------- Best Times -------- */

.best-times-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.best-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
}

.best-time-track {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #fff;
}

.best-time-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--accent, #8a7cff);
}

/* -------- Credits -------- */

.credits-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
}

.credits-line {
  font-size: 14px;
  color: var(--text, #e9e9f1);
}

.credits-role {
  display: inline-block;
  min-width: 80px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--accent, #8a7cff);
  text-transform: uppercase;
  margin-right: 12px;
}

.credits-site {
  margin-top: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--accent, #8a7cff);
  opacity: 0.7;
}

/* ================================================================
   GAME HUD
   ================================================================ */

/* -------- Collision flash -------- */

.collision-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(255, 40, 20, 0.45) 100%
  );
  transition: opacity 0.06s ease-out;
}

.collision-flash.active {
  opacity: 1;
  transition: none;
}

/* -------- Top HUD: title + lap + time -------- */

.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 28px 20px;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
  /* HUD fade-in driven by JS-set --hud-opacity during the camera
   * intro. Default 0 means the HUD starts hidden — prevents a
   * flash of fully-lit HUD between gameContainer becoming visible
   * and the first render frame setting --hud-opacity. */
  opacity: var(--hud-opacity, 0);
  transition: opacity 0.15s linear;
}

/* Same opacity variable applied to the bottom-of-screen HUD so the
 * speedo + minimap fade in together with the top bar. */
.hud-speedo,
.minimap {
  opacity: var(--hud-opacity, 0);
  transition: opacity 0.15s linear;
}

.hud-top-left,
.hud-top-right {
  flex: 1;
  display: flex;
}

.hud-top-left { justify-content: flex-start; }
.hud-top-right { justify-content: flex-end; }

.hud-top-center {
  flex: 0 0 auto;
  text-align: center;
}

.hud-title {
  font-size: 18px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  line-height: 1;
  margin-top: 2px;
}

/* ---- Broadcast info chip (top-center) ----
 * F1-broadcast lower-third style: dark slab with a colored accent
 * stripe on the left, big bold track name dominant. No backdrop blur
 * — broadcast graphics are usually solid, not glassy. Sharp corners
 * with just a slight rounding gives the "official" feel rather than
 * the "in-game UI" feel. */
.hud-chip {
  display: flex;
  align-items: stretch;
  background: rgba(10, 10, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55);
  overflow: hidden;
}

/* Colored accent stripe on the left of the chip — picks up the kerb
   accent color via inline style set from JS (CSS variable). */
.hud-chip::before {
  content: "";
  width: 4px;
  background: var(--chip-accent, #cc1830);
  flex-shrink: 0;
}

.hud-chip-main {
  display: flex;
  flex-direction: column;
  padding: 9px 18px 10px;
  gap: 3px;
}

.hud-chip-track {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1;
}

.hud-chip-trackname {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hud-chip-sep { display: none; }

.hud-chip-country {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.hud-chip-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 5px;
  margin-top: 2px;
}

.hud-chip-meta {
  font-size: 9px;
  font-weight: 800;
  color: var(--chip-accent, #cc1830);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hud-chip-best {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
}

.hud-value-sm {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  font-variant-numeric: tabular-nums;
}

/* Lap counter — bigger, with pill background */

.hud-lap-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px 14px 6px;
  backdrop-filter: blur(6px);
}

/* Top-right time pill — same chrome as the lap pill so they bookend the chip */
.hud-time-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px 14px 6px;
  backdrop-filter: blur(6px);
  text-align: right;
  align-items: flex-end;
}

/* Delta to best lap — green = ahead, red = behind, hidden when no best yet */
.hud-delta {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.hud-delta.ahead {
  color: #00dd66;
  text-shadow: 0 0 8px rgba(0, 221, 102, 0.5);
}

.hud-delta.behind {
  color: #ff4040;
  text-shadow: 0 0 8px rgba(255, 64, 64, 0.5);
}

/* (Sector display removed — Marc reverted to laptime-only HUD.) */

.hud-value-lg {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  font-variant-numeric: tabular-nums;
}

.hud-lap-total {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
}

/* -------- Standings (P1–P8) -------- */
/* Sits on the right edge below the lap-time pill. Same chrome
 * (translucent black, blur, white-trace border, 12px radius) as the
 * lap and time boxes so it reads as part of the HUD family. Hidden
 * in solo races (script.js sets display:none when aiCars is empty). */

.hud-standings {
  position: fixed;
  top: 92px;
  right: 28px;
  min-width: 168px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 10;
  font-variant-numeric: tabular-nums;
  opacity: var(--hud-opacity, 0);
  transition: opacity 0.15s linear;
}

.standings-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.standings-row + .standings-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.standings-pos {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
}

.standings-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standings-lap {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
}

.standings-row.standings-player {
  color: #fff;
}
.standings-row.standings-player .standings-pos {
  color: #ffcc44;
  text-shadow: 0 0 6px rgba(255, 204, 68, 0.5);
}
.standings-row.standings-player .standings-lap {
  color: rgba(255, 255, 255, 0.7);
}

/* -------- Lap banner (flashes on new lap) -------- */

.lap-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.lap-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: none;
}

/* Respawn warning — fires when the safety net teleports the car
 * back. Orange-tinted so it reads as a warning, smaller than the lap
 * banner so it doesn't dominate the screen. */
.respawn-banner {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #ffaa44;
  text-shadow: 0 0 14px rgba(255, 170, 68, 0.55), 0 4px 20px rgba(0,0,0,0.85);
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.respawn-banner.show {
  opacity: 1;
  transition: none;
}

/* -------- Bottom HUD: speed — hidden, shown on wheel LCD instead -------- */
.hud-bottom { display: none; }

/* -------- Minimap -------- */

.minimap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 210px;
  height: 210px;
  border-radius: 18px;
  background: rgba(8, 8, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.5),
              inset 0 0 0 1px rgba(255,255,255,0.04);
  pointer-events: none;
  z-index: 10;
}

/* -------- Speed readout (chase cam) --------
 * Big, prominent number — no gear indicator since the game doesn't
 * actually shift gears. The "kmh" unit sits beneath the number in a
 * subtle weight so the speed dominates. */
.hud-speedo {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 11;
  display: none;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
}

.hud-speedo-num {
  font-size: 64px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 28px rgba(0,0,0,0.4);
}

.hud-speedo-unit {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* -------- Start lights -------- */

.start-lights {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  z-index: 20;
}

.start-light {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #555;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  transition: background 0.1s, box-shadow 0.1s;
}

.start-light.red {
  background: #e81020;
  box-shadow: 0 0 18px #e81020, 0 0 40px rgba(232,16,32,0.5);
}

.start-light.green {
  background: #00dd44;
  box-shadow: 0 0 18px #00dd44, 0 0 40px rgba(0,221,68,0.5);
}

/* -------- Loading screen --------
 * Shown immediately when Race is clicked, hiding the bg-color flash
 * while the world builds. Track outline draws in over the first
 * second, then the screen fades out into the camera intro. */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d12;
  pointer-events: none;
  transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
  opacity: 0;
}

/* Subtle radial glow behind the center text */
.loading-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
              rgba(204, 24, 48, 0.10) 0%,
              rgba(13, 13, 18, 0.0) 60%);
  pointer-events: none;
}

/* Track outline SVG — scaled big so it dominates the screen and
 * serves as the loading bar itself. The faint base path is the
 * "background" of the bar; the colored path traces over it as the
 * loading progresses. */
.loading-track-svg {
  position: absolute;
  /* 135vmin overflows on near-square or portrait viewports
   * (135 % of the smaller axis exceeds the larger axis), which
   * clipped the track outline left/right. 95vmin is the largest
   * size that's guaranteed to fit on every aspect ratio with a
   * small margin. */
  width: 95vmin;
  height: 95vmin;
  opacity: 0.85;
  pointer-events: none;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,0.6));
}

.loading-track-svg path {
  stroke-width: 14;
}

.loading-center {
  position: relative;
  text-align: center;
  z-index: 2;
}

.loading-trackname {
  font-size: clamp(54px, 9vw, 120px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 6px 30px rgba(0,0,0,0.95), 0 0 60px rgba(0,0,0,0.7);
  animation: loadingTitleIn 0.6s ease-out;
}

.loading-country {
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.30em;
  margin-top: 14px;
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0,0,0,0.85);
  animation: loadingTitleIn 0.6s ease-out 0.15s both;
}

.loading-country::before { content: "— "; opacity: 0.55; }

@keyframes loadingTitleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1.00); }
}

/* Track outline trace IS the loading bar. Duration matches the
 * loading-screen MIN_HOLD (1.5s) so it visually represents the
 * minimum time you'll see this screen. The stroke-dasharray /
 * stroke-dashoffset both get set in JS to the path's actual length
 * so the animation works regardless of track size. */
@keyframes loadingTraceDraw {
  from { stroke-dashoffset: var(--trace-length, 4000); }
  to   { stroke-dashoffset: 0; }
}

.loading-screen.tracing #loadingTrackPathDraw {
  animation: loadingTraceDraw 1.5s linear forwards;
}

/* -------- Race intro title card --------
 * Shown during the camera intro sweep (~4.5s) over the whole-track
 * overview. Big stylized track name on top, country in a smaller
 * accent line beneath. Position is bottom-left of screen so it
 * doesn't fight the centered start lights or block the view of the
 * track. Animation fades it in over the first 0.4s, holds, then
 * fades out at the end of the sweep. */
.intro-title-card {
  position: fixed;
  left: 5vw;
  bottom: 12vh;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  animation: introTitleFade 4.5s ease-out forwards;
  text-shadow: 0 4px 24px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,0.6);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

@keyframes introTitleFade {
  0%   { opacity: 0; transform: translateY(20px); }
  10%  { opacity: 1; transform: translateY(0); }
  85%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.intro-title-track {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.intro-title-country {
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 8px;
  /* Small leading dash gives a "subtitle" feel without bullets */
}

.intro-title-country::before {
  content: "— ";
  opacity: 0.6;
}

/* -------- Pause overlay -------- */

/* -------- Cursor hiding during gameplay --------
 * The race canvas should never show the OS pointer; the JS code also
 * sets `cursor: none` on body/canvas at race start, but a CSS rule
 * scoped to the game container is more robust against browser
 * quirks (e.g., the cursor briefly reappearing on mouse movement
 * even with inline cursor:none). Overlays where the user needs to
 * click buttons explicitly opt back in. */
#gameContainer { cursor: none; }
#gameContainer .pause-overlay,
#gameContainer .finish-overlay { cursor: auto; }

.pause-overlay, .finish-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  backdrop-filter: blur(6px);
}

.pause-inner, .finish-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.pause-title, .finish-title {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  margin-bottom: 10px;
}

.pause-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pause-volume input[type="range"] {
  width: 160px;
  accent-color: #8a7cff;
}

.pause-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 36px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 220px;
}

.pause-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

.finish-times {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
  width: 260px;
}

/* Finish-screen verdict banner — only shown in race mode (script
 * skips emitting it for time trial). Color reflects outcome: gold for
 * win, violet for podium, neutral for finished elsewhere. */
.finish-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
}

.finish-verdict {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finish-pos {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.7);
}

.finish-position.win .finish-verdict {
  color: #ffcc44;
  text-shadow: 0 0 14px rgba(255, 204, 68, 0.55);
}
.finish-position.win {
  border-color: rgba(255, 204, 68, 0.5);
  box-shadow: 0 0 20px rgba(255, 204, 68, 0.18);
}

.finish-position.podium .finish-verdict {
  color: #8a7cff;
  text-shadow: 0 0 12px rgba(138, 124, 255, 0.5);
}
.finish-position.podium {
  border-color: rgba(138, 124, 255, 0.45);
}

.finish-position.loss .finish-verdict {
  color: rgba(255,255,255,0.6);
}

.finish-time-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.finish-time-row.best {
  color: #00dd44;
  font-weight: 700;
}

.finish-time-row.total {
  border-top: 2px solid rgba(255,255,255,0.25);
  border-bottom: none;
  font-weight: 700;
  color: #fff;
  padding-top: 10px;
  margin-top: 4px;
}

.finish-time-row.best-label {
  border-bottom: none;
  color: #8a7cff;
  font-weight: 600;
  font-size: 14px;
  padding-top: 8px;
}

/* -------- Pre-Race Options -------- */
/* Small panel between track-select and game start. Only the rows
 * relevant to the current mode are visible (JS toggles AI / Ghost). */
.prerace-group {
  margin-bottom: 18px;
}

/* -------- Cars / Livery picker -------- */
/* The Cars screen lets the BG car (rendered into #menuBg3d) show
 * through the middle of the screen as a live preview. So this screen
 * uses a darker top/bottom and a transparent middle band. */
.menu-screen-cars {
  background: linear-gradient(to bottom,
    rgba(11, 11, 18, 0.92) 0%,
    rgba(11, 11, 18, 0.18) 35%,
    rgba(11, 11, 18, 0.18) 65%,
    rgba(11, 11, 18, 0.92) 100%
  );
}
.cars-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Spacer that defines where the BG car preview shows through. */
.cars-stage {
  flex: 1 1 auto;
  min-height: 200px;
}

.cars-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
  backdrop-filter: blur(8px);
}

.car-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.car-swatch:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}
.car-swatch.selected {
  border-color: var(--accent, #8a7cff);
  background: rgba(138, 124, 255, 0.14);
  box-shadow: 0 0 18px rgba(138, 124, 255, 0.25);
}
.car-swatch-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.car-swatch-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  line-height: 1.3;
}
.car-swatch.selected .car-swatch-name { color: #fff; }

@media (max-width: 800px) {
  .cars-swatches { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .cars-swatches { grid-template-columns: repeat(2, 1fr); }
}

/* -------- Account --------
 * Single-column. One bordered "identity" card holds Name + Current
 * Car. Statistics render as a row of 4 tiles. Online sits at the
 * bottom as a quiet footnote (no card chrome). */
.account-identity {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  padding: 22px;
  text-align: left;
  background: linear-gradient(180deg, rgba(138, 124, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(138, 124, 255, 0.28);
  border-radius: var(--radius-md, 12px);
}

.account-identity-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-name-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

#accountName {
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-sm, 6px);
  letter-spacing: 0.04em;
}
#accountName:focus {
  outline: none;
  border-color: var(--accent, #8a7cff);
  background: rgba(0, 0, 0, 0.5);
}
#accountName::placeholder { color: rgba(255, 255, 255, 0.3); }

.account-identity-livery {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-livery-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: #555;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

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

.account-livery-cap {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}

.account-livery-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.account-livery-link {
  padding: 8px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #8a7cff);
  background: rgba(138, 124, 255, 0.10);
  border: 1px solid rgba(138, 124, 255, 0.28);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.account-livery-link:hover {
  color: #fff;
  background: rgba(138, 124, 255, 0.22);
  border-color: var(--accent, #8a7cff);
}

.account-block-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #8a7cff);
  text-align: left;
  margin-bottom: 12px;
}

.account-stats-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
}

.stat-tile-val {
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-tile-key {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.account-online-note {
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .account-stats-tiles { grid-template-columns: repeat(2, 1fr); }
  .account-identity-livery { flex-wrap: wrap; }
  .account-livery-link { width: 100%; text-align: center; }
}

/* -------- Shop placeholder -------- */
.shop-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, #24243b);
  border-radius: var(--radius-md, 12px);
}
.shop-soon-icon {
  width: 64px;
  height: 64px;
  color: var(--accent, #8a7cff);
  opacity: 0.6;
}
.shop-soon-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}
.shop-soon-desc {
  font-size: 13px;
  color: var(--muted, #a7a7c2);
  line-height: 1.6;
  max-width: 32ch;
}

/* -------- Cockpit CSS overlay — not used -------- */
.cockpit { display: none; }

/* -------- Steering wheel canvas -------- */

.steering-wheel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 42%;
  pointer-events: none;
  z-index: 9;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 600px) {
  .menu-title { font-size: 22px; }
  .menu-inner { padding: 24px 16px; }
  .menu-btn { padding: 12px 20px; font-size: 10px; }
  .menu-heading { font-size: 14px; }
  .track-card { padding: 10px 12px; gap: 10px; }
  .track-card-preview { flex: 0 0 60px; width: 60px; height: 45px; }
  .track-card-name { font-size: 9px; }
  .control-key { flex: 0 0 80px; font-size: 8px; }

  .hud-top { padding: 10px 14px 14px; }
  .hud-title { font-size: 14px; }
  .hud-value-sm { font-size: 18px; }
  .hud-value-lg { font-size: 26px; }
  .hud-lap-total { font-size: 14px; }
  .hud-speed { font-size: 36px; }
  .lap-banner { font-size: 28px; }
  .minimap { width: 110px; height: 110px; bottom: 12px; right: 12px; }
  .steering-wheel { height: 38%; }

  /* Hub: stack mode cards on narrow viewports. */
  .mode-cards { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 140px; padding: 18px 14px 14px; }
  .mode-card-icon { width: 36px; height: 36px; }
  .mode-card-title { font-size: 11px; }
  .mode-card-desc { font-size: 11px; }
  .menu-icon-btn { padding: 8px 10px; font-size: 8px; }
}
