/* PINPOINT. Colours, type and radius are brand tokens set from js/brands.js; the values here are the default brand. */
:root {
  --bg: #F4F1EA; --surface: #FFFFFF; --ink: #0E1A2B; --mute: #5B6676; --line: #D9DEE5;
  --accent: #FF5A1F; --accentInk: #0E1A2B; --accentText: #C2410C; --good: #1F9D6B; --warn: #E0A100; --bad: #D7362B;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 10px;
  --pad: clamp(16px, 4vw, 40px);
  --contours: url(/assets/contours/malta.svg);   /* main.js swaps in the landmark of the day */
  --rule: 1px solid var(--line);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased;
}
body.is-app { overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.eyebrow, .meta, .idx, .tag, .gbar-title span, .score small, th {
  font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
}
.hint { color: var(--mute); font-size: 14px; }

/* ---------- controls ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius); border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink); font: 700 16px/1.1 var(--display); text-decoration: none; text-align: center;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, opacity .15s;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn:active { translate: 0 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accentInk); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn:disabled { opacity: .5; cursor: default; translate: none; }
.btn.primary:disabled { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); border-color: transparent; opacity: 1; color: color-mix(in srgb, var(--accentInk) 65%, transparent); }

.linkbtn { appearance: none; background: none; border: 0; padding: 12px 0; cursor: pointer; font: 500 14px var(--body);
  color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.linkbtn:hover { text-decoration-color: var(--ink); }
.iconbtn { appearance: none; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: none;
  border: 0; border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.iconbtn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.iconbtn svg, .zoomer svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.field { display: grid; gap: 6px; }
.field span { font: 500 13px var(--body); color: var(--mute); }
.field input { min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 16px; width: 100%; }
.field input:focus { outline: none; border-color: var(--ink); }
.field input::placeholder { color: color-mix(in srgb, var(--mute) 70%, transparent); }
#codeInput { font-family: var(--mono); letter-spacing: .3em; text-transform: uppercase; }
.formerr { color: var(--bad); font-size: 14px; min-height: 1.5em; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- home ---------- */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--pad) 14px; border-bottom: var(--rule); }
.brandmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo { width: 32px; height: 32px; display: block; }
.wordmark { font: 700 20px/1 var(--display); letter-spacing: .02em; }

.home { min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.home-cols { flex: 1; display: flex; justify-content: center; align-items: center; padding: 0 var(--pad); }
.home-body { flex: 0 1 520px; min-width: 0; padding: clamp(24px, 6vh, 64px) 0 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: center; justify-items: center; text-align: center; }
.home-body h1 { font: 700 clamp(32px, 6vw, 50px)/1.02 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.homemark { width: 72px; height: 72px; display: block; }
.homemark svg { width: 100%; height: 100%; display: block; }
.lede { font-size: 16px; }

/* Pills: Play, and the friends row under it. */
.pill { appearance: none; border: 1.5px solid var(--ink); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); border-radius: 999px;
  padding: 12px 20px; min-height: 48px; cursor: pointer; white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.pill b, .pill { font: 700 16px/1.1 var(--display); }
.pill:hover { background: var(--surface); }
.pill:active { translate: 0 1px; }
.pill.is-main { background: var(--accent); border-color: var(--accent); color: var(--accentInk); padding: 16px 56px; margin-top: 6px; }
.pill.is-main b { font-size: 20px; }
.pill.is-main:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.pill.is-dark { background: var(--ink); color: var(--bg); }
.pill.is-dark:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
/* Once today's photo is played, friends is the thing to do next. */
.home.is-played .pill.is-main { background: color-mix(in srgb, var(--surface) 92%, transparent); border-color: var(--ink); color: var(--ink); padding: 12px 24px; }
.home.is-played .pill.is-main b { font-size: 16px; }
.home.is-alldone .roomrow .pill.is-dark { background: var(--accent); border-color: var(--accent); color: var(--accentInk); }
.orline { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 380px; margin-top: 6px; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.orline::before, .orline::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.roomrow { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.roomrow .is-dark { flex: 1.3; }
.roomrow input { flex: 1; min-width: 0; min-height: 48px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 10px; text-align: center;
  font: 700 16px var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--ink); }
.roomrow input:focus { outline: none; border-color: var(--ink); }
.roomrow input::placeholder { color: color-mix(in srgb, var(--mute) 60%, transparent); }
.homemeta { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); min-height: 1.4em; }

/* Today's result, shown above the buttons once the daily is played. */
#todaySlot:empty { display: none; }
#todaySlot { width: 100%; max-width: 440px; margin-top: 6px; }
.todaycard > span { min-width: 0; }
.todaycard { display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 14px; padding: 14px 18px; }
.todaycard .eyebrow { margin: 0; }
.todaycard .squares { display: flex; gap: 5px; margin: 6px 0 4px; }
.todaycard .squares i { width: 20px; height: 20px; border-radius: 4px; background: var(--c); }
.todaycard .squares i.is-empty { background: var(--line); }
.todaycard p { font-size: 15px; }

/* The menu rows are still used for a waiting Sbarter match. */
.menu { display: grid; gap: 10px; width: 100%; }
.menuitem { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 64px; padding: 0 18px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); cursor: pointer; text-align: left;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.menuitem b { font: 700 20px/1.1 var(--display); }
.menuitem span { font: 500 12px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--mute); text-align: right; }
.menuitem:hover { background: color-mix(in srgb, var(--ink) 6%, var(--surface)); }
.menuitem:active { translate: 0 1px; }
.menuitem.is-main { background: var(--accent); border-color: var(--accent); color: var(--accentInk); min-height: 76px; }
.menuitem.is-main b { font-size: 24px; }
.menuitem.is-main span { color: color-mix(in srgb, var(--accentInk) 80%, transparent); }
.menuitem.is-main:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }

.streak { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font: 500 14px var(--mono); }
.streak-days { display: flex; gap: 5px; }
.streak-days i { width: 16px; height: 16px; border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); border-radius: 3px; }
.streak-days i.is-done { background: var(--accent); border-color: var(--accent); }
.streak-days i.is-today { border-color: var(--ink); }
.streak-best { color: var(--mute); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
th, td { padding: 7px 14px 7px 0; text-align: right; white-space: nowrap; border-bottom: var(--rule); }
tbody th { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; }
#howBody { display: grid; gap: 10px; }
#howBody h3 { margin: 8px 0 0; font: 700 16px var(--display); }

.colophon { border-top: var(--rule); padding: 16px var(--pad) calc(20px + env(safe-area-inset-bottom)); color: var(--mute); font-size: 12px; text-align: center; }

.field select { min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 16px; color: inherit; width: 100%; }
.splitrow { display: flex; gap: 10px; align-items: end; }
.splitrow .field { flex: 1; min-width: 0; }
.splitrow .btn { flex: none; }
.placelist { max-height: min(52dvh, 460px); overflow-y: auto; padding-right: 2px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.placelist button { appearance: none; min-height: 56px; padding: 8px 14px; text-align: left; cursor: pointer; background: transparent;
  border: 1.5px solid var(--line); border-radius: var(--radius); display: grid; }
.placelist button:hover { border-color: var(--ink); }
.placelist .placerule { grid-column: 1 / -1; width: 100%; height: 0; margin: 4px 0; border: 0; border-top: var(--rule); }
.placelist b { font: 700 16px var(--display); }
.placelist button > span { font: 500 11px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }

/* Result grid: one square per pin, coloured by how close it was. */
.squares { display: inline-flex; gap: 3px; flex: none; }
/* Six grades, from green (found) through yellow, orange and red to purple and blue (nowhere near). Colours: regions.js. */
.squares i, .gradekey i, .tries i { width: 12px; height: 12px; border-radius: 2px; background: var(--c); flex: none; }
.squares i { width: 14px; height: 14px; }
.gradekey { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 11px/1.3 var(--mono); color: var(--mute); }
.gradekey li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rows .near { overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-block: var(--rule); }
.stats div { padding: 12px 0; }
.stats dt { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.stats dd { margin: 2px 0 0; font: 700 22px var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- app bar (lobby and game) ---------- */
.gbar { display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(4px, env(safe-area-inset-left)); border-bottom: var(--rule); }
.gbar-title { display: grid; min-width: 0; margin-right: auto; }
.gbar-title b { font: 700 16px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapsize svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#mapFull { padding: 8px; display: grid; place-items: center; }
.mapfull-exit { display: none; position: absolute; z-index: 6; top: 12px; left: 12px; font-size: 14px; padding: 10px 14px; }
.mapwrap.is-full { position: fixed; inset: 0; z-index: 45; height: auto !important; min-height: 0; border: 0; }
.mapwrap.is-full .mapfull-exit { display: block; top: max(12px, env(safe-area-inset-top)); }
#gSound[aria-pressed="false"] { opacity: .45; }
#gSound[aria-pressed="false"] .waves { display: none; }
.gbar-nums { display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.score { display: grid; text-align: right; }
.score b, .timer { font: 700 20px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.timer { min-width: 2.4ch; padding: 6px 10px; border: 1.5px solid var(--ink); border-radius: var(--radius); text-align: center; }
.timer.is-rush { background: var(--bad); border-color: var(--bad); color: #fff; }
.timerbar { height: 4px; background: var(--line); overflow: hidden; }
.timerbar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform .1s linear; }
.timerbar.is-rush i { background: var(--bad); }

.net { position: fixed; z-index: 60; top: max(8px, env(safe-area-inset-top)); left: 50%; translate: -50% 0;
  background: var(--ink); color: var(--bg); font: 500 13px var(--body); padding: 8px 14px; border-radius: 999px; white-space: nowrap; }

/* ---------- lobby ---------- */
.lobby { min-height: 100dvh; display: flex; flex-direction: column; overflow: auto; height: 100dvh; }
.lobby-body { display: grid; gap: 0; width: 100%; max-width: 920px; margin: 0 auto; padding: 0 var(--pad) calc(24px + env(safe-area-inset-bottom)); }
.invite, .roster { display: grid; gap: 14px; padding: 20px 0; justify-items: start; }
.invite { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.invite .eyebrow, .invite .btn, .invite .hint { grid-column: 1 / -1; }
.roster { border-top: var(--rule); }
.code { font: 700 clamp(48px, 15vw, 88px)/1 var(--mono); letter-spacing: .1em; }
.qr { width: clamp(104px, 28vw, 148px); padding: 6px; background: #fff; border: var(--rule); border-radius: 6px; }
.qr path { fill: #0E1A2B; }
.players { display: grid; gap: 0; width: 100%; }
.players li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: var(--rule); font-weight: 500; }
.players li.is-away { opacity: .45; }
.players .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.roster .btn, .invite .btn { width: 100%; }
.roster .hint { order: 3; }
.roster .btn { order: 2; }
@media (min-width: 760px) {
  .lobby-body { grid-template-columns: 1fr 1fr; gap: 0 56px; }
  .roster { border-top: 0; }
}

/* ---------- play screen ---------- */
/* A flex column, so the photo keeps the leftover height whether or not the timer bar is showing. */
.game { height: 100dvh; display: flex; flex-direction: column; }
.stagewrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 430px); }
/* Two slots: the big one (first child of .stagewrap) and the small one (top of .side).
   The photo starts big and the map small; the swap button exchanges them (screen.js moves the elements). */
.stage { background: #0b0f14; }
.stage, .mapwrap { position: relative; overflow: hidden; }
.stagewrap > .stage, .stagewrap > .mapwrap { min-height: 0; }
.side > .stage, .side > .mapwrap { flex: none; height: 58%; min-height: 220px; border-bottom: var(--rule); }
#shot, #gmap { position: absolute; inset: 0; }
#shot.is-moving { pointer-events: none; }
.crosshair { pointer-events: none; line-height: 0; filter: drop-shadow(0 0 2px rgb(0 0 0 / .75)); }
.crosshair svg { width: 96px; height: 96px; }

/* Registration ticks in the corners of the photo. */
.tick { position: absolute; width: 18px; height: 18px; border: 0 solid rgb(255 255 255 / .85); pointer-events: none; z-index: 2; }
.tick.tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.tick.tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.tick.bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.tick.br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }
.fov { position: absolute; z-index: 2; left: 36px; top: 14px; font: 500 12px var(--mono); color: #fff; background: rgb(0 0 0 / .55); padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.zoomer { position: absolute; z-index: 2; right: 18px; top: 18px; display: grid; gap: 6px; }
.zoomer button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; cursor: pointer;
  background: rgb(0 0 0 / .6); color: #fff; font: 500 24px/1 var(--mono); touch-action: manipulation; }
.zoomer button:hover { background: rgb(0 0 0 / .8); }
.zoomer button:focus-visible { outline-color: #fff; }
.stage .maplibregl-ctrl-bottom-right { bottom: 8px; right: 8px; }

/* The side panel is see-through enough for the contour background to carry on behind it. */
.side { position: relative; display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb, var(--surface) 45%, transparent); border-left: var(--rule); }
#gmap.is-armed { cursor: crosshair; }
#gmap.is-armed .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.maptools { position: absolute; z-index: 5; top: 8px; left: 8px; display: flex; gap: 6px; }
.mapsize { border: 0; border-radius: 6px; padding: 8px 10px; cursor: pointer;
  background: rgb(0 0 0 / .6); color: #fff; font: 500 12px var(--body); }
.panel { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.help { font-weight: 500; }
.detail, #gChat { flex: none; }   /* the panel scrolls; its parts never squash into each other */
.panel .btn { margin-top: auto; width: 100%; flex: none; position: sticky; bottom: 0; }

/* Countdown over the photo before a live round. */
.countdown { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: var(--ink); color: var(--bg);
  font: 700 clamp(72px, 20vw, 168px)/1 var(--mono); }

/* Room chat (lobby, between places, final standings). */
.chat { display: grid; gap: 8px; padding-top: 10px; border-top: var(--rule); width: 100%; }
.chat h3 { margin: 0; font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
/* A fixed height with the newest line at the bottom: new messages push the older ones up, and the box below never moves. */
.chat-list { display: flex; flex-direction: column; gap: 4px; height: 132px; overflow-y: auto; font-size: 14px; }
.chat-list li { flex: none; }
.chat-list li:first-child { margin-top: auto; }
.chat-list li { display: flex; gap: 6px; align-items: baseline; overflow-wrap: anywhere; }
.chat-list b { flex: none; }
.chat-list .dot { translate: 0 -1px; }
.chat-list .none { color: var(--mute); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 16px; }
.chat-form input:focus { outline: none; border-color: var(--ink); }
.chat-form .btn { min-height: 44px; flex: none; width: auto; position: static; margin: 0; }
#lobbyChat { width: 100%; order: 4; }
#lobbyChat:empty, #gChat:empty, #summaryChat:empty { display: none; }
.summary-chat { max-width: 640px; margin: -20px auto 0; padding: 0 var(--pad) calc(40px + env(safe-area-inset-bottom)); }

.pips { display: flex; gap: 6px; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.is-used { background: var(--c, var(--mute)); }
.pips i.is-now { background: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.chips li.is-in { border-color: var(--ink); }
.chips li.is-away { opacity: .45; }
.chips em { font: 500 11px var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.chips em:empty { display: none; }

.rows { display: grid; }
.rows li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: var(--rule); }
.rows .rank { font: 700 14px var(--mono); color: var(--mute); }
.rows .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .dist { font: 500 13px var(--mono); color: var(--mute); white-space: nowrap; }
.rows b { font: 700 15px var(--mono); font-variant-numeric: tabular-nums; min-width: 5ch; text-align: right; }
.rows li.is-you .who { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rows.is-final li:first-child b, .rows.is-final li:first-child .rank { color: var(--accentText); }

.tries { display: grid; font: 500 13px var(--mono); color: var(--mute); }
.tries li { display: grid; grid-template-columns: 12px 4.5em 1fr 3.5em 4.5em; align-items: center; gap: 8px; padding: 5px 0; border-bottom: var(--rule); }
.tries b { text-align: right; }
.tries li.is-best { color: var(--ink); }

/* Pins and the revealed target on the guess map. */
.pin { width: 26px; height: 31px; cursor: pointer; }
.pin i { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.pin b { display: grid; place-items: center; width: 100%; height: 100%; rotate: 45deg; color: #fff; font: 700 12px/1 var(--mono); }
/* Earlier misses are smaller. Only the inner shape is resized: the outer element carries MapLibre's own
   positioning transform, and scaling it would scale the position too (pins then drift as the map zooms). */
.pin.is-faded { opacity: .6; }
.pin.is-faded i { width: 20px; height: 20px; margin: 7px 3px 0; }
.pin.is-faded b { font-size: 10px; }
.pin.is-live i { animation: drop .18s ease-out; }
@keyframes drop { from { translate: 6px -6px; opacity: 0; } }
.target { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 1px 6px rgb(0 0 0 / .4); }

@media (max-width: 820px) {
  .stagewrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(120px, 1fr) auto; }
  .side { border-left: 0; border-top: var(--rule); }
  .side > .stage, .side > .mapwrap { height: 30dvh; min-height: 170px; }
  .panel { flex: none; max-height: 34dvh; gap: 8px; padding-top: 10px; }
  .help { font-size: 15px; line-height: 1.35; }
  .game.is-reveal .side > .stage, .game.is-reveal .side > .mapwrap { height: 24dvh; }
  .game.is-reveal .panel { max-height: 44dvh; }
  #gChat .chat-list { height: 76px; }
  .crosshair svg { width: 80px; height: 80px; }
  .zoomer { right: 12px; top: 12px; }
  .zoomer button { width: 40px; height: 40px; }
  .gbar-title b { font-size: 15px; }
}
@media (max-height: 520px) and (min-width: 821px) { .side > .stage, .side > .mapwrap { min-height: 120px; height: 46%; } }
/* In the small slot the photo's extras shrink so they do not cover it. */
.side > .stage .fov, .side > .stage .tick.tl { display: none; }
.side > .stage .crosshair svg { width: 64px; height: 64px; }
.side > .stage .zoomer button { width: 34px; height: 34px; font-size: 18px; }

/* ---------- results ---------- */
.summary-body { display: grid; gap: 18px; max-width: 640px; margin: 0 auto; padding: clamp(24px, 6vw, 56px) var(--pad) calc(40px + env(safe-area-inset-bottom)); }
.summary-body h1 { font: 700 clamp(34px, 8vw, 56px)/1 var(--display); letter-spacing: -.02em; }
.bigscore b { font: 700 clamp(40px, 11vw, 64px)/1 var(--mono); color: var(--accentText); font-variant-numeric: tabular-nums; }
.bigscore span { font: 500 18px var(--mono); color: var(--mute); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 180px; }

/* ---------- dialogs and toast ---------- */
.sheet { border: 0; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-radius: calc(var(--radius) + 4px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.sheet::backdrop { background: rgb(8 12 20 / .55); }
.sheet > form, .sheet-body { display: grid; gap: 14px; padding: 20px; }
.sheet header { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font: 700 22px var(--display); }
.sheet.small { width: min(400px, calc(100vw - 24px)); }
.brandlist { display: grid; gap: 8px; }
.brandopt { appearance: none; display: flex; align-items: center; gap: 14px; text-align: left; min-height: 60px; padding: 10px 14px; cursor: pointer;
  background: transparent; border: 1.5px solid var(--line); border-radius: var(--radius); }
.brandopt.is-on { border-color: var(--ink); }
.brandopt-text { display: grid; min-width: 0; }
.brandopt-text b { font: 700 16px var(--body); }
.brandopt-text span { font-size: 13px; color: var(--mute); }
.swatches { display: flex; flex: none; }
.swatches i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 1px solid rgb(128 128 128 / .5); margin-left: -6px; }
.swatches i:first-child { margin-left: 0; }

.toast { position: fixed; z-index: 70; left: 50%; top: calc(68px + env(safe-area-inset-top)); translate: -50% -12px; opacity: 0; pointer-events: none;
  max-width: min(440px, calc(100vw - 32px)); background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius);
  font: 500 15px/1.35 var(--body); text-align: center; transition: opacity .2s, translate .2s; }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- brand-specific touches ---------- */
/* ---------- home backgrounds (Design sheet > Home background) ---------- */
/* The background sits behind every screen (home, results, lobby, the bars of the play screen). */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transition: opacity .7s; }
body.bg-out::before { opacity: 0 !important; }
/* Contours: Mount Etna, a line every 100 m, drawn in the brand's ink through a mask. */
body[data-bg="contours"]::before { background: var(--ink); opacity: .17;
  -webkit-mask: var(--contours) center / cover no-repeat; mask: var(--contours) center / cover no-repeat; }
/* Terrain: banded elevation tints with hill shading, washed back so text stays readable. */
body[data-bg="terrain"]::before { background: url(/assets/terrain.webp) center / cover no-repeat; opacity: .6; }
body[data-bg="terrain"][data-mode="dark"]::before { opacity: .16; filter: grayscale(1) invert(1); }
body[data-bg="terrain"] .menuitem:not(.is-main) { background: color-mix(in srgb, var(--surface) 92%, transparent); }
body[data-bg="grid"]::before { background:
  linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px) 0 0 / 100% 40px,
  linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px) 0 0 / 40px 100%; }

.homelinks, .footlinks { display: flex; gap: 4px 22px; flex-wrap: wrap; justify-content: center; }
/* After today's photo: Local steps up beside "See today's result". */
.playrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 6px; }
.playrow .pill.is-main { margin-top: 0; }
.pill.is-next { background: var(--accent); border-color: var(--accent); color: var(--accentInk); padding: 12px 24px; }
.pill.is-next:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.pill[hidden], .modepill[hidden] { display: none; }
/* The other game modes: a pill each, with a line saying what it is. */
.modes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.modepill { appearance: none; display: grid; gap: 2px; justify-items: center; min-width: 112px; padding: 9px 18px; cursor: pointer; color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 999px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .15s, border-color .15s; }
.modepill:hover { background: var(--surface); border-color: var(--ink); }
.modepill b { font: 700 14px/1.15 var(--display); }
.modepill small { font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.footlinks .linkbtn { font-size: 12px; padding: 4px 0; }
.narrow { display: none; }
.masthead .linkbtn, .masthead .boardswitch { white-space: nowrap; }
@media (max-width: 560px) {
  .mastlinks .wide { display: none; } .narrow { display: inline-block; } .mastlinks { gap: 12px; } .wordmark { font-size: 17px; }
  #langBtn { font-size: 0; }   /* just the flag on a phone */
  .roomrow .pill { padding-inline: 14px; }
}
@media (max-width: 400px) { .masthead .wordmark { display: none; } }

/* Leaderboard switch (top right) and the panel it drops down. */
.boardswitch { appearance: none; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; cursor: pointer; font: 600 14px var(--body); color: var(--ink); white-space: nowrap; }
.boardswitch i { position: relative; width: 36px; height: 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); transition: background-color .18s; flex: none; }
.boardswitch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); transition: translate .18s cubic-bezier(.3, 1.4, .5, 1), background-color .18s; }
.boardswitch[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
.boardswitch[aria-checked="true"] i::after { translate: 16px 0; background: var(--accentInk); }
.home .home-board { position: absolute; z-index: 20; top: calc(max(14px, env(safe-area-inset-top)) + 58px); right: var(--pad); width: min(360px, calc(100vw - 2 * var(--pad)));
  box-shadow: 0 12px 32px rgb(0 0 0 / .14); max-height: calc(100dvh - 90px); overflow-y: auto; animation: boarddrop .2s ease-out; }
.home .home-board[hidden] { display: none; }
@keyframes boarddrop { from { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .home .home-board { animation: none; } .boardswitch i, .boardswitch i::after { transition: none; } }

/* Archive: one row per day. */
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.days li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.days li.is-today { border-color: var(--ink); }
.days .eyebrow { margin: 0; }
.days b { display: block; font: 700 16px var(--display); }
.days small { color: var(--mute); font-size: 13px; }
.days .right { display: grid; gap: 4px; justify-items: end; }
.days .squares { display: flex; gap: 3px; } .days .squares i { width: 14px; height: 14px; border-radius: 3px; background: var(--c); }
.days .pts { font: 700 13px var(--mono); }
.days .pill { min-height: 36px; padding: 6px 16px; font-size: 14px; }
/* Flags: Windows has no flag emoji of its own, so they come from a small font that holds only flags. */
@font-face { font-family: 'Twemoji Country Flags'; src: url(/vendor/TwemojiCountryFlags.woff2) format('woff2'); font-display: swap;
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; }
.flag { font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; font-style: normal; letter-spacing: 0; }
/* Language menu in the top bar. */
.langpick { position: relative; }
#langBtn { text-decoration: none; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }
#langBtn .flag { font-size: 17px; vertical-align: -2px; }
.langmenu { position: absolute; z-index: 30; right: 0; top: 100%; display: grid; min-width: 170px; padding: 6px; background: var(--surface);
  border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(0 0 0 / .18); }
.langmenu button { appearance: none; background: none; border: 0; border-radius: calc(var(--radius) - 4px); padding: 10px 12px; text-align: left; cursor: pointer;
  font: 500 15px var(--body); color: var(--ink); white-space: nowrap; }
.langmenu button:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.langmenu button.is-on { font-weight: 700; }
.langmenu .flag { font-size: 18px; margin-right: 6px; vertical-align: -2px; }
.mastlinks { display: flex; gap: 18px; align-items: center; }
#matchSlot:empty { display: none; }
/* On large monitors the home column grows, so the page is not mostly empty. The steps need the height as well as the width. */
@media (min-width: 2200px) and (min-height: 1150px) { .home-cols { zoom: 1.28; } }
@media (min-width: 3000px) and (min-height: 1500px) { .home-cols { zoom: 1.65; } }
#contourNote .linkbtn { font-size: 12px; color: var(--mute); padding: 4px 0; }
#contourNote { display: flex; gap: 6px 18px; justify-content: center; flex-wrap: wrap; align-items: baseline; }
.stack { display: grid; gap: 12px; }
.sheet h3 { margin: 6px 0 0; font: 700 16px var(--display); }
.friendlist { display: grid; }
.friendlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: var(--rule); font-weight: 500; }
.friendlist .linkbtn { padding: 8px 0; font-size: 13px; color: var(--mute); }
a.linkbtn { display: inline-block; }
.gbar, .masthead, .colophon { background: color-mix(in srgb, var(--bg) 82%, transparent); }
/* Archivo is drawn a little wider for headings, like lettering on a printed map. */
body[data-type="archivo"] :is(.home-body h1, .summary-body h1, .wordmark, .menuitem b, .sheet h2) { font-stretch: 112%; }
body[data-type="archivo"] .home-body h1 { font-weight: 800; letter-spacing: -.025em; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { appearance: none; min-height: 40px; padding: 0 14px; cursor: pointer; background: transparent; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; font: 500 14px var(--body); }
.seg button.is-on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.seg button small { margin-left: 7px; font: 500 12px var(--body); color: var(--mute); }
.seg button.is-on small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.soundrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.soundrow input[type=range] { flex: 1 1 160px; min-width: 0; height: 40px; accent-color: var(--ink); cursor: pointer; }
.soundrow input:disabled { opacity: .4; cursor: default; }
.placelist button.is-on { border-color: var(--ink); }

.board { display: grid; gap: 10px; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.board h2 { font: 700 18px var(--display); }
.board .rows li:last-child { border-bottom: 0; }
.board-form .field input { min-height: 48px; }
body[data-brand="orbit"] .wordmark, body[data-brand="orbit"] .menuitem b, body[data-brand="orbit"] .btn { text-transform: uppercase; letter-spacing: .06em; }
body[data-brand="zto"] .home-body h1 { font-size: clamp(30px, 8vw, 48px); line-height: 1.05; letter-spacing: 0; }
body[data-brand="zto"] .menuitem b, body[data-brand="zto"] .wordmark { letter-spacing: 0; font-size: 17px; }
body[data-brand="overhead"] .home-body h1 { font-weight: 500; }
body[data-brand="spoton"] .btn { border-width: 2px; }
body[data-brand="orbit"] .maplibregl-ctrl-attrib { background: rgb(12 18 32 / .85); color: #9fb3cc; }
body[data-brand="orbit"] .maplibregl-ctrl-attrib a { color: #9fb3cc; }

.maplibregl-ctrl-attrib { font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Google's sign-in button sits in its own frame; this centres it and holds its space while it loads. */
.gbox { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }
.sheet .orline { max-width: none; margin: 0; }

/* Recovery code, shown once in the account sheet */
.recovery { display: grid; gap: 10px; padding: 14px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.recovery code { font: 700 clamp(18px, 5.4vw, 24px) var(--mono); letter-spacing: 0.06em; user-select: all; overflow-wrap: anywhere; }
.recovery .hint { margin: 0; }
