/* The look of the logo (assets/ui/logo.webp): gunmetal letters, brushed-steel faces, copper light along the edges
   and the arcs through the A's. Panels are dark steel with a copper glint on top and the corners cut like the A's;
   copper marks what is active. */
:root {
  --ink: #ece6dc;            /* warm white, the logo's highlights */
  --ink-2: #aab2ba;          /* steel */
  --ink-3: #6f777f;
  --gun: #121417;
  --gun-1: rgba(30, 33, 38, .88);
  --gun-2: rgba(14, 16, 19, .88);
  --line: rgba(207, 213, 218, .14);
  --copper: #d98e3f;
  --copper-hi: #f6c27a;
  --copper-lo: #7b471a;
  --glow: rgba(229, 155, 60, .45);
  --cut: 12px;
  --head: 'Exo 2', 'Fira Sans', system-ui, sans-serif;
  --body: 'Fira Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--gun); color: var(--ink);
  font-family: var(--body); touch-action: none; }
/* no text selection or long-press callout where the game is played (the view, the HUD, the pad, the title): the
   menu's text, the credits, the coordinates and the inputs stay selectable and copyable */
#view, #hud, #touch, #title, #loading { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#hud #where, #mptoast, .m-about, .m-note p, input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }
/* the menu scrolls with a finger (the game page itself does not pan or zoom) */
#menu, #board { touch-action: pan-y; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; }

/* a steel panel: copper glint along the top edge, corners cut like the logo's A */
.panel, #mp, #help, .card, #where {
  background: linear-gradient(180deg, var(--gun-1), var(--gun-2));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(246, 194, 122, .22), 0 8px 24px rgba(0, 0, 0, .35);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
kbd { display: inline-block; min-width: 22px; padding: 0 5px; margin-right: 3px; border-radius: 3px; text-align: center;
  background: linear-gradient(180deg, #3a3f46, #23272c); border: 1px solid #ffffff2a; border-bottom-color: #0008;
  color: var(--ink); font: 600 11px/18px var(--body); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.online { background: #3ccf7a; box-shadow: 0 0 6px #3ccf7a; }
.dot.offline, .dot.full { background: #e0533f; }

/* ---------------------------------------------------------------- loading */
#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center;
  background: radial-gradient(ellipse at 50% 45%, #23272d 0%, #121417 62%, #0b0c0e 100%); transition: opacity .7s; z-index: 9; padding: 16px; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .logo { width: min(760px, 88vw); height: auto; filter: drop-shadow(0 6px 18px #000a); }
.sub { color: var(--ink-2); font-size: 14px; letter-spacing: .06em; }
.bar { width: min(420px, 78vw); height: 4px; background: #ffffff14; overflow: hidden; margin-top: 4px; }
#loadbar { height: 100%; width: 0; background: linear-gradient(90deg, var(--copper-lo), var(--copper), var(--copper-hi));
  box-shadow: 0 0 10px var(--glow); transition: width .2s; }
#loadtext { font: 600 12px var(--head); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .1em; }

/* ---------------------------------------------------------------- the menu (as reference/game/gameLookMenu.png) */
#menu { position: fixed; inset: 0; z-index: 7; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-rows: auto 1fr auto; gap: clamp(12px, 2.4vh, 26px);
  padding: 14px clamp(16px, 2.6vw, 40px) 30px;
  background:
    linear-gradient(90deg, rgba(10, 11, 13, .88) 0%, rgba(10, 11, 13, .45) 30%, rgba(10, 11, 13, 0) 50%, rgba(10, 11, 13, .45) 72%, rgba(10, 11, 13, .82) 100%),
    linear-gradient(180deg, rgba(10, 11, 13, .75) 0%, rgba(10, 11, 13, 0) 16%, rgba(10, 11, 13, 0) 80%, rgba(10, 11, 13, .8) 100%);
  animation: menuin .45s ease-out; }
@keyframes menuin { from { opacity: 0; } to { opacity: 1; } }
/* the menu's rows never grow wider than the screen: the tabs scroll inside their row instead */
#menu > *, .m-tabs { min-width: 0; }
#menu { grid-template-columns: minmax(0, 1fr); }

.m-bar { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px); border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.m-logo { width: clamp(150px, 15vw, 230px); height: auto; filter: drop-shadow(0 2px 8px #000c) brightness(1.15); flex: none; }
.m-tabs { display: flex; gap: clamp(6px, 1.6vw, 26px); flex: 1; overflow-x: auto; scrollbar-width: none; }
.m-tabs button { background: none; border: 0; cursor: pointer; padding: 10px 2px 12px; position: relative;
  font: 600 15px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.m-tabs button:hover { color: var(--ink); }
.m-tabs button.on { color: var(--copper-hi); }
.m-tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -11px; height: 3px;
  background: linear-gradient(90deg, var(--copper-lo), var(--copper-hi)); box-shadow: 0 0 10px var(--glow); }
.m-who { display: flex; align-items: center; gap: 14px; flex: none; }
.m-online { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.m-chip { --cut: 8px; padding: 6px 12px; font: 700 13px var(--head); letter-spacing: .06em;
  background: linear-gradient(180deg, var(--gun-1), var(--gun-2)); border: 1px solid var(--line); border-left: 3px solid var(--copper);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }

.m-page { display: grid; grid-template-columns: minmax(300px, 470px) 1fr minmax(260px, 340px); gap: 24px; align-items: start; }
.m-cards { display: grid; gap: 10px; align-content: start; }
.m-side { display: grid; gap: 12px; align-content: start; grid-column: 3; }

/* a card: the scene photo on the right, fading into steel on the left, the title over it */
.card { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; min-height: 92px;
  padding: 14px 18px; cursor: pointer; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.card::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(14, 16, 19, .97) 0%, rgba(14, 16, 19, .86) 38%, rgba(14, 16, 19, .15) 100%), var(--img, none) right center / cover no-repeat; }
.card > * { position: relative; z-index: 1; }
.card:hover:not(:disabled), .card:focus-visible { transform: translateX(4px); border-color: rgba(246, 194, 122, .55); outline: none; }
.card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; z-index: 2; background: transparent; }
.card.primary::before, .card.join::before, .card:hover:not(:disabled)::before { background: linear-gradient(180deg, var(--copper-hi), var(--copper-lo));
  box-shadow: 0 0 10px var(--glow); }
.card .tx { display: grid; gap: 4px; flex: 1; min-width: 0; }
.card b { font: 700 22px/1.05 var(--head); letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 2px 6px #000c; }
.card small { color: var(--ink-2); font-size: 13px; text-shadow: 0 1px 4px #000; }
.card .go { font: 300 32px/1 var(--head); color: var(--ink-2); transition: color .15s, transform .15s; }
.card:hover:not(:disabled) .go { color: var(--copper-hi); transform: translateX(3px); }
.card .tag { font: 700 10px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--copper-hi);
  border: 1px solid rgba(217, 142, 63, .6); padding: 3px 7px; background: #000a; }
.card.soon { cursor: default; }
.card.soon b, .card.soon small { opacity: .62; }
.card.slim { min-height: 0; padding: 10px 18px; }
.card.slim b { font-size: 16px; }

.m-title { align-self: start; text-align: center; padding-top: 2vh; pointer-events: none; text-shadow: 0 3px 16px #000c; }
.m-weather { font: 600 13px var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.m-biglogo { display: block; width: min(520px, 100%); height: auto; margin: 10px auto 0; filter: drop-shadow(0 6px 18px #000c); }

/* ---------------------------------------------------------------- the title screen: logo, one button, the city */
#title { position: fixed; inset: 0; z-index: 7; display: grid; grid-template-rows: 1fr auto; padding: 16px 16px 34px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(10, 11, 13, .55) 0%, rgba(10, 11, 13, 0) 70%),
    linear-gradient(180deg, rgba(10, 11, 13, .85) 0%, rgba(10, 11, 13, 0) 22%, rgba(10, 11, 13, 0) 72%, rgba(10, 11, 13, .9) 100%);
  animation: menuin .8s ease-out; }
#title::before, #title::after { content: ''; position: absolute; left: 0; right: 0; height: 6vh; background: #000; pointer-events: none; }
#title::before { top: 0; } #title::after { bottom: 0; }
#title .t-mid { align-self: start; padding-top: 11vh; display: grid; justify-items: center; gap: clamp(18px, 3.6vh, 34px); text-align: center; z-index: 1; }
.t-logo { width: min(900px, 90vw); height: auto; filter: drop-shadow(0 8px 26px #000d); }
#play { --cut: 14px; position: relative; min-width: min(340px, 80vw); padding: 18px 48px; cursor: pointer; border: 0;
  font: 800 clamp(22px, 2.6vw, 30px)/1 var(--head); letter-spacing: .3em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, var(--copper-hi) 0%, var(--copper) 45%, var(--copper-lo) 100%);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  text-shadow: 0 2px 4px #0008; box-shadow: 0 0 30px var(--glow); transition: filter .15s, transform .15s; }
#play span { padding-left: .3em; }
#play:hover, #play:focus-visible { filter: brightness(1.12); transform: scale(1.03); outline: none; }
#titlenote { min-height: 18px; font: 600 14px var(--head); letter-spacing: .12em; color: var(--ink-2); text-shadow: 0 1px 6px #000; }
#titlenote .dot { margin-right: 8px; vertical-align: middle; }
.t-foot { justify-self: center; z-index: 1; color: var(--ink-3); font-size: 13px; }
.m-title i { display: block; width: 64px; height: 3px; margin: 12px auto 0; background: linear-gradient(90deg, var(--copper-lo), var(--copper-hi));
  box-shadow: 0 0 10px var(--glow); }

.panel { padding: 14px 16px 16px; }
.panel h3 { margin: 0 0 10px; font: 700 13px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  display: flex; align-items: center; gap: 10px; }
.panel h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217, 142, 63, .6), transparent); }
.panel .hint { margin: 7px 0 0; font-size: 12px; color: var(--ink-3); }
.m-players { list-style: none; margin: 0; padding: 0; max-height: 26vh; overflow-y: auto; }
.m-players li { display: flex; align-items: center; gap: 8px; line-height: 26px; font-size: 14px; }
.m-players li i { width: 10px; height: 10px; flex: none; clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 30% 100%, 0 70%); }
.m-players li small { color: var(--ink-3); margin-left: auto; }
.m-soon { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.m-soon li { display: grid; gap: 1px; padding-left: 10px; border-left: 2px solid rgba(217, 142, 63, .5); }
.m-soon b { font: 700 14px var(--head); letter-spacing: .04em; }
.m-soon span { font-size: 12px; color: var(--ink-3); }

.m-editor { width: min(520px, 100%); }
.m-note { width: min(520px, 100%); font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.m-note p { margin: 0 0 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.row.end { justify-content: flex-end; margin-top: 16px; }
.seg { display: flex; border: 1px solid var(--line); flex-wrap: wrap; }
.seg.wrap { max-width: 330px; justify-content: flex-end; }
.seg button { background: #0005; border: 0; padding: 6px 11px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: linear-gradient(180deg, var(--copper), var(--copper-lo)); color: #fff; text-shadow: 0 1px 2px #0006; }
.sw { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 330px; }
.sw button { width: 24px; height: 24px; border: 1px solid #ffffff33; cursor: pointer; padding: 0;
  clip-path: polygon(0 0, 75% 0, 100% 25%, 100% 100%, 25% 100%, 0 75%); }
.sw button.on { outline: 2px solid var(--copper-hi); outline-offset: -2px; box-shadow: inset 0 0 0 2px #000; }
.btn { font: 700 13px var(--head); letter-spacing: .08em; text-transform: uppercase; color: #fff; cursor: pointer; border: 0;
  padding: 9px 16px; background: linear-gradient(180deg, var(--copper), var(--copper-lo));
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.btn.ghost { background: #ffffff1a; color: var(--ink-2); }
#menuname { width: 220px; font: 600 15px var(--head); color: var(--ink); background: #0006; border: 1px solid var(--line);
  border-bottom: 2px solid var(--copper); padding: 6px 9px; outline: none; user-select: text; }
#setsens { width: 200px; accent-color: var(--copper); }
.keys { display: grid; grid-template-columns: 1fr; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.keys div { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); line-height: 26px; }
.keys div span { margin-right: 10px; }
.m-foot { display: flex; gap: 22px; color: var(--ink-3); font-size: 13px; }

@media (max-width: 1100px) {
  .m-page { grid-template-columns: minmax(0, 1fr); }
  .m-side { grid-column: auto; }
  .m-title { display: none; }
  .m-cards { max-width: 600px; }
  #menu { background: linear-gradient(180deg, rgba(10, 11, 13, .6), rgba(10, 11, 13, .88)); }
}
@media (max-width: 700px) {
  .m-bar { flex-wrap: wrap; gap: 8px; }
  /* the tabs on a row of their own, scrolled sideways with a finger when they do not fit */
  .m-tabs { order: 3; flex: 1 1 100%; width: 100%; touch-action: pan-x; }
  .m-tabs button { font-size: 13px; letter-spacing: .06em; }
  .m-who { margin-left: auto; }
  .m-chip { display: none; }
  .card { min-height: 74px; }
  .card b { font-size: 18px; }
  .m-foot { display: none; }
  .row { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- driving HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
/* shade behind the corners that carry the logo and the dial, so the steel letters read on a bright sky */
#hud::before { content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 420px 260px at 0 0, rgba(8, 9, 11, .62), rgba(8, 9, 11, 0) 100%),
              radial-gradient(ellipse 300px 260px at 100% 100%, rgba(8, 9, 11, .45), rgba(8, 9, 11, 0) 100%); }
#tl { position: absolute; left: 16px; top: 14px; display: grid; gap: 8px; justify-items: start; width: 250px; }
.hudlogo { width: 230px; height: auto; filter: drop-shadow(0 0 1px #000) drop-shadow(0 2px 8px #000e) brightness(1.15); }
#where { --cut: 7px; padding: 6px 11px 6px 10px; color: var(--ink-2); max-width: min(330px, 62vw); box-sizing: border-box; }
#where .loc-stop { display: flex; align-items: center; gap: 7px; min-width: 0; font: 600 14px var(--head); color: var(--ink); letter-spacing: .01em; }
#where .loc-stop.none { font-weight: 500; color: var(--ink-2); }
#where .loc-stop.none .loc-bus { opacity: .45; }
#where .loc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* a small bus, drawn in CSS: body, windows, wheels */
#where .loc-bus { flex: none; width: 15px; height: 12px; border-radius: 3px 3px 2px 2px; background: var(--copper-hi);
  position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
#where .loc-bus::before { content: ''; position: absolute; left: 2px; right: 2px; top: 2px; height: 4px; border-radius: 1px;
  background: var(--gun-2); }
#where .loc-bus::after { content: ''; position: absolute; left: 2px; bottom: -2px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink); box-shadow: 8px 0 0 var(--ink); }
#where .loc-dist { margin: 2px 0 0 22px; font: 500 12px var(--body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
#where .loc-dist:empty { display: none; }
#where .loc-ll { margin: 3px 0 0 22px; font: 500 10.5px var(--head); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
#stats { position: absolute; right: 16px; top: 14px; font-size: 11px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
#hint { position: absolute; left: 16px; bottom: 16px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
#hint kbd { margin-right: 0; }
#hintcar, #hintgate { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; color: var(--copper-hi); }
#hintcar[hidden], #hintgate[hidden] { display: none; }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); padding: 8px 16px; font: 600 15px var(--head);
  letter-spacing: .03em; color: var(--ink); background: linear-gradient(180deg, var(--gun-1), var(--gun-2)); border: 1px solid var(--line);
  border-top-color: rgba(246, 194, 122, .5); white-space: nowrap; }
#hint kbd + kbd, #hint kbd:not(:first-child) { margin-left: 8px; }

/* the speed: a steel dial, copper as far as the speed goes, the number in warm steel. Only while the player drives
   (body[data-mode="drive"], set from the player's state in src/main.js): on foot it is gone */
#speed { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  width: 168px; height: 168px; display: grid; place-items: center; }
body:not([data-mode="drive"]) #speed { display: none; }
#gauge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 8px #000a); }
#gauge .face { fill: rgba(12, 14, 17, .58); stroke: rgba(207, 213, 218, .12); stroke-width: 1; }
#gauge .track { fill: none; stroke: rgba(20, 22, 26, .78); stroke-width: 15; stroke-linecap: butt; }
#gauge .fill { fill: none; stroke: url(#gcopper); stroke-width: 9; filter: drop-shadow(0 0 5px rgba(229, 155, 60, .7)); transition: stroke-dasharray .08s linear; }
#gauge .tick { stroke: var(--ink-2); stroke-width: 1.5; opacity: .7; }
#gauge .tick.major { stroke: var(--ink); stroke-width: 2.4; opacity: .95; }
#gauge text { fill: var(--ink-2); font: 600 11px var(--head); text-anchor: middle; dominant-baseline: middle; }
/* the number: a fixed box three digits wide, centred, with digits of one width, so 0, 9, 10 and 100 stand in one place */
#speed b { position: relative; margin-top: 2px; width: 3ch; text-align: center; font: 800 40px/1 var(--head);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  background: linear-gradient(180deg, #ffffff 10%, #cdd3d8 52%, #8b939b 54%, #e8d2b4 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 2px 3px #000c); }
#speed .unit { position: absolute; bottom: 44px; font: 600 10px var(--head); letter-spacing: .16em; color: var(--copper-hi); opacity: .85;
  text-transform: uppercase; }

#help { position: fixed; left: 16px; bottom: 44px; padding: 10px 14px; font-size: 13px; line-height: 1.75; z-index: 4; }
#help b { font: 700 13px var(--head); letter-spacing: .1em; text-transform: uppercase; }

/* the menu's МЭДЭЭЛЭЛ page: the data and licences */
.m-about { max-width: min(640px, 100%); font-size: 14px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
/* the menu and the title screen have their own buttons: the driving pad is not over them */
body[data-mode="menu"] #touch { display: none; }
.m-about a, .m-note a:not(.btn) { color: var(--copper-hi); }
.m-note a.btn { display: inline-block; text-decoration: none; }

/* ---------------------------------------------------------------- players panel */
#mp { --cut: 10px; pointer-events: auto; width: 250px; padding: 8px 10px; font-size: 13px; }
#mp .head { display: flex; align-items: center; gap: 7px; }
#mptitle { flex: 1; font: 700 13px var(--head); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mp button { font: 700 11px var(--head); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #0006;
  background: linear-gradient(180deg, var(--copper), var(--copper-lo)); border: 0; padding: 5px 8px; cursor: pointer; flex: none;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
#mp button.plain { background: #ffffff1c; padding: 2px 7px; margin-left: 6px; }
#mproom { margin-top: 5px; font-size: 12px; color: var(--ink-2); }
#mplist { list-style: none; margin: 6px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; }
#mplist li { display: flex; align-items: center; gap: 7px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#mplist li[data-id]:hover { color: var(--copper-hi); }
#mplist li i { width: 10px; height: 10px; flex: none; clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 30% 100%, 0 70%); }
#mplist li small { color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
#mplist input { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: #0005; border: 1px solid var(--line);
  border-bottom-color: var(--copper); padding: 0 5px; line-height: 20px; user-select: text; outline: none; }
#mptoast { margin-top: 6px; font-size: 12px; color: var(--copper-hi); word-break: break-all; user-select: text; }

/* ---------------------------------------------------------------- the delivery game */
#tr { position: absolute; right: 16px; top: 34px; width: 310px; display: grid; gap: 8px; justify-items: end; }
#wallet { display: flex; align-items: baseline; gap: 10px; font: 800 22px var(--head); letter-spacing: .02em; text-shadow: 0 2px 6px #000c;
  color: #9ee6b5; font-variant-numeric: tabular-nums; }
#wallet small { font: 600 12px var(--head); color: var(--ink-2); letter-spacing: .06em; }
.neg { color: #ff7a66 !important; }
#job { --cut: 10px; width: 100%; font-size: 13px; padding: 10px 12px 12px; }
.j-head { display: flex; align-items: center; gap: 10px; }
.j-head b { font: 800 18px var(--head); color: var(--ink); }
.j-time { margin-left: auto; font: 800 22px var(--head); font-variant-numeric: tabular-nums; color: var(--ink); }
.j-time.warn { color: var(--copper-hi); } .j-time.late { color: #ff7a66; }
.j-step { margin-top: 6px; color: var(--ink-2); line-height: 1.4; }
.j-step b { color: var(--copper-hi); font-family: var(--head); margin-right: 4px; }
.j-warn { margin-top: 6px; color: #ffb199; font-size: 12px; }
.j-here { margin-top: 8px; padding: 5px 8px; border-left: 3px solid var(--c); background: #0006; font: 600 13px var(--head); }
.o-cargo { font: 700 10px var(--head); letter-spacing: .1em; text-transform: uppercase; padding: 3px 6px; border: 1px solid currentColor; }
.c-hot { color: #ff9d6b; } .c-fragile { color: #8fd3ff; } .c-heavy { color: #e2c36f; } .c-plain { color: var(--ink-2); } .c-urgent { color: #ff7a9a; }
.o-park { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; color: var(--ink-2); }
.o-park li { display: flex; align-items: center; gap: 7px; }
.o-park i { width: 10px; height: 10px; flex: none; }
.o-park b { color: var(--ink); }
#minimap { position: absolute; left: 16px; bottom: 44px; width: 190px; height: 190px; border-radius: 50%;
  filter: drop-shadow(0 4px 12px #000a); }

#board { --cut: 14px; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px 18px 14px; animation: menuin .25s ease-out; }
.b-head { display: flex; align-items: center; gap: 16px; }
.b-head h2 { margin: 0; flex: 1; font: 800 22px var(--head); letter-spacing: .1em; text-transform: uppercase; }
.b-wallet { font-size: 13px; color: var(--ink-2); } .b-wallet b { color: #9ee6b5; font: 800 16px var(--head); }
.b-x { background: none; border: 0; color: var(--ink-2); font-size: 18px; cursor: pointer; }
.b-note, .b-wait { color: var(--copper-hi); font-size: 13px; margin: 10px 0 0; }
.b-cur { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.b-cur .btn { margin-left: auto; padding: 6px 12px; }
.b-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.offer { --cut: 10px; display: grid; gap: 6px; align-content: start; text-align: left; padding: 12px 14px; cursor: pointer;
  background: linear-gradient(180deg, #23272dee, #15181ccc); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: border-color .15s, transform .15s; }
.offer:hover, .offer:focus-visible { border-color: rgba(246, 194, 122, .7); transform: translateY(-2px); outline: none; }
.o-top { display: flex; align-items: center; gap: 10px; }
.o-top b { font: 800 26px var(--head); color: #9ee6b5; flex: 1; }
.o-shop { font: 700 16px var(--head); color: var(--ink); } .o-shop small { color: var(--ink-3); font: 400 12px var(--body); margin-left: 4px; }
.o-to { font-size: 14px; color: var(--ink); }
.o-row { font-size: 12px; color: var(--ink-2); line-height: 1.45; } .o-row b { color: var(--ink); }
.o-row.dim { color: var(--ink-3); }
.b-foot { display: flex; align-items: center; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.b-foot .btn { margin-left: auto; }

#doorbox { --cut: 12px; position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 6; width: min(420px, calc(100vw - 32px));
  display: grid; gap: 8px; padding: 14px 16px; }
#doorbox b { font: 800 18px var(--head); } #doorbox p { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; }
#doorbox .btn { text-align: left; text-transform: none; letter-spacing: .02em; font-size: 14px; }
#summary { --cut: 12px; position: fixed; right: 16px; top: 34%; z-index: 5; width: 300px; padding: 12px 16px 12px; pointer-events: none;
  animation: menuin .3s ease-out; }
#summary h3 { margin: 0 0 8px; font: 800 15px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--copper-hi); }
#summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
#summary li, .s-net { display: flex; justify-content: space-between; gap: 10px; }
#summary li b { color: #9ee6b5; font-variant-numeric: tabular-nums; }
.s-net { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font: 800 18px var(--head); }
.s-net b { color: #9ee6b5; }
#summary small { display: block; margin-top: 8px; color: var(--ink-3); font-size: 12px; }

@media (max-width: 900px) {
  .b-offers { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- touch */
/* the safe area: notches and the home bar (viewport-fit=cover) */
#touch { --sl: env(safe-area-inset-left); --sr: env(safe-area-inset-right); --sb: env(safe-area-inset-bottom); --st: env(safe-area-inset-top); }
#touch .pad { position: fixed; bottom: calc(18px + var(--sb)); display: flex; gap: 12px; }
#touch .left { left: calc(16px + var(--sl)); }
#touch .right { right: calc(16px + var(--sr)); }
body:not([data-mode="drive"]) #touch .drive-only, body:not([data-mode="foot"]) #touch .foot-only { display: none; }
#touch button { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid rgba(217, 142, 63, .6);
  background: radial-gradient(circle at 50% 35%, #2c2f35cc, #15171acc); color: var(--ink); font-size: 24px; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; padding: 0; }
/* the icon is only a picture: the finger always lands on the button */
#touch button i { font-style: normal; pointer-events: none; -webkit-user-drag: none; display: block; line-height: 1; }
#touch button.on { background: radial-gradient(circle, var(--copper), var(--copper-lo)); box-shadow: 0 0 14px var(--glow); }
#touch .foot-only button { border-color: rgba(170, 178, 186, .55); }
#touch .menubtn { position: fixed; right: calc(16px + var(--sr)); top: calc(12px + var(--st)); width: 44px; height: 44px; font-size: 20px; z-index: 5; }
#touch .carbtn { position: fixed; right: calc(16px + var(--sr)); bottom: calc(104px + var(--sb)); width: 56px; height: 56px; font-size: 22px; }

@media (max-width: 600px), (pointer: coarse) {
  #help, #hint { display: none; }
  .hudlogo { width: 160px; }
  #tl { width: 200px; }
  #mp { width: 224px; font-size: 12px; } #mplist { max-height: 22vh; }
  #mp .head button { font-size: 10px; padding: 4px 6px; letter-spacing: .03em; }
  /* under the menu button, clear of the pedals and the car and order buttons */
  #speed { width: 104px; height: 104px; right: calc(12px + env(safe-area-inset-right)); bottom: auto; top: calc(64px + env(safe-area-inset-top)); }
  #speed b { font-size: 26px; } #speed .unit { bottom: 24px; font-size: 8px; letter-spacing: .12em; }
  #gauge text { display: none; }
  #stats { display: none; }
  #tr { top: 200px; right: 12px; width: min(280px, 60vw); }
  #wallet { font-size: 17px; }
  #minimap { width: 120px; height: 120px; left: 12px; bottom: 104px; }
  #summary { top: auto; bottom: 110px; right: 12px; width: min(280px, 70vw); }
}
#touch .jobsbtn { position: fixed; right: calc(16px + var(--sr)); bottom: calc(170px + var(--sb)); width: 56px; height: 56px; font-size: 22px; }
/* a yard gate within reach: its button, over the car button (shown only then) */
#touch .usebtn { position: fixed; right: calc(16px + var(--sr)); bottom: calc(236px + var(--sb)); width: 56px; height: 56px; font-size: 24px;
  border-color: rgba(246, 194, 122, .9); }
/* a phone on its side: little height. The dial goes left of the menu button at the top, the car and order buttons
   beside the pedals, so nothing stands on the road ahead or on another button */
@media (pointer: coarse) and (max-height: 500px) {
  #speed { width: 88px; height: 88px; top: calc(8px + env(safe-area-inset-top)); right: calc(70px + env(safe-area-inset-right)); }
  #speed b { font-size: 22px; } #speed .unit { bottom: 19px; font-size: 7px; }
  #touch button { width: 62px; height: 62px; font-size: 21px; }
  #touch .carbtn { bottom: calc(14px + var(--sb)); right: calc(170px + var(--sr)); width: 50px; height: 50px; }
  #touch .jobsbtn { bottom: calc(14px + var(--sb)); right: calc(226px + var(--sr)); width: 50px; height: 50px; }
  #tr { top: 104px; }
  #minimap { bottom: 92px; width: 96px; height: 96px; }
}
