/* The city page (city.html). The room page's styles are in style.css. */
:root { --fg: #f4f1ea; --ink: #0a1033; --sun: #ffe14a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d0d0f; color: var(--fg);
  font: 14px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
canvas { display: block; touch-action: none; }
#hud, #help, #status, #credit { position: fixed; z-index: 5; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
/* Speed and street: top left, the developer line's corner in the room page. */
#hud { left: calc(12px + env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top)); font-weight: 700; }
#speed { display: inline-block; min-width: 2.2ch; font: 900 30px/1 ui-sans-serif, system-ui, sans-serif; text-align: right; }
#street { font-weight: 800; font-size: 16px; }
#near { font-weight: 600; opacity: .9; }
/* The map: top right, left of the pause button; on a phone smaller. */
#map { position: fixed; z-index: 5; top: calc(10px + env(safe-area-inset-top)); right: calc(68px + env(safe-area-inset-right)); width: 170px; height: 170px;
  border: 3px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
body.touch #map { width: 120px; height: 120px; }
/* Pause: top right on every screen, 48 px, as the room's (AGENTS.md). The menu over the city is menu.css with the
   room's colours (DESIGN.md); the city goes on behind it. Settings opens the right-hand panel, else one column. */
#btn-pause { position: fixed; z-index: 8; top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: rgba(27,42,99,.72); color: #fff; font: 800 14px Rubik, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
#overlay { --navy: #1B2A63; --sun: #FFC21A; --ink: #0B1029; --shadow: 0 10px 28px rgba(11,16,41,.4); font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
#overlay:not(.settings) .main { display: none; }
#overlay:not(.settings) .menu { grid-template-columns: 1fr; width: min(260px, 100%); }
#panel-options { display: grid; gap: 6px; }
/* The big map: the whole piece, over the page. */
#bigmap { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(8,14,70,.55); cursor: pointer; }
#bigmap.hidden { display: none; }
#bigmap canvas { width: min(92vw, 92vh - 30px); height: min(92vw, 92vh - 30px); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); }
#bigmap div { position: absolute; bottom: 6px; font-weight: 700; }
#bigmap canvas { cursor: crosshair; touch-action: none; }
#bigmap button { position: absolute; right: calc(50% - min(46vw, 46vh - 15px) + 12px); width: 48px; height: 48px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink);
  font: 900 24px/1 ui-sans-serif, system-ui, sans-serif; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
#map-in { top: calc(50% - min(46vw, 46vh - 15px) + 12px); }
#map-out { top: calc(50% - min(46vw, 46vh - 15px) + 68px); }
/* Where the way leads and how far: top middle. A click or tap on it stops following. */
#nav { position: fixed; z-index: 6; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); min-height: 48px; max-width: 46vw; padding: 0 18px;
  border: 3px solid var(--ink); border-radius: 999px; background: #2f6bff; color: #fff; font: 800 15px ui-sans-serif, system-ui, sans-serif;
  box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#nav:empty { display: none; }
#help { left: 12px; bottom: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 8px 10px;
  border-radius: 10px; background: rgba(10,16,51,.55); font-size: 12px; text-shadow: none; }
kbd { font: 11px ui-monospace, monospace; padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(255,255,255,.4); white-space: nowrap; }
#status { left: 50%; top: 45%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(10,16,51,.7); text-shadow: none; }
#status:empty { display: none; }
#credit { right: 8px; bottom: 4px; font-size: 10px; opacity: .8; }

/* Touch buttons: shown from the first touch (body.touch, set in src/city/input.js). 64 px, 12 px apart, inside the safe area. */
#drive { display: none; position: fixed; inset: 0; z-index: 7; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.touch #drive { display: block; }
body.touch .mouse-only, body.touch #help { display: none; }   /* #help: its own display wins over the class */
#drive .left, #drive .right { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 12px; }
#drive .left { left: calc(18px + env(safe-area-inset-left)); }
#drive .right { right: calc(18px + env(safe-area-inset-right)); }
#drive button { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(10,16,51,.45);
  color: var(--fg); font: 800 14px ui-sans-serif, system-ui, sans-serif; pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; }
#drive button:active { background: var(--sun); color: var(--ink); }
body.touch #credit { bottom: auto; top: calc(4px + env(safe-area-inset-top)); right: 50%; transform: translateX(50%); }
/* an upright phone: the street wraps short of the map, the credit sits above the buttons */
body.touch #hud { max-width: calc(100vw - 250px - env(safe-area-inset-right)); }
@media (orientation: portrait) { body.touch #credit { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); width: 90vw; text-align: center; } }
