:root {
  color-scheme: dark;
  --ink: #07171c;
  --deep-water: #0d2329;
  --water: #173b43;
  --water-soft: #285661;
  --paper: #f2eddf;
  --paper-muted: #c9c7bd;
  --sea-glass: #78c6c0;
  --sea-glass-dark: #347c79;
  --cedar: #bd6d43;
  --signal: #f08a4b;
  --ferry: #f3e9d1;
  --muted: #9eaaa8;
  --line: rgba(229, 238, 233, .22);
  --panel: rgba(7, 23, 28, .9);
  --panel-solid: #102a31;
  --shadow: rgba(1, 9, 12, .48);
  --focus: #f6bd78;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #f5f0e4;
  --deep-water: #dce9e5;
  --water: #c3d9d6;
  --water-soft: #9ebfbb;
  --paper: #16363d;
  --paper-muted: #31545a;
  --sea-glass: #0a6c6b;
  --sea-glass-dark: #075251;
  --cedar: #944f31;
  --signal: #c95720;
  --ferry: #fffaf0;
  --muted: #587176;
  --line: rgba(18, 56, 63, .22);
  --panel: rgba(239, 245, 239, .93);
  --panel-solid: #edf3ed;
  --shadow: rgba(24, 57, 62, .22);
  --focus: #9a3f17;
}

* { box-sizing: border-box; }

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

body {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

button,
a { font: inherit; }

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled { cursor: wait; opacity: .55; }

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--deep-water);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--deep-water);
  outline-offset: -4px;
}

.topbar {
  position: absolute;
  z-index: 40;
  top: calc(10px + var(--safe-top));
  right: calc(12px + var(--safe-right));
  left: calc(12px + var(--safe-left));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.back-link,
.utility-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--paper);
  box-shadow: 0 4px 16px var(--shadow);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
}

.back-link > span:first-child { color: var(--sea-glass); font-size: 18px; }

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}

html[data-theme="light"] .masthead { text-shadow: 0 1px 1px rgba(255, 255, 255, .7); }

.masthead span {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: .075em;
}

.masthead b {
  color: var(--sea-glass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
}

.utility-actions {
  justify-self: end;
  display: flex;
  gap: 7px;
}

.utility-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  cursor: pointer;
}

.utility-actions button:hover,
.back-link:hover { border-color: var(--sea-glass); }

.button-icon { color: var(--sea-glass); font-size: 17px; line-height: 1; }

#themeBtn .button-copy { display: none; }
#themeBtn::after { content: "Light mode"; }
#themeBtn[aria-pressed="true"]::after { content: "Dark mode"; }

.play-only { display: none !important; }
body[data-game-state="playing"] .play-only,
body[data-game-state="paused"] .play-only { display: inline-flex !important; }

.ride-hud,
.route-instrument,
.objective-panel,
.nearby-prompt,
.action-prompt { opacity: 0; pointer-events: none; }

body[data-game-state="playing"] .ride-hud,
body[data-game-state="playing"] .route-instrument,
body[data-game-state="playing"] .objective-panel,
body[data-game-state="playing"] .nearby-prompt:not(.hidden),
body[data-game-state="playing"] .action-prompt:not(.hidden),
body[data-game-state="paused"] .ride-hud,
body[data-game-state="paused"] .route-instrument,
body[data-game-state="paused"] .objective-panel {
  opacity: 1;
}

.ride-hud {
  position: absolute;
  z-index: 20;
  top: calc(70px + var(--safe-top));
  left: calc(16px + var(--safe-left));
  display: grid;
  grid-template-columns: 116px 112px 76px;
  grid-template-rows: auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sea-glass);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 8px 26px var(--shadow);
  transition: opacity .2s ease;
}

.speed-readout {
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  min-height: 96px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.speed-readout span,
.hud-stat span,
.location-readout span,
.objective-panel > span,
.map-heading > span,
.nearby-prompt > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.speed-readout span { grid-column: 1 / 3; }
.speed-readout strong {
  align-self: end;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: .95;
}
.speed-readout small { align-self: end; color: var(--sea-glass); font-size: 10px; font-weight: 800; text-transform: uppercase; }

.hud-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.hud-stat strong { font-family: Consolas, "Courier New", monospace; font-size: 16px; }
.volts-stat { border-left: 1px solid var(--line); }
.volts-stat strong { color: var(--signal); }
.battery-track { flex: 0 0 100%; height: 3px; background: var(--line); }
.battery-track b { display: block; width: 100%; height: 100%; background: var(--sea-glass); }

.location-readout {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 8px 10px;
}
.location-readout strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.route-instrument {
  position: absolute;
  z-index: 20;
  top: calc(70px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  width: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 8px 26px var(--shadow);
  transition: opacity .2s ease;
}

.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}
.map-heading b { color: var(--sea-glass); font-family: Georgia, serif; font-size: 11px; font-style: italic; font-weight: 600; }
#minimap { display: block; width: 100%; height: 160px; background: rgba(19, 55, 62, .72); }
html[data-theme="light"] #minimap { background: rgba(197, 220, 216, .8); }

.route-legend {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  min-height: 34px;
  padding: 8px 9px;
  border-top: 1px solid var(--line);
}
.route-legend span { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.route-legend i { display: block; width: 13px; height: 3px; background: var(--sea-glass); }
.route-legend .legend-challenge { width: 7px; height: 7px; background: var(--signal); transform: rotate(45deg); }
.route-legend .legend-you { width: 7px; height: 7px; border: 2px solid var(--ferry); border-radius: 50%; background: var(--cedar); }

.objective-panel {
  position: absolute;
  z-index: 20;
  right: 290px;
  bottom: calc(24px + var(--safe-bottom));
  left: 290px;
  display: grid;
  justify-items: center;
  min-width: 300px;
  margin: auto;
  padding: 9px 22px 10px;
  border-top: 3px solid var(--signal);
  background: var(--panel);
  box-shadow: 0 8px 26px var(--shadow);
  text-align: center;
  transition: opacity .2s ease;
}
.objective-panel strong { margin-top: 2px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(16px, 1.6vw, 22px); font-weight: 600; }
.objective-panel small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.nearby-prompt {
  position: absolute;
  z-index: 25;
  top: 48%;
  left: calc(18px + var(--safe-left));
  width: 220px;
  padding: 10px 11px;
  border-left: 4px solid var(--signal);
  background: var(--panel);
  box-shadow: 0 8px 24px var(--shadow);
}
.nearby-prompt strong { display: block; margin: 3px 0 9px; font-family: Georgia, serif; font-size: 17px; }
.nearby-prompt button {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--signal);
  color: #15252a;
  font-weight: 900;
  cursor: pointer;
}
kbd { border: 1px solid currentColor; border-radius: 2px; padding: 1px 5px; font: inherit; }

.action-prompt {
  position: absolute;
  z-index: 24;
  top: 43%;
  left: 50%;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.ride-toast {
  position: absolute;
  z-index: 28;
  top: 28%;
  left: 50%;
  padding: 9px 14px;
  border-left: 4px solid var(--signal);
  background: var(--panel);
  box-shadow: 0 6px 18px var(--shadow);
  color: var(--paper);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity .18s ease, transform .18s ease;
}
.ride-toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

.overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(70px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background: rgba(4, 15, 19, .65);
}

html[data-theme="light"] .overlay { background: rgba(202, 220, 216, .58); }

.garage-overlay {
  overflow: auto;
  overscroll-behavior: contain;
}

.garage-sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(550px, 1.28fr);
  width: min(1120px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 5px solid var(--sea-glass);
  border-radius: 3px;
  background: var(--panel-solid);
  box-shadow: 0 24px 60px var(--shadow);
}

.garage-sheet::before {
  content: "49.1659° N  /  123.9401° W";
  position: absolute;
  top: 14px;
  right: 18px;
  color: var(--muted);
  font: 700 9px/1 Consolas, "Courier New", monospace;
  letter-spacing: .12em;
}

.garage-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 510px;
  padding: 50px clamp(28px, 4vw, 60px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--deep-water);
}

.garage-intro::after {
  content: "";
  position: absolute;
  right: -92px;
  bottom: 44px;
  width: 250px;
  height: 250px;
  border: 2px solid var(--sea-glass);
  border-radius: 50%;
  opacity: .2;
  box-shadow: 0 0 0 20px var(--deep-water), 0 0 0 22px var(--sea-glass), 0 0 0 45px var(--deep-water), 0 0 0 47px var(--sea-glass);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sea-glass);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

.garage-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(58px, 7vw, 102px);
  font-weight: 400;
  letter-spacing: .035em;
  line-height: .82;
}
.garage-intro h1 span { display: block; color: var(--ferry); font-size: .44em; letter-spacing: .15em; line-height: 1.2; }
.subtitle { margin: 17px 0 20px; color: var(--signal); font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 2.5vw, 31px); font-style: italic; }
.lede { position: relative; z-index: 1; max-width: 430px; margin-bottom: 0; color: var(--paper-muted); font-size: 14px; line-height: 1.65; }

.garage-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 38px clamp(24px, 3vw, 42px) 20px; }
.garage-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.garage-heading span { color: var(--signal); font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.garage-heading h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 600; }
.garage-heading p { max-width: 245px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: right; }

.scooter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.scooter-card {
  position: relative;
  min-height: 102px;
  padding: 13px 15px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.scooter-card::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: transparent; }
.scooter-card:hover { background: rgba(120, 198, 192, .07); }
.scooter-card.selected { background: rgba(120, 198, 192, .11); }
.scooter-card.selected::after { background: var(--sea-glass); }
.scooter-card.selected .scooter-code { color: var(--sea-glass); }
.scooter-card strong { display: block; margin: 3px 0 3px; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: 22px; font-weight: 400; letter-spacing: .065em; }
.scooter-card small { display: block; color: var(--paper-muted); font-size: 10px; line-height: 1.25; }
.scooter-card b { display: block; margin-top: 6px; color: var(--signal); font: 800 9px/1 Consolas, "Courier New", monospace; text-transform: uppercase; }
.scooter-code { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.locked-look strong::after { content: " VOLTS"; color: var(--muted); font: 800 7px/1 "Segoe UI", sans-serif; letter-spacing: .12em; vertical-align: middle; }

.route-brief { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 22px; }
.route-line { position: absolute; top: 7px; right: 16.66%; left: 16.66%; height: 2px; background: var(--sea-glass); }
.route-line i { position: absolute; top: -4px; width: 10px; height: 10px; border: 2px solid var(--sea-glass); border-radius: 50%; background: var(--panel-solid); }
.route-line i:first-child { left: 0; }
.route-line i:nth-child(2) { left: 50%; transform: translateX(-50%); }
.route-line i:last-child { right: 0; background: var(--signal); }
.route-brief p { margin: 0; text-align: center; }
.route-brief b { display: block; font-family: Georgia, serif; font-size: 12px; }
.route-brief span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.challenge-copy { display: flex; align-items: baseline; gap: 12px; padding: 8px 10px; border-left: 3px solid var(--signal); background: rgba(240, 138, 75, .08); }
.challenge-copy span { flex: 0 0 auto; color: var(--signal); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.challenge-copy p { margin: 0; color: var(--paper-muted); font-size: 10px; }

.launch-row { display: grid; grid-template-columns: 1fr minmax(230px, .7fr); align-items: center; gap: 18px; }
.controls-note { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.controls-note b { color: var(--paper-muted); text-transform: uppercase; }
.ride-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 8px 0 18px;
  border: 0;
  border-radius: 2px;
  background: var(--signal);
  color: #11242a;
  font-weight: 950;
  letter-spacing: .035em;
  cursor: pointer;
}
.ride-button i { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(17, 36, 42, .4); border-radius: 50%; font-size: 20px; font-style: normal; transition: transform .18s ease; }
.ride-button:not(:disabled):hover i { transform: translateX(3px); }
.legal-note { margin: -4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }

.compact-overlay { z-index: 50; }
.dialog-sheet {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--sea-glass);
  border-radius: 3px;
  background: var(--panel-solid);
  box-shadow: 0 24px 60px var(--shadow);
}
.dialog-sheet h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 600; }
.dialog-sheet > p:not(.eyebrow, .key-help) { color: var(--paper-muted); line-height: 1.5; }
.dialog-actions { display: grid; gap: 8px; margin-top: 22px; }
.dialog-actions button {
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-weight: 800;
  cursor: pointer;
}
.dialog-actions button:hover { border-color: var(--sea-glass); }
.dialog-actions .primary-action { border-color: var(--sea-glass); background: var(--sea-glass); color: #10262b; }
.dialog-actions .quiet-danger { color: var(--signal); }
.key-help { margin: 18px 0 0; color: var(--muted); font: 700 9px/1.5 Consolas, monospace; text-align: center; text-transform: uppercase; }
.result-sheet { text-align: center; }
.result-medal { display: grid; place-items: center; width: 66px; height: 66px; margin: 16px auto 8px; border: 2px solid var(--signal); border-radius: 50%; color: var(--signal); font-size: 32px; }
#resultTime { display: block; font: 400 46px/1 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: .04em; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-stats span { padding: 12px 8px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.result-stats span + span { border-left: 1px solid var(--line); }
.result-stats b { display: block; margin-bottom: 3px; color: var(--paper); font-size: 16px; }
.two-up { grid-template-columns: 1fr 1fr; }

.touch-ui { display: none; }

@media (max-width: 920px) {
  .garage-sheet { grid-template-columns: 1fr; width: min(680px, 100%); }
  .garage-intro { min-height: auto; padding: 25px 30px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .garage-intro::after { display: none; }
  .garage-intro h1 { font-size: 54px; line-height: .87; }
  .subtitle { margin: 7px 0 10px; font-size: 21px; }
  .lede { font-size: 12px; line-height: 1.45; }
  .garage-body { padding-top: 24px; }
  .objective-panel { right: 220px; left: 220px; }
}

@media (max-width: 680px) {
  .topbar { top: calc(7px + var(--safe-top)); right: calc(8px + var(--safe-right)); left: calc(8px + var(--safe-left)); grid-template-columns: 44px 1fr auto; gap: 6px; }
  .back-link { justify-content: center; width: 44px; padding: 0; }
  .back-copy { display: none; }
  .masthead { justify-self: start; display: block; padding-left: 3px; }
  .masthead span { display: block; font-size: 15px; }
  .masthead b { display: block; font-size: 10px; }
  .utility-actions { gap: 5px; }
  .utility-actions button { width: 44px; padding: 0; }
  .utility-actions .button-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #themeBtn::after { display: none; }
  .utility-actions .play-only { width: auto; padding: 0 9px; font-size: 9px; }

  .overlay { padding: calc(60px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left)); }
  .garage-sheet { width: 100%; max-height: 100%; }
  .garage-sheet::before { display: none; }
  .garage-intro { padding: 16px 18px 14px; }
  .garage-intro .eyebrow { display: none; }
  .garage-intro h1 { font-size: 41px; line-height: .86; }
  .subtitle { margin: 6px 0 7px; font-size: 17px; }
  .lede { font-size: 10px; line-height: 1.35; }
  .garage-body { gap: 9px; padding: 13px 12px 10px; }
  .garage-heading { align-items: center; padding-bottom: 7px; }
  .garage-heading h2 { font-size: 19px; }
  .garage-heading p { max-width: 160px; font-size: 8px; line-height: 1.25; }
  .scooter-card { min-height: 91px; padding: 9px 10px 8px; }
  .scooter-card strong { margin: 2px 0; font-size: 18px; }
  .scooter-card small { font-size: 8px; }
  .scooter-card b { margin-top: 4px; font-size: 7px; }
  .route-brief { padding-top: 16px; }
  .route-line { top: 4px; }
  .route-brief b { font-size: 10px; }
  .route-brief span { font-size: 7px; }
  .challenge-copy { gap: 7px; padding: 5px 7px; }
  .challenge-copy span { font-size: 7px; }
  .challenge-copy p { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .launch-row { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 5px; }
  .ride-button { min-height: 50px; }
  .controls-note { overflow: hidden; font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .legal-note { display: none; }

  .ride-hud { top: calc(61px + var(--safe-top)); left: calc(8px + var(--safe-left)); grid-template-columns: 72px 72px; grid-template-rows: 52px; border-left-width: 3px; }
  .speed-readout { grid-row: auto; grid-template-columns: 1fr auto; min-height: 52px; padding: 6px 7px; }
  .speed-readout strong { font-size: 29px; }
  .speed-readout small { font-size: 6px; }
  .speed-readout span,
  .hud-stat span { font-size: 7px; }
  .hud-stat { min-height: 52px; padding: 5px 7px; border-bottom: 0; }
  .hud-stat strong { font-size: 11px; }
  .volts-stat,
  .location-readout { display: none; }

  .route-instrument { top: calc(61px + var(--safe-top)); right: calc(8px + var(--safe-right)); width: 106px; }
  .map-heading { min-height: 24px; padding: 4px 5px; }
  .map-heading > span { font-size: 7px; }
  .map-heading b { display: none; }
  #minimap { height: 72px; }
  .route-legend { min-height: 22px; padding: 5px; }
  .route-legend span { font-size: 0; }
  .route-legend i { width: 17px; }

  .objective-panel { top: calc(188px + var(--safe-top)); right: 50%; bottom: auto; left: auto; min-width: 0; width: min(340px, calc(100% - 24px)); padding: 6px 10px 7px; transform: translateX(50%); }
  .objective-panel > span { font-size: 7px; }
  .objective-panel strong { overflow: hidden; width: 100%; margin-top: 1px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .objective-panel small { display: none; }

  .nearby-prompt { top: 238px; left: calc(8px + var(--safe-left)); width: 175px; padding: 7px 8px; }
  .nearby-prompt strong { margin: 2px 0 6px; font-size: 13px; }
  .nearby-prompt button { min-height: 44px; }
  .action-prompt { top: 246px; max-width: 240px; font-size: 9px; text-align: center; }

  .dialog-sheet { padding: 26px 20px; }
  .dialog-sheet h2 { font-size: 28px; }
  .two-up { grid-template-columns: 1fr; }
}

@media (max-width: 420px) and (max-height: 760px) {
  .garage-intro { padding-top: 10px; padding-bottom: 9px; }
  .garage-intro h1 { font-size: 34px; }
  .subtitle { margin: 4px 0; }
  .lede { display: none; }
  .garage-body { gap: 6px; padding-top: 8px; }
  .garage-heading { padding-bottom: 5px; }
  .garage-heading p { display: none; }
  .scooter-card { min-height: 78px; }
  .route-brief { padding-top: 14px; }
  .challenge-copy { display: none; }
  .ride-button { min-height: 48px; }
}

@media (hover: none), (pointer: coarse) {
  body[data-game-state="playing"] .touch-ui,
  body[data-game-state="paused"] .touch-ui {
    position: absolute;
    z-index: 22;
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    left: calc(8px + var(--safe-left));
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
  }

  body[data-game-state="paused"] .touch-ui { opacity: .35; }
  .touch-ui button { pointer-events: auto; user-select: none; touch-action: none; }
  .steer-pad {
    display: grid;
    grid-template-columns: 58px 30px 58px;
    align-items: center;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--panel);
    box-shadow: 0 6px 18px var(--shadow);
    pointer-events: auto;
  }
  .steer-pad button {
    min-width: 58px;
    min-height: 62px;
    border: 0;
    background: transparent;
    color: var(--paper);
    font-size: 24px;
    font-weight: 900;
  }
  .steer-pad span { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
  .touch-actions { display: flex; pointer-events: none; }
  .touch-actions button {
    display: grid;
    place-items: center;
    min-width: 56px;
    min-height: 64px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    color: var(--paper);
    box-shadow: 0 6px 18px var(--shadow);
  }
  .touch-actions button span { font-size: 19px; font-weight: 900; line-height: 1; }
  .touch-actions button b { font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
  .primary-touch { gap: 6px; }
  #throttleTouch { min-width: 64px; min-height: 72px; border-color: var(--sea-glass); background: var(--sea-glass); color: #10262b; }
  .utility-touch {
    position: absolute;
    right: 2px;
    bottom: 80px;
    gap: 5px;
  }
  .utility-touch button { min-width: 48px; min-height: 48px; box-shadow: 0 4px 12px var(--shadow); }
  .utility-touch button span { font-size: 14px; }
  .utility-touch button b { font-size: 6px; }
}

@media (orientation: landscape) and (max-height: 500px) and (hover: none),
       (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .route-instrument { width: 220px; }
  .map-heading { min-height: 28px; padding: 5px 7px; }
  #minimap { height: 96px; }
  .route-legend { min-height: 26px; padding: 5px 7px; }
}

@media (max-width: 560px) and (hover: none), (max-width: 560px) and (pointer: coarse) {
  .steer-pad { grid-template-columns: 48px 26px 48px; height: 58px; }
  .steer-pad button { min-width: 48px; min-height: 56px; }
  .primary-touch button { min-width: 48px; min-height: 58px; }
  #throttleTouch { min-width: 58px; min-height: 66px; }
}

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