/* Stroll: the street fills the screen; a warm paper-and-ink chrome sits on top like a pocket map. */
:root {
  --ink: #14110f;
  --glass: rgba(20, 17, 15, .82);
  --glass-2: rgba(255, 255, 255, .07);
  --fg: #f6f1e7;
  --muted: #b3aa9c;
  --line: rgba(255, 255, 255, .14);
  --accent: #f2c14e;
  --accent-ink: #2b1f00;
  --pin: #e2553c;
  --good: #7fd6a4;
  --display: "Fraunces", Georgia, serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--fg); font: 15px/1.5 var(--body); overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#pano { position: fixed; inset: 0; background: var(--ink); }
.pnlm-container { background: var(--ink) !important; }
.pnlm-load-box, .pnlm-about-msg, .pnlm-controls-container { display: none !important; }
.pnlm-compass { top: auto !important; bottom: calc(24px + var(--safe-b)); left: 14px; right: auto !important; }

.loading { position: fixed; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--ink); color: var(--muted); }
.loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading span { animation: none; } }

/* top bar */
.top { position: fixed; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.top > * { pointer-events: auto; }
.brand { background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 5px 15px; font: 700 1.15rem var(--display); cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.meter { display: flex; gap: 6px; }
.meter span { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; text-align: right; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.meter small { display: block; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.meter b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* the pocket map: a corner card on desktop that grows on hover, a sheet on phones */
.guessbox { position: fixed; z-index: 6; right: 16px; bottom: calc(16px + var(--safe-b)); width: 300px; display: grid; gap: 8px; transition: width .2s ease; }
.guessbox:hover, .guessbox.big { width: min(560px, calc(100vw - 32px)); }
#map { height: 200px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: height .2s ease; }
.guessbox:hover #map, .guessbox.big #map { height: min(400px, 60vh); }
.map-toggle { display: none; }
@media (max-width: 759px) {
  .guessbox { left: 0; right: 0; bottom: 0; width: auto; padding: 10px 10px calc(10px + var(--safe-b)); background: var(--glass); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .guessbox:hover, .guessbox.big { width: auto; }
  #map { display: none; height: 52vh; }
  .guessbox.big #map { display: block; height: 52vh; }
  .guessbox:not(.big) .guess-row { display: none; }
  .map-toggle { display: block; width: 100%; border: 0; border-radius: 999px; padding: 13px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
  .guessbox.big .map-toggle { background: var(--glass-2); color: var(--fg); border: 1px solid var(--line); }
}
.maplibregl-canvas { cursor: crosshair; }
.maplibregl-ctrl-attrib { display: none; }

.go { display: block; width: 100%; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); padding: 13px 16px; font-weight: 700; font-size: 1rem; cursor: pointer; }
.go:disabled { background: var(--glass); color: var(--muted); cursor: default; font-weight: 600; border: 1px solid var(--line); }
.go.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.go small { opacity: .7; margin-left: 4px; font-weight: 600; }

/* result: the map takes the whole screen, a card sits at the bottom */
.result { position: fixed; inset: 0; z-index: 7; pointer-events: none; display: grid; align-items: end; justify-items: center; padding: 16px 16px calc(16px + var(--safe-b)); }
.result-card { pointer-events: auto; width: 100%; max-width: 440px; max-height: calc(100vh - 90px); overflow-y: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; gap: 6px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pts { display: flex; align-items: baseline; gap: 8px; }
.pts b { font: 700 2.4rem/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.pts span, .dist { color: var(--muted); }
.dist { margin: 0; }
.place { margin: 4px 0 0; display: grid; border-top: 1px solid var(--line); padding-top: 8px; }
.place b { font-size: 1.05rem; }
.place span { color: var(--muted); }
.credit-line { margin: 0 0 6px; font-size: .74rem; color: var(--muted); }
.credit-line a { color: inherit; }
body.revealing .guessbox { left: 0; top: 0; right: 0; bottom: 0; width: auto; padding: 0; background: none; border: 0; }
body.revealing #map { display: block; height: 100%; border-radius: 0; border: 0; }
body.revealing .guess-row, body.revealing .map-toggle { display: none; }

/* start and end */
.screen { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: linear-gradient(180deg, rgba(20, 17, 15, .35), rgba(20, 17, 15, .85)); overflow: auto; }
.card { width: 100%; max-width: 440px; background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 24px; display: grid; gap: 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: relative; }
h1 { margin: 0; font: 700 3.2rem/1 var(--display); letter-spacing: -.01em; }
.lede { margin: 0; color: #e6dfd2; font-size: 1.05rem; }
.how { margin: 4px 0 0; padding-left: 1.2em; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; }
.fine { margin: 0; color: var(--muted); font-size: .78rem; }
.done { margin: -4px 0 0; color: var(--good); font-size: .9rem; }
.lang-switch { position: absolute; top: 16px; right: 16px; display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch button { border: 0; background: transparent; border-radius: 999px; padding: 3px 9px; font-size: .72rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang-switch button.on { background: var(--glass-2); color: var(--fg); }
.kicker { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.total { font: 700 3.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.of { margin: -6px 0 0; color: var(--muted); }
.summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.summary li { display: grid; grid-template-columns: 1.4em 1fr auto; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 6px; font-size: .92rem; }
.summary li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary li small { color: var(--muted); }
.summary li b { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; }
.row .go { flex: 1; }

.toast { position: fixed; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .9rem; max-width: calc(100% - 32px); text-align: center; }

.credit { position: fixed; left: 8px; bottom: 2px; z-index: 4; font-size: .64rem; color: rgba(255, 255, 255, .6); text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.credit a { color: inherit; }
@media (max-width: 759px) { .credit { bottom: auto; top: calc(58px + var(--safe-t)); left: auto; right: 8px; } }

/* map markers */
.pin { width: 26px; height: 34px; }
.pin svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45)); }
.answer { width: 22px; height: 22px; border-radius: 50%; background: var(--good); border: 3px solid var(--ink); box-shadow: 0 0 0 6px rgba(127, 214, 164, .3); }

/* after a guess: a little history of the place, and the same spot in other years */
.about { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.about b { font: 600 1rem var(--display); }
.about p { margin: 0; color: #e6dfd2; font-size: .9rem; line-height: 1.45; }
.about a { font-size: .82rem; width: fit-content; }
.years { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.years > span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.year-list { display: flex; flex-wrap: wrap; gap: 6px; }
.year-list button { border: 1px solid var(--line); background: var(--glass-2); color: var(--fg); border-radius: 999px; padding: 5px 13px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.year-list button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.timebar { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(440px, calc(100% - 32px)); background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: grid; gap: 8px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.timebar .year-list { justify-content: center; }
body.looking .result, body.looking .guessbox { display: none !important; }
