@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080911;
  --panel: rgba(12, 14, 22, 0.86);
  --panel-strong: rgba(11, 13, 20, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(242, 238, 224, 0.13);
  --line-strong: rgba(242, 238, 224, 0.24);
  --cream: #f4f0e3;
  --muted: #9a99a6;
  --dim: #686973;
  --acid: #d8ff3e;
  --acid-soft: #a8c934;
  --pink: #ff4f87;
  --cyan: #63eee0;
  --orange: #ff7a45;
  --red: #ff3f5d;
  --blue: #5a9bff;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Space Grotesk", "Helvetica Neue", sans-serif;
  --mono: "Space Grotesk", monospace;
  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.8, 0.22, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

#game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #070810;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene-tint,
.vignette,
.scanlines,
.hit-vignette,
.boost-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.scene-tint {
  background:
    linear-gradient(180deg, rgba(4, 5, 10, 0.3) 0%, transparent 20%, transparent 68%, rgba(4, 5, 10, 0.55) 100%),
    radial-gradient(ellipse at 50% 55%, transparent 42%, rgba(3, 4, 8, 0.32) 100%);
}

.vignette {
  box-shadow: inset 0 0 160px 30px rgba(0, 0, 0, 0.45);
}

.scanlines {
  opacity: 0.16;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.hit-vignette {
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 35%, var(--hit-color, rgba(255, 55, 73, 0.64)) 100%);
  transition: opacity 0.8s var(--ease);
  z-index: 4;
}

.hit-vignette.flash {
  animation: hitFlash 0.6s var(--ease) forwards;
}

@keyframes hitFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.boost-vignette {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s linear;
  background:
    linear-gradient(90deg, rgba(84, 250, 255, 0.16), transparent 22%, transparent 78%, rgba(84, 250, 255, 0.16)),
    radial-gradient(ellipse at center, transparent 48%, rgba(48, 218, 222, 0.12) 100%);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
}

/* ------------------------------------------------------------------ */
/* Shared bits                                                         */
/* ------------------------------------------------------------------ */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--acid);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--acid);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--acid);
  color: #0b0c10;
  border-color: var(--acid);
  box-shadow: 0 0 0 1px rgba(216, 255, 62, 0.18), 0 8px 28px rgba(216, 255, 62, 0.12);
}

.button-primary:hover {
  background: #e2ff68;
  box-shadow: 0 0 0 1px rgba(216, 255, 62, 0.28), 0 12px 32px rgba(216, 255, 62, 0.2);
}

.button-large {
  min-width: 260px;
  min-height: 62px;
  font-size: 26px;
}

.button-ghost {
  background: rgba(10, 12, 18, 0.45);
  color: var(--cream);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--cream);
}

.button-arrow {
  font-family: var(--body);
  font-size: 20px;
  font-weight: 400;
  transition: transform 0.18s var(--ease);
}

.button:hover .button-arrow {
  transform: translateX(4px);
}

.button-danger {
  background: var(--red);
  border-color: var(--red);
  color: #16060a;
}

.danger-link {
  padding: 4px 0;
  color: var(--dim);
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.danger-link:hover {
  color: var(--red);
}

kbd {
  display: inline-flex;
  min-width: 21px;
  min-height: 20px;
  padding: 2px 5px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 240, 227, 0.28);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
}

.divider {
  opacity: 0.35;
}

/* ------------------------------------------------------------------ */
/* Loading                                                             */
/* ------------------------------------------------------------------ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(ellipse at center, rgba(31, 32, 48, 0.5), transparent 52%),
    #07080e;
  z-index: 100;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

.loading-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.loading-kicker {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.34em;
}

.loading-mark strong {
  font-family: var(--display);
  font-size: clamp(72px, 12vw, 164px);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.045em;
  color: var(--cream);
}

.loading-sub {
  margin-top: 2px;
  color: var(--acid);
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: 0.32em;
  transform: translateX(0.16em);
}

.loading-track {
  width: min(320px, 55vw);
  height: 2px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  box-shadow: 0 0 18px var(--acid);
  transition: width 0.45s var(--ease);
}

.loading-caption {
  color: var(--dim);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Title                                                               */
/* ------------------------------------------------------------------ */
.title-screen {
  display: flex;
  flex-direction: column;
  padding: 26px 38px 20px;
  background:
    linear-gradient(90deg, rgba(5, 6, 11, 0.86) 0%, rgba(5, 6, 11, 0.56) 38%, rgba(5, 6, 11, 0.13) 65%, rgba(5, 6, 11, 0.6) 100%),
    linear-gradient(180deg, rgba(4, 5, 10, 0.72) 0%, transparent 28%, transparent 72%, rgba(4, 5, 10, 0.8) 100%);
  z-index: 30;
}

.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.04) calc(100% - 1px)),
    radial-gradient(circle at 80% 30%, rgba(255, 89, 134, 0.07), transparent 30%);
}

.title-header,
.title-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: rgba(244, 240, 227, 0.56);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.tiny-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiny-brand-mark {
  color: var(--acid);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title-header-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
}

.title-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.55fr);
  align-items: end;
  gap: 40px;
  padding: 32px 0 42px;
}

.title-copy {
  align-self: center;
  max-width: 820px;
  padding-top: 3vh;
}

.wordmark {
  display: flex;
  flex-direction: column;
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(94px, 13.8vw, 220px);
  letter-spacing: -0.045em;
  line-height: 0.69;
  text-transform: uppercase;
}

.wordmark-top {
  color: var(--cream);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.42);
  animation: titleRise 0.85s var(--ease) both;
}

.wordmark-bottom {
  position: relative;
  color: rgba(244, 240, 227, 0.035);
  -webkit-text-stroke: 2.5px rgba(244, 240, 227, 0.9);
  text-shadow: 0 0 28px rgba(244, 240, 227, 0.06);
  letter-spacing: -0.038em;
  animation: titleRise 0.85s 0.08s var(--ease) both;
}

.wordmark-bottom::after {
  content: "";
  position: absolute;
  left: 0.02em;
  bottom: 0.1em;
  width: 1.48em;
  height: 0.085em;
  background: var(--acid);
  transform: skewX(-24deg);
  opacity: 0.95;
}

@keyframes titleRise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-tagline {
  margin: 26px 0 32px;
  max-width: 450px;
  color: rgba(244, 240, 227, 0.72);
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.055em;
  line-height: 1.6;
  animation: titleRise 0.8s 0.18s var(--ease) both;
}

.title-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  animation: titleRise 0.8s 0.26s var(--ease) both;
}

.title-actions .button-ghost {
  min-width: 126px;
  justify-content: center;
}

.title-save {
  display: flex;
  gap: 28px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 420px;
  animation: titleRise 0.8s 0.32s var(--ease) both;
}

.title-save > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.title-save strong {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mini-label {
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.17em;
}

.shift-brief {
  align-self: center;
  justify-self: end;
  width: min(100%, 380px);
  margin-bottom: 0;
  padding: 22px 22px 18px;
  border: 1px solid rgba(244, 240, 227, 0.16);
  background: rgba(8, 10, 16, 0.7);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  animation: titleRise 0.9s 0.2s var(--ease) both;
}

.brief-topline {
  display: flex;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.19em;
}

.brief-ref {
  color: var(--dim);
}

.brief-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.brief-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(244, 240, 227, 0.09);
}

.brief-num {
  padding-top: 2px;
  color: var(--acid);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.brief-list strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brief-list p {
  margin: 5px 0 0;
  color: rgba(244, 240, 227, 0.52);
  font-family: var(--body);
  font-size: 10px;
  line-height: 1.55;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  padding-top: 15px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.control-strip span {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.control-strip kbd {
  min-width: 17px;
  min-height: 17px;
  padding: 1px 4px;
  font-size: 8px;
}

.title-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(244, 240, 227, 0.11);
  color: var(--dim);
  font-size: 8px;
}

.title-footer-right {
  color: rgba(244, 240, 227, 0.35);
}

/* ------------------------------------------------------------------ */
/* HUD                                                                 */
/* ------------------------------------------------------------------ */
.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hud button,
.hud .minimap-shell,
.hud .mission-card,
.hud .speedo,
.hud .results-card {
  pointer-events: auto;
}

.hud-header {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 30px;
}

.hud-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.hud-brand-mark {
  color: var(--acid);
  font-family: var(--display);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.hud-brand div {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hud-brand strong {
  font-family: var(--display);
  font-size: 18px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hud-brand span:not(.hud-brand-mark) {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.17em;
}

.cash-chip {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 11px;
  min-width: 140px;
  padding: 9px 14px 8px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.74);
}

.cash-chip::before,
.mission-card::before,
.speedo::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 1px;
  background: var(--acid);
}

.cash-label {
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.18em;
}

#hud-cash {
  color: var(--cream);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.cash-delta {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  color: var(--acid);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s, transform 0.2s;
}

.cash-delta.negative {
  color: var(--red);
}

.cash-delta.show {
  opacity: 1;
  transform: translateY(0);
}

.rank-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.62);
}

.rank-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  color: var(--acid);
  font-family: var(--body);
  font-size: 10px;
}

.rank-chip div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.rank-chip strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.05em;
}

.rank-progress {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.rank-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  transition: width 0.35s var(--ease);
}

.hud-center {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 390px;
}

.run-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 7px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(8, 10, 16, 0.78) 14%, rgba(8, 10, 16, 0.78) 86%, transparent);
  color: var(--muted);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.run-order {
  color: var(--cream);
  font-weight: 500;
}

.run-divider {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}

.run-phase {
  color: var(--pink);
  font-weight: 500;
}

.run-phase.dropoff {
  color: var(--acid);
}

.timer {
  min-width: 90px;
  padding-left: 2px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: right;
}

.timer-pickup {
  color: var(--dim);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.timer.low {
  color: var(--orange);
}

.timer.late {
  color: var(--red);
  animation: timerPulse 0.9s infinite;
}

@keyframes timerPulse {
  50% { opacity: 0.52; }
}

.signal-readout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 25px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.68);
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.signal-readout[data-signal="red"] {
  color: var(--red);
  border-color: rgba(255, 63, 93, 0.38);
}

.signal-readout[data-signal="amber"] {
  color: var(--orange);
}

.signal-readout[data-signal="green"] {
  color: var(--cyan);
}

.signal-mini {
  display: flex;
  gap: 3px;
}

.signal-lamp {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.signal-lamp.red.active {
  background: var(--red);
  box-shadow: 0 0 7px var(--red);
}

.signal-lamp.amber.active {
  background: var(--orange);
  box-shadow: 0 0 7px var(--orange);
}

.signal-lamp.green.active {
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

#signal-distance {
  color: var(--muted);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.wanted-panel {
  width: 292px;
  padding: 8px 11px 9px;
  border: 1px solid rgba(255, 63, 93, 0.35);
  background: rgba(19, 9, 15, 0.8);
}

.wanted-panel.danger {
  border-color: var(--red);
  animation: wantedPulse 0.55s infinite alternate;
}

@keyframes wantedPulse {
  to { box-shadow: 0 0 20px rgba(255, 63, 93, 0.18); }
}

.wanted-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
  color: rgba(255, 188, 194, 0.65);
}

.wanted-badge {
  padding: 2px 5px;
  background: var(--red);
  color: #17060a;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#wanted-cops {
  flex: 1;
}

#wanted-state {
  color: var(--red);
  font-weight: 500;
}

.heat-track,
.bust-track {
  position: relative;
  height: 3px;
  margin-top: 7px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.heat-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff9559, var(--red));
  transition: width 0.3s var(--ease);
}

.bust-track {
  height: 2px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.bust-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #ffffff;
  transition: width 0.12s linear;
}

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

.minimap-shell {
  width: 194px;
  padding: 7px 7px 6px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.minimap-head,
.minimap-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.minimap-head {
  padding: 0 2px 6px;
}

#minimap-north {
  color: var(--acid);
}

#minimap {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0d13;
}

.minimap-foot {
  padding: 7px 2px 0;
}

#minimap-target-label {
  overflow: hidden;
  max-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

#minimap-distance {
  color: var(--cream);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.hud-actions {
  display: flex;
  gap: 5px;
}

.icon-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.72);
  color: var(--muted);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.12em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-button:hover {
  color: var(--cream);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.icon-key {
  color: var(--acid);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
}

.icon-key.muted {
  color: var(--red);
}

.mission-card {
  position: absolute;
  top: 142px;
  left: 30px;
  width: 306px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 48%),
    rgba(8, 10, 16, 0.8);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.nav-badge {
  position: absolute;
  top: 13px;
  right: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(216, 255, 62, 0.45);
  border-radius: 50%;
  color: var(--acid);
  background: rgba(216, 255, 62, 0.06);
}

#nav-arrow {
  display: block;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1;
  transition: transform 0.16s linear;
}

.mission-kicker {
  color: var(--acid);
  font-family: var(--body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.17em;
}

.mission-card h2 {
  margin: 9px 0 5px;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 0.98;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-sub {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.055em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mission-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 8px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.mission-row > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mission-row span {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.mission-row strong {
  color: var(--cream);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

.mission-tip {
  min-height: 22px;
  margin-top: 13px;
  color: rgba(244, 240, 227, 0.46);
  font-family: var(--body);
  font-size: 8px;
  line-height: 1.55;
}

.mission-progress {
  width: 100%;
  height: 2px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.mission-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pink);
  transition: width 0.2s linear;
}

.speedo {
  position: absolute;
  right: 30px;
  bottom: 28px;
  width: 264px;
  padding: 13px 16px 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 50%),
    rgba(8, 10, 16, 0.8);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
}

.speedo-topline {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.16em;
}

#gear-readout {
  color: var(--acid);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
}

.speedo-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 9px;
}

#speed-value {
  color: var(--cream);
  font-family: var(--display);
  font-size: 74px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.8;
  font-variant-numeric: tabular-nums;
}

.speedo-main small {
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.rpm-track {
  display: flex;
  gap: 2px;
  height: 8px;
  margin-bottom: 11px;
}

.rpm-track span {
  flex: 1;
  background: rgba(255, 255, 255, 0.13);
  transform: skewX(-15deg);
  transition: background 0.08s linear, box-shadow 0.08s linear;
}

.rpm-track span.active {
  background: var(--acid);
  box-shadow: 0 0 7px rgba(216, 255, 62, 0.3);
}

.rpm-track span:nth-last-child(-n + 4).active {
  background: var(--pink);
  box-shadow: 0 0 7px rgba(255, 79, 135, 0.4);
}

.nitro-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.nitro-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.nitro-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(99, 238, 224, 0.52);
  transition: width 0.08s linear;
}

#nitro-value {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.touch-nitro {
  display: none;
}

.results-card {
  position: absolute;
  top: 300px;
  right: 30px;
  width: 306px;
  padding: 15px;
  border: 1px solid rgba(216, 255, 62, 0.35);
  background: rgba(10, 13, 15, 0.9);
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.results-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.results-head {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.results-head .on-time { color: var(--acid); }
.results-head .late { color: var(--red); }

.results-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin: 9px 0 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

#result-stars {
  color: var(--acid);
  font-family: var(--body);
  font-size: 15px;
  letter-spacing: 0.1em;
}

#result-stars.stars-0 { color: var(--red); }
#result-stars.stars-1 { color: var(--orange); }
#result-stars.stars-2 { color: var(--cyan); }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.results-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.results-grid strong {
  color: var(--cream);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.results-grid strong.negative {
  color: var(--red);
}

.results-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.results-total strong {
  color: var(--acid);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  line-height: 0.9;
}

.toast-stack {
  position: absolute;
  left: 30px;
  bottom: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  width: min(360px, calc(100vw - 60px));
}

.toast {
  position: relative;
  width: 100%;
  padding: 10px 30px 11px 12px;
  border-left: 2px solid var(--acid);
  background: rgba(8, 10, 16, 0.86);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-kicker {
  display: block;
  color: var(--acid);
  font-family: var(--body);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.toast strong {
  display: block;
  margin-top: 2px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.toast p {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  line-height: 1.45;
}

.toast-close {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 5px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--cream);
}

.toast-danger {
  border-left-color: var(--red);
}
.toast-danger .toast-kicker { color: var(--red); }
.toast-police {
  border-left-color: var(--blue);
}
.toast-police .toast-kicker { color: var(--blue); }
.toast-success {
  border-left-color: var(--acid);
}
.toast-warn {
  border-left-color: var(--orange);
}
.toast-warn .toast-kicker { color: var(--orange); }

.tutorial-card {
  position: absolute;
  left: 50%;
  bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(440px, calc(100vw - 60px));
  padding: 13px 38px 14px 14px;
  transform: translate(-50%, 12px);
  border: 1px solid var(--line-strong);
  background: rgba(8, 10, 16, 0.84);
  opacity: 0;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
  pointer-events: auto;
}

.tutorial-card.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tutorial-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 11px var(--pink);
}

.tutorial-card strong {
  display: block;
  color: var(--cream);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.tutorial-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 9px;
  line-height: 1.5;
}

.tutorial-card button {
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--dim);
  font-size: 17px;
}

.hint-bar {
  position: absolute;
  left: 30px;
  bottom: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(244, 240, 227, 0.35);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hint-bar span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hint-bar kbd {
  min-width: 16px;
  min-height: 16px;
  padding: 1px 3px;
  font-size: 7px;
  opacity: 0.7;
}

.hint-warn {
  color: rgba(255, 63, 93, 0.65);
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 4px;
  height: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.42;
}

.busted-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(34, 0, 9, 0.18), rgba(7, 4, 8, 0.72));
  pointer-events: none;
  opacity: 1;
}

.busted-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 63, 93, 0.5);
  background: linear-gradient(180deg, rgba(255, 63, 93, 0.06), transparent 20%, transparent 80%, rgba(255, 63, 93, 0.06));
  animation: bustFlash 0.4s ease-out both;
}

@keyframes bustFlash {
  0% { opacity: 1; }
  100% { opacity: 0.3; }
}

.busted-kicker {
  color: var(--red);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.32em;
}

.busted-overlay strong {
  position: relative;
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(100px, 17vw, 260px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.82;
  text-shadow: 0 0 60px rgba(255, 63, 93, 0.35);
}

.busted-overlay strong::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.1em;
  height: 0.1em;
  background: var(--red);
  transform: skewX(-20deg);
}

#busted-penalty {
  position: relative;
  margin: 17px 0 0;
  color: var(--red);
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.17em;
}

.busted-hint {
  position: relative;
  margin-top: 9px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.11em;
}

/* ------------------------------------------------------------------ */
/* Garage                                                              */
/* ------------------------------------------------------------------ */
.garage-screen {
  z-index: 50;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 92px),
    radial-gradient(ellipse at 18% 44%, rgba(85, 93, 112, 0.20), transparent 42%),
    radial-gradient(ellipse at 70% 15%, rgba(255, 79, 135, 0.045), transparent 30%),
    linear-gradient(90deg, #090a10 0%, #08090f 44%, #05070b 53%, #05060a 100%);
}

.garage-bg-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 23% 55%, transparent 12%, rgba(3, 4, 8, 0.2) 40%, rgba(3, 4, 8, 0.72) 78%);
  z-index: 0;
}

.garage-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 36px 18px;
  border-bottom: 1px solid var(--line);
}

.garage-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.garage-heading h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--display);
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 0.8;
}

.garage-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.garage-cash {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.garage-cash span {
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.garage-cash strong {
  color: var(--acid);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.garage-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
  padding: 26px 36px 22px;
  gap: 28px;
}


.garage-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  min-height: 0;
}

.garage-preview {
  position: relative;
  flex: 1 1 0;
  min-height: 190px;
  max-height: 322px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 58%, rgba(99, 238, 224, 0.11), transparent 46%),
    radial-gradient(ellipse at 50% 100%, rgba(216, 255, 62, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(4, 5, 9, 0.08));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.garage-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 12%, transparent 88%, rgba(255, 255, 255, 0.035)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: overlay;
}

.garage-preview::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 62px;
  height: 1px;
  background: var(--acid);
}

#garage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#garage-canvas.dragging {
  cursor: grabbing;
}

.garage-preview-top,
.garage-preview-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.garage-preview-top {
  top: 10px;
}

.garage-preview-top span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
}

.garage-preview-top i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

.garage-preview-bottom {
  bottom: 9px;
}

#garage-preview-angle {
  color: var(--acid);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.garage-left .garage-specs {
  align-self: stretch;
  max-width: none;
  flex: 0 0 auto;
}

.garage-left .garage-quote {
  display: none;
}

.garage-left .bike-heading {
  padding-bottom: 11px;
}

.garage-left .bike-heading p {
  margin-top: 6px;
}

.garage-left .spec-list {
  padding: 12px 0 7px;
}

.garage-left .spec-row {
  margin-bottom: 8px;
}

.garage-left .garage-meta {
  padding: 9px 0;
}

.garage-left .spec-extra {
  margin-top: 8px;
  padding-top: 8px;
}


.garage-specs {
  align-self: end;
  max-width: 350px;
  padding-bottom: 2px;
}

.bike-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.bike-class {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 7px;
  background: var(--acid);
  color: #0b0c10;
  font-family: var(--body);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.bike-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.bike-heading p {
  max-width: 300px;
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 9px;
  line-height: 1.55;
}

.spec-list {
  padding: 17px 0 13px;
}

.spec-row {
  margin-bottom: 11px;
}

.spec-row-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.spec-row-label span:last-child {
  color: var(--cream);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.spec-row-label em {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.spec-bar {
  height: 3px;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.12);
}

.spec-bar span {
  display: block;
  height: 100%;
  background: var(--acid);
  transition: width 0.35s var(--ease);
}

.spec-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.spec-extra span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.spec-extra strong {
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
}

.garage-meta {
  display: flex;
  gap: 24px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.garage-meta div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.garage-meta span {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.garage-meta strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}

.garage-quote {
  max-width: 300px;
  margin-top: 17px;
  color: rgba(244, 240, 227, 0.35);
  font-family: var(--body);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.garage-quote span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.garage-menu {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 4px 0 0;
}

.garage-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 13px;
}

.garage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.garage-tab {
  padding: 6px 11px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.garage-tab:hover {
  color: var(--cream);
}

.garage-tab.active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--acid);
}

.garage-menu-note {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  padding-right: 5px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 255, 62, 0.35) transparent;
}

.upgrade-grid::-webkit-scrollbar {
  width: 4px;
}

.upgrade-grid::-webkit-scrollbar-thumb {
  background: rgba(216, 255, 62, 0.32);
}

.upgrade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 13px 13px 10px;
  border: 1px solid rgba(244, 240, 227, 0.11);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 42%),
    rgba(11, 13, 21, 0.72);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

.upgrade-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 35px;
  height: 1px;
  background: var(--upgrade-color);
}

.upgrade-card:hover {
  border-color: rgba(244, 240, 227, 0.23);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 42%),
    rgba(14, 16, 25, 0.9);
  transform: translateY(-1px);
}

.upgrade-card.is-maxed {
  border-color: rgba(216, 255, 62, 0.28);
}

.upgrade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.upgrade-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid color-mix(in srgb, var(--upgrade-color) 50%, transparent);
  color: var(--upgrade-color);
  background: color-mix(in srgb, var(--upgrade-color) 8%, transparent);
}

.upgrade-icon svg {
  width: 23px;
  height: 23px;
}

.upgrade-level {
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.upgrade-level strong {
  color: var(--upgrade-color);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
}

.upgrade-level em {
  font-style: normal;
  color: var(--dim);
}

.upgrade-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.upgrade-name-row h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 0.9;
}

.upgrade-family {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.upgrade-blurb {
  min-height: 28px;
  margin: 6px 0 7px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  line-height: 1.42;
}

.upgrade-pips {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}

.upgrade-pips i {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.upgrade-pips i.filled {
  background: var(--upgrade-color);
  box-shadow: 0 0 7px color-mix(in srgb, var(--upgrade-color) 25%, transparent);
}

.upgrade-next {
  display: flex;
  gap: 7px;
  overflow: hidden;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upgrade-next span {
  flex: 0 0 auto;
  color: var(--upgrade-color);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.paint-row {
  display: flex;
  gap: 4px;
  margin: 7px 0 6px;
}

.paint-swatch {
  width: 17px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--swatch);
  opacity: 0.8;
  transition: transform 0.14s, border-color 0.14s;
}

.paint-swatch:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #fff;
}

.paint-swatch.selected {
  border-color: var(--cream);
  outline: 1px solid rgba(244, 240, 227, 0.45);
  outline-offset: 2px;
}

.paint-swatch:disabled {
  background: #20232b;
  opacity: 0.38;
  cursor: not-allowed;
}

.upgrade-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-top: auto;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--upgrade-color) 45%, transparent);
  color: var(--cream);
  font-family: var(--body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: background 0.15s, color 0.15s;
}

.upgrade-buy:hover {
  background: var(--upgrade-color);
  color: #0b0c10;
}

.upgrade-buy strong {
  color: var(--upgrade-color);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.upgrade-buy:hover strong {
  color: #0b0c10;
}

.upgrade-buy.short {
  border-color: rgba(255, 63, 93, 0.3);
  color: var(--muted);
}

.upgrade-buy.short strong {
  color: var(--red);
}

.upgrade-buy.short:hover {
  background: rgba(255, 63, 93, 0.15);
  color: var(--cream);
}

.upgrade-buy.maxed {
  justify-content: center;
  border-color: rgba(216, 255, 62, 0.26);
  color: var(--acid);
  cursor: default;
}

.upgrade-buy.maxed:hover {
  background: transparent;
  color: var(--acid);
}

.garage-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.garage-foot-right {
  color: rgba(244, 240, 227, 0.2);
  white-space: nowrap;
  letter-spacing: 0.12em;
}

/* ------------------------------------------------------------------ */
/* Pause / confirm                                                     */
/* ------------------------------------------------------------------ */
.pause-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 9, 0.56);
  z-index: 60;
}

.pause-card {
  width: min(510px, calc(100vw - 48px));
  padding: 24px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(8, 10, 16, 0.93);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.pause-topline {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.pause-card h2 {
  margin: 26px 0 7px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 55px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.82;
}

.pause-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 10px;
  line-height: 1.5;
}

.pause-card .button-primary {
  width: 100%;
}

.pause-actions {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.pause-actions .button {
  flex: 1;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  font-size: 15px;
}

.pause-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pause-controls div {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.pause-controls div span {
  margin-left: 4px;
}

.pause-controls kbd {
  min-width: 18px;
  min-height: 18px;
  padding: 1px 4px;
  font-size: 7px;
}

.pause-card .danger-link {
  margin-top: 22px;
}

.confirm-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  background: rgba(4, 5, 9, 0.72);
}

.confirm-card {
  width: min(470px, calc(100vw - 48px));
  padding: 28px;
  border: 1px solid rgba(255, 63, 93, 0.35);
  background: var(--panel-strong);
}

.confirm-card h2 {
  margin: 17px 0 9px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 53px;
  font-weight: 800;
  line-height: 0.84;
}

.confirm-card p {
  margin: 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 10px;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 7px;
  margin-top: 24px;
}

.confirm-actions .button {
  flex: 1;
  justify-content: center;
}

/* ------------------------------------------------------------------ */
/* Touch                                                               */
/* ------------------------------------------------------------------ */
.touch-controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 16px 18px;
  pointer-events: none;
}

.touch-controls button {
  pointer-events: auto;
  touch-action: none;
}

.touch-steer,
.touch-drive {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.touch-steer button {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(244, 240, 227, 0.25);
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.4);
  color: var(--cream);
  font-family: var(--display);
  font-size: 25px;
}

.touch-drive button {
  min-width: 63px;
  min-height: 56px;
  padding: 7px;
  border: 1px solid rgba(244, 240, 227, 0.22);
  background: rgba(8, 10, 16, 0.46);
  color: var(--cream);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.touch-drive .touch-gaspedal {
  min-width: 84px;
  min-height: 74px;
  border-color: rgba(216, 255, 62, 0.4);
  color: var(--acid);
  font-size: 24px;
}

.touch-controls button:active {
  background: rgba(216, 255, 62, 0.22);
  transform: scale(0.96);
}

.touch-nitro {
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid rgba(99, 238, 224, 0.3);
  color: var(--cyan);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.17em;
}

.touch-device .touch-nitro {
  display: block;
}

.touch-device .hint-bar {
  display: none;
}

.touch-device .toast-stack {
  bottom: 118px;
}

.rotate-notice {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--acid);
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.2em;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .title-screen {
    padding: 22px 26px 18px;
  }
  .title-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
  }
  .title-copy {
    padding-top: 0;
  }
  .shift-brief {
    padding: 16px;
  }
  .hud-header {
    padding: 16px 20px;
  }
  .mission-card {
    top: 130px;
    left: 20px;
    width: 282px;
  }
  .speedo {
    right: 20px;
    bottom: 20px;
    width: 244px;
  }
  .toast-stack {
    left: 20px;
    bottom: 78px;
  }
  .hint-bar {
    left: 20px;
    bottom: 20px;
  }
  .results-card {
    right: 20px;
    top: 260px;
  }
  .garage-topbar {
    padding: 20px 24px 15px;
  }
  .garage-body {
    padding: 20px 24px 18px;
    gap: 20px;
  }
  .upgrade-card {
    min-height: 184px;
  }
}

@media (max-width: 980px) {
  .title-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  }
  .wordmark {
    font-size: clamp(80px, 14vw, 160px);
  }
  .hud-center {
    top: 14px;
    min-width: 330px;
  }
  .run-strip {
    gap: 8px;
    padding: 5px 10px;
    font-size: 8px;
  }
  .timer {
    font-size: 24px;
    min-width: 70px;
  }
  .hud-left {
    gap: 6px;
  }
  .hud-brand {
    display: none;
  }
  .rank-chip {
    min-width: 106px;
  }
  .cash-chip {
    min-width: 120px;
  }
  .minimap-shell {
    width: 164px;
  }
  .mission-card {
    top: 118px;
    width: 250px;
  }
  .mission-card h2 {
    font-size: 26px;
  }
  .results-card {
    top: 235px;
    width: 280px;
  }
  .speedo {
    width: 220px;
  }
  #speed-value {
    font-size: 62px;
  }
  .garage-body {
    grid-template-columns: minmax(240px, 0.32fr) minmax(0, 0.68fr);
  }
  .garage-heading h2 {
    font-size: 43px;
  }
  .upgrade-grid {
    grid-template-columns: 1fr;
  }
  .upgrade-card {
    min-height: 172px;
  }
  .garage-foot {
    display: block;
  }
  .garage-foot-right {
    display: none;
  }
}

@media (max-width: 760px) {
  .title-screen {
    padding: 15px 16px 13px;
    overflow-y: auto;
  }
  .title-header-meta {
    display: none;
  }
  .title-header {
    font-size: 8px;
  }
  .title-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 20px 0;
    gap: 24px;
  }
  .title-copy {
    padding-top: 0;
  }
  .wordmark {
    font-size: clamp(76px, 22vw, 150px);
    line-height: 0.69;
  }
  .title-tagline {
    margin: 18px 0 22px;
    font-size: 11px;
  }
  .title-actions {
    flex-wrap: wrap;
  }
  .button-large {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 22px;
  }
  .title-actions .button-ghost {
    flex: 0 0 96px;
  }
  .title-save {
    margin-top: 21px;
    gap: 22px;
  }
  .shift-brief {
    align-self: stretch;
    justify-self: stretch;
    width: auto;
    margin: 0;
    padding: 15px;
  }
  .brief-list li {
    padding: 10px 0;
  }
  .brief-list p {
    display: none;
  }
  .control-strip {
    display: none;
  }
  .title-footer {
    display: none;
  }

  .hud-header {
    padding: 10px;
    gap: 7px;
  }
  .hud-left {
    gap: 4px;
  }
  .cash-chip {
    min-width: 90px;
    padding: 6px 8px;
  }
  #hud-cash {
    font-size: 19px;
  }
  .rank-chip {
    min-width: 0;
    padding: 5px 7px;
  }
  .rank-chip strong {
    font-size: 11px;
  }
  .rank-icon {
    display: none;
  }
  .hud-center {
    top: 58px;
    min-width: 0;
    width: calc(100vw - 20px);
  }
  .run-strip {
    justify-content: center;
    background: rgba(8, 10, 16, 0.72);
    }
  .run-order {
    display: none;
  }
  .run-divider {
    display: none;
  }
  .signal-readout {
    min-height: 22px;
    font-size: 7px;
  }
  .wanted-panel {
    width: 260px;
  }
  .hud-right {
    gap: 5px;
  }
  .minimap-shell {
    width: 104px;
    padding: 4px;
  }
  .minimap-head,
  .minimap-foot {
    font-size: 6px;
    padding: 2px;
  }
  .minimap-head {
    padding-bottom: 3px;
  }
  .minimap-foot {
    padding-top: 4px;
  }
  .minimap-foot #minimap-target-label {
    max-width: 50px;
  }
  .minimap-foot #minimap-distance {
    font-size: 10px;
  }
  .hud-actions {
    gap: 2px;
  }
  .icon-button {
    width: 23px;
    min-height: 23px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .icon-button .icon-key {
    font-size: 11px;
  }
  .icon-button span:last-child {
    display: none;
  }
  .mission-card {
    top: 96px;
    left: 10px;
    width: 178px;
    padding: 8px 10px;
    clip-path: none;
  }
  .nav-badge {
    top: 9px;
    right: 9px;
    width: 23px;
    height: 23px;
  }
  #nav-arrow {
    font-size: 12px;
  }
  .mission-kicker {
    font-size: 6px;
    padding-right: 25px;
  }
  .mission-card h2 {
    margin: 5px 0 3px;
    max-width: 145px;
    font-size: 19px;
  }
  .mission-sub {
    display: none;
  }
  .mission-row {
    display: flex;
    margin-top: 7px;
    padding-top: 6px;
  }
  .mission-row > div:nth-child(2),
  .mission-row > div:nth-child(3) {
    display: none;
  }
  .mission-row span {
    font-size: 6px;
  }
  .mission-row strong {
    font-size: 14px;
  }
  .mission-tip {
    display: none;
  }
  .mission-progress {
    margin-top: 7px;
  }
  .hud.has-wanted .mission-card,
  .hud.has-wanted .signal-readout {
    display: none;
  }
  .signal-readout {
    display: none;
  }
  .tutorial-card {
    display: none !important;
  }
  .toast-stack {
    width: min(250px, calc(100vw - 20px));
  }
  .speedo {
    right: 10px;
    bottom: 10px;
    width: 155px;
    padding: 8px;
  }
  #speed-value {
    font-size: 42px;
  }
  .speedo-main {
    margin: 2px 0 5px;
    gap: 4px;
  }
  .speedo-topline {
    font-size: 6px;
  }
  .rpm-track {
    height: 5px;
    gap: 1px;
    margin-bottom: 7px;
  }
  .nitro-row {
    gap: 4px;
    font-size: 6px;
  }
  .toast-stack,
  .touch-device .toast-stack {
    left: 10px;
    bottom: 250px;
    width: min(250px, calc(100vw - 20px));
  }
  .toast {
    max-width: 280px;
    padding: 8px 26px 9px 9px;
  }
  .toast strong {
    font-size: 17px;
  }
  .toast p {
    font-size: 7px;
  }
  .results-card {
    top: 190px;
    right: 10px;
    bottom: auto;
    width: 224px;
    padding: 10px;
  }
  .hud.has-wanted .results-card {
    top: 166px;
  }
  .results-title {
    margin: 7px 0 9px;
    font-size: 17px;
  }
  .results-total strong {
    font-size: 24px;
  }
  .tutorial-card {
    bottom: 134px;
    width: calc(100vw - 20px);
    padding: 10px 30px 11px 10px;
  }
  .tutorial-card strong {
    font-size: 17px;
  }
  .tutorial-card p {
    font-size: 8px;
  }
  .hint-bar {
    display: none;
  }
  .crosshair {
    display: none;
  }
  .busted-overlay strong {
    font-size: clamp(82px, 27vw, 180px);
  }
  .garage-screen {
    overflow-y: auto;
    display: block;
  }
  .garage-topbar {
    padding: 14px 14px 10px;
  }
  .garage-heading h2 {
    font-size: 38px;
  }
  .garage-top-actions {
    gap: 9px;
    align-items: center;
  }
  .garage-cash {
    display: none;
  }
  .garage-topbar .button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 14px;
    gap: 7px;
  }
  .garage-body {
    display: block;
    padding: 0 14px 18px;
  }
  .garage-left {
    display: none;
  }
  .garage-specs {
    display: none;
  }
  .garage-menu {
    min-height: calc(100vh - 96px);
  }
  .garage-menu-head {
    padding: 10px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .garage-menu-note {
    display: none;
  }
  .garage-tabs {
    gap: 0;
  }
  .garage-tab {
    padding: 5px 7px;
    font-size: 7px;
  }
  .upgrade-grid {
    max-height: none;
    overflow: visible;
    grid-template-columns: 1fr;
  }
  .garage-foot {
    padding-top: 16px;
  }
  .pause-card {
    padding: 17px;
  }
  .pause-card h2 {
    font-size: 44px;
  }
  .pause-actions {
    flex-wrap: wrap;
  }
  .pause-actions .button {
    flex: 1 1 30%;
  }
  .pause-controls {
    gap: 7px;
  }
  .confirm-card {
    padding: 20px;
  }
  .confirm-card h2 {
    font-size: 42px;
  }
  .confirm-actions {
    flex-wrap: wrap;
  }
  .touch-controls {
    padding: 0 10px 12px;
  }
  .touch-controls .touch-steer button {
    width: 54px;
    height: 54px;
  }
  .touch-controls .touch-drive button {
    min-width: 55px;
  }
  .touch-controls .touch-drive .touch-gaspedal {
    min-width: 73px;
    min-height: 66px;
  }
  .touch-device .speedo {
    bottom: 86px;
  }
  .touch-device .toast-stack {
    bottom: 172px;
  }
}

@media (max-height: 620px) and (min-width: 761px) {
  .title-layout {
    padding: 10px 0 18px;
  }
  .wordmark {
    font-size: clamp(78px, 12.5vw, 170px);
  }
  .title-tagline {
    margin: 13px 0 16px;
  }
  .title-save {
    margin-top: 15px;
  }
  .shift-brief {
    max-height: 55vh;
    overflow-y: auto;
  }
  .brief-list li {
    padding: 9px 0;
  }
  .brief-list p {
    display: none;
  }
  .control-strip {
    padding-top: 9px;
  }
  .mission-card {
    top: 108px;
  }
  .speedo {
    bottom: 16px;
  }
  .toast-stack {
    bottom: 70px;
  }
}


@media (max-height: 740px) and (min-width: 761px) {
  .garage-topbar {
    padding-top: 14px;
    padding-bottom: 12px;
  }
  .garage-body {
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 18px;
  }
  .garage-preview {
    min-height: 150px;
    max-height: 210px;
  }
  .garage-left {
    gap: 9px;
  }
  .garage-left .bike-heading {
    padding-bottom: 7px;
  }
  .garage-left .bike-heading h3 {
    font-size: 23px;
  }
  .garage-left .spec-list {
    padding: 7px 0 4px;
  }
  .garage-left .spec-row {
    margin-bottom: 5px;
  }
  .garage-left .spec-row-label {
    font-size: 7px;
  }
  .garage-left .spec-row-label span:last-child {
    font-size: 11px;
  }
  .garage-left .garage-meta {
    padding: 6px 0;
  }
  .garage-left .garage-meta strong {
    font-size: 16px;
  }
  .garage-left .spec-extra {
    display: none;
  }
  .upgrade-card {
    min-height: 172px;
  }
}

/* ------------------------------------------------------------------ */
/* Food, interior handoffs, and interaction prompt                     */
/* ------------------------------------------------------------------ */
.food-icon {
  --food-color: var(--acid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--food-color) 42%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--food-color) 12%, rgba(8, 10, 15, 0.8));
  color: var(--food-color);
}

.food-icon.small {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.food-icon.large {
  width: 48px;
  height: 48px;
  padding: 8px;
}

.food-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mission-food {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.mission-food-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.mission-food-copy em {
  color: var(--pink);
  font-family: var(--display);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
}

.mission-food-copy strong {
  overflow: hidden;
  color: rgba(244, 240, 227, 0.78);
  font-family: var(--body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.07em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.interact-prompt {
  position: absolute;
  left: 50%;
  bottom: 104px;
  z-index: 14;
  display: grid;
  grid-template-columns: 42px 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  width: min(440px, calc(100vw - 40px));
  min-height: 62px;
  padding: 9px 13px 9px 10px;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.03), transparent 55%),
    rgba(8, 10, 16, 0.92);
  color: var(--cream);
  text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  pointer-events: auto;
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
}

.interact-prompt::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 54px;
  height: 1px;
  background: var(--interact-accent, var(--acid));
}

.interact-prompt.is-ready {
  border-color: color-mix(in srgb, var(--interact-accent, var(--acid)) 62%, transparent);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--interact-accent, var(--acid)) 9%, transparent), transparent 58%),
    rgba(8, 10, 16, 0.94);
  animation: interactPulse 1.5s ease-in-out infinite;
}

.interact-prompt.is-blocked {
  border-color: rgba(255, 63, 93, 0.24);
  opacity: 0.92;
}

.interact-prompt.is-blocked .interact-key {
  color: var(--dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

@keyframes interactPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(216, 255, 62, 0); }
  50% { box-shadow: 0 0 26px color-mix(in srgb, var(--interact-accent, var(--acid)) 18%, transparent); }
}

.interact-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--interact-accent, var(--acid));
  border-radius: 50%;
  background: color-mix(in srgb, var(--interact-accent, var(--acid)) 12%, transparent);
  color: var(--interact-accent, var(--acid));
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
}

.interact-food {
  display: flex;
  align-items: center;
  justify-content: center;
}

.interact-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.interact-kicker {
  color: var(--interact-accent, var(--acid));
  font-family: var(--body);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.interact-copy strong {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.interact-copy em {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.interact-arrow {
  color: var(--dim);
  font-family: var(--body);
  font-size: 17px;
}

.interior-screen {
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at 27% 46%, rgba(62, 82, 83, 0.22), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 79, 135, 0.055), transparent 38%),
    #07080d;
}

.interior-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.016) 0,
    rgba(255, 255, 255, 0.016) 1px,
    transparent 1px,
    transparent 90px
  );
}

.interior-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  width: min(1240px, 100%);
  height: min(77vh, 730px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0b0d13;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.55);
}

.interior-shell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: min(58%, 620px);
  height: 2px;
  background: var(--interior-accent, var(--acid));
}

.interior-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(216, 255, 62, 0.045), transparent 50%),
    #06070b;
}

#interior-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.interior-stage-top,
.interior-stage-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(244, 240, 227, 0.42);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.interior-stage-top {
  top: 14px;
}

.interior-stage-top span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--interior-accent, var(--acid));
}

.interior-stage-top i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--interior-accent, var(--acid));
  box-shadow: 0 0 8px var(--interior-accent, var(--acid));
}

.interior-stage-bottom {
  bottom: 13px;
}

#interior-stage-order {
  color: var(--cream);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.interior-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 26px 20px;
  overflow-y: auto;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.04), transparent 43%),
    #0a0c12;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 255, 62, 0.28) transparent;
}

.interior-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--interior-accent, var(--acid));
  font-family: var(--body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.interior-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: -4px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1;
}

.interior-close:hover {
  color: var(--cream);
}

.interior-panel h2 {
  margin: 18px 0 5px;
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 0.88;
}

.interior-sub {
  margin: 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.interior-dialogue {
  position: relative;
  margin: 23px 0 18px;
  padding: 15px 17px 13px;
  border-left: 2px solid var(--interior-accent, var(--acid));
  background: rgba(255, 255, 255, 0.035);
}

.interior-dialogue span {
  display: block;
  color: rgba(244, 240, 227, 0.73);
  font-family: var(--body);
  font-size: 11px;
  line-height: 1.55;
}

.interior-dialogue cite {
  display: block;
  margin-top: 8px;
  color: var(--interior-accent, var(--acid));
  font-family: var(--body);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.13em;
}

.interior-order-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.interior-order-card > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.interior-order-label {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.interior-order-card strong {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#interior-food-qty {
  color: var(--muted);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.interior-order-number {
  align-self: flex-start;
  color: var(--dim);
  font-family: var(--display);
  font-size: 16px;
}

.interior-meta {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.interior-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.interior-meta span {
  color: var(--dim);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.interior-meta strong {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.interior-confirm {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 21px;
}

.interior-confirm-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(10, 12, 16, 0.38);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
}

.interior-back {
  align-self: flex-start;
  margin-top: 11px;
  padding: 3px 0;
  color: var(--dim);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.interior-back:hover {
  color: var(--cream);
}

.interior-note {
  margin: 12px 0 0;
  color: rgba(244, 240, 227, 0.3);
  font-family: var(--body);
  font-size: 7px;
  line-height: 1.5;
}

.interior-screen .interior-shell {
  animation: interiorIn 0.35s var(--ease) both;
}

@keyframes interiorIn {
  from { opacity: 0; transform: translateY(10px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .interior-shell {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  }
}

@media (max-width: 860px) {
  .interior-screen {
    padding: 12px;
    align-items: stretch;
  }
  .interior-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 24px);
    min-height: 0;
    overflow-y: auto;
  }
  .interior-stage {
    flex: 0 0 31vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .interior-panel {
    flex: 1;
    overflow: visible;
    padding: 16px;
  }
  .interior-panel h2 {
    margin-top: 12px;
    font-size: 37px;
  }
  .interior-dialogue {
    margin: 14px 0;
    padding: 11px 12px 10px;
  }
  .interior-dialogue span {
    font-size: 10px;
  }
  .interior-confirm {
    margin-top: 16px;
  }
}

@media (max-width: 760px) {
  .mission-food {
    margin-top: 7px;
  }
  .mission-food-copy strong {
    font-size: 7px;
  }
  .food-icon.small {
    width: 24px;
    height: 24px;
    padding: 3px;
  }
  .interact-prompt {
    bottom: 235px;
    grid-template-columns: 34px 30px minmax(0, 1fr) 14px;
    gap: 8px;
    width: calc(100vw - 20px);
    min-height: 54px;
    padding: 7px 9px;
  }
  .interact-key {
    width: 31px;
    height: 31px;
    font-size: 18px;
  }
  .interact-copy strong {
    font-size: 18px;
  }
  .interact-copy em {
    font-size: 7px;
  }
  .interact-kicker {
    font-size: 6px;
  }
  .interior-screen {
    padding: 0;
  }
  .interior-shell {
    width: 100%;
    height: 100%;
    border: 0;
  }
  .interior-stage {
    flex-basis: 30vh;
  }
  .interior-stage-top,
  .interior-stage-bottom {
    font-size: 7px;
    left: 10px;
    right: 10px;
  }
  .interior-panel {
    padding: 14px;
  }
  .interior-panel h2 {
    font-size: 36px;
  }
  .interior-dialogue {
    margin: 12px 0;
  }
  .interior-order-card {
    padding: 10px;
  }
  .interior-order-card strong {
    font-size: 20px;
  }
  .interior-confirm {
    min-height: 50px;
    font-size: 19px;
  }
  .interior-note {
    padding-bottom: 8px;
  }
}


.interact-key.touch-key,
.interior-confirm-key.touch-key {
  font-family: var(--body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 760px) {
  .interior-confirm-key {
    width: 30px;
    height: 22px;
    font-size: 8px;
  }
}

/* ------------------------------------------------------------------ */
/* Order tiers, style combo and nitro pads                             */
/* ------------------------------------------------------------------ */
.mission-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-type {
  --type-color: var(--acid);
  padding: 3px 7px 2px;
  border: 1px solid color-mix(in srgb, var(--type-color) 55%, transparent);
  background: color-mix(in srgb, var(--type-color) 12%, transparent);
  color: var(--type-color);
  font-family: var(--body);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}

.mission-type[data-type="fragile"] {
  animation: typePulse 1.1s ease-in-out infinite alternate;
}

@keyframes typePulse {
  to { box-shadow: 0 0 15px color-mix(in srgb, var(--type-color) 25%, transparent); }
}

.style-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(99, 238, 224, 0.17);
  color: var(--cyan);
  font-family: var(--body);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.style-row strong {
  color: var(--cream);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.style-track {
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.11);
}

.style-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(99, 238, 224, 0.55);
  transition: width 0.08s linear;
}

.style-row em {
  color: rgba(99, 238, 224, 0.62);
  font-style: normal;
  font-size: 6px;
  letter-spacing: 0.06em;
}

.style-row.is-hot strong {
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(99, 238, 224, 0.4);
}

.toast-style {
  border-left-color: var(--cyan);
}
.toast-style .toast-kicker {
  color: var(--cyan);
}

.results-grid strong.positive {
  color: var(--cyan);
}

.interior-screen[data-order-type="vip"] {
  --interior-accent: #ffd166;
}
.interior-screen[data-order-type="fragile"] {
  --interior-accent: #ff7ca8;
}

@media (max-width: 760px) {
  .style-row {
    margin-top: 7px;
    padding-top: 6px;
  }
  .style-row strong {
    font-size: 15px;
  }
  .style-row em {
    font-size: 5px;
  }
  .mission-meta {
    gap: 7px;
  }
  .mission-type {
    font-size: 6px;
    padding: 2px 5px;
  }
}

.touch-hop {
  border-color: rgba(99, 238, 224, 0.4) !important;
  color: var(--cyan) !important;
  font-size: 12px !important;
  letter-spacing: 0.02em !important;
}

@media (max-width: 760px) {
  .touch-drive {
    display: grid;
    grid-template-columns: repeat(2, minmax(54px, 1fr));
    gap: 5px;
    align-items: stretch;
  }
  .touch-controls .touch-drive button {
    min-width: 0;
    min-height: 46px;
    font-size: 15px;
  }
  .touch-controls .touch-drive .touch-gaspedal {
    min-width: 0;
    min-height: 60px;
    font-size: 22px;
  }
}

/* Compact mobile HUD: the run strip becomes a timer inside the mission card,
   and the speedometer is lifted clear of the touch controls. */
.mission-inline-timer {
  display: none;
}

@media (max-width: 760px) {
  #run-strip,
  #signal-readout {
    display: none;
  }
  .mission-inline-timer {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 48px;
    color: var(--cream);
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  .mission-inline-timer.pickup {
    color: var(--dim);
    font-family: var(--body);
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 0.08em;
  }
  .mission-inline-timer.low {
    color: var(--orange);
  }
  .mission-inline-timer.late {
    color: var(--red);
  }
  .hud-center {
    top: 140px;
    width: calc(100vw - 20px);
    min-width: 0;
  }
  .hud.has-wanted #mission-card {
    display: none;
  }
  .hud.has-wanted .hud-center {
    top: 140px;
  }
  .wanted-panel {
    width: 100%;
    max-width: 340px;
  }
  .touch-device .speedo {
    bottom: 150px;
  }
  .touch-device .toast-stack {
    bottom: 390px;
  }
  .interact-prompt {
    bottom: 320px;
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  .touch-device .speedo {
    bottom: 132px;
  }
  .touch-device .toast-stack {
    bottom: 350px;
  }
  .interact-prompt {
    bottom: 285px;
  }
}

.mission-meta {
  padding-right: 34px;
}
@media (max-width: 760px) {
  .mission-meta {
    padding-right: 44px;
  }
}
