:root {
  --bg-deep: #050a12;
  --bg-panel: rgba(6, 14, 24, 0.78);
  --bg-card: rgba(8, 16, 28, 0.94);
  --line: rgba(232, 210, 160, 0.16);
  --text: #f7f1e6;
  --muted: #9aa8b8;
  --green: #5eead4;
  --green-solid: #c9a227;
  --green-deep: #8a6a12;
  --gold: #e8c56a;
  --accent-solid: #c9a227;
  --danger: #ff6b7a;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

.game-grade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, transparent 52%, rgba(3, 7, 12, .12) 76%, rgba(0, 0, 0, .42) 112%),
    linear-gradient(180deg, rgba(94, 160, 224, .035), transparent 35%, rgba(255, 174, 70, .025));
  mix-blend-mode: multiply;
}

.game-grade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.brand-mark {
  width: 34px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, #00732f 0 33%, #fff 33% 66%, #000 66%);
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark.dubai-mark::after {
  display: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f42a41;
  left: 14px;
  top: 5px;
}

.brand-sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 8px 4px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 14px;
  min-width: 64px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.stat-divider {
  width: 1px;
  background: var(--line);
  margin: 4px 0;
}

.accent {
  color: var(--gold);
}

.danger {
  color: var(--danger);
}

.mission {
  position: absolute;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.message {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.speedometer {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(240px, 40vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.speed-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.speed-fill {
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1fbf6a, #f0c14b 70%, #ff6b7a);
  transition: width 0.08s linear;
}

.speed-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.controls {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.pad,
.right-pad {
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.pad {
  grid-template-columns: 1fr 1fr;
}

.ctrl {
  width: 72px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.ctrl:active {
  transform: scale(0.96);
}

.ctrl-horn,
.ctrl-boost {
  width: 88px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ctrl-horn {
  background: rgba(180, 40, 55, 0.78);
  border-color: rgba(255, 140, 150, 0.28);
}

.ctrl-boost {
  background: rgba(210, 160, 30, 0.82);
  border-color: rgba(255, 220, 120, 0.3);
  color: #1a1400;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: auto;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(40, 90, 160, 0.35), transparent 70%),
    rgba(4, 10, 22, 0.78);
}

.overlay.hidden {
  display: none;
}

/* —— Professional main menu —— */
.menu-overlay {
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background:
    linear-gradient(115deg, rgba(4, 12, 28, 0.55) 0%, rgba(4, 12, 28, 0.2) 42%, rgba(4, 12, 28, 0.72) 100%),
    radial-gradient(ellipse 90% 70% at 18% 30%, rgba(212, 160, 23, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 78% 70%, rgba(60, 120, 200, 0.18), transparent 60%),
    rgba(3, 8, 18, 0.62);
  animation: menu-fade-in 0.55s ease both;
}

@keyframes menu-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.menu-shell {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.menu-hero {
  text-align: left;
  padding: 8px 8px 8px 4px;
  animation: menu-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes menu-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 193, 75, 0.85);
}

.menu-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.menu-title span {
  color: var(--gold);
}

.menu-tagline {
  margin: 0 0 28px;
  max-width: 28ch;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.55;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.menu-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu-meta-item strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.menu-panel {
  width: 100%;
  padding: 28px 26px 22px;
  border-radius: 24px;
  background: rgba(8, 18, 34, 0.92);
  border: 1px solid rgba(212, 232, 255, 0.12);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
  animation: menu-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.menu-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.menu-panel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.audio-toggles {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.audio-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.audio-btn.is-on {
  color: #1a1400;
  background: var(--gold);
  border-color: transparent;
}

.audio-btn:not(.is-on):hover {
  color: var(--text);
  border-color: rgba(212, 160, 23, 0.4);
}

.menu-actions {
  justify-content: stretch;
}

.btn-drive {
  width: 100%;
  padding: 16px 22px;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-help {
  margin-top: 20px;
}

.menu-panel .garage-label {
  margin: 0;
}

.menu-panel .car-garage {
  max-height: min(240px, 32vh);
}

.menu-panel .car-option {
  position: relative;
  overflow: hidden;
}

.menu-panel .car-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.15s ease;
}

.menu-panel .car-option.is-selected::before {
  background: var(--gold);
}

@media (max-width: 860px) {
  .menu-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    max-height: calc(100vh - 40px);
    overflow: auto;
  }

  .menu-hero {
    text-align: center;
    padding: 4px;
  }

  .menu-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .menu-meta {
    justify-content: center;
  }

  .menu-title {
    font-size: clamp(44px, 14vw, 64px);
  }
}

.card {
  width: min(92vw, 460px);
  padding: 36px 32px 28px;
  border-radius: 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.card-wide {
  width: min(94vw, 640px);
}

.garage-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.car-garage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  text-align: left;
}

.car-option {
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 10px;
  cursor: pointer;
  font-family: var(--font-display);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.car-option:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 160, 23, 0.45);
}

.car-option.is-selected {
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.14);
  box-shadow: 0 0 0 1px rgba(212, 160, 23, 0.25);
}

.car-option .car-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.car-option .car-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.car-picked {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.car-picked strong {
  color: var(--gold);
  font-weight: 700;
}

.flag {
  width: 52px;
  height: 32px;
  margin: 0 auto 18px;
  border-radius: 5px;
  background: #006a4e;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.flag::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f42a41;
  left: 20px;
  top: 8px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow.danger {
  color: var(--danger);
}

h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(40px, 10vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

h1 span {
  color: var(--gold);
}

h1 span.danger {
  color: var(--danger);
}

.lede {
  margin: 0 auto 28px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.load-status {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--gold);
  color: #1a1400;
  box-shadow: 0 10px 28px rgba(212, 160, 23, 0.28);
}

.btn-primary:hover {
  background: #e0b12a;
}

.help dt {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.help {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  text-align: left;
}

.help > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: baseline;
}

.help dd {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 28px;
}

.result {
  padding: 16px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .controls {
    opacity: 0.78;
  }

  .ctrl {
    width: 64px;
    height: 54px;
  }

  .ctrl-horn,
  .ctrl-boost {
    width: 80px;
    font-size: 12px;
  }

  .mission {
    top: 78px;
  }
}

@media (max-width: 640px) {
  .mission {
    top: auto;
    bottom: 118px;
    font-size: 12px;
  }

  .brand-sub {
    font-size: 14px;
  }

  .stat {
    min-width: 52px;
    padding: 4px 10px;
  }

  .stat-value {
    font-size: 15px;
  }

  .card {
    padding: 28px 22px 22px;
  }
}

/* —— HUD visibility —— */
.ui.is-menu .hud-play { visibility: hidden; pointer-events: none; }
.ui.is-playing .hud-play { visibility: visible; }
.ui.is-paused .hud-play { visibility: hidden; pointer-events: none; }

.pause-fab {
  position: absolute;
  top: max(72px, calc(env(safe-area-inset-top) + 64px));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 12px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.power-hud {
  position: absolute;
  left: 50%;
  top: max(58px, calc(env(safe-area-inset-top) + 52px));
  transform: translateX(-50%);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  max-width: min(420px, calc(100vw - 32px));
  text-align: center;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  pointer-events: auto;
}

.mode-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.mode-btn.is-on {
  background: rgba(212,160,23,0.18);
  border-color: var(--gold);
  color: var(--gold);
}

.map-block {
  margin: 0 0 14px;
  pointer-events: auto;
}
.map-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
  max-height: 140px;
  overflow: auto;
}
.map-option {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  font-family: var(--font-display);
}
.map-option.is-selected {
  border-color: var(--gold);
  background: rgba(212,160,23,0.14);
}
.map-option.is-locked {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
}
.map-option.is-locked .map-title::after {
  content: "  LOCKED";
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: .08em;
}
.map-title { display: block; font-weight: 700; font-size: 12px; }
.map-meta { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }

.lan-box {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
  pointer-events: auto;
}
.lan-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.lan-hint code {
  color: var(--gold);
  font-size: 10px;
}
.lan-field {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.lan-field input {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
}
.lan-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.lan-code {
  margin: 0;
  grid-template-columns: 1fr;
}
.lan-code input {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  font-weight: 700;
}
.lan-status {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.lan-players {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text);
}
.lan-players:empty { display: none; }
#lanStartBtn { width: 100%; }

.volume-row {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  pointer-events: auto;
}
.vol-label {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.vol-label input { width: 100%; }

.preview-wrap {
  margin-top: 22px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}
#preview { display: block; width: 100%; height: auto; }
.preview-caption {
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.car-stats {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(240,193,75,0.85);
  letter-spacing: 0.02em;
}

.board-box {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.board-box summary { cursor: pointer; font-weight: 700; color: var(--gold); }
.leaderboard { margin: 10px 0 0; padding-left: 18px; }
.leaderboard li { margin: 4px 0; font-size: 12px; }
.leaderboard span { color: var(--muted); opacity: 0.8; }

.tut-list {
  text-align: left;
  margin: 0 0 24px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.tut-list strong { color: var(--text); }

.menu-shell {
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}
.menu-overlay { align-items: flex-start; padding-top: max(16px, env(safe-area-inset-top)); }

@media (min-width: 900px) {
  .menu-shell { overflow: visible; max-height: none; }
  .menu-overlay { align-items: center; }
}

/* —— Menu v2 cinematic —— */
.menu-v2 {
  align-items: stretch !important;
  justify-content: flex-end;
  padding: 0 !important;
  pointer-events: auto;
}

.menu-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.15) 0%, rgba(5, 10, 18, 0.05) 40%, rgba(5, 10, 18, 0.72) 100%),
    radial-gradient(ellipse 80% 55% at 50% 110%, rgba(201, 162, 39, 0.18), transparent 60%);
  pointer-events: none;
  animation: vignette-breathe 8s ease-in-out infinite alternate;
}

@keyframes vignette-breathe {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

.menu-hero-stage {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  margin: auto auto 0;
  padding: 28px 24px max(36px, env(safe-area-inset-bottom));
  text-align: center;
  animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-v2 .menu-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.menu-v2 .menu-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 0.92;
}

.menu-title-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 14vw, 104px);
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  animation: brand-glow 4.5s ease-in-out infinite alternate;
}

.menu-title-rush {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 11vw, 78px);
  letter-spacing: -0.03em;
  color: var(--gold);
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
}

@keyframes brand-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.08); }
}

.menu-v2 .menu-tagline {
  margin: 18px auto 0;
  max-width: 28ch;
  font-size: clamp(15px, 2.4vw, 18px);
  color: var(--muted);
  line-height: 1.45;
}

.menu-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
  pointer-events: auto;
}

.menu-cta-row .btn-drive {
  min-width: 160px;
  padding: 14px 28px;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-best-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.menu-best-row strong { color: var(--gold); font-size: 14px; }
.menu-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}

.menu-v2 .load-status {
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.8;
}

.side-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  z-index: 5;
  overflow: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.94), rgba(6, 10, 18, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.side-drawer.is-open,
.side-drawer:not(.hidden) {
  transform: translateX(0);
}

.side-drawer.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-sm {
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.side-drawer .preview-wrap {
  margin: 0 0 16px;
}

.side-drawer .car-garage {
  max-height: 220px;
}

@media (max-width: 640px) {
  .menu-title-brand { font-size: clamp(48px, 16vw, 72px); }
  .side-drawer { width: 100%; }
}

/* Underground street-racing interface */
:root {
  --bg-deep: #070907;
  --bg-panel: rgba(12, 15, 12, 0.88);
  --bg-card: rgba(12, 15, 12, 0.97);
  --line: rgba(205, 255, 39, 0.22);
  --text: #f3f5e9;
  --muted: #9da294;
  --green: #ceff27;
  --green-solid: #ceff27;
  --green-deep: #718d0d;
  --gold: #ceff27;
  --accent-solid: #ceff27;
  --shadow: 14px 18px 0 rgba(0, 0, 0, 0.42);
  --radius: 2px;
  --font-display: "Teko", Impact, sans-serif;
  --font-body: "Rajdhani", system-ui, sans-serif;
}

body {
  letter-spacing: 0.015em;
}

.menu-v2 {
  justify-content: flex-start;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 5, 0.96) 0%, rgba(5, 7, 5, 0.84) 38%, rgba(5, 7, 5, 0.08) 72%),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.82));
}

.menu-v2::before {
  content: "";
  position: absolute;
  width: 68vw;
  height: 135vh;
  left: -27vw;
  top: -18vh;
  transform: rotate(13deg);
  background:
    linear-gradient(90deg, transparent 0 70%, rgba(206, 255, 39, 0.055) 70% 71%, transparent 71%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px),
    #111511;
  box-shadow: 35px 0 90px rgba(0,0,0,.8);
  opacity: .94;
}

.menu-v2::after {
  content: "///";
  position: absolute;
  right: 5vw;
  bottom: -12vh;
  font: 700 min(35vw, 470px)/1 var(--font-display);
  letter-spacing: -.2em;
  color: rgba(206,255,39,.055);
  transform: skewX(-13deg);
  pointer-events: none;
}

.menu-vignette {
  background:
    radial-gradient(circle at 78% 46%, transparent 0 25%, rgba(0,0,0,.28) 60%, rgba(0,0,0,.78) 100%),
    linear-gradient(180deg, rgba(0,0,0,.2), transparent 55%, rgba(0,0,0,.72));
  animation: none;
}

.menu-grain {
  position: absolute;
  inset: 0;
  opacity: .17;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.06) 3px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
}

.menu-speed-lines {
  position: absolute;
  right: 0;
  top: 16%;
  width: 52%;
  height: 28%;
  opacity: .22;
  transform: skewY(-8deg);
  background: repeating-linear-gradient(180deg, transparent 0 13px, rgba(206,255,39,.45) 13px 15px, transparent 15px 31px);
  mask-image: linear-gradient(90deg, transparent, #000);
}

.menu-corner {
  position: absolute;
  z-index: 4;
  color: rgba(206,255,39,.7);
  font: 600 11px/1 var(--font-body);
  letter-spacing: .22em;
  text-transform: uppercase;
}
.menu-corner-top { top: 22px; right: 28px; }
.menu-corner-bottom { bottom: 22px; right: 28px; }

.menu-hero-stage {
  width: min(560px, 54vw);
  margin: auto 0 auto clamp(28px, 7vw, 110px);
  padding: 40px 0;
  text-align: left;
  transform: skewY(-1.5deg);
  animation: underground-enter .6s cubic-bezier(.1,.8,.2,1) both;
}

@keyframes underground-enter {
  from { opacity: 0; transform: translateX(-45px) skewY(-1.5deg); }
  to { opacity: 1; transform: translateX(0) skewY(-1.5deg); }
}

.menu-v2 .menu-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  color: #b8bdae;
  font: 700 12px/1 var(--font-body);
  letter-spacing: .22em;
}
.menu-v2 .menu-kicker span {
  padding: 5px 7px;
  background: var(--gold);
  color: #080a07;
  letter-spacing: 0;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}

.menu-v2 .menu-title {
  align-items: flex-start;
  position: relative;
  width: max-content;
  transform: skewX(-8deg);
  filter: drop-shadow(14px 14px 0 rgba(0,0,0,.42));
}

.menu-title-brand,
.menu-title-rush {
  text-transform: uppercase;
  animation: none;
}
.menu-title-brand {
  font-size: clamp(78px, 11vw, 150px);
  line-height: .65;
  letter-spacing: -.035em;
  color: #f3f5e9;
  -webkit-text-stroke: 1px rgba(255,255,255,.18);
  text-shadow: none;
}
.menu-title-rush {
  margin-left: 1.05em;
  font-size: clamp(62px, 8.5vw, 116px);
  line-height: .76;
  letter-spacing: .015em;
  color: var(--gold);
  text-shadow: none;
}

.menu-v2 .menu-tagline {
  margin: 22px 0 0 12px;
  max-width: 34ch;
  padding-left: 14px;
  border-left: 5px solid var(--gold);
  color: #d8dacf;
  font: 600 clamp(14px, 1.5vw, 18px)/1.25 var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.menu-cta-row {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
  width: min(390px, 90%);
  gap: 3px;
  margin: 24px 0 0 10px;
}

.menu-cta-row .btn {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 11px 22px 10px;
  border: 0;
  border-left: 4px solid rgba(255,255,255,.16);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(31,35,30,.97), rgba(17,20,17,.7));
  color: #d8dacf;
  box-shadow: none;
  text-align: left;
  text-transform: uppercase;
  font: 600 24px/1 var(--font-display);
  letter-spacing: .055em;
  transform: skewX(-8deg);
}
.menu-cta-row .btn > * { transform: skewX(8deg); }
.menu-cta-row .btn:hover,
.menu-cta-row .btn:focus-visible,
.menu-cta-row .btn-primary {
  border-left-color: #fff;
  color: #090b08;
  background: linear-gradient(100deg, var(--gold), #9fca18);
  transform: skewX(-8deg) translateX(10px);
  box-shadow: -10px 8px 0 rgba(0,0,0,.35);
}
.menu-index {
  display: inline-block;
  width: 38px;
  margin-right: 8px;
  color: inherit;
  opacity: .55;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .08em;
  vertical-align: 3px;
}

.menu-best-row {
  justify-content: flex-start;
  margin: 16px 0 0 22px;
  color: #858b7f;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.menu-best-row strong { color: var(--gold); }
.menu-dot {
  width: 14px;
  height: 2px;
  border-radius: 0;
  background: rgba(206,255,39,.35);
}
.menu-v2 .load-status {
  margin: 8px 0 0 22px;
  color: #6d7468;
  font-family: var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.side-drawer {
  width: min(490px, 100%);
  padding: max(24px, env(safe-area-inset-top)) 26px max(28px, env(safe-area-inset-bottom));
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,.018) 4px 5px),
    linear-gradient(115deg, rgba(25,29,24,.99), rgba(8,10,8,.99));
  border-left: 5px solid var(--gold);
  box-shadow: -25px 0 0 rgba(0,0,0,.38), -55px 0 90px rgba(0,0,0,.65);
}
.drawer-head {
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(206,255,39,.32);
}
.garage-label {
  color: var(--gold);
  font: 600 22px/1 var(--font-display);
  letter-spacing: .14em;
}
.menu-panel-sub {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.preview-wrap,
.car-option,
.map-option,
.mode-btn,
.lan-field input,
.card,
.result {
  border-radius: 0;
}
.preview-wrap {
  border: 1px solid rgba(206,255,39,.34);
  border-bottom: 5px solid var(--gold);
  background:
    linear-gradient(rgba(206,255,39,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(206,255,39,.035) 1px, transparent 1px),
    #090b09;
  background-size: 18px 18px;
}
.car-garage { grid-template-columns: 1fr 1fr; gap: 5px; }
.car-option,
.map-option,
.mode-btn {
  background: #171a16;
  border: 1px solid rgba(255,255,255,.09);
  border-left: 3px solid #41463e;
  transform: skewX(-2deg);
}
.car-option:hover,
.map-option:hover {
  transform: skewX(-2deg) translateX(3px);
  border-color: rgba(206,255,39,.55);
}
.car-option.is-selected,
.map-option.is-selected,
.mode-btn.is-on {
  background: linear-gradient(100deg, rgba(206,255,39,.28), rgba(206,255,39,.04));
  border-color: var(--gold);
  border-left-width: 5px;
  color: #f5f7ed;
  box-shadow: none;
}
.car-option .car-title,
.map-title { font-family: var(--font-display); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; }
.car-stats { color: var(--gold); }

.btn {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.btn-primary {
  background: var(--gold);
  color: #080a07;
  box-shadow: 6px 6px 0 rgba(0,0,0,.35);
}
.btn-ghost {
  background: #1c201a;
  border-color: rgba(255,255,255,.14);
}

.panel,
.pause-fab {
  border-radius: 2px;
  border-color: rgba(206,255,39,.2);
  background: linear-gradient(110deg, rgba(17,20,16,.92), rgba(6,8,6,.82));
  backdrop-filter: blur(8px);
}
.brand,
.stats {
  border-bottom: 3px solid var(--gold);
  transform: skewX(-3deg);
}
.stat-label,
.brand-name { letter-spacing: .16em; }
.stat-value,
.brand-sub { font-family: var(--font-display); font-style: italic; }
.speed-track { border-radius: 0; background: rgba(255,255,255,.14); }
.speed-fill { border-radius: 0; background: linear-gradient(90deg, var(--gold), #fff25a, #ff512f); }
.ctrl {
  border-radius: 2px;
  border-color: rgba(206,255,39,.28);
  background: rgba(14,17,13,.88);
}
.ctrl-boost { background: var(--gold); color: #080a07; }

@media (max-width: 760px) {
  .menu-v2::before { width: 130vw; left: -70vw; opacity: .78; }
  .menu-corner { display: none; }
  .menu-hero-stage {
    width: calc(100% - 36px);
    margin: auto 18px max(20px, env(safe-area-inset-bottom));
    padding: 24px 0;
  }
  .menu-title-brand { font-size: clamp(72px, 25vw, 106px); }
  .menu-title-rush { font-size: clamp(58px, 19vw, 82px); }
  .menu-cta-row { width: 100%; margin-left: 0; }
  .menu-v2 .menu-tagline,
  .menu-best-row,
  .menu-v2 .load-status { margin-left: 4px; }
  .side-drawer { border-left-width: 0; border-top: 5px solid var(--gold); }
  .car-garage { grid-template-columns: 1fr; }
}

.online-mode-block { margin: 14px 0; pointer-events: auto; }
.online-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 8px 0;
}
.online-mode-option {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-left: 3px solid #41463e;
  background: #171a16;
  color: var(--muted);
  font: 600 17px/1 var(--font-display);
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.online-mode-option:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.online-mode-option.is-selected {
  border-color: var(--gold);
  border-left-width: 5px;
  background: linear-gradient(100deg, rgba(206,255,39,.3), rgba(206,255,39,.04));
  color: var(--gold);
}
.online-mode-option:disabled { cursor: default; opacity: .7; }
.match-timer {
  position: absolute;
  top: max(112px, calc(env(safe-area-inset-top) + 100px));
  left: 50%;
  transform: translateX(-50%) skewX(-5deg);
  z-index: 7;
  padding: 7px 18px 5px;
  border-bottom: 3px solid var(--gold);
  color: var(--gold);
  font: 700 28px/1 var(--font-display);
  letter-spacing: .08em;
}
.match-timer.hidden { display: none; }
.match-timer.is-critical {
  color: #fff;
  border-color: var(--danger);
  animation: timer-pulse .55s ease-in-out infinite alternate;
}
@keyframes timer-pulse { to { transform: translateX(-50%) skewX(-5deg) scale(1.08); } }
.online-standings {
  margin: 12px 0 26px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  text-align: left;
}
.online-standings li {
  padding: 11px 14px;
  border-left: 4px solid #444a40;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight: 700;
}
.online-standings li.is-winner {
  border-color: var(--gold);
  background: rgba(206,255,39,.13);
  color: var(--text);
}
.account-field {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.account-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-left: 4px solid var(--gold);
  background: #0d100c;
  color: var(--text);
  font: 600 16px var(--font-body);
  outline: none;
}
.account-field input:focus { border-color: var(--gold); }
.profile-rank { color: var(--gold); text-transform: uppercase; letter-spacing: .15em; }
#profileName { margin: 4px 0 18px; font: 600 44px/1 var(--font-display); text-transform: uppercase; }
.leaderboard-panel { margin-top: 28px; padding-top: 18px; border-top: 1px dashed rgba(206,255,39,.3); }

/* Car-specific performance cluster */
.speedometer {
  --speed-progress: 0deg;
  --speed-mid: 0deg;
  width: 172px;
  right: 126px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: auto;
  transform: none;
  gap: 5px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .58));
}
.speed-dial {
  width: 126px;
  height: 126px;
  padding: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(
    from 210deg,
    #71ffb0 0deg,
    var(--gold) var(--speed-mid),
    #ff4f45 var(--speed-progress),
    rgba(255, 255, 255, .11) var(--speed-progress) 240deg,
    transparent 240deg
  );
  box-shadow: 0 0 0 1px rgba(255,255,255,.16), inset 0 0 22px rgba(0,0,0,.75), 0 0 22px rgba(206,255,39,.12);
  transition: filter .16s ease;
}
.speed-dial::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  border-bottom-color: transparent;
}
.speed-dial-inner {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(40,49,61,.98), rgba(5,8,12,.99) 72%);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 0 20px rgba(0,0,0,.78);
}
.speed-gear {
  min-width: 24px;
  padding: 1px 6px;
  color: #0a0d0f;
  background: var(--gold);
  font: 800 11px/1.4 var(--font-display);
  text-align: center;
  transform: skew(-8deg);
}
.speed-value {
  margin-top: 1px;
  color: #fff;
  font: 800 34px/1 var(--font-display);
  letter-spacing: -2px;
  text-shadow: 0 0 14px rgba(255,255,255,.3);
}
.speed-unit {
  color: var(--muted);
  font: 700 8px/1.3 var(--font-display);
  letter-spacing: 2px;
}
.speed-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255,255,255,.68);
  font: 700 8px/1 var(--font-display);
  letter-spacing: .7px;
  text-transform: uppercase;
}
.speed-meta > span:first-child {
  max-width: 105px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.speed-meta b { color: var(--gold); }
.speedometer .speed-track { height: 3px; }
.speedometer.is-boosting .speed-dial {
  filter: brightness(1.2) drop-shadow(0 0 12px rgba(255,79,69,.8));
}
.speedometer.is-boosting .speed-gear {
  color: #fff;
  background: #ff4f45;
}
@media (max-width: 700px) {
  .game-grade {
    background: radial-gradient(circle at 50% 45%, transparent 58%, rgba(0,0,0,.24) 112%);
  }
  .game-grade::after {
    display: none;
  }
  .speedometer {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(106px, calc(env(safe-area-inset-bottom) + 96px));
    left: auto;
    transform: scale(.72);
    transform-origin: bottom right;
  }
  .speed-meta {
    font-size: 7px;
  }
}
