:root {
  color-scheme: dark;
  --ink: #0b111a;
  --panel: #111b27;
  --paper: #f4f7f9;
  --muted: #a6b3c1;
  --lime: #d3fb78;
  --ice: #8bd7ed;
  --amber: #ffc17c;
  --line: rgba(222,236,250,.14);
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  --edge: 24px;
  --instrument-width: 222px;
  --header-action-height: 46px;
  --safe-left: max(var(--edge), env(safe-area-inset-left));
  --safe-right: max(var(--edge), env(safe-area-inset-right));
  --safe-top: max(var(--edge), env(safe-area-inset-top));
  --safe-bottom: max(var(--edge), env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); color: var(--paper); font: 16px var(--sans); -webkit-tap-highlight-color: transparent; }
button, a, input, select { font: inherit; }
button { color: inherit; cursor: pointer; border: 0; touch-action: manipulation; }
button, .steering-pad { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .55; }
button svg, svg.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.boot-screen { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: max(28px,env(safe-area-inset-top)) max(40px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(40px,env(safe-area-inset-left)); background: #09131b; isolation: isolate; touch-action: none; }
.boot-map { position: absolute; z-index: -2; inset: -12% -13% -12% 23%; background: url('./assets/loading-map.svg') center/cover no-repeat; opacity: .8; transform: rotate(-12deg); }
.boot-screen::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#09131b 8%,#09131bf0 31%,#09131b7a 62%,#09131b15),linear-gradient(0deg,#09131b 0%,transparent 25%,transparent 80%,#09131bcc); }
.boot-header, .boot-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.boot-header .brand { font-size: 22px; }
.boot-edition, .boot-footer { color: #9eb2bd; font: 11px/1.5 var(--mono); letter-spacing: 1.3px; }
.boot-content { width: min(520px,55vw); margin: 36px 0; }
.boot-content h2 { margin: 21px 0 18px; font-size: clamp(42px,5.8vw,80px); font-weight: 800; line-height: .99; letter-spacing: -3px; }
.boot-content h2 em { color: var(--lime); font-style: normal; }
.boot-copy { color: #b3c2cd; font-size: 16px; line-height: 1.6; margin: 0 0 42px; }
.boot-readout { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; min-height: 40px; }
.boot-readout > span { font-size: 13px; line-height: 1.5; color: #d9e6ed; }
.boot-readout > strong { flex: 0 0 auto; color: var(--lime); font: 500 30px/1 var(--mono); letter-spacing: -1px; }
.boot-progress { height: 4px; margin: 15px 0; background: #dcecff20; border-radius: 4px; overflow: hidden; }
.boot-progress > i { display: block; height: 100%; width: 0; background: var(--lime); transition: width .25s ease; box-shadow: 0 0 16px #d3fb7860; }
.boot-progress.indeterminate > i { width: 30%; animation: boot-download 1.7s ease-in-out infinite; }
@keyframes boot-download { from { transform: translateX(-110%); } to { transform: translateX(350%); } }
.boot-detail { min-height: 38px; margin: 0; color: #8ea5b4; font-size: 12px; line-height: 1.55; }
.boot-failed .boot-progress > i { background: var(--amber); }
.boot-failed .boot-progress.indeterminate > i { animation: none; }
.boot-failed #bootRetry { margin-top: 20px; }
.map-place-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.point-chip .map-place-name > small { color: #93a6b5; font-size: 10px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 240px; }
.map-address { margin: 5px 0 9px; color: #9eb2c1; font-size: 11px; line-height: 1.35; }
.boot-footer { font-size: 10px; letter-spacing: .7px; }
:fullscreen { background: var(--ink); }
:-webkit-full-screen { background: var(--ink); }
@media (max-width: 700px) and (orientation: portrait) {
  .boot-screen { padding: max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left)); }
  .boot-edition { max-width: 120px; text-align: right; font-size: 9px; }
  .boot-content { width: 100%; margin: 36px 0; }
  .boot-content h2 { font-size: clamp(44px,11vw,68px); letter-spacing: -2px; }
  .boot-map { inset: -2% -80% 5% -25%; opacity: .5; }
  .boot-screen::after { background: linear-gradient(0deg,#09131b 3%,#09131be6 25%,#09131b8a 72%,#09131bd9); }
  .boot-footer > :last-child { max-width: 160px; text-align: right; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .boot-screen { padding: max(16px,env(safe-area-inset-top)) max(28px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(28px,env(safe-area-inset-left)); }
  .boot-content { width: min(480px,58vw); margin: 12px 0; }
  .boot-content h2 { margin: 12px 0; font-size: clamp(33px,7vh,48px); letter-spacing: -1.5px; }
  .boot-copy { display: none; }
  .boot-content .eyebrow { font-size: 9px; }
  .boot-readout { min-height: 25px; }
  .boot-readout > strong { font-size: 24px; }
  .boot-progress { margin: 10px 0; }
  .boot-detail { min-height: 19px; font-size: 11px; }
  .boot-footer { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .boot-progress > i { transition: none; }.boot-progress.indeterminate > i { animation: none; } }
#gameCanvas { display: block; width: 100%; height: 100%; outline: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#vignette { pointer-events: none; position: fixed; inset: 0; background: linear-gradient(180deg,#07101b29,transparent 26%,transparent 65%,#07101b4d); }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 12px/1.4 var(--mono); letter-spacing: 1.7px; }
.short-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; background: var(--lime); }
kbd { border: 1px solid #d6e4f133; border-radius: 5px; padding: 4px 7px; color: #d4deea; background: #ffffff07; font: 12px/1.2 var(--mono); white-space: nowrap; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 13px 18px; border-radius: 10px; font-size: 14px; font-weight: 700; transition: background .15s, border-color .15s, transform .15s; }
.primary { color: #17220d; background: var(--lime); box-shadow: 0 5px 22px #b8ed4c0c; }
.primary:hover { background: #e1ff9e; }
.primary:active, .secondary:active { transform: translateY(1px); }
.secondary { border: 1px solid var(--line); background: #e0edff08; color: var(--paper); }
.secondary:hover { background: #e0edff12; border-color: #d3fb7855; }
.text-button { min-height: 40px; padding: 9px 0; color: #bac7d4; background: none; font-size: 14px; }
.text-button:hover { color: var(--lime); }
.icon-button { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e5efff26; border-radius: 12px; background: #0d1723d9; color: #e5edf5; box-shadow: 0 3px 16px #0002; }
.icon-button:hover { background: #233345; border-color: #d3fb7870; color: var(--lime); }
.icon-button:active { background: #d3fb78; color: #17220d; }

/* Start screen: one clear choice of activity, one clear choice of controls. */
.welcome { position: fixed; inset: 0; display: flex; flex-direction: column; padding: 36px 48px 22px; overflow: auto; touch-action: pan-y; background: linear-gradient(90deg,#07101af5 0%,#0a1421d9 44%,#0a142133 80%),linear-gradient(0deg,#07101abd,transparent 55%); }
.welcome-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-shrink: 0; }
.brand { display: flex; flex-direction: column; color: var(--paper); text-decoration: none; font-weight: 900; line-height: .9; letter-spacing: -1.3px; transform: skew(-5deg); }
.brand > span { font-size: 20px; letter-spacing: -.5px; }
.brand strong { font-size: 37px; }
.brand-slash, .brand-dot { color: var(--lime); }
.brand-slash { margin-left: 3px; }
.edition { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 20px; background: #111d2b80; font: 12px/1.2 var(--mono); letter-spacing: .7px; }
.edition i, .loading-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }
.welcome-main { margin: auto 0; width: min(590px,100%); padding: 34px 0; }
h1 { margin: 22px 0 20px; font-size: clamp(52px,6.4vw,84px); font-weight: 850; line-height: .99; letter-spacing: -4px; }
h1 em { color: var(--lime); font-style: normal; }
.welcome-copy { max-width: 440px; margin: 0 0 24px; color: #bac7d5; font-size: 16px; line-height: 1.55; }
.welcome-play { max-width: 510px; }
.mode-list { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 16px; }
.mode { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #dbe8ff05; color: #c6d1dd; }
.mode svg { width: 22px; height: 22px; color: #93a9bd; }
.mode span { font-size: 14px; font-weight: 600; }
.mode:hover { background: #dbe8ff0c; }
.mode.active { border-color: #d3fb7899; color: var(--lime); background: #d3fb780c; }
.mode.active svg { color: var(--lime); }
.welcome-controls { margin: 0 0 16px; }
.control-picker-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #a4b5c5; font: 12px/1.3 var(--mono); letter-spacing: .8px; }
.control-picker-label small { font: 12px/1.3 var(--sans); letter-spacing: 0; color: #acb9c7; }
.control-mode-options { display: grid; grid-template-columns: repeat(3,1fr); padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: #050d16aa; }
.control-mode-options button { min-height: 39px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #9fadc0; font-size: 14px; font-weight: 600; }
.control-mode-options button svg { width: 19px; height: 19px; }
.control-mode-options button[aria-pressed="true"] { color: #eaf7ff; background: #284254; border-color: #8bd7ed42; }
.start-button { width: 100%; }
.load-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; min-height: 16px; color: #a1aebd; font: 12px/1.4 var(--mono); }
.loading-dot { background: var(--amber); animation: pulse 1.4s infinite; }
.load-status.ready .loading-dot { background: var(--lime); animation: none; }
.welcome-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #9faebe; flex-shrink: 0; }
.control-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.4; }
.control-hint i { font-style: normal; color: #66778b; }
.footer-links { display: flex; gap: 22px; }
.mobile-hint { display: none; }
.touch-enabled .mobile-hint { display: flex; }
.touch-enabled .desktop-hint { display: none; }

/* Driving HUD. Centre of the scene stays clear; controls occupy the edges. */
.hud { position: fixed; inset: 0; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.hud button, .steering-pad { pointer-events: auto; touch-action: none; }
body:not(.is-driving) .hud { visibility: hidden; }
.hud-compat { display: none !important; }
.game-header { position: absolute; top: var(--safe-top); left: var(--safe-left); right: var(--safe-right); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.location-card { min-width: 0; max-width: min(390px,calc(100% - 222px)); padding: 10px 15px 11px; border: 1px solid #cce3ff22; border-radius: 13px; background: linear-gradient(120deg,#101b29ed,#0e1824c4); box-shadow: 0 4px 24px #0002; }
.location-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #b2c4d4; font: 12px/1.2 var(--mono); letter-spacing: .8px; }
.location-dot { height: 5px; width: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 9px #d3fb7833; }
.location-meta time { padding-left: 8px; border-left: 1px solid #cce3ff2b; color: #e7f3fd; font-variant-numeric: tabular-nums; }
.world-phase { color: #90abc0; letter-spacing: 0; text-transform: none; }
.location-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 5px; font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.header-actions { display: flex; gap: 7px; flex-shrink: 0; }
.pause-button { border-color: #d3fb7847; color: var(--lime); }
.minimap-wrap { display: none; position: absolute; left: var(--safe-left); top: calc(var(--safe-top) + 77px); width: 144px; height: 118px; padding: 0; border: 1px solid #cce3ff3b; border-radius: 12px; overflow: hidden; background: #101b27ee; box-shadow: 0 5px 20px #0003; }
.hud-minimap .minimap-wrap { display: block; }
.minimap-wrap canvas { width: 100%; height: 100%; display: block; opacity: .93; }
.map-north { position: absolute; top: 8px; right: 8px; width: 19px; height: 19px; border-radius: 4px; background: #0c1726c7; color: #d8e8f2; font: 12px/19px var(--mono); }
.minimap-caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; height: 25px; padding: 0 9px; color: #c0d1df; background: #0d1824d9; font: 12px/1 var(--mono); letter-spacing: .5px; }
.minimap-caption svg { width: 13px; height: 13px; }
.mission-summary { position: absolute; left: var(--safe-left); top: calc(var(--safe-top) + 77px); display: flex; align-items: center; gap: 9px; max-width: min(360px,calc(100vw - 60px)); min-height: 44px; padding: 10px 12px; border: 1px solid #d3fb7830; border-radius: 10px; background: #101c28e6; text-align: left; }
.hud-minimap .mission-summary { left: calc(var(--safe-left) + 156px); max-width: min(330px,calc(100vw - 390px)); }
.mission-summary > svg { color: var(--lime); width: 18px; height: 18px; }
#missionSummaryTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 14px; }
#missionSummaryMeta { color: var(--lime); white-space: nowrap; font: 12px/1.2 var(--mono); }
.speed-panel { position: absolute; bottom: var(--safe-bottom); left: 50%; transform: translateX(-50%); width: var(--instrument-width); padding: 10px 17px 11px; border: 1px solid #d8e9ff30; border-radius: 15px; background: linear-gradient(140deg,#101b2bec,#0b1521df); box-shadow: 0 8px 30px #0003; }
.speed-main { display: flex; align-items: center; justify-content: center; gap: 15px; }
.gear-block { display: flex; flex-direction: column; align-items: center; padding-right: 14px; border-right: 1px solid #cce3ff26; gap: 3px; }
#gear { color: var(--lime); font: 700 29px/1 var(--mono); }
.gear-block small { font: 12px/1.2 var(--mono); color: #91a6bb; letter-spacing: -.5px; }
.speed-reading { display: flex; align-items: baseline; gap: 6px; }
#speed { font: 750 56px/.95 var(--mono); letter-spacing: -3px; font-variant-numeric: tabular-nums; color: #f6fbff; }
.speed-unit { font: 12px/1 var(--mono); color: #a8bbce; }
.rpm-track { height: 5px; margin-top: 9px; border-radius: 2px; overflow: hidden; background: #ccdef022; position: relative; }
.rpm-track > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#81cde8 5%,#b8efa1 63%,#d3fb78 78%,#ffc17c 100%); }
.rpm-track::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg,transparent 0,transparent calc(8.333% - 2px),#101b29 calc(8.333% - 2px),#101b29 8.333%); }
.speed-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 6px; color: #a5b7c9; white-space: nowrap; font: 12px/1.2 var(--mono); }
.speed-bottom b { color: #e2ecf5; font-weight: 500; }
.speed-bottom small { font: 12px/1.2 var(--sans); color: #8fa3b8; }
.drive-status { position: absolute; top: -9px; left: 14px; padding: 3px 7px; border: 1px solid #a6ce6a33; border-radius: 5px; background: #1b2d29; color: #d3efae; font: 10px/1 var(--mono); letter-spacing: .6px; }
.damage-status { position: absolute; bottom: -18px; right: 0; color: var(--amber); font: 12px/1 var(--mono); text-shadow: 0 1px 3px #000; }
.reverse-drive #gear { color: var(--amber); }
.reverse-drive .drive-status { color: #ffd7a8; border-color: #ffc17c66; background: #382a21; }
.input-mode-shortcut { position: absolute; left: var(--safe-left); bottom: var(--safe-bottom); display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 9px 12px; border: 1px solid #cce3ff22; border-radius: 9px; background: #0b1521c9; color: #aebfcf; font: 12px/1.2 var(--mono); }
.input-mode-shortcut svg { width: 18px; height: 18px; }
.touch-enabled .input-mode-shortcut { display: none; }

/* Visible by JS mode, never dependent on pointer media queries alone. */
.touch-controls { position: absolute; inset: 0; pointer-events: none; touch-action: none; }
.steering-pad { --steer: 0; position: absolute; left: var(--safe-left); bottom: var(--safe-bottom); width: 202px; height: 114px; border: 1px solid #bdd6ef39; border-radius: 24px; background: linear-gradient(150deg,#152539cf,#0b1421ae); box-shadow: inset 0 1px #d6ecff0a,0 5px 22px #0002; outline-offset: 4px; }
.steering-line { position: absolute; left: 18px; right: 18px; top: 47%; height: 2px; background: linear-gradient(90deg,transparent,#95b3d04a 18%,#95b3d04a 82%,transparent); }
.steering-line::before, .steering-line::after { content: ''; position: absolute; top: -4px; width: 2px; height: 10px; border-radius: 2px; background: #b1c7df3b; }
.steering-line::before { left: 0; }.steering-line::after { right: 0; }
.steering-thumb { position: absolute; left: 50%; top: 47%; transform: translate(-50%,-50%); display: flex; align-items: center; justify-content: center; width: 66px; height: 66px; border: 1px solid #aac8e766; border-radius: 50%; color: #dcecf9; background: radial-gradient(circle at 35% 25%,#30475b,#192b3e); box-shadow: 0 3px 10px #0004; transition: left .14s ease-out; }
.steering-thumb svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; width: 45px; height: 45px; transform: rotate(calc(var(--steer) * 90deg)); transition: transform .14s ease-out; }
.steering-origin { display: none; position: absolute; width: 4px; height: 8px; top: 18px; transform: translateX(-50%); border-radius: 4px; background: var(--lime); }
.steering-pad small { position: absolute; bottom: 9px; left: 0; right: 0; text-align: center; color: #a1b4c7; font: 12px/1 var(--mono); letter-spacing: .6px; }
.steering-pad.pressed { border-color: #d3fb7880; background: linear-gradient(150deg,#213a3be0,#10212bd4); }
.steering-pad.pressed .steering-thumb { border-color: var(--lime); color: var(--lime); box-shadow: 0 0 18px #c5f77b1a; transition: none; }
.steering-pad.pressed .steering-thumb svg { transition: none; }
.steering-pad.pressed .steering-origin { display: block; }
.pedals { position: absolute; right: var(--safe-right); bottom: var(--safe-bottom); display: flex; gap: 11px; align-items: flex-end; pointer-events: none; }
.pedals button { pointer-events: auto; touch-action: none; }
.pedal { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; width: 78px; border: 1px solid #bed5ec62; border-radius: 14px; color: #e0eaf3; background: linear-gradient(150deg,#203248dd,#101c2cdb); box-shadow: inset 0 1px #e4f2ff0e,0 5px 20px #0002; font: 700 14px/1 var(--sans); }
.pedal svg { width: 28px; height: 28px; }
.pedal.brake { height: 91px; }
.pedal.throttle { height: 124px; border-color: #d3fb7866; background: linear-gradient(150deg,#3b5037dc,#182b26d9); color: #e0ffad; }
.pedal i { position: absolute; left: 12px; right: 12px; bottom: 9px; height: 3px; background: #c3d8ee1c; border-radius: 2px; }
.pedal.throttle i { background: #d3fb7847; }
.handbrake { position: absolute; left: 0; bottom: 102px; display: flex; align-items: center; justify-content: center; gap: 5px; width: 78px; min-height: 38px; padding: 8px 5px; border: 1px solid #cce0f34a; border-radius: 10px; background: #142233d9; color: #c0d0df; font: 12px/1 var(--mono); }
.handbrake svg { width: 18px; height: 18px; }
.pedal.pressed, .handbrake.pressed { background: #d3fb78; border-color: #eeffd4; color: #182511; box-shadow: 0 0 20px #d3fb7822,inset 0 3px 8px #52720b33; }
.pedal.brake.pressed { background: #ffc17c; border-color: #ffe3ba; color: #352316; }
.pedal.pressed i { background: currentColor; }

/* Menus share the instruments' material; scrolling remains native. */
.overlay { position: fixed; inset: 0; z-index: 12; display: flex; justify-content: center; align-items: center; padding: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); background: #07101ce8; backdrop-filter: blur(10px); touch-action: pan-y; }
.pause-card { width: 470px; max-width: 100%; max-height: calc(100dvh - 36px); padding: 24px; overflow-y: auto; border: 1px solid #cce3ff20; border-radius: 20px; background: linear-gradient(150deg,#162232,#0e1825); box-shadow: 0 24px 80px #0004; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; }
.pause-card h2 { margin: 14px 0 6px; font-size: 42px; line-height: 1; letter-spacing: -1.8px; }
.pause-copy { color: #9eaec0; font-size: 14px; margin: 0 0 22px; }
.pause-card > .primary { width: 100%; }
.pause-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pause-grid > button { display: flex; align-items: center; gap: 9px; min-height: 49px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #d7eaff05; font-size: 14px; text-align: left; }
.pause-grid > button:hover { border-color: #d3fb7870; background: #d3fb7809; }
.pause-grid svg { width: 19px; height: 19px; color: #a5c6db; }
.pause-grid kbd { margin-left: auto; padding: 2px 4px; font-size: 11px; color: #8095aa; }
.pause-grid #noticeMenuButton { grid-column: 1 / -1; }
.pause-progress { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); font: 12px/1.4 var(--mono); color: #92a5ba; }
.pause-bottom { display: flex; justify-content: space-between; gap: 12px; }
.sheet-card { display: flex; flex-direction: column; width: 740px; max-width: 100%; max-height: min(800px,calc(100dvh - 36px)); border: 1px solid #cce3ff2b; border-radius: 18px; background: #111c2a; box-shadow: 0 20px 90px #0005; overflow: hidden; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 23px 26px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sheet-header h2 { font-size: 28px; font-weight: 750; letter-spacing: -.9px; line-height: 1.1; margin: 7px 0 0; }
.sheet-header .icon-button { background: #1c2b3c; flex-shrink: 0; }
.sheet-body { min-height: 0; padding: 22px 26px 26px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: #4b627b #111c2a; -webkit-overflow-scrolling: touch; }
.sheet-body p { color: #adbdcc; font-size: 16px; line-height: 1.55; margin: 0 0 16px; }
.sheet-body p strong { color: #e9f0f6; }
.sheet-body h3 { font-size: 16px; margin: 24px 0 12px; }
.sheet-body a { color: #b9dcf1; text-underline-offset: 3px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button-row > .primary, .button-row > .secondary { flex: 1; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.settings-row > div { min-width: 0; }
.settings-row strong { display: block; font-size: 16px; font-weight: 600; }
.settings-row small { display: block; color: #8fa4ba; font-size: 12px; line-height: 1.45; margin-top: 5px; }
select { max-width: 220px; min-height: 43px; padding: 10px 12px; border: 1px solid #cce3ff30; border-radius: 8px; color: #e3eef8; background: #1b2b3d; font-size: 14px; }
.toggle-button { min-height: 42px; padding: 10px 14px; border-radius: 8px; border: 1px solid #d3fb7850; background: #d3fb7810; color: var(--lime); font-size: 14px; }
.toggle-button.off { color: #afbdcd; border-color: var(--line); background: #ffffff04; }
.controls-intro { padding: 18px; margin-bottom: 10px; border: 1px solid #8bd7ed2b; border-radius: 12px; background: #142638; }
.controls-intro .control-mode-options { margin: 12px 0; }
.controls-intro > strong { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.controls-intro > strong svg { width: 22px; height: 22px; fill: none; stroke: var(--ice); stroke-width: 1.7; }
.control-caption { font-size: 14px !important; margin-bottom: 13px !important; }
.controls-intro .secondary { width: 100%; min-height: 44px; border-color: #8bd7ed45; background: #8bd7ed0b; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 15px 0; font-size: 14px; }
.controls-grid > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; color: #adbdcd; }
.control-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 18px 0; }
.control-step { border: 1px solid var(--line); border-radius: 10px; padding: 15px 12px; }
.control-step > svg { width: 27px; height: 27px; stroke: var(--ice); fill: none; stroke-width: 1.6; margin-bottom: 9px; }
.control-step strong { display: block; font-size: 14px; margin-bottom: 6px; }
.control-step p { font-size: 14px; line-height: 1.4; margin: 0; }
.time-controls { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
.time-range-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 14px; color: #aebed0; }
.time-range-label output { color: var(--lime); font: 20px/1 var(--mono); }
.time-controls input[type="range"] { display: block; width: 100%; height: 30px; accent-color: var(--lime); touch-action: pan-y; }
.time-presets { display: flex; gap: 8px; margin-top: 9px; }
.time-presets button { flex: 1; min-height: 38px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; color: #b9c9d7; background: #d8eaff05; font-size: 14px; }
.time-presets button[aria-pressed="true"] { color: var(--lime); border-color: #d3fb7855; }
.tiny-note, .fiction-note, .source-foot { font-size: 12px !important; line-height: 1.55 !important; color: #8ba0b5 !important; }
.fiction-note { border-left: 2px solid #7893aa55; padding-left: 12px; margin-top: 20px !important; }
.activity-list { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.activity-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 175px; padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #dcecff05; }
.activity-card:hover { background: #d3fb7808; border-color: #d3fb7855; }
.activity-card > small { color: var(--lime); font: 12px/1.3 var(--mono); letter-spacing: .6px; margin-bottom: 12px; }
.activity-card > strong { font-size: 18px; line-height: 1.2; margin-bottom: 8px; }
.activity-card > span { color: #a5b8ca; font-size: 15px; line-height: 1.45; }
.activity-card > .card-foot { margin-top: auto; padding-top: 16px; color: #8ca4bb; font: 12px/1.4 var(--mono); }
.activity-card > .button-row { margin-top:auto; padding-top:14px; width:100%; }
.activity-card .button-row .secondary { flex:0 0 44px; padding:10px; }
.activity-result { display:flex; flex-direction:column; gap:8px; margin:18px 0; padding:20px; background:#d3fb7809; border:1px solid #d3fb7833; border-radius:12px; }
.activity-result > strong { color:var(--lime); font:700 38px/1.1 var(--mono); }
.activity-result small { font:12px/1.2 var(--mono); color:#a8bdce; }
.activity-result > span { color:#b8c9d5; font-size:14px; }
.activity-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:14px 0; }
.activity-metrics span { font-size:13px; color:#9eb5c7; }.activity-metrics b { display:block; margin-top:5px; font:600 19px/1.2 var(--mono); color:#e8f2f8; }
.parking-diagram { display:block; width:240px; max-width:100%; max-height:210px; margin:10px auto; border-radius:12px; background:#0a1420; }
.activity-clue { padding:18px; border-left:3px solid var(--lime); background:#d3fb7808; font-size:18px!important; color:#edf4ef!important; }
.clue-choices { display:grid; gap:9px; }.clue-choices button { text-align:left; min-height:48px; white-space:normal; }
.clue-wrong { opacity:.55; border-color:#b27c6d66; }
.clue-hint { margin-top:15px!important; padding:13px 16px; border-radius:9px; background:#b4d8f111; }
.clue-discovery { margin-bottom:22px; padding-bottom:16px; border-bottom:1px solid var(--line); }.clue-discovery >strong { display:block; color:var(--lime); margin-bottom:9px; }
.clue-discovery small,.memory-source { font-size:12px!important; line-height:1.6; }
.cargo-status { margin:18px 0; }.cargo-status strong { display:flex; justify-content:space-between; font-size:15px; }.cargo-status [role="progressbar"] { height:8px; margin:11px 0; border-radius:5px; overflow:hidden; background:#d5e8ff19; }.cargo-status i { display:block; height:100%; background:var(--lime); }
.memory-list { display:grid; gap:16px; }.memory-card { padding:19px; border:1px solid var(--line); border-radius:12px; background:#d9edff05; }.memory-card >small { color:var(--lime); font:12px/1.3 var(--mono); }.memory-card h3 { margin:12px 0; font-size:20px; }.memory-card .secondary { min-height:44px; white-space:normal; }
.fuel-places { display:grid; gap:8px; margin:18px 0; }.fuel-places button { display:flex; justify-content:space-between; gap:12px; text-align:left; }.fuel-places small { color:#9bb3c4; white-space:nowrap; }
.fuel-enabled .rpm-numeric { display:none; }
.fuel-readout { display:flex; align-items:center; gap:5px; min-height:26px; position:relative; padding:3px 0 5px; color:#a8bdce; background:none; border:0; font:11px/1.2 var(--mono); }
.fuel-readout svg { width:15px; height:15px; }.fuel-readout >i { position:absolute; bottom:0; left:20px; right:0; height:2px; background:#d4e8ff26; }.fuel-readout >i b { display:block; height:100%; background:currentColor; }
.fuel-readout.fuel-low { color:var(--amber); }.fuel-readout.fuel-ready { color:var(--lime); }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 22px 0 16px; }
.stat-block { padding: 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: #e2efff05; }
.stat-block strong { display: block; color: var(--paper); font: 700 25px/1.2 var(--mono); margin-bottom: 8px; }
.stat-block span { font: 12px/1.5 var(--mono); color: #8fa6bd; }
.link-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; font-size: 14px; }
.route-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.route-field { display: flex; flex-direction: column; gap: 8px; color: #a0b3c7; font: 12px/1.2 var(--mono); }
.route-field select { width: 100%; max-width: none; font-family: var(--sans); }
.record-block { margin: 18px 0; padding: 16px; border: 1px solid #d3fb7833; border-radius: 10px; background: #d3fb7806; }
.record-block strong { display: block; font: 30px/1.2 var(--mono); color: var(--lime); margin-bottom: 6px; }
.record-block > span { font: 12px/1.4 var(--mono); color: #99b0bd; }
.map-stage { width: 100%; height: 300px; overflow: hidden; border: 1px solid #c6def62b; border-radius: 11px; background: #10202c; }
.map-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; color: #9bb0c4; font: 12px/1.3 var(--mono); }
.map-legend > span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }.legend-dot.landmark { background: var(--amber); }.legend-dot.target { background: var(--ice); }
.map-categories, .map-points { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.map-filter, .point-chip { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #dceaff05; color: #b7c7d7; font-size: 14px; text-align: left; }
.map-filter[aria-pressed="true"], .point-chip.active { border-color: #d3fb7877; color: var(--lime); background: #d3fb780a; }
.map-points { max-height: 142px; overflow-y: auto; padding: 4px 0 10px; }
.map-destination, .mission-destination { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #dceaff04; }
.map-destination > strong, .mission-destination strong { display: block; font-size: 18px; line-height: 1.3; margin-bottom: 7px; }
.map-destination small, .mission-destination small { display: block; font-size: 12px; color: #95abc1; line-height: 1.5; }
.map-destination .place-description { font-size: 15px; line-height: 1.5; margin: 12px 0; }
.map-reference { display: inline-block; font-size: 14px; margin-top: 14px; }
.map-tour { width: 100%; margin-top: 16px; }
.toast { position: fixed; z-index: 14; top: calc(var(--safe-top) + 76px); left: 50%; transform: translateX(-50%); max-width: min(370px,calc(100vw - 50px)); display: flex; gap: 9px; padding: 11px 15px; background: #101e2bef; border: 1px solid #dceeff2a; border-radius: 10px; box-shadow: 0 5px 24px #0003; pointer-events: none; }
.toast-mark { width: 3px; background: var(--lime); border-radius: 2px; flex-shrink: 0; }
.toast strong { display: block; font-size: 14px; line-height: 1.4; }
.toast p { color: #a9bdce; font-size: 14px; line-height: 1.5; margin: 4px 0 0; }
body.is-driving .toast { top: auto; bottom: calc(var(--safe-bottom) + 132px); max-width: min(340px,calc(100vw - 240px)); }
body.is-driving #toastText { display: none; }
body.is-driving .toast strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rotate-hint, .noscript { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: #0c1624f7; text-align: center; }
.noscript { z-index: 110; }
.rotate-hint > svg { width: 74px; height: 74px; margin-bottom: 20px; fill: none; stroke: var(--lime); stroke-width: 1.7; }
.rotate-hint h2 { font-size: 28px; letter-spacing: -.8px; margin: 12px 0; }.rotate-hint p { color: #9fb3c9; font-size: 16px; margin: 0 0 24px; }
@keyframes pulse { 50% { opacity: .35; } }

@media (min-width:1000px) and (max-height:780px) {
  .welcome-main { width: min(1040px,100%); display: grid; grid-template-columns: 1fr 420px; align-items: center; gap: 70px; }
  .welcome-play { padding-top: 20px; }.mode-list { grid-template-columns: repeat(2,1fr); }.mode { min-height: 58px; flex-direction: row; }
}
@media (max-width:950px) and (max-height:540px) {
  :root { --edge: 14px; --instrument-width: 190px; --header-action-height: 43px; }
  .welcome { padding: 15px max(22px,env(safe-area-inset-right)) 10px max(22px,env(safe-area-inset-left)); }
  .brand > span { font-size: 14px; }.brand strong { font-size: 26px; }.edition { padding: 7px 9px; letter-spacing: .2px; }
  .welcome-main { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 12px 0; align-items: center; }
  .welcome-story .eyebrow { letter-spacing: .5px; font-size: 12px; }
  h1 { font-size: clamp(38px,6.2vw,52px); letter-spacing: -2.2px; margin: 15px 0 14px; }
  .welcome-copy { font-size: 16px; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .welcome-play { max-width: none; }
  .mode-list { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }.mode { min-height: 41px; padding: 8px; flex-direction: row; gap: 7px; }.mode svg { width: 18px; height: 18px; }
  .welcome-controls { margin-bottom: 10px; }.control-picker-label { margin-bottom: 5px; letter-spacing: .3px; }.control-picker-label small { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .control-mode-options { padding: 3px; gap: 3px; }.control-mode-options button { min-height: 34px; padding: 6px; gap: 5px; }.control-mode-options button svg { width: 17px; height: 17px; }
  .start-button { min-height: 43px; padding: 10px; }.load-status { margin-top: 7px; font-size: 12px; }
  .welcome-footer { min-height: 27px; gap: 12px; }.welcome-footer .text-button { min-height: 28px; padding: 5px 0; font-size: 14px; }.footer-links { gap: 16px; }
  .game-header { gap: 12px; }.header-actions { gap: 5px; }.header-actions .icon-button { width: 43px; height: 43px; border-radius: 11px; }.header-actions svg { width: 21px; height: 21px; }
  .location-card { padding: 8px 11px 9px; max-width: calc(100% - 199px); border-radius: 11px; }.location-meta { gap: 6px; letter-spacing: .4px; }.location-name { font-size: 15px; margin-top: 4px; }
  .minimap-wrap { top: calc(var(--safe-top) + 65px); width: 112px; height: 86px; border-radius: 10px; }.minimap-caption { height: 21px; padding: 0 7px; }.map-north { top: 5px; right: 5px; }
  .mission-summary { top: calc(var(--safe-top) + 65px); min-height: 39px; padding: 9px 11px; max-width: 290px; }.hud-minimap .mission-summary { left: calc(var(--safe-left) + 124px); max-width: min(280px,calc(100vw - 350px)); }
  .speed-panel { width: 190px; padding: 9px 13px 10px; border-radius: 13px; }.speed-main { gap: 12px; }.gear-block { padding-right: 11px; gap: 3px; }#gear { font-size: 25px; }.gear-block small { font-size: 11px; }#speed { font-size: 47px; letter-spacing: -2.5px; }.rpm-track { margin-top: 7px; height: 4px; }.speed-bottom { gap: 5px; margin-top: 6px; }.speed-bottom small { font-size: 11px; }
  .steering-pad { width: 184px; height: 108px; border-radius: 22px; }.steering-thumb { width: 62px; height: 62px; }.steering-thumb svg { width: 42px; height: 42px; }.steering-pad small { bottom: 8px; letter-spacing: .2px; }
  .pedals { gap: 10px; }.pedal { width: 70px; border-radius: 12px; }.pedal.brake { height: 82px; }.pedal.throttle { height: 113px; }.pedal svg { width: 25px; height: 25px; }.handbrake { width: 70px; bottom: 92px; min-height: 35px; font-size: 12px; }
  body.is-driving .toast { bottom: calc(var(--safe-bottom) + 115px); max-width: min(320px,calc(100vw - 300px)); padding: 9px 12px; }
  .overlay { padding: 12px max(14px,env(safe-area-inset-right)) 12px max(14px,env(safe-area-inset-left)); }
  .pause-card { width: 600px; padding: 18px; max-height: calc(100dvh - 24px); border-radius: 15px; }.pause-card h2 { font-size: 30px; margin: 9px 0 13px; }.pause-copy { display: none; }.pause-card > .primary { min-height: 42px; padding: 10px; }
  .pause-grid { grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 9px; }.pause-grid > button { min-height: 43px; padding: 9px; gap: 7px; }.pause-grid > button kbd { display: none; }.pause-grid #noticeMenuButton { grid-column: auto; }.pause-grid svg { width: 17px; height: 17px; }.pause-progress { padding: 11px 0; margin-top: 5px; }.pause-bottom .text-button { min-height: 29px; padding: 7px 0; }
  .sheet-card { max-height: calc(100dvh - 24px); border-radius: 14px; }.sheet-header { padding: 14px 20px 13px; }.sheet-header h2 { font-size: 24px; margin-top: 5px; }.sheet-header .icon-button { width: 40px; height: 40px; }.sheet-body { padding: 17px 20px 20px; }
  .settings-row { padding: 13px 0; }.map-stage { height: 200px; }.map-points { max-height: 100px; }.controls-intro { padding: 15px; }.control-step { padding: 12px; }
}
@media (max-width:700px) and (max-height:540px) {
  :root { --edge: 12px; --instrument-width: 178px; --header-action-height: 42px; }
  .welcome { padding-top: 12px; }.welcome-main { gap: 21px; padding: 9px 0; }.welcome-copy { -webkit-line-clamp: 3; font-size: 15px; }.welcome-footer .control-hint { max-width: 275px; }.welcome-footer .control-hint i { display: none; }.control-picker-label small { display: none; }
  .world-phase { display: none; }.location-meta { gap: 5px; font-size: 11px; }.location-name { font-size: 14px; }.header-actions .icon-button { width: 42px; height: 42px; }.location-card { max-width: calc(100% - 193px); }
  .minimap-wrap { width: 104px; height: 80px; top: calc(var(--safe-top) + 62px); }.hud-minimap .mission-summary { left: calc(var(--safe-left) + 115px); max-width: calc(100vw - 320px); }.mission-summary { top: calc(var(--safe-top) + 62px); gap: 6px; }.mission-summary > svg { display: none; }#missionSummaryTitle { font-size: 13px; }#missionSummaryMeta { font-size: 12px; }
  .steering-pad { width: 164px; height: 102px; }.steering-thumb { width: 58px; height: 58px; }.steering-thumb svg { width: 40px; height: 40px; }
  .pedal { width: 64px; }.pedal.throttle { height: 108px; }.pedal.brake { height: 80px; }.handbrake { width: 64px; bottom: 89px; gap: 3px; }.handbrake svg { width: 16px; height: 16px; }
  .speed-panel { width: 178px; padding-left: 11px; padding-right: 11px; }.speed-main { gap: 10px; }#speed { font-size: 44px; }.gear-block { padding-right: 10px; }.speed-unit { font-size: 11px; }
  .pause-grid { gap: 6px; }.pause-grid > button { padding: 8px; font-size: 13px; }.controls-grid { grid-template-columns: 1fr; }
}
@media (max-width:700px) and (min-height:541px) {
  :root { --edge: 18px; --instrument-width: 190px; --header-action-height: 89px; }
  .welcome { padding: 25px 24px 16px; }.brand > span { font-size: 17px; }.brand strong { font-size: 31px; }.edition { font-size: 11px; padding: 8px; }
  .welcome-main { width: 100%; padding: 26px 0; }.welcome-story .eyebrow { letter-spacing: .6px; }h1 { font-size: 55px; letter-spacing: -2.8px; margin: 21px 0 17px; }.welcome-copy { margin-bottom: 22px; }
  .mode-list { grid-template-columns: repeat(2,1fr); }.mode { min-height: 48px; flex-direction: row; }.welcome-controls { margin-bottom: 14px; }.welcome-footer { align-items: flex-start; }.welcome-footer .control-hint { max-width: 180px; }.footer-links { gap: 12px; }
  .activity-list, .route-fields { grid-template-columns: 1fr; }.activity-card { min-height: 145px; }.controls-grid { grid-template-columns: 1fr; }.control-steps { grid-template-columns: 1fr; }.control-step { display: grid; grid-template-columns: 35px 1fr; gap: 4px 8px; }.control-step > svg { grid-row: 1/3; margin: 0; }.control-step strong, .control-step p { grid-column: 2; }
  .sheet-header { padding: 20px; }.sheet-body { padding: 20px; }.sheet-header h2 { font-size: 25px; }.settings-row { gap: 12px; }select { max-width: 154px; }.stat-block { padding: 12px 9px; }.stat-block strong { font-size: 22px; }
  .location-card { max-width: calc(100% - 100px); }.header-actions { display: grid; grid-template-columns: 42px 42px; gap: 5px; }.header-actions .icon-button { width: 42px; height: 42px; }.world-phase { display: none; }.location-meta { font-size: 11px; }.location-name { font-size: 14px; }
  .minimap-wrap { top: calc(var(--safe-top) + 105px); width: 112px; height: 90px; }.mission-summary { top: calc(var(--safe-top) + 105px); }.hud-minimap .mission-summary { left: calc(var(--safe-left) + 122px); max-width: calc(100vw - 158px); }
  .speed-panel { width: 190px; }.input-mode-shortcut span { display: none; }
}
@media (max-height:360px) {
  .welcome { padding-top: 9px; padding-bottom: 8px; }.welcome-main { padding: 7px 0; }h1 { font-size: 39px; }.mode { min-height: 36px; }.welcome-copy { -webkit-line-clamp: 2; }.start-button { min-height: 40px; }.load-status { margin-top: 5px; }
  .steering-pad { height: 94px; }.steering-thumb { width: 54px; height: 54px; }.steering-thumb svg { width: 36px; height: 36px; }.pedal.throttle { height: 100px; }.pedal.brake { height: 74px; }.handbrake { bottom: 82px; }.speed-panel { padding-top: 8px; padding-bottom: 8px; }#speed { font-size: 40px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }

/* Geographic context stays in the upper corner, not over the roadway. */
.heading-readout { display: inline-flex; justify-content: center; min-width: 23px; padding: 2px 4px; border-radius: 4px; background: #d3fb7817; color: var(--lime); letter-spacing: 0; }
.location-nearby { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9eb6ca; font-size: 12px; line-height: 1.2; }
.minimap-wrap,.mission-summary { top: calc(var(--safe-top) + 90px); }
@media(max-width:950px) and (max-height:540px) { .minimap-wrap,.mission-summary { top: calc(var(--safe-top) + 84px); }.world-phase { display:none; } }
@media(max-width:700px) and (min-height:541px) { .minimap-wrap,.mission-summary { top:calc(var(--safe-top) + 105px); } }

/* Keep the chase car visible between the thumbs on landscape touch screens. */
@media (orientation:landscape) {
  .touch-enabled .speed-panel { top: calc(var(--safe-top) + var(--header-action-height) + 20px); right: var(--safe-right); bottom: auto; left: auto; transform: none; }
  .touch-enabled .mission-summary { right: calc(var(--safe-right) + var(--instrument-width) + 16px); }
}

/* The map owns a fixed viewport and exactly one scrolling list. The canvas
   captures map drags only; it never consumes wheel scrolling or list gestures. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.world-loading { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #08111caa; touch-action: none; }
.world-loading > div { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border: 1px solid #b7cee83a; border-radius: 12px; background: #102031; color: #e6f1fa; font-size: 16px; }
.sheet-overlay[data-panel="map"] .sheet-card { width: min(1140px,100%); height: min(760px,calc(100dvh - 36px)); min-height: 0; }
.sheet-overlay[data-panel="map"] .sheet-header { padding: 16px 20px; }
.sheet-overlay[data-panel="map"] .sheet-header h2 { font-size: 24px; margin-top: 4px; }
.sheet-overlay[data-panel="map"] .sheet-body { flex: 1; padding: 0; min-height: 0; overflow: hidden; }
.map-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(270px,.66fr); height: 100%; min-height: 0; }
.map-explore { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 14px; }
.map-layout .map-stage { position: relative; flex: 1; height: auto; min-height: 100px; border-radius: 10px; }
.map-stage canvas:focus-visible { outline: 2px solid var(--lime); outline-offset: -3px; }
.map-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-tool { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #c8ddef50; border-radius: 9px; background: #102231f5; box-shadow: 0 3px 10px #0004; color: #eef5fa; font-size: 26px; touch-action: manipulation; }
.map-tool svg { width: 20px; height: 20px; }
.map-gesture-hint { pointer-events: none; position: absolute; top: 12px; left: 12px; border-radius: 6px; padding: 5px 8px; background: #10202bde; color: #b8ccdc; font-size: 12px; }
.map-layout .map-legend { margin-top: 10px; gap: 15px; flex-shrink: 0; }
.map-places { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); background: #14202e; }
.map-search-row { display: flex; gap: 7px; padding: 14px 12px 7px; flex-shrink: 0; }
.map-search-row input { min-width: 0; width: 100%; height: 42px; border: 1px solid #ccdeee35; border-radius: 8px; padding: 0 11px; background: #0c1723; color: #edf4fa; font: 16px var(--sans); touch-action: manipulation; }
.map-search-row input::placeholder { color: #95aabb; }
.map-search-row select { width: 108px; min-width: 90px; max-width: 108px; padding: 0 5px; font-size: 13px; }
.map-results-label { padding: 0 14px 7px; font-size: 12px; color: #9bb1c5; flex-shrink: 0; }
.map-layout .map-points { display: flex; flex-direction: column; flex-wrap: nowrap; flex: 1; min-height: 48px; max-height: none; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; margin: 0; padding: 4px 9px 10px; gap: 4px; scrollbar-width: auto; scrollbar-color: #6f879f #14202e; }
.map-layout .point-chip { display: flex; align-items: center; justify-content: space-between; gap: 9px; width: 100%; min-height: 45px; flex-shrink: 0; padding: 10px; touch-action: pan-y; }
.map-layout .point-chip span { min-width: 0; font-size: 14px; line-height: 1.3; }
.map-layout .point-chip small { color: #a2b5c7; font: 11px var(--mono); white-space: nowrap; }
.map-layout .point-chip.active small { color: #d3ec99; }
.map-layout .map-empty { padding: 12px; font-size: 14px; }
.map-layout #mapDestination { flex-shrink: 0; }
.map-layout .map-destination { margin: 0; padding: 12px; border: 0; border-top: 1px solid #c8ddec2b; border-radius: 0; background: #0d1926; }
.map-layout .map-destination > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; margin-bottom: 3px; }
.map-destination-meta { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.map-layout .map-reference { margin: 0; font-size: 11px; white-space: nowrap; }
.map-layout .map-destination small { font-size: 11px; }
.map-layout .map-destination .button-row { margin-top: 10px; gap: 6px; flex-wrap: nowrap; }
.map-layout .map-destination .button-row button { min-height: 42px; padding: 10px 8px; font-size: 13px; white-space: nowrap; }
.map-layout .map-destination .button-row svg { width: 15px; height: 15px; }
@media (max-height:540px) and (min-width:600px) {
  .sheet-overlay[data-panel="map"] { padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .sheet-overlay[data-panel="map"] .sheet-card { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .sheet-overlay[data-panel="map"] .sheet-header { padding: 8px 14px; gap: 8px; }
  .sheet-overlay[data-panel="map"] .sheet-header .eyebrow { display: none; }
  .sheet-overlay[data-panel="map"] .sheet-header h2 { font-size: 20px; margin: 0; }
  .sheet-overlay[data-panel="map"] .sheet-header .icon-button { width: 36px; height: 36px; }
  .map-layout { grid-template-columns: minmax(0,1fr) minmax(264px,.82fr); }
  .map-explore { padding: 8px; }
  .map-layout .map-legend { margin-top: 6px; font-size: 11px; }
  .map-search-row { padding: 8px 8px 4px; gap: 5px; }
  .map-search-row input { height: 36px; padding: 0 8px; }
  .map-search-row select { width: 92px; }
  .map-results-label { padding: 0 10px 4px; font-size: 11px; }
  .map-layout .map-destination { padding: 8px; }
  .map-layout .map-destination > strong { font-size: 14px; }
  .map-layout .map-destination .button-row { margin-top: 6px; }
  .map-layout .map-destination .button-row button { min-height: 38px; padding: 8px 5px; font-size: 12px; }
  .map-tool { width: 38px; height: 38px; }
}
@media (max-width:599px) {
  .sheet-overlay[data-panel="map"] .sheet-card { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
  .sheet-overlay[data-panel="map"] .sheet-header { padding: 10px 14px; }
  .sheet-overlay[data-panel="map"] .sheet-header .eyebrow { display: none; }
  .sheet-overlay[data-panel="map"] .sheet-header h2 { font-size: 21px; }
  .map-layout { grid-template-columns: 1fr; grid-template-rows: minmax(120px,.8fr) minmax(190px,1fr); }
  .map-places { border-left: 0; border-top: 1px solid var(--line); }
  .map-explore { padding: 8px; }
  .map-layout .map-legend { display: none; }
  .map-tools { flex-direction: row; }
  .map-gesture-hint { top: auto; bottom: 10px; }
  .map-search-row { padding: 8px 10px 4px; }
  .map-search-row input { height: 36px; }
  .map-layout .map-destination { padding: 9px 10px; }
}
