/* ============================================================
   NEON DRIFT · 霓虹夜驰 — UI / HUD styles
   ============================================================ */
@font-face {
  font-family: 'Orbitron';
  src: url('fonts/orbitron.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cyan: #00e5ff;
  --magenta: #ff2bd6;
  --amber: #ffb84d;
  --lime: #8dffcf;
  --red: #ff3b5c;
  --bg: #05010f;
  --ink: #e6fdff;
  --ink-dim: rgba(197, 240, 255, 0.55);
  --panel: linear-gradient(160deg, rgba(9, 12, 32, 0.78), rgba(14, 3, 26, 0.55));
  --line: rgba(0, 229, 255, 0.34);
  --font: 'Orbitron', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  touch-action: pan-y;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

#game-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hud {
  touch-action: none;
}

/* ---------------- full screen FX overlays ---------------- */
.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.fx-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.8;
}

.fx-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(125% 100% at 50% 48%, transparent 42%, rgba(2, 0, 8, 0.55) 88%, rgba(2, 0, 8, 0.85) 100%),
    linear-gradient(180deg, rgba(130, 0, 130, 0.08), transparent 26%);
}

.fx-flash {
  display: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 62%, rgba(255, 59, 92, 0.62), rgba(255, 0, 80, 0.12) 55%, transparent 80%);
}

.fx-flash.hit,
.fx-flash.pick,
.fx-flash.boost {
  display: block;
}
.fx-flash.hit {
  animation: flash-hit 0.55s ease-out;
}

.fx-flash.pick {
  background: radial-gradient(circle at 50% 60%, rgba(0, 229, 255, 0.55), transparent 70%);
  animation: flash-pick 0.45s ease-out;
}

.fx-flash.boost {
  background: radial-gradient(circle at 50% 55%, rgba(255, 43, 214, 0.28), transparent 75%);
  animation: flash-pick 0.6s ease-out;
}

@keyframes flash-hit {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes flash-pick {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- HUD ---------------- */
.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: calc(14px + var(--safe-t)) calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.is-hidden {
  display: none !important;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 22px rgba(0, 229, 255, 0.08), 0 0 18px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.score-panel {
  padding: 8px 20px 9px 14px;
  min-width: 152px;
}

.label {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  font-weight: 600;
}

.score-value {
  font-size: 34px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #eafcff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.75), 0 0 26px rgba(255, 43, 214, 0.35);
  font-variant-numeric: tabular-nums;
}

.label.sub {
  margin-top: 2px;
  letter-spacing: 0.18em;
  color: rgba(255, 184, 77, 0.75);
}
.label.sub span {
  color: var(--amber);
  font-weight: 700;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-row {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(8, 12, 30, 0.72);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 14px rgba(0, 229, 255, 0.1);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  color: var(--cyan);
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.1s;
}
.icon-btn:active {
  transform: scale(0.93);
  background: rgba(0, 229, 255, 0.2);
}
.icon-btn.muted {
  color: rgba(120, 160, 175, 0.5);
  text-decoration: line-through;
}
#btn-full svg {
  display: block;
  opacity: 0.9;
}

.dist-panel {
  padding: 5px 12px 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #d9fbff;
  font-variant-numeric: tabular-nums;
}
.dist-panel em {
  font-style: normal;
  font-size: 9px;
  color: var(--ink-dim);
  margin-left: 4px;
  letter-spacing: 0.2em;
}

.health {
  display: flex;
  gap: 5px;
  padding: 3px;
}
.health i {
  display: block;
  width: 26px;
  height: 7px;
  background: linear-gradient(90deg, var(--magenta), var(--red));
  box-shadow: 0 0 9px rgba(255, 59, 92, 0.8);
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  transition: opacity 0.2s, filter 0.2s;
}
.health i.lost {
  opacity: 0.16;
  filter: grayscale(1);
  box-shadow: none;
}

/* combo */
.combo {
  position: absolute;
  left: 50%;
  top: calc(17% + var(--safe-t));
  transform: translateX(-50%) scale(0.9);
  display: flex;
  align-items: baseline;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  text-shadow: 0 0 14px rgba(255, 43, 214, 0.8);
}
.combo.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: combo-pop 0.28s ease-out;
}
.combo-x {
  font-size: 40px;
  font-weight: 900;
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255, 184, 77, 0.85);
}
.combo-label {
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--magenta);
}
@keyframes combo-pop {
  0% { transform: translateX(-50%) scale(1.45); }
  100% { transform: translateX(-50%) scale(1); }
}

/* popups */
.popups {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.popup {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  max-width: 92vw;
  color: var(--lime);
  text-shadow: 0 0 14px rgba(141, 255, 207, 0.9);
  animation: float-up 0.95s cubic-bezier(0.16, 0.9, 0.3, 1) forwards;
  white-space: nowrap;
}
.popup.miss {
  color: #9ff6ff;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.9);
}
.popup.bad {
  color: var(--red);
  text-shadow: 0 0 14px rgba(255, 59, 92, 0.9);
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.85); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -68px) scale(0.98); }
}

/* bottom HUD */
.hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 4px;
}

.speedo {
  min-width: 126px;
}
.speed-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #f2feff;
  font-weight: 800;
  font-size: 56px;
  line-height: 0.92;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.8), 0 0 34px rgba(0, 229, 255, 0.25);
}
.speed-value small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-shadow: none;
}
.speed-bars {
  display: flex;
  gap: 3px;
  margin-top: 7px;
  height: 8px;
}
.speed-bars i {
  flex: 1;
  background: rgba(0, 229, 255, 0.12);
  transform: skewX(-18deg);
  transition: background 0.12s, box-shadow 0.12s;
}
.speed-bars i.on {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
}
.speed-bars i.hot {
  background: var(--magenta);
  box-shadow: 0 0 9px rgba(255, 43, 214, 0.9);
}

.boost {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
}
.boost-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--ink-dim);
  margin-bottom: 5px;
}
.boost-head span:last-child {
  color: var(--cyan);
}
.boost-track {
  position: relative;
  height: 13px;
  background: rgba(5, 9, 24, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.35);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  overflow: hidden;
}
.boost-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #0a4d8f, var(--cyan) 55%, #b9fdff);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.9);
  transition: width 0.12s linear, background 0.25s;
}
.boost-track.low .boost-fill {
  background: linear-gradient(90deg, #6a1030, var(--magenta));
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.9);
}
.boost-track.boosting .boost-fill {
  background: linear-gradient(90deg, #ff9d00, var(--magenta) 60%, #ffd3f8);
  animation: boost-pulse 0.32s infinite alternate;
}
@keyframes boost-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.45); }
}

/* touch boost button */
.boost-btn {
  pointer-events: auto;
  display: none;
  width: 86px;
  height: 86px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #061018;
  background: linear-gradient(150deg, #b6fdff, var(--cyan) 45%, #0b8fb0);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.55), inset 0 0 18px rgba(255, 255, 255, 0.4);
  clip-path: polygon(50% 0, 94% 22%, 100% 68%, 50% 100%, 0 68%, 6% 22%);
  transition: transform 0.08s, filter 0.1s;
  touch-action: none;
}
.boost-btn:active,
.boost-btn.held {
  transform: scale(0.94);
  filter: brightness(1.25);
  background: linear-gradient(150deg, #ffd6fa, var(--magenta) 45%, #ff7be0);
  box-shadow: 0 0 34px rgba(255, 43, 214, 0.85), inset 0 0 18px rgba(255, 255, 255, 0.5);
}

body.touch .boost-btn {
  display: grid;
  place-items: center;
}

/* steer indicator */
.steer-indicator {
  position: absolute;
  left: 50%;
  bottom: calc(150px + var(--safe-b));
  width: 132px;
  height: 3px;
  transform: translateX(-50%);
  background: rgba(0, 229, 255, 0.16);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.steer-indicator.active {
  opacity: 1;
}
.steer-indicator i {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 22px;
  height: 11px;
  margin-left: -11px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(calc(var(--steer, 0) * 55px));
}

.hint {
  position: absolute;
  left: 50%;
  top: calc(104px + var(--safe-t));
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(210, 246, 255, 0.62);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s;
  text-shadow: 0 1px 8px #000;
}
.hint.show {
  opacity: 1;
}

/* ---------------- screens ---------------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-t)) calc(20px + var(--safe-r)) calc(24px + var(--safe-b)) calc(20px + var(--safe-l));
  background:
    radial-gradient(120% 90% at 50% 18%, rgba(5, 1, 15, 0.18) 0%, rgba(5, 1, 15, 0.62) 52%, rgba(3, 0, 10, 0.94) 100%);
  overflow-y: auto;
  touch-action: pan-y;
}

.menu-screen {
  background:
    linear-gradient(180deg, rgba(5, 1, 15, 0) 42%, rgba(5, 1, 15, 0.5) 66%, rgba(3, 0, 10, 0.9) 88%, rgba(3, 0, 10, 0.96) 100%),
    radial-gradient(120% 90% at 50% 16%, rgba(5, 1, 15, 0.1) 0%, rgba(5, 1, 15, 0.5) 48%, rgba(3, 0, 10, 0.93) 100%);
}

.menu-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.12) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, transparent 20%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 20%, #000 78%, transparent 100%);
}

.menu-content {
  position: relative;
  width: min(880px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.brand-top {
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(126, 246, 255, 0.85);
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.title {
  position: relative;
  margin: 0;
  font-size: clamp(46px, 11.5vw, 118px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0.045em;
  color: #f2feff;
  text-shadow:
    0 0 10px rgba(0, 229, 255, 0.9),
    0 0 42px rgba(255, 43, 214, 0.55),
    0 0 90px rgba(255, 43, 214, 0.3);
}
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
}
.title::before {
  color: var(--magenta);
  transform: translate(-3px, 1px);
  clip-path: inset(0 0 58% 0);
  animation: glitch-a 5.2s infinite steps(1);
}
.title::after {
  color: var(--cyan);
  transform: translate(3px, -1px);
  clip-path: inset(56% 0 0 0);
  animation: glitch-b 4.4s infinite steps(1);
}
@keyframes glitch-a {
  0%, 92%, 100% { transform: translate(-3px, 1px); clip-path: inset(0 0 58% 0); }
  93% { transform: translate(-9px, -2px); clip-path: inset(0 0 46% 0); }
  95% { transform: translate(4px, 2px); clip-path: inset(8% 0 62% 0); }
  97% { transform: translate(-5px, 0); clip-path: inset(0 0 52% 0); }
}
@keyframes glitch-b {
  0%, 88%, 100% { transform: translate(3px, -1px); clip-path: inset(56% 0 0 0); }
  89% { transform: translate(8px, 2px); clip-path: inset(48% 0 4% 0); }
  91% { transform: translate(-6px, -1px); clip-path: inset(62% 0 0 0); }
  94% { transform: translate(2px, 1px); clip-path: inset(54% 0 2% 0); }
}

.title-cn {
  margin-top: 12px;
  font-size: clamp(15px, 2.2vw, 21px);
  font-weight: 600;
  letter-spacing: 0.62em;
  color: rgba(214, 251, 255, 0.78);
  text-indent: 0.62em;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.tagline {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(190, 235, 255, 0.62);
  font-family: 'PingFang SC', 'Microsoft YaHei', var(--font);
}

.cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: min(400px, 80vw);
  padding: 16px 44px 15px;
  color: #04121a;
  background: linear-gradient(110deg, #ffb3ef, var(--magenta) 32%, #a06bff 62%, var(--cyan) 100%);
  box-shadow:
    0 0 26px rgba(255, 43, 214, 0.45),
    0 0 70px rgba(0, 229, 255, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.35);
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
  font-weight: 900;
  letter-spacing: 0.16em;
  transition: transform 0.12s, filter 0.15s, box-shadow 0.2s;
}
.cta span {
  font-size: 22px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}
.cta small {
  font-size: 9px;
  letter-spacing: 0.42em;
  opacity: 0.62;
  text-indent: 0.42em;
}
.cta:hover,
.cta:focus-visible {
  filter: brightness(1.12);
  box-shadow: 0 0 38px rgba(255, 43, 214, 0.7), 0 0 90px rgba(0, 229, 255, 0.3);
  outline: none;
}
.cta:active {
  transform: scale(0.97);
}

.menu-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.best {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
}
.best strong {
  font-size: 18px;
  color: var(--amber);
  letter-spacing: 0.08em;
  margin-left: 10px;
  text-shadow: 0 0 14px rgba(255, 184, 77, 0.6);
  font-variant-numeric: tabular-nums;
}
.controls {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(190, 235, 255, 0.5);
  font-family: 'PingFang SC', 'Microsoft YaHei', var(--font);
}
body.touch .desktop-only {
  display: none;
}
body:not(.touch) .touch-only {
  display: none;
}
.controls b {
  color: rgba(0, 229, 255, 0.8);
  font-weight: 600;
  margin-right: 4px;
}

.menu-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(150, 200, 220, 0.4);
}
.menu-foot .icon-btn {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

/* pause / game-over */
.overlay-screen {
  background: radial-gradient(120% 100% at 50% 40%, rgba(6, 2, 16, 0.78), rgba(3, 0, 10, 0.93));
}

.panel-card {
  position: relative;
  width: min(460px, 94vw);
  padding: 30px clamp(20px, 5vw, 38px) 28px;
  background: linear-gradient(165deg, rgba(12, 16, 40, 0.94), rgba(18, 3, 32, 0.92));
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.12) inset,
    inset 0 0 40px rgba(0, 229, 255, 0.06),
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(255, 43, 214, 0.12);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  text-align: center;
}
.panel-card::before,
.panel-card::after {
  content: '';
  position: absolute;
  width: 46px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.panel-card::before {
  top: 12px;
  left: 18px;
}
.panel-card::after {
  bottom: 12px;
  right: 18px;
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
}

.card-kicker {
  font-size: 9px;
  letter-spacing: 0.46em;
  color: rgba(0, 229, 255, 0.6);
  margin-bottom: 8px;
}
.card-title {
  margin: 0;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #f3feff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.65), 0 0 50px rgba(255, 43, 214, 0.35);
}
.card-title.danger {
  color: #ffe9ee;
  text-shadow: 0 0 18px rgba(255, 59, 92, 0.9), 0 0 60px rgba(255, 43, 214, 0.45);
}
.card-sub {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0 22px;
}
.stat {
  padding: 10px 6px 9px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.16);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.stat span {
  display: block;
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.stat strong {
  font-size: 25px;
  font-weight: 800;
  color: #eafcff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}
.stat.gold strong {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255, 184, 77, 0.6);
}
.new-record {
  display: none;
  margin: 0 auto 14px;
  width: fit-content;
  padding: 5px 14px;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: #1b0a00;
  background: linear-gradient(90deg, var(--amber), #ffe9a8);
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.6);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  animation: record-blink 1.1s infinite alternate;
}
.new-record.show {
  display: block;
}
@keyframes record-blink {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-primary,
.btn-ghost {
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  transition: transform 0.1s, filter 0.15s;
}
.btn-primary {
  color: #04121a;
  background: linear-gradient(110deg, #b6fdff, var(--cyan) 45%, #67b7ff);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.45);
}
.btn-primary:active {
  transform: scale(0.975);
  filter: brightness(1.15);
}
.btn-ghost {
  color: rgba(214, 251, 255, 0.75);
  background: rgba(8, 14, 32, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.05);
}
.btn-ghost:active {
  transform: scale(0.975);
  background: rgba(0, 229, 255, 0.12);
}

/* ---------------- responsive ---------------- */
@media (max-width: 560px) {
  .score-panel {
    min-width: 124px;
    padding: 6px 15px 7px 12px;
  }
  .score-value {
    font-size: 27px;
  }
  .speed-value {
    font-size: 42px;
  }
  .speedo {
    min-width: 96px;
    flex: 0 0 auto;
  }
  .hud-bottom {
    gap: 12px;
    align-items: flex-end;
  }
  .boost {
    flex: 1 1 auto;
    max-width: none;
    margin-left: 0;
    padding-bottom: 5px;
  }
  .boost-head {
    display: none;
  }
  .boost-track {
    height: 10px;
  }
  .boost-btn {
    width: 76px;
    height: 76px;
    font-size: 11px;
    flex: 0 0 auto;
  }
  .title-cn {
    letter-spacing: 0.4em;
  }
  .tagline {
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  .controls {
    gap: 6px 14px;
    font-size: 10px;
  }
  .stats {
    margin: 18px 0 18px;
  }
  .stat strong {
    font-size: 21px;
  }
  .combo {
    top: calc(13% + var(--safe-t));
  }
  .combo-x {
    font-size: 32px;
  }
  .hint {
    top: calc(92px + var(--safe-t));
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .steer-indicator {
    bottom: calc(134px + var(--safe-b));
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .screen {
    padding: 12px 20px;
  }
  .menu-content {
    gap: 12px;
  }
  .brand-top {
    margin-bottom: 4px;
    font-size: 8px;
  }
  .title {
    font-size: clamp(38px, 9vh, 64px);
  }
  .title-cn {
    margin-top: 6px;
    font-size: 13px;
  }
  .tagline {
    margin-top: 6px;
    font-size: 10px;
  }
  .cta {
    min-width: min(360px, 60vw);
    padding: 10px 34px;
  }
  .cta span {
    font-size: 17px;
  }
  .menu-meta {
    gap: 4px;
  }
  .controls {
    display: none;
  }
  .best strong {
    font-size: 15px;
  }
  .menu-foot {
    display: none;
  }
  .speed-value {
    font-size: 40px;
  }
  .boost-btn {
    width: 68px;
    height: 68px;
  }
  .combo {
    top: calc(12% + var(--safe-t));
  }
  .combo-x {
    font-size: 28px;
  }
  .hint {
    top: calc(74px + var(--safe-t));
  }
  .steer-indicator {
    bottom: calc(118px + var(--safe-b));
  }
}

@media (prefers-reduced-motion: reduce) {
  .title::before,
  .title::after,
  .menu-bg-grid,
  .fx-scan,
  .new-record,
  .boost-track.boosting .boost-fill {
    animation: none !important;
  }
  .cta,
  .icon-btn,
  .boost-btn {
    transition: none;
  }
}

@media (max-width: 370px) {
  .hud {
    padding-left: calc(12px + var(--safe-l));
    padding-right: calc(12px + var(--safe-r));
  }
  .score-panel {
    min-width: 104px;
    padding: 6px 11px 7px 10px;
  }
  .score-value {
    font-size: 22px;
  }
  .icon-btn {
    width: 37px;
    height: 37px;
  }
  .hud-right {
    gap: 6px;
  }
  .dist-panel {
    font-size: 15px;
  }
  .health i {
    width: 22px;
    height: 6px;
  }
  .speed-value {
    font-size: 37px;
  }
  .boost-btn {
    width: 68px;
    height: 68px;
    font-size: 10px;
  }
  .title {
    font-size: clamp(40px, 12vw, 58px);
  }
}
