/* HUD: plain HTML over the canvas. The map itself never touches the DOM. */
:root {
  --ink: #1e2430;
  --muted: #5d6b7e;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(30, 36, 48, 0.12);
  --accent: #ffd23f;
  font: 13px/1.4 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #c7e0f2; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }

.panel {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel h2 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.panel h2 + dl { margin-top: 0; }
.panel dl + h2 { margin-top: 10px; }

#stats { top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; width: 290px; max-width: calc(100vw - 20px); }
#stats .stats-head { display: flex; align-items: center; gap: 8px; }
#stats .stats-head h2 { margin: 0; }
#stats .stats-summary { display: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#stats-toggle { margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: 700 15px/1 ui-sans-serif, -apple-system, sans-serif; cursor: pointer; }
#stats-toggle:hover { background: var(--accent); }
#stats-body { margin-top: 4px; }
#stats.collapsed { width: auto; padding: 6px 8px 6px 12px; }
#stats.collapsed #stats-body { display: none; }
#stats.collapsed .stats-summary { display: inline; }
#stats dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 0; }
#stats dt { color: var(--muted); }
#stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

#controls { top: calc(70px + env(safe-area-inset-top, 0px)); right: 10px; display: grid; grid-template-columns: auto auto; gap: 6px 8px; align-items: center; }
#controls label { color: var(--muted); }
#controls select { font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
#controls .check { grid-column: 1 / -1; color: var(--ink); display: flex; gap: 6px; align-items: center; }
#controls kbd { font: inherit; font-size: 11px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); }

#find { top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 20px)); padding: 6px; }
#search { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
#results { display: flex; flex-direction: column; color: var(--muted); }
#results:not(:empty) { padding-top: 6px; }
#results button { font: inherit; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 6px; color: var(--ink); cursor: pointer; }
#results button:hover, #results button:focus-visible { background: rgba(255, 210, 63, 0.35); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#status { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); margin: 0; font-weight: 700; font-size: 15px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--ink); background: var(--panel); box-shadow: 0 3px 0 var(--ink); max-width: calc(100vw - 32px); text-align: center; }
#status:empty { display: none; }

#pick[hidden] { display: none; }
#pick { left: 50%; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; min-width: 240px; padding-right: 36px; }
#pick strong { font-size: 16px; }
#pick span { color: var(--muted); }
#pick-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }

#help { position: fixed; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; color: var(--ink); opacity: 0.7; font-size: 12px; white-space: nowrap; }

:focus-visible { outline: 2px solid #2e7cb8; outline-offset: 2px; }

#clock { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; }
#clock strong { font-size: 15px; font-variant-numeric: tabular-nums; }
#clock #clock-icon { font-size: 15px; width: 18px; text-align: center; }
#clock #clock-period { color: var(--muted); min-width: 64px; }
#clock .clock-buttons { display: flex; gap: 2px; }
#clock button { font: inherit; font-size: 12px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
#clock button:hover, #clock button[aria-current="true"] { background: var(--accent); }
#clock #clock-run { width: 26px; padding: 3px 0; }
#controls { top: calc(56px + env(safe-area-inset-top, 0px)); }
body.night .panel { background: rgba(236, 240, 252, 0.88); }
#sound[hidden] { display: none; }
#sound { position: fixed; left: calc(10px + env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; padding: 7px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
#sound:hover { background: var(--accent); }
#sound:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
#sound svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sound .speaker { fill: currentColor; }
#sound .mute, #sound[aria-pressed="false"] .waves { display: none; }
#sound[aria-pressed="false"] .mute { display: inline; }
#sound[aria-pressed="false"] { opacity: 0.75; }
@media (pointer: coarse) {
  body.playing #sound { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
  body.playing #clock { top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; right: auto; left: 10px; }
}
body.playing #clock .clock-buttons, body.playing #clock #clock-period { display: none; }

@media (max-width: 640px) {
  #stats { width: auto; right: 10px; font-size: 11px; }
  #stats dl { grid-template-columns: repeat(2, auto 1fr); }
  #stats-body > h2, #stats-body > dl:last-of-type { display: none; }
  #controls { top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); right: 10px; left: 10px; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); font-size: 12px; }
  #controls select { width: 100%; min-width: 0; }
  #pick { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  #help { display: none; }
  #find { top: auto; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
  #sound { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
  #clock { top: auto; bottom: calc(176px + env(safe-area-inset-bottom, 0px)); right: 10px; font-size: 12px; gap: 5px; }
  #clock #clock-period { display: none; }
  #stats { top: calc(10px + env(safe-area-inset-top, 0px)); }
}

/* playing a character (control.js, drive-hud.js): speedometer in a corner, a fading key hint at the top, joystick on touch */
#drive-corner[hidden], #drive-hint[hidden], #pad[hidden], #speedo[hidden], #walk-badge[hidden] { display: none; }
#drive-corner { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
#speedo { position: relative; width: 176px; height: 176px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
#speedo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#speedo .face { fill: none; }
#speedo .track { fill: none; stroke: rgba(30, 36, 48, 0.12); stroke-width: 9; stroke-linecap: round; }
#speedo .redline { fill: none; stroke: #f05a4f; stroke-width: 9; opacity: 0.35; }
#speedo .progress { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
#speedo line { stroke: var(--ink); stroke-linecap: round; }
#speedo line.major { stroke-width: 3; }
#speedo line.minor { stroke-width: 1.5; opacity: 0.6; }
#speedo text { font: 700 13px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: var(--ink); text-anchor: middle; }
#speedo .needle path { fill: #f05a4f; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
#speedo .hub { fill: var(--ink); }
#speedo .speedo-readout { position: absolute; left: 0; right: 0; top: 118px; display: flex; justify-content: center; align-items: baseline; gap: 3px; }
#speedo .speedo-readout strong { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
#speedo .speedo-readout span { font-size: 11px; font-weight: 700; color: var(--muted); }
#speedo .speedo-name { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
#speedo .speedo-gear { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); font-weight: 900; font-size: 13px; color: #fff; background: #f05a4f; border: 2px solid var(--ink); border-radius: 6px; padding: 0 5px; }
#speedo .speedo-gear[hidden] { display: none; }
#speedo.crash { animation: crash 0.4s; }
@keyframes crash { 0%, 100% { transform: none; } 25% { transform: translateX(-4px) rotate(-2deg); background: #ffd6d2; } 75% { transform: translateX(4px) rotate(2deg); } }
/* life (drive-hud.js › life, hurt, down) */
#life { align-self: stretch; display: flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, 0.92); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 14px; padding: 6px 11px; }
#life .icon { flex: none; width: 20px; height: 20px; }
#life .icon svg { width: 100%; height: 100%; fill: #f05a4f; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
#life .bar { position: relative; flex: 1; height: 13px; border: 2px solid var(--ink); border-radius: 7px; background: rgba(30, 36, 48, 0.1); overflow: hidden; }
#life .bar i { position: absolute; inset: 0 auto 0 0; background: #f05a4f; transition: width 0.3s; }
#life[data-level="ok"] .bar i { background: #3fbf6f; }
#life[data-level="mid"] .bar i { background: #f5a524; }
#life[data-level="low"] .icon { animation: heartbeat 0.8s infinite; }
#life strong { min-width: 26px; text-align: right; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 28% { transform: scale(1.1); } }
#hurt-edge { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 120px 40px rgba(220, 30, 30, 0.85); z-index: 5; }
#hurt-edge.hit { animation: hurt-flash 0.7s ease-out; }
#hurt-edge.low:not(.hit) { animation: hurt-low 1.6s ease-in-out infinite; }
@keyframes hurt-flash { 0% { opacity: var(--hit, 0.6); } 100% { opacity: 0; } }
@keyframes hurt-low { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.38; } }
body.down #map { filter: grayscale(0.9) brightness(0.85); transition: filter 1.2s; }
#down[hidden] { display: none; }
#down { position: fixed; left: 0; right: 0; top: calc(70px + env(safe-area-inset-top, 0px)); display: flex; justify-content: center; pointer-events: none; z-index: 6; animation: down-in 0.8s ease-out; }
#down .card { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255, 255, 255, 0.94); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); border-radius: 18px; padding: 10px 22px; text-align: center; }
#down strong { font-size: 20px; font-weight: 900; color: #e0453b; }
#down span { font-size: 15px; font-weight: 700; }
#down em { font-style: normal; font-size: 12px; color: var(--muted); }
@keyframes down-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }

/* fuel and the vehicle's state, beside the speedometer (drive-hud.js › condition) */
#drive-corner .drive-row { display: flex; align-items: flex-end; gap: 10px; }
#gauges[hidden], #gauges .gauge-line[hidden], #gauges .arrow[hidden] { display: none; }
#gauges { width: 178px; display: flex; flex-direction: column; gap: 7px; background: rgba(255, 255, 255, 0.92); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 16px; padding: 9px 11px; }
#gauges .gauge { display: flex; align-items: center; gap: 7px; }
#gauges .icon { flex: none; width: 20px; height: 20px; }
#gauges .icon svg { width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#gauges .bar { position: relative; flex: 1; height: 13px; border: 2px solid var(--ink); border-radius: 7px; background: rgba(30, 36, 48, 0.1); overflow: hidden; }
#gauges .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); transition: width 0.25s linear, background 0.3s; }
#gauges .bar b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(30, 36, 48, 0.35); }
#gauges .bar .q1 { left: 25%; } #gauges .bar .q2 { left: 50%; } #gauges .bar .q3 { left: 75%; }
#gauges .ends { display: flex; gap: 5px; font-size: 10px; font-weight: 900; color: var(--muted); }
#gauges .ends em { font-style: normal; }
#gauges .fuel.low .bar i { background: #f5a524; }
#gauges .fuel.reserve .bar i { background: #f05a4f; }
#gauges .fuel.reserve .icon { animation: blink 0.9s steps(1) infinite; }
#gauges .fuel.reserve .icon svg { stroke: #f05a4f; }
#gauges .fuel.filling .bar i { background: #3fbf6f; transition: width 0.1s linear; }
#gauges .breath[hidden] { display: none; }
#gauges .breath .bar i { background: #5cc8f0; transition: width 0.15s linear; }
#gauges .breath.straining .bar i { background: #f5a524; }
#gauges .breath.spent .bar i { background: #f05a4f; }
#gauges .breath.spent .icon, #gauges .breath.spent .value { animation: blink 0.6s steps(1) infinite; color: #f05a4f; }
#gauges .breath .value { min-width: 34px; text-align: right; font-size: 11px; font-weight: 900; }
#gauges .health .value { min-width: 34px; text-align: right; font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; }
#gauges .health[data-level="ok"] .bar i { background: #3fbf6f; }
#gauges .health[data-level="worn"] .bar i { background: #b8cf3a; }
#gauges .health[data-level="hurt"] .bar i { background: #f5a524; }
#gauges .health[data-level="bad"] .bar i { background: #f05a4f; }
#gauges .health[data-level="bad"] .icon, #gauges .health[data-level="wreck"] .value { animation: blink 0.9s steps(1) infinite; }
#gauges .health[data-level="wreck"] .value { color: #f05a4f; min-width: 0; white-space: nowrap; }
#gauges .gauge-line { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 800; }
#gauges .gauge-line.filling { color: #2a9a55; }
#gauges .arrow { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); }
#gauges .arrow svg { width: 13px; height: 13px; fill: #fff; }
@keyframes blink { 50% { opacity: 0.25; } }
#walk-badge { display: flex; flex-direction: column; align-items: flex-end; background: rgba(255, 255, 255, 0.92); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 16px; padding: 8px 14px; }
#walk-badge strong { font-size: 14px; }
#walk-badge span { font-size: 20px; font-weight: 900; }
#drive-note { margin: 0; max-width: 260px; text-align: right; font-weight: 700; color: #fff; background: var(--ink); border-radius: 10px; padding: 6px 10px; opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
#drive-note.on { opacity: 1; transform: none; }
#drive-hint { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); margin: 0; font-size: 12px; color: var(--ink); background: rgba(255, 255, 255, 0.8); border-radius: 12px; padding: 4px 12px; width: max-content; max-width: max(280px, calc(100vw - 640px)); text-align: center; transition: opacity 0.8s; pointer-events: none; }
#drive-hint.fade { opacity: 0; }
@media (pointer: coarse) {
  /* the joystick and the buttons take the bottom: the speedometer goes to the top right, smaller */
  #drive-corner { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); flex-direction: column-reverse; }
  #speedo { width: 128px; height: 128px; }
  #speedo .speedo-readout { top: 84px; }
  #speedo .speedo-readout strong { font-size: 19px; }
  #speedo .speedo-name { bottom: 6px; font-size: 9px; }
  #speedo .speedo-gear { top: 40px; }
  #drive-corner .drive-row { align-items: flex-start; }
  #gauges { width: 150px; padding: 7px 9px; gap: 5px; }
  #drive-hint { bottom: auto; top: calc(150px + env(safe-area-inset-top, 0px)); }
}
#pad { position: fixed; inset: auto 0 calc(16px + env(safe-area-inset-bottom, 0px)) 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px; pointer-events: none; }
#pad .stick { pointer-events: auto; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); border: 2px solid rgba(30, 36, 48, 0.4); display: grid; place-items: center; touch-action: none; }
#pad .knob { width: 56px; height: 56px; border-radius: 50%; background: var(--ink); opacity: 0.75; transition: transform 0.05s; }
#pad .pad-buttons { pointer-events: auto; display: flex; flex-direction: column; gap: 10px; }
#pad button { font: inherit; font-weight: 700; font-size: 15px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.9); color: var(--ink); touch-action: none; }
#pad button:active { background: var(--accent); }
body.playing #find, body.playing #controls, body.playing #help, body.playing #results { display: none; }
@media (max-width: 640px) { body.playing #stats { display: none; } }

/* deliveries (jobs.js): the card of the delivery under way and the wallet in the corner (drive-hud.js), the phone (phone.js) */
#job-card[hidden], #job-card .job-food[hidden], #job-card .job-hold[hidden], #phone[hidden], #phone-button[hidden], #phone-button .dot[hidden] { display: none; }
#job-card { align-self: stretch; width: 260px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, 0.94); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 16px; padding: 9px 11px; }
#job-card .job-head { display: flex; align-items: center; gap: 8px; }
#job-card .icon { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 9px; background: #ff8c26; }
#job-card[data-stage="dropoff"] .icon { background: #ff6bb8; }
#job-card .icon svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
#job-card .job-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
#job-card .job-who em { font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
#job-card .job-who strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#job-card .job-time { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
#job-card .job-time.tight { color: #e08a00; }
#job-card .job-time.late { color: #f05a4f; animation: blink 0.9s steps(1) infinite; }
#job-card .job-line { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; }
#job-card .job-line b { font-weight: 900; font-variant-numeric: tabular-nums; }
#job-card .job-dish { color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#job-card .arrow { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); }
#job-card .arrow svg { width: 15px; height: 15px; fill: #fff; }
#job-card .job-food { display: flex; align-items: center; gap: 7px; font-size: 11px; }
#job-card .job-food .bar { position: relative; flex: 1; height: 11px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(30, 36, 48, 0.1); overflow: hidden; }
#job-card .job-food .bar i { position: absolute; inset: 0 auto 0 0; background: #3fbf6f; transition: width 0.3s; }
#job-card .job-food[data-level="worn"] .bar i { background: #b8cf3a; }
#job-card .job-food[data-level="hurt"] .bar i { background: #f5a524; }
#job-card .job-food[data-level="bad"] .bar i { background: #f05a4f; }
#job-card .job-food b { font-weight: 900; min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
#job-card .job-hold { position: relative; height: 18px; border: 2px solid var(--ink); border-radius: 9px; overflow: hidden; background: rgba(30, 36, 48, 0.08); }
#job-card .job-hold i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
#job-card .job-hold span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 900; line-height: 14px; }
#wallet { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.92); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 999px; padding: 4px 12px 4px 6px; }
#wallet .icon { width: 22px; height: 22px; }
#wallet .icon svg { width: 100%; height: 100%; fill: var(--accent); stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#wallet strong { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
#wallet.debt strong { color: #f05a4f; }
#wallet .stars { font-size: 12px; font-weight: 800; color: #c98a00; }
#wallet .stars:empty { display: none; }

#phone-button { position: fixed; left: calc(56px + env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; padding: 6px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
#phone-button:hover, #phone-button[aria-pressed="true"] { background: var(--accent); }
#phone-button svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#phone-button .dot { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: #f05a4f; border: 2px solid var(--ink); }
#phone { position: fixed; left: calc(10px + env(safe-area-inset-left, 0px)); bottom: calc(58px + env(safe-area-inset-bottom, 0px)); width: 310px; max-width: calc(100vw - 20px); max-height: calc(100vh - 80px); display: flex; padding: 9px; border-radius: 30px; background: var(--ink); box-shadow: 0 6px 0 rgba(30, 36, 48, 0.5); }
#phone .screen { flex: 1; min-height: 0; overflow-y: auto; border-radius: 22px; background: #f6f8fb; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
#phone .app-head { display: flex; align-items: center; gap: 8px; }
#phone .brand { flex: 1; display: flex; align-items: baseline; gap: 6px; }
#phone .brand strong { font-size: 21px; font-weight: 900; letter-spacing: -0.02em; color: #ff6a1a; }
#phone .brand span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
#phone .money { display: flex; align-items: baseline; gap: 3px; background: var(--accent); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; }
#phone .money strong { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
#phone .money span { font-size: 10px; font-weight: 800; }
#phone .money.debt { background: #ffd2cd; }
#phone .money.debt strong { color: #d43a2f; }
#phone button { font: inherit; font-weight: 800; font-size: 12px; padding: 6px 11px; border-radius: 10px; border: 2px solid var(--ink); background: var(--accent); color: var(--ink); box-shadow: 0 2px 0 var(--ink); cursor: pointer; white-space: nowrap; }
#phone button:hover:not(:disabled) { filter: brightness(1.06); }
#phone button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
#phone button:disabled { opacity: 0.45; cursor: default; }
#phone button.secondary { background: #fff; }
#phone button.close { padding: 0; width: 26px; height: 26px; border-radius: 50%; background: #fff; font-size: 16px; line-height: 1; }
#phone .rating { margin: -4px 0 0; font-size: 12px; font-weight: 800; color: #c98a00; }
#phone .block { display: flex; flex-direction: column; gap: 7px; }
#phone h3 { margin: 0; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
#phone .offer { position: relative; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 10px 10px; overflow: hidden; }
#phone .current .offer { background: #fff4e6; }
#phone .route { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-size: 13px; line-height: 1.2; }
#phone .route .to { color: var(--muted); font-weight: 900; }
#phone .route .here { color: #e2560e; }
#phone .facts { margin: 0; display: flex; flex-wrap: wrap; gap: 3px 9px; font-size: 11px; color: var(--muted); font-weight: 700; }
#phone .facts strong { color: var(--ink); font-size: 12px; }
#phone .facts .late { color: #f05a4f; }
#phone .offer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
#phone .pay { font-size: 15px; font-weight: 900; color: #2a9a55; }
#phone .expire { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(30, 36, 48, 0.08); }
#phone .expire i { position: absolute; inset: 0 auto 0 0; background: #ff8c26; }
#phone .empty { margin: 0; font-size: 12px; color: var(--muted); font-style: italic; }
#phone .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
#phone .row .facts { flex-direction: column; flex: 1; min-width: 0; }
#phone .owned { font-size: 12px; font-weight: 900; color: #2a9a55; }
#phone .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
#phone .history li { display: flex; align-items: center; gap: 6px; }
#phone .history .stars { color: #e0a000; letter-spacing: -1px; }
#phone .history .who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 700; }
#phone .history b { color: #2a9a55; font-variant-numeric: tabular-nums; }
#phone .history b.zero { color: #f05a4f; }
#phone .phone-hint { margin: 0; text-align: center; font-size: 10px; color: var(--muted); }
body.phone-open #stats { display: none; }
@media (pointer: coarse) {
  #phone-button { left: calc(10px + env(safe-area-inset-left, 0px)); bottom: calc(222px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }
  #phone { left: 10px; right: 10px; width: auto; top: calc(56px + env(safe-area-inset-top, 0px)); bottom: calc(176px + env(safe-area-inset-bottom, 0px)); max-height: none; }
  #job-card { width: 210px; padding: 7px 9px; }
}

/* the big button over a vehicle that can be pushed (control.js › placePrompt): it bobs, an arrow points at the vehicle */
#act-prompt[hidden] { display: none; }
#act-prompt { position: fixed; left: 0; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 11px; border: 3px solid var(--ink); border-radius: 16px; background: var(--accent); color: var(--ink); box-shadow: 0 5px 0 var(--ink); font: 900 17px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0.01em; cursor: pointer; touch-action: none; margin-top: -14px; }
#act-prompt::after { content: ''; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); border: 9px solid transparent; border-top: 11px solid var(--ink); }
#act-prompt > * { animation: prompt-bob 0.9s ease-in-out infinite; }
#act-prompt svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#act-prompt kbd { font: 900 13px/1 ui-monospace, monospace; padding: 4px 7px; border: 2px solid var(--ink); border-radius: 7px; background: #fff; box-shadow: 0 2px 0 var(--ink); }
#act-prompt:hover { background: #ffe066; }
#act-prompt:active { box-shadow: 0 2px 0 var(--ink); }
@keyframes prompt-bob { 50% { transform: translateY(-3px); } }
@media (pointer: coarse) { #act-prompt { font-size: 19px; padding: 12px 18px 12px 14px; } }

/* the game without ?dev=1 (main.js › setDev, F3 toggles): no telemetry, no settings form (nor its catalog link), no long
   help line; the long key help of drive-hud.js only after H. A short hint comes once instead (#tip, main.js › tipOnce) */
body:not(.dev) #stats, body:not(.dev) #controls, body:not(.dev) #help { display: none; }
body:not(.dev):not(.hint-on) #drive-hint { display: none; }
#tip[hidden] { display: none; }
#tip { position: fixed; z-index: 30; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100vw - 32px); padding: 7px 16px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); font-size: 14px; font-weight: 700; text-align: center; pointer-events: none; transition: opacity 0.8s; }
#tip.fade { opacity: 0; }
/* on a phone the open phone (which Jogar opens) would sit under the pad's buttons: those come back when it closes */
@media (pointer: coarse) { body.phone-open #pad .pad-buttons { display: none; } }
@media (pointer: coarse) { #tip { top: calc(62px + env(safe-area-inset-top, 0px)); } }

/* the start screen (index.html #intro, intro.js): a card over the map, which loads behind it; the suggestions push
   the Jogar button down (over it, a tap on Jogar would pick a suggestion instead) */
#intro[hidden] { display: none; }
#intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; background: radial-gradient(ellipse at 50% 40%, rgba(199, 224, 242, 0.15), rgba(30, 36, 48, 0.55)); }
body.intro #find, body.intro #clock, body.intro #sound, body.intro #status, body.intro #pick { display: none; }
.intro-card { position: relative; width: min(440px, 100%); padding: 26px 26px 18px; border-radius: 28px; border: 3px solid var(--ink); background: #fffdf5; box-shadow: 0 8px 0 var(--ink); text-align: center; }
#intro-title { margin: 0; font-size: 76px; line-height: 1; font-weight: 900; letter-spacing: -0.04em; color: #ff6a1a; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); transform: rotate(-3deg); }
#intro-tagline { margin: 16px auto 20px; max-width: 330px; font-size: 17px; line-height: 1.35; font-weight: 700; color: var(--ink); }
#intro-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#intro-form label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.intro-field { position: relative; }
#intro-city { width: 100%; font: inherit; font-size: 18px; font-weight: 600; padding: 12px 14px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); box-shadow: inset 0 3px 0 rgba(30, 36, 48, 0.08); }
#intro-city::placeholder { color: #8a96a6; font-weight: 500; }
#intro-results:empty { display: none; }
#intro-results { margin-top: 6px; display: flex; flex-direction: column; padding: 4px; border-radius: 14px; border: 2px dashed rgba(30, 36, 48, 0.3); background: #fff8dc; max-height: 220px; overflow-y: auto; }
#intro-results button { display: flex; align-items: baseline; gap: 4px; font: inherit; font-size: 16px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; color: var(--ink); cursor: pointer; }
#intro-results button span { color: var(--muted); font-size: 13px; font-weight: 700; }
#intro-results button:hover, #intro-results button[aria-selected="true"] { background: rgba(255, 210, 63, 0.5); }
#intro-results .none { margin: 0; padding: 9px 10px; color: var(--muted); }
#intro-play { margin-top: 6px; font: inherit; font-size: 30px; font-weight: 900; letter-spacing: -0.01em; padding: 13px 18px; border-radius: 18px; border: 3px solid var(--ink); background: var(--accent); color: var(--ink); box-shadow: 0 6px 0 var(--ink); cursor: pointer; }
#intro-play:hover:not(:disabled) { filter: brightness(1.05); }
#intro-play:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
#intro-play:disabled { opacity: 0.75; cursor: progress; }
#intro-status { margin: 0; min-height: 1.4em; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; }
#intro-status:empty { min-height: 0; }
#intro-explore { margin-top: 10px; font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px; cursor: pointer; }
#intro-explore:hover { color: var(--ink); }
@media (max-width: 480px) {
  .intro-card { padding: 22px 18px 14px; border-radius: 24px; }
  #intro-title { font-size: 64px; }
  #intro-tagline { font-size: 16px; margin: 14px auto 16px; }
}

/* share the city (main.js › share): a round button beside the sound and the phone, only while playing */
#share { position: fixed; left: calc(102px + env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; padding: 7px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
#share:hover { background: var(--accent); }
#share:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
#share svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body:not(.playing) #share, body.down #share { display: none; }
@media (pointer: coarse) {
  #share { left: calc(10px + env(safe-area-inset-left, 0px)); bottom: calc(274px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; padding: 9px; }
  body.phone-open #share { display: none; }
}
