/* ============================================================
   NEON VELOCITY · 夜行竞速（Three.js 3D 版）
   菜单 / 结算：近黑 + 橙色；比赛 HUD：青色（对齐官方示例 2）
   ============================================================ */

:root {
  --bg: #050608;
  --panel: #0a0b0e;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ebef;
  --muted: #7a808a;
  --muted-2: #4c515a;
  --accent: #ff5a1f;
  --accent-2: #ff8a4c;
  --cyan: #57d7ff;
  --ok: #7fd6a4;
  --font-display: "Bahnschrift SemiCondensed", "Bahnschrift", "DIN Condensed", "Arial Narrow",
    "Helvetica Neue", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", "Courier New", monospace;
  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
canvas { display: block; }

.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; background: #04060a; }

.fx-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(130% 95% at 50% 46%, rgba(0,0,0,0) 42%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.85) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 72%, rgba(0,0,0,0.6) 100%);
}
.fx-grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.05; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.6'/></svg>");
}

.hud-k {
  display: block; font-family: var(--font-mono); font-size: 9px; line-height: 1;
  letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px rgba(255,90,31,0.9); display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

.eyebrow {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.22em; color: var(--muted); text-transform: uppercase;
}
.eyebrow .bar { width: 26px; height: 1px; background: var(--accent); }
.cap {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--muted); text-transform: uppercase;
}
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px;
  padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 3px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text);
  background: rgba(255,255,255,0.03);
}

.btn {
  display: inline-flex; align-items: center; gap: 12px; height: 46px; padding: 0 22px;
  border-radius: 2px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; transition: background .16s, border-color .16s, box-shadow .16s, transform .12s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: #100a07; font-weight: 600; border: 1px solid var(--accent);
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 8px 34px -12px rgba(255,90,31,.85); }
.btn.primary kbd { border-color: rgba(16,10,7,.35); color: rgba(16,10,7,.75); background: rgba(16,10,7,.08); }
.btn.ghost { border: 1px solid var(--line-strong); color: var(--text); background: rgba(255,255,255,.015); }
.btn.ghost:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.05); }

.link {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--muted);
  text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent;
}
.link:hover { color: var(--text); border-color: var(--line-strong); }

.screen { position: fixed; inset: 0; z-index: 10; }

/* ============================================================
   HUD
   ============================================================ */
.hud { position: fixed; inset: 0; z-index: 6; pointer-events: none; font-variant-numeric: tabular-nums; }

.hud-tl {
  position: absolute; top: 20px; left: 26px; display: flex; gap: 40px; align-items: flex-start;
}
.gear-box { display: grid; grid-template-columns: auto 12px; grid-template-rows: auto auto; gap: 2px 12px; }
.gear-num {
  font-family: var(--font-mono); font-size: 48px; font-weight: 600; line-height: .8;
  letter-spacing: -.05em; color: var(--text);
  text-shadow: 0 0 30px rgba(87,215,255,.35);
}
.gear-meta {
  grid-column: 1; font-family: var(--font-mono); font-size: 8px; letter-spacing: .22em;
  color: var(--muted); margin-top: 6px;
}
.rpm { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 2px; justify-content: flex-end; padding-bottom: 4px; }
.rpm i { width: 10px; height: 4px; background: rgba(255,255,255,.09); transition: background .06s; }
.rpm i.on { background: var(--cyan); box-shadow: 0 0 8px rgba(87,215,255,.55); }
.rpm i.on.hot { background: var(--accent); box-shadow: 0 0 8px rgba(255,90,31,.6); }

.pos-box { padding-top: 4px; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; width: 74px; }
.pos-box .hud-k { width: 100%; }
.pos-box b { font-family: var(--font-mono); font-size: 24px; font-weight: 600; line-height: 1; color: var(--cyan); }
.pos-box em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.hud-tc {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  text-align: center; font-family: var(--font-mono);
}
.lap-line { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.lap-line b { font-size: 22px; font-weight: 600; letter-spacing: .04em; }
.lap-line span { font-size: 11px; color: var(--muted); }
.race-time { font-size: 15px; letter-spacing: .06em; margin-top: 4px; color: var(--text); }
.best-line { margin-top: 6px; font-size: 9px; letter-spacing: .18em; color: var(--muted); }
.best-line b { color: var(--muted); font-weight: 500; margin-left: 6px; letter-spacing: .04em; }

.hud-tr { position: absolute; top: 18px; right: 24px; }
.map-box {
  position: relative; width: 200px; padding: 8px 8px 6px;
  border: 1px solid rgba(87,215,255,.22);
  background: rgba(6,10,16,.88);
  box-shadow: inset 0 0 30px rgba(87,215,255,.06), 0 0 24px -12px rgba(87,215,255,.4);
}
.map-box canvas { width: 100%; height: auto; }
.map-label {
  position: absolute; left: 9px; bottom: 6px; font-family: var(--font-mono); font-size: 8px;
  letter-spacing: .22em; color: rgba(87,215,255,.55);
}

.hud-speedo {
  position: absolute; right: 22px; bottom: 16px; width: 232px; height: 232px;
}
.hud-speedo canvas { width: 100%; height: 100%; }
.speedo-read {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.speedo-read b {
  font-family: var(--font-mono); font-size: 46px; font-weight: 600; line-height: 1;
  letter-spacing: -.04em; text-shadow: 0 0 24px rgba(87,215,255,.35);
}
.speedo-read span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em; color: var(--muted); margin-top: 6px;
}

.hud-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 42vw); padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.08); background: rgba(6,8,12,.55);
  backdrop-filter: blur(2px);
}
.bar-key {
  font-family: var(--font-mono); font-size: 9px; color: var(--muted); letter-spacing: .1em;
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 5px;
}
.hud-bar .bar { position: relative; flex: 1; height: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.hud-bar .bar i { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: var(--cyan); }
.hud-bar .bar.brk i { background: #e9ebef; }

.hud-hint {
  position: absolute; left: 26px; bottom: 20px; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase;
}
.hud-hint b { color: var(--muted); font-weight: 500; }

.hud-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 18px;
}
.countdown {
  font-family: var(--font-display); font-size: clamp(90px, 15vw, 190px); font-weight: 700;
  line-height: .9; color: var(--accent);
  text-shadow: 0 0 60px rgba(255,90,31,.55), 0 0 140px rgba(255,90,31,.25);
  animation: cdPop .9s cubic-bezier(.2,.8,.2,1);
}
.countdown.go { color: #fff; text-shadow: 0 0 70px rgba(255,255,255,.5); }
@keyframes cdPop {
  0% { opacity: 0; transform: scale(1.45); filter: blur(6px); }
  28% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: .92; transform: scale(.98); }
}
.toast {
  font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 44px); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--text);
  text-shadow: 0 4px 40px rgba(0,0,0,.9); animation: toastIn .5s ease-out;
}
.toast em { font-style: normal; color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- 驾驶舱 ---------------- */
.cockpit { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.cockpit-dash {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  background:
    radial-gradient(70% 100% at 50% 112%, rgba(9,12,17,0.98) 0%, rgba(9,12,17,0.9) 38%, rgba(9,12,17,0.5) 64%, rgba(9,12,17,0) 86%);
}
.cockpit-wheel {
  position: absolute; left: 50%; bottom: -2%;
  transform: translateX(-50%);
  width: min(240px, 24vw); height: auto; opacity: .96;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.85));
}
.cockpit-frame {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(3,4,7,.75) 0%, rgba(3,4,7,0) 10%, rgba(3,4,7,0) 90%, rgba(3,4,7,.75) 100%);
}

/* ============================================================
   菜单
   ============================================================ */
.menu {
  display: flex;
  background:
    linear-gradient(90deg, rgba(4,5,8,.94) 0%, rgba(4,5,8,.82) 30%, rgba(4,5,8,.15) 62%, rgba(4,5,8,.55) 100%),
    radial-gradient(80% 70% at 78% 55%, rgba(255,90,31,.05), rgba(0,0,0,0) 70%);
}
.menu-wrap {
  width: 100%; max-width: 1360px; margin: 0 auto; padding: 30px 46px 22px;
  display: flex; flex-direction: column; min-height: 100%;
}
.menu-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo i {
  width: 16px; height: 16px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 62% 100%, 0 100%);
  box-shadow: 0 0 22px rgba(255,90,31,.6);
}
.logo b { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; }
.logo span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--muted-2);
  padding-left: 12px; border-left: 1px solid var(--line);
}
.menu-nav { display: flex; gap: 26px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.menu-ver { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--muted-2); }

.menu-body {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  align-items: center; gap: 48px; padding: 26px 0 18px;
}
.menu-hero { max-width: 620px; }
.kicker {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .24em; color: var(--muted); text-transform: uppercase;
}
.kicker .bar { width: 26px; height: 1px; background: var(--accent); }

.menu-title { margin: 14px 0 0; font-family: var(--font-display); text-transform: uppercase; line-height: .82; }
.menu-title .outline {
  display: block; font-size: clamp(44px, 5.4vw, 76px); font-weight: 700; letter-spacing: .06em;
  color: transparent; -webkit-text-stroke: 1.6px rgba(255,255,255,.5);
}
.menu-title .grad {
  display: block; font-size: clamp(62px, 9.2vw, 132px); font-weight: 700; font-style: italic;
  letter-spacing: -.015em;
  background: linear-gradient(180deg, #ffc39a 0%, #ff7a3c 42%, #e8420f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 40px rgba(255,90,31,.25));
}
.menu-sub {
  margin: 16px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  color: var(--muted); text-transform: uppercase;
}
.menu-desc { margin: 16px 0 0; max-width: 460px; font-size: 14px; line-height: 1.85; color: #9aa0a8; }
.menu-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.menu-keys {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; padding-top: 18px;
  border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .12em; color: var(--muted);
}
.menu-keys kbd { margin-right: 4px; }
.menu-specs { display: flex; gap: 44px; margin-top: 22px; }
.menu-specs div { display: flex; flex-direction: column; gap: 3px; }
.menu-specs span { font-family: var(--font-mono); font-size: 8px; letter-spacing: .2em; color: var(--muted-2); }
.menu-specs b { font-family: var(--font-mono); font-size: 24px; font-weight: 600; line-height: 1; }
.menu-specs em { font-style: normal; font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; color: var(--muted-2); }

.menu-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,15,20,.78), rgba(6,8,11,.9));
  padding: 16px 18px 18px; backdrop-filter: blur(4px);
  position: relative;
}
.menu-card::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 48px; height: 1px; background: var(--accent);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; }
.card-head span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--muted); }
.card-head b { font-family: var(--font-display); font-size: 26px; letter-spacing: .04em; }
.card-sub { margin-top: 4px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; color: var(--muted-2); }
.card-stats { margin-top: 16px; display: grid; gap: 12px; }
.cs { display: grid; grid-template-columns: 38px 1fr 46px; align-items: center; gap: 10px; }
.cs span { font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.csbar { height: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.csbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffb27a); }
.cs b { font-family: var(--font-mono); font-size: 11px; text-align: right; color: var(--text); }
.card-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .12em; color: var(--muted);
}
.card-foot .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.menu-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--muted-2);
  overflow: hidden;
}
.ticker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.22); }

/* ============================================================
   结算
   ============================================================ */
.results {
  overflow: auto; display: block;
  background:
    radial-gradient(90% 60% at 12% 0%, rgba(255,90,31,.07) 0%, rgba(5,6,8,0) 60%),
    radial-gradient(70% 50% at 90% 10%, rgba(80,120,255,.045) 0%, rgba(5,6,8,0) 55%),
    var(--bg);
}
.res-wrap {
  width: 100%; max-width: 1200px; min-height: 100%; margin: 0 auto; padding: 40px 44px 30px;
  display: flex; flex-direction: column; justify-content: center;
}
.res-top {
  display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px;
  border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .22em; color: var(--muted); text-transform: uppercase;
}
.res-eyebrow { display: flex; align-items: center; gap: 10px; }
.res-eyebrow .tick { width: 14px; height: 1px; background: var(--accent); }
.res-status { display: flex; align-items: center; gap: 9px; }
.res-head { padding: 30px 0 6px; }
.res-title {
  margin: 0; font-family: var(--font-display); font-size: clamp(46px, 6.4vw, 88px);
  font-weight: 700; line-height: .92; letter-spacing: .005em; text-transform: uppercase; white-space: nowrap;
}
.res-title .pos { color: var(--accent); }
.res-sub { margin: 16px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); }

.res-grid {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 226px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-top: 26px; min-height: 330px;
}
.res-left { padding: 22px 24px 24px 0; border-right: 1px solid var(--line); }
.bigpos {
  font-family: var(--font-display); font-size: 92px; font-weight: 300; line-height: .8;
  letter-spacing: -.02em; margin-bottom: 10px;
}
.statlist { margin-top: 22px; }
.stat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-top: 1px solid rgba(255,255,255,.045);
}
.stat span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.stat b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.stat b em { font-style: normal; font-size: 8px; color: var(--muted); margin-left: 3px; }

.res-mid { padding: 22px 26px 24px; border-right: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-title {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em; color: #b9bec6; text-transform: uppercase;
}
.panel-title span { color: var(--muted-2); letter-spacing: .1em; margin-left: 6px; }
.panel-meta { font-family: var(--font-mono); font-size: 8px; letter-spacing: .2em; color: var(--muted-2); }

.standings { margin-top: 12px; }
.standing {
  display: grid; grid-template-columns: 52px 12px minmax(0,1fr) 64px 92px;
  align-items: center; gap: 10px; height: 40px;
  border-top: 1px solid rgba(255,255,255,.045);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  padding: 0 10px 0 0;
}
.standing .pos { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: .08em; }
.standing .dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.standing .name { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: #a9afb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standing .gap { text-align: right; font-size: 10px; }
.standing .time { text-align: right; color: var(--text); font-size: 11px; }
.standing.is-player {
  background: linear-gradient(90deg, rgba(255,90,31,.10), rgba(255,90,31,0) 70%);
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 10px; margin-left: -10px;
}
.standing.is-player .pos { color: var(--accent); }
.standing.is-player .name { color: var(--text); }

.res-right { padding: 22px 0 24px 24px; }
.stat-block {
  padding: 12px 0 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 7px;
}
.stat-block:first-child { border-top: 0; padding-top: 0; }
.stat-block span { font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; }
.stat-block b { font-family: var(--font-mono); font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.stat-block b.status { font-size: 20px; font-weight: 600; letter-spacing: .08em; color: var(--text); }
.stat-block b.gap { color: var(--accent); font-size: 27px; }

.res-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; }
.foot-links { display: flex; gap: 26px; }
.foot-actions { display: flex; gap: 10px; }

/* ============================================================
   暂停 / 触屏
   ============================================================ */
.pause {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(4,5,8,.72); backdrop-filter: blur(6px);
}
.pause-card {
  width: min(440px, 90vw); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(13,15,19,.96), rgba(7,8,11,.98)); padding: 28px 30px 26px;
}
.pause-card h2 { margin: 16px 0 8px; font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: .02em; }
.pause-card p { margin: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.pause-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pause-actions .btn { height: 40px; padding: 0 16px; font-size: 10px; }

.touch {
  position: fixed; inset: auto 0 0 0; z-index: 7; display: none; justify-content: space-between;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); pointer-events: none;
}
.touch button {
  pointer-events: auto; width: 74px; height: 74px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(10,12,16,.55); color: var(--text);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; backdrop-filter: blur(4px);
}
.touch button:active { background: rgba(255,90,31,.25); }
.touch-steer, .touch-pedal { display: flex; gap: 12px; align-items: flex-end; }
.touch-pedal .throttle { background: rgba(255,90,31,.18); border-color: rgba(255,90,31,.5); }
@media (pointer: coarse) { .touch { display: flex; } .hud-bar { display: none; } }

/* ============================================================
   自适应
   ============================================================ */
@media (max-width: 1080px) {
  .menu-wrap { padding: 24px 30px 18px; }
  .menu-body { grid-template-columns: minmax(0,1fr) 280px; gap: 30px; }
  .res-wrap { padding: 30px 30px 26px; }
  .res-grid { grid-template-columns: 210px minmax(0,1fr) 200px; }
  .bigpos { font-size: 76px; }
  .hud-speedo { width: 190px; height: 190px; }
  .speedo-read b { font-size: 38px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .menu { position: relative; min-height: 100%; }
  .menu-body { grid-template-columns: minmax(0,1fr); gap: 26px; padding: 20px 0; }
  .menu-body > * { min-width: 0; }
  .menu-card { max-width: 100%; }
  .menu-nav, .menu-ver { display: none; }
  .menu-specs { gap: 28px; }
  .res-title { white-space: normal; }
  .res-grid { grid-template-columns: 1fr; }
  .res-left, .res-mid { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 0; }
  .res-right { padding: 20px 0 0; }
  .res-foot { flex-direction: column; align-items: flex-start; }
  .res-wrap { padding: 22px 18px 24px; }
  .hud-tl { top: 14px; left: 16px; gap: 18px; }
  .gear-num { font-size: 40px; }
  .hud-tr { top: 12px; right: 14px; }
  .map-box { width: 132px; }
  .hud-speedo { width: 150px; height: 150px; right: 12px; bottom: 10px; }
  .speedo-read b { font-size: 30px; }
  .hud-tc { top: 12px; }
  .lap-line b { font-size: 18px; }
  .race-time { font-size: 12px; }
  .hud-hint { display: none; }
  .menu-title .grad { font-size: clamp(56px, 13vw, 96px); }
}
@media (max-width: 560px) {
  .hud-tl { gap: 12px; }
  .pos-box { width: 56px; }
  .hud-bar { width: 70vw; bottom: 14px; }
  .hud-tr { display: none; }
  .res-foot { gap: 16px; }
  .foot-actions { width: 100%; }
  .foot-actions .btn { flex: 1; justify-content: center; }
  .menu-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .standing { grid-template-columns: 44px 10px minmax(0,1fr) 54px 78px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .countdown, .toast { animation: none; }
}
