/* Lofi Drive — full-screen canvas; Controls on the LEFT, Settings on the RIGHT, the place and dash along the bottom.
   Wide screens: two vertical rails (scrolling within the space above the bottom bar if needed). Narrow or short
   screens (the same query as hud.js COMPACT): a Controls and a Settings opener with bounded, scrolling drawers, and the
   steering and pedals docked above the bottom bar for thumbs. H alone shows / hides all of it. */
:root {
  --ink: rgba(244, 241, 234, 0.94);
  --dim: rgba(244, 241, 234, 0.74);
  --glass: rgba(14, 17, 22, 0.42);
  --panel: rgba(14, 17, 22, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --red: #d2242c;
  /* controls look like controls: a solid fill and a visible edge; text has neither */
  --btn: rgba(255, 255, 255, 0.11);
  --btn-hover: rgba(255, 255, 255, 0.19);
  --btn-line: rgba(255, 255, 255, 0.26);
  --rail-l: 300px;                /* Settings (left) */
  --rail-r: 262px;                /* Controls (right) */
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #1a1d22;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1d22; }
#view, #paintedCockpit { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; }
#paintedCockpit { pointer-events: none; image-rendering: pixelated; }
body.painted-view #view { image-rendering: pixelated; }
#cameraView { flex-wrap: wrap; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.hud { position: fixed; z-index: 2; pointer-events: none; transition: opacity 1.2s ease; }
.hud > * { pointer-events: auto; }
.glass, .panel, .hud-drive, .where, .dash { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }

/* ---- chips (buttons, links) ----
   Everything you can press has a solid fill, an edge and a shadow under it; text (notes, slider labels, values) has
   none of those. Inside panels: a choice group is a segmented picker (the picked one filled red), an on/off setting is
   a switch row (label left, switch right), a section head is a row ending in a round chevron button. */
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--btn-line); background: var(--btn); color: var(--ink); text-decoration: none; font: inherit;
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.chip:hover { background: var(--btn-hover); border-color: rgba(255, 255, 255, 0.36); }
.chip:active { transform: translateY(1px); box-shadow: none; }
.chip:focus-visible, .sec-head:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
.chip.strong { background: var(--red); border-color: transparent; color: #fff; }
.chip.toggle[aria-pressed="true"] { background: var(--red); border-color: rgba(255, 150, 150, 0.45); color: #fff; font-weight: 600; }
.chip:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; transform: none; }
.chip:disabled:hover { background: var(--btn); border-color: var(--btn-line); }
kbd { font: inherit; font-size: 10.5px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(14, 17, 22, 0.35); color: var(--ink); }
.note { font-size: 12px; color: var(--dim); line-height: 1.5; }
.vol + .note, .chip + .note, .choice + .note { margin-top: -6px; }

/* a choice group: a segmented picker in a sunken tray, the picked option filled */
.toggles.choice { gap: 3px; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.08); }
.toggles.choice .chip { border-color: transparent; box-shadow: none; background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.toggles.choice .chip:hover { background: var(--btn-hover); }
.toggles.choice .chip[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
/* the Sport's paints: a row of its own under the cars, each chip with a swatch of its colour or livery */
.sport-paints { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding-top: 4px; margin-top: 2px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sport-paints .sub-label { flex: 1 1 100%; font-size: 11px; opacity: 0.7; padding: 0 6px; }
.sport-paints .chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sport-paints .chip::before { content: ''; flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
/* an on/off setting: the whole row is the button, the switch on its right shows the state */
.chip.switch { flex: 1 1 100%; justify-content: space-between; gap: 12px; height: 38px; padding: 0 10px 0 12px; border-radius: 10px;
  text-align: left; font-weight: 500; }
.chip.switch::after { content: ""; flex: none; width: 36px; height: 20px; border-radius: 10px;
  background: radial-gradient(circle at 10px 50%, #f4f1ea 0 7px, transparent 7.5px), rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.chip.switch[aria-pressed="true"] { background: var(--btn); border-color: var(--btn-line); color: var(--ink); font-weight: 600; }
.chip.switch[aria-pressed="true"]:hover { background: var(--btn-hover); }
.chip.switch[aria-pressed="true"]::after { background: radial-gradient(circle at 26px 50%, #fff 0 7px, transparent 7.5px), var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 150, 150, 0.45); }

/* ---- rails (wide screens) ---- */
.rail { top: 0; bottom: var(--foot-h, 84px); display: flex; flex-direction: column; gap: 12px; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 8px; }
.rail-l { left: 0; width: calc(var(--rail-l) + max(14px, env(safe-area-inset-left)) + 6px); padding-left: max(14px, env(safe-area-inset-left)); padding-right: 6px; }
.rail-r { right: 0; width: calc(var(--rail-r) + max(14px, env(safe-area-inset-right)) + 6px); padding-right: max(14px, env(safe-area-inset-right)); padding-left: 6px; }
.rail > * { flex: none; }
.rail-top { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.rail-r .rail-top { justify-content: flex-end; }
.opener, .panel-close { display: none; }
/* the Settings gear and the Controls button (hud.js data-collapse): small round buttons on every screen; each panel opens from its button */
.chip.opener.gear { background: rgba(14, 17, 22, 0.55); display: inline-flex; width: 34px; height: 34px; padding: 0; border-radius: 50%; flex: none; }
.gear svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.3s ease; }
.gear[aria-expanded="true"] { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); }
#settingsOpen[aria-expanded="true"] svg { transform: rotate(60deg); }   /* only the cog turns */
.panel { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 10px; background: rgba(16, 19, 24, 0.82); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles .chip { flex: 1 1 auto; }

/* collapsible sections */
.sec { border-top: 1px solid var(--line); }
.sec-h { margin: 0; font: inherit; }
.sec-head { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 6px 6px 6px 8px; margin: 3px -6px; width: calc(100% + 12px); border: 0; border-radius: 9px;
  background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.sec-head:hover { background: rgba(255, 255, 255, 0.08); }
/* the chevron sits in a small round button, so the row reads as something to open */
.sec-head::after { content: "\203A"; display: grid; place-items: center; flex: none; width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%;
  border: 1px solid var(--btn-line); background: var(--btn); color: var(--ink); font-size: 17px; line-height: 1; padding-bottom: 2px;
  transition: transform 0.15s ease; }
.sec-head:hover::after { background: var(--btn-hover); }
.sec-head[aria-expanded="true"]::after { transform: rotate(90deg); background: rgba(255, 255, 255, 0.26); }
.sec-body { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 4px 0 18px; }
.sec-body > .chip { align-self: flex-start; }
.sec-body > .chip.switch { align-self: stretch; flex: none; }
/* Settings flyouts (wide screens): a section opens beside the panel, top-aligned with its header (hud.js places it and
   keeps one open); the rail stays as short as its headers, so it doesn't need to scroll or clip */
#settingsRail { overflow: visible; }
.panel[data-fly] { position: relative; }
.panel[data-fly] .sec-body.fly { position: absolute; left: calc(100% + 8px); width: var(--rail-l); z-index: 5; box-sizing: border-box;
  padding: 12px 14px 14px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(16, 19, 25, 0.9); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38); }
body:not(.compact) .panel[data-fly] .sec-head[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); }
body:not(.compact) .panel[data-fly] .sec-head[aria-expanded="true"]::after { transform: none; color: var(--ink); }
/* short windows (itch's 960 × 540 frame, a laptop's browser): tighter section rows, so every header fits above the
   bottom (2026-11-26, Miguel on itch: "The settings seem too big"; at 540 px the panel ran to 588 and Credits was cut) */
@media (max-height: 760px) and (min-width: 761px) and (min-height: 521px) {
  .panel[data-fly] { gap: 0; padding-top: 10px; }
  .panel[data-fly] .panel-head { margin-bottom: 6px; }
  .panel[data-fly] .sec-head { min-height: 34px; margin: 1px -6px; padding: 4px 6px 4px 8px; }
}

/* sliders: one full-width row each (label · slider · value) */
/* plain text around a slider: no box, so only the slider itself looks pressable */
.vol { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 2px; font-size: 12.5px; color: var(--dim); }
.vol-label { flex: none; min-width: 5.6em; color: var(--ink); }
.vol input { flex: 1 1 auto; min-width: 60px; width: 100%; margin: 0; accent-color: var(--red); cursor: pointer; }
.vol input:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.75); outline-offset: 3px; }
.vol output { flex: none; min-width: 4.2ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cruise-set output { min-width: 6.4ch; }
.weather output { min-width: 9.5ch; }
.daytime output { min-width: 5ch; }
.daytime[data-mode="manual"] output { color: #ffd9a8; }

/* audio groups: button, then its volume row, then any status line */
.sound { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; }
/* the music's track line: what plays, and "Next track" beside it */
.sound .track-row { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; }
.sound .track-row .sound-msg { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound .track-row .chip { flex: none; margin-left: auto; }
.sound .own-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; }
.sound .own-row[hidden] { display: none; }
.sound .own-row .chip { flex: none; }
/* Settings › Credits (supporters.js fills the supporters) */
.credits { display: flex; flex-direction: column; gap: 4px; }
.credits > * { flex: none; }   /* a tall list scrolls the panel, never squeezes the supporters */
.credits .cr-h { margin: 8px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.credits .cr-h:first-child { margin-top: 0; }
.credits .cr-list, .credits .cr-supporters { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.credits .cr-supporters { max-height: 180px; overflow-y: auto; }
.credits .cr-supporters .beers { color: var(--dim); white-space: nowrap; }
.credits a { color: inherit; }
.credits .cr-dedication { margin: 0; font-size: 13px; line-height: 1.5; font-style: italic; }
/* the stream's thank-you to a supporter, and now and then where to support (supporters.js); outside the HUD */
.support-alert { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  max-width: min(760px, calc(100vw - 48px)); padding: 12px 20px; border-radius: 14px; text-align: center;
  color: #fff; background: rgba(40, 22, 6, 0.72); border: 1px solid rgba(255, 200, 90, 0.55);
  font: 700 24px/1.3 system-ui, sans-serif; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); transition: opacity 0.8s ease;
  animation: support-in 0.6s ease; }
.support-alert.remind { font-size: 20px; font-weight: 600; background: rgba(12, 10, 24, 0.62); border-color: rgba(255, 255, 255, 0.18); }
.support-alert.out { opacity: 0; }
@keyframes support-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@media (prefers-reduced-motion: reduce) { .support-alert { animation: none; } }
.sound .vol { flex: 1 1 100%; }
/* a volume row: label, slider, value, then the sound's on/off as a small speaker button (its text stays for screen
   readers and the tooltip; the icon shows the state: speaker with waves = on, crossed out = off) */
.sound .vol-row { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; }
.sound .vol-row .vol { flex: 1 1 auto; min-width: 0; }
.chip.mute { flex: none; width: 34px; height: 30px; padding: 0; }
.chip.mute { font-size: 0; color: var(--dim); }
.chip.mute::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4V5z' fill='black'/%3E%3Cpath d='m22 9-6 6M16 9l6 6'/%3E%3C/svg%3E"); }
.chip.mute[aria-pressed="true"] { background: var(--btn); border-color: var(--btn-line); color: var(--ink); font-weight: 500; }
.chip.mute[aria-pressed="true"]:hover { background: var(--btn-hover); }
.chip.mute[aria-pressed="true"]::before {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4V5z' fill='black'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E"); }
.sound-msg { flex: 1 1 100%; font-size: 12px; color: var(--ink); }
.sound-msg:empty { display: none; }
.sound[data-state="error"] .sound-msg, .sound[data-state="blocked"] .sound-msg, .sound[data-state="interrupted"] .sound-msg { color: #ffb4a8; }
.sound[data-state="error"] .mute, .sound[data-state="blocked"] .mute, .sound[data-state="interrupted"] .mute { border-color: rgba(255, 140, 120, 0.8); color: #ffb4a8; }

.help .keys { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 12px; line-height: 1.5; color: var(--dim); }

/* ---- driving controls: steering and pedals (in the right rail on wide screens) ---- */
.hud-drive { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin-top: auto; }
.hud-drive .pad { display: flex; gap: 8px; align-items: flex-end; }
.hud-drive > .pad .key { flex: 1 1 0; }
.drive-r { display: flex; gap: 8px; }
.key { min-width: 44px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  font: inherit; font-size: 15px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.key:hover { background: rgba(20, 24, 30, 0.62); }
.key:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.75); outline-offset: 2px; }
.key.on, .key:active { background: rgba(255, 255, 255, 0.28); border-color: rgba(255, 255, 255, 0.45); }
.key.gearkey { min-width: 40px; height: 44px; font-size: 18px; padding: 0 8px; }
.key.pedal { min-width: 64px; height: 58px; font-size: 13px; letter-spacing: 0.02em; }
.key.pedal.gas.on { background: rgba(80, 200, 120, 0.42); }
.key.pedal.brake.on { background: rgba(210, 36, 44, 0.6); }
body.paused .hud-drive .key, body.paused .shifter { opacity: 0.45; }
/* visitors drive (2026-11-23): the pad is for touch screens only (keys elsewhere), docked above the bottom bar */
#controls { display: none; }
body:not(.can-drive) .drive-only, body.can-drive .watch-only { display: none; }
.key.cruisekey { height: 44px; font-size: 13px; }
.key.cruisekey[aria-pressed="true"] { background: rgba(80, 160, 255, 0.4); border-color: rgba(140, 190, 255, 0.6); }
@media (pointer: coarse) {
  body.can-drive #controls { display: flex; position: fixed; z-index: 2; left: 0; right: 0; bottom: calc(var(--foot-h, 120px) + 4px);
    flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 8px; margin: 0;
    padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
    background: none; border: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
  body.can-drive #controls > * { pointer-events: auto; }
  body.can-drive #controls .pad .key { flex: none; -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
}

/* ---- H shifter: conventional five-speed gate (1/3/5 up, 2/4 down, N on the crossbar), knob = the actual gear ---- */
.shifter { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 6px 4px; border-radius: 12px; align-self: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.gate { position: relative; width: 120px; height: 112px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.shifter.dragging .gate { cursor: grabbing; }
.slots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.slots path { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 7px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gpos { position: absolute; left: var(--x); top: var(--y); width: 40px; height: 36px; transform: translate(-50%, -50%); padding: 0; border: 0;
  border-radius: 10px; background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 600; cursor: inherit; touch-action: none; }
.gpos.n { height: 28px; }
.gpos:hover, .gpos.target { color: var(--ink); background: rgba(255, 255, 255, 0.1); }
.gpos:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.75); outline-offset: -2px; }
.knob { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; pointer-events: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #1a1d22; background: rgba(244, 241, 234, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.18); transition: left 0.14s ease, top 0.14s ease; }
.shifter[data-mode="manual"] .knob { background: var(--red); color: #fff; }
.shifter.dragging .knob { transition: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.45); }
.shifter-foot { display: flex; gap: 6px; font-size: 10px; line-height: 1.2; color: var(--dim); letter-spacing: 0.03em; white-space: nowrap; }
.shifter-mode { color: var(--ink); }
.shifter[data-mode="manual"] .shifter-mode { color: #ff8a80; }
.shifter.rejected { animation: gate-no 0.4s ease; border-color: rgba(255, 140, 120, 0.7); }
/* display only (Cruise-only page): no grab cursor, no hover target; the knob still glides between gears */
.shifter.display-only .gate { cursor: default; touch-action: auto; }
/* a six-speed car (vehicle.js DRIVETRAINS sport) opens the gate's 6th position, under the 5th */
.shifter:not([data-gears="6"]) .gate .gpos.g6, .shifter:not([data-gears="6"]) .slots .slot6 { display: none; }   /* beats .display-only .gpos's grid */
.shifter.display-only .gpos { cursor: default; display: grid; place-items: center; }
.shifter.display-only .gpos:hover { color: var(--dim); background: transparent; }
.shifter.display-only .gpos.active { color: var(--ink); }
/* A / M under the shifter (gear-mode.js; only where the visitor can drive): the picked one lit, M in the manual red */
.gearbox { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.gbtn { min-width: 24px; height: 18px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line); background: transparent;
  color: var(--dim); font-family: inherit; font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: 0.06em; cursor: pointer; }
.gbtn:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.35); }
.gbtn[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.4); }
.gbtn[data-gmode="manual"][aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.gbtn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (pointer: coarse) { .gbtn { min-width: 34px; height: 26px; border-radius: 13px; font-size: 11px; } }   /* a finger, not a cursor */
@keyframes gate-no { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }

/* ---- bottom bar: where you are, and the dash ---- */
.hud-bottom { left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 10px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.where { min-width: 0; max-width: min(420px, 60vw); padding: 9px 12px 10px; border-radius: 12px; }
.place { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .sub { font-weight: 400; color: var(--dim); font-size: 12px; }
/* the music playing (Radio track or style), under the landscape name */
.playing { font-size: 12px; color: #ffd9a8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the line ellipsizes, the 👍 / 👎 after it never do (music-likes.js; only on Miguel's own page) */
.playing:not([hidden]):has(> .np-rate:not([hidden])) { display: flex; align-items: center; gap: 6px; overflow: visible; }
.np-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-rate { flex: none; display: inline-flex; gap: 2px; }
.np-rate[hidden] { display: none; }
.np-btn { width: 24px; height: 20px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer;
  font-size: 12px; line-height: 1; opacity: 0.5; filter: grayscale(1); transition: opacity 0.15s ease, filter 0.15s ease; }
.np-btn:hover { opacity: 0.9; filter: none; background: rgba(255, 255, 255, 0.08); }
.np-btn[aria-pressed="true"] { opacity: 1; filter: none; background: rgba(255, 217, 168, 0.16); border-color: rgba(255, 217, 168, 0.4); }
.np-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 1px; }
.music-picks { display: grid; gap: 6px; }
.music-picks[hidden] { display: none; }
.picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.picks li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.picks .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picks .pick-clear { height: 24px; padding: 0 8px; flex: none; }
.playing .note { color: var(--dim); }
.playing .by { color: rgba(255, 238, 214, 0.72); }                    /* the song's author, after the title (credit.js) */
.playing .by:not(:empty)::before { content: ' · '; color: var(--dim); white-space: pre; }
.next { color: var(--dim); font-size: 11.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.track { height: 2px; margin-top: 7px; background: rgba(255, 255, 255, 0.12); border-radius: 1px; overflow: hidden; }
.track i { display: block; height: 100%; background: rgba(255, 255, 255, 0.7); transform-origin: left center; transform: scaleX(0); }
.dash { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 12px; font-variant-numeric: tabular-nums; margin-left: auto; }
.gauge { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.gauge b { font-size: 20px; font-weight: 600; }
.gauge small { font-size: 10px; color: var(--dim); letter-spacing: 0.04em; }
.gauge.speed b { min-width: 3ch; text-align: center; }
.gauge.gear b { min-width: 1.4ch; text-align: center; }
.gauge.rpm { width: 96px; align-items: stretch; gap: 4px; }
.rpmbar { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.rpmbar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 96.3%; right: 0; background: rgba(210, 36, 44, 0.75); }  /* 7,800 of 8,100 */
.rpmbar i { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.78); transform-origin: left center; transform: scaleX(0.1); }
.dash.limiter .rpmbar i { background: #ff5a4e; }
.cstat { min-width: 8.5ch; font-size: 11px; line-height: 1.25; color: var(--dim); white-space: pre-line; }   /* a second line: why it follows */
.ind { font-size: 13px; line-height: 1; color: rgba(255, 255, 255, 0.16); }
.ind.on { color: #ffae2b; text-shadow: 0 0 8px rgba(255, 170, 40, 0.75); }
.msg { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); text-align: center; font-size: 12px; color: var(--ink);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.25s ease; pointer-events: none; white-space: nowrap; }
.msg.show { opacity: 1; }
/* the dash + H shifter cluster: big speed on top, the rev bar and the cruise state under it, the gate beside them.
   The knob is the gear readout, so the dash's gear gauge and the gate's "cruise" foot are hidden (the shifter's
   aria-label still says gear and mode). */
#dash { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto auto; grid-template-rows: auto auto auto auto; column-gap: 10px; row-gap: 6px;
  align-items: center; padding: 10px 12px 10px 14px; }
#dash > .gauge.gear, #dash .shifter-foot { display: none; }   /* no second "4" or "cruise": the status line says what the car is doing */
#indL { grid-area: 2 / 1; }
#dash > .gauge.speed { grid-area: 2 / 2; }
#indR { grid-area: 2 / 3; }
#dash > .gauge.rpm { grid-area: 3 / 1 / 4 / 4; width: auto; }
#cruiseStatus { grid-area: 4 / 1 / 5 / 4; text-align: center; }
#dash .gauge.speed b { font-size: 34px; }
/* the driver badge (persona.js), top of the cluster, kept discreet (2026-11-23, Miguel: "more discreet in the ui"): no
   box, a small dot in the style's colour and the style's name in small dim capitals; the gap / mood / rage line is in
   its tooltip (main.js sets the title), not on screen */
.persona { grid-area: 1 / 1 / 2 / 4; display: flex; align-items: center; gap: 6px; justify-self: center;
  --pc: #5fd38a; line-height: 1; opacity: 0.75; }
.persona[hidden] { display: none; }
.persona[data-style="sporty"] { --pc: #ffb238; }
.persona[data-style="aggressive"] { --pc: #ff5a4e; }
.persona .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--pc); }
.persona b { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.persona small { display: none; }
.persona.push .pdot { animation: persona-push 0.5s ease-in-out infinite alternate; }
.persona.lift .pdot { opacity: 0.55; }
@keyframes persona-push { to { transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .persona.push .pdot { animation: none; transform: scale(1.3); } }
#dash > .shifter { grid-area: 1 / 4 / 5 / 5; align-self: center; background: transparent; border: 0; border-left: 1px solid var(--line);
  border-radius: 0; padding: 0 0 0 12px; }
#dash .gate { width: 100px; height: 94px; }
#dash .gpos { width: 30px; height: 28px; font-size: 11px; }
#dash .knob { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 12px; }

/* the bottom bar is narrower than the space between the rails only on mid-size screens: keep the dash clear of them */
@media (max-width: 1100px) and (min-width: 761px) and (min-height: 521px) { .where { max-width: calc(100vw - var(--rail-r) - 460px); } }

/* ---- narrow or short screens: openers + drawers, steering and pedals docked above the bottom bar ---- */
@media (max-width: 760px), (max-height: 520px) {
  .chip { height: 36px; padding: 0 13px; }
  .chip.switch { height: 42px; }
  .chip.mute { width: 38px; height: 36px; }
  .rail { bottom: auto; width: auto; overflow: visible; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 0; }
  .rail-l { padding-left: max(10px, env(safe-area-inset-left)); padding-right: 0; }
  .rail-r { padding-right: max(10px, env(safe-area-inset-right)); padding-left: 0; }
  .rail-top { gap: 8px; }
  .opener, .panel-close { display: inline-flex; }
  .chip.opener.gear { width: 38px; height: 38px; }
  .opener[aria-expanded="true"] { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); }
  .panel { position: fixed; z-index: 4; top: calc(max(10px, env(safe-area-inset-top)) + 44px);
    width: min(340px, calc(100vw - 20px)); max-height: calc(100dvh - max(10px, env(safe-area-inset-top)) - 44px - var(--foot-h, 120px) - var(--pads-h, 70px) - 8px);
    overflow-y: auto; overscroll-behavior: contain; background: rgba(16, 19, 24, 0.88); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4); }
  .rail-l .panel { left: max(10px, env(safe-area-inset-left)); }
  .rail-r .panel { right: max(10px, env(safe-area-inset-right)); }
  .sec-head { min-height: 44px; }
  .vol { min-height: 38px; }
  .vol input { height: 28px; }
  .hud-drive { position: fixed; left: 0; right: 0; bottom: var(--foot-h, 120px); flex-direction: row; justify-content: space-between; align-items: flex-end;
    margin: 0; padding: 0 max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    background: none; border: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
  .hud-drive > * { pointer-events: auto; }
  .hud-drive > .pad .key { flex: none; }
  .key { -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
  .hud-bottom { flex-wrap: wrap; row-gap: 8px; padding-top: 6px; }
  .dash { order: -1; flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
  .gauge.rpm { width: 70px; }
  .where { max-width: none; flex: 1 1 100%; }
  .cstat { display: none; }
  #dash { row-gap: 4px; padding: 8px 10px 8px 12px; }
  #dash .gauge.speed b { font-size: 28px; }
  .persona b { font-size: 9.5px; }
  #dash .gate { width: 84px; height: 76px; }
  #dash .gpos { width: 26px; height: 24px; font-size: 10.5px; }
  #dash .knob { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; }
}
/* short landscape phones: the bottom bar stays on one row */
@media (max-height: 520px) and (min-width: 600px) {
  .hud-bottom { flex-wrap: nowrap; }
  .dash { order: 0; flex: none; margin-left: auto; }
  .where { flex: 0 1 auto; max-width: 46vw; }
}
@media (max-width: 380px) {
  .long { display: none; }
  .pad, .hud-drive .pad { gap: 6px; }
  .key { min-width: 44px; height: 46px; padding: 0 8px; }
  .key.gearkey { min-width: 38px; height: 44px; }
  .key.pedal { min-width: 52px; height: 52px; }
  .dash { gap: 8px; padding: 6px 10px; }
  .gauge.rpm { width: 54px; }
}

/* ---- speeding tickets: the camera photo, the latest fine and the running total. In the bottom bar, right of the place
   card (2026-11-17, Miguel; it used to sit above the place card, or top left on shorter windows). The box takes its
   width in the bar and the bar's height; the card itself is pinned to the box's bottom and grows upward, so opening the
   photo never changes the bar's height (--foot-h), the rails or the stream tip. ---- */
.ticket-box { position: relative; flex: 0 1 244px; min-width: 150px; align-self: stretch; min-height: 48px; }
.ticket { position: absolute; left: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 8px 9px 8px; border-radius: 14px; text-align: left; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); cursor: pointer; }
.ticket:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.75); outline-offset: 2px; }
.ticket-head { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #ffd23f; }
.ticket-photo { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; border-radius: 8px; background: #0c0e11; }
.ticket[aria-expanded="false"] .ticket-photo { display: none; }
.trow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.trow b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.trow.total b { font-size: 17px; color: #ff6a5e; }
.tlabel { font-size: 11.5px; color: var(--dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdim { color: var(--dim); opacity: 0.85; }
.ticket-box.pop .ticket { animation: ticket-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes ticket-in { from { transform: translateY(14px) scale(0.97); opacity: 0; } }
/* Settings flyouts stack over anything they open across */
#settingsRail { z-index: 3; }
@media (max-width: 760px), (max-height: 520px) {
  .ticket-box { flex: 0 0 150px; min-width: 0; }
  /* phones: the place card shares its row with the ticket instead of taking the whole row */
  .hud-bottom:has(> .ticket-box:not([hidden])) .where { flex-basis: 0; }
  .ticket { padding: 6px 7px; gap: 3px; border-radius: 12px; }
  /* phones: the dash row sits right above this one, so while the photo is open the card rises above the whole bar
     (bottom right) instead of over the dash, and drops back into its row when it folds */
  .ticket[aria-expanded="true"] { position: fixed; left: auto; right: max(10px, env(safe-area-inset-right)); bottom: calc(var(--foot-h, 120px) + 6px); width: 172px; }
  .ticket-head { font-size: 9.5px; }
  .tlabel { font-size: 10.5px; }
  .trow b { font-size: 13px; }
  .trow.total b { font-size: 14px; }
  .tplace { display: none; }
}

/* H alone shows / hides the HUD, in the game and on a stream (?stream=1 starts hidden). Hidden means hidden: not on
   hover, focus, other keys or pause; its controls are inert (hud.js), don't catch clicks and there is no cursor. */
body.hud-off .hud, body.hud-off .hud:hover, body.hud-off .hud:focus-within { opacity: 0; }
body.hud-off .hud * { pointer-events: none !important; }
body.hud-off { cursor: none; }
/* stream chat (chat.js): who asked for what, and the command card; outside the HUD so they show with it hidden */
.chat-toast, .chat-hint { position: fixed; left: 24px; z-index: 3; max-width: min(640px, calc(100vw - 48px));
  color: #fff; background: rgba(12, 10, 24, 0.62); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px;
  padding: 10px 16px; font: 600 20px/1.3 system-ui, sans-serif; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: opacity 0.8s ease; pointer-events: none; }
.chat-toast { bottom: 22%; }
.chat-hint { bottom: calc(22% + 64px); font-size: 17px; font-weight: 500; }
.chat-toast.out, .chat-hint.out { opacity: 0; }
/* the stream's standing invitation (chat.js TIP, with a smaller TIPS example under it, a new one every 20 s): bottom-right corner (above the dash while the
   HUD shows), big enough to read on a 1080p stream, a pulse with each command card */
.chat-tip { position: fixed; right: 18px; bottom: 14px; z-index: 3; pointer-events: none; color: #fff; text-align: right;
  font: 600 20px/1.2 system-ui, sans-serif; letter-spacing: 0.01em; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  padding: 7px 14px; border-radius: 10px; background: rgba(12, 10, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); }
.chat-tip b { color: #ffd76a; font-weight: 700; }
.chat-tip.pulse { animation: tip-pulse 1.6s ease 2; }
.chat-tip-ex { display: block; margin-top: 2px; font: 500 16px/1.25 system-ui, sans-serif; color: rgba(255, 255, 255, 0.88);
  transition: opacity 0.45s ease; }   /* the rotating example under the !controls line */
.chat-tip-ex.swap { opacity: 0; }
@keyframes tip-pulse { 40% { transform: scale(1.08); background: rgba(70, 40, 120, 0.75); } }
@media (prefers-reduced-motion: reduce) { .chat-tip.pulse { animation: none; } }
body:not(.hud-off) .chat-tip { bottom: calc(var(--foot-h, 84px) + 6px); }   /* above the dash cluster */
/* the stream's corner with the HUD hidden: the landscape and the track playing (main.js streamNow), bottom left */
.stream-now { position: fixed; left: 18px; bottom: 14px; z-index: 3; pointer-events: none; color: #fff; max-width: calc(50vw - 30px);
  font: 600 18px/1.2 system-ui, sans-serif; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 7px 14px; border-radius: 10px; background: rgba(12, 10, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); }
.stream-now .track { color: #ffd9a8; }
.stream-now .track:not(:empty)::before { content: '  ·  ♪ '; color: rgba(255, 255, 255, 0.6); white-space: pre; }
body:not(.hud-off) .stream-now { display: none; }   /* the place card shows both while the HUD shows */
/* the police chase's banner (chase.js): top centre, outside the HUD so a stream with the HUD hidden shows it too; its
   edge glows red / blue like the light bars (steady under reduced motion) */
.chase-banner { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 3; pointer-events: none;
  color: #fff; font: 700 22px/1.2 system-ui, sans-serif; letter-spacing: 0.04em; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  padding: 8px 20px; border-radius: 12px; background: rgba(12, 10, 24, 0.62); border: 2px solid rgba(255, 255, 255, 0.2);
  opacity: 0; transition: opacity 0.8s ease; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.chase-banner.on { opacity: 1; animation: chase-edge 1s steps(1) infinite; }
.chase-banner.calm, .chase-banner.calm.on { animation: none; border-color: rgba(150, 120, 255, 0.7); }
@keyframes chase-edge { 0% { border-color: rgba(255, 50, 40, 0.9); box-shadow: -6px 0 18px rgba(255, 40, 30, 0.45); }
  50% { border-color: rgba(60, 110, 255, 0.95); box-shadow: 6px 0 18px rgba(50, 100, 255, 0.45); } }
@media (prefers-reduced-motion: reduce) { .chase-banner.on { animation: none; border-color: rgba(150, 120, 255, 0.7); } }
@media (max-width: 520px) { .chase-banner { font-size: 16px; top: 50px; padding: 6px 12px; } }
/* a stream never leaves the drive */
body.stream #ovBack { display: none; }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; padding: 20px;
  background: radial-gradient(ellipse at center, rgba(10, 12, 16, 0.25), rgba(10, 12, 16, 0.6)); }
.card { max-width: 420px; padding: 18px 20px; border-radius: 14px; background: rgba(16, 19, 24, 0.82); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.card p { margin: 0 0 14px; color: var(--dim); }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.card a { color: var(--ink); }
body.no-gl #view { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hud { transition: none; }
  .knob { transition: none; }
  .sec-head::after { transition: none; }
  .gear svg { transition: none; }
  .shifter.rejected { animation: none; }
}

/* Loading screen (until main.js adds body.ready). Motion is transform/opacity only, so the compositor keeps it
   running while the main thread builds the car and the world. */
#loading { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 45%, #1a1d22, #07080a 70%); transition: opacity 0.6s ease, visibility 0s linear 0.6s; }
body.ready #loading, body.no-gl #loading { opacity: 0; visibility: hidden; pointer-events: none; }
.load-box { display: grid; justify-items: center; gap: 10px; text-align: center; }
.load-wheel { width: 96px; height: 96px; animation: load-spin 1.6s linear infinite; will-change: transform; }
.load-wheel svg { display: block; width: 100%; height: 100%; }
.load-road { position: relative; width: 220px; height: 3px; margin-top: -8px; overflow: hidden; border-radius: 2px;
  background: rgba(255, 255, 255, 0.08); -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.load-road i { position: absolute; inset: 0 -70px 0 0; will-change: transform; animation: load-road 0.4s linear infinite;
  background: repeating-linear-gradient(90deg, rgba(244, 241, 234, 0.75) 0 34px, transparent 34px 70px); }
.load-title { margin-top: 6px; font-size: 18px; letter-spacing: 0.04em; }
.load-title b { color: var(--red); font-weight: 800; letter-spacing: 0.08em; }
.load-text { color: var(--dim); font-size: 13px; min-height: 1.4em; max-width: 360px; animation: load-pulse 1.4s ease-in-out infinite alternate; }
.load-back { display: none; margin-top: 6px; pointer-events: auto; }
body.load-failed .load-back { display: inline-flex; }
body.load-failed .load-wheel, body.load-failed .load-road i, body.load-failed .load-text { animation: none; }
@keyframes load-spin { to { transform: rotate(360deg); } }
@keyframes load-road { to { transform: translateX(-70px); } }
@keyframes load-pulse { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .load-wheel { animation-duration: 6s; }
  .load-road i { animation: none; }
}

/* ---- garage (garage-ui.js): credits, the classified ads, the owned parts ---- */
.garage-credits { margin: 0; font-size: 15px; font-weight: 600; }
.garage-credits small { font-weight: 400; color: var(--dim); font-size: 12px; }
.garage-h { margin: 2px 0 -4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.garage-ads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.garage-ad { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 10px;
  border: 1px dashed var(--btn-line); border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.garage-ad svg { width: 56px; height: 28px; grid-row: span 2; }
.garage-ad b { font-size: 13px; }
.garage-ad .ad-line { grid-column: 2; font-size: 12px; color: var(--dim); line-height: 1.35; }
.garage-ad .chip { grid-row: span 2; grid-column: 3; height: 28px; padding: 0 10px; }
.garage-empty { font-size: 12px; color: var(--dim); }
.garage-owned:empty::before { content: 'Nothing yet.'; font-size: 12px; color: var(--dim); }
/* The Drive Gazette (gazette-ui.js): the list in Settings › Garage, and the newsprint card at the top right (outside the
   HUD, so it shows with the HUD hidden too) */
.garage-news { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; max-height: 150px; overflow-y: auto; }
.garage-news li { font: 600 13px/1.3 Georgia, 'Times New Roman', serif; }
.garage-news li small { font: 400 11px system-ui, sans-serif; color: var(--dim); }
.gazette-card { position: fixed; top: 14px; right: 64px; z-index: 2; pointer-events: none; width: min(300px, calc(100vw - 140px));
  padding: 8px 12px 10px; border-radius: 4px; background: #f1ead8; color: #1d1a14; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(-8px) rotate(-0.6deg); transition: opacity 0.6s ease, transform 0.6s ease; }
.gazette-card.on { opacity: 1; transform: translateY(0) rotate(-0.6deg); }
.gazette-card small { display: block; font: 700 10px/1 Georgia, serif; letter-spacing: 0.16em; text-transform: uppercase;
  padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid rgba(29, 26, 20, 0.45); }
.gazette-card b { display: block; font: 700 16px/1.25 Georgia, 'Times New Roman', serif; }
/* the rival (rival-ui.js): its card at the call-out and its race banner, top centre (a rival never shares it with a chase) */
.rival-card, .rival-banner { position: fixed; top: 58px; left: 50%; z-index: 3; pointer-events: none; color: #fff;
  background: rgba(12, 10, 24, 0.72); border: 2px solid rgba(242, 197, 0, 0.75); border-radius: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); opacity: 0; transform: translate(-50%, -8px); transition: opacity 0.7s ease, transform 0.7s ease; }
.rival-card.on, .rival-banner.on { opacity: 1; transform: translate(-50%, 0); }
.rival-card { width: min(330px, calc(100vw - 32px)); padding: 10px 16px 12px; font: 14px/1.35 system-ui, sans-serif; }
.rival-card small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #f2c500; }
.rival-card b { display: block; font-size: 20px; margin-top: 2px; }
.rival-card em { display: block; font-style: normal; color: rgba(255, 255, 255, 0.75); margin-bottom: 6px; }
.rival-card p { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.rival-card p span { color: rgba(255, 255, 255, 0.6); }
.rival-card q { display: block; margin-top: 7px; font-style: italic; color: rgba(255, 255, 255, 0.85); }
.rival-banner { font: 700 20px/1.2 system-ui, sans-serif; letter-spacing: 0.03em; padding: 8px 20px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .gazette-card, .rival-card, .rival-banner { transition: none; } }
@media (max-width: 520px) { .rival-banner { font-size: 16px; top: 50px; padding: 6px 12px; } .gazette-card { top: 56px; right: 12px; width: calc(100vw - 24px); } }

/* Settings › Car: the hover thumbnail (car-ui.js createCarThumbs), beside the Settings panel */
.car-thumb { position: fixed; z-index: 60; box-sizing: border-box; width: 258px; padding: 8px 8px 10px; border-radius: 12px; pointer-events: none;
  background: rgba(14, 17, 22, 0.86); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: car-thumb-in 120ms ease-out; }
.car-thumb[hidden] { display: none; }
.car-thumb img { display: block; width: 240px; height: 135px; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 70%); }
.car-thumb p { margin: 8px 2px 0; font-size: 12px; line-height: 1.45; color: var(--dim); }
.car-thumb strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; margin-bottom: 1px; }
@keyframes car-thumb-in { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .car-thumb { animation: none; } }

/* the compass (compass.js; 2026-11-23, Miguel: "Can some curve be added? That way it would be possible to add a north
   compass"): the road's heading on a tape at the top centre, part of the HUD; N in red, the other points of the compass
   bright, the degrees dim, a tick every 5°, and the red mark in the middle is the way the car is going. The chase and
   rival banners sit under it. */
.compass { top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(240px, calc(100vw - 150px)); height: 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; pointer-events: none; }
.hud > .compass, .compass * { pointer-events: none; }
.compass-win { position: absolute; inset: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.compass-tape { position: absolute; left: 0; top: 0; bottom: 0; will-change: transform;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.38) 0 1px, transparent 1px 12px) 0 100% / 100% 6px no-repeat; }
.compass .cl { position: absolute; top: 6px; transform: translateX(-50%); font: 600 10px/1 system-ui, sans-serif; color: var(--dim);
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.compass .cl.p { top: 5px; font-size: 12px; font-weight: 700; color: var(--ink); }
.compass .cl.n { top: 5px; font-size: 12px; font-weight: 800; color: #ff5a4e; }
.compass::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 11px; margin-left: -1px; border-radius: 1px; background: #ff5a4e; }
.compass::before { content: ""; position: absolute; left: 50%; top: 0; margin-left: -4px; border: 4px solid transparent; border-top-color: #ff5a4e; }

/* ---- postcards (postcards.js, postcard-ui.js; 2026-11-24, Miguel: "pode ser um pouco como o burnout paradise? O postal
   aparece um pouco inclinado e o texto no postal vai sendo escrito à mão"). The row sits in the place card; the card
   that comes in is paper, tilted, and its lines are written out left to right; the album is a dialog. ---- */
.pc-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-width: 0; font-size: 11.5px; }
.pc-row[hidden] { display: none; }
.pc-album-btn, .pc-snap { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 7px;
  font: inherit; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink); cursor: pointer;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.pc-album-btn:hover { background: rgba(255, 255, 255, 0.16); }
.pc-album-btn:focus-visible, .pc-snap:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }
.pc-album-btn.pc-bump { animation: pc-bump 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes pc-bump { 40% { transform: scale(1.25); background: rgba(255, 210, 63, 0.35); } }
.pc-bag { flex: none; color: #ffd23f; font-variant-numeric: tabular-nums; }
.pc-snap { min-width: 0; max-width: 100%; background: #f4eddc; color: #1f2f6b; border-color: transparent; font-weight: 600;
  box-shadow: 0 0 0 0 rgba(255, 230, 160, 0.7); animation: pc-ready 1.8s ease-in-out infinite; }
.pc-snap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-snap:hover { background: #fff8e6; }
@keyframes pc-ready { 50% { box-shadow: 0 0 0 5px rgba(255, 230, 160, 0); } }
.pc-hint { min-width: 0; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-hint[hidden] { display: none; }

/* left of the road, over the open side of the picture: the car (centre right in the chase view) stays in sight
   (2026-11-24, Miguel: "Shouldn't it be on the left side when it appears so it doesn't block the car?") */
.pc-fly { position: fixed; z-index: 4; left: max(4vw, 20px); top: 13vh; width: min(320px, 74vw); pointer-events: none; }
.pc-fly[hidden] { display: none; }
.pc-card { position: relative; padding: 10px 10px 12px; background: #f4eddc; color: #1f2f6b; border-radius: 3px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3); transform: rotate(-5deg);
  animation: pc-in 0.65s cubic-bezier(0.2, 0.85, 0.25, 1.1) both; }
@keyframes pc-in { from { transform: translate(-40vw, 30vh) rotate(-22deg) scale(0.8); opacity: 0.2; } }
.pc-card.pc-drop { animation: none; transition: transform 0.7s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.7s ease-in;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(12deg) scale(0.08); opacity: 0.3; }
.pc-card.pc-calm { animation: none; transform: rotate(-3deg); }
.pc-card.pc-out { transition: opacity 0.5s; opacity: 0; }
.pc-photo { aspect-ratio: 16 / 9; background: #15181c; overflow: hidden; }
.pc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the stamp and the postmark sit on the paper, bottom right (over the photo they could not be read); the stamp's
   perforated edge is its own background with holes, the picture covers the middle */
.pc-stamp { position: absolute; bottom: 12px; right: 12px; width: 52px; height: 62px; transform: rotate(5deg);
  background: radial-gradient(circle at 4px 4px, transparent 2.4px, #fffaf0 2.9px) -4px -4px / 8px 8px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.3)); }
.pc-stamp::before { content: ""; position: absolute; inset: 5px; background: var(--stamp, #b4553a); }
.pc-stamp-art { position: relative; display: block; text-align: center; font-size: 22px; line-height: 40px; }
.pc-stamp small { position: relative; display: block; text-align: center; font-size: 6.5px; font-weight: 700; letter-spacing: 0.06em; color: #fffaf0; }
.pc-mark { position: absolute; bottom: 22px; right: 44px; width: 54px; height: 54px; border: 2px solid rgba(30, 35, 60, 0.6); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-14deg);
  font: 700 6.5px/1.25 ui-sans-serif, system-ui, sans-serif; color: rgba(30, 35, 60, 0.75); text-align: center; }
.pc-mark b { font-size: 6px; max-width: 46px; }
.pc-text { display: flex; flex-direction: column; min-height: 72px; padding: 8px 100px 0 4px; }
.pc-hand { display: block; white-space: nowrap; font-family: "Segoe Print", "Bradley Hand", "Noteworthy", "Ink Free", "Comic Neue", cursive; line-height: 1.3; }
.pc-title { font-size: 19px; }
.pc-note { font-size: 14.5px; }
.pc-sign { font-size: 13.5px; align-self: flex-end; margin-top: 2px; }
/* written out letter by letter in the pen's rhythm (postcard-ui.js penTimes): each letter is drawn left to right in
   fresh, darker ink that then dries to the card's blue */
.pc-ch { display: inline-block; white-space: pre; }
.pc-write .pc-ch { clip-path: inset(-45% 110% -45% -25%); animation: pc-pen var(--d, 0.05s) cubic-bezier(0.35, 0.1, 0.6, 1) var(--delay, 0s) forwards, pc-dry 1.4s ease-out var(--delay, 0s) both; }
@keyframes pc-pen { to { clip-path: inset(-45% -40% -45% -25%); } }
@keyframes pc-dry { from { color: #0a1240; text-shadow: 0 0 0.6px rgba(10, 18, 64, 0.7); } }
@media (max-width: 760px), (max-height: 520px) {
  .pc-fly { left: 50%; right: auto; top: 12vh; width: min(320px, 78vw); margin-left: calc(min(320px, 78vw) / -2); }
  .pc-title { font-size: 16px; }
  .pc-note { font-size: 12.5px; }
  .pc-sign { font-size: 12px; }
}

.pc-album { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 14, 0.55); }
.pc-album[hidden] { display: none; }
.pc-album-card { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px;
  border-radius: 14px; background: rgba(16, 19, 24, 0.92); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
.pc-album-note { margin: 6px 0 10px; }
.pc-land h3 { margin: 12px 0 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.pc-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pc-slot { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 72px; padding: 6px 6px 8px; border-radius: 4px; font: inherit; text-align: left; }
.pc-slot.got { background: #f4eddc; color: #1f2f6b; border: 0; cursor: pointer; transform: rotate(-1.2deg); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.pc-slot.got:nth-child(2) { transform: rotate(1deg); }
.pc-slot.got:hover, .pc-slot.got:focus-visible { transform: rotate(0) scale(1.03); outline: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.pc-slot img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pc-slot.missing { justify-content: center; align-items: center; text-align: center; border: 1.5px dashed rgba(255, 255, 255, 0.25); color: var(--dim); }
.pc-slot-title { font-size: 12px; line-height: 1.25; }
.pc-slot.got .pc-slot-title { font-family: "Segoe Print", "Bradley Hand", "Noteworthy", "Ink Free", "Comic Neue", cursive; font-size: 12.5px; }
.pc-slot small { font-size: 11px; }
.pc-slot-bag { color: #9a6a00; }
.pc-view img { display: block; width: 100%; height: auto; border-radius: 4px; transform: rotate(-1deg); margin: 8px 0 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5); min-height: 120px; background: #f4eddc; }
.pc-view .row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .pc-slots { gap: 6px; } .pc-slot { min-height: 80px; } .pc-slot-title { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) {
  .pc-snap, .pc-album-btn.pc-bump { animation: none; }
  .pc-write .pc-ch { animation: none; clip-path: none; }
}
