@charset "UTF-8";

:root {
  --pink: #ff9a3d;
  --pink-soft: #ffd3a1;
  --cyan: #2ee6d6;
  --violet: #b06bff;
  --amber: #ffd36e;
  --ink: #08040a;
  --panel: rgba(16, 8, 10, 0.66);
  --line: rgba(255, 255, 255, 0.13);
  --display: "Bahnschrift", "Arial Narrow", "Impact", "Arial Black", "Microsoft YaHei", sans-serif;
  --body: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button { font: inherit; color: inherit; }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #05020d;
  isolation: isolate;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}

#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #05020d;
}
#gl.is-hidden { display: none; }

.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.fx-scanlines {
  opacity: 0.2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
}

.fx-vignette {
  background:
    radial-gradient(120% 90% at 50% 46%, transparent 38%, rgba(2, 0, 8, 0.42) 76%, rgba(2, 0, 8, 0.86) 100%),
    linear-gradient(180deg, rgba(3, 0, 9, 0.4), transparent 18%, transparent 78%, rgba(3, 0, 9, 0.45));
}

.fx-grain {
  display: none;
}

.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ---------------------------------- HUD ---------------------------------- */

.hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.hud-corner {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  display: flex;
  align-items: flex-start;
  gap: 18px;
  pointer-events: auto;
}

.hud-tl { left: max(26px, env(safe-area-inset-left)); }
.hud-tr {
  right: max(26px, env(safe-area-inset-right));
  gap: 9px;
  pointer-events: auto;
}

.stat-block {
  min-width: 72px;
  text-shadow: 0 0 24px rgba(255, 45, 149, 0.35);
}

.stat-label {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  margin-bottom: 4px;
}

.stat-value {
  display: flex;
  align-items: baseline;
  line-height: 0.9;
}

.stat-value b {
  font-family: var(--display);
  font-size: clamp(31px, 3.2vw, 48px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.stat-value small {
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  margin-left: 3px;
}

.pos-value b { color: var(--cyan); text-shadow: 0 0 18px rgba(39, 230, 255, 0.55); }
.stat-divider {
  width: 1px;
  height: 42px;
  margin-top: 8px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.24), transparent);
}

.race-clock {
  position: absolute;
  top: max(23px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55);
}

.clock-kicker, .lap-time {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.48);
}

.race-clock > b {
  display: block;
  font-family: var(--display);
  font-size: clamp(21px, 2.2vw, 31px);
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin: 3px 0 4px;
  font-variant-numeric: tabular-nums;
}

.lap-time em {
  font-style: normal;
  color: var(--pink-soft);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(8, 3, 19, 0.56);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.icon-btn:hover { border-color: var(--pink); background: rgba(255, 45, 149, 0.14); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; fill: rgba(255, 255, 255, 0.82); }
.icon-btn.muted .sound-wave { opacity: 0; }
.icon-btn.muted::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--pink);
  transform: rotate(-45deg);
  border-radius: 2px;
}

.leaderboard {
  position: absolute;
  top: 126px;
  right: max(26px, env(safe-area-inset-right));
  width: 196px;
  padding: 13px 14px 10px;
  background: linear-gradient(135deg, rgba(9, 3, 22, 0.82), rgba(13, 4, 30, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 2px solid rgba(255, 45, 149, 0.55);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.lb-title {
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 10px;
}

.lb-title span { color: var(--pink); }
.lb-rows { display: flex; flex-direction: column; gap: 5px; }

.lb-row {
  display: grid;
  grid-template-columns: 16px 6px 1fr auto;
  align-items: center;
  gap: 7px;
  height: 21px;
  font-size: 10px;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.58);
  transition: color 0.2s, transform 0.25s;
}

.lb-row .lb-pos { font-family: var(--display); font-style: italic; font-weight: 800; color: rgba(255, 255, 255, 0.34); }
.lb-row .lb-dot { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.lb-row .lb-name { font-weight: 700; white-space: nowrap; overflow: hidden; }
.lb-row .lb-gap { font-variant-numeric: tabular-nums; font-size: 9px; opacity: 0.65; }
.lb-row.you { color: #fff; }
.lb-row.you .lb-pos { color: var(--pink); }
.lb-row.you .lb-name::after { content: " ›"; color: var(--pink); }
.lb-row.finished { opacity: 0.45; }

.speed-cluster {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(30px, env(safe-area-inset-right));
  width: 236px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.speed-dial {
  position: relative;
  width: 224px;
  height: 174px;
}

.dial-svg {
  position: absolute;
  left: 50%;
  top: 0;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  overflow: visible;
}

.dial-guide, .dial-ticks, .dial-arc {
  fill: none;
  transform: rotate(135deg);
  transform-origin: 110px 110px;
}

.dial-guide {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 75 100;
}

.dial-ticks {
  stroke: rgba(255, 255, 255, 0.23);
  stroke-width: 1;
  stroke-dasharray: 0.7 4.4;
}

.dial-arc {
  stroke: var(--pink);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.08s linear, stroke 0.3s ease;
}

.speed-cluster.boosting .dial-arc { stroke: var(--cyan); }

.dial-readout {
  position: absolute;
  inset: 29px 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.dial-readout span {
  font-family: var(--display);
  font-size: 57px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(255, 255, 255, 0.26);
}

.dial-readout small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.38em;
}

.gear-badge {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(4, 1, 12, 0.42);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

.gear-badge span { color: rgba(255, 255, 255, 0.4); font-size: 7px; font-weight: 700; letter-spacing: 0.18em; }
.gear-badge b { color: var(--cyan); font-family: var(--display); font-size: 15px; font-style: italic; }

.nitro-wrap { width: 250px; margin-top: -4px; }
.nitro-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.nitro-head span { font-size: 8px; font-weight: 800; letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.5); }
.nitro-head em { font-style: normal; font-family: var(--display); font-size: 11px; color: var(--cyan); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

.nitro-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.11);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.nitro-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0aa8c4, var(--cyan) 55%, #e7ffff);
  box-shadow: 0 0 18px rgba(39, 230, 255, 0.75);
  transform-origin: left center;
  transition: width 0.08s linear;
}

.nitro-fill.low { background: linear-gradient(90deg, #992157, var(--pink), #ffc1de); box-shadow: 0 0 18px rgba(255, 45, 149, 0.7); }
.nitro-shine {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 19px, rgba(5, 2, 13, 0.45) 19px 21px);
  pointer-events: none;
}
.nitro-hint { margin-top: 4px; text-align: right; color: rgba(255, 255, 255, 0.28); font-size: 7px; letter-spacing: 0.22em; }

.best-lap-card {
  position: absolute;
  left: max(28px, env(safe-area-inset-left));
  bottom: max(28px, env(safe-area-inset-bottom));
  padding: 8px 22px 8px 12px;
  border-left: 2px solid rgba(255, 45, 149, 0.55);
  background: linear-gradient(90deg, rgba(5, 2, 13, 0.66), rgba(5, 2, 13, 0));
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.best-lap-card span { font-size: 8px; letter-spacing: 0.26em; color: rgba(255, 255, 255, 0.35); font-weight: 700; }
.best-lap-card b { font-family: var(--display); font-size: 17px; font-style: italic; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.82); font-variant-numeric: tabular-nums; }

/* ------------------------------- Countdown ------------------------------- */

.countdown {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(6, 1, 16, 0.14), rgba(6, 1, 16, 0.5) 55%, rgba(3, 0, 9, 0.72));
  transition: opacity 0.25s ease;
}

.countdown-num {
  font-family: var(--display);
  font-size: clamp(150px, 24vw, 330px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.55),
    0 0 45px rgba(255, 45, 149, 0.9),
    0 0 110px rgba(255, 45, 149, 0.55);
}

.countdown-num.go {
  font-size: clamp(92px, 15vw, 210px);
  color: var(--cyan);
  letter-spacing: 0.02em;
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.6),
    0 0 42px rgba(39, 230, 255, 0.9),
    0 0 110px rgba(39, 230, 255, 0.45);
}

.countdown-num.pop { animation: count-pop 0.46s cubic-bezier(0.18, 0.86, 0.3, 1); }
.countdown-sub {
  margin-top: 22px;
  font-size: 10px;
  letter-spacing: 0.55em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

@keyframes count-pop {
  0% { transform: scale(1.45) skewX(-8deg); opacity: 0; filter: blur(10px); }
  45% { opacity: 1; filter: blur(0); }
  100% { transform: scale(1) skewX(-8deg); opacity: 1; }
}

.race-toast {
  position: absolute;
  top: 21%;
  left: 50%;
  transform: translate(-50%, 8px);
  z-index: 25;
  padding: 10px 30px;
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 28px);
  font-style: italic;
  letter-spacing: 0.14em;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  text-shadow: 0 0 22px rgba(255, 45, 149, 0.8);
  border-top: 1px solid rgba(255, 45, 149, 0.6);
  border-bottom: 1px solid rgba(255, 45, 149, 0.6);
  background: linear-gradient(90deg, transparent, rgba(255, 45, 149, 0.14), transparent);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.race-toast.overlay-toast { z-index: 80; top: 8%; }

.race-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------- Screens -------------------------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.menu-screen {
  pointer-events: none;
  background:
    radial-gradient(58% 26% at 31% 45%, rgba(4, 1, 12, 0.78) 0%, rgba(4, 1, 12, 0.42) 55%, transparent 78%),
    linear-gradient(90deg, rgba(4, 1, 12, 0.96) 0%, rgba(4, 1, 12, 0.82) 28%, rgba(4, 1, 12, 0.34) 54%, rgba(4, 1, 12, 0.04) 73%, transparent 100%),
    linear-gradient(180deg, rgba(3, 0, 9, 0.38) 0%, transparent 32%, transparent 58%, rgba(3, 0, 9, 0.82) 100%);
}

.menu-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 49.9%, rgba(255, 255, 255, 0.03) 49.9% 50.1%, transparent 50.1%);
}

.menu-shell {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(24px, 3.4vw, 54px) clamp(26px, 5vw, 82px);
  display: flex;
  flex-direction: column;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.42);
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
}

.brand-line i { width: 38px; height: 1px; background: rgba(255, 255, 255, 0.2); }

.title-wrap {
  margin-top: auto;
  margin-bottom: auto;
  padding: 4vh 0 0;
  max-width: 920px;
}

.title-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--pink-soft);
  font-size: clamp(8px, 0.8vw, 11px);
  font-weight: 800;
  letter-spacing: 0.54em;
}

.title-kicker::before { content: ""; width: 36px; height: 2px; background: var(--pink); box-shadow: 0 0 10px var(--pink); }

.game-title {
  position: relative;
  margin: 9px 0 0 -0.055em;
  font-family: var(--display);
  font-size: clamp(70px, 11vw, 195px);
  font-weight: 900;
  font-style: italic;
  line-height: 0.82;
  letter-spacing: -0.065em;
  color: #fff4d8;
  text-shadow:
    0 1px 0 #ffe2a6,
    0 4px 0 rgba(112, 52, 22, 0.55),
    0 0 36px rgba(255, 154, 61, 0.35);
  background: linear-gradient(180deg, #fffdf3 4%, #fff0c8 37%, #ffb347 61%, #b85d2c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 40px rgba(255, 154, 61, 0.2));
}

.game-title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 190, 120, 0.28);
  transform: translate(5px, 4px);
  -webkit-text-fill-color: transparent;
}

.title-rule {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: clamp(14px, 2vh, 24px);
  width: min(610px, 78%);
  color: rgba(255, 255, 255, 0.72);
}
.title-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 154, 61, 0.8), rgba(255, 255, 255, 0.08)); }
.title-rule span:last-child { background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(46, 230, 214, 0.18)); }
.title-rule b { font-size: clamp(10px, 1vw, 14px); font-weight: 500; letter-spacing: 0.42em; color: rgba(255, 255, 255, 0.74); white-space: nowrap; }

.title-copy {
  margin: clamp(15px, 2.2vh, 25px) 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(12px, 1.2vw, 15px);
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.menu-actions {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.8vw, 58px);
  pointer-events: auto;
  margin-bottom: clamp(28px, 5.5vh, 68px);
}

.start-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 292px;
  padding: 16px 25px 16px 31px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(100deg, #ffb347, #ff8a3d 55%, #ffe0a3);
  color: #231006;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  box-shadow: 0 0 38px rgba(255, 154, 61, 0.32);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.22s;
}

.start-btn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(37, 0, 24, 0.18);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  pointer-events: none;
}

.start-btn:hover { transform: translateX(5px); filter: brightness(1.08); }
.start-btn:active { transform: translateX(3px) scale(0.986); }
.start-glow { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.38) 46%, transparent 60%); transform: translateX(-120%); animation: btn-sheen 4.8s ease-in-out infinite; }
@keyframes btn-sheen { 0%, 55% { transform: translateX(-120%); } 78%, 100% { transform: translateX(120%); } }

.start-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.start-copy small { font-size: 8px; font-weight: 800; letter-spacing: 0.34em; opacity: 0.6; margin-bottom: 5px; }
.start-copy b { font-size: 23px; font-weight: 900; letter-spacing: 0.08em; }
.start-arrow { position: relative; margin-left: auto; font-family: var(--display); font-size: 35px; font-weight: 300; line-height: 1; transition: transform 0.2s; }
.start-btn:hover .start-arrow { transform: translateX(4px); }

.menu-meta {
  display: flex;
  gap: clamp(18px, 2.4vw, 38px);
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(5, 2, 13, 0.52), rgba(5, 2, 13, 0));
  border-radius: 2px;
}
.meta-item { display: flex; flex-direction: column; gap: 5px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.15); }
.meta-item span { color: rgba(255, 255, 255, 0.34); font-size: 8px; font-weight: 700; letter-spacing: 0.18em; }
.meta-item b { color: rgba(255, 255, 255, 0.8); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }

.menu-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}

.controls-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 26px; color: rgba(255, 255, 255, 0.41); font-size: 10px; letter-spacing: 0.05em; }
.controls-hint span { display: inline-flex; align-items: center; gap: 4px; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--body);
  font-size: 8px;
  font-weight: 700;
  border-radius: 2px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.record-chip { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; white-space: nowrap; }
.record-chip span { color: rgba(255, 255, 255, 0.34); font-size: 8px; font-weight: 700; letter-spacing: 0.24em; }
.record-chip b { font-family: var(--display); font-style: italic; font-size: 20px; letter-spacing: 0.05em; color: var(--pink-soft); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255, 45, 149, 0.35); }

.menu-side-note {
  position: absolute;
  right: clamp(26px, 5vw, 82px);
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 7px;
  letter-spacing: 0.34em;
  line-height: 2.2;
  text-align: center;
  pointer-events: none;
}

/* --------------------------------- Modals -------------------------------- */

.center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 46%, rgba(10, 2, 22, 0.35), rgba(3, 0, 9, 0.8) 68%);
  backdrop-filter: blur(5px);
  pointer-events: auto;
  padding: 22px;
}

.modal-card {
  position: relative;
  width: min(500px, 92vw);
  max-height: calc(100dvh - 28px);
  padding: clamp(29px, 4vw, 46px);
  background: linear-gradient(145deg, rgba(24, 7, 39, 0.95), rgba(7, 2, 18, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 45, 149, 0.5) transparent;
}

.modal-card::-webkit-scrollbar { width: 4px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(255, 45, 149, 0.45); border-radius: 4px; }

.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), transparent);
}

.modal-eyebrow { color: var(--pink); font-size: 8px; font-weight: 800; letter-spacing: 0.38em; margin-bottom: 10px; }
.modal-card h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 5vw, 53px); font-style: italic; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.modal-card > p { color: rgba(255, 255, 255, 0.46); margin: 11px 0 27px; font-size: 12px; letter-spacing: 0.08em; }

.modal-actions { display: flex; gap: 10px; margin-top: 28px; }
.modal-actions.vertical { flex-direction: column; margin-top: 24px; }

.primary-btn, .ghost-btn {
  position: relative;
  flex: 1;
  min-height: 48px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}

.primary-btn {
  background: linear-gradient(100deg, var(--pink), #ff79b7);
  color: #1b0212;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.primary-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.ghost-btn:hover { border-color: rgba(255, 45, 149, 0.55); background: rgba(255, 45, 149, 0.09); color: #fff; }
.modal-key-hint { margin-top: 19px; text-align: center; color: rgba(255, 255, 255, 0.29); font-size: 9px; letter-spacing: 0.15em; }
.modal-key-hint kbd { height: 17px; min-width: 17px; margin: 0 2px; }

.result-card { width: min(570px, 93vw); }
.result-glow { position: absolute; top: -110px; right: -80px; width: 300px; height: 300px; background: radial-gradient(circle, rgba(255, 45, 149, 0.24), transparent 67%); pointer-events: none; }
.result-head { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 20px; align-items: center; }
.result-head .modal-eyebrow { grid-column: 1 / -1; }
.result-rank {
  grid-row: 2 / 4;
  font-family: var(--display);
  font-size: clamp(66px, 9vw, 96px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.06em;
  color: var(--cyan);
  text-shadow: 0 0 32px rgba(39, 230, 255, 0.3);
}
.result-card.win .result-rank { color: var(--amber); text-shadow: 0 0 34px rgba(255, 211, 110, 0.38); }
.result-head h2 { grid-column: 2; grid-row: 2; }
.result-head p { grid-column: 2; grid-row: 3; margin: 7px 0 0; color: rgba(255, 255, 255, 0.43); font-size: 11px; letter-spacing: 0.055em; }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 29px; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.09); }
.result-grid > div { padding: 13px 14px; background: rgba(8, 3, 20, 0.82); }
.result-grid span { display: block; color: rgba(255, 255, 255, 0.34); font-size: 8px; font-weight: 700; letter-spacing: 0.13em; margin-bottom: 6px; }
.result-grid b { display: block; font-family: var(--display); font-size: clamp(16px, 2vw, 22px); font-style: italic; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.result-grid b small { font-size: 8px; font-family: var(--body); color: rgba(255, 255, 255, 0.34); letter-spacing: 0.1em; }

.result-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 22px; }
.result-bar { display: grid; grid-template-columns: 21px 1fr auto; gap: 9px; align-items: center; font-size: 9px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); }
.result-bar .rpos { font-family: var(--display); font-style: italic; }
.result-bar .rname { color: rgba(255, 255, 255, 0.66); }
.result-bar.you .rname { color: #fff; }
.result-bar .rtime { font-variant-numeric: tabular-nums; }
.result-bar .rline { grid-column: 2 / 4; height: 2px; background: rgba(255, 255, 255, 0.06); margin-top: -5px; }
.result-bar .rline i { display: block; height: 100%; background: var(--pink); opacity: 0.55; }

/* ------------------------------ Touch controls --------------------------- */

.touch-controls {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  pointer-events: none;
  padding: max(15px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  align-items: flex-end;
  justify-content: space-between;
}

.touch-steer, .touch-pedals { display: flex; align-items: flex-end; gap: 9px; pointer-events: auto; }
.touch-pedals { align-items: flex-end; }

.touch-btn {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 2, 20, 0.56);
  color: rgba(255, 255, 255, 0.8);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.1s, transform 0.1s, border-color 0.1s;
}

.touch-btn.active { background: rgba(255, 45, 149, 0.26); border-color: var(--pink); transform: scale(0.95); }
.touch-btn svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.touch-btn.steer { width: 60px; height: 60px; border-radius: 50%; }
.touch-btn.steer svg { width: 25px; height: 25px; }
.touch-btn.gas { width: 70px; height: 70px; border-radius: 50%; border-color: rgba(39, 230, 255, 0.4); color: var(--cyan); }
.touch-btn.brake { width: 52px; height: 52px; border-radius: 50%; font-size: 8px; font-weight: 800; letter-spacing: 0.06em; }
.touch-btn.nitro { width: 60px; height: 60px; border-radius: 50%; border-color: rgba(255, 45, 149, 0.45); color: var(--pink-soft); }
.touch-btn.nitro span { font-family: var(--display); font-style: italic; font-size: 14px; font-weight: 900; letter-spacing: 0.03em; }

.rotate-hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 26;
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  pointer-events: none;
}

/* -------------------------------- Responsive ----------------------------- */

/* ------------------------------ 2.0 Interface ----------------------------- */

.profile-chip {
  position: absolute;
  top: clamp(24px, 3.4vw, 54px);
  right: clamp(26px, 5vw, 82px);
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 13px;
  background: linear-gradient(100deg, rgba(7, 2, 17, 0.72), rgba(7, 2, 17, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-right: 2px solid rgba(255, 45, 149, 0.55);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}
.profile-chip b { color: #fff; font-family: var(--display); font-size: 16px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.profile-chip small { color: var(--pink-soft); font-size: 7px; letter-spacing: 0.08em; }
.profile-chip i { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.16); margin: 0 7px; align-self: center; }

.menu-actions { margin-bottom: 14px; }
.menu-subactions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
  margin-bottom: clamp(18px, 3.2vh, 38px);
}

.subaction-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 164px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(120deg, rgba(13, 5, 28, 0.7), rgba(13, 5, 28, 0.22));
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.subaction-btn:hover { border-color: rgba(255, 45, 149, 0.6); background: rgba(255, 45, 149, 0.1); transform: translateY(-1px); }
.subaction-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; color: var(--pink-soft); font-size: 15px; }
.subaction-btn small { display: block; color: rgba(255, 255, 255, 0.34); font-size: 7px; letter-spacing: 0.25em; margin-bottom: 3px; }
.subaction-btn b { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.82); }
.pad-hint { color: var(--cyan); font-size: 7px; letter-spacing: 0.12em; }

/* HUD additions */
.minimap-panel {
  position: absolute;
  left: max(26px, env(safe-area-inset-left));
  top: 112px;
  width: 196px;
  padding: 10px 11px 8px;
  background: linear-gradient(145deg, rgba(8, 3, 20, 0.68), rgba(8, 3, 20, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid rgba(39, 230, 255, 0.5);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  pointer-events: none;
}
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.map-head span { color: rgba(255, 255, 255, 0.46); font-size: 7px; letter-spacing: 0.16em; font-weight: 700; }
.map-head em { color: var(--cyan); font-style: normal; font-size: 6px; letter-spacing: 0.22em; }
#minimap { display: block; width: 100%; height: auto; }
.map-fade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(4, 1, 12, 0.2)); pointer-events: none; }

.race-data-card {
  position: absolute;
  left: max(26px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 292px;
  padding: 10px 12px 11px;
  background: linear-gradient(100deg, rgba(5, 2, 13, 0.7), rgba(5, 2, 13, 0.1));
  border-left: 2px solid rgba(255, 45, 149, 0.5);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  pointer-events: none;
}
.sector-row { display: flex; gap: 13px; margin-bottom: 6px; }
.sector { display: flex; align-items: baseline; gap: 5px; font-family: var(--display); font-variant-numeric: tabular-nums; }
.sector i { font-style: normal; font-size: 7px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.3); }
.sector b { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.66); }
.sector.active b { color: #fff; text-shadow: 0 0 12px rgba(39, 230, 255, 0.5); }
.sector.done b { color: var(--cyan); }
.delta-row { display: flex; align-items: baseline; gap: 9px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.delta-row span { color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.2em; }
.delta-row b { font-family: var(--display); font-size: 13px; font-style: italic; color: rgba(255, 255, 255, 0.45); font-variant-numeric: tabular-nums; }
.delta-row b.better { color: #5dffb2; }
.delta-row b.slower { color: #ff658f; }
.best-lap-card {
  position: static;
  width: auto;
  padding: 0;
  margin-top: 5px;
  border: 0;
  background: none;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  clip-path: none;
}
.best-lap-card span { font-size: 7px; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.28); }
.best-lap-card b { font-family: var(--display); font-size: 12px; font-style: italic; color: rgba(255, 255, 255, 0.62); font-variant-numeric: tabular-nums; }

.slipstream-badge {
  align-self: flex-end;
  margin: 0 2px 5px 0;
  padding: 4px 10px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--cyan);
  border: 1px solid rgba(39, 230, 255, 0.4);
  background: rgba(39, 230, 255, 0.08);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.slipstream-badge.show { opacity: 1; transform: none; }

.start-lights { display: flex; gap: 13px; margin-bottom: 26px; }
.start-lights i {
  display: block;
  width: clamp(37px, 4.4vw, 62px);
  height: clamp(12px, 1.4vw, 19px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transform: skewX(-18deg);
  transition: background 0.15s, box-shadow 0.15s;
}
.start-lights i.on { background: #ff2d95; border-color: #ff8bc8; box-shadow: 0 0 22px rgba(255, 45, 149, 0.8); }
.start-lights i.go { background: var(--cyan); border-color: #b5fbff; box-shadow: 0 0 22px rgba(39, 230, 255, 0.75); }

.event-label { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.34); font-size: 7px; letter-spacing: 0.2em; }

/* Subpages */
.subpage {
  z-index: 42;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(45, 11, 72, 0.32), transparent 75%),
    linear-gradient(180deg, rgba(4, 1, 12, 0.96) 0%, rgba(4, 1, 12, 0.9) 42%, rgba(4, 1, 12, 0.98) 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 45, 149, 0.45) transparent;
  pointer-events: auto;
}

.subpage-shell {
  width: min(1420px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(20px, 3.2vw, 42px) clamp(22px, 4.4vw, 64px) clamp(22px, 3vw, 38px);
  display: flex;
  flex-direction: column;
}

.subpage-head {
  display: flex;
  align-items: center;
  gap: 25px;
  padding-bottom: clamp(16px, 2.2vw, 25px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.back-btn span { font-size: 15px; line-height: 1; }
.back-btn:hover { color: #fff; border-color: var(--pink); background: rgba(255, 45, 149, 0.08); }

/* 返回网站主页（主菜单左上角，独立于游戏内返回主菜单） */
.site-home-btn {
  position: absolute;
  z-index: 20;
  left: 24px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 14, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-ui, inherit);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  /* .menu-screen 整体关闭了指针事件，子元素需自行重新开启 */
  pointer-events: auto;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.site-home-btn span { font-size: 14px; line-height: 1; }
.site-home-btn:hover {
  color: #fff;
  border-color: var(--pink);
  background: rgba(255, 45, 149, 0.12);
  transform: translateX(-2px);
}
@media (max-width: 720px) {
  .site-home-btn { left: 12px; top: 12px; padding: 6px 10px; font-size: 9px; }
}

.subpage-title { flex: 1; }
.subpage-title > span { color: var(--pink); font-size: 8px; letter-spacing: 0.32em; font-weight: 700; }
.subpage-title h2 { margin: 4px 0 0; font-family: var(--display); font-size: clamp(26px, 3vw, 43px); font-style: italic; font-weight: 900; letter-spacing: -0.02em; line-height: 1; }

.wallet { display: flex; align-items: baseline; gap: 5px; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, 0.13); }
.wallet span { color: rgba(255, 255, 255, 0.32); font-size: 7px; letter-spacing: 0.2em; }
.wallet b { font-family: var(--display); font-size: 23px; font-style: italic; color: var(--amber); font-variant-numeric: tabular-nums; }
.wallet small { font-size: 7px; color: rgba(255, 255, 255, 0.35); }

.setup-body { flex: 1; padding: 24px 0 112px; display: flex; flex-direction: column; gap: clamp(22px, 3vh, 34px); }
.setup-section { min-width: 0; }
.section-head { display: flex; align-items: baseline; gap: 15px; margin-bottom: 12px; }
.section-head h3 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: 0.16em; }
.section-head h3 i { color: var(--pink); font-family: var(--display); font-size: 12px; font-style: normal; }
.section-head p { margin: 0; color: rgba(255, 255, 255, 0.3); font-size: 9px; letter-spacing: 0.04em; }

.track-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.track-card {
  position: relative;
  min-height: 150px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(100% 120% at 80% 20%, var(--tb, rgba(255, 45, 149, 0.22)), transparent 66%),
    linear-gradient(155deg, rgba(20, 7, 39, 0.88), rgba(6, 2, 16, 0.9));
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.track-card::before {
  content: "";
  position: absolute;
  inset: 52% -10% -20%;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.06) 23px 24px),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(255, 255, 255, 0.05) 15px 16px);
  transform: perspective(110px) rotateX(53deg);
  transform-origin: bottom;
  opacity: 0.7;
  pointer-events: none;
}
.track-card::after {
  content: "";
  position: absolute;
  left: -10%; right: -10%; top: 42%;
  height: 34px;
  background: linear-gradient(180deg, transparent, var(--tc, rgba(255, 45, 149, 0.26)));
  clip-path: polygon(0 100%, 12% 35%, 22% 70%, 35% 0, 51% 66%, 66% 20%, 82% 68%, 100% 25%, 100% 100%);
  opacity: 0.8;
  pointer-events: none;
}
.track-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.28); }
.track-card.selected { border-color: var(--ta, var(--pink)); box-shadow: inset 0 0 0 1px var(--ta, var(--pink)), 0 8px 35px rgba(0, 0, 0, 0.3); }
.track-card.selected::before { opacity: 1; }
.track-top { position: relative; z-index: 2; display: flex; justify-content: space-between; color: rgba(255, 255, 255, 0.34); font-size: 7px; letter-spacing: 0.14em; }
.track-top em { font-style: normal; color: var(--ta, var(--pink-soft)); }
.track-name { position: relative; z-index: 2; margin-top: 30px; }
.track-name span { display: block; color: rgba(255, 255, 255, 0.38); font-size: 7px; letter-spacing: 0.18em; margin-bottom: 3px; }
.track-name b { display: block; font-family: var(--display); font-size: clamp(17px, 1.55vw, 23px); font-style: italic; font-weight: 900; letter-spacing: -0.01em; line-height: 1; }
.track-meta { position: relative; z-index: 2; display: flex; gap: 12px; margin-top: 16px; color: rgba(255, 255, 255, 0.42); font-size: 8px; font-variant-numeric: tabular-nums; }
.track-meta i { font-style: normal; color: rgba(255, 255, 255, 0.22); }
.track-check { position: absolute; right: 13px; top: 40px; z-index: 3; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--ta, var(--pink)); color: #0a0412; font-size: 11px; font-weight: 900; opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.2s; }
.track-card.selected .track-check { opacity: 1; transform: none; }

.car-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.car-card {
  position: relative;
  display: grid;
  grid-template-columns: 44% 1fr;
  min-height: 155px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(18, 7, 35, 0.82), rgba(6, 2, 15, 0.92));
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.car-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.25); }
.car-card.selected { border-color: var(--cc, var(--cyan)); box-shadow: inset 0 0 0 1px var(--cc, var(--cyan)); }
.car-card.locked { cursor: default; }
.car-card.locked:hover { transform: none; }
.car-art { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }
.car-art img { width: 100%; max-width: 100%; filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.45)); transform: rotate(-3deg); }
.car-card.locked .car-art img { filter: grayscale(0.7) brightness(0.45); }
.car-info { position: relative; z-index: 2; display: flex; flex-direction: column; padding-left: 4px; }
.car-info > span { color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.16em; }
.car-info b { font-family: var(--display); font-size: 18px; font-style: italic; letter-spacing: 0.01em; line-height: 1.05; margin-top: 2px; }
.car-tag { color: var(--cc, var(--cyan)) !important; font-size: 7px !important; letter-spacing: 0.12em !important; margin-top: 3px; }
.car-bars { display: flex; flex-direction: column; gap: 3px; margin-top: 9px; }
.car-bar { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 5px; color: rgba(255, 255, 255, 0.3); font-size: 6px; letter-spacing: 0.08em; }
.car-bar i { height: 3px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; }
.car-bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v, 50%); background: var(--cc, var(--cyan)); opacity: 0.8; }
.car-lock {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  background: rgba(5, 2, 13, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.45);
}
.car-lock button { border: 0; background: var(--amber); color: #1d1100; padding: 4px 8px; font-size: 7px; font-weight: 800; letter-spacing: 0.05em; cursor: pointer; }
.car-lock button:disabled { opacity: 0.35; cursor: default; }
.car-check { position: absolute; right: 10px; top: 10px; z-index: 3; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--cc, var(--cyan)); color: #061014; font-size: 10px; font-weight: 900; opacity: 0; transform: scale(0.6); transition: 0.2s; }
.car-card.selected .car-check { opacity: 1; transform: none; }

.setup-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px max(clamp(22px, 4.4vw, 64px), calc((100vw - 1420px) / 2 + 64px)) max(13px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(5, 1, 14, 0.965), rgba(5, 1, 14, 1));
}
.setup-summary { display: flex; flex-direction: column; gap: 3px; }
.setup-summary span { color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.24em; }
.setup-summary b { font-family: var(--display); font-size: clamp(15px, 1.6vw, 21px); font-style: italic; letter-spacing: 0.02em; }
.setup-summary small { color: rgba(255, 255, 255, 0.36); font-size: 8px; letter-spacing: 0.09em; }
.setup-start { min-width: 235px; padding: 12px 22px; }

/* Career */
.career-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 20px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.08);
}
.career-stat { padding: 12px 15px; background: rgba(7, 2, 17, 0.86); }
.career-stat span { display: block; color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.16em; margin-bottom: 4px; }
.career-stat b { font-family: var(--display); font-size: 22px; font-style: italic; letter-spacing: 0.02em; }
.career-list { display: flex; flex-direction: column; gap: 9px; }
.career-loadout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin: 0 0 12px; color: rgba(255, 255, 255, 0.3); font-size: 8px; letter-spacing: 0.06em; }
.career-loadout b { color: rgba(255, 255, 255, 0.8); font-family: var(--display); font-size: 11px; font-style: italic; letter-spacing: 0.03em; }
.career-loadout i { width: 1px; height: 9px; background: rgba(255, 255, 255, 0.16); margin: 0 4px; align-self: center; }
.career-event {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr) 110px 120px;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(100deg, rgba(17, 6, 32, 0.8), rgba(7, 2, 17, 0.42));
  border-left: 2px solid var(--ec, rgba(255, 45, 149, 0.7));
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.career-event.available { cursor: pointer; }
.career-event.available:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 45, 149, 0.07); transform: translateX(3px); }
.career-event.locked { opacity: 0.38; filter: grayscale(0.5); }
.event-index { font-family: var(--display); font-size: 28px; font-style: italic; font-weight: 900; color: var(--ec, var(--pink)); opacity: 0.65; }
.event-main > span { color: rgba(255, 255, 255, 0.34); font-size: 7px; letter-spacing: 0.15em; }
.event-main b { display: block; margin-top: 2px; font-family: var(--display); font-size: 20px; font-style: italic; letter-spacing: 0.01em; }
.event-main small { display: block; margin-top: 3px; color: rgba(255, 255, 255, 0.3); font-size: 8px; }
.event-rule { color: rgba(255, 255, 255, 0.38); font-size: 8px; line-height: 1.7; }
.event-rule b { color: rgba(255, 255, 255, 0.75); font-weight: 700; }
.event-medal { display: flex; gap: 5px; }
.event-medal i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.2); font-size: 9px; font-style: normal; }
.event-medal i.gold { background: var(--amber); color: #291600; border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 211, 110, 0.3); }
.event-medal i.silver { background: #c8d4e8; color: #18202e; border-color: #c8d4e8; }
.event-medal i.bronze { background: #d18a58; color: #261208; border-color: #d18a58; }
.event-action { justify-self: end; }
.event-action button { min-width: 94px; padding: 9px 12px; border: 1px solid rgba(255, 45, 149, 0.45); background: rgba(255, 45, 149, 0.09); color: #fff; font-size: 8px; letter-spacing: 0.1em; cursor: pointer; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); }
.event-action button:disabled { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); color: rgba(255, 255, 255, 0.25); cursor: default; }
.event-status { display: block; color: rgba(255, 255, 255, 0.28); font-size: 7px; letter-spacing: 0.07em; margin-top: 5px; }

/* Settings */
.settings-screen { z-index: 56; }
.settings-card { width: min(680px, 94vw); }
.settings-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 17px; }
.settings-head h2 { margin-top: 2px; }
.settings-close { width: 34px; height: 34px; font-size: 20px; font-weight: 300; line-height: 1; }
.settings-grid { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 49px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}
.setting-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.setting-row b { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }
.setting-row small { color: rgba(255, 255, 255, 0.3); font-size: 8px; letter-spacing: 0.02em; }
.setting-row select {
  min-width: 114px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 9px;
  outline: none;
  cursor: pointer;
}
.setting-row select:focus { border-color: var(--pink); }
.setting-row option { background: #12051f; color: #fff; }
.switch { position: relative; width: 42px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.12); transition: background 0.2s, border-color 0.2s; }
.switch i::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 2.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); transition: transform 0.2s, background 0.2s; }
.switch input:checked + i { background: rgba(39, 230, 255, 0.18); border-color: rgba(39, 230, 255, 0.5); }
.switch input:checked + i::after { transform: translateX(19px); background: var(--cyan); box-shadow: 0 0 9px rgba(39, 230, 255, 0.6); }
.volume-row input[type="range"] { width: 170px; accent-color: var(--pink); cursor: pointer; }
.settings-hint { display: flex; flex-direction: column; gap: 4px; margin: 15px 0 5px; color: rgba(255, 255, 255, 0.27); font-size: 8px; line-height: 1.7; letter-spacing: 0.04em; }
.renderer-status { margin-top: 7px; padding: 6px 9px; border: 1px solid rgba(39, 230, 255, 0.18); background: rgba(39, 230, 255, 0.045); color: rgba(255, 255, 255, 0.4); font-size: 8px; letter-spacing: 0.04em; }
.renderer-status b { color: var(--cyan); font-family: var(--display); font-size: 11px; font-style: italic; letter-spacing: 0.04em; }
.renderer-status.fallback b { color: var(--amber); }
.settings-card .modal-actions { margin-top: 16px; }

.install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(39, 230, 255, 0.16);
  background: linear-gradient(100deg, rgba(8, 24, 30, 0.6), rgba(255, 255, 255, 0.02));
}
.install-row > div { min-width: 0; }
.install-row span { display: block; color: var(--cyan); font-size: 7px; letter-spacing: 0.18em; }
.install-row b { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; }
.install-row small { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.28); font-size: 7px; }
.install-row button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 13px;
  border: 1px solid rgba(39, 230, 255, 0.4);
  background: rgba(39, 230, 255, 0.08);
  color: var(--cyan);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.install-row button:disabled { opacity: 0.35; cursor: default; }
.install-row.installed { border-color: rgba(82, 255, 184, 0.28); }
.install-row.installed span, .install-row.installed button { color: #52ffb8; border-color: rgba(82, 255, 184, 0.35); }

.challenge-screen { z-index: 58; }
.challenge-card { width: min(570px, 94vw); }
.challenge-card h2 { margin: 5px 0 0; font-family: var(--display); font-size: 34px; font-style: italic; letter-spacing: -0.01em; }
.challenge-card > p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.4); font-size: 10px; line-height: 1.6; }
.challenge-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 18px; border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.08); }
.challenge-info:empty { display: none; }
.challenge-import.is-hidden { display: none; }
.challenge-actions .is-hidden { display: none; }
.challenge-info > div { padding: 10px 11px; background: rgba(8, 3, 20, 0.9); }
.challenge-info span { display: block; color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.15em; }
.challenge-info b { display: block; margin-top: 4px; font-family: var(--display); font-size: 17px; font-style: italic; font-variant-numeric: tabular-nums; }
.challenge-info small { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.28); font-size: 7px; }
.challenge-import { margin-top: 15px; }
.challenge-import label { display: block; margin-bottom: 5px; color: rgba(255, 255, 255, 0.35); font-size: 8px; letter-spacing: 0.08em; }
.challenge-import textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--body);
  font-size: 9px;
  line-height: 1.5;
  outline: none;
}
.challenge-import textarea:focus { border-color: var(--pink); }
.challenge-import > button { margin-top: 7px; padding: 7px 14px; border: 1px solid rgba(255, 45, 149, 0.4); background: rgba(255, 45, 149, 0.08); color: var(--pink-soft); font-size: 8px; cursor: pointer; }
.challenge-error { min-height: 14px; margin-top: 5px; color: #ff6b9e; font-size: 8px; }
.challenge-actions { margin-top: 18px; }
.challenge-actions .primary-btn, .challenge-actions .ghost-btn { font-size: 11px; }
.challenge-share-result { margin-top: 10px; color: rgba(255, 255, 255, 0.34); font-size: 8px; line-height: 1.6; word-break: break-all; }
.challenge-share-result b { display: block; color: #52ffb8; font-size: 9px; letter-spacing: 0.06em; }
.challenge-share-result small { display: block; margin-top: 3px; color: rgba(255, 255, 255, 0.26); font-size: 7px; }
.challenge-share-result textarea { width: 100%; min-height: 52px; margin-top: 6px; padding: 7px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.3); color: rgba(255, 255, 255, 0.6); font-size: 8px; }

/* Results extras */
.result-extra { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.reward-chip { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.035); font-size: 8px; color: rgba(255, 255, 255, 0.4); letter-spacing: 0.08em; }
.reward-chip b { font-family: var(--display); font-size: 14px; font-style: italic; color: var(--amber); }
.reward-chip.record { border-color: rgba(39, 230, 255, 0.35); color: var(--cyan); }
.reward-chip.record b { color: var(--cyan); font-size: 11px; }
.reward-chip.unlock { border-color: rgba(255, 45, 149, 0.4); color: var(--pink-soft); }
.reward-chip.unlock b { color: #fff; font-size: 10px; }

/* -------------------------------- 3.0 Garage ------------------------------ */

.garage-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px;
  border: 1px solid rgba(255, 179, 71, 0.16);
  background: linear-gradient(110deg, rgba(255, 179, 71, 0.045), rgba(46, 230, 214, 0.025));
}
.garage-stage { position: relative; min-height: 330px; overflow: hidden; background: radial-gradient(70% 90% at 50% 58%, rgba(255, 154, 61, 0.12), #07040a 58%, #07040a); }
#garageCanvas { display: block; width: 100%; height: 330px; touch-action: none; cursor: grab; }
#garageCanvas:active { cursor: grabbing; }
.garage-badge { position: absolute; top: 11px; left: 13px; padding: 4px 8px; border: 1px solid rgba(46, 230, 214, 0.3); color: var(--cyan); font-size: 7px; letter-spacing: 0.2em; background: rgba(2, 12, 14, 0.55); }
.garage-hint { position: absolute; right: 13px; bottom: 10px; color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.12em; }
.garage-side { display: flex; flex-direction: column; gap: 9px; padding: 16px 15px; border-left: 1px solid rgba(255, 255, 255, 0.08); }
.garage-label { color: rgba(255, 255, 255, 0.35); font-size: 7px; letter-spacing: 0.22em; }
.paint-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.paint-swatch { width: 30px; height: 30px; border: 2px solid rgba(255, 255, 255, 0.18); background: var(--pc); cursor: pointer; position: relative; transition: transform 0.18s, border-color 0.18s; }
.paint-swatch:hover { transform: translateY(-2px); }
.paint-swatch.on { border-color: #fff; box-shadow: 0 0 18px var(--pc); }
.paint-swatch.on::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(0, 0, 0, 0.72); font-size: 13px; font-weight: 900; }
.garage-side b { font-family: var(--display); font-size: 18px; font-style: italic; letter-spacing: 0.04em; color: var(--pink-soft); }
.garage-side p { margin: 0; color: rgba(255, 255, 255, 0.3); font-size: 8px; line-height: 1.75; }
@media (max-width: 760px) {
  .garage-panel { grid-template-columns: 1fr; }
  .garage-side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  #garageCanvas { height: 260px; }
  .garage-stage { min-height: 260px; }
}
.upgrade-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

.upgrade-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.upgrade-head b { font-family: var(--display); font-size: 15px; font-style: italic; color: rgba(255, 255, 255, 0.82); }
.upgrade-head em { margin-left: auto; color: var(--amber); font-style: normal; font-size: 9px; }
.upgrade-head small { color: rgba(255, 255, 255, 0.3); font-size: 8px; }
.upgrade-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 132px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid var(--uc, var(--cyan));
  background: linear-gradient(100deg, rgba(15, 5, 29, 0.9), rgba(7, 2, 17, 0.6));
}
.upgrade-name { display: flex; flex-direction: column; gap: 1px; }
.upgrade-name span { color: var(--uc, var(--cyan)); font-size: 7px; letter-spacing: 0.18em; }
.upgrade-name b { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.upgrade-name small { color: rgba(255, 255, 255, 0.28); font-size: 7px; }
.upgrade-level { display: flex; flex-direction: column; gap: 4px; }
.upgrade-level small { color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.09em; }
.upgrade-pips { display: flex; gap: 3px; }
.upgrade-pips i { width: 16px; height: 4px; background: rgba(255, 255, 255, 0.1); transform: skewX(-24deg); }
.upgrade-pips i.on { background: var(--uc, var(--cyan)); box-shadow: 0 0 7px var(--uc, var(--cyan)); }
.upgrade-row button {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.upgrade-row button:hover:not(:disabled) { border-color: var(--uc, var(--cyan)); background: rgba(39, 230, 255, 0.09); color: #fff; }
.upgrade-row button:disabled { opacity: 0.32; cursor: default; }

.ghost-delta span { color: var(--cyan); }
.ghost-delta b { color: rgba(255, 255, 255, 0.36); }

/* Replay & photo mode */
.replay-screen {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: radial-gradient(80% 70% at 50% 50%, transparent 30%, rgba(3, 0, 10, 0.52) 100%);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.replay-top {
  position: absolute;
  top: clamp(18px, 3.3vw, 38px);
  left: clamp(18px, 4vw, 58px);
  right: clamp(18px, 4vw, 58px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.replay-title span { display: block; color: var(--pink); font-size: 8px; letter-spacing: 0.28em; font-weight: 700; }
.replay-title b { display: block; margin-top: 4px; font-family: var(--display); font-size: clamp(20px, 2.7vw, 36px); font-style: italic; letter-spacing: -0.01em; }
.replay-title small { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.34); font-size: 8px; letter-spacing: 0.13em; }
.replay-clock { display: flex; align-items: baseline; gap: 7px; font-family: var(--display); font-style: italic; font-variant-numeric: tabular-nums; }
.replay-clock b { font-size: clamp(18px, 2.1vw, 28px); color: #fff; }
.replay-clock i { color: rgba(255, 255, 255, 0.25); font-style: normal; font-size: 14px; }
.replay-clock span { color: rgba(255, 255, 255, 0.38); font-size: 12px; }

.replay-bar {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 2.7vw, 30px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(980px, calc(100vw - 40px));
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 1, 14, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease, pointer-events 0.2s ease;
}
.replay-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.replay-btn:hover { border-color: var(--pink); background: rgba(255, 45, 149, 0.12); color: #fff; }
.replay-play { min-width: 64px; border-color: rgba(255, 45, 149, 0.5); color: var(--pink-soft); }
.replay-photo { border-color: rgba(39, 230, 255, 0.35); color: var(--cyan); }
.replay-seek {
  flex: 1;
  min-width: 90px;
  height: 24px;
  margin: 0 2px;
  accent-color: var(--pink);
  background: transparent;
  cursor: pointer;
}
.replay-seek::-webkit-slider-runnable-track { height: 3px; background: rgba(255, 255, 255, 0.16); }
.replay-seek::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -3.5px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px rgba(255, 45, 149, 0.8); }
.replay-seek::-moz-range-track { height: 3px; background: rgba(255, 255, 255, 0.16); }
.replay-seek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--pink); }

.photo-bar {
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  top: clamp(18px, 3.2vw, 38px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(39, 230, 255, 0.34);
  background: rgba(5, 1, 14, 0.86);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.photo-bar span { color: var(--cyan); font-size: 8px; letter-spacing: 0.22em; font-weight: 700; }
.photo-bar small { color: rgba(255, 255, 255, 0.3); font-size: 8px; letter-spacing: 0.05em; }
.replay-screen.photo-mode .replay-top,
.replay-screen.photo-mode .replay-bar { opacity: 0; visibility: hidden; pointer-events: none; }
.replay-screen.photo-mode .photo-bar { opacity: 1; visibility: visible; pointer-events: auto; }

.record-replay {
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(39, 230, 255, 0.3);
  background: rgba(39, 230, 255, 0.06);
  color: var(--cyan);
  font-size: 7px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.record-replay:hover { background: rgba(39, 230, 255, 0.14); }
.record-replay.challenge { border-color: rgba(255, 45, 149, 0.35); color: var(--pink-soft); background: rgba(255, 45, 149, 0.06); }
.record-replay.challenge:hover { background: rgba(255, 45, 149, 0.14); }
.record-head-actions { display: flex; align-items: center; gap: 10px; }
.record-head-actions p { margin: 0; color: rgba(255, 255, 255, 0.3); font-size: 8px; letter-spacing: 0.06em; }
.record-import {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 45, 149, 0.32);
  background: rgba(255, 45, 149, 0.07);
  color: var(--pink-soft);
  font-size: 7px;
  letter-spacing: 0.07em;
  cursor: pointer;
}
.record-import:hover { background: rgba(255, 45, 149, 0.15); color: #fff; }

/* Driver profile */
.profile-screen {
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(39, 230, 255, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(4, 1, 12, 0.985) 0%, rgba(4, 1, 12, 0.97) 50%, rgba(4, 1, 12, 0.995) 100%);
}
.profile-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 20px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.07);
}
.profile-stat { padding: 11px 14px; background: rgba(7, 2, 17, 0.94); }
.profile-stat span { display: block; color: rgba(255, 255, 255, 0.3); font-size: 7px; letter-spacing: 0.16em; margin-bottom: 3px; }
.profile-stat b { font-family: var(--display); font-size: 20px; font-style: italic; }
.profile-stat small { font-family: var(--body); font-size: 7px; color: rgba(255, 255, 255, 0.3); margin-left: 3px; font-style: normal; }

.profile-tabs { display: flex; gap: 3px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 14px; }
.profile-tabs button {
  padding: 10px 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.34);
  font-size: 9px;
  letter-spacing: 0.13em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.profile-tabs button:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.profile-tabs button.active { color: #fff; border-color: var(--pink); background: rgba(255, 45, 149, 0.07); }

.profile-content { padding-bottom: 30px; }
.profile-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 2px 0 11px; }
.profile-section-head > div span { color: var(--pink); font-size: 7px; letter-spacing: 0.26em; font-weight: 700; }
.profile-section-head h3 { margin: 3px 0 0; font-family: var(--display); font-size: 24px; font-style: italic; letter-spacing: -0.01em; }
.profile-section-head p { margin: 0; color: rgba(255, 255, 255, 0.3); font-size: 8px; letter-spacing: 0.06em; }
.profile-note { margin-top: 12px; color: rgba(255, 255, 255, 0.27); font-size: 8px; letter-spacing: 0.07em; }

.daily-list { display: flex; flex-direction: column; gap: 7px; }
.daily-card { display: grid; grid-template-columns: 52px 1fr 100px; align-items: center; gap: 15px; padding: 13px 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-left: 2px solid var(--dc, var(--pink)); background: linear-gradient(100deg, rgba(16, 5, 30, 0.92), rgba(7, 2, 17, 0.7)); }
.daily-card.done { background: linear-gradient(100deg, rgba(14, 31, 28, 0.9), rgba(7, 2, 17, 0.7)); }
.daily-icon, .achievement-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 50%; color: var(--dc, var(--pink)); font-family: var(--display); font-size: 12px; font-style: italic; }
.daily-card.done .daily-icon { background: rgba(82, 255, 184, 0.13); color: #52ffb8; border-color: rgba(82, 255, 184, 0.4); }
.daily-main { min-width: 0; }
.daily-main > span { color: rgba(255, 255, 255, 0.28); font-size: 7px; letter-spacing: 0.14em; }
.daily-main b { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.daily-state { text-align: right; }
.daily-state b { display: block; font-family: var(--display); font-size: 17px; font-style: italic; color: var(--dc, var(--pink)); }
.daily-state small { display: block; color: rgba(255, 255, 255, 0.28); font-size: 7px; letter-spacing: 0.1em; }
.progress-track { height: 3px; margin-top: 8px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--dc, var(--pink)); box-shadow: 0 0 8px var(--dc, var(--pink)); }

.achievement-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.achievement-card { display: grid; grid-template-columns: 50px 1fr 90px; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid rgba(255, 255, 255, 0.08); background: linear-gradient(100deg, rgba(15, 5, 29, 0.9), rgba(7, 2, 17, 0.64)); opacity: 0.72; }
.achievement-card.unlocked { opacity: 1; border-color: rgba(82, 255, 184, 0.24); background: linear-gradient(100deg, rgba(12, 30, 26, 0.9), rgba(7, 2, 17, 0.7)); }
.achievement-card.unlocked .achievement-icon { border-color: rgba(82, 255, 184, 0.4); background: rgba(82, 255, 184, 0.1); color: #52ffb8; }
.achievement-main { min-width: 0; }
.achievement-main > span { color: var(--pink); font-size: 6px; letter-spacing: 0.18em; }
.achievement-main b { display: block; margin-top: 1px; font-size: 12px; font-weight: 700; }
.achievement-main small { display: block; color: rgba(255, 255, 255, 0.3); font-size: 7px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achievement-reward { text-align: right; }
.achievement-reward b { font-family: var(--display); font-size: 16px; font-style: italic; color: var(--amber); }
.achievement-reward small { color: rgba(255, 255, 255, 0.3); font-size: 7px; margin-left: 2px; }
.achievement-reward em { display: block; margin-top: 3px; color: rgba(255, 255, 255, 0.28); font-style: normal; font-size: 7px; letter-spacing: 0.05em; }

.record-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.record-block { padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-left: 2px solid var(--rc, var(--pink)); background: rgba(9, 3, 20, 0.78); }
.record-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.record-head span { display: block; color: rgba(255, 255, 255, 0.26); font-size: 6px; letter-spacing: 0.17em; }
.record-head b { display: block; font-family: var(--display); font-size: 16px; font-style: italic; letter-spacing: 0.01em; }
.record-head em { color: var(--rc, var(--pink)); font-style: normal; font-family: var(--display); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-head-right { display: flex; align-items: center; gap: 7px; }
.record-list { padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.record-row { display: grid; grid-template-columns: 18px 1fr 1fr 32px; gap: 6px; align-items: baseline; font-size: 8px; color: rgba(255, 255, 255, 0.35); }
.record-row span { color: var(--rc, var(--pink)); font-family: var(--display); font-style: italic; }
.record-row b { color: rgba(255, 255, 255, 0.8); font-family: var(--display); font-style: italic; font-variant-numeric: tabular-nums; }
.record-row em { font-style: normal; color: rgba(255, 255, 255, 0.34); }
.record-row small { text-align: right; color: rgba(255, 255, 255, 0.26); }
.record-empty { padding: 9px 0; color: rgba(255, 255, 255, 0.24); font-size: 8px; letter-spacing: 0.06em; }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.photo-card { margin: 0; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(8, 3, 18, 0.86); overflow: hidden; }
.photo-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #07020e; }
.photo-card figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 9px 5px; }
.photo-card figcaption span { font-family: var(--display); font-size: 12px; font-style: italic; color: rgba(255, 255, 255, 0.8); }
.photo-card figcaption small { color: rgba(255, 255, 255, 0.28); font-size: 7px; white-space: nowrap; }
.photo-actions { display: flex; gap: 5px; padding: 0 9px 8px; }
.photo-actions button {
  flex: 1;
  min-height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.55);
  font-size: 7px;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.photo-actions button:hover { border-color: var(--cyan); color: var(--cyan); }
.photo-actions button[data-photo-delete]:hover { border-color: var(--pink); color: var(--pink); }
.photo-empty { grid-column: 1 / -1; padding: 34px 14px; border: 1px dashed rgba(255, 255, 255, 0.12); text-align: center; color: rgba(255, 255, 255, 0.28); font-size: 9px; letter-spacing: 0.05em; }

@media (max-width: 1080px) {
  .menu-side-note { display: none; }
  .game-title { font-size: clamp(66px, 11.8vw, 148px); }
  .leaderboard { width: 172px; }
  .best-lap-card { display: none; }
}

@media (max-width: 760px) {
  .brand-line { font-size: 7px; letter-spacing: 0.16em; gap: 8px; }
  .brand-line i { width: 18px; }
  .menu-shell { padding: 20px 22px; }
  .title-wrap { padding-top: 2vh; }
  .game-title { font-size: clamp(48px, 15.4vw, 102px); line-height: 0.86; }
  .title-copy { font-size: 11px; line-height: 1.7; }
  .title-copy br { display: none; }
  .title-rule { width: 100%; margin-top: 12px; }
  .title-rule b { font-size: 9px; letter-spacing: 0.24em; }
  .menu-actions { gap: 16px; margin-bottom: 3vh; flex-direction: column; align-items: flex-start; }
  .start-btn { min-width: 265px; width: min(100%, 340px); padding: 14px 21px 14px 25px; }
  .start-copy b { font-size: 20px; }
  .menu-meta { gap: 22px; }
  .controls-hint { gap: 8px 15px; font-size: 9px; }
  .controls-hint span:first-child { display: none; }
  .menu-footer { padding-top: 12px; }
  .record-chip b { font-size: 16px; }
  .hud-tl { left: 14px; gap: 11px; }
  .hud-tr { right: 14px; }
  .stat-label { font-size: 8px; letter-spacing: 0.2em; }
  .stat-value b { font-size: 30px; }
  .stat-value small { font-size: 11px; }
  .stat-divider { height: 31px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .race-clock { top: 78px; }
  .clock-kicker { font-size: 7px; }
  .race-clock > b { font-size: 19px; }
  .leaderboard { display: none; }
  .speed-cluster { left: 50%; right: auto; transform: translateX(-50%); width: 210px; bottom: max(4px, env(safe-area-inset-bottom)); align-items: center; }
  .speed-dial { width: 178px; height: 140px; }
  .dial-svg { width: 176px; height: 176px; }
  .dial-readout { inset: 26px 0 auto; }
  .dial-readout span { font-size: 45px; }
  .dial-readout small { font-size: 7px; margin-top: 3px; }
  .gear-badge { bottom: 9px; }
  .nitro-wrap { width: 184px; }
  .nitro-hint { display: none; }
  .countdown-num { font-size: clamp(130px, 37vw, 270px); }
  .center-screen { padding: 14px; }
  .modal-card { padding: 27px 23px; }
  .result-grid > div { padding: 10px; }
  .result-grid b { font-size: 15px; }
  .modal-actions { flex-direction: column; }
  .pause-card .modal-actions { flex-direction: column; }
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
  .hud.is-hidden ~ .touch-controls { display: none; }
  .supports-touch .controls-hint { display: none; }
  .supports-touch .menu-footer::before {
    content: "左侧转向 · 右侧油门 / 刹车 / 氮气";
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    letter-spacing: 0.08em;
  }
  .supports-touch .leaderboard { display: none; }
  .supports-touch .best-lap-card { display: none; }
  .supports-touch .speed-cluster {
    top: max(72px, calc(env(safe-area-inset-top) + 62px));
    right: max(14px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
    transform: none;
    width: 154px;
    align-items: flex-end;
  }
  .supports-touch .speed-dial { width: 138px; height: 109px; }
  .supports-touch .dial-svg { width: 136px; height: 136px; }
  .supports-touch .dial-readout { inset: 18px 0 auto; }
  .supports-touch .dial-readout span { font-size: 37px; }
  .supports-touch .dial-readout small { font-size: 6px; margin-top: 3px; letter-spacing: 0.3em; }
  .supports-touch .gear-badge { bottom: 3px; padding: 2px 7px; }
  .supports-touch .gear-badge span { font-size: 6px; }
  .supports-touch .gear-badge b { font-size: 12px; }
  .supports-touch .nitro-wrap { width: 142px; margin-top: -5px; }
  .supports-touch .nitro-head { margin-bottom: 3px; }
  .supports-touch .nitro-head span { font-size: 6px; }
  .supports-touch .nitro-head em { font-size: 9px; }
  .supports-touch .nitro-track { height: 7px; }
  .supports-touch .nitro-hint { display: none; }
  .supports-touch .rotate-hint { display: block; }
  .hud:not(.is-hidden) ~ .rotate-hint { display: none !important; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .menu-shell { padding: 15px 25px; }
  .brand-line { font-size: 7px; }
  .title-wrap { padding-top: 1vh; margin-top: auto; margin-bottom: auto; }
  .game-title { font-size: clamp(52px, 9.6vw, 100px); }
  .title-kicker { font-size: 7px; }
  .title-copy { display: none; }
  .title-rule { margin-top: 11px; }
  .menu-actions { margin-bottom: 2.2vh; gap: 20px; }
  .start-btn { min-width: 250px; padding: 11px 22px; }
  .start-copy b { font-size: 19px; }
  .start-copy small { font-size: 7px; margin-bottom: 3px; }
  .start-arrow { font-size: 28px; }
  .menu-footer { padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .controls-hint { font-size: 8px; gap: 11px; }
  .controls-hint span:first-child { display: inline-flex; }
  .record-chip b { font-size: 15px; }
  .hud-tr { top: 13px; }
  .hud-tl { top: 12px; }
  .race-clock { top: 10px; }
  .leaderboard { top: 76px; transform: scale(0.92); transform-origin: top right; }
  .speed-dial { width: 195px; height: 146px; }
  .dial-svg { width: 194px; height: 194px; }
  .speed-cluster { bottom: -4px; }
  .speed-dial { margin-bottom: -2px; }
  .nitro-wrap { width: 200px; }
  .countdown-num { font-size: clamp(110px, 21vw, 210px); }
  .touch-btn.steer { width: 54px; height: 54px; }
  .touch-btn.gas { width: 62px; height: 62px; }
  .touch-btn.brake { width: 47px; height: 47px; }
  .touch-btn.nitro { width: 54px; height: 54px; }
  .rotate-hint { display: none !important; }
  .center-screen { padding: 8px; }
  .result-card { width: min(620px, 94vw); padding: 15px 24px 17px; }
  .result-card .modal-eyebrow { margin-bottom: 4px; }
  .result-head { column-gap: 14px; }
  .result-rank { font-size: 58px; }
  .result-head h2 { font-size: 33px; }
  .result-head p { margin-top: 4px; font-size: 10px; }
  .result-grid { margin-top: 12px; }
  .result-grid > div { padding: 8px 12px; }
  .result-grid b { font-size: 16px; }
  .result-bars { display: none; }
  .result-card .modal-actions { margin-top: 13px; }
  .result-card .primary-btn, .result-card .ghost-btn { min-height: 40px; }
  .pause-card { padding: 22px 28px; }
  .pause-card h2 { font-size: 35px; }
  .pause-card > p { margin: 8px 0 15px; }
}

@media (orientation: portrait) and (max-width: 600px) {
  .rotate-hint { display: block; }
  .brand-line span:last-child { display: none; }
  .brand-line i { display: none; }
  .title-wrap { padding-top: 9vh; }
  .title-rule { width: 100%; }
  .menu-actions { margin-top: auto; }
  .menu-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .touch-controls { padding-bottom: 20px; }
  .touch-steer { gap: 8px; }
  .touch-btn.steer { width: 56px; height: 56px; }
  .touch-pedals {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  .touch-btn.gas { width: 66px; height: 66px; }
  .touch-btn.brake { width: 48px; height: 48px; }
  .touch-btn.nitro { width: 54px; height: 54px; }
  .race-toast { top: 31%; font-size: 17px; padding: 8px 20px; }
  .supports-touch .speed-cluster { top: max(86px, calc(env(safe-area-inset-top) + 76px)); }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .supports-touch .menu-meta { display: none; }
  .supports-touch .menu-actions { margin-bottom: 1.6vh; }
}

@media (max-width: 1080px) {
  .upgrade-list { grid-template-columns: 1fr; }
  .minimap-panel { width: 168px; top: 108px; }
  .race-data-card { width: 258px; }
  .profile-chip { right: clamp(26px, 4vw, 50px); }
  .career-event { grid-template-columns: 45px minmax(0, 1.2fr) minmax(0, 0.9fr) 100px 108px; gap: 12px; }
  .event-main b { font-size: 18px; }
}

@media (max-width: 900px) {
  .minimap-panel { display: none; }
  .race-data-card { width: 242px; }
  .career-event { grid-template-columns: 40px minmax(0, 1fr) 90px 105px; gap: 10px; }
  .event-rule { display: none; }
  .setup-start { min-width: 205px; }
  .car-card { grid-template-columns: 40% 1fr; }
}

@media (max-width: 760px) {
  .profile-chip { top: 18px; right: 18px; padding: 6px 9px; }
  .profile-chip > span:first-of-type { display: none; }
  .profile-chip i { margin: 0 3px; }
  .menu-subactions { width: 100%; margin-bottom: 16px; }
  .subaction-btn { flex: 1; min-width: 0; padding: 8px 7px; gap: 7px; }
  .subaction-icon { width: 22px; height: 22px; font-size: 11px; }
  .subaction-btn b { font-size: 10px; letter-spacing: 0.03em; white-space: nowrap; }
  .subaction-btn small { font-size: 6px; letter-spacing: 0.12em; }
  .menu-footer { margin-top: auto; }
  .minimap-panel, .race-data-card { display: none; }
  .start-lights { gap: 7px; margin-bottom: 18px; }
  .start-lights i { width: 34px; height: 9px; }
  .event-label { font-size: 6px; letter-spacing: 0.12em; }
  .subpage-shell { padding: 15px 14px 20px; }
  .subpage-head { gap: 10px; padding-bottom: 13px; }
  .subpage-title > span { font-size: 6px; letter-spacing: 0.18em; }
  .subpage-title h2 { font-size: 25px; }
  .back-btn { padding: 7px 9px; font-size: 8px; }
  .wallet { padding-left: 9px; gap: 3px; }
  .wallet b { font-size: 18px; }
  .wallet span { display: none; }
  .setup-body { padding: 16px 0 158px; gap: 18px; }
  .section-head { align-items: flex-start; gap: 9px; flex-direction: column; margin-bottom: 9px; }
  .section-head p { font-size: 8px; }
  .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .track-card { min-height: 124px; padding: 11px; }
  .track-name { margin-top: 17px; }
  .track-name b { font-size: 16px; }
  .track-meta { margin-top: 10px; gap: 7px; font-size: 7px; }
  .car-grid { grid-template-columns: 1fr; gap: 7px; }
  .car-card { min-height: 118px; grid-template-columns: 37% 1fr; padding: 9px 10px; }
  .car-info b { font-size: 17px; }
  .car-bars { margin-top: 6px; }
  .car-lock { inset: auto 8px 8px 8px; padding: 5px 7px; }
  .setup-footer { flex-direction: column; align-items: stretch; gap: 11px; padding-top: 12px; }
  .setup-summary b { font-size: 15px; }
  .setup-start { width: 100%; min-width: 0; }
  .career-summary { grid-template-columns: repeat(2, 1fr); margin: 14px 0 12px; }
  .career-stat { padding: 9px 11px; }
  .career-stat b { font-size: 18px; }
  .career-event { grid-template-columns: 34px minmax(0, 1fr) 92px; gap: 9px; padding: 11px; }
  .event-index { font-size: 23px; }
  .event-main b { font-size: 16px; }
  .event-main small { font-size: 7px; }
  .event-medal { display: none; }
  .event-action { grid-column: 3; grid-row: 1 / 3; }
  .event-action button { min-width: 84px; padding: 8px 7px; font-size: 7px; }
  .settings-card { padding: 22px 18px; }
  .setting-row { gap: 10px; min-height: 45px; }
  .setting-row b { font-size: 10px; }
  .setting-row small { font-size: 7px; }
  .setting-row select { min-width: 97px; font-size: 8px; }
  .volume-row input[type="range"] { width: 112px; }
  .settings-hint { font-size: 7px; }
  .settings-card .modal-actions { flex-direction: row; }
  .result-extra { gap: 5px; }
  .reward-chip { padding: 5px 8px; font-size: 7px; }
}

@media (hover: none) and (pointer: coarse) {
  .supports-touch .minimap-panel,
  .supports-touch .race-data-card,
  .supports-touch .profile-chip { display: none; }
  .supports-touch .event-label { display: none; }
  .supports-touch .pad-hint { display: none; }
  .supports-touch .start-lights { margin-bottom: 16px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .subpage-shell { padding: 12px 18px 14px; min-height: 100dvh; }
  .subpage-head { gap: 14px; padding-bottom: 10px; }
  .subpage-title h2 { font-size: 25px; }
  .subpage-title > span { font-size: 6px; }
  .back-btn { padding: 6px 9px; }
  .wallet b { font-size: 18px; }
  .setup-body { padding: 12px 0 92px; gap: 14px; }
  .section-head { margin-bottom: 7px; }
  .track-card { min-height: 111px; padding: 10px 12px; }
  .track-name { margin-top: 15px; }
  .track-name b { font-size: 19px; }
  .track-meta { margin-top: 9px; }
  .car-card { min-height: 122px; padding: 8px 11px; grid-template-columns: 36% 1fr; }
  .car-art img { max-height: 100px; width: auto; }
  .car-info b { font-size: 16px; }
  .car-bars { gap: 2px; margin-top: 5px; }
  .setup-footer { padding-top: 9px; }
  .setup-start { min-width: 185px; padding: 9px 19px; }
  .career-summary { margin: 10px 0 8px; }
  .career-summary .career-stat { padding: 8px 12px; }
  .career-stat b { font-size: 17px; }
  .career-event { padding: 8px 12px; }
  .event-main b { font-size: 17px; }
  .event-main small { margin-top: 1px; }
  .settings-card { max-height: calc(100dvh - 16px); padding: 16px 24px 18px; }
  .settings-head { margin-bottom: 8px; }
  .setting-row { min-height: 38px; padding: 5px 0; }
  .settings-hint { margin: 8px 0 2px; gap: 2px; }
  .settings-card .modal-actions { margin-top: 10px; }
  .settings-card .modal-actions .primary-btn,
  .settings-card .modal-actions .ghost-btn { min-height: 38px; }
  .pause-card { max-height: calc(100dvh - 16px); padding: 18px 26px; }
  .pause-card h2 { font-size: 32px; }
  .pause-card > p { margin: 5px 0 10px; }
  .pause-card .modal-actions.vertical { gap: 5px; margin-top: 10px; }
  .pause-card .primary-btn, .pause-card .ghost-btn { min-height: 34px; }
  .pause-card .modal-key-hint { display: none; }
  .start-lights { margin-bottom: 12px; }
  .start-lights i { width: 36px; height: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .start-glow { animation: none; }
  * { scroll-behavior: auto; }
}

.career-screen {
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(45, 11, 72, 0.28), transparent 75%),
    linear-gradient(180deg, rgba(4, 1, 12, 0.985) 0%, rgba(4, 1, 12, 0.965) 52%, rgba(4, 1, 12, 0.995) 100%);
}
.career-screen .career-event {
  background: linear-gradient(100deg, rgba(18, 6, 33, 0.985), rgba(8, 2, 18, 0.975));
}
.career-screen .career-event.locked {
  opacity: 1;
  filter: grayscale(0.45) brightness(0.62);
}
.career-screen .career-event.available:hover { background: rgba(255, 45, 149, 0.12); }

@media (max-width: 760px) {
  .replay-top { top: 14px; left: 14px; right: 14px; }
  .replay-title b { font-size: 20px; }
  .replay-title small { font-size: 7px; }
  .replay-clock b { font-size: 16px; }
  .replay-clock span { font-size: 10px; }
  .replay-bar { bottom: 10px; width: calc(100vw - 20px); flex-wrap: wrap; gap: 5px; padding: 7px; }
  .replay-seek { order: -1; flex: 1 0 100%; }
  .replay-btn { padding: 6px 8px; font-size: 8px; }
  .replay-play { min-width: 52px; }
  .photo-bar { left: 10px; right: 10px; top: 10px; bottom: auto; flex-wrap: wrap; justify-content: center; }
  .photo-bar small { flex: 1 0 100%; text-align: center; }
  .record-head { align-items: center; }
  .record-head em { font-size: 9px; }
  .record-head-actions { flex-direction: column; align-items: flex-end; gap: 4px; }
  .record-head-actions p { display: none; }
  .record-replay { padding: 2px 5px; font-size: 6px; }
  .challenge-card h2 { font-size: 28px; }
  .challenge-card > p { font-size: 9px; }
  .challenge-info b { font-size: 14px; }
  .challenge-info > div { padding: 8px 9px; }
  .challenge-actions { flex-direction: column; }
  .upgrade-head { flex-wrap: wrap; gap: 4px 8px; }
  .upgrade-head em { margin-left: 0; }
  .upgrade-head small { margin-left: auto; }
  .upgrade-row {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    padding: 9px 10px;
  }
  .upgrade-name { grid-column: 1; }
  .upgrade-level { grid-column: 1; flex-direction: row; align-items: center; gap: 8px; }
  .upgrade-level small { white-space: nowrap; }
  .upgrade-row button { grid-column: 2; grid-row: 1 / 3; padding: 8px 7px; font-size: 7px; }
  .upgrade-pips i { width: 11px; }
  .profile-summary { grid-template-columns: repeat(2, 1fr); margin: 14px 0 12px; }
  .profile-stat { padding: 9px 11px; }
  .profile-stat b { font-size: 18px; }
  .profile-tabs { gap: 0; }
  .profile-tabs button { flex: 1; padding: 9px 4px; font-size: 8px; letter-spacing: 0.04em; }
  .profile-section-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .profile-section-head h3 { font-size: 20px; }
  .profile-section-head p { font-size: 7px; }
  .daily-card { grid-template-columns: 38px 1fr 65px; gap: 9px; padding: 10px; }
  .daily-icon, .achievement-icon { width: 30px; height: 30px; font-size: 10px; }
  .daily-main b { font-size: 11px; }
  .daily-state b { font-size: 14px; }
  .achievement-list { grid-template-columns: 1fr; }
  .achievement-card { grid-template-columns: 42px 1fr 76px; gap: 9px; padding: 9px 10px; }
  .achievement-main b { font-size: 11px; }
  .achievement-reward b { font-size: 14px; }
  .record-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-card figcaption { flex-direction: column; gap: 1px; }
  .photo-card figcaption span { font-size: 10px; }
  .record-block { padding: 10px 12px; }
  .record-head b { font-size: 14px; }
  .record-head em { font-size: 10px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .replay-top { top: 10px; left: 16px; right: 16px; }
  .replay-title b { font-size: 17px; }
  .replay-title small { display: none; }
  .replay-clock b { font-size: 15px; }
  .replay-bar { bottom: 8px; width: min(860px, calc(100vw - 24px)); flex-wrap: nowrap; padding: 5px 6px; }
  .replay-seek { order: 0; flex: 1; }
  .replay-btn { padding: 4px 7px; font-size: 7px; min-height: 28px; }
  .photo-bar { top: 10px; bottom: auto; padding: 7px 9px; }
  .record-replay { font-size: 6px; }
  .upgrade-row { padding: 6px 10px; gap: 8px; }
  .upgrade-head { padding: 5px 10px; }
  .upgrade-name small { display: none; }
  .upgrade-level small { display: none; }
  .upgrade-pips i { width: 13px; height: 3px; }
  .profile-summary { margin: 8px 0 8px; }
  .profile-stat { padding: 6px 10px; }
  .profile-stat b { font-size: 16px; }
  .profile-tabs { margin-bottom: 8px; }
  .profile-tabs button { padding: 7px 12px; }
  .daily-card { padding: 8px 10px; }
  .achievement-card { padding: 7px 9px; }
  .record-block { padding: 8px 10px; }
}
