/* Roost Rush live map. Colors come from design/colors/tokens.json (ui.dark, map, game, radar.display, dawn.glow). */
:root {
  /* ui.dark */
  --bg: #0A0E14; --surface: #141B2D; --surface-raised: #1E2740;
  --text: #F4F1EA; --text-muted: #A9B1C6; --border: #2A3550; --border-strong: #6A7799;
  --accent: #FFD27A; --on-accent: #0A0E14; --accent-text: #F2A65A; --focus: #F4F1EA;
  /* brand */
  --twilight-indigo: #2B2F6B; --civil-violet: #6B4E9B; --dawn-amber: #F2A65A; --ember: #E8743B;
  --dawn-glow: radial-gradient(130% 160% at 100% 0%, #F2A65A 0%, #E8743B 18%, #6B4E9B 42%, #2B2F6B 62%, #141B2D 82%, #0A0E14 100%);
  /* map */
  --map-basemap: #181B21; --map-deep: #0B0E14; --map-coast: #5A6170;
  /* game states */
  --live-fill: #04E9E7; --live-ink: #04E9E7;
  --candidate-fill: #FFE45C; --candidate-ink: #FFE98A;   /* potential rings: lemon yellow, not the radars' amber */
  --missed-fill: #454D63; --missed-ink: #9AA2B8;
  --first-light-ink: #FFD27A;
  /* radar states: amber = watching (it's dawn there), cool slate = waiting, dim = done, coral = offline.
     Cyan is kept for birds (rings) only. */
  --rad-live: #FFB547; --rad-pre: #8C96C4; --rad-done: #4E566C; --rad-offline: #FF8A7A;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --ui: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --topbar-h: 56px;
  --sheet-w: 380px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* MapLibre places every marker with position: absolute plus a transform. A marker's own class setting position
   (relative, say) silently overrides that: the marker drops into normal flow, lands off its point and drifts when
   zooming. This rule outranks any single-class rule, so it can't happen again. Children can still be absolute. */
.maplibregl-marker.maplibregl-marker { position: absolute; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 16px; line-height: 1.45;
  display: flex; flex-direction: column; overflow: hidden;
}
.mono { font-family: var(--mono); }
.display { font-family: var(--display); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }

/* a.skip, not .skip: Label mode's "Skip" reason button carries the same class and was being moved off-screen with it. */
a.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
a.skip:focus { top: 8px; }

/* ---------- top bar: night navy under the dawn glow from the top right (east) ---------- */
.topbar {
  position: relative; z-index: 5; display: flex; align-items: center; gap: 12px 16px;
  min-height: var(--topbar-h); padding: 6px 12px 6px 16px; padding-top: max(6px, env(safe-area-inset-top));
  background: radial-gradient(520px 200px at 100% 0%, rgba(242,166,90,.55) 0%, rgba(232,116,59,.35) 22%, rgba(107,78,155,.28) 48%, rgba(43,47,107,.25) 70%, transparent 100%), var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 24px; width: auto; }
.where { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.where p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where-place { font-weight: 700; font-size: 15px; }
.where-meta { font-size: 12px; color: var(--text-muted); }
.tally { display: flex; align-items: baseline; gap: 6px; flex: none; }
.tally-num { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; }
.tally-label { font-size: 13px; color: var(--text); display: flex; flex-direction: column; line-height: 1.15; }
.tally-extra { color: var(--text-muted); font-size: 11px; }
.icon-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.btn-ghost {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--border-strong);
  background: rgba(10,14,20,.55); color: var(--text); font-weight: 700; cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-raised); }
.btn-primary {
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { cursor: not-allowed; opacity: .6; }

.alert-bar {
  position: relative; z-index: 4; margin: 0; padding: 4px 16px; min-height: 26px; display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alert-bar[hidden] { display: none; }
.alert-bar a { color: inherit; }
.alert-bar small { font-weight: 400; opacity: .8; }

/* ---------- layout ---------- */
.layout { position: relative; flex: 1; min-height: 0; display: flex; overflow: hidden; overflow: clip; }   /* clip: the slid-down sheet must never make the page scroll */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--map-basemap); }
.sheet {
  width: var(--sheet-w); flex: none; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.sheet-handle { display: none; }
.sheet-head { padding: 14px 16px 0; }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs [role=tab] {
  min-height: 44px; padding: 0 12px; background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--text-muted); font-weight: 700; cursor: pointer;
}
.tabs [role=tab][aria-selected=true] { color: var(--text); border-bottom-color: var(--accent-text); }
.sheet-body { overflow-y: auto; padding: 14px 16px 24px; flex: 1; min-height: 0; }

.dawn-card {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 16px;
  background-image: radial-gradient(240px 140px at 100% 0%, rgba(232,116,59,.22), transparent 70%);
}
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.nextdawn { margin: 0; font-family: var(--mono); font-size: 26px; font-weight: 600; }
.nextdawn-sub { margin: 2px 0 12px; color: var(--text-muted); font-size: 14px; }
.fine { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

.ring-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ring-item {
  width: 100%; text-align: left; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; min-height: 56px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); cursor: pointer;
}
.ring-item:hover { border-color: var(--border-strong); }
.ring-item[aria-current=true] { border-color: var(--live-ink); }
.ring-item .ri-title { font-weight: 700; display: block; overflow-wrap: anywhere; }
.ring-item .ri-meta { font-family: var(--mono); font-size: 13px; color: var(--text-muted); display: block; }
.ring-item .ri-size { font-family: var(--mono); font-size: 14px; text-align: right; }
.ring-item .ri-state { font-size: 12px; display: block; }
.ri-state.is-ring { color: var(--live-ink); }
.ri-state.is-cand { color: var(--candidate-ink); }
.day-head { font-size: 13px; color: var(--text-muted); margin: 16px 0 6px; font-weight: 700; }
.day-head:first-child { margin-top: 0; }
.empty { background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 14px; padding: 14px; }
.empty p { margin: 0 0 8px; }
.empty p:last-child { margin: 0; }
.empty .season { color: var(--text-muted); font-size: 14px; }

/* ring status icons (shape + color + word, never color alone) */
.ico { width: 32px; height: 32px; display: block; }
.ico circle { fill: none; }
.ico.ring circle.wall { stroke: var(--live-fill); stroke-width: 3; }
.ico.ring circle.core { fill: rgba(4,233,231,.18); stroke: none; }
.ico.cand circle.wall { stroke: var(--candidate-fill); stroke-width: 2.2; stroke-dasharray: 4.5 3.5; fill: rgba(255,228,92,.06); }
.ico.cand text { fill: var(--candidate-ink); font: 700 12px var(--ui); }

/* ---------- legend (map key) ---------- */
.legend {
  position: absolute; right: 56px; top: 10px; z-index: 4; width: 300px; max-width: calc(100% - 76px);
  display: flex; flex-direction: column; max-height: calc(100% - 20px);
  background: rgba(20,27,45,.97); border: 1px solid var(--border-strong); border-radius: 14px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.legend[hidden] { display: none; }
.legend-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0 14px; }
.legend-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.legend-head .card-close { position: static; width: 40px; height: 40px; font-size: 24px; }
.legend-body { padding: 0 14px 12px; overflow-y: auto; min-height: 0; }
/* the key button sits in MapLibre's control stack, under + and − */
.key-btn { display: grid !important; place-items: center; }
.key-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.key-btn[aria-expanded=true] { background: var(--accent) !important; }
.key-btn[aria-expanded=true] svg { stroke: var(--on-accent); }
.lg-h { margin: 6px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.lg-note { text-transform: none; letter-spacing: 0; color: var(--text-muted); font-weight: 400; font-size: 12px; }
.legend-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 7px; }
.legend-list li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; }
.lg-text b { display: block; font-weight: 700; color: var(--text); }
.lg-text small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.lg-count { color: var(--text-muted); font-size: 12px; }
.lg-icon { width: 24px; height: 24px; display: inline-grid; place-items: center; }
.lg-icon svg { width: 22px; height: 22px; }
.lg-icon.lg-live span { width: 9px; height: 9px; border-radius: 50%; background: var(--rad-live); box-shadow: 0 0 0 4px rgba(255,181,71,.25), 0 0 8px rgba(255,181,71,.7); }
.lg-icon.lg-pre::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--rad-pre); }
.lg-icon.lg-done::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rad-done); }
.lg-icon.lg-offline::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px dotted var(--rad-offline); }
.lg-icon.lg-ring circle { fill: rgba(4,233,231,.15); stroke: var(--live-fill); stroke-width: 2.5; }
.lg-icon.lg-cand circle { fill: none; stroke: var(--candidate-fill); stroke-width: 2; stroke-dasharray: 3 2.5; }
.lg-icon.lg-cand text { fill: var(--candidate-ink); font: 700 10px var(--ui); }
.lg-icon.lg-dawn::before { content: ""; width: 20px; height: 4px; border-radius: 2px; background: var(--dawn-amber); box-shadow: 0 0 6px var(--ember); }
.dbz { margin-top: 2px; }
.dbz-bar { height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #04E9E7 0 10%, #019FF4 10% 20%, #4A4AFF 20% 30%, #02FD02 30% 40%, #01C501 40% 50%, #008E00 50% 60%, #FDF802 60% 70%, #E5BC00 70% 80%, #FD9500 80% 90%, #FD0000 90% 100%); }
.dbz-bands { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.dbz-note { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }

/* ---------- Near me ---------- */
.near-me {
  position: absolute; z-index: 3; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px;
  background: rgba(20,27,45,.95); border: 1.5px solid var(--border-strong); color: var(--text); font: 700 15px var(--ui);
  cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.near-me svg { width: 20px; height: 20px; fill: none; stroke: var(--text-muted); stroke-width: 2.2; }   /* quiet until on: no yellow under the logo */
.near-me:hover { border-color: var(--accent); }
.near-me[aria-pressed=true] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.near-me[aria-pressed=true] svg { stroke: var(--on-accent); }
.near-me[aria-busy=true] { opacity: .75; cursor: progress; }
.you { width: 18px; height: 18px; }
.you::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #5BA8FF; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.6); }
.you::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: rgba(91,168,255,.25); animation: you 2.4s ease-out infinite; }
@keyframes you { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.toast { position: absolute; z-index: 3; top: 64px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: 12px; background: rgba(20,27,45,.97); border: 1px solid var(--border-strong); font-size: 14px; }

/* ---------- map markers ---------- */
.rad { pointer-events: none; display: grid; place-items: center; }
.rad-pre { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--rad-pre); background: rgba(10,14,20,.7); }
.rad-done { width: 7px; height: 7px; border-radius: 50%; background: var(--rad-done); box-shadow: 0 0 0 1.5px rgba(10,14,20,.8); }
.rad-offline { width: 12px; height: 12px; border-radius: 50%; border: 2px dotted var(--rad-offline); }
.rad-live { width: 26px; height: 26px; } /* no position here: it would override the marker's own absolute positioning */
.rad-live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rad-live); box-shadow: 0 0 0 2px rgba(10,14,20,.8), 0 0 8px rgba(255,181,71,.7); }
.rad-live .rip { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--rad-live); opacity: 0; animation: ripple 2.6s ease-out infinite; }
.rad-live .rip.r2 { animation-delay: 1.3s; }
.rad-live .lbl { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
@keyframes ripple { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.lbl {
  font-family: var(--mono); font-size: 11px; color: #fff; white-space: nowrap; font-weight: 600;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000, 0 0 4px #000;
}
.map-wrap.hide-radar-labels .rad-live .lbl { display: none; }
.map-wrap.hide-radar-labels .rad-live.has-ring .lbl { display: block; }

.ring-mk {
  background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  min-width: 44px; min-height: 44px; justify-content: center;
}
.ring-mk .ico { width: 34px; height: 34px; filter: drop-shadow(0 0 2px #000); }
.ring-mk .lbl { margin-top: 1px; font-size: 12px; }
.ring-mk.cand .ico { width: 42px; height: 42px; filter: drop-shadow(0 0 4px rgba(255,228,92,.45)) drop-shadow(0 0 2px #000); }
.ring-mk.cand .lbl { color: var(--candidate-ink); font-family: var(--ui); font-weight: 800; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.map-wrap.low-zoom .ring-mk.cand .ico { width: 34px; height: 34px; }
.ring-mk[aria-pressed=true] .ico { transform: scale(1.18); }
.ring-mk.past .ico { opacity: .9; }
.dawn-label { pointer-events: none; font-family: var(--ui); font-weight: 700; font-size: 13px; color: #0A0E14; background: var(--dawn-amber); padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 0 12px rgba(232,116,59,.7); }

/* ---------- ring card ---------- */
.card[hidden] { display: none; }
.card {
  position: absolute; z-index: 20; right: calc(var(--sheet-w) + 60px); top: 16px; width: 380px;
  max-width: min(calc(100vw - 32px), calc(100vw - var(--sheet-w) - 72px));   /* never wider than the map beside the ring list */
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 18px; padding: 12px 14px 12px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  max-height: calc(100% - 32px); display: flex; flex-direction: column;
}
.card-close {
  position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
}
.card-close:hover { background: rgba(255,255,255,.06); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.chip .ico { width: 22px; height: 22px; }
.chip.ring { background: var(--live-fill); color: #0A0E14; }
.chip.ring .ico circle.wall { stroke: #0A0E14; }
.chip.ring .ico circle.core { fill: rgba(10,14,20,.15); }
.chip.cand { background: var(--candidate-fill); color: #0A0E14; }
.chip.cand .ico circle.wall { stroke: #0A0E14; }
.chip.cand .ico text { fill: #0A0E14; }
/* Compact card: the ring art on the left, everything else beside it, so it needs little room on a phone. */
#card-body { overflow-y: auto; min-height: 0; margin-right: -6px; padding-right: 6px; }
.card-main { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 8px; }
.card-main .thumb-lg { width: 112px; max-width: none; border-radius: 12px; }
.card-main .art { margin: 0; }
.card-main .art figcaption { font-size: 10.5px; margin-top: 4px; line-height: 1.3; }
.card h2 { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.15; margin: 0 0 2px; }
.card .sub { margin: 0 0 6px; color: var(--text-muted); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 0; font-size: 13px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-family: var(--mono); }
.birds { margin: 10px 0 0; font-size: 15px; font-weight: 700; }
.birds small { display: inline; font-weight: 400; font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.source { margin: 8px 0 0; padding-top: 6px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.card .note { font-size: 13px; color: var(--candidate-ink); margin: 10px 0 0; }

/* ---------- about drawer ---------- */
.about {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(520px, 100vw); max-width: 100vw; border: 0; border-left: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); padding: 24px 22px 40px; overflow-y: auto; position: fixed;
}
.about::backdrop { background: rgba(5,7,10,.7); }
.about-glow { position: absolute; inset: 0 0 auto 0; height: 220px; background: var(--dawn-glow); opacity: .35; pointer-events: none; mask-image: linear-gradient(#000, transparent); -webkit-mask-image: linear-gradient(#000, transparent); }
.about > * { position: relative; }
.about-close-row { position: sticky; top: 0; height: 0; z-index: 2; }
.about h2 { font-weight: 800; font-size: 30px; margin: 4px 44px 10px 0; line-height: 1.1; }
.about h3 { font-size: 17px; margin: 22px 0 6px; }
.about p, .about li { color: var(--text); font-size: 15px; }
.about ul { padding-left: 20px; }
.about li { margin-bottom: 6px; }
.coming { margin-top: 26px; padding: 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--border-strong); }
.coming-title { font-weight: 800; font-size: 22px; margin: 0 0 6px; line-height: 1.15; }
.noscript { padding: 16px; }

/* MapLibre controls in night style */
.maplibregl-ctrl-group { background: var(--surface-raised); border: 1px solid var(--border-strong); }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
/* MapLibre's compact attribution sets black text for its own white pill; ours is dark, so the text must be light. */
.maplibregl-ctrl-attrib { background: rgba(10,14,20,.85) !important; color: var(--text) !important; font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--text) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* ---------- mobile: bottom sheet ---------- */
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .topbar { gap: 10px; padding: 4px 4px 4px 12px; padding-top: max(4px, env(safe-area-inset-top)); }
  .brand img { height: 17px; }
  .where-place { font-size: 13px; }
  .where-meta { font-size: 11px; }
  .tally-label { font-size: 12px; }
  .sheet-body { display: flex; flex-direction: column; }
  .sheet-body .dawn-card { order: 2; margin: 16px 0 0; }
  .sheet-body [role=tabpanel] { order: 1; }
  .tally-num { font-size: 20px; }
  .layout { flex-direction: column; }
  /* A drag sheet: always full height, slid down by --sheet-y (set by js/app.js) to rest at peek, half or full. */
  .sheet {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0; width: auto; z-index: 6;
    border-left: 0; border-top: 1px solid var(--border-strong); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.45);
    transform: translateY(var(--sheet-y, 60%)); transition: transform .32s cubic-bezier(.2,.8,.2,1); will-change: transform;
  }
  .sheet.dragging { transition: none; }
  .sheet-handle, .sheet-head { touch-action: none; user-select: none; -webkit-user-select: none; }
  .sheet-body { overflow-y: hidden; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .sheet.full .sheet-body { overflow-y: auto; }
  .sheet:not(.full) .sheet-body { touch-action: none; }
  .sheet-handle { display: grid; place-items: center; width: 100%; height: 30px; background: none; border: 0; cursor: grab; }
  .legend { right: 52px; top: 10px; max-height: calc(100% - 20px - var(--sheet-peek, 0px)); }
  .sheet-head { padding-top: 0; }
  .sheet-title { font-size: 19px; margin-bottom: 6px; }
  .card { left: 10px; right: 10px; width: auto; max-width: none; top: auto; bottom: 10px; max-height: 50%; padding: 10px 12px; }
  .card-main { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .card-main .thumb-lg { width: 96px; }
  .about { width: 100vw; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rad-live .rip { opacity: .55; transform: scale(1); }
  .rad-live .rip.r2 { transform: scale(.62); }
}

/* ring art (detector thumbnails: 120 km square, north up, NWS colors, transparent) */
.thumb { position: relative; display: block; background: var(--map-basemap); border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb-sm { width: 52px; height: 52px; }
.thumb-lg { width: 100%; aspect-ratio: 1; max-width: 240px; border-radius: 14px; }
.thumb-badge { position: absolute; right: 2px; bottom: 2px; background: rgba(10,14,20,.85); border-radius: 50%; display: grid; place-items: center; }
.thumb-sm .thumb-badge .ico { width: 18px; height: 18px; }
.thumb-lg .thumb-badge { right: 6px; bottom: 6px; }
.thumb-lg .thumb-badge .ico { width: 26px; height: 26px; }
.thumb.no-art { display: grid; place-items: center; }
.thumb.no-art .thumb-badge { position: static; background: none; }
.thumb-sm.no-art .thumb-badge .ico { width: 30px; height: 30px; }
.art { margin: 10px 0 12px; }
.art figcaption { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 6px; }


/* national zoom: smaller ring icons, labels only on the selected ring (the list carries the details) */
.map-wrap.low-zoom .ring-mk .ico { width: 28px; height: 28px; }
/* Zoomed out, the radars are background: small, quiet, no ripples, so the rings are what you see first.
   They come back to full strength as you zoom in. */
.map-wrap.far-zoom .rad-live { width: 10px; height: 10px; }
.map-wrap.far-zoom .rad-live .dot { width: 5px; height: 5px; opacity: .7; box-shadow: none; }
.map-wrap.far-zoom .rad-live .rip { display: none; }
.map-wrap.far-zoom .rad-pre { width: 6px; height: 6px; border-width: 1.5px; opacity: .55; }
.map-wrap.far-zoom .rad-done { width: 4px; height: 4px; opacity: .55; box-shadow: none; }
.map-wrap.far-zoom .rad-offline { width: 7px; height: 7px; border-width: 1.5px; opacity: .6; }
.map-wrap.mid-zoom .rad-live .dot { width: 7px; height: 7px; box-shadow: 0 0 0 2px rgba(10,14,20,.8); }
.map-wrap.mid-zoom .rad-live .rip { border-width: 1.5px; }
.map-wrap.mid-zoom .rad-live .rip.r2 { display: none; }
.map-wrap.far-zoom .ring-mk .ico { filter: drop-shadow(0 0 6px rgba(4,233,231,.55)) drop-shadow(0 0 2px #000); }
.map-wrap.low-zoom .ring-mk .lbl { display: none; }
.map-wrap.low-zoom .ring-mk[aria-pressed=true] .lbl { display: block; }

/* ---------- scroll cues: yellow up/down arrows instead of hard-to-see scrollbars ---------- */
.scroll-cued { scrollbar-width: none; }
.scroll-cued::-webkit-scrollbar { display: none; }
.cue { position: sticky; z-index: 3; height: 0; display: flex; justify-content: flex-end; pointer-events: none; }
.cue.up { top: 0; }
.cue.down { bottom: 0; }
.cue button {
  pointer-events: auto; width: 34px; height: 34px; margin-right: -2px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px rgba(0,0,0,.5);
  display: grid; place-items: center; transition: opacity .2s, transform .2s;
}
.cue.up button { transform: translateY(4px); }
.cue.down button { transform: translateY(-38px); }
.cue button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cue[hidden] { display: flex; }
.cue[hidden] button { opacity: 0; pointer-events: none; }
.grip { width: 32px; height: 12px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.sheet.full .grip { transform: rotate(180deg); }
.cue.up { order: -1; }
.cue.down { order: 99; }

/* ---------- radars pop up as dawn approaches (radarPhase in js/app.js) ---------- */
.radb { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.radb:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.radb.ph-far { pointer-events: none; width: 8px; height: 8px; }
.rad-far { width: 4px; height: 4px; border-radius: 50%; background: var(--rad-pre); opacity: .35; }
.rad-soon { position: relative; width: 14px; height: 14px; display: grid; place-items: center; }
.rad-soon .dot { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--rad-live); background: rgba(10,14,20,.8); box-shadow: 0 0 10px rgba(255,181,71,.45); }
.soon-chip { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: #0A0E14;
  background: var(--rad-live); padding: 1px 6px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.radb.pop { animation: rad-pop .7s cubic-bezier(.2,1.6,.4,1) both; }
.radb.pop::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rad-live); animation: rad-burst 1s ease-out forwards; pointer-events: none; }
@keyframes rad-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes rad-burst { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }
.map-wrap.far-zoom .soon-chip { display: none; }
.map-wrap.far-zoom .rad-soon .dot { width: 8px; height: 8px; border-width: 2px; }
.map-wrap.far-zoom .radb { width: 22px; height: 22px; }

/* radar card */
.rad-chip { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); padding: 3px 10px 3px 8px; }
.rad-chip-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--rad-pre); }
.rad-chip.ph-live .rad-chip-dot { background: var(--rad-live); border-color: var(--rad-live); box-shadow: 0 0 6px var(--rad-live); }
.rad-chip.ph-soon .rad-chip-dot { border-color: var(--rad-live); }
.rad-chip.ph-done .rad-chip-dot { background: var(--rad-done); border-color: var(--rad-done); }
.rad-chip.ph-offline .rad-chip-dot { border-style: dotted; border-color: var(--rad-offline); }
.rad-scan { position: relative; background: var(--map-basemap); }
.rad-scan img { object-fit: contain; }
.rad-scan-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--rad-live); box-shadow: 0 0 0 2px rgba(10,14,20,.8); }
.rad-rain { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.rad-rings { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rad-ring { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 600 13px var(--mono); cursor: pointer; }
.rad-ring .ico { width: 22px; height: 22px; }
.btn-alert { margin-top: 10px; width: 100%; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--accent); background: transparent; color: var(--text); font: 700 15px var(--ui); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-alert::before { content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0-6 6v4l-2 3h16l-2-3V9a6 6 0 0 0-6-6zm-2 15a2 2 0 0 0 4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0-6 6v4l-2 3h16l-2-3V9a6 6 0 0 0-6-6zm-2 15a2 2 0 0 0 4 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn-alert.on { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .radb.pop, .radb.pop::after { animation: none; } }
.lg-icon.lg-soon::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--rad-live); box-shadow: 0 0 6px rgba(255,181,71,.45); }
#card-title:focus { outline: none; }
.near-me.nope { border-color: var(--rad-offline); animation: nope .45s ease-in-out; }
.near-me.nope svg { stroke: var(--rad-offline); }
@keyframes nope { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .near-me.nope { animation: none; } }
.where-place.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.where-near { font-family: var(--ui); }
@media (max-width: 760px) { .where-near { display: none; } }
/* The card's × always wins: no up-arrow over it (scroll back up by swiping), and it sits above everything. */
#card-body > .cue.up { display: none; }
.card-close { z-index: 6; }
.card.swiping { transition: none; }
.card { transition: transform .2s ease-out; }
/* Radar card placeholder before the first scan: a quiet radar scope with a slow sweep, sized to the art column. */
.rad-scope { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  background:
    radial-gradient(circle, var(--rad-live) 0 2.5px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 15px, rgba(140,150,196,.28) 15px 16px),
    var(--map-basemap); }
.rad-scope .sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,181,71,.38), rgba(255,181,71,0) 70deg, transparent 360deg);
  animation: scope-sweep 4s linear infinite; }
@keyframes scope-sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rad-scope .sweep { animation: none; } }
/* keep the last lines clear of the down arrow */
#card-body { padding-bottom: 10px; }
@media (max-width: 760px) { .card { max-height: 58%; } }

/* ---------------------------------------------------------------- the live run (js/run.js) */
.btn-catch { width: 100%; margin: 10px 0 6px; }
.catch-steer { display: grid; }
.catch-steer .btn-ghost { margin-top: 0; }
body.catching #map .maplibregl-canvas { cursor: crosshair; }
body.catching .card { display: none; }
body.catching #near-me { visibility: hidden; }   /* the score bar needs the room, and Near me would fly off the radar */
.run-hud {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6; width: min(640px, calc(100% - 32px));   /* room for "Replay · Evansville, IN" beside the scores */
  display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; align-items: center;
  padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(10,14,20,.88); border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(6px);
}
.rh-where { display: flex; flex-direction: column; min-width: 0; }
.rh-where b { font-family: var(--display); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-where span { font-size: 12px; color: var(--text-muted); }
.rh-score { display: flex; gap: 14px; margin: 0; }
.rh-score div { display: flex; flex-direction: column; align-items: flex-start; }
.rh-score dt { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.rh-score dd { margin: 0; font-size: 18px; font-weight: 700; }
.rh-score .pips { display: flex; gap: 4px; padding-top: 6px; }
.rh-score .pips i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.rh-score .pips i.on { background: var(--accent); border-color: var(--accent); }
.rh-score .out dt { color: var(--rad-offline); }
.rh-exit { min-height: 38px; grid-row: 1; grid-column: 3; }
.rh-coach { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--accent); }
@media (max-width: 1100px) {
  /* Phones, and any map narrower than the wide bar needs (a tablet held upright, a small window: the ring list takes
     380 px beside the map): a compact bar, so the radar and its rings stay in view. */
  .run-hud { top: 8px; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 7px 8px 8px 12px; border-radius: 14px; }
  .rh-where b { font-size: 15px; }
  .rh-where span { font-size: 11px; }
  /* The score row never wraps, at any score or phone width: each figure sits under a small label, so the row is only
     as wide as its four values. (Side by side, labels and values ran past 360 px once the points reached five
     digits, and "Misses left" dropped to a line of its own.) */
  .rh-score { grid-column: 1 / -1; grid-row: 2; gap: 16px; align-items: flex-start; flex-wrap: nowrap; }
  .rh-score div { flex: none; white-space: nowrap; }
  .rh-score dt { font-size: 9px; letter-spacing: .05em; line-height: 1.2; }
  .rh-score dd { font-size: 14px; line-height: 1.25; }
  .rh-score .pips { padding-top: 5px; gap: 4px; }
  .rh-score .pips i { width: 7px; height: 7px; }
  .rh-exit { grid-row: 1; grid-column: 2; min-height: 32px; padding: 4px 14px; }
  .rh-coach { font-size: 12.5px; }
  .rp-btn { min-width: 34px; min-height: 30px; font-size: 12px; }
  .rp-track i { flex-basis: 6px; height: 6px; }
  body.catching #near-me, body.catching .maplibregl-ctrl-top-right { visibility: hidden; }
}

/* A tap on the radar: a crosshair that settles into its result. */
.tap-mk { width: var(--tap, 26px); height: var(--tap, 26px); pointer-events: none; }   /* --tap: run.js sizes it to ~18 km of ground */   /* no position: see .maplibregl-marker at the top */
.tap-mk i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--text); }
.tap-mk i + i { inset: 35%; background: var(--text); border: 0; }
.tap-mk.st-sending i:first-child { animation: tapPulse .9s ease-out infinite; }
.tap-mk.st-scored i { border-color: var(--live-fill); box-shadow: 0 0 10px var(--live-fill); }
.tap-mk.st-scored i + i { background: var(--live-fill); }
.tap-mk.st-pending i, .tap-mk.st-review i { border-color: var(--candidate-fill); border-style: dashed; }
.tap-mk.st-pending i + i, .tap-mk.st-review i + i { background: var(--candidate-fill); }
.tap-mk.st-miss { opacity: .7; }
.tap-mk.st-miss i { border-color: var(--missed-ink); }
.tap-mk.st-miss i + i { background: var(--missed-fill); }
/* A tap on real echo that isn't a ring: free, so a plain crosshair, neither a hit nor a miss. */
.tap-mk.st-echo { opacity: .75; }
.tap-mk.st-echo i { border-color: var(--text-muted); border-width: 1.5px; }
.tap-mk.st-echo i + i { background: var(--text-muted); }
/* your call: echo the detector is still deciding on. It pulses and is labelled until it's a catch or the watch ends. */
.tap-call { display: none; position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); white-space: nowrap;
  font: 700 10px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--candidate-ink);
  background: rgba(10,14,20,.78); padding: 3px 5px; border-radius: 4px; }
.tap-mk.st-echo.is-watching { opacity: 1; }
.tap-mk.st-echo.is-watching i { border-color: var(--candidate-fill); border-width: 2px; }
.tap-mk.st-echo.is-watching i + i { background: var(--candidate-fill); }
.tap-mk.st-echo.is-watching i:first-child { animation: callPulse 1.8s ease-in-out infinite; }
.tap-mk.st-echo.is-watching .tap-call { display: block; }
@keyframes callPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .tap-mk.st-echo.is-watching i:first-child { animation: none; } }
@keyframes tapPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* Points rise out of the tap. */
.pts-anchor { pointer-events: none; z-index: 5; }
.pts-pop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: none; text-align: center;
  padding: 6px 12px; border-radius: 12px; background: rgba(10,14,20,.9); border: 1px solid var(--border-strong);
  animation: ptsRise 4s ease-out forwards; white-space: nowrap; }
.pts-pop b { font-family: var(--display); font-size: 26px; line-height: 1; }
.pts-pop span { font-size: 12px; font-family: var(--mono); color: var(--text-muted); }
.pts-pop.scored b { color: var(--live-fill); text-shadow: 0 0 14px rgba(4,233,231,.6); }
.pts-pop.scored span:nth-child(n+3) { color: var(--first-light-ink); font-weight: 700; }
.pts-pop.pending b { color: var(--candidate-ink); font-size: 18px; }
.pts-pop.miss b { color: var(--missed-ink); font-size: 18px; }
.pts-pop.already b { font-size: 16px; }
.pts-pop.echo b { color: var(--text); font-size: 17px; }

/* After a miss: a faint arrow at the tap toward the nearest ring still to catch, with one line saying which way
   (run.js showHint). The anchor has no size, so everything is placed from the tap itself. */
.hint-anchor { width: 0; height: 0; pointer-events: none; z-index: 4; }
.hint { position: absolute; left: 0; top: 0; animation: hintFade 6s ease-out forwards; }
.hint-arrow { position: absolute; left: -2px; top: -50px; width: 4px; height: 30px; border-radius: 2px; background: var(--accent); opacity: .8;
  transform-origin: 2px 50px; transform: translate(var(--ax, 0px), var(--ay, 0px)) rotate(var(--deg, 0deg)); filter: drop-shadow(0 0 3px rgba(10,14,20,.95)); }   /* from 20 to 54 px out from the tap */
.hint-arrow::before { content: ''; position: absolute; left: -5px; top: -4px; border: 7px solid transparent; border-top: 0; border-bottom: 12px solid var(--accent); }
.hint.is-behind .hint-arrow { top: 20px; transform-origin: 2px -20px; }   /* no room ahead: the arrow sits on the near side, pointing the same way */
.hint-text { position: absolute; top: 62px; left: 0; transform: translateX(calc(-50% + var(--dx, 0px))); white-space: nowrap; padding: 3px 10px;
  border-radius: 999px; font: 600 12.5px/1.3 var(--ui); color: var(--text); background: rgba(10,14,20,.82); border: 1px solid var(--border-strong); }
.hint.is-above .hint-text { top: auto; bottom: 60px; }   /* clear of the ring list; the tap's own words go above it */
@keyframes hintFade { 0% { opacity: 0; } 6% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hint { animation: none !important; } }
@keyframes ptsRise { 0% { transform: translateY(8px) scale(.9); opacity: 0; } 12% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pts-pop, .tap-mk i { animation: none !important; } }
.hunt-item { border-color: var(--accent); }
.hunt-item .hunt-q { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--accent);
  color: var(--accent); font-family: var(--display); font-weight: 800; }
.hunt-item .ri-size { color: var(--accent); font-weight: 700; }
.thumb-clip { aspect-ratio: auto; display: flex; align-items: center; }
.cards-sum { width: 100%; margin: 0 0 4px; font-size: 13px; color: var(--text-muted); }

/* Replay Today: transport and a dot per scan. */
.rh-replay { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.rp-btn { min-width: 40px; min-height: 36px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: 700 13px var(--mono); cursor: pointer; }
.rp-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.rp-track { display: flex; gap: 3px; flex: 1; min-width: 0; justify-content: flex-end; align-items: center; }   /* one row: dots narrow on a long morning */
.rp-track i { flex: 0 1 7px; min-width: 2px; height: 7px; border-radius: 4px; background: var(--border-strong); }
.rp-track i.past { background: var(--text-muted); }
.rp-track i.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.run-hud.is-replay { border-color: var(--civil-violet); }
.streak-line { color: var(--accent); font-weight: 700; }

/* Boards (js/boards.js). */
.bd-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.bd-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.bd-seg button { min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--text-muted); font: 700 13px var(--ui); cursor: pointer; }
.bd-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.bd-select { min-height: 36px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 13px var(--ui); padding: 0 8px; max-width: 100%; }
.bd-head { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.bd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bd-list li { display: grid; grid-template-columns: 34px 1fr auto 76px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.bd-list li.bd-you { border-color: var(--accent); }
.bd-list li:nth-child(-n+3) .bd-rank { color: var(--accent); font-weight: 800; }
.bd-rank { text-align: right; color: var(--text-muted); }
.bd-who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pts { font-weight: 700; }
.bd-m { color: var(--text-muted); font-size: 12px; text-align: right; }
.bd-pin { margin: 8px 0 0; color: var(--accent); }
.bd-name { margin: 12px 0 0; font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bd-name input { min-height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0 10px; font: 600 14px var(--ui); }
.bd-link { background: none; border: 0; color: var(--accent); font: 700 14px var(--ui); cursor: pointer; padding: 0; text-decoration: underline; }
.bd-msg { color: var(--rad-offline); font-size: 13px; width: 100%; }
.tabs [role=tab] { white-space: nowrap; }
@media (max-width: 420px) { .tabs [role=tab] { padding: 0 9px; font-size: 15px; } }
/* The narrowest phones (320 px): the four tabs and the header's clock both need the room. */
@media (max-width: 350px) {
  .tabs [role=tab] { padding: 0 6px; font-size: 14px; }
  .tally-extra { display: none; }
}

/* Labeling a Potential ring from its card. */
.lbx { margin: 10px 0 0; padding: 10px; border-radius: 12px; border: 1px dashed var(--candidate-fill); background: rgba(255,228,92,.06); }
.lbx-q { margin: 0 0 8px; font-size: 14px; }
.lbx-q:last-child { margin: 0; }
.lbx-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lbx .lb-btn { min-height: 40px; padding: 0 12px; font-size: 14px; }
.lbx-link { background: none; border: 0; padding: 0; color: var(--accent); font: 700 14px var(--ui); text-decoration: underline; cursor: pointer; }
.ring-actions { margin: 10px 0 4px; display: flex; }
.ring-actions > button { flex: 1; }
.scan-note { margin: 8px 0 0; font-size: 12px; color: var(--accent); }
.area-replay { position: absolute; left: 12px; top: 64px; z-index: 4; margin: 0;
  max-width: calc(100% - 84px); padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(10,14,20,.86); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.area-replay > span { overflow: hidden; text-overflow: ellipsis; }
.area-replay .replay-btn { flex: none; }
@media (min-width: 881px) { .area-replay { top: 64px; } }
body.catching .area-replay { display: none; }
.replay-btn { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; margin-left: 4px; cursor: pointer; }
.rh-loop { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rh-loop .replay-btn { font-size: 11px; padding: 0 8px; }
/* Rings this player has already caught: marked on the map, in the list and on the card. */
.ring-mk.caught .ico { opacity: .45; }
.ring-mk.caught .lbl { font-size: 0; }
.ring-mk.caught .lbl::after { content: '\2713 Caught'; font-family: var(--ui); font-weight: 800; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ring-item.is-caught { opacity: .7; }
.ri-state.is-caught { color: var(--accent); }
.card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.caught { background: var(--accent); color: #0A0E14; padding: 3px 10px; }
.ring-nav { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
.ring-nav-btn { flex: 1; }
.ring-nav-n { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ring-nav-done { margin: 8px 0 4px; font-size: 13px; color: var(--accent); }
/* Catch mode: Previous / Next radar with rings still to catch. */
.rh-nav { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.rh-nav-n { flex: 1; text-align: center; font-size: 12px; color: var(--text-muted); }
.rh-nav-n.is-hint { color: var(--accent); font-size: 12.5px; line-height: 1.25; }   /* the first-tap help, between the arrows: short enough for one line */
.rh-nav .rp-btn { min-width: 36px; min-height: 28px; padding: 0 10px; }
/* Touch screens (phones, iPads): thumb-sized arrows. */
@media (pointer: coarse) { .rh-nav .rp-btn { min-width: 44px; min-height: 34px; } }
/* The narrowest phones (320 px): the loop line's Pause stays on the same line as the scan time. */
@media (max-width: 359px) { .rh-nav { gap: 4px; } .rh-nav-n.is-hint { font-size: 11.5px; }
  .rh-loop { flex-wrap: nowrap; white-space: nowrap; font-size: 10px; } .rh-loop .replay-btn { padding: 0 5px; font-size: 10px; margin-left: 2px; } .rh-exit { padding: 4px 10px; } .run-hud { column-gap: 6px; padding-left: 10px; } }
/* Rings players voted out in Label mode (verdicts.js): dimmed and dashed, never hidden. */
.ring-mk.doubted .ico { opacity: .4; filter: grayscale(.7); }
.ring-mk.doubted .lbl { text-decoration: line-through; opacity: .7; }
.ri-state.is-doubted { color: var(--text-muted); }
.chip.crowd { background: var(--surface); border: 1px solid var(--border-strong); padding: 3px 10px; font-weight: 600; }
.chip.crowd.not { color: var(--text-muted); }
.chip.crowd.ring { color: var(--live-ink); }

/* Thumb-sized targets on touch screens (44 px), where the mouse sizes were 18-40 px: the species chips, the
   leaderboard switches and "Change name", and the round header and map buttons. */
@media (pointer: coarse) {
  .bd-seg button { min-height: 44px; }
  .bd-link { min-height: 44px; display: inline-flex; align-items: center; }
  .icon-btn { width: 44px; height: 44px; }
  .area-replay .replay-btn, .scan-note .replay-btn { min-height: 32px; padding: 4px 14px; }
}
/* On the narrowest phones the scroll cue sat on top of "Next ›" in the ring card: keep the row clear of it. */
@media (max-width: 359px) { .ring-nav { padding-right: 44px; } }
