:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --txt: #f1f5f9;
  --mut: #94a3b8;
  --red: #ef4444;
  --yel: #fbbf24;
  --grn: #22c55e;
  --acc: #38bdf8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--txt); font-family: "PingFang SC", "Noto Sans SC", sans-serif; overflow: hidden; }
#disclaimer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: #7f1d1d; color: #fecaca; text-align: center;
  font-size: 12px; font-weight: 700; padding: 6px 8px; letter-spacing: 0.5px;
}
#app { position: absolute; inset: 0; top: 28px; }
.page { height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
.topbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 23, 42, 0.94); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.topbar h2 { flex: 1; font-size: 16px; }
.back, .chip, .btn, .card-btn, .proj, .v-card, .opt, .gear, .handbrake, .lights button {
  border: 0; border-radius: 10px; color: var(--txt); background: var(--card);
}
.back { padding: 6px 10px; }
.disc-mini { font-size: 11px; color: #fecaca; }
.pad { padding: 14px; }
.hint, .sub { color: var(--mut); margin: 10px 0; }
.hero { padding: 28px 16px 8px; text-align: center; }
.hero h1 { font-size: 28px; color: var(--yel); }
.hero p { color: var(--mut); margin-top: 8px; line-height: 1.5; }
.name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.name-row input {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: #0b1220; color: var(--txt);
}
.btn { padding: 10px 14px; }
.btn.primary { background: #b45309; }
.btn.lg { width: 100%; padding: 14px; font-size: 18px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-btn, .v-card, .proj { padding: 14px; text-align: left; }
.mt { margin-top: 12px; }
.v-list { display: flex; flex-direction: column; gap: 10px; }
.v-card { display: flex; flex-direction: column; gap: 4px; }
.v-card.lock { opacity: 0.45; }
.v-card .tag { color: var(--yel); font-size: 12px; }
.weather-bar, .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { padding: 6px 10px; }
.chip.on { background: #0e7490; }
.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj.done { border: 1px solid var(--grn); }
.center { text-align: center; }
.score-big { font-size: 64px; color: var(--yel); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.q-stem { font-size: 16px; line-height: 1.5; margin: 10px 0; }
.opt { display: block; width: 100%; text-align: left; padding: 12px; margin: 8px 0; }
.opt.picked { outline: 2px solid var(--acc); }
.opt.right { background: #14532d; }
.opt.wrong { background: #7f1d1d; }
.explain { display: none; background: #0b1220; padding: 10px; border-radius: 8px; color: var(--mut); }
.wrong-item { background: var(--card); padding: 8px; border-radius: 8px; margin: 6px 0; text-align: left; }
.timer { color: var(--yel); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog { background: #1e293b; border-radius: 14px; padding: 16px; width: min(420px, 100%); }
.dialog.warn { border: 1px solid var(--red); }
.ad-box { height: 120px; background: #0b1220; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 10px 0; color: var(--mut); }
.drive { display: flex; flex-direction: column; height: 100%; }
.drive-top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #0b1220; }
.hud { flex: 1; font-size: 13px; }
.hud b { color: var(--yel); margin-right: 8px; }
.stage { flex: 1; position: relative; min-height: 180px; }
.stage canvas { width: 100%; height: 100%; display: block; background: #1a2330; }
.voice, .toast {
  position: absolute; left: 8px; right: 8px; text-align: center; pointer-events: none;
}
.voice { top: 8px; color: #fde68a; font-weight: 700; }
.toast { bottom: 8px; color: #fecaca; }
.dash { height: 210px; background: #111827; border-top: 2px solid #334155; flex-shrink: 0; }
.dash-inner { display: grid; grid-template-columns: 120px 1fr 90px 110px; gap: 6px; height: 100%; padding: 8px; }
.steer-wrap { display: flex; align-items: center; justify-content: center; }
.steer {
  width: 108px; height: 108px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #475569, #0f172a);
  border: 8px solid #94a3b8; display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.steer-mark { font-size: 11px; color: #cbd5e1; }
.pedals { display: flex; gap: 6px; align-items: stretch; }
.pedal {
  flex: 1; background: #1f2937; border-radius: 10px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  touch-action: none; user-select: none;
}
.pedal i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #22c55e; opacity: 0.35; }
.pedal.brake i { background: #ef4444; }
.pedal.clutch i { background: #38bdf8; }
.pedal.on { outline: 2px solid #fbbf24; }
.center-col { display: flex; flex-direction: column; gap: 6px; }
.handbrake { padding: 8px; }
.handbrake.on { background: #b91c1c; }
.gears { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gear { padding: 6px; font-size: 13px; }
.gear.active { background: #0369a1; }
.lights { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lights button { padding: 6px; font-size: 12px; }
.lights button.on { background: #ca8a04; color: #111; }
.lights button.blink { animation: blink 0.7s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.album { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stamp { padding: 10px 12px; background: #0b1220; border-radius: 8px; opacity: 0.4; }
.stamp.on { opacity: 1; border: 1px solid var(--yel); }
.skin-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); padding: 10px; border-radius: 10px; margin-bottom: 8px; }
.rank { margin: 0 0 12px 18px; color: var(--mut); }
@media (max-width: 420px) {
  .dash { height: 230px; }
  .dash-inner { grid-template-columns: 96px 1fr 78px 96px; }
  .steer { width: 92px; height: 92px; }
}
