:root {
  color-scheme: dark;
  --ink-950: #11141b;
  --ink-900: #171b25;
  --ink-850: #1d2330;
  --ink-800: #242b38;
  --paper: #f7efe1;
  --paper-muted: #c9c2b7;
  --amber: #ffb648;
  --amber-bright: #ffc96d;
  --ember: #f07145;
  --coral: #e45b42;
  --mint: #79d4ad;
  --line: rgba(255, 255, 255, 0.11);
  --glass: rgba(16, 20, 28, 0.76);
  --shadow: 0 24px 70px rgba(5, 8, 14, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  min-height: 100%;
  background: var(--ink-950);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 82% 4%, rgba(240, 113, 69, 0.17), transparent 28rem),
    radial-gradient(circle at 8% 96%, rgba(121, 212, 173, 0.09), transparent 25rem),
    linear-gradient(145deg, #202635 0%, #11141b 52%, #151922 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only,
.scene-marker {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 30px);
}

.game-console {
  position: relative;
  width: min(100%, 1480px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, rgba(37, 44, 58, 0.96), rgba(20, 24, 33, 0.97));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.08);
}

.game-console::after {
  position: absolute;
  inset: 0;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.game-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(18px, 2.5vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(22, 27, 37, 0.72);
}

.brand-lockup,
.header-actions,
.pedal-group,
.route-controls__buttons,
.keyboard-legend {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 72, 0.42);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(255, 182, 72, 0.16), rgba(240, 113, 69, 0.04));
}

.brand-mark__sun {
  position: absolute;
  top: 9px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 16px rgba(255, 182, 72, 0.55);
}

.brand-mark__ridge,
.brand-mark__ridge::before {
  position: absolute;
  content: "";
  transform: rotate(45deg);
}

.brand-mark__ridge {
  left: 8px;
  bottom: -17px;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #49566a;
}

.brand-mark__ridge::before {
  top: -10px;
  left: -4px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--paper);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-lockup h1 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.38rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.brand-lockup h1 span {
  margin-left: 8px;
  color: var(--paper-muted);
  font-size: 0.66em;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.status-chip {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.status-chip__light {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(121, 212, 173, 0.11), 0 0 14px rgba(121, 212, 173, 0.5);
  animation: signal-pulse 2.2s ease-in-out infinite;
}

.status-chip:has([data-state="crashed"]) .status-chip__light,
.status-chip:has([data-state="out-of-fuel"]) .status-chip__light,
.status-chip:has([data-state="ended"]) .status-chip__light {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(228, 91, 66, 0.12), 0 0 14px rgba(228, 91, 66, 0.5);
  animation: none;
}

.status-chip__text {
  color: #e9e5dc;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.icon-button,
.primary-button,
.secondary-button,
.text-button,
.pedal {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255, 182, 72, 0.27);
  border-radius: 999px;
  background: rgba(255, 182, 72, 0.08);
}

.icon-button:hover {
  border-color: rgba(255, 182, 72, 0.55);
  background: rgba(255, 182, 72, 0.14);
}

.icon-button:active,
.secondary-button:active,
.text-button:active,
.primary-button:active {
  transform: translateY(1px) scale(0.985);
}

.icon-button__label {
  font-size: 0.74rem;
  font-weight: 700;
}

.restart-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid var(--amber);
  border-right-color: transparent;
  border-radius: 50%;
}

.restart-glyph::after {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 0;
  height: 0;
  content: "";
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--amber);
  transform: rotate(-18deg);
}

.pause-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  display: block;
}

.pause-glyph::before,
.pause-glyph::after {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 4px;
  border-radius: 2px;
  content: "";
  background: var(--amber);
}

.pause-glyph::before {
  left: 2px;
}

.pause-glyph::after {
  right: 2px;
}

.icon-button--pause[aria-pressed="true"] .pause-glyph::before {
  inset: 1px auto 1px 3px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--amber);
  border-radius: 0;
  background: transparent;
}

.icon-button--pause[aria-pressed="true"] .pause-glyph::after {
  display: none;
}

.game-stage {
  position: relative;
  isolation: isolate;
  height: clamp(350px, 59vh, 720px);
  min-height: 350px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 204, 112, 0.74) 0 3%, rgba(240, 113, 69, 0.26) 3.2%, transparent 15%),
    linear-gradient(180deg, #cd765c 0%, #6e6471 43%, #29313e 100%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-stage::before,
.game-stage::after {
  position: absolute;
  inset: auto -8% 0;
  z-index: -2;
  height: 58%;
  content: "";
  pointer-events: none;
  clip-path: polygon(0 70%, 10% 45%, 18% 61%, 31% 18%, 43% 58%, 55% 32%, 67% 67%, 79% 28%, 90% 59%, 100% 39%, 100% 100%, 0 100%);
  background: #41495b;
  opacity: 0.48;
}

.game-stage::after {
  z-index: -1;
  height: 40%;
  clip-path: polygon(0 52%, 9% 72%, 20% 40%, 32% 74%, 45% 33%, 58% 65%, 72% 29%, 86% 70%, 100% 38%, 100% 100%, 0 100%);
  background: #29313e;
  opacity: 0.78;
}

.stage-glow {
  position: absolute;
  top: -30%;
  left: 54%;
  z-index: -1;
  width: min(54vw, 740px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 205, 119, 0.26), transparent 64%);
  pointer-events: none;
}

.stage-grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px),
    linear-gradient(90deg, rgba(24, 28, 36, 0.18), transparent 17%, transparent 83%, rgba(24, 28, 36, 0.18));
  mix-blend-mode: soft-light;
}

.game-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.hud {
  position: absolute;
  inset: 18px 18px auto;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(104px, 146px));
  gap: 7px;
}

.telemetry-card,
.route-plaque {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(145deg, rgba(19, 23, 31, 0.82), rgba(27, 32, 42, 0.66));
  box-shadow: 0 10px 28px rgba(10, 13, 19, 0.15), inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}

.telemetry-card {
  min-width: 0;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 13px;
}

.telemetry-card__label,
.route-plaque__copy > span,
.route-controls__label {
  color: #c7c1b7;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.telemetry-card__value {
  margin-top: 4px;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.8vw, 1.18rem);
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-card--speed {
  border-color: rgba(255, 182, 72, 0.3);
}

.telemetry-card--speed .telemetry-card__value {
  color: var(--amber-bright);
}

.telemetry-card--speed .telemetry-card__value::after {
  content: " km/h";
  color: var(--paper-muted);
  font-size: 0.55em;
  font-weight: 700;
}

#distance-display::after {
  content: " m";
  color: var(--paper-muted);
  font-size: 0.55em;
  font-weight: 700;
}

.telemetry-card--fuel {
  min-width: 132px;
}

.telemetry-card--fuel .telemetry-card__label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

#fuel-display {
  color: var(--amber-bright);
}

#fuel-display::after {
  content: "%";
}

.fuel-meter {
  position: relative;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.fuel-meter__fill {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ember), var(--amber-bright));
  box-shadow: 0 0 13px rgba(255, 182, 72, 0.45);
  transform-origin: left;
  transition: width 160ms linear, transform 160ms linear, background-color 160ms ease;
}

.fuel-meter.is-low .fuel-meter__fill,
.fuel-meter[data-level="low"] .fuel-meter__fill,
.fuel-meter__fill[data-level="low"],
.fuel-meter__fill[data-level="critical"] {
  background: linear-gradient(90deg, #c9413a, var(--coral));
  box-shadow: 0 0 13px rgba(228, 91, 66, 0.5);
  animation: low-fuel 0.8s ease-in-out infinite alternate;
}

.fuel-meter__ticks {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(13, 16, 22, 0.4) calc(20% - 1px) 20%);
}

.route-plaque {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 14px;
}

.route-plaque__icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(121, 212, 173, 0.42);
  border-radius: 50%;
}

.route-plaque__icon::before,
.route-plaque__icon::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 2px;
  height: 8px;
  content: "";
  background: var(--mint);
  transform: translate(-50%, -92%);
  transform-origin: 50% 92%;
}

.route-plaque__icon::after {
  height: 6px;
  transform: translate(-50%, -92%) rotate(125deg);
}

.route-plaque__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#run-seed {
  max-width: 180px;
  overflow: hidden;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-toast {
  position: absolute;
  top: 102px;
  left: 50%;
  z-index: 7;
  min-width: min(310px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  background: rgba(18, 22, 30, 0.88);
  box-shadow: 0 16px 36px rgba(8, 10, 15, 0.3);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  animation: toast-arrive 420ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.event-toast strong,
.event-toast small {
  display: block;
}

.event-toast strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.event-toast small {
  margin-top: 2px;
  color: var(--paper-muted);
  font-size: 0.64rem;
}

.event-toast__flag,
.pickup-can {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 182, 72, 0.13);
}

.event-toast__flag::before {
  position: absolute;
  top: 8px;
  left: 11px;
  width: 2px;
  height: 19px;
  content: "";
  background: var(--amber);
}

.event-toast__flag::after {
  position: absolute;
  top: 7px;
  left: 13px;
  width: 12px;
  height: 9px;
  content: "";
  clip-path: polygon(0 0, 100% 16%, 76% 100%, 0 82%);
  background: var(--amber);
}

.pickup-can {
  border: 2px solid var(--mint);
  border-radius: 8px;
  background: rgba(121, 212, 173, 0.1);
}

.pickup-can::before {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 7px;
  height: 5px;
  border: 2px solid var(--mint);
  border-radius: 2px;
  content: "";
}

.pickup-can::after {
  position: absolute;
  top: 10px;
  left: 8px;
  width: 12px;
  height: 12px;
  content: "+";
  color: var(--mint);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 900;
  line-height: 12px;
}

.run-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 14, 20, 0.48);
  backdrop-filter: blur(7px) saturate(80%);
  animation: overlay-in 260ms ease both;
}

.run-overlay__card {
  width: min(100%, 410px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 23px;
  background:
    radial-gradient(circle at 100% 0, rgba(240, 113, 69, 0.18), transparent 48%),
    rgba(24, 29, 39, 0.95);
  box-shadow: 0 28px 70px rgba(3, 5, 9, 0.45), inset 0 1px rgba(255, 255, 255, 0.09);
  text-align: center;
}

.run-overlay__badge {
  position: relative;
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 14px;
  border: 1px solid rgba(228, 91, 66, 0.38);
  border-radius: 15px;
  background: rgba(228, 91, 66, 0.1);
}

.run-overlay__badge::before,
.run-overlay__badge::after {
  position: absolute;
  top: 22px;
  left: 13px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  content: "";
  background: var(--coral);
  transform: rotate(45deg);
}

.run-overlay__badge::after {
  transform: rotate(-45deg);
}

.run-overlay__kicker {
  margin: 0 0 6px;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.run-overlay h2 {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.45rem);
  letter-spacing: -0.04em;
}

.run-overlay p:not(.run-overlay__kicker) {
  max-width: 34ch;
  margin: 10px auto 21px;
  color: var(--paper-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.primary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0 18px;
  border-radius: 12px;
  color: #251b12;
  background: linear-gradient(135deg, var(--amber-bright), var(--amber));
  box-shadow: 0 8px 24px rgba(255, 182, 72, 0.22), inset 0 1px rgba(255, 255, 255, 0.45);
  font-size: 0.77rem;
  font-weight: 800;
}

.primary-button:hover {
  box-shadow: 0 10px 30px rgba(255, 182, 72, 0.34), inset 0 1px rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.stage-hint {
  position: absolute;
  right: 18px;
  bottom: 15px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(247, 239, 225, 0.7);
  background: rgba(16, 20, 28, 0.42);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.stage-hint__key,
kbd {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-bottom-color: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px rgba(0, 0, 0, 0.18);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(340px, 0.8fr);
  align-items: stretch;
  gap: clamp(14px, 2.3vw, 30px);
  padding: 17px clamp(18px, 2.5vw, 34px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(38, 45, 58, 0.88), rgba(26, 31, 41, 0.95));
}

.pedal-group {
  gap: 10px;
}

.pedal {
  min-height: 67px;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom-width: 3px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 8px 18px rgba(5, 8, 12, 0.12), inset 0 1px rgba(255, 255, 255, 0.05);
  touch-action: none;
  user-select: none;
}

.pedal:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.pedal--accelerate {
  border-color: rgba(255, 182, 72, 0.32);
  color: #2b2117;
  background: linear-gradient(145deg, var(--amber-bright), #f3a33d);
  box-shadow: 0 9px 24px rgba(255, 182, 72, 0.17), inset 0 1px rgba(255, 255, 255, 0.38);
}

.pedal--accelerate:hover {
  border-color: var(--amber-bright);
  background: linear-gradient(145deg, #ffd586, #ffad40);
  box-shadow: 0 11px 28px rgba(255, 182, 72, 0.24), inset 0 1px rgba(255, 255, 255, 0.42);
}

.pedal:active,
.pedal.is-pressed,
.pedal[data-pressed="true"],
.pedal[aria-pressed="true"] {
  border-bottom-width: 1px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.22);
  transform: translateY(2px) scale(0.99);
}

.pedal--accelerate:active,
.pedal--accelerate.is-pressed,
.pedal--accelerate[data-pressed="true"],
.pedal--accelerate[aria-pressed="true"] {
  color: #261c11;
  background: linear-gradient(145deg, #df8d2f, #f6af48);
  box-shadow: inset 0 4px 15px rgba(93, 50, 12, 0.26), 0 0 22px rgba(255, 182, 72, 0.18);
}

.pedal__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pedal__copy strong {
  font-size: 0.86rem;
  letter-spacing: 0.015em;
}

.pedal__copy small {
  margin-top: 3px;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
}

.pedal--accelerate .pedal__copy small {
  color: rgba(43, 33, 23, 0.67);
}

.pedal__icon--brake {
  display: flex;
  gap: 5px;
}

.pedal__icon--brake i {
  width: 4px;
  height: 21px;
  display: block;
  border-radius: 2px;
  background: var(--paper-muted);
  transform: skew(-9deg);
}

.pedal__icon--accelerate {
  position: relative;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(43, 33, 23, 0.76);
  border-radius: 50%;
}

.pedal__icon--accelerate::before,
.pedal__icon--accelerate::after {
  position: absolute;
  top: 11px;
  left: 5px;
  width: 13px;
  height: 2px;
  content: "";
  background: rgba(43, 33, 23, 0.76);
}

.pedal__icon--accelerate::after {
  transform: rotate(90deg);
}

.route-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.route-controls label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-controls__field {
  min-height: 43px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  background: rgba(10, 13, 18, 0.28);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.route-controls__field:focus-within {
  border-color: rgba(255, 182, 72, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 182, 72, 0.09);
}

.route-controls__prefix {
  padding-left: 12px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.route-controls input {
  width: 100%;
  min-width: 0;
  height: 41px;
  padding: 0 11px 0 5px;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.route-controls__buttons {
  gap: 7px;
}

.secondary-button,
.text-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 800;
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid rgba(255, 182, 72, 0.38);
  border-radius: 11px;
  color: var(--amber-bright);
  background: rgba(255, 182, 72, 0.085);
}

.secondary-button:hover {
  border-color: rgba(255, 182, 72, 0.68);
  background: rgba(255, 182, 72, 0.14);
}

.text-button {
  gap: 7px;
  padding: 0 8px;
  color: var(--paper-muted);
  background: transparent;
}

.text-button:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
}

.dice-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.dice-glyph::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  content: "";
  background: currentColor;
  box-shadow: 6px 0 currentColor, 3px 5px currentColor;
}

.game-footer {
  min-height: 39px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 7px clamp(18px, 2.5vw, 34px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(201, 194, 183, 0.62);
  background: rgba(14, 18, 25, 0.52);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-footer p {
  margin: 0;
}

.footer-dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(121, 212, 173, 0.4);
}

.keyboard-legend {
  justify-content: center;
  gap: 15px;
}

.keyboard-legend > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.keyboard-legend kbd {
  min-width: 18px;
  height: 18px;
  font-size: 0.5rem;
}

.build-stamp {
  justify-self: end;
}

@keyframes signal-pulse {
  0%, 100% { opacity: 0.74; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes low-fuel {
  from { opacity: 0.68; }
  to { opacity: 1; }
}

@keyframes toast-arrive {
  from { opacity: 0; transform: translate(-50%, -14px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 960px) {
  .game-stage {
    height: clamp(330px, 55vh, 570px);
  }

  .control-deck {
    grid-template-columns: 1fr;
  }

  .route-controls {
    grid-template-columns: minmax(190px, 1fr) auto;
  }

  .game-footer {
    grid-template-columns: 1fr auto;
  }

  .keyboard-legend {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    place-items: start center;
    padding: 0;
  }

  .game-console {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .game-header {
    min-height: 70px;
    gap: 8px;
    padding: 11px 13px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .eyebrow {
    font-size: 0.5rem;
  }

  .brand-lockup h1 {
    font-size: 0.94rem;
  }

  .brand-lockup h1 span {
    display: block;
    margin: 3px 0 0;
    font-size: 0.6em;
  }

  .status-chip {
    min-height: 36px;
    padding: 0 10px;
  }

  .status-chip__text {
    max-width: 78px;
    overflow: hidden;
    font-size: 0.56rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-button {
    width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
  }

  .icon-button__label {
    display: none;
  }

  .game-stage {
    height: clamp(300px, 49vh, 440px);
    min-height: 300px;
  }

  .hud {
    inset: 10px 9px auto;
    flex-direction: column;
    gap: 7px;
  }

  .telemetry-strip {
    width: 100%;
    grid-template-columns: 0.9fr 0.9fr 1.25fr;
    gap: 5px;
  }

  .telemetry-card {
    min-height: 56px;
    padding: 8px 9px;
    border-radius: 11px;
  }

  .telemetry-card--fuel {
    min-width: 0;
  }

  .telemetry-card__label,
  .route-plaque__copy > span {
    font-size: 0.48rem;
    letter-spacing: 0.08em;
  }

  .telemetry-card__value {
    font-size: clamp(0.74rem, 3.5vw, 0.95rem);
  }

  .route-plaque {
    min-height: 39px;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 10px;
  }

  .route-plaque__icon {
    width: 21px;
    height: 21px;
  }

  #run-seed {
    max-width: 150px;
    font-size: 0.62rem;
  }

  .event-toast {
    top: 109px;
  }

  .stage-hint {
    right: 9px;
    bottom: 9px;
    max-width: calc(100% - 18px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-deck {
    gap: 13px;
    padding: 13px;
  }

  .pedal {
    min-height: 66px;
    padding: 10px 12px;
  }

  .route-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .route-controls__buttons {
    gap: 3px;
  }

  .text-button {
    width: 43px;
    padding: 0;
    font-size: 0;
  }

  .text-button .dice-glyph {
    margin: 0;
  }

  .secondary-button {
    padding: 0 11px;
  }

  .game-footer {
    min-height: 35px;
    padding: 7px 13px max(7px, env(safe-area-inset-bottom));
    font-size: 0.48rem;
  }
}

@media (max-width: 410px) {
  .brand-lockup {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .eyebrow {
    display: none;
  }

  .brand-lockup h1 span {
    display: none;
  }

  .brand-lockup h1 {
    font-size: 0.86rem;
  }

  .header-actions {
    gap: 6px;
  }

  .status-chip {
    gap: 6px;
    padding: 0 6px;
  }

  .status-chip__text {
    max-width: 50px;
  }

  .game-stage {
    height: clamp(285px, 47vh, 380px);
    min-height: 285px;
  }

  .telemetry-card {
    padding-inline: 7px;
  }

  .telemetry-card__label {
    letter-spacing: 0.04em;
  }

  .pedal {
    gap: 10px;
  }

  .pedal__copy strong {
    font-size: 0.76rem;
  }

  .pedal__icon--accelerate {
    width: 23px;
    height: 23px;
  }

  .route-controls {
    grid-template-columns: 1fr;
  }

  .route-controls__buttons {
    display: grid;
    grid-template-columns: 1fr 43px;
  }

  .game-footer > p:first-child {
    display: none;
  }

  .game-footer {
    display: flex;
    justify-content: flex-end;
  }
}

@media (max-height: 690px) and (min-width: 721px) {
  .app-shell {
    padding-block: 8px;
  }

  .game-header {
    min-height: 66px;
    padding-block: 9px;
  }

  .game-stage {
    height: calc(100dvh - 230px);
    min-height: 300px;
  }

  .control-deck {
    padding-block: 11px;
  }

  .pedal {
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
