@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: url('assets/fonts/orbitron-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: url('assets/fonts/orbitron-latin-900-normal.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #05060c;
  --paper: #edf7ff;
  --muted: rgba(214, 232, 246, 0.5);
  --dim: rgba(214, 232, 246, 0.24);
  --cyan: #66f5ff;
  --cyan-soft: #2bc7dd;
  --pink: #ff2f80;
  --amber: #ffbe55;
  --red: #ff3e50;
  --lime: #b5ff4a;
  --glass: rgba(7, 11, 20, 0.62);
  --font-display: 'Orbitron', 'Bahnschrift', 'Segoe UI', sans-serif;
  --font-ui: 'Rajdhani', 'Bahnschrift SemiCondensed', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
html { background: var(--ink); }
body {
  overflow: hidden;
  color: var(--paper);
  background: #05060c;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: none;
}

button { font: inherit; color: inherit; border: 0; background: none; }
button:focus-visible { outline: 1px solid var(--cyan); outline-offset: 4px; }
canvas { display: block; }
.is-hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.mono { font-variant-numeric: tabular-nums; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #05060c;
}

.screen-shade {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,4,10,0.82) 0%, rgba(3,4,10,0.4) 34%, transparent 62%),
    linear-gradient(0deg, rgba(3,4,9,0.82) 0%, transparent 26%, transparent 72%, rgba(3,4,9,0.55) 100%);
  transition: opacity 0.8s ease;
}
body.is-racing .screen-shade { opacity: 0.38; }

.film-grain {
  position: fixed;
  inset: -50%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.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='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  animation: grainShift 0.28s steps(2) infinite;
}

@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2%, 1%, 0); }
  50% { transform: translate3d(1%, -2%, 0); }
  75% { transform: translate3d(-1%, -1%, 0); }
  100% { transform: translate3d(2%, 1%, 0); }
}

/* ───────────────────────────── boot ───────────────────────────── */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 56px);
  background:
    radial-gradient(ellipse at 50% 64%, rgba(27, 58, 78, 0.34), transparent 55%),
    #05060c;
  transition: opacity 1s ease, visibility 1s ease;
}
.boot-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(102,245,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102,245,255,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 55%, black, transparent 72%);
}
.boot-mark, .boot-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(229, 245, 255, 0.62);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
}
.boot-mark .dim { color: rgba(229, 245, 255, 0.28); }
.boot-center {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(520px, 78vw);
  text-align: center;
}
.micro-label {
  margin: 0;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.boot-title {
  margin: 14px 0 38px;
  font-family: var(--font-display);
  font-size: clamp(38px, 5.2vw, 74px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.14em;
  color: #f3fbff;
}
.boot-title em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px rgba(102, 245, 255, 0.8);
  text-shadow: 0 0 28px rgba(102, 245, 255, 0.22);
}
.boot-progress {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.boot-progress i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #fff);
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.28s ease;
}
.boot-status {
  margin: 14px 0 0;
  color: rgba(220, 240, 250, 0.42);
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.boot-foot { color: rgba(220, 240, 250, 0.32); }
.boot-screen.is-done { opacity: 0; visibility: hidden; }

/* ───────────────────────────── title ───────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}
.title-screen {
  overflow: hidden;
  padding: clamp(24px, 3.6vw, 54px);
}
.title-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 55%, transparent 0%, transparent 34%, rgba(3,4,10,0.24) 76%, rgba(3,4,10,0.6) 100%),
    linear-gradient(90deg, rgba(3,5,12,0.93) 0%, rgba(3,5,12,0.78) 26%, rgba(3,5,12,0.22) 56%, transparent 72%),
    linear-gradient(0deg, rgba(3,5,12,0.92) 0%, transparent 26%);
}
.title-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(105deg, transparent 0 196px, rgba(102,245,255,0.022) 196px 197px, transparent 197px 392px);
  mask-image: linear-gradient(90deg, black 0%, transparent 62%);
}
.title-top, .title-bottom, .title-main { position: absolute; z-index: 2; }
.title-top {
  top: clamp(24px, 3.6vw, 54px);
  left: clamp(24px, 3.6vw, 54px);
  right: clamp(24px, 3.6vw, 54px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  animation: fadeIn 0.9s 0.15s ease both;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(235, 249, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.brand-name { font-family: var(--font-display); font-size: 11px; }
.brand-div { color: var(--cyan); opacity: 0.6; }
.brand-sub { color: rgba(235, 249, 255, 0.3); font-size: 9px; }
.mark-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  transform: skewX(-22deg);
}
.mark-bars i {
  display: block;
  width: 4px;
  height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(102,245,255,0.6);
}
.mark-bars i:nth-child(2) { height: 15px; opacity: 0.65; }
.mark-bars i:nth-child(3) { height: 7px; opacity: 0.36; }
.venue {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(235, 249, 255, 0.65);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.18em;
  text-align: right;
}
.venue b { color: var(--cyan); font-weight: 500; }
.venue-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: blink 1.8s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.18; } }
.sound-btn {
  pointer-events: auto;
  margin-left: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.13);
  color: rgba(235, 249, 255, 0.5);
  font-size: 9px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: 0.25s ease;
  background: rgba(5, 9, 16, 0.42);
}
.sound-btn:hover { border-color: rgba(102,245,255,0.5); color: var(--cyan); }
.sound-btn.is-off { color: rgba(255,255,255,0.25); }

.title-main {
  left: clamp(24px, 7.2vw, 118px);
  top: 49%;
  width: min(670px, 56vw);
  transform: translateY(-50%);
  animation: riseIn 1.1s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(calc(-50% + 24px)); }
  to { opacity: 1; transform: translateY(-50%); }
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: rgba(235, 249, 255, 0.42);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.26em;
}
.eyebrow i { width: 20px; height: 1px; background: rgba(102,245,255,0.35); }
.eyebrow span:first-child { color: var(--cyan); }
.hero-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(64px, 9.4vw, 146px);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: 0.015em;
  white-space: nowrap;
}
.hero-line {
  display: block;
  color: rgba(241, 250, 255, 0.98);
  text-shadow: 0 18px 60px rgba(0,0,0,0.65);
}
.hero-accent {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: clamp(1px, 0.1vw, 2px) rgba(102, 245, 255, 0.9);
  text-shadow: 0 0 60px rgba(26, 208, 237, 0.12);
  transform: translateX(0.06em);
}
.title-slash {
  display: inline-block;
  width: clamp(6px, 0.7vw, 10px);
  height: clamp(50px, 7.2vw, 108px);
  margin-left: 0.22em;
  vertical-align: 0.02em;
  background: linear-gradient(180deg, var(--pink), rgba(255,47,128,0.1));
  box-shadow: 0 0 28px rgba(255, 47, 128, 0.4);
  transform: skewX(-20deg);
}
.cn-title {
  margin-top: 20px;
  font-family: var(--font-cn);
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: 0.34em;
  color: rgba(248, 253, 255, 0.88);
}
.cn-title span {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(235, 249, 255, 0.32);
}
.hero-copy {
  margin: 22px 0 0;
  color: rgba(220, 238, 247, 0.52);
  font-family: var(--font-cn);
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.1em;
}
.paint-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 26px;
}
.paint-row > .micro-label { flex: none; color: rgba(235,249,255,0.3); }
.paint-swatches { display: flex; gap: 16px; pointer-events: auto; }
.swatch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: rgba(235, 249, 255, 0.28);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  cursor: pointer;
  transition: color 0.25s ease;
}
.swatch i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sw);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.swatch:hover, .swatch.is-active { color: rgba(245, 253, 255, 0.88); }
.swatch.is-active i { transform: scale(1.28); box-shadow: 0 0 16px var(--sw), inset 0 0 0 3px rgba(0,0,0,0.3); }
.cta-row { display: flex; align-items: stretch; gap: 14px; margin-top: 34px; }
.cta {
  position: relative;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 218px;
  padding: 17px 28px 15px 24px;
  overflow: hidden;
  color: #041015;
  background: var(--cyan);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 0 0 rgba(102,245,255,0);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.42) 48%, transparent 64%);
  transform: translateX(-120%);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta:hover { background: #b9fbff; transform: translateY(-2px); box-shadow: 0 8px 38px rgba(102,245,255,0.25); }
.cta:hover::before { transform: translateX(120%); }
.cta-main { font-family: var(--font-cn); font-size: 16px; font-weight: 700; letter-spacing: 0.15em; }
.cta-main b { font-family: var(--font-ui); font-size: 20px; font-weight: 400; vertical-align: -1px; }
.cta-sub { font-size: 8px; font-weight: 700; letter-spacing: 0.2em; color: rgba(4,16,21,0.54); }
.cta.small { min-width: 200px; padding: 15px 24px; }
.cta.small .cta-main { font-size: 13px; }
.ghost-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 22px;
  border: 1px solid rgba(235, 249, 255, 0.16);
  color: rgba(235, 249, 255, 0.6);
  background: rgba(5, 9, 16, 0.3);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: 0.25s ease;
}
.ghost-btn span { color: var(--cyan); font-size: 16px; }
.ghost-btn:hover { border-color: rgba(102,245,255,0.5); color: var(--paper); background: rgba(102,245,255,0.06); }

.title-bottom {
  left: clamp(24px, 3.6vw, 54px);
  right: clamp(24px, 3.6vw, 54px);
  bottom: clamp(24px, 3.6vw, 50px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  animation: fadeIn 1.2s 0.6s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.spec-strip {
  display: flex;
  gap: clamp(20px, 3vw, 44px);
  padding-top: 14px;
  border-top: 1px solid rgba(235, 249, 255, 0.13);
}
.spec-strip div { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 5px; }
.spec-strip span { grid-column: 1 / -1; color: rgba(235,249,255,0.3); font-size: 8px; font-weight: 600; letter-spacing: 0.18em; }
.spec-strip b { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: 0.03em; color: rgba(241,250,255,0.84); }
.spec-strip small { font-size: 7px; color: rgba(235,249,255,0.32); letter-spacing: 0.1em; }
.title-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(235, 249, 255, 0.34);
  font-family: var(--font-cn);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.title-hint span { margin: 0 7px; color: rgba(235,249,255,0.13); }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(235,249,255,0.18);
  border-bottom-color: rgba(235,249,255,0.28);
  color: rgba(235,249,255,0.6);
  background: rgba(235,249,255,0.035);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* help */
.help-panel {
  position: absolute;
  z-index: 6;
  right: clamp(24px, 3.6vw, 54px);
  top: 104px;
  width: min(410px, calc(100vw - 48px));
  padding: 22px;
  pointer-events: auto;
  background: rgba(6, 10, 18, 0.9);
  border: 1px solid rgba(102,245,255,0.2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  backdrop-filter: blur(24px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  transform: translateY(0);
}
.help-panel.is-hidden { transform: translateY(-8px); }
.help-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.1); color: var(--cyan); font-size: 9px; font-weight: 600; letter-spacing: 0.2em; }
.help-head button { color: rgba(235,249,255,0.5); font-size: 20px; line-height: 1; cursor: pointer; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 20px 0 16px; }
.help-grid div { display: flex; align-items: center; gap: 6px; color: rgba(235,249,255,0.58); font-family: var(--font-cn); font-size: 10px; letter-spacing: 0.05em; }
.help-grid span { margin-left: auto; }
.help-panel > p { margin: 0; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); color: rgba(220,238,247,0.38); font-family: var(--font-cn); font-size: 10px; line-height: 1.8; }

/* ───────────────────────────── HUD ───────────────────────────── */
.hud {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
.hud-top {
  position: absolute;
  top: clamp(16px, 2.2vw, 30px);
  left: clamp(16px, 2.6vw, 38px);
  right: clamp(16px, 2.6vw, 38px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.hud-chip {
  position: relative;
  min-height: 58px;
  padding: 10px 14px 9px;
  background: linear-gradient(135deg, rgba(8, 14, 24, 0.76), rgba(5, 9, 16, 0.36));
  border: 1px solid rgba(208, 240, 255, 0.11);
  border-left: 2px solid rgba(102,245,255,0.5);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  backdrop-filter: blur(13px);
  min-width: 104px;
}
.hud-chip::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 26%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
  opacity: 0.65;
}
.hud-label { display: block; margin-bottom: 2px; color: rgba(221,240,250,0.35); font-size: 8px; font-weight: 600; letter-spacing: 0.2em; }
.pos-line { display: flex; align-items: baseline; gap: 4px; }
.pos-line b { font-family: var(--font-display); font-size: 26px; line-height: 1; font-weight: 700; color: #f3fbff; }
.pos-line em { font-size: 10px; font-style: normal; color: rgba(221,240,250,0.34); }
.lap-chip { min-width: 94px; }
.lap-dots { display: flex; gap: 4px; margin-top: 6px; }
.lap-dots i { width: 14px; height: 2px; background: rgba(255,255,255,0.13); }
.lap-dots i.is-on { background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.time-chip { min-width: 158px; }
.time-chip b { display: block; font-size: 19px; font-weight: 600; line-height: 1.15; color: rgba(245,253,255,0.94); letter-spacing: 0.06em; }
.lap-readout { display: block; margin-top: 4px; color: rgba(221,240,250,0.28); font-size: 7px; letter-spacing: 0.15em; }
.lap-readout b { display: inline; font-size: 9px; font-weight: 500; color: rgba(221,240,250,0.5); letter-spacing: 0.05em; }
.pause-btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 34px;
  height: 36px;
  margin-left: auto;
  border: 1px solid rgba(208, 240, 255, 0.14);
  background: rgba(5, 9, 16, 0.52);
  color: rgba(235, 249, 255, 0.5);
  cursor: pointer;
  backdrop-filter: blur(10px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.pause-btn i { display: block; width: 2px; height: 9px; background: currentColor; box-shadow: 4px 0 0 currentColor; margin-right: 4px; }
.pause-btn span { font-size: 5px; letter-spacing: 0.12em; }
.pause-btn:hover { color: var(--cyan); border-color: rgba(102,245,255,0.5); }
.minimap-wrap {
  position: relative;
  width: clamp(158px, 13vw, 210px);
  padding: 10px 10px 8px;
  justify-self: start;
  background: rgba(5, 9, 16, 0.5);
  border: 1px solid rgba(208, 240, 255, 0.13);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  backdrop-filter: blur(13px);
}
.minimap-head { display: flex; justify-content: space-between; align-items: center; padding: 0 1px 5px; font-size: 6px; letter-spacing: 0.13em; color: rgba(221,240,250,0.34); }
.minimap-head b { color: rgba(102,245,255,0.5); font-weight: 500; }
#minimap { width: 100%; aspect-ratio: 1; }
.minimap-scan {
  position: absolute;
  inset: 22px 8px 6px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(102,245,255,0.07) 48%, transparent 100%);
  height: 30%;
  animation: mapScan 4s linear infinite;
}
@keyframes mapScan { 0% { transform: translateY(-20%); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(280%); opacity: 0; } }

.hud-bottom {
  position: absolute;
  left: clamp(16px, 2.6vw, 38px);
  right: clamp(16px, 2.6vw, 38px);
  bottom: clamp(16px, 2.4vw, 32px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(18px, 3vw, 44px);
}
.speed-cluster {
  position: relative;
  width: clamp(168px, 15vw, 216px);
  height: clamp(168px, 15vw, 216px);
  justify-self: end;
  flex: none;
}
.speed-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 140deg, var(--cyan) 0deg var(--speed-arc, 0deg), rgba(238, 251, 255, 0.11) var(--speed-arc, 0deg) 260deg, transparent 260deg 360deg);
  filter: drop-shadow(0 0 9px rgba(102,245,255,0.22));
  transition: background 0.08s linear;
}
.speed-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.09);
}
.speed-ring-inner {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(102,245,255,0.08), transparent 55%),
    rgba(3, 7, 13, 0.77);
  backdrop-filter: blur(10px);
}
.speed-ticks {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 138deg, rgba(238,251,255,0.28) 0deg 0.6deg, transparent 0.6deg 7.2deg);
  mask-image: radial-gradient(circle, transparent 65%, black 66%, black 71%, transparent 72%);
  opacity: 0.42;
}
.speed-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
  text-align: center;
}
.speed-readout b {
  font-family: var(--font-display);
  font-size: clamp(45px, 4.4vw, 64px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: #f2fcff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(102,245,255,0.16);
}
.speed-readout span { margin-top: 7px; color: rgba(221,240,250,0.35); font-size: 8px; font-weight: 600; letter-spacing: 0.28em; padding-left: 0.28em; }
.gear-readout {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.gear-readout span { color: rgba(221,240,250,0.28); font-size: 6px; letter-spacing: 0.15em; }
.gear-readout b { color: var(--cyan); font-family: var(--font-display); font-size: 12px; font-weight: 700; }
.rpm-lights {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
}
.rpm-lights i { width: 8px; height: 2px; background: rgba(255,255,255,0.13); }
.rpm-lights i.is-hot { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.rpm-lights i.is-red { background: var(--pink); box-shadow: 0 0 8px var(--pink); }

.center-meta {
  width: min(430px, 34vw);
  max-width: 430px;
  justify-self: center;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.car-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(238,251,255,0.44);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.17em;
}
.car-tag b { color: rgba(238,251,255,0.9); font-family: var(--font-display); font-size: 9px; }
.car-tag em { margin-left: auto; font-style: normal; color: rgba(238,251,255,0.24); font-size: 7px; letter-spacing: 0.14em; }
.live-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 7px var(--pink); }
.nitro-wrap { width: 100%; }
.nitro-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; color: rgba(238,251,255,0.34); font-size: 7px; font-weight: 600; letter-spacing: 0.2em; }
.nitro-head b { color: var(--cyan); font-family: var(--font-display); font-size: 9px; font-weight: 700; letter-spacing: 0.03em; }
.nitro-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: rgba(238,251,255,0.1);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}
.nitro-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #1ba1bb, var(--cyan) 60%, #f4ffff);
  box-shadow: 0 0 14px rgba(102,245,255,0.5);
  transition: width 0.08s linear;
}
.nitro-track .nitro-sheen { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0,0,0,0.16) 0 1px, transparent 1px 16px); }
.controls-mini { display: flex; gap: 18px; align-items: flex-end; justify-content: center; margin-top: 2px; }
.controls-mini div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.controls-mini span { color: rgba(238,251,255,0.27); font-size: 6px; letter-spacing: 0.15em; }

.drift-tag {
  position: absolute;
  left: 50%;
  top: 24%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  transform: translate(-50%, 10px) skewX(-8deg);
  opacity: 0;
  background: linear-gradient(90deg, rgba(255,47,128,0.06), rgba(255,47,128,0.2), rgba(255,47,128,0.06));
  border-top: 1px solid rgba(255,47,128,0.55);
  border-bottom: 1px solid rgba(255,47,128,0.18);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.drift-tag.is-on { opacity: 1; transform: translate(-50%, 0) skewX(-8deg); }
.drift-tag span { color: var(--pink); font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; }
.drift-tag b { color: #fff; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.drift-tag em { color: rgba(255,255,255,0.42); font-style: normal; font-size: 7px; letter-spacing: 0.12em; }
.wrong-way {
  position: absolute;
  top: 19%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 18px rgba(255,62,80,0.4);
}
.wrong-way.is-on { opacity: 1; animation: wrongPulse 0.8s infinite alternate; }
.wrong-way span { font-family: var(--font-cn); font-size: 9px; letter-spacing: 0.24em; color: rgba(255,255,255,0.45); }
@keyframes wrongPulse { from { opacity: 0.55; } to { opacity: 1; } }

.toast {
  position: absolute;
  left: 50%;
  bottom: 25%;
  transform: translate(-50%, 14px);
  opacity: 0;
  padding: 10px 18px;
  color: rgba(240,252,255,0.88);
  border-left: 1px solid var(--cyan);
  background: linear-gradient(90deg, rgba(4,8,14,0.85), rgba(4,8,14,0.2));
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.15em;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.quality-tag {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  color: rgba(238,251,255,0.2);
  font-size: 6px;
  letter-spacing: 0.2em;
  pointer-events: none;
}

/* ───────────────────────────── countdown ───────────────────────────── */
.countdown {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, transparent 20%, rgba(3,5,10,0.22) 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.countdown.is-hidden { opacity: 0; visibility: hidden; }
.countdown-kicker { color: var(--cyan); font-size: 9px; font-weight: 600; letter-spacing: 0.42em; padding-left: 0.42em; }
.countdown-num {
  margin: -3px 0 -4px;
  font-family: var(--font-display);
  font-size: clamp(130px, 20vw, 280px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: #f3fcff;
  text-shadow: 0 0 65px rgba(102,245,255,0.28), 0 0 140px rgba(102,245,255,0.14);
}
.countdown-num.is-pulse { animation: countPulse 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
.countdown-num.is-go { color: var(--lime); text-shadow: 0 0 70px rgba(181,255,74,0.4), 0 0 150px rgba(181,255,74,0.2); }
@keyframes countPulse {
  0% { opacity: 0; transform: scale(1.55); filter: blur(9px); }
  22% { opacity: 1; transform: scale(0.98); filter: blur(0); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9); }
}
.countdown-sub { margin-top: 8px; color: rgba(238,251,255,0.38); font-family: var(--font-cn); font-size: 9px; letter-spacing: 0.32em; padding-left: 0.32em; }

/* ───────────────────────────── modals ───────────────────────────── */
.modal-screen {
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(4,7,13,0.2), rgba(2,4,8,0.74));
  backdrop-filter: blur(9px);
}
.modal-screen:not(.is-hidden) { pointer-events: auto; }
.modal-card {
  position: relative;
  width: min(560px, 94vw);
  padding: clamp(26px, 4vw, 46px);
  background:
    linear-gradient(135deg, rgba(102,245,255,0.035), transparent 30%),
    rgba(5, 9, 17, 0.92);
  border: 1px solid rgba(208,240,255,0.14);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
.pause-card { width: min(480px, 94vw); }
.pause-card h2, .result-card h2 {
  margin: 10px 0 12px;
  font-family: var(--font-cn);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.pause-card h2 span { display: block; margin-top: 7px; color: rgba(238,251,255,0.26); font-family: var(--font-ui); font-size: 10px; font-weight: 500; letter-spacing: 0.3em; }
.modal-copy { margin: 0 0 24px; color: rgba(221,240,250,0.42); font-family: var(--font-cn); font-size: 11px; line-height: 1.8; letter-spacing: 0.08em; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.modal-actions .ghost-btn { min-height: 48px; }
.modal-foot { margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.09); color: rgba(221,240,250,0.25); font-size: 8px; letter-spacing: 0.18em; }

.result-card { width: min(1040px, 95vw); max-height: calc(100vh - 48px); overflow-y: auto; }
.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.9fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
}
.result-main, .result-side { min-width: 0; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.result-head h2 { color: #f3fcff; }
.result-badge {
  min-width: 78px;
  padding: 10px 15px;
  text-align: right;
  border: 1px solid rgba(102,245,255,0.25);
  background: rgba(102,245,255,0.04);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.result-badge span { display: block; color: rgba(102,245,255,0.5); font-size: 6px; letter-spacing: 0.18em; }
.result-badge b { display: block; margin-top: 2px; color: var(--cyan); font-family: var(--font-display); font-size: 29px; font-weight: 900; line-height: 1; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 20px 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.result-grid div { padding: 12px 14px; background: rgba(4,8,14,0.86); }
.result-grid span { display: block; margin-bottom: 6px; color: rgba(221,240,250,0.3); font-size: 7px; letter-spacing: 0.13em; }
.result-grid b { font-family: var(--font-display); font-size: clamp(13px, 1.6vw, 18px); font-weight: 700; letter-spacing: 0.02em; color: rgba(245,253,255,0.9); }
.result-grid b small { font-size: 7px; color: rgba(221,240,250,0.35); }
.result-table { margin-bottom: 0; border-top: 1px solid rgba(255,255,255,0.1); }
.result-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 8px 3px; border-bottom: 1px solid rgba(255,255,255,0.06); color: rgba(221,240,250,0.4); font-size: 9px; letter-spacing: 0.08em; }
.result-row b { color: rgba(245,253,255,0.82); font-family: var(--font-ui); font-size: 11px; font-weight: 600; }
.result-row.is-player { background: linear-gradient(90deg, rgba(102,245,255,0.06), transparent); }
.result-row.is-player b { color: var(--cyan); }
.result-row i { font-style: normal; color: rgba(221,240,250,0.3); font-size: 8px; }
.result-actions { margin-top: 22px; }

/* Local best-time records */
.result-side {
  padding-left: clamp(18px, 2vw, 28px);
  border-left: 1px solid rgba(255,255,255,0.09);
}
.records-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.records-head h3 { margin: 5px 0 0; color: #f3fcff; font-family: var(--font-cn); font-size: 20px; font-weight: 700; letter-spacing: 0.1em; }
.records-head h3 span { display: block; margin-top: 3px; color: rgba(238,251,255,0.28); font-family: var(--font-ui); font-size: 7px; font-weight: 500; letter-spacing: 0.24em; }
.records-badge { padding: 5px 7px; color: var(--cyan); border: 1px solid rgba(102,245,255,0.24); font-size: 6px; font-weight: 600; letter-spacing: 0.16em; }
.record-entry.is-hidden, .record-saved.is-hidden { display: none; }
.record-entry {
  margin-top: 12px;
  padding: 11px 12px;
  background: linear-gradient(135deg, rgba(255,190,85,0.1), rgba(255,47,128,0.035));
  border: 1px solid rgba(255,190,85,0.3);
  border-left: 2px solid var(--amber);
}
.record-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--amber); font-size: 7px; font-weight: 700; letter-spacing: 0.16em; }
.record-entry-head b { color: var(--amber); font-family: var(--font-display); font-size: 16px; font-weight: 900; }
.record-entry-copy { margin: 6px 0 8px; color: rgba(245,245,235,0.58); font-family: var(--font-cn); font-size: 9px; line-height: 1.6; letter-spacing: 0.04em; }
.record-form { display: flex; gap: 6px; }
#recordName {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255,190,85,0.24);
  background: rgba(3,6,11,0.68);
  color: #f4fdff;
  font-family: var(--font-ui), var(--font-cn);
  font-size: 12px;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#recordName::placeholder { color: rgba(238,251,255,0.24); font-family: var(--font-cn); font-size: 9px; letter-spacing: 0.03em; }
#recordName:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(102,245,255,0.08); }
.record-save {
  height: 34px;
  padding: 0 12px;
  flex: none;
  color: #1a0e02;
  background: var(--amber);
  font-family: var(--font-cn);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: background 0.2s ease, transform 0.2s ease;
}
.record-save:hover { background: #ffe0a1; transform: translateY(-1px); }
.record-entry-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: rgba(238,251,255,0.38); font-size: 7px; letter-spacing: 0.08em; }
#recordError { color: var(--red); font-family: var(--font-cn); text-align: right; }
.record-saved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--cyan);
  border: 1px solid rgba(102,245,255,0.22);
  background: rgba(102,245,255,0.055);
  font-family: var(--font-cn);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.record-saved b { color: var(--cyan); font-family: var(--font-display); font-size: 16px; font-weight: 900; }
.leaderboard-columns { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; margin-top: 13px; padding: 0 7px 6px; color: rgba(221,240,250,0.24); font-size: 6px; letter-spacing: 0.16em; border-bottom: 1px solid rgba(255,255,255,0.09); }
.leaderboard-columns span:last-child { text-align: right; }
.leaderboard-list { display: flex; flex-direction: column; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 7px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  border-left: 2px solid transparent;
}
.leaderboard-row > b { color: rgba(221,240,250,0.3); font-family: var(--font-display); font-size: 9px; font-weight: 700; letter-spacing: 0.02em; }
.leaderboard-row .record-driver { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.leaderboard-row .record-driver strong { overflow: hidden; color: rgba(244,253,255,0.82); font-family: var(--font-cn); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-row .record-driver small { overflow: hidden; color: rgba(221,240,250,0.24); font-family: var(--font-ui); font-size: 6px; letter-spacing: 0.06em; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-row em { color: rgba(237,251,255,0.82); font-family: var(--font-display); font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-align: right; }
.leaderboard-row.is-new { background: linear-gradient(90deg, rgba(102,245,255,0.11), transparent); border-left-color: var(--cyan); }
.leaderboard-row.is-new > b, .leaderboard-row.is-new .record-driver strong, .leaderboard-row.is-new em { color: var(--cyan); }
.leaderboard-row.is-empty { opacity: 0.32; }
.records-foot { margin-top: 10px; color: rgba(221,240,250,0.22); font-size: 6px; letter-spacing: 0.13em; text-align: right; }

/* ───────────────────────────── touch ───────────────────────────── */
.touch-controls {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  display: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
body.is-touch .touch-controls { display: block; }
.touch-steer {
  position: absolute;
  left: 18px;
  bottom: 22px;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.touch-pedals {
  position: absolute;
  right: 18px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  pointer-events: auto;
}
.touch-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(238,251,255,0.18);
  border-radius: 50%;
  background: rgba(5,9,16,0.5);
  color: rgba(238,251,255,0.68);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.touch-btn.steer { font-size: 19px; }
.touch-btn.gas { width: 72px; height: 80px; border-color: rgba(102,245,255,0.36); color: var(--cyan); border-radius: 40px; }
.touch-btn.brake { width: 56px; height: 62px; border-radius: 30px; color: rgba(255,62,80,0.85); }
.touch-btn.drift { width: 50px; height: 50px; font-size: 7px; }
.touch-btn.nitro { width: 50px; height: 50px; color: var(--lime); font-size: 8px; }
.touch-btn.is-down { background: rgba(102,245,255,0.22); border-color: var(--cyan); transform: scale(0.95); }
.rotate-hint { display: none; }

/* ───────────────────────────── responsive ───────────────────────────── */
@media (max-width: 1100px) {
  .title-main { width: min(620px, 64vw); }
  .hero-title { font-size: clamp(58px, 9.8vw, 110px); }
  .controls-mini { display: none; }
  .center-meta { max-width: 300px; }
}
@media (pointer: coarse) {
  body.is-racing .hud-bottom {
    left: 14px;
    right: 14px;
    bottom: 84px;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  body.is-racing .speed-cluster {
    width: 98px;
    height: 98px;
    justify-self: end;
  }
  body.is-racing .minimap-wrap { width: 112px; padding: 7px 7px 6px; }
  body.is-racing .speed-readout b { font-size: 29px; }
  body.is-racing .speed-readout span { font-size: 5px; }
  body.is-racing .gear-readout { bottom: 14px; }
  body.is-racing .rpm-lights { bottom: 4px; }
  body.is-racing .speed-ticks { opacity: 0.28; }
  body.is-racing .center-meta { display: none; }
  body.is-racing .hud-top { top: 8px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .title-screen { padding: 12px 18px; }
  .title-top { top: 12px; left: 18px; right: 18px; }
  .brand { gap: 8px; font-size: 9px; }
  .brand-name { font-size: 9px; }
  .brand-sub, .brand-div { display: none; }
  .venue { font-size: 8px; gap: 7px; }
  .sound-btn { padding: 7px 8px; font-size: 7px; }
  .title-main { top: 51%; left: 22px; width: min(62vw, 560px); }
  .eyebrow { margin-bottom: 7px; font-size: 7px; gap: 8px; }
  .hero-title { font-size: clamp(38px, 10.5vw, 76px); line-height: 0.78; }
  .title-slash { height: 0.72em; }
  .cn-title { margin-top: 7px; font-size: 16px; letter-spacing: 0.26em; }
  .cn-title span { font-size: 8px; }
  .hero-copy { display: none; }
  .paint-row { margin-top: 9px; gap: 12px; }
  .paint-row > .micro-label { font-size: 7px; }
  .paint-swatches { gap: 11px; }
  .swatch { font-size: 7px; }
  .swatch span { display: none; }
  .swatch i { width: 12px; height: 12px; }
  .cta-row { margin-top: 10px; gap: 8px; }
  .cta { min-width: 160px; padding: 9px 16px; }
  .cta-main { font-size: 13px; }
  .cta-main b { font-size: 16px; }
  .cta-sub { font-size: 7px; }
  .ghost-btn { min-height: 54px; padding: 0 12px; font-size: 9px; gap: 8px; }
  .title-bottom { display: none; }
  .help-panel {
    top: 54px;
    right: 14px;
    width: min(360px, calc(100vw - 28px));
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 14px;
  }
  .help-grid { gap: 8px 14px; margin: 12px 0 10px; }
  .help-panel > p { font-size: 9px; }
  .modal-screen { padding: 8px; }
  .modal-card {
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: 18px 22px;
    width: min(760px, 96vw);
  }
  .pause-card { width: min(460px, 94vw); }
  .pause-card h2, .result-card h2 { font-size: 26px; margin: 6px 0 8px; }
  .modal-copy { margin-bottom: 12px; font-size: 9px; }
  .result-grid { grid-template-columns: 1fr 1fr; margin: 12px 0; }
  .result-grid div { padding: 8px 10px; }
  .result-grid span { margin-bottom: 3px; font-size: 6px; }
  .result-grid b { font-size: 13px; }
  .result-table { margin-bottom: 12px; }
  .result-row { padding: 5px 2px; }
  .result-row b, .result-row span { font-size: 9px; }
  .modal-actions .cta { min-width: 160px; }
  .modal-actions .ghost-btn { min-height: 44px; }
  .modal-foot { margin-top: 10px; padding-top: 8px; }
  .countdown-num { font-size: clamp(100px, 24vh, 170px); }
  .countdown-kicker { font-size: 7px; }
  .countdown-sub { font-size: 7px; }
  .touch-btn { width: 56px; height: 56px; }
  .touch-btn.gas { width: 68px; height: 72px; }
  .touch-btn.brake { width: 52px; height: 58px; }
  .touch-btn.drift, .touch-btn.nitro { width: 46px; height: 46px; }
  .touch-steer { left: 14px; bottom: 14px; }
  .touch-pedals { right: 14px; bottom: 14px; }
  body.is-racing .speed-cluster { width: 92px; height: 92px; }
  body.is-racing .speed-readout b { font-size: 27px; }
  .hud-top { top: 8px; }
  .hud-chip { min-height: 46px; padding: 6px 9px; }
  .pos-line b { font-size: 20px; }
  .time-chip b { font-size: 14px; }
  .minimap-wrap { width: 104px; }
}

@media (max-width: 820px) {
  .title-screen { padding: 18px; }
  .title-top { top: 18px; left: 18px; right: 18px; }
  .brand-sub, .brand-div { display: none; }
  .venue { font-size: 8px; }
  .sound-btn { margin-left: 2px; padding: 7px 8px; }
  .title-main { left: 20px; top: 48%; width: calc(100vw - 40px); }
  .hero-title { font-size: clamp(48px, 14.8vw, 92px); }
  .cn-title { margin-top: 12px; }
  .hero-copy { margin-top: 14px; font-size: 10px; line-height: 1.85; }
  .paint-row { margin-top: 18px; gap: 12px; }
  .swatch span { display: none; }
  .paint-swatches { gap: 12px; }
  .cta-row { margin-top: 22px; }
  .cta { min-width: 185px; padding: 13px 20px; }
  .title-bottom { left: 18px; right: 18px; bottom: 16px; }
  .spec-strip { gap: 16px; }
  .spec-strip b { font-size: 13px; }
  .title-hint { display: none; }
  .help-panel { top: 74px; right: 18px; }
  .hud-top { top: 10px; left: 10px; right: 10px; gap: 6px; }
  .hud-chip { min-height: 46px; padding: 7px 10px; min-width: 72px; }
  .pos-line b { font-size: 20px; }
  .time-chip { min-width: 120px; }
  .time-chip b { font-size: 14px; }
  .lap-readout { display: none; }
  .pause-btn { width: 30px; height: 32px; }
  .minimap-wrap { width: 92px; padding: 6px; }
  .hud-bottom { left: 12px; right: 12px; bottom: 12px; }
  .speed-cluster { width: 136px; height: 136px; }
  .speed-readout b { font-size: 38px; }
  .speed-readout span { font-size: 6px; }
  .gear-readout { bottom: 18px; }
  .center-meta { margin-bottom: 4px; gap: 8px; max-width: 210px; }
  .car-tag em { display: none; }
  .speed-ring-inner { inset: 7px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-card { max-height: 92vh; overflow-y: auto; }
}
@media (max-width: 560px) {
  .title-top .venue > span:not(.venue-dot) { display: none; }
  .hero-title { font-size: clamp(40px, 15vw, 74px); letter-spacing: 0; }
  .title-slash { height: 0.75em; }
  .eyebrow { font-size: 7px; gap: 7px; }
  .hero-copy br { display: none; }
  .title-bottom { display: none; }
  .cta { min-width: 158px; }
  .ghost-btn { padding: 0 14px; gap: 8px; }
  .minimap-wrap { width: 78px; }
  .minimap-head { display: none; }
  .hud-chip.time-chip { display: none; }
  .speed-cluster { width: 116px; height: 116px; }
  .speed-readout b { font-size: 33px; }
  .center-meta { max-width: 160px; }
  .car-tag { font-size: 7px; }
  .nitro-head { font-size: 6px; }
  .result-head { flex-direction: column; }
  .result-badge { display: none; }
  .modal-actions { flex-direction: column; }
  .modal-actions .ghost-btn { justify-content: center; }
  .touch-btn { width: 54px; height: 54px; }
  .touch-btn.gas { width: 64px; height: 72px; }
  .touch-btn.brake { width: 50px; height: 56px; }
}
@media (max-width: 900px) and (orientation: portrait) {
  #rotateHint.rotate-hint {
    display: block;
    position: fixed;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 8px 14px;
    color: rgba(238,251,255,0.55);
    background: rgba(3,6,12,0.72);
    border: 1px solid rgba(255,255,255,0.12);
    font-family: var(--font-cn);
    font-size: 9px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Short landscape phones: keep the title composition compact and playable. */
@media (max-height: 520px) and (orientation: landscape) {
  .title-top { top: 12px; left: 18px; right: 18px; }
  .brand-sub, .brand-div { display: none; }
  .venue { font-size: 8px; }
  .title-main { top: 51%; left: 22px; width: min(62vw, 560px); }
  .eyebrow { margin-bottom: 7px; font-size: 7px; }
  .hero-title { font-size: clamp(38px, 10.5vw, 76px); line-height: 0.78; }
  .hero-copy { display: none; }
  .cn-title { margin-top: 7px; font-size: 16px; letter-spacing: 0.26em; }
  .cn-title span { font-size: 8px; }
  .paint-row { margin-top: 9px; gap: 12px; }
  .paint-row > .micro-label { font-size: 7px; }
  .swatch { font-size: 7px; }
  .swatch span { display: none; }
  .swatch i { width: 12px; height: 12px; }
  .cta-row { margin-top: 10px; gap: 8px; }
  .cta { min-width: 160px; padding: 9px 16px; }
  .cta-main { font-size: 13px; }
  .cta-sub { font-size: 7px; }
  .ghost-btn { min-height: 54px; padding: 0 12px; font-size: 9px; }
  .title-bottom { display: none; }
  .help-panel { top: 54px; right: 14px; width: min(360px, calc(100vw - 28px)); max-height: calc(100vh - 66px); overflow-y: auto; padding: 14px; }
  .modal-card { max-height: calc(100vh - 16px); overflow-y: auto; padding: 18px 22px; }
  .pause-card h2, .result-card h2 { font-size: 26px; margin: 6px 0 8px; }
  .modal-copy { margin-bottom: 12px; }
  .result-grid { margin: 12px 0; }
  .result-grid div { padding: 8px 10px; }
  .result-grid span { margin-bottom: 3px; }
  .result-grid b { font-size: 13px; }
  .result-table { margin-bottom: 12px; }
  .result-row { padding: 5px 2px; }
  .modal-foot { margin-top: 10px; padding-top: 8px; }
  .countdown-num { font-size: clamp(100px, 24vh, 170px); }
  .touch-steer { left: 14px; bottom: 14px; }
  .touch-pedals { right: 14px; bottom: 14px; }
  .touch-btn { width: 56px; height: 56px; }
  .touch-btn.gas { width: 68px; height: 72px; }
  .touch-btn.brake { width: 52px; height: 58px; }
  .touch-btn.drift, .touch-btn.nitro { width: 46px; height: 46px; }
}

@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  body.is-racing .hud-bottom {
    left: 14px;
    right: 14px;
    bottom: 94px;
    gap: 12px;
  }
  body.is-racing .minimap-wrap { width: 100px; padding: 6px; }
  body.is-racing .speed-cluster { width: 88px; height: 88px; }
  body.is-racing .speed-readout b { font-size: 25px; }
  body.is-racing .speed-readout span { font-size: 4.5px; }
  body.is-racing .gear-readout { bottom: 12px; }
  body.is-racing .rpm-lights { bottom: 3px; }
  body.is-racing .minimap-head { font-size: 5px; }
}

@media (max-width: 780px) {
  .result-card { width: min(620px, 94vw); }
  .result-layout { grid-template-columns: 1fr; gap: 18px; }
  .result-side {
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.09);
  }
}
