/* GeoBarkr · Fog. Cool grey paper, ink buttons, your pin in ember; other
   players get their own colours. Street View fills the game screens and the
   map pops out of a bubble. Mobile first. Design notes: docs/DESIGN.md. */

:root {
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --line: #DDE2E8;
  --text: #0E1726;
  --muted: #5E6B7D;
  --primary: #0E1726;
  --primary-ink: #FFFFFF;
  --me: #F26A3D;
  --water: #D3DEEA;
  --land: #F7F8FA;
  --coast: #BFCAD6;
  --grid: rgba(14, 23, 38, 0.05);
  --danger: #D93B3B;
  --soft: #EDF0F3;
  --link: #2F5BD3;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px;
  --r-sm: 9px;
  /* Motion and materials (docs/DESIGN.md, "Interaction"). */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --material: rgba(255, 255, 255, 0.8);
  --material-heavy: rgba(255, 255, 255, 0.96);
  --blur: blur(20px) saturate(160%);
  --edge: rgba(14, 23, 38, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
/* No pinch or double-tap zoom on the pages (the map and Street View handle
   their own pinch); text still follows the reader's text-size setting. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); touch-action: pan-x pan-y; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.1; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num, .gb-num { font-variant-numeric: tabular-nums; }
.gb-muted { color: var(--muted); }
.gb-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */

.gb-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: background-color 0.2s ease;
}
.has-band .gb-header { position: fixed; left: 0; right: 0; }
/* Content scrolls under a frosted bar; a soft edge instead of a hard rule. */
.gb-header.is-scrolled { background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.gb-header::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(rgba(14, 23, 38, 0.08), transparent); opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
.gb-header.is-scrolled::after { opacity: 1; }
.gb-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; }
.gb-brand:hover { text-decoration: none; }
.gb-mark { display: inline-flex; color: var(--text); }
.gb-header-right { display: flex; align-items: center; gap: 4px; }
.gb-me { display: inline-flex; padding: 4px; border-radius: 50%; transition: transform 0.16s var(--ease-out), box-shadow 0.2s ease; }
.gb-me:hover { text-decoration: none; }
.gb-me[aria-current="page"] .gb-av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--me); }
/* The pages, inline on wide screens; on phones they're on your profile. */
.gb-menu { display: none; }
.gb-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text); font: 500 0.9375rem var(--font); }
.gb-menu a:active { background: var(--line); }
.gb-menu a:hover { text-decoration: none; }
@media (hover: hover) { .gb-menu a:hover { background: var(--line); } }
.gb-menu a[aria-current="page"] { color: var(--primary); font-weight: 600; }
@media (min-width: 820px) { .gb-menu { display: flex; margin-right: 6px; } }

/* ---------- Avatars and pins ---------- */

.gb-av {
  --s: 28px;
  width: var(--s); height: var(--s); flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font: 700 calc(var(--s) * 0.38) / 1 var(--font);
  letter-spacing: 0.02em;
  overflow: hidden;
}
.gb-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gb-pin { position: absolute; transform: translate(-50%, -100%); padding-bottom: 7px; pointer-events: none; }
.gb-pin .gb-av { box-shadow: 0 0 0 2.5px #fff, 0 3px 10px rgba(14, 23, 38, 0.35); }
.gb-pin::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--c); border-bottom: 0;
}
@keyframes gb-drop { from { transform: translateY(-14px) scale(0.82); opacity: 0.4; } }
.gb-pin.is-dropping .gb-av { animation: gb-drop 0.3s var(--ease-out) both; }
.gb-pin.is-me .gb-av { box-shadow: 0 0 0 2.5px var(--c), 0 0 0 6px rgba(242, 106, 61, 0.3), 0 3px 10px rgba(14, 23, 38, 0.35); }
.gb-target { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; pointer-events: none; }
.gb-target svg { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 1px 3px rgba(14, 23, 38, 0.4)); }
.gb-target span {
  margin-top: 2px; padding: 3px 9px; border-radius: 6px; background: var(--text); color: #fff; box-shadow: 0 2px 8px rgba(14, 23, 38, 0.25);
  font: 700 0.8125rem var(--font); white-space: nowrap;
}

/* ---------- Pages ---------- */

.gb-page { width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.gb-page.wide { max-width: 1040px; }
.gb-title { font-size: 1.875rem; font-weight: 650; letter-spacing: -0.03em; margin: 8px 0 16px; }
.gb-lede { color: var(--muted); font-size: 1.0625rem; margin: 0 0 20px; max-width: 32em; }
.gb-label { color: var(--muted); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.01em; margin: 22px 2px 8px; }
.gb-section { margin-bottom: 28px; }

/* World-map band at the top of pages without Street View. */
.gb-band { position: relative; height: 270px; overflow: hidden; }
.gb-band.short { height: 170px; }
.gb-band .gb-world { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-band::after { content: ""; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.gb-band-caption { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.gb-band-caption .k { color: var(--muted); font-size: 0.8125rem; }
.gb-band-caption .v { font-weight: 600; }
.gb-band-caption .score { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.gb-band-caption a.score:hover { text-decoration: none; }
.gb-band-caption .score b { display: block; font-size: 1.625rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.gb-band-caption .score span { color: var(--muted); font-size: 0.8125rem; }
.gb-world-sea { fill: var(--water); }
.gb-world-land { fill: var(--land); stroke: var(--coast); }
.gb-world-grid { stroke: var(--grid); fill: none; }
@media (min-width: 900px) { .gb-band { height: 320px; } .gb-band.short { height: 200px; } }

/* ---------- Controls ---------- */

.gb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: var(--r);
  background: var(--primary); color: var(--primary-ink);
  font: 650 1.0625rem var(--font); cursor: pointer; text-decoration: none;
  transition: transform 0.18s var(--ease-out), background-color 0.2s ease, color 0.2s ease, filter 0.15s ease;
}
.gb-btn:hover { text-decoration: none; }
@media (hover: hover) { .gb-btn:hover:not(:disabled) { filter: brightness(1.07); } }
/* Feedback on press, not on release. */
.gb-btn, .gb-row, .gb-tabs button, .gb-me, .gb-expand, .gb-recentre, a.gb-line, .gb-menu a { touch-action: manipulation; }
.gb-btn:active:not(:disabled) { transform: scale(0.97); transition-duration: 0.06s; }
.gb-me:active, .gb-expand:active, .gb-recentre:active { transform: scale(0.92); }
.gb-btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; filter: none; }
.gb-btn.block { display: flex; width: 100%; }
.gb-btn.quiet { background: transparent; color: var(--text); border: 1px solid var(--line); }
.gb-btn.small { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; }
.gb-btn.google { background: #fff; color: #1f1f1f; }
.gb-btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }

.gb-input, .gb-select {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--text);
  font: 400 1.0625rem var(--font);
}
.gb-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.gb-input:focus, .gb-select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.gb-code { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; }
.gb-code::placeholder { letter-spacing: 0.1em; color: var(--muted); font-weight: 500; text-transform: none; }
.gb-field { display: block; margin-bottom: 12px; }
.gb-field > span { display: block; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.01em; margin: 0 2px 6px; }
.gb-inline { display: flex; gap: 8px; }
.gb-inline > :first-child { flex: 1; min-width: 0; }

/* Segmented control: the selected thumb slides to the option you pick. */
.gb-tabs {
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin: 0 0 14px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line);
}
.gb-tabs::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 8px; background: var(--text); box-shadow: 0 1px 5px rgba(14, 23, 38, 0.12);
  transition: transform 0.36s var(--ease-out);
}
.gb-tabs:has(button:nth-child(2)[aria-selected="true"])::before { transform: translateX(100%); }
.gb-tabs button {
  position: relative; z-index: 1; min-height: 34px; padding: 0 18px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: 600 0.875rem var(--font); cursor: pointer; transition: color 0.2s ease;
}
.gb-tabs button[aria-selected="true"] { color: var(--bg); }
@supports not selector(:has(a)) {
  .gb-tabs::before { display: none; }
  .gb-tabs button[aria-selected="true"] { background: var(--text); }
}
.gb-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8125rem; margin: 14px 0; }
.gb-or::before, .gb-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Rows: modes on the landing page, games, players. */
.gb-list { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.gb-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.gb-row:first-child { border-top: 0; }
@media (hover: hover) { .gb-row:hover { background: rgba(14, 23, 38, 0.03); } }
.gb-row:active:not(:disabled), a.gb-line:active { background: rgba(14, 23, 38, 0.06); }
.gb-row:disabled { opacity: 0.6; cursor: progress; }
.gb-row b { display: block; font-weight: 600; font-size: 1.0312rem; }
.gb-row > span > span { color: var(--muted); font-size: 0.8438rem; }
.gb-row .chev { color: var(--muted); font-size: 1.375rem; line-height: 1; }
.gb-icon { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; color: var(--text); }

.gb-lines { border-top: 1px solid var(--line); }
.gb-line { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.gb-line .grow { flex: 1; min-width: 0; }
.gb-line .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-line .grow span { color: var(--muted); font-size: 0.8125rem; }
.gb-line .end { text-align: right; font-variant-numeric: tabular-nums; }
.gb-line .end b { display: block; font-weight: 650; font-size: 1.0625rem; }
.gb-line .end span { color: var(--muted); font-size: 0.7812rem; }
.gb-line.is-me { box-shadow: inset 2px 0 0 var(--me); background: linear-gradient(90deg, rgba(242, 106, 61, 0.1), transparent 60%); padding-left: 10px; }
/* Someone just joined or guessed: their row arrives and glows briefly. */
@keyframes gb-row-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes gb-row-glow { from { background-color: rgba(242, 106, 61, 0.12); } to { background-color: transparent; } }
.gb-line.is-new { animation: gb-row-in 0.34s var(--ease-out) both, gb-row-glow 1.6s ease-out both; }
.gb-tag { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.gb-thumb { width: 96px; height: 60px; flex: none; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.gb-thumb .gb-world { width: 100%; height: 100%; display: block; }

.gb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gb-table th, .gb-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.gb-table th { color: var(--muted); font-weight: 500; font-size: 0.8125rem; }
.gb-table .r { text-align: right; white-space: nowrap; }
.gb-table .meta { display: block; color: var(--muted); font-size: 0.7812rem; }
.gb-table tr.is-me td:first-child { box-shadow: inset 2px 0 0 var(--me); }
.gb-table .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.gb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Podium */
.gb-podium { display: grid; grid-template-columns: 1fr 1.08fr 1fr; gap: 8px; align-items: end; margin-bottom: 14px; }
.gb-pod { text-align: center; padding: 14px 6px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.gb-pod .gb-av { margin-bottom: 8px; }
.gb-pod b { display: block; font-size: 1.125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.gb-pod .name { display: block; color: var(--muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-pod.first { padding-top: 20px; border-color: var(--me); }
.gb-pod .place { color: var(--primary); font-weight: 650; font-size: 0.75rem; margin-bottom: 6px; }

/* Lobby */
.gb-codecard { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 18px 18px; border-radius: 26px; background: var(--surface); box-shadow: 0 8px 26px rgba(14, 23, 38, 0.08); }
.gb-codecard-code { text-align: center; }
.gb-qr { width: 160px; flex: none; background: #fff; padding: 8px; border-radius: 14px; border: 1px solid var(--line); }
.gb-qr svg { display: block; width: 100%; height: auto; }
.gb-share { min-height: 52px; border-radius: 16px; }
.gb-btn.gb-cancel { margin-top: 10px; color: var(--danger); border-color: var(--line); }
.gb-roomcode { font-size: 2.5rem; font-weight: 650; letter-spacing: 0.12em; line-height: 1; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .gb-lobby { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
  .gb-lobby .gb-codecard { padding: 28px 24px 24px; }
  .gb-lobby .gb-qr { width: 220px; }
  .gb-lobby .gb-roomcode { font-size: 4rem; }
}

/* ---------- Game screens ---------- */

.gb-game { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.gb-topbar { flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 6; }
.gb-topbar .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gb-topbar .home-link { display: inline-flex; color: var(--text); }
.gb-topbar b { font-weight: 650; white-space: nowrap; }
.gb-topbar .right { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-topbar .right b { color: var(--text); }
.gb-steps { display: flex; gap: 4px; }
.gb-steps i { width: 16px; height: 3px; border-radius: 2px; background: var(--line); transition: background-color 0.3s ease; }
.gb-steps i.done { background: var(--text); }
.gb-steps i.now { background: var(--primary); }

.gb-sv { position: relative; flex: 1; min-height: 0; background: #070D19; }
.gb-pano { position: absolute; inset: 0; }
/* No Google Maps key yet: Leaflet maps and the keyless Street View embed (js/maps-keyless.js). */
.gb-leaflet { background: var(--water); font: inherit; }
.gb-leaflet .leaflet-container, .gb-leaflet.leaflet-container { background: var(--water); }
.gb-leaflet-icon { background: none; border: 0; }
.gb-leaflet .leaflet-control-attribution { background: rgba(255, 255, 255, 0.75); color: var(--muted); font-size: 0.625rem; }
.gb-leaflet .leaflet-control-attribution a { color: var(--muted); }
.gb-sv-embed { position: absolute; left: 0; top: -90px; width: 100%; height: calc(100% + 90px); border: 0; }
.gb-pano:has(.gb-sv-embed), .gb-sv:has(.gb-sv-embed) { overflow: hidden; }
.gb-pano-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
/* Over Street View: back-to-start top left, compass top right. */
.gb-recentre {
  position: absolute; left: 12px; top: 12px; z-index: 4;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--edge); background: var(--material); color: var(--text); cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: transform 0.16s var(--ease-out);
}

/* The guess map: a bubble in the corner of Street View that grows into a card
   (data-state: bubble | open | done). js/pages/play.js switches states. */
.gb-game.play .gb-sv { position: absolute; inset: 0; }
.gb-game.play .gb-topbar { position: absolute; top: 0; left: 0; right: 0; border-bottom: 0; background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.gb-guess {
  --bubble: 132px;
  position: absolute; z-index: 5; right: 14px; bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  background: var(--surface); box-shadow: 0 14px 40px rgba(14, 23, 38, 0.3);
  transform-origin: 100% 100%;
  transition: width 0.5s var(--ease-out), height 0.5s var(--ease-out), border-radius 0.5s var(--ease-out), padding 0.5s var(--ease-out), right 0.5s var(--ease-out);
}
.gb-guess[data-state="bubble"] { width: var(--bubble); height: var(--bubble); border-radius: 50%; padding: 0; border: 3px solid #fff; }
.gb-guess[data-state="open"] { width: calc(100% - 24px); right: 12px; height: min(640px, calc(100% - 96px)); border-radius: 28px; padding: 10px; }
.gb-guess[data-state="done"] { width: calc(100% - 24px); right: 12px; height: auto; max-height: 58%; border-radius: 28px; padding: 14px 16px 12px; }
.gb-guess-head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 4px 0 8px; }
.gb-guess-head .gb-readout { flex: 1; padding: 0; }
.gb-round-btn { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; background: var(--soft); color: var(--text); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; transition: transform 0.16s var(--ease-out); }
.gb-round-btn:active { transform: scale(0.92); }
.gb-mapbox { position: relative; flex: 1; min-height: 0; border-radius: 20px; overflow: hidden; background: var(--water); }
.gb-guess[data-state="bubble"] .gb-mapbox { border-radius: 50%; }
.gb-map { position: absolute; inset: 0; }
.gb-bubble-hit { position: absolute; inset: 0; z-index: 4; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.gb-guess:not([data-state="bubble"]) .gb-bubble-hit { display: none; }
.gb-guess[data-state="bubble"] > :not(.gb-mapbox) { display: none; }
.gb-guess[data-state="done"] .gb-mapbox, .gb-guess[data-state="done"] .gb-guess-head { display: none; }
.gb-guess[data-state="done"] .gb-actions { display: none; }
.gb-readout { display: flex; justify-content: space-between; gap: 10px; padding: 0 2px; font-size: 0.8438rem; letter-spacing: 0.01em; color: var(--muted); font-variant-numeric: tabular-nums; }
.gb-readout b { color: var(--me); font-weight: 600; }
.gb-actions { display: flex; gap: 8px; }
.gb-actions .gb-btn { flex: 1; border-radius: 18px; }
.gb-waiting { flex: 1; overflow-y: auto; min-height: 0; }
.gb-waiting h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 2px; }
.gb-waiting p { color: var(--muted); margin: 0 0 8px; font-size: 0.875rem; }
/* Beside the bubble: a hint before you've guessed, then a Guess button. */
.gb-bubble-side {
  position: absolute; z-index: 5; right: calc(14px + 132px + 10px); bottom: calc(22px + 44px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.gb-game.play:has(.gb-guess:not([data-state="bubble"])) .gb-bubble-side { display: none; }
.gb-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; border: 0;
  background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--text); font: 600 0.9375rem var(--font); box-shadow: 0 6px 18px rgba(14, 23, 38, 0.2); cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.gb-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--me); }
/* The host can end the round from anywhere on the play screen. */
.gb-end-pill { position: absolute; z-index: 6; top: calc(124px + env(safe-area-inset-top)); right: 14px; padding: 10px 14px; font-size: 0.875rem; }
.gb-pill-btn { min-height: 50px; padding: 0 26px; border-radius: 999px; box-shadow: 0 8px 22px rgba(14, 23, 38, 0.3); }
.gb-recentre { border-radius: 50%; width: 48px; height: 48px; box-shadow: 0 4px 14px rgba(14, 23, 38, 0.18); }
.gb-compass {
  position: absolute; right: 12px; top: 12px; z-index: 4; width: 48px; height: 48px; border-radius: 50%; color: var(--text);
  background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: 0 4px 14px rgba(14, 23, 38, 0.18); pointer-events: none;
}
.gb-compass svg { display: block; width: 100%; height: 100%; }
.gb-compass .dial { transform-origin: 24px 24px; transition: transform 0.12s linear; }
.gb-game.play .gb-recentre { top: calc(66px + env(safe-area-inset-top)); left: 14px; }
.gb-game.play .gb-compass { top: calc(66px + env(safe-area-inset-top)); right: 14px; }
@media (min-width: 900px) {
  .gb-guess[data-state="open"] { width: min(520px, 46vw); right: 18px; height: min(640px, calc(100% - 110px)); }
  .gb-guess[data-state="done"] { width: 420px; right: 18px; }
  .gb-guess { right: 18px; }
  .gb-bubble-side { right: calc(18px + 132px + 12px); }
}
@media (prefers-reduced-motion: reduce) { .gb-guess { transition: none; } }

/* Host screen (in person): Street View for the room, live guesses beside it. */
.gb-host-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gb-host-body .gb-sv { flex: 1 1 60%; }
.gb-side { flex: 0 0 auto; max-height: 40%; overflow-y: auto; padding: 14px 16px; border-top: 1px solid var(--line); }
.gb-side h2 { font-size: 1.25rem; margin-bottom: 2px; }
@media (min-width: 900px) {
  .gb-host-body { flex-direction: row; }
  .gb-side { flex: 0 0 360px; max-height: none; border-top: 0; border-left: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
  .gb-side .gb-actions { margin-top: auto; flex-direction: column; }
}

/* Phone in party mode. */
.gb-party-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
.gb-party-body .gb-btn { min-height: 58px; font-size: 1.125rem; }
.gb-status { margin: auto 0; display: grid; gap: 14px; justify-items: start; padding: 0 6px; animation: gb-fade 0.3s ease both; }
.gb-status h2 { font-size: 1.875rem; font-weight: 650; letter-spacing: -0.02em; }
.gb-status p { margin: 0; color: var(--muted); font-size: 1.0625rem; }

/* Round results: the map fills the screen; a card floats over it with your
   distance and points, then everyone's distance, time and score bars. */
.gb-results { position: fixed; inset: 0; z-index: 50; background: var(--water); }
.gb-results-body { position: absolute; inset: 0; }
.gb-results-map { position: absolute; inset: 0; background: var(--water); }
.gb-results-head {
  position: absolute; z-index: 2; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 16px; border-radius: 16px;
  background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 4px 16px rgba(14, 23, 38, 0.12);
}
.gb-results-head .place { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-results-info {
  position: absolute; z-index: 2; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-height: 64%;
  overflow-y: auto; padding: 16px 16px 14px; border-radius: 28px; background: var(--surface);
  box-shadow: 0 14px 44px rgba(14, 23, 38, 0.25); display: flex; flex-direction: column;
}
.gb-summary .k { color: var(--muted); font-size: 0.875rem; }
.gb-summary .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gb-summary .km { font-size: 2rem; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.gb-summary .pts { color: var(--me); font-size: 1.3125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.gb-summary .meta { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.gb-ranked { margin: 12px 0 14px; }
.gb-bar-row { display: grid; grid-template-columns: 30px minmax(0, 7.5em) 1fr 52px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.gb-bar-row .who { line-height: 1.2; min-width: 0; }
.gb-bar-row .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-bar-row .who span { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-bar { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.gb-bar i { display: block; height: 100%; border-radius: 5px; background: var(--c); transform-origin: left; }
.gb-bar-row .pts { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.gb-bar-row.is-me .who b::after { content: " (you)"; color: var(--muted); font-weight: 500; }
@keyframes gb-grow { from { transform: scaleX(0); } }
.gb-results.is-new .gb-bar i { animation: gb-grow 0.7s 0.2s var(--ease-out) both; }
.gb-results-info .gb-btn { margin-top: auto; border-radius: 18px; }
.gb-results-info .wait { margin-top: auto; color: var(--muted); text-align: center; }
@keyframes gb-scrim { from { background-color: transparent; } }
@keyframes gb-sheet-in { from { transform: translateY(110%); } }
@keyframes gb-pop { from { transform: translate(24px, 24px) scale(0.94); opacity: 0; } }
@keyframes gb-fade { from { opacity: 0; } }
.gb-results.is-new .gb-results-map { animation: gb-fade 0.35s ease both; }
.gb-results.is-new .gb-results-info { animation: gb-sheet-in 0.55s var(--ease-out) both; }
@media (min-width: 900px) {
  .gb-results-head { right: auto; min-width: 360px; left: 18px; top: 18px; }
  .gb-results-info { left: auto; right: 18px; bottom: 18px; width: 440px; max-height: calc(100% - 36px); transform-origin: 100% 100%; }
  /* Desktop: it grows out of the guess panel in the corner. */
  .gb-results.is-new .gb-results-info { animation: gb-pop 0.45s var(--ease-out) both; }
}

/* Sign in: the world behind the form. */
.gb-signin { position: relative; min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; }
.gb-signin-map { position: absolute; inset: 0; }
.gb-signin-map .gb-world { width: 100%; height: 100%; display: block; }
.gb-signin-map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(243, 245, 247, 0) 0%, rgba(243, 245, 247, 0.4) 35%, var(--bg) 62%); }
.gb-signin-body { position: relative; z-index: 2; width: 100%; max-width: 440px; margin: 0 auto; padding: 0 20px 36px; }
.gb-signin-brand { display: flex; align-items: center; gap: 10px; font-size: 1.875rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 6px; }
@media (min-width: 900px) { .gb-signin { justify-content: center; } .gb-signin-map::after { background: radial-gradient(ellipse at center, var(--bg) 22%, rgba(243, 245, 247, 0.35) 70%); } }

/* About, privacy and terms: readable text pages (public, no sign-in). */
.gb-legal { max-width: 680px; padding-top: 18px; }
.gb-legal .gb-title { font-size: 2.25rem; letter-spacing: -0.03em; line-height: 1.08; margin: 6px 0 14px; }
.gb-legal h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.015em; margin: 34px 0 10px; }
.gb-legal h3 { font-size: 1rem; font-weight: 650; margin: 20px 0 6px; }
.gb-legal p, .gb-legal li { color: #2A3647; line-height: 1.6; }
.gb-legal ul { padding-left: 1.2em; margin: 8px 0 12px; }
.gb-legal li { margin: 6px 0; }
.gb-legal li::marker { color: var(--muted); }
.gb-legal strong { color: var(--text); font-weight: 600; }
.gb-legal .gb-lede { color: var(--muted); }
.gb-legal a:not(.gb-btn) { text-decoration: underline; text-decoration-color: rgba(14, 23, 38, 0.3); text-underline-offset: 3px; }
.gb-kicker { color: var(--primary); font-size: 0.875rem; font-weight: 600; margin: 0; }
.gb-colophon { margin: 40px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.01em; line-height: 1.8; }
.gb-colophon a { color: var(--muted); }
.gb-signin .gb-colophon { margin-top: 18px; border-top: 0; padding-top: 0; text-align: center; }

/* Start screen: your places on the map, the Play sheet below (phones) or
   floating beside it (wider screens). */
.gb-home { min-height: 100dvh; display: flex; flex-direction: column; }
.gb-home-map { position: relative; height: 54dvh; min-height: 300px; flex: none; }
.gb-home-map .gb-world { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-home-chip {
  position: absolute; z-index: 3; top: 66px; left: 16px; display: inline-flex; gap: 4px; align-items: center;
  padding: 8px 14px; border-radius: 999px; background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--muted); font-size: 0.875rem; box-shadow: 0 4px 14px rgba(14, 23, 38, 0.08);
}
.gb-home-chip b { color: var(--text); font-weight: 600; }
.gb-home-chip:hover { text-decoration: none; }
.gb-home-sheet {
  position: relative; z-index: 2; flex: 1; margin-top: -26px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(14, 23, 38, 0.1);
  display: flex; flex-direction: column; gap: 12px;
}
.gb-resume {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  border-radius: 16px; background: var(--soft); color: var(--text);
}
.gb-resume:hover { text-decoration: none; }
.gb-resume .k { display: block; color: var(--muted); font-size: 0.78rem; }
.gb-resume b { font-weight: 600; }
.gb-resume .go { flex: none; padding: 9px 16px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-weight: 600; font-size: 0.875rem; }
.gb-seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--soft); }
.gb-seg button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font: 600 0.875rem var(--font); cursor: pointer; touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.gb-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 6px rgba(14, 23, 38, 0.12); }
.gb-mode-note { margin: -2px 4px 0; color: var(--muted); font-size: 0.875rem; min-height: 2.6em; }
.gb-maprow {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
}
.gb-maprow span { color: var(--muted); }
.gb-maprow b { flex: 1; text-align: right; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-maprow svg { flex: none; color: var(--muted); }
.gb-maprow:active:not(:disabled) { background: var(--soft); }
.gb-maprow:disabled { cursor: progress; }
/* Map picker: a sheet with search (once there are lots) and the list. */
.gb-picker { padding-bottom: 12px; height: min(640px, calc(100dvh - 40px)); }
.gb-search {
  width: 100%; height: 46px; margin: 2px 0 8px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--soft);
  color: var(--text); font: 400 1rem var(--font);
}
.gb-search:focus { outline: 2px solid var(--text); outline-offset: 0; }
.gb-picklist { display: flex; flex-direction: column; }
.gb-pick {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 4px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); font: 500 1rem var(--font); text-align: left; cursor: pointer; touch-action: manipulation;
}
.gb-pick:first-child { border-top: 0; }
.gb-pick .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-pick .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; color: transparent; border: 1.5px solid var(--line); }
.gb-pick[aria-selected="true"] .tick { background: var(--text); border-color: var(--text); color: #fff; }
.gb-pick:active { background: var(--soft); }
.gb-play { min-height: 56px; border-radius: 16px; font-size: 1.0625rem; }
.gb-joinrow { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 16px; border: 1px solid var(--line); }
.gb-joinrow input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; color: var(--text); font: 600 1rem var(--font); letter-spacing: 0.14em; text-transform: uppercase; }
.gb-joinrow input::placeholder { color: var(--muted); letter-spacing: 0.02em; text-transform: none; font-weight: 500; }
.gb-joinrow input:focus { outline: none; }
.gb-joinrow:focus-within { border-color: var(--text); }
.gb-joinrow button { height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--soft); color: var(--text); font: 600 1rem var(--font); cursor: pointer; touch-action: manipulation; }
.gb-home-sheet .gb-colophon { margin-top: auto; padding-top: 10px; border-top: 0; text-align: center; }
@media (min-width: 900px) {
  .gb-home-map { position: fixed; inset: 0; height: auto; }
  .gb-home-chip { top: 80px; left: 24px; }
  .gb-home-sheet { position: absolute; left: 24px; bottom: 24px; width: 420px; margin: 0; flex: none; border-radius: 26px; box-shadow: 0 18px 50px rgba(14, 23, 38, 0.18); }
}

/* Game results: your stats, standings, round by round. */
.gb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 4px 0 26px; border-radius: 20px; overflow: hidden; background: var(--line); box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); }
.gb-stat { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gb-stat .k { color: var(--muted); font-size: 0.8125rem; }
.gb-stat b { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gb-stat .s { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 760px) { .gb-stats { grid-template-columns: repeat(4, 1fr); } }
.gb-standings { border-radius: 20px; background: var(--surface); padding: 0 16px; box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); }
.gb-standing { display: grid; grid-template-columns: 18px 34px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.gb-standing:first-child { border-top: 0; }
.gb-standing .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.gb-standing .who b { font-weight: 600; }
.gb-standing .who span { display: block; color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.gb-standing .strip { display: flex; gap: 3px; margin-top: 6px; max-width: 220px; }
.gb-standing .strip i { flex: 1; height: 6px; border-radius: 3px; background: var(--c); }
.gb-standing .total { font-size: 1.125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.gb-standing.is-me .who b::after { content: ""; }
.gb-round { border-radius: 20px; background: var(--surface); padding: 12px 16px 6px; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); }
.gb-round-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.gb-round-head .n { width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; flex: none; }
.gb-round-head b { font-weight: 600; }

/* How to play */
.gb-help-btn {
  width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); font: 650 1rem/1 var(--font); cursor: pointer; display: grid; place-items: center;
  touch-action: manipulation; transition: transform 0.16s var(--ease-out);
}
.gb-help-btn:active { transform: scale(0.92); }
.gb-help {
  width: min(460px, calc(100% - 20px)); max-height: calc(100dvh - 40px); margin: auto auto 10px; padding: 18px 20px 20px;
  border: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(14, 23, 38, 0.3); overflow-y: auto;
}
.gb-help[open] { animation: gb-sheet-in 0.45s var(--ease-out) both; }
.gb-help::backdrop { background: rgba(14, 23, 38, 0.35); animation: gb-fade 0.3s ease both; }
@keyframes gb-sheet-out { to { transform: translateY(110%); } }
@keyframes gb-fade-out { to { opacity: 0; } }
.gb-help.is-closing { animation: gb-sheet-out 0.3s cubic-bezier(0.4, 0, 1, 1) both; }
.gb-help.is-closing::backdrop { animation: gb-fade-out 0.3s ease both; }
@media (min-width: 700px) {
  .gb-help[open] { animation: gb-pop-in 0.35s var(--ease-out) both; }
  .gb-help.is-closing { animation: gb-pop-out 0.22s ease-in both; }
}
@keyframes gb-pop-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes gb-pop-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.gb-picker[open] .gb-pick { animation: gb-rise 0.35s var(--ease-out) both; animation-delay: calc(0.08s + var(--i, 0) * 25ms); }
.gb-help-head {
  position: sticky; top: -18px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: -18px -20px 6px; padding: 16px 14px 10px 20px; background: var(--surface);
}
.gb-help h2 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; }
.gb-help h3 { font-size: 1rem; font-weight: 650; margin: 16px 0 4px; }
.gb-help-close { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--soft); color: var(--text); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.gb-help-close:active { transform: scale(0.92); }
.gb-help-steps, .gb-help-modes { margin: 6px 0; padding-left: 1.2em; color: #2A3647; line-height: 1.5; }
.gb-help-steps li, .gb-help-modes li { margin: 7px 0; }
.gb-help-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.gb-help-table th, .gb-help-table td { padding: 6px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.gb-help-table th { color: var(--muted); font-weight: 500; font-size: 0.8125rem; }
.gb-help-table .r { text-align: right; }
.gb-help-foot { margin: 14px 0 0; font-size: 0.875rem; }
.gb-help-make { margin: 4px 0; color: #2A3647; line-height: 1.5; }
@media (min-width: 700px) { .gb-help { margin: auto; } }

/* ---------- Photo rounds ----------
   The whole photo, centred, on a blurred and frosted copy of itself (iOS
   style) so the screen is always filled; pinch, drag, double-tap or scroll to
   zoom (js/photo.js). */
.gb-photo { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: #1A2232; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.gb-photo:active { cursor: grabbing; }
.gb-photo-glass {
  position: absolute; inset: -60px; background-size: cover; background-position: center;
  filter: blur(42px) saturate(170%); transform: scale(1.15); opacity: 0; transition: opacity 0.5s ease;
}
.gb-photo-glass::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12)); }
.gb-photo-sheet {
  position: absolute; left: 50%; top: 50%; transform-origin: center; will-change: transform;
  box-shadow: 0 12px 44px rgba(14, 23, 38, 0.28); opacity: 0; transition: opacity 0.4s ease;
}
.gb-photo-img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.gb-photo.is-loaded .gb-photo-glass, .gb-photo.is-loaded .gb-photo-sheet { opacity: 1; }
.gb-photo.is-zoomed .gb-photo-sheet { box-shadow: none; }
.gb-sv.is-photo .gb-compass { display: none; }
.gb-game.play .gb-photo { --photo-top: 54px; }
@media (prefers-reduced-transparency: reduce) { .gb-photo-glass { filter: blur(42px) saturate(120%) brightness(0.7); } }

/* ---------- Profile ---------- */
.gb-profile .gb-page { margin-top: -56px; position: relative; z-index: 2; }
.gb-profile-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.gb-profile-head .gb-av { box-shadow: 0 0 0 4px var(--bg), 0 8px 24px rgba(14, 23, 38, 0.18); }
.gb-profile-head .who { min-width: 0; padding-bottom: 4px; }
.gb-profile-head h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-profile-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; }
.gb-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 2px 12px; }
.gb-section-head h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; }
.gb-create { min-height: 40px; padding: 0 14px 0 12px; border-radius: 999px; gap: 6px; }
.gb-cards { display: flex; flex-direction: column; gap: 10px; }
.gb-card {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 20px; background: var(--surface); color: var(--text);
  box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); touch-action: manipulation; transition: transform 0.18s var(--ease-out);
  animation: gb-rise 0.4s var(--ease-out) both; animation-delay: calc(0.1s + var(--i, 0) * 40ms);
}
.gb-card:hover { text-decoration: none; }
.gb-card:active { transform: scale(0.985); }
.gb-card-thumb { position: relative; width: 74px; height: 74px; flex: none; border-radius: 14px; overflow: hidden; background: var(--water); }
.gb-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-card-thumb .gb-world { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.gb-card-body b { max-width: 100%; font-weight: 600; font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-card-body .meta { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.8125rem; }
.gb-state { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.gb-state.is-ready { background: rgba(18, 165, 122, 0.12); color: #0B7A5A; }
.gb-state.is-draft { background: rgba(242, 106, 61, 0.12); color: #B4461F; }
.gb-chev { flex: none; display: inline-flex; color: var(--coast); }
.gb-empty-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 20px; border: 1.5px dashed var(--coast); color: var(--text);
}
.gb-empty-card:hover { text-decoration: none; background: var(--surface); }
.gb-empty-card span { color: var(--muted); font-size: 0.9375rem; }
/* Grouped rows, as in iOS Settings. */
.gb-group { border-radius: 18px; background: var(--surface); overflow: hidden; box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); }
.gb-group-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px;
  border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: 500 1rem var(--font); text-align: left; cursor: pointer; touch-action: manipulation;
}
.gb-group > :first-child { border-top: 0; }
.gb-group-row:hover { text-decoration: none; }
.gb-group-row:active { background: var(--soft); }
.gb-group-row b { min-width: 0; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-group-row b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border: solid var(--coast); border-width: 2px 2px 0 0; transform: translateY(-2px) rotate(45deg); }
.gb-signout { margin-top: 14px; color: var(--danger); background: var(--surface); border-color: transparent; box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); }

/* Street View or photos: a small icon (and word) wherever maps are listed. */
.gb-kind { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #3B4EE0; background: rgba(91, 108, 255, 0.12); }
.gb-kind.is-photo { color: #B4461F; background: rgba(242, 106, 61, 0.13); }
.gb-kind.with-label { width: auto; height: auto; display: inline-flex; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.gb-card-body .meta .gb-kind, .gb-maprow .gb-kind { width: 20px; height: 20px; border-radius: 6px; }
.gb-card-body .meta .gb-kind svg, .gb-maprow .gb-kind svg { width: 13px; height: 13px; }
.gb-maprow b { display: inline-flex; justify-content: flex-end; align-items: center; gap: 8px; }
.gb-pick .name { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; }
.gb-pick .name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-pick .name .sub { color: var(--muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-pick .gb-tag { flex: none; }
.gb-chips { display: flex; gap: 6px; margin: 0 0 8px; overflow-x: auto; scrollbar-width: none; }
.gb-chips::-webkit-scrollbar { display: none; }
.gb-chips button {
  flex: none; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text);
  font: 600 0.875rem var(--font); cursor: pointer; touch-action: manipulation; transition: background-color 0.2s ease, color 0.2s ease;
}
.gb-chips button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.gb-picker-make { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 10px; border-radius: 14px; background: var(--soft); color: var(--text); font-weight: 600; }
.gb-picker-make:hover { text-decoration: none; }

/* ---------- Making a map ---------- */
.gb-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 2px -4px; color: var(--muted); font-weight: 500; }
.gb-back:hover { text-decoration: none; color: var(--text); }
.gb-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.gb-kind-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px; border-radius: 20px; border: 2px solid transparent;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06);
  touch-action: manipulation; transition: border-color 0.2s ease, transform 0.18s var(--ease-out);
}
.gb-kind-card:active { transform: scale(0.98); }
.gb-kind-card[aria-checked="true"] { border-color: var(--text); }
.gb-kind-card .art { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 4px; }
.gb-kind-card .art.sv { color: #3B4EE0; background: rgba(91, 108, 255, 0.12); }
.gb-kind-card .art.photo { color: #B4461F; background: rgba(242, 106, 61, 0.13); }
.gb-kind-card b { font-size: 1.0625rem; font-weight: 650; }
.gb-kind-card > span:last-child { color: var(--muted); font-size: 0.8438rem; line-height: 1.4; }
.gb-maker .gb-field > span, .gb-editor .gb-field > span { display: flex; justify-content: space-between; gap: 8px; }
.gb-field i, .gb-group-field i { font-style: normal; color: var(--muted); font-size: 0.75rem; }
.gb-textarea { min-height: 0; padding: 12px 14px; resize: none; line-height: 1.4; }
.gb-seg-small button { flex-direction: row; justify-content: center; padding: 10px 6px; font-size: 0.9375rem; }
.gb-note { margin: 8px 4px 0; color: var(--muted); font-size: 0.8438rem; }
.gb-maker-form .gb-btn { margin-top: 18px; }
.gb-maker-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.gb-maker .gb-title { margin-top: 10px; overflow-wrap: anywhere; }
.gb-save-state { color: var(--muted); font-size: 0.8125rem; }
.gb-ready {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 20px; background: var(--surface);
  box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); margin-bottom: 6px;
}
.gb-ready .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gb-ready .text b { font-weight: 650; }
.gb-ready .text span { color: var(--muted); font-size: 0.875rem; }
.gb-ready .gb-btn { border-radius: 999px; padding: 0 20px; min-height: 42px; }
.gb-ready-steps { display: grid; grid-template-columns: repeat(5, 7px); gap: 3px; align-items: end; height: 30px; }
.gb-ready-steps i { height: 12px; border-radius: 3px; background: var(--line); transition: background-color 0.3s ease, height 0.4s var(--ease-out); }
.gb-ready-steps i.done { height: 30px; background: var(--me); }
.gb-ready.is-ready .gb-ready-steps i.done { background: #12A57A; }
.gb-slots { display: flex; flex-direction: column; gap: 8px; }
.gb-slot {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 8px 14px 8px 12px; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 6px 20px rgba(14, 23, 38, 0.06); transition: transform 0.18s var(--ease-out);
  animation: gb-rise 0.4s var(--ease-out) both; animation-delay: calc(0.05s + var(--i, 0) * 35ms);
}
.gb-slot:active { transform: scale(0.985); }
.gb-slot .n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-size: 0.8125rem; font-weight: 700; }
.gb-slot-thumb { position: relative; width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden; background: var(--water); }
.gb-slot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-slot-thumb .gb-world { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-slot .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gb-slot .body b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-slot .body span { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-slot .edit { color: var(--link); font-weight: 600; font-size: 0.9375rem; }
.gb-slot.is-empty { background: transparent; box-shadow: none; border: 1.5px dashed var(--coast); }
.gb-slot.is-empty .n { background: var(--soft); color: var(--muted); }
.gb-slot .plus { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-size: 1.25rem; line-height: 1; }
.gb-details { margin-bottom: 4px; }
.gb-group-field { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
.gb-group-field > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8125rem; }
.gb-group-field input:not([type=checkbox]), .gb-group-field textarea { border: 0; padding: 0; background: none; color: var(--text); font: 500 1.0625rem/1.4 var(--font); resize: none; }
.gb-group-field input:focus, .gb-group-field textarea:focus { outline: none; }
.gb-group-field:focus-within { box-shadow: inset 3px 0 0 var(--text); }
.gb-switch-row { flex-direction: row; align-items: center; justify-content: space-between; }
.gb-switch-row > span { flex-direction: column; color: var(--text); font-size: 1rem; font-weight: 500; }
/* An iOS-style switch. */
.gb-switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 999px;
  background: var(--line); cursor: pointer; transition: background-color 0.25s ease;
}
.gb-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(14, 23, 38, 0.25); transition: transform 0.3s var(--ease-out);
}
.gb-switch:checked { background: #12A57A; }
.gb-switch:checked::after { transform: translateX(20px); }
.gb-maker .gb-cancel { margin-top: 26px; }

/* The place editor: full screen on phones (Street View or the photo on top,
   the map and name below); a large panel on wider screens. */
.gb-editor {
  width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text);
  overflow: hidden;
}
.gb-editor:focus { outline: none; }
.gb-editor[open] { display: flex; flex-direction: column; animation: gb-sheet-in 0.45s var(--ease-out) both; }
.gb-editor.is-closing { animation: gb-sheet-out 0.3s cubic-bezier(0.4, 0, 1, 1) both; }
.gb-editor::backdrop { background: rgba(14, 23, 38, 0.4); }
.gb-editor-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--bg);
}
.gb-editor-bar b { font-weight: 650; }
.gb-editor-bar .gb-btn { min-height: 40px; border-radius: 999px; padding: 0 20px; }
.gb-editor-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.gb-editor-stage { position: relative; flex: none; height: 48dvh; background: #1A2232; overflow: hidden; }
.gb-editor-stage .gb-pano { opacity: 0; transition: opacity 0.3s ease; }
.gb-editor-stage .gb-pano.is-on { opacity: 1; }
.gb-editor.is-photo .gb-editor-stage .gb-pano { display: none; }
.gb-editor:not(.is-photo) .gb-editor-photo, .gb-editor:not(.is-photo) .gb-photo-pick, .gb-editor:not(.is-photo) .gb-change-photo { display: none !important; }
.gb-editor-photo { position: absolute; inset: 0; }
.gb-photo-pick {
  position: absolute; inset: 14px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 20px; border: 1.5px dashed rgba(255, 255, 255, 0.4); color: #fff; cursor: pointer; text-align: center;
}
.gb-photo-pick b { font-size: 1.125rem; font-weight: 650; }
.gb-photo-pick span { color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; }
.gb-photo-pick:active { background: rgba(255, 255, 255, 0.06); }
.gb-photo-pick:focus-within { outline: 2px solid #fff; outline-offset: -4px; }
.gb-editor-search {
  position: absolute; z-index: 4; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  border-radius: 14px; background: var(--material-heavy); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 6px 18px rgba(14, 23, 38, 0.2); color: var(--muted);
}
.gb-editor-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: 400 1rem var(--font); }
.gb-editor-search input:focus { outline: none; }
.gb-editor-search:focus-within { box-shadow: 0 0 0 2px var(--text), 0 6px 18px rgba(14, 23, 38, 0.2); }
.gb-editor-side > .gb-editor-search { position: relative; inset: auto; flex: none; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.gb-editor-side > .gb-editor-search:focus-within { box-shadow: 0 0 0 2px var(--text); }
.gb-change-photo { position: absolute; z-index: 4; right: 12px; bottom: 12px; padding: 9px 14px; font-size: 0.875rem; }
.gb-stage-hint {
  position: absolute; z-index: 2; left: 50%; top: 58%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 40px); margin: 0;
  color: rgba(255, 255, 255, 0.85); text-align: center; font-weight: 500;
}
.gb-editor-side { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
.gb-editor-map { position: relative; flex: none; height: 32dvh; min-height: 200px; border-radius: 20px; overflow: hidden; background: var(--water); }
.gb-editor-status { margin: 0 4px; min-height: 1.4em; color: var(--muted); font-size: 0.875rem; }
.gb-editor-side .gb-field { margin: 0; }
.gb-editor-side .gb-cancel { align-self: flex-start; }
.gb-place-pin {
  position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--text);
  box-shadow: 0 0 0 4px #fff, 0 4px 12px rgba(14, 23, 38, 0.4); pointer-events: none;
}
.gb-place-pin::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--me); }
@media (min-width: 900px) {
  .gb-editor { width: min(1180px, calc(100% - 48px)); height: min(760px, calc(100dvh - 48px)); margin: auto; border-radius: 26px; box-shadow: 0 30px 80px rgba(14, 23, 38, 0.35); }
  .gb-editor[open] { animation: gb-pop-in 0.35s var(--ease-out) both; }
  .gb-editor.is-closing { animation: gb-pop-out 0.22s ease-in both; }
  .gb-editor-bar { padding: 12px 14px; }
  .gb-editor-body { flex-direction: row; overflow: hidden; }
  .gb-editor-stage { flex: 1; height: auto; margin: 0 0 14px 14px; border-radius: 20px; }
  .gb-editor-side { flex: 0 0 380px; overflow-y: auto; padding-top: 0; }
  .gb-editor-map { height: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .gb-card, .gb-slot, .gb-editor[open] { animation: gb-fade 0.2s ease both !important; }
}

/* First load: the start screen settles in (map, then your places, then the
   sheet and its controls one after another); other pages rise in gently. */
@keyframes gb-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes gb-settle { from { opacity: 0; transform: scale(1.04); } }
@keyframes gb-drop-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes gb-pop-dot { from { transform: scale(0); } }
body.is-ready > main:not(.gb-home):not(.gb-game) { animation: gb-rise 0.45s var(--ease-out) both; }
body.is-ready .gb-home-map { animation: gb-settle 1s var(--ease-out) both; }
body.is-ready .gb-home-map circle { transform-box: fill-box; transform-origin: center; animation: gb-pop-dot 0.45s 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
body.is-ready .gb-home-chip { animation: gb-drop-in 0.45s 0.55s var(--ease-out) both; }
body.is-ready .gb-home-sheet { animation: gb-rise 0.6s 0.1s var(--ease-out) both; }
body.is-ready .gb-home-sheet > * { animation: gb-rise 0.5s var(--ease-out) both; }
body.is-ready .gb-home-sheet > :nth-child(2) { animation-delay: 0.18s; }
body.is-ready .gb-home-sheet > :nth-child(3) { animation-delay: 0.24s; }
body.is-ready .gb-home-sheet > :nth-child(4) { animation-delay: 0.3s; }
body.is-ready .gb-home-sheet > :nth-child(5) { animation-delay: 0.36s; }
body.is-ready .gb-home-sheet > :nth-child(6) { animation-delay: 0.42s; }
body.is-ready .gb-home-sheet > :nth-child(7) { animation-delay: 0.48s; }
body.is-ready .gb-home-sheet > :nth-child(n+8) { animation-delay: 0.54s; }

/* Loading: app pages stay blank until they're ready, then fade in, so
   nothing half-drawn shows. A page can never stay hidden for long. */
body:has(> script[src*="/js/pages/"]) > main { transition: opacity 0.35s ease; }
body:has(> script[src*="/js/pages/"]):not(.is-ready) > main { opacity: 0; animation: gb-unhide 0s 5s forwards; }
@keyframes gb-unhide { to { opacity: 1; } }

/* Misc */
.gb-toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 100;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-weight: 600; box-shadow: 0 10px 30px rgba(14, 23, 38, 0.25);
  opacity: 0; transform: translate(-50%, 14px) scale(0.96); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.4s var(--ease-out);
}
.gb-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.gb-toast.is-error { background: var(--danger); color: #fff; }
.gb-demo-note { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.7812rem; text-align: center; }
.gb-notice { padding-top: 60px; }
.gb-loading { color: var(--muted); padding: 30px 2px; }
.gb-admin-pano { position: relative; height: 280px; border-radius: var(--r); overflow: hidden; background: #070D19; margin-bottom: 10px; border: 1px solid var(--line); }
.gb-grid2 { display: grid; gap: 0 10px; grid-template-columns: 1fr 1fr; }
.gb-grid2 .span { grid-column: 1 / -1; }
.gb-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.gb-check input { width: 20px; height: 20px; accent-color: var(--primary); }
@media (min-width: 900px) { .gb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; } }

/* Reduced motion: no sliding or scaling; things fade instead. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-property: opacity, color, background-color, visibility !important; }
  .gb-line.is-new, .gb-results.is-new .gb-results-info, .gb-results.is-new .gb-bar i, .gb-pin.is-dropping .gb-av,
  body.is-ready > main, body.is-ready .gb-home-map, body.is-ready .gb-home-sheet, body.is-ready .gb-home-sheet > *, body.is-ready .gb-home-chip,
  .gb-help[open], .gb-picker[open] .gb-pick { animation: gb-fade 0.2s ease both !important; }
  body.is-ready .gb-home-map circle { animation: none !important; }
  .gb-btn:active:not(:disabled), .gb-me:active, .gb-expand:active, .gb-recentre:active { transform: none; }
  .gb-toast { transform: none; }
  .gb-toast.is-shown, .gb-toast { transform: translateX(-50%); }
}
/* Reduced transparency or more contrast: solid bars, clearer edges. */
@media (prefers-reduced-transparency: reduce) { :root { --material: #FFFFFF; --material-heavy: #FFFFFF; --blur: none; } }
@media (prefers-contrast: more) { :root { --material: #FFFFFF; --material-heavy: #FFFFFF; --blur: none; --line: #9AA6B4; --edge: #9AA6B4; --muted: #3E4A5A; } }
