/* app/map/map.css: the overview map's page (Slopcouver ISO Main, 7 Nov 2026). Phone first: the map fills the screen,
   nothing scrolls sideways, the controls clear the notch and the home bar. */
:root {
  --bg: #e9e4da; --ink: #1d232b; --muted: #5c6670; --card: rgba(255, 255, 255, .96); --accent: #0f6d8c; --accent-ink: #fff;
  --ok: #2d7a3c; --warn: #a3551b; --line: rgba(0, 0, 0, .14); --shadow: 0 2px 10px rgba(0, 0, 0, .22);
  --top: max(10px, env(safe-area-inset-top)); --bottom: max(10px, env(safe-area-inset-bottom));
  --left: max(12px, env(safe-area-inset-left)); --right: max(12px, env(safe-area-inset-right));
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15191e; --ink: #e8ecef; --muted: #9aa5ae; --card: rgba(28, 33, 39, .96); --accent: #5ec2e2; --accent-ink: #062530;
    --ok: #7bd08a; --warn: #f0a868; --line: rgba(255, 255, 255, .16); }
}
* { box-sizing: border-box; }
/* manipulation: no double-tap zoom of the page itself (the map zooms itself; review 8 Nov) */
html { touch-action: manipulation; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* clip, not hidden: a hidden box still scrolls when a pin outside it takes focus (review 8 Nov) */
#map { position: fixed; inset: 0; overflow: hidden; overflow: clip; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; }
#map.drag { cursor: grabbing; }
#map img { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; -webkit-user-drag: none;
  transition: opacity .18s; max-width: none; }

.pin { position: absolute; left: 0; top: 0; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; font: inherit;
  touch-action: manipulation; }
.pin span { display: block; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12px;
  padding: 4px 9px; border-radius: 12px; white-space: nowrap; box-shadow: var(--shadow); }
.pin::after { content: ""; display: block; width: 2px; height: 14px; margin: 0 auto; background: var(--accent); }
/* a pin whose label would cover another: a dot on its stalk (tap it for the card) */
.pin { z-index: 2; }
.pin.dot { z-index: 1; padding: 8px 10px 0; } /* a bigger target for a finger; the stalk's foot stays on the place */
.pin.dot span { display: none; }
.pin.dot::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: var(--shadow); }
.pin.dot::after { height: 8px; }
.pin:focus-visible span, .pin.on span { outline: 2px solid #fff; outline-offset: 1px; filter: brightness(.82); }

.bar { position: fixed; top: var(--top); left: var(--left); right: var(--right); display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; pointer-events: none; }
.bar > * { pointer-events: auto; }
.home { font-weight: 700; color: var(--ink); text-decoration: none; background: var(--card); padding: 7px 12px; border-radius: 10px;
  box-shadow: var(--shadow); }
.pick { min-width: 0; flex: 0 1 auto; }
/* 16 px: iOS zooms the page into a smaller select on focus and leaves it zoomed (review 8 Nov) */
.pick select { font: inherit; font-size: 16px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); box-shadow: var(--shadow); max-width: min(62vw, 300px); }

.turn { position: fixed; right: var(--right); bottom: calc(var(--bottom) + 30px + 104px); display: flex; flex-direction: column; gap: 8px; }
.turn button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }
.turn button[hidden] { display: none; }
#compass { border-radius: 50%; }
#compass .needle { display: inline-block; font-size: 13px; font-weight: 800; color: #c0392b; transition: transform .25s; }
#compass .needle::before { content: "▲"; display: block; font-size: 10px; line-height: 1; margin-bottom: -1px; }
.zoom { position: fixed; right: var(--right); bottom: calc(var(--bottom) + 30px); display: flex; flex-direction: column; gap: 8px; }
.zoom button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }

#card { position: fixed; left: var(--left); bottom: calc(var(--bottom) + 30px); width: min(360px, calc(100vw - 88px)); background: var(--card);
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 4px 18px rgba(0, 0, 0, .28); }
#card[hidden] { display: none; }
#card h2 { margin: 0 28px 4px 0; font-size: 17px; }
#card .blurb { margin: 0 0 12px; color: var(--muted); }
#card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#card a.go { background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 10px 16px; border-radius: 10px; }
#card .state { font-size: 12px; }
#card .state.safe { color: var(--ok); } #card .state.unsafe { color: var(--warn); }
#card .x { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted);
  font-size: 22px; cursor: pointer; }

.foot { position: fixed; left: var(--left); right: calc(var(--right) + 56px); bottom: var(--bottom); display: flex; gap: 10px;
  align-items: center; font-size: 11px; color: var(--muted); pointer-events: none; min-width: 0; }
.foot > * { pointer-events: auto; }
.foot button { font: inherit; font-size: 12px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 9px; cursor: pointer; white-space: nowrap; }
.foot .credit .short { display: none; }
.foot .credit a, .foot .credit .linkish { color: inherit; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.foot .credit .linkish { font-size: 11px; border: 0; background: none; padding: 0; }
.foot .credit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 3px var(--bg); }

#about { max-width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 18px 20px; background: var(--card);
  color: var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
#about::backdrop { background: rgba(0, 0, 0, .35); }
#about h2 { margin: 0 0 8px; font-size: 18px; }
#about p { margin: 0 0 10px; }
#about .sources, #about .build { font-size: 12px; color: var(--muted); }
#about a { color: var(--accent); }
#about button { font: inherit; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--accent);
  color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.noscript { position: fixed; inset: 40% 16px auto; text-align: center; }
/* one notice at a time (a failed turn, say), replaced by the next, gone after a few seconds */
#notice { position: fixed; left: 50%; top: calc(var(--top) + 96px); transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 14px; }
#notice[hidden] { display: none; }

@media (max-width: 480px) {
  .home { padding: 7px 10px; }
  .foot .credit .long { display: none; }
  .foot .credit .short { display: inline; }
  #card { width: calc(100vw - var(--left) - var(--right) - 56px); }
}
