@font-face {
  font-family: "Barlow Display";
  src: url("../vendor/display.woff2") format("woff2");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../vendor/body.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --night: #080b1b;
  --night-soft: #10172c;
  --cream: #fff7e6;
  --cream-dim: #e9ddc8;
  --amber: #ffd166;
  --amber-hot: #ffb347;
  --coral: #ff6b7a;
  --mint: #63f0c5;
  --violet: #a38bff;
  --sky: #65c8ff;
  --ink: #0b1224;
  --muted: rgba(255, 247, 230, .62);
  --line: rgba(255, 247, 230, .16);
  --glass: rgba(10, 15, 32, .62);
  --display: "Barlow Display", "Arial Narrow", Impact, sans-serif;
  --body: "DM Sans", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button, svg { flex-shrink: 0; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}
svg { display: block; }
::selection { background: var(--amber); color: var(--ink); }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 23px;
  padding: 0 6px;
  border: 1px solid rgba(255, 247, 230, .25);
  border-radius: 5px;
  background: rgba(255, 247, 230, .08);
  color: var(--cream);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .03em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .35);
}
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--night); color: var(--cream); padding: 30px; text-align: center;
}

#game { position: relative; width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; background: #1b1435; }
#world { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; touch-action: none; }

.world-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(4, 6, 16, .34) 100%),
    linear-gradient(180deg, rgba(7, 8, 22, .2), transparent 18%, transparent 78%, rgba(4, 7, 16, .42));
}
.film-grain {
  position: absolute; inset: -30%; z-index: 3; pointer-events: none; opacity: .055;
  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='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  animation: grainShift .7s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-1.5%, 1%, 0); }
  50% { transform: translate3d(1.5%, -1.5%, 0); }
  75% { transform: translate3d(-.7%, -1%, 0); }
  100% { transform: translate3d(1%, 1.5%, 0); }
}
.speed-lines {
  position: absolute; inset: -18%; z-index: 4; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg at 50% 54%,
    transparent 0deg 4.7deg,
    rgba(255, 247, 230, .12) 4.8deg 5.05deg,
    transparent 5.15deg 9.4deg);
  -webkit-mask-image: radial-gradient(circle at 50% 54%, transparent 0 18%, #000 55%, transparent 95%);
  mask-image: radial-gradient(circle at 50% 54%, transparent 0 18%, #000 55%, transparent 95%);
  mix-blend-mode: screen;
  transition: opacity .18s ease;
}
.speed-lines.on { opacity: .5; animation: speedRush .38s ease-in-out infinite alternate; }
@keyframes speedRush { from { transform: scale(1); } to { transform: scale(1.035) rotate(1.2deg); } }
.screen-flash {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 48%, rgba(255, 232, 169, .7), rgba(255, 168, 95, .12) 50%, transparent 75%);
}
.screen-flash.on { animation: flashPulse .38s ease-out; }
@keyframes flashPulse { 0% { opacity: 0; } 22% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- Header ---------- */
.menu-header {
  position: absolute; z-index: 18; inset: 0 0 auto 0;
  height: 96px; padding: 24px clamp(24px, 3.6vw, 54px);
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none; transition: opacity .35s ease, transform .35s ease;
}
.brand { display: flex; align-items: center; gap: 13px; pointer-events: none; }
.brand-mark {
  display: grid; place-items: center; width: 45px; height: 45px; color: var(--amber);
  filter: drop-shadow(0 0 16px rgba(255, 209, 102, .27));
}
.brand-mark svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.brand-type { display: flex; flex-direction: column; gap: 5px; }
.brand-type strong {
  font-family: var(--display); font-style: italic; font-size: 22px; line-height: .8;
  letter-spacing: .045em; font-weight: 800;
}
.brand-type small { font-size: 7px; font-weight: 700; letter-spacing: .28em; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 17px; pointer-events: auto; }
.header-divider { width: 1px; height: 17px; background: var(--line); }
.header-button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 1px;
  color: rgba(255, 247, 230, .72); font-size: 8px; font-weight: 700; letter-spacing: .14em;
  transition: color .2s ease, opacity .2s ease;
}
.header-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-button:hover { color: var(--amber); }
.header-button[aria-pressed="false"] { color: var(--coral); }
body.racing .menu-header { opacity: 0; transform: translateY(-12px); pointer-events: none; }
body.menu-mode .menu-header { opacity: 1; transform: none; }

/* ---------- Menu ---------- */
.menu-screen {
  position: absolute; inset: 0; z-index: 10; pointer-events: none;
  transition: opacity .55s ease, visibility .55s;
}
.menu-screen::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 21, .91) 0%, rgba(5, 8, 21, .77) 30%, rgba(5, 8, 21, .28) 60%, transparent 82%),
    linear-gradient(180deg, rgba(5, 8, 21, .54) 0%, transparent 25%, transparent 68%, rgba(4, 7, 18, .72) 100%);
}
.menu-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.menu-copy {
  position: absolute; left: clamp(28px, 6.6vw, 108px); top: 50%;
  width: min(660px, 52vw); transform: translateY(-48%);
  pointer-events: none;
}
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  color: var(--cream-dim); font-size: 9px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
}
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(99, 240, 197, .8); }
.eyebrow span { opacity: .45; margin: 0 3px; }
.menu-title {
  margin: 18px 0 16px; font-family: var(--display); font-weight: 800; font-style: italic;
  line-height: .68; letter-spacing: -.035em; text-transform: uppercase;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .28));
}
.menu-title > span { display: block; transform-origin: 0 70%; animation: titleRise .9s cubic-bezier(.19, 1, .22, 1) both; }
.title-top { font-size: clamp(76px, 10.2vw, 156px); color: var(--cream); letter-spacing: .01em; }
.title-bottom {
  font-size: clamp(105px, 14.3vw, 214px); line-height: .72;
  background: linear-gradient(100deg, var(--amber) 4%, var(--amber-hot) 42%, var(--coral) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation-delay: .08s;
}
.title-dot { color: var(--mint); -webkit-text-fill-color: var(--mint); text-shadow: 0 0 22px rgba(99, 240, 197, .45); }
@keyframes titleRise {
  from { opacity: 0; transform: translateY(38px) skewY(3deg); }
  to { opacity: 1; transform: none; }
}
.tagline {
  margin: 19px 0 24px; color: rgba(255, 247, 230, .72);
  font-size: clamp(15px, 1.25vw, 19px); line-height: 1.55; font-weight: 400;
  letter-spacing: .005em;
}
.tagline strong { color: var(--cream); font-weight: 600; }
.start-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; pointer-events: auto; }
.start-button {
  position: relative; display: inline-flex; align-items: center; justify-content:space-between; gap: 24px;
  min-width: 254px; height: 66px; padding: 0 8px 0 24px; border-radius: 9px;
  background: linear-gradient(105deg, #9e5a33, #6e3029);
  color: var(--cream); box-shadow: 0 12px 34px rgba(84, 36, 24, .3), inset 0 1px 0 rgba(255, 220, 173, .28);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  overflow: hidden;
}
.start-button::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 239, 210, .15), transparent);
  transition: transform .55s ease;
}
.start-button:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(84, 36, 24, .4); filter:brightness(1.1); }
.start-button:focus-visible { outline:2px solid var(--cream); outline-offset:4px; }
.start-button:hover::before { transform: translateX(120%) skewX(-22deg); }
.start-button:active { transform: translateY(0); }
.start-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.start-label small { font-size: 7px; font-weight: 800; letter-spacing: .22em; color:var(--cream); }
.start-arrow {
  display: grid; place-items: center; width: 50px; height: 50px; margin-left:auto; flex-shrink:0; border-radius: 7px;
  background: #251916; color: var(--cream);
}
.start-arrow svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.start-hint { color: rgba(255, 247, 230, .48); font-size: 9px; letter-spacing: .08em; }
.start-hint kbd { margin-left: 5px; }
.circuit-button {
  display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 14px 0 10px;
  border: 1px solid rgba(255, 247, 230, .16); border-radius: 8px;
  background: rgba(10, 16, 34, .52); backdrop-filter: blur(12px); text-align: left;
  transition: border-color .2s, background .2s, transform .2s;
}
.circuit-button:hover { border-color: rgba(255, 209, 102, .48); background: rgba(26, 24, 39, .7); transform: translateY(-2px); }
.circuit-button-index {
  display: grid; place-items: center; width: 31px; height: 31px; border-radius: 6px;
  background: rgba(255, 209, 102, .13); color: var(--amber);
  font-family: var(--display); font-style: italic; font-size: 16px; line-height: 1;
}
.circuit-button-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.circuit-button-copy small { color: rgba(255, 247, 230, .4); font-size: 6px; font-weight: 800; letter-spacing: .2em; }
.circuit-button-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--cream); }
.circuit-button > svg { width: 14px; height: 14px; fill: none; stroke: rgba(255, 247, 230, .45); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.inspect-hint {
  position: absolute; right: clamp(30px, 4.6vw, 68px); bottom: clamp(22px, 3.2vh, 36px);
  display: flex; align-items: center; gap: 9px; color: rgba(255, 247, 230, .36);
  font-size: 6.5px; font-weight: 700; letter-spacing: .18em; pointer-events: none;
}
.inspect-hint i { width: 17px; height: 1px; background: currentColor; opacity: .5; }
.inspect-icon { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(255, 247, 230, .2); border-radius: 50%; }
.inspect-icon svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
body.racing .inspect-hint, body.results-mode .inspect-hint { opacity: 0; }
body.menu-mode #world { cursor: grab; }
body.menu-mode #world:active { cursor: grabbing; }
#world { touch-action: none; }
.menu-stats { display: flex; align-items: stretch; gap: 0; margin-top: 31px; }
.menu-stats > div {
  display: flex; flex-direction: column; gap: 2px; min-width: 92px; padding: 0 21px;
  border-left: 1px solid var(--line);
}
.menu-stats > div:first-child { padding-left: 0; border-left: 0; }
.menu-stats strong { font-family: var(--display); font-style: italic; font-size: 20px; letter-spacing: .03em; line-height: 1; color: var(--cream); }
.menu-stats span { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .19em; }
.controls-strip {
  display: flex; align-items: center; gap: 23px; width: fit-content;
  margin-top: 30px; padding: 12px 16px; border: 1px solid rgba(255, 247, 230, .1);
  border-radius: 10px; background: rgba(6, 11, 25, .26); backdrop-filter: blur(10px);
}
.controls-strip > div { display: flex; align-items: center; gap: 8px; }
.controls-strip small { color: rgba(255, 247, 230, .48); font-size: 7px; font-weight: 700; letter-spacing: .15em; }
.controls-strip kbd { height: 20px; min-width: 20px; font-size: 8px; }
.controls-strip kbd.wide { padding: 0 9px; font-size: 7px; letter-spacing: .08em; }
.key-pair { display: flex; gap: 3px; }
.track-sticker {
  position: absolute; right: clamp(30px, 4.6vw, 68px); bottom: clamp(62px, 9vh, 104px);
  width: 274px; padding: 17px 18px 16px;
  border: 1px solid rgba(255, 247, 230, .16); border-radius: 13px;
  background: linear-gradient(155deg, rgba(13, 19, 42, .74), rgba(8, 11, 25, .5));
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
  transform: rotate(1.2deg); pointer-events: none;
}
.sticker-top, .sticker-foot { display: flex; align-items: center; justify-content: space-between; color: rgba(255, 247, 230, .46); font-size: 6.5px; font-weight: 700; letter-spacing: .17em; }
.sticker-map { width: 100%; height: 108px; margin: 8px 0 2px; overflow: visible; }
.sticker-map path { fill: none; stroke: rgba(255, 247, 230, .25); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.sticker-map .map-inner { stroke: rgba(99, 240, 197, .8); stroke-width: 1.5; }
.sticker-map circle { fill: var(--amber); stroke: rgba(8, 11, 27, .8); stroke-width: 2; }
.sticker-title { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.sticker-title span { color: var(--mint); font-size: 6.5px; font-weight: 700; letter-spacing: .2em; }
.sticker-title strong { font-family: var(--display); font-style: italic; font-size: 26px; line-height: 1; letter-spacing: -.01em; color: var(--cream); }
.sticker-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.difficulty { display: flex; gap: 3px; }
.difficulty i { width: 4px; height: 8px; background: rgba(255, 247, 230, .2); transform: skew(-18deg); }
.difficulty i.on { background: var(--coral); }
.menu-side-note {
  position: absolute; right: 29px; top: 48%; display: flex; align-items: center; gap: 10px;
  transform: rotate(90deg) translateX(50%); transform-origin: right center;
  color: rgba(255, 247, 230, .33); font-size: 6px; font-weight: 700; letter-spacing: .2em;
}
.menu-side-note i { width: 30px; height: 1px; background: currentColor; }
.menu-footer {
  position: absolute; left: clamp(28px, 3.6vw, 54px); right: clamp(28px, 3.6vw, 54px); bottom: 24px;
  display: flex; justify-content: space-between; color: rgba(255, 247, 230, .3);
  font-size: 7px; font-weight: 700; letter-spacing: .18em;
}
body.results-mode .menu-screen, body.racing .menu-screen { opacity: 0; visibility: hidden; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.hud-kicker { color: rgba(255, 247, 230, .55); font-size: 7px; font-weight: 700; letter-spacing: .22em; }
.hud-position {
  position: absolute; left: clamp(20px, 2.6vw, 38px); top: clamp(20px, 3.3vh, 32px);
  display: flex; flex-direction: column; gap: 1px; padding: 12px 16px 13px;
  min-width: 136px; border: 1px solid rgba(255, 247, 230, .14); border-radius: 13px;
  background: linear-gradient(145deg, rgba(8, 13, 31, .8), rgba(8, 13, 31, .32));
  backdrop-filter: blur(13px); box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.hud-position strong {
  font-family: var(--display); font-style: italic; font-size: 57px; line-height: .78;
  letter-spacing: -.025em; color: var(--cream);
}
.hud-position strong em { font-size: 18px; font-style: normal; font-family: var(--body); color: rgba(255, 247, 230, .42); letter-spacing: 0; margin-left: 4px; }
.position-bar { display: flex; gap: 3px; margin-top: 8px; }
.position-bar i { display: block; width: 13px; height: 3px; border-radius: 3px; background: rgba(255, 247, 230, .14); }
.position-bar i.on { background: var(--mint); box-shadow: 0 0 9px rgba(99, 240, 197, .4); }
.hud-lap {
  position: absolute; left: clamp(20px, 2.6vw, 38px); top: clamp(133px, 16.5vh, 155px);
  display: flex; flex-direction: column; gap: 1px; padding: 9px 16px 11px;
  min-width: 136px; border: 1px solid rgba(255, 247, 230, .1); border-radius: 13px;
  background: rgba(8, 13, 31, .46); backdrop-filter: blur(12px);
}
.hud-lap strong { font-family: var(--display); font-style: italic; font-size: 34px; line-height: .85; }
.hud-lap strong em { font-family: var(--body); font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); }
.lap-pips { display: flex; gap: 4px; margin-top: 7px; }
.lap-pips i { width: 26px; height: 3px; border-radius: 3px; background: rgba(255, 247, 230, .16); }
.lap-pips i.on { background: var(--amber); box-shadow: 0 0 10px rgba(255, 209, 102, .35); }
.hud-timer {
  position: absolute; top: clamp(20px, 3vh, 30px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 30px 9px; min-width: 190px;
  border: 1px solid rgba(255, 247, 230, .12); border-radius: 999px;
  background: rgba(8, 13, 31, .58); backdrop-filter: blur(13px);
}
.hud-timer strong { font-size: 17px; font-weight: 500; letter-spacing: .09em; font-variant-numeric: tabular-nums; color: var(--cream); }
.pause-button {
  position: absolute; top: clamp(25px, 3.8vh, 38px); left: calc(50% + 150px);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 247, 230, .17); background: rgba(8, 13, 31, .55);
  color: rgba(255, 247, 230, .75); backdrop-filter: blur(10px); pointer-events: auto;
  transition: background .2s, color .2s, transform .2s;
}
.pause-button:hover { background: rgba(255, 209, 102, .16); color: var(--amber); transform: scale(1.05); }
.pause-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hud-map {
  position: absolute; right: clamp(20px, 2.6vw, 38px); top: clamp(20px, 3.3vh, 32px);
  width: clamp(190px, 16vw, 245px); padding: 11px 12px 9px;
  border: 1px solid rgba(255, 247, 230, .13); border-radius: 13px;
  background: linear-gradient(145deg, rgba(8, 13, 31, .76), rgba(8, 13, 31, .3));
  backdrop-filter: blur(13px);
}
.map-head, .map-foot { display: flex; align-items: center; justify-content: space-between; color: rgba(255, 247, 230, .45); font-size: 6px; font-weight: 700; letter-spacing: .17em; }
.map-status { display: inline-flex; align-items: center; gap: 5px; color: var(--mint); }
.map-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(99, 240, 197, .9); animation: liveBlink 1.5s ease infinite; }
@keyframes liveBlink { 0%, 62%, 100% { opacity: 1; } 72% { opacity: .28; } 82% { opacity: 1; } }
#minimap { display: block; width: 100%; height: auto; margin: 3px 0 2px; }
.map-foot { border-top: 1px solid rgba(255, 247, 230, .09); padding-top: 7px; }
.map-you { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); margin-right: 4px; box-shadow: 0 0 7px rgba(255, 209, 102, .8); }
.item-slot {
  position: absolute; left: clamp(20px, 2.6vw, 38px); bottom: clamp(24px, 3.5vh, 38px);
  display: flex; align-items: center; gap: 11px; min-width: 178px; padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 247, 230, .12); border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 13, 31, .72), rgba(8, 13, 31, .32));
  backdrop-filter: blur(13px); transition: border-color .25s, background .25s, transform .25s;
}
.item-slot.has-item { border-color: rgba(255, 209, 102, .46); background: linear-gradient(145deg, rgba(44, 34, 20, .74), rgba(8, 13, 31, .38)); }
.item-slot.pop { animation: itemPop .42s cubic-bezier(.2, 1.5, .3, 1); }
@keyframes itemPop { 0% { transform: scale(.86); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
.item-key { display: grid; place-items: center; width: 34px; height: 46px; border-right: 1px solid var(--line); }
.item-key kbd { width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 247, 230, .1); font-size: 10px; }
.item-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; background: rgba(255, 247, 230, .06); color: rgba(255, 247, 230, .35); }
.item-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.item-slot.has-item .item-icon { color: var(--amber); background: rgba(255, 209, 102, .13); box-shadow: inset 0 0 14px rgba(255, 209, 102, .1); }
.item-slot.shield .item-icon { color: var(--mint); background: rgba(99, 240, 197, .12); }
.item-slot.pulse .item-icon { color: var(--coral); background: rgba(255, 107, 122, .12); }
.item-slot.spike .item-icon { color: #ff9f43; background: rgba(255, 159, 67, .12); }
.item-slot.oil .item-icon { color: #a38bff; background: rgba(163, 139, 255, .12); }
.item-slot.repair .item-icon { color: #65c8ff; background: rgba(101, 200, 255, .12); }
.item-copy { display: flex; flex-direction: column; gap: 3px; }
.item-copy span { color: rgba(255, 247, 230, .42); font-size: 6px; font-weight: 700; letter-spacing: .22em; }
.item-copy strong { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: rgba(255, 247, 230, .75); white-space: nowrap; }
.item-slot.has-item .item-copy strong { color: var(--cream); }
.drift-widget {
  position: absolute; left: 50%; bottom: clamp(27px, 3.7vh, 40px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid rgba(255, 247, 230, .1); background: rgba(8, 13, 31, .4);
  backdrop-filter: blur(10px); opacity: .55; transition: opacity .2s, border-color .2s, box-shadow .2s;
}
.drift-widget.active { opacity: 1; border-color: rgba(255, 209, 102, .38); box-shadow: 0 0 24px rgba(255, 209, 102, .08); }
.drift-name { color: var(--muted); font-size: 6px; font-weight: 800; letter-spacing: .2em; }
.drift-pips { display: flex; gap: 3px; }
.drift-pips i { width: 20px; height: 4px; border-radius: 3px; background: rgba(255, 247, 230, .15); transition: background .12s, box-shadow .12s; }
.drift-pips i.on { background: var(--mint); box-shadow: 0 0 8px rgba(99, 240, 197, .55); }
.drift-pips i.hot { background: var(--amber); box-shadow: 0 0 9px rgba(255, 209, 102, .6); }
.drift-pips i.max { background: var(--coral); box-shadow: 0 0 11px rgba(255, 107, 122, .7); }
.drift-widget small { color: rgba(255, 247, 230, .42); font-size: 6px; font-weight: 700; letter-spacing: .13em; }
.drift-widget.active small { color: rgba(255, 247, 230, .68); }
.damage-widget {
  position: absolute; left: clamp(20px, 2.6vw, 38px); top: clamp(226px, 27vh, 268px);
  width: clamp(136px, 11vw, 166px); padding: 8px 11px 9px;
  border: 1px solid rgba(255, 247, 230, .1); border-radius: 11px;
  background: rgba(8, 13, 31, .46); backdrop-filter: blur(12px);
  transition: border-color .25s, box-shadow .25s;
}
.damage-head { display: flex; align-items: baseline; justify-content: space-between; }
.damage-head span { color: rgba(255, 247, 230, .42); font-size: 6px; font-weight: 800; letter-spacing: .2em; }
.damage-head strong { color: var(--mint); font-family: var(--display); font-style: italic; font-size: 14px; line-height: .9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.damage-track { height: 4px; margin: 6px 0 5px; overflow: hidden; border-radius: 3px; background: rgba(255, 247, 230, .12); }
.damage-track i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--mint); box-shadow: 0 0 9px rgba(99, 240, 197, .5); transform-origin: left center; transition: transform .18s ease, background .25s; }
.damage-widget small { color: rgba(255, 247, 230, .42); font-size: 5.5px; font-weight: 800; letter-spacing: .18em; }
.damage-widget.worn .damage-head strong { color: var(--amber); }
.damage-widget.worn .damage-track i { background: var(--amber); box-shadow: 0 0 9px rgba(255, 209, 102, .5); }
.damage-widget.critical { border-color: rgba(255, 107, 122, .46); box-shadow: 0 0 20px rgba(255, 107, 122, .1); }
.damage-widget.critical .damage-head strong, .damage-widget.critical small { color: var(--coral); }
.damage-widget.critical .damage-track i { background: var(--coral); box-shadow: 0 0 11px rgba(255, 107, 122, .7); animation: damagePulse .7s ease-in-out infinite alternate; }
@keyframes damagePulse { from { opacity: .55; } to { opacity: 1; } }
.speed-panel { position: absolute; right: clamp(22px, 3vw, 44px); bottom: clamp(18px, 3vh, 34px); width: clamp(122px, 10.5vw, 152px); aspect-ratio: 1; }
.speed-gauge { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; filter: drop-shadow(0 0 13px rgba(255, 209, 102, .1)); }
.gauge-base { fill: none; stroke: rgba(255, 247, 230, .12); stroke-width: 5; }
.gauge-ring { fill: none; stroke: var(--amber); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 270.18; stroke-dashoffset: 270.18; }
.speed-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.speed-read strong { font-family: var(--display); font-style: italic; font-size: clamp(33px, 3.7vw, 50px); line-height: .8; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.speed-read span { color: rgba(255, 247, 230, .42); font-size: 6px; font-weight: 700; letter-spacing: .18em; }
.race-callout {
  position: absolute; left: 50%; top: 22%; transform: translate(-50%, 20px); text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 4;
}
.race-callout.show { animation: calloutShow 1.5s cubic-bezier(.16, 1, .3, 1) both; visibility: visible; }
@keyframes calloutShow {
  0% { opacity: 0; transform: translate(-50%, 26px) scale(.92); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -2px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -13px) scale(1.01); }
}
.race-callout strong { display: block; font-family: var(--display); font-style: italic; font-size: clamp(46px, 6vw, 84px); line-height: .8; letter-spacing: -.02em; text-transform: uppercase; color: var(--cream); text-shadow: 0 8px 28px rgba(0, 0, 0, .32); }
.race-callout small { display: block; margin-top: 8px; color: var(--amber); font-size: 8px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
.race-callout.turbo strong { color: var(--amber); }
.race-callout.final strong { color: var(--coral); }
.race-callout.finish strong { color: var(--mint); }
.toast {
  position: absolute; left: 50%; bottom: clamp(95px, 13vh, 128px); transform: translate(-50%, 8px);
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
  border: 1px solid rgba(255, 247, 230, .14); border-radius: 999px;
  background: rgba(7, 11, 26, .7); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transition: opacity .22s, transform .22s, visibility .22s; white-space: nowrap;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 209, 102, .15); color: var(--amber); }
.toast-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast strong { font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.toast small { color: var(--muted); font-size: 8px; }
.countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; visibility: hidden; z-index: 6;
}
.countdown.show { opacity: 1; visibility: visible; }
.countdown span {
  font-family: var(--display); font-style: italic; font-size: clamp(150px, 23vw, 290px);
  font-weight: 800; line-height: .7; letter-spacing: -.05em; color: var(--cream);
  text-shadow: 0 15px 50px rgba(0, 0, 0, .35), 0 0 70px rgba(255, 209, 102, .18);
}
.countdown span.go { color: var(--mint); text-shadow: 0 15px 50px rgba(0, 0, 0, .35), 0 0 70px rgba(99, 240, 197, .3); }
.countdown.pop span { animation: countPop .5s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes countPop { 0% { opacity: 0; transform: scale(1.38); } 30% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }

/* ---------- Touch controls ---------- */
.touch-controls { display: none; position: absolute; inset: auto 0 0 0; height: 210px; pointer-events: none; z-index: 3; }
.touch-cluster { position: absolute; bottom: 24px; display: flex; gap: 13px; pointer-events: auto; align-items: flex-end; }
.touch-left { left: 22px; }
.touch-right { right: 20px; gap: 9px; }
.touch-btn {
  display: grid; place-items: center; width: 61px; height: 61px; border-radius: 50%;
  border: 1px solid rgba(255, 247, 230, .23); background: rgba(8, 13, 31, .46);
  color: var(--cream); backdrop-filter: blur(8px); touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn:active, .touch-btn.pressed { background: rgba(255, 209, 102, .23); border-color: rgba(255, 209, 102, .6); }
.touch-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.touch-btn.go { width: 76px; height: 76px; border-color: rgba(255, 209, 102, .5); background: rgba(255, 209, 102, .17); color: var(--amber); }
.touch-btn.go svg { width: 29px; height: 29px; fill: currentColor; stroke-width: 0; }
.touch-mini { display: flex; flex-direction: column; gap: 7px; }
.touch-btn.mini { width: 52px; height: 27px; border-radius: 8px; font-size: 6px; font-weight: 800; letter-spacing: .12em; }
.touch-btn.mini.brake { color: var(--coral); border-color: rgba(255, 107, 122, .3); }
@media (pointer: coarse) {
  .touch-controls { display: flex; }
  .pause-button { top: 18px; }
}
@media (pointer: coarse) and (max-height: 560px) {
  .touch-controls { height: 160px; }
  .touch-btn { width: 52px; height: 52px; }
  .touch-btn.go { width: 64px; height: 64px; }
}

/* ---------- Sheets ---------- */
.sheet-layer {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 26px;
  background: radial-gradient(ellipse at 50% 25%, rgba(34, 31, 69, .58), rgba(3, 5, 14, .82) 70%);
  backdrop-filter: blur(11px);
}
.sheet-layer[hidden] { display: none !important; }
.pause-card {
  position: relative; width: min(540px, 92vw); padding: 38px 40px 30px;
  border: 1px solid rgba(255, 247, 230, .15); border-radius: 20px;
  background: linear-gradient(150deg, rgba(18, 24, 49, .95), rgba(7, 10, 25, .92));
  box-shadow: 0 32px 90px rgba(0, 0, 0, .4); text-align: center;
  animation: sheetIn .35s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.pause-card .eyebrow { justify-content: center; }
.pause-card h2 { margin: 13px 0 7px; font-family: var(--display); font-style: italic; font-size: 74px; line-height: .8; letter-spacing: -.03em; }
.pause-card h2 span { color: var(--amber); }
.pause-card p { margin: 0 0 27px; color: var(--muted); font-size: 11px; }
.pause-actions { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.primary-action, .secondary-action, .text-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 49px; padding: 0 22px; border-radius: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; transition: transform .2s, background .2s, border-color .2s;
}
.primary-action { width: min(300px, 100%); background: var(--amber); color: var(--ink); box-shadow: 0 10px 30px rgba(255, 185, 68, .17); }
.primary-action:hover { transform: translateY(-2px); background: #ffdc87; }
.secondary-action { width: min(300px, 100%); border: 1px solid rgba(255, 247, 230, .17); background: rgba(255, 247, 230, .04); color: var(--cream); }
.secondary-action:hover { background: rgba(255, 247, 230, .09); border-color: rgba(255, 247, 230, .3); }
.text-action { min-height: 35px; color: var(--muted); font-size: 8px; }
.text-action:hover { color: var(--cream); }
.primary-action svg, .secondary-action svg, .text-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pause-tools { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Circuit select ---------- */
.circuit-layer { z-index: 32; }
.circuit-card {
  width: min(1120px, 95vw); max-height: 92vh; overflow-y: auto; padding: clamp(22px, 3vw, 36px);
  border: 1px solid rgba(255, 247, 230, .16); border-radius: 22px;
  background: linear-gradient(150deg, rgba(18, 24, 49, .97), rgba(7, 10, 25, .95));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .45);
  animation: sheetIn .4s cubic-bezier(.16, 1, .3, 1) both;
}
.circuit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.circuit-head h2 { margin: 9px 0 5px; font-family: var(--display); font-style: italic; font-size: clamp(46px, 5.2vw, 74px); line-height: .78; letter-spacing: -.035em; }
.circuit-head h2 span { color: var(--amber); }
.circuit-head p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .03em; }
.circuit-close {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid rgba(255, 247, 230, .16); border-radius: 50%;
  background: rgba(255, 247, 230, .04); color: rgba(255, 247, 230, .68);
  transition: background .2s, color .2s, transform .2s;
}
.circuit-close:hover { background: rgba(255, 107, 122, .14); color: var(--coral); transform: rotate(90deg); }
.circuit-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.circuit-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; padding: 20px 0; }
.circuit-option {
  position: relative; display: flex; flex-direction: column; min-height: 245px; padding: 16px;
  border: 1px solid rgba(255, 247, 230, .11); border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 247, 230, .035), rgba(255, 247, 230, .01));
  text-align: left; overflow: hidden; transition: border-color .22s, transform .22s, background .22s;
}
.circuit-option::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; opacity: .7;
  background: var(--track-accent, var(--amber));
}
.circuit-option:hover { transform: translateY(-3px); border-color: rgba(255, 247, 230, .26); background: rgba(255, 247, 230, .05); }
.circuit-option.is-active { border-color: rgba(255, 209, 102, .46); background: linear-gradient(160deg, rgba(255, 209, 102, .09), rgba(255, 247, 230, .015)); }
.circuit-option-top { display: flex; align-items: center; justify-content: space-between; color: rgba(255, 247, 230, .38); font-size: 6px; font-weight: 800; letter-spacing: .18em; }
.circuit-option-top strong { font-family: var(--display); font-style: italic; font-size: 22px; letter-spacing: .02em; color: var(--track-accent, var(--amber)); }
.circuit-option h3 { margin: 6px 0 5px; font-family: var(--display); font-style: italic; font-size: 27px; line-height: .9; letter-spacing: -.01em; }
.circuit-option p { margin: 0; min-height: 42px; color: rgba(255, 247, 230, .48); font-size: 8px; line-height: 1.55; }
.circuit-option-map { width: 100%; height: 96px; margin: 8px 0 9px; overflow: visible; }
.circuit-option-map path { fill: none; stroke: rgba(255, 247, 230, .18); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.circuit-option-map .inner { stroke: var(--track-accent, var(--mint)); stroke-width: 1.7; opacity: .9; }
.circuit-option-stats { display: flex; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 247, 230, .09); }
.circuit-option-stats span { display: flex; flex-direction: column; gap: 2px; color: rgba(255, 247, 230, .35); font-size: 5.5px; font-weight: 700; letter-spacing: .15em; }
.circuit-option-stats strong { color: rgba(255, 247, 230, .76); font-family: var(--body); font-size: 8px; letter-spacing: .04em; }
.circuit-option .select-tag { position: absolute; top: 12px; right: 12px; color: var(--amber); font-size: 6px; font-weight: 800; letter-spacing: .14em; opacity: 0; }
.circuit-option.is-active .select-tag { opacity: 1; }
.circuit-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: rgba(255, 247, 230, .32); font-size: 6.5px; font-weight: 700; letter-spacing: .16em; }

.results-layer { overflow-y: auto; align-items: center; }
.results-card {
  position: relative; width: min(980px, 94vw); padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(255, 247, 230, .16); border-radius: 22px;
  background: linear-gradient(150deg, rgba(19, 25, 52, .96), rgba(7, 10, 25, .95));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .45);
  animation: sheetIn .5s cubic-bezier(.16, 1, .3, 1) both;
}
.results-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.results-head h2 { margin: 9px 0 5px; font-family: var(--display); font-style: italic; font-size: clamp(58px, 7.5vw, 102px); line-height: .75; letter-spacing: -.035em; }
.results-head h2 span { color: var(--amber); }
.results-head p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.result-badge {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%;
  border: 1px solid rgba(255, 209, 102, .5); background: radial-gradient(circle at 35% 30%, rgba(255, 226, 145, .2), rgba(255, 209, 102, .04));
  color: var(--amber); font-family: var(--display); font-style: italic; font-size: 33px;
  box-shadow: 0 0 35px rgba(255, 209, 102, .11);
}
.result-grid { display: grid; grid-template-columns: 1fr 246px; gap: 28px; padding: 22px 0; }
.results-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.result-row {
  display: grid; grid-template-columns: 30px 10px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-bottom: 1px solid rgba(255, 247, 230, .075);
}
.result-row:last-child { border-bottom: 0; }
.result-row.player { border-radius: 8px; background: rgba(255, 209, 102, .09); border-bottom-color: transparent; }
.result-rank { font-family: var(--display); font-style: italic; font-size: 22px; color: rgba(255, 247, 230, .44); }
.result-row.player .result-rank { color: var(--amber); }
.result-swatch { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.result-name { font-size: 10px; font-weight: 700; letter-spacing: .09em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-name small { margin-left: 7px; color: rgba(255, 247, 230, .3); font-size: 7px; font-weight: 500; letter-spacing: .1em; }
.result-row.player .result-name small { color: var(--amber); }
.result-time { font-size: 10px; font-variant-numeric: tabular-nums; color: rgba(255, 247, 230, .66); letter-spacing: .04em; }
.result-summary { padding: 17px; border: 1px solid rgba(255, 247, 230, .1); border-radius: 12px; background: rgba(255, 247, 230, .025); }
.result-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255, 247, 230, .07); }
.result-summary > div:first-child { padding-top: 0; }
.result-summary span { color: var(--muted); font-size: 6px; font-weight: 700; letter-spacing: .18em; }
.result-summary strong { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.result-summary strong small { color: var(--muted); font-size: 7px; }
.result-summary p { margin: 15px 0 2px; color: rgba(255, 247, 230, .48); font-size: 9px; line-height: 1.55; }
.result-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--line); }
.result-actions .primary-action, .result-actions .secondary-action { width: auto; min-width: 174px; }

/* ---------- Loading & fatal ---------- */
.loading {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background:
    radial-gradient(circle at 50% 44%, rgba(71, 51, 112, .5), transparent 44%),
    #080b1b;
  transition: opacity .7s ease, visibility .7s;
}
.loading.is-hidden { opacity: 0; visibility: hidden; }
.loading-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-style: italic; font-size: 26px; letter-spacing: .04em; }
.loading-brand .brand-mark { width: 34px; height: 34px; }
.loading-brand .brand-mark svg { width: 32px; height: 32px; }
.loading-line { width: min(260px, 60vw); height: 2px; background: rgba(255, 247, 230, .12); overflow: hidden; border-radius: 3px; }
.loading-line i { display: block; width: 45%; height: 100%; background: linear-gradient(90deg, transparent, var(--amber), var(--coral)); animation: loadSweep 1.2s ease-in-out infinite; }
@keyframes loadSweep { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
.loading p { margin: 0; color: rgba(255, 247, 230, .36); font-size: 7px; font-weight: 700; letter-spacing: .21em; }
.fatal { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: #080b1b; padding: 25px; }
.fatal-card { max-width: 470px; text-align: center; padding: 34px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 247, 230, .03); }
.fatal-icon { width: 34px; height: 34px; margin: 0 auto 14px; fill: none; stroke: var(--coral); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fatal h2 { margin: 0 0 9px; font-family: var(--display); font-style: italic; font-size: 37px; line-height: .9; }
.fatal p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .menu-copy { width: min(590px, 56vw); }
  .track-sticker { width: 245px; }
  .controls-strip { gap: 15px; }
  .menu-side-note { display: none; }
}
@media (max-width: 900px) {
  .menu-copy { left: 5.4vw; width: 64vw; }
  .track-sticker { bottom: 74px; width: 218px; }
  .sticker-map { height: 80px; }
  .sticker-title strong { font-size: 21px; }
  .menu-footer span:last-child { display: none; }
  .result-grid { grid-template-columns: 1fr 210px; gap: 20px; }
}
@media (max-width: 720px) {
  .menu-header { height: 74px; padding: 17px 19px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-mark svg { width: 34px; height: 34px; }
  .brand-type strong { font-size: 18px; }
  .brand-type small { font-size: 6px; }
  .header-button span { display: none; }
  .header-actions { gap: 13px; }
  .menu-copy { left: 24px; right: 24px; top: 49%; width: auto; transform: translateY(-46%); }
  .eyebrow { font-size: 7px; }
  .menu-title { margin-top: 16px; }
  .title-top { font-size: clamp(65px, 16vw, 102px); }
  .title-bottom { font-size: clamp(88px, 22vw, 144px); }
  .tagline { font-size: 13px; margin: 16px 0 19px; }
  .start-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .start-button { height: 58px; min-width: 230px; }
  .start-arrow { width: 44px; height: 44px; }
  .start-hint { font-size: 8px; }
  .menu-stats { margin-top: 23px; }
  .menu-stats > div { min-width: 73px; padding: 0 13px; }
  .menu-stats strong { font-size: 16px; }
  .menu-stats span { font-size: 6px; }
  .controls-strip { display: none; }
  .track-sticker, .menu-footer { display: none; }
  .hud-position { left: 14px; top: 14px; min-width: 105px; padding: 9px 11px 10px; }
  .hud-position strong { font-size: 45px; }
  .hud-position strong em { font-size: 13px; }
  .position-bar i { width: 8px; }
  .hud-lap { left: 14px; top: 104px; min-width: 105px; padding: 7px 11px 9px; }
  .hud-lap strong { font-size: 28px; }
  .lap-pips i { width: 20px; }
  .hud-timer { top: 14px; min-width: 145px; padding: 6px 17px 7px; }
  .hud-timer strong { font-size: 13px; }
  .hud-kicker { font-size: 6px; }
  .pause-button { top: 17px; left: auto; right: 14px; width: 29px; height: 29px; }
  .hud-map { top: 56px; right: 14px; width: 145px; padding: 8px 9px 7px; }
  .map-head, .map-foot { font-size: 5px; }
  .map-head > span:first-child { display: none; }
  .hud-map { width: 142px; }
  .item-slot { left: 14px; bottom: 18px; min-width: 136px; padding: 7px 10px 7px 7px; gap: 8px; }
  .item-key { width: 24px; height: 38px; }
  .item-key kbd { width: 19px; height: 19px; font-size: 8px; }
  .item-icon { width: 34px; height: 34px; border-radius: 8px; }
  .item-icon svg { width: 19px; height: 19px; }
  .item-copy strong { font-size: 8px; }
  .item-copy span { font-size: 5px; }
  .drift-widget { display: none; }
  .damage-widget { left: 14px; top: 182px; width: 106px; padding: 6px 8px 7px; }
  .damage-head strong { font-size: 12px; }
  .damage-head span, .damage-widget small { font-size: 5px; }
  .speed-panel { width: 96px; right: 10px; bottom: 14px; }
  .speed-read strong { font-size: 29px; }
  .speed-read span { font-size: 5px; }
  .countdown span { font-size: 145px; }
  .toast { bottom: 104px; max-width: 90vw; }
  .race-callout { top: 18%; }
  .result-badge { width: 62px; height: 62px; font-size: 24px; }
  .results-card { width: 94vw; padding: 21px; max-height: 94vh; overflow-y: auto; }
  .result-grid { grid-template-columns: 1fr; gap: 16px; }
  .result-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
  .result-summary > div { padding: 5px 0; border-bottom: 0; flex-direction: column; gap: 2px; }
  .result-summary > div:first-child { padding-top: 5px; }
  .result-summary p { display: none; }
  .result-summary strong { font-size: 11px; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions .primary-action, .result-actions .secondary-action { width: 100%; }
  .results-head h2 { font-size: 67px; }
  .pause-card { padding: 29px 21px 22px; }
  .pause-card h2 { font-size: 58px; }
  .circuit-button { width: 100%; height: 52px; }
  .circuit-button-copy strong { max-width: none; }
  .inspect-hint { right: 16px; bottom: 15px; font-size: 5px; letter-spacing: .12em; }
  .inspect-hint i { display: none; }
  .circuit-card { width: 96vw; padding: 18px; max-height: 94vh; }
  .circuit-head h2 { font-size: 42px; }
  .circuit-head p { display: none; }
  .circuit-options { grid-template-columns: 1fr; gap: 10px; }
  .circuit-option { min-height: 0; padding: 13px; display: grid; grid-template-columns: 1fr 96px; column-gap: 10px; }
  .circuit-option h3 { font-size: 22px; margin-top: 3px; }
  .circuit-option p { grid-column: 1; min-height: 0; font-size: 7px; }
  .circuit-option-map { grid-column: 2; grid-row: 1 / span 3; height: 72px; margin: 0; align-self: center; }
  .circuit-option-stats { grid-column: 1 / -1; margin-top: 8px; }
  .circuit-option .select-tag { top: 10px; right: 10px; }
  .circuit-footer span:last-child { display: none; }
}
@media (pointer: coarse) {
  body.touch .hud-position { top: 12px; }
  body.touch .hud-map { top: 52px; }
  body.touch .item-slot { bottom: 166px; }
  body.touch .speed-panel { bottom: 154px; width: 82px; }
  body.touch .speed-read strong { font-size: 25px; }
  body.touch .toast { bottom: 252px; }
  body.touch .pause-button { position: absolute; }
}
@media (max-height: 610px) and (min-width: 721px) {
  .menu-copy { top: 51%; }
  .menu-title { margin-top: 11px; margin-bottom: 10px; }
  .title-top { font-size: clamp(56px, 8vw, 100px); }
  .title-bottom { font-size: clamp(78px, 11vw, 150px); }
  .tagline { margin: 11px 0 14px; font-size: 13px; }
  .menu-stats { margin-top: 17px; }
  .controls-strip { margin-top: 17px; padding: 8px 13px; }
  .track-sticker { bottom: 45px; }
  .sticker-map { height: 65px; }
  .menu-footer { bottom: 15px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .menu-title { margin: 6px 0 8px; }
  .title-top { font-size: 52px; }
  .title-bottom { font-size: 74px; }
  .tagline { display: none; }
  .controls-strip, .track-sticker, .menu-footer { display: none; }
  .menu-stats { margin-top: 14px; }
  .hud-map { width: 118px; top: 12px; }
  .hud-lap { top: 92px; }
  /* Keep durability readable below the minimap in short landscape viewports. */
  .damage-widget { display: block; left: auto; right: 14px; top: 140px; width: 106px; padding: 5px 8px; }
  .damage-head { line-height: 12px; align-items: center; }
  .damage-head span { font-size: 5px; }
  .damage-head strong { font-size: 12px; line-height: 1; }
  .damage-widget small { display: none; }
  .damage-track { height: 3px; margin: 4px 0 0; }
  .item-slot { bottom: 10px; }
  .speed-panel { bottom: 8px; width: 82px; }
  .drift-widget { bottom: 18px; }
  .touch-controls { height: 120px; }
  .touch-cluster { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
