/* Hallmark · shape: app screen · genre: playful · theme: custom (Lookout tickets, from prototype G4)
 * paper: #e7e8e2 platform grey, tickets #fffdf6 cream · accent: the line you're at (html[data-line]), ink #1b1f24 for the main tap, purple #80276c stamps, MBTA line colours as line data
 * nav: top HUD (rank, points, rival) + 4 tabs · signature: every egg is a ticket; the clock punches holes, a find throws chads and slams a stamp · states: locating, denied, nearby, in range, open, found, yours, empty, hot, low time, expired, no match
 * axes: light/grotesk/line-colour · posture: two inks + line colour · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E5 S5 R4 V4 · weakest: H, many screens at one density; only the find moves, everything else stays still */

:root {
  /* paper and ink */
  --paper: #e7e8e2;
  --ticket: #fffdf6;
  --paper-3: #f2efe4;
  --desk: #d4d6ce;
  --ink: #1b1f24;
  --ink-2: #3b424a;
  --muted: #5d646c;
  --rule: #d8d6cb;
  --perf: #cfcabb;
  --hole-shade: color-mix(in oklab, var(--ink) 22%, transparent);
  --stamp: #80276c;
  --good: #2f7d4f;
  --bad: #b42318;
  --low: #b42318;
  --focus: #2b5cd6;
  --scrim: color-mix(in oklab, var(--ink) 92%, transparent);

  /* MBTA lines (line data) */
  --line-red: #da291c;
  --line-orange: #ed8b00;
  --line-blue: #003da5;
  --line-green: #00843d;
  --line-red-deep: #b31f14;
  --line-orange-deep: #c46f00;
  --line-blue-deep: #002e7d;
  --line-green-deep: #006b31;

  /* the line you're at: set by html[data-line] */
  --here: var(--ink);
  --here-deep: #0d1014;
  --here-ink: var(--ticket);

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wide: 85%;
  --notch: 10px;
  --radius: 8px;
  --tabs-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;

  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem;
  color-scheme: light;
}
html[data-line="Green"] { --here: var(--line-green); --here-deep: var(--line-green-deep); --here-ink: var(--ticket); }
html[data-line="Red"] { --here: var(--line-red); --here-deep: var(--line-red-deep); --here-ink: var(--ticket); }
html[data-line="Blue"] { --here: var(--line-blue); --here-deep: var(--line-blue-deep); --here-ink: var(--ticket); }
html[data-line="Orange"] { --here: var(--line-orange); --here-deep: var(--line-orange-deep); --here-ink: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--space-lg));
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.02em; line-height: 1.05; overflow-wrap: break-word; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--here) 25%, transparent); }

main { max-width: 560px; margin: 0 auto; padding: var(--space-xs) var(--space-md) var(--space-md); }
main > * + * { margin-top: var(--space-md); }
.stack > * + * { margin-top: var(--space-sm); }
.row { display: flex; align-items: center; gap: var(--space-xs); }

/* ---------- HUD: brand, rank, points, rival ---------- */
.hud { position: sticky; top: 0; z-index: 10; max-width: 560px; margin: 0 auto; padding: calc(var(--space-sm) + env(safe-area-inset-top)) var(--space-md) var(--space-xs); background: var(--paper); }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.hud-quiet .rival { display: none; }
.hud-right { display: flex; align-items: center; gap: var(--space-xs); }
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ticket); color: var(--ink); }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.bell-n { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--stamp, #b0154f); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); font-weight: 800; font-stretch: var(--wide); font-size: 1.4rem; letter-spacing: -0.02em; text-decoration: none; }
.brand-l { font-size: 1.6rem; margin-bottom: var(--space-md); }
.mypts { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs); border-radius: 999px; background: var(--ticket); color: var(--ink-2); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out); }
a.mypts:hover { background: var(--paper-3); }
.mypts b { color: var(--ink); font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mypts-here { padding-left: var(--space-sm); }
.mypts-here b { color: var(--here); }
html[data-line="Orange"] .mypts-here b { color: var(--here-deep); }
.rank-chip { padding: var(--space-3xs) var(--space-xs); border-radius: 999px; background: var(--ink); color: var(--ticket); font-weight: 800; font-size: var(--text-xs); }
.rival { display: grid; gap: var(--space-2xs); margin-top: var(--space-xs); color: var(--ink-2); font-size: var(--text-xs); text-decoration: none; }
.rival b { color: var(--ink); font-weight: 800; }
.rival:hover .rival-txt { text-decoration: underline; }
.rival-bar { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--here) var(--p), var(--paper-3) var(--p)); }

/* ---------- tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--ticket); border-top: 2px dashed var(--perf); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3xs); color: var(--muted); text-decoration: none; font-size: var(--text-xs); font-weight: 600; transition: color var(--dur-micro) var(--ease-out); }
.tabs a:hover { color: var(--ink); }
.tabs a:active { opacity: 0.7; }
.tabs a[aria-current] { color: var(--here); }
html[data-line="Orange"] .tabs a[aria-current] { color: var(--here-deep); }
.tabs svg, .icon-btn svg, .btn svg, .back svg, .match-verdict svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 48px; padding: 0 var(--space-md); border: 0; border-radius: 10px;
  font-weight: 700; font-size: var(--text-md); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ink { background: var(--ink); color: var(--ticket); }
.btn-ink:hover { background: var(--ink-2); }
.btn-primary { background: var(--here); color: var(--here-ink); }
.btn-primary:hover { background: var(--here-deep); }
html[data-line="Orange"] .btn-primary:hover { color: var(--ticket); }
.btn-ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.btn-ghost:hover { background: var(--paper-3); }
.btn-block { width: 100%; }
.btn-l { min-height: 56px; font-size: 1.1rem; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; margin: calc(var(--space-xs) * -1); border-radius: 10px; color: var(--ink); }
.icon-btn:hover { background: var(--ticket); }
.icon-btn:active, .link:active, .back:active { opacity: 0.7; }
.link { background: none; border: 0; padding: var(--space-xs) 0; color: var(--ink-2); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 44px; color: var(--ink-2); font-weight: 600; font-size: var(--text-sm); text-decoration: none; }
.back:hover { color: var(--ink); }
.back svg { width: 18px; height: 18px; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.field-label { display: block; font-weight: 700; }
.field-hint + .field-label { margin-top: var(--space-sm); }
.opt { color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 48px; padding: 0 var(--space-sm); border: 0; border-radius: var(--radius); background: var(--paper-3); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--perf); }
.input::placeholder { color: var(--muted); }
.input:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: var(--space-2xs); border-radius: 10px; background: var(--paper-3); }
.seg button { border: 0; background: transparent; padding: var(--space-sm) var(--space-2xs); border-radius: 7px; color: var(--ink-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.seg button:hover { color: var(--ink); }
.seg button:active { transform: translateY(1px); }
.seg button[aria-selected="true"] { background: var(--ticket); color: var(--ink); }
#stationPick { margin-top: var(--space-xs); }

.notice { padding: var(--space-sm) var(--space-md); border-radius: var(--radius); background: var(--ticket); font-size: var(--text-sm); }
.notice.row { display: flex; gap: var(--space-sm); align-items: center; }
.notice.bad { box-shadow: inset 0 0 0 2px var(--bad); }
.toast { cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--space-sm)); transform: translateX(-50%); z-index: 20; max-width: calc(100% - 32px); padding: var(--space-sm) var(--space-md); border-radius: 10px; background: var(--ink); color: var(--ticket); font-size: var(--text-sm); }
.empty { display: grid; justify-items: center; gap: var(--space-sm); padding: var(--space-xl) var(--space-md); color: var(--muted); text-align: center; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--perf); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-h { font-size: 2.6rem; line-height: 1; }
.page-sub { color: var(--ink-2); margin-top: var(--space-2xs) !important; }
.sec-h { font-size: 1.6rem; }

/* ---------- the ticket ---------- */
.tk { position: relative; background: var(--ticket); border-radius: var(--radius); }
.tk-top, .tk-bottom { padding: var(--space-md); }
.tk-top { position: relative; }
/* a tear line with a notch bitten out of each edge, exactly where it sits */
.tk-perf { position: relative; height: 2px; padding-inline: var(--space-md); background: repeating-linear-gradient(to right, var(--perf) 0 6px, transparent 6px 11px) content-box; }
.tk-perf::before, .tk-perf::after { content: ""; position: absolute; top: calc(var(--notch) * -1 + 1px); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--paper); }
.tk-perf::before { left: calc(var(--notch) * -1); }
.tk-perf::after { right: calc(var(--notch) * -1); }
.hole { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 2px 3px var(--hole-shade); }
.hole-s { width: 16px; height: 16px; }

/* the band: a ticket's top edge, printed in its line's colour */
.band { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-md); border-radius: var(--radius) var(--radius) 0 0; background: var(--here); color: var(--here-ink); font-weight: 800; font-stretch: var(--wide); }
.band-name { font-size: 1.05rem; }
.band-right { margin-left: auto; font-weight: 700; }
.band-chip { padding: 0 var(--space-xs); border-radius: 4px; background: var(--ln); color: var(--ticket); font-size: var(--text-sm); box-shadow: 0 0 0 1.5px var(--ticket); }
.branches { list-style: none; display: flex; gap: var(--space-2xs); margin: 0 0 0 auto; padding: 0; }
.branches li { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--here-ink); color: var(--here); font-size: var(--text-sm); font-weight: 800; }
.band-lines { display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch; height: 10px; padding: 0; gap: 0; overflow: hidden; }
.band-lines i { background: var(--ln); }

/* the stamp: the game's purple ink, never something you tap */
.stamp { display: inline-block; padding: var(--space-3xs) var(--space-xs); border-radius: 5px; color: var(--stamp); box-shadow: inset 0 0 0 2px var(--stamp); font-weight: 800; font-stretch: var(--wide); font-size: 1rem; line-height: 1.2; transform: rotate(-7deg); }
.stamp-corner { position: absolute; top: var(--space-md); right: var(--space-md); }
.stamp-quiet { color: var(--muted); box-shadow: inset 0 0 0 2px var(--perf); }
.stamp-s { font-size: var(--text-sm); }
.stamp-big { position: absolute; right: var(--space-md); top: var(--space-lg); font-size: 1.35rem; padding: var(--space-2xs) var(--space-sm); box-shadow: inset 0 0 0 3px var(--stamp); transform: rotate(-9deg); }

/* ---------- welcome, locate ---------- */
.welcome-h { font-size: 2.5rem; line-height: 1; }
.welcome-p { color: var(--ink-2); margin-top: var(--space-sm); }
.locate .spin { margin-bottom: var(--space-sm); }
.locate-h { font-size: 2rem; }
.locate-p { color: var(--ink-2); margin: var(--space-xs) 0 var(--space-md); }
.far { color: var(--ink-2); margin-top: var(--space-xs); }
.far b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }

/* station list */
.st-list { list-style: none; margin: var(--space-xs) 0 0; padding: 0; display: grid; gap: var(--space-2xs); }
.st-list a { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius); background: var(--ticket); text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out); }
.st-list a:hover { background: var(--paper-3); }
.st-list a:active { transform: translateY(1px); }
.st-lines { display: flex; gap: var(--space-3xs); }
.st-lines i { width: 6px; height: 28px; border-radius: 3px; background: var(--ln); }
.st-txt { display: grid; flex: 1; min-width: 0; }
.st-txt b { font-weight: 700; }
.st-txt small { color: var(--muted); font-size: var(--text-sm); }
.st-count { padding: var(--space-3xs) var(--space-xs); border-radius: 999px; background: var(--ink); color: var(--ticket); font-weight: 800; font-size: var(--text-xs); }

/* ---------- station ---------- */
.here { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.station { font-size: 3.4rem; line-height: 0.95; padding-right: 96px; overflow-wrap: normal; }
.station-long { font-size: 2.5rem; line-height: 1; }
.next-row { display: grid; grid-template-columns: 6px 1fr auto; gap: var(--space-sm); align-items: center; }
.route { align-self: stretch; min-height: 36px; border-radius: 3px; background: var(--ln, var(--perf)); }
.next-label { color: var(--muted); font-size: var(--text-sm); }
.next-to { font-weight: 800; font-stretch: var(--wide); font-size: 1.25rem; line-height: 1.1; }
.next-none { font-weight: 600; font-stretch: 100%; font-size: var(--text-sm); color: var(--ink-2); }
.next-min { font-weight: 800; font-stretch: 80%; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.next-min small { font-size: var(--text-sm); font-weight: 600; font-stretch: 100%; margin-left: var(--space-3xs); color: var(--ink-2); }
.next-min .now { font-size: 1.4rem; color: var(--here); }
.train-board { display: grid; gap: var(--space-xs); }
.dirs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.dirs li { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: var(--space-sm); align-items: center; }
.dirs-txt { min-width: 0; }
.dirs-to { font-weight: 800; font-stretch: var(--wide); font-size: 1.1rem; line-height: 1.15; overflow-wrap: anywhere; }
.dirs-sub { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.3; }
.dirs-min { font-weight: 800; font-stretch: 80%; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dirs-min small { font-size: var(--text-sm); font-weight: 600; font-stretch: 100%; margin-left: var(--space-3xs); color: var(--ink-2); }
.dirs-min .now { font-size: 1.2rem; color: var(--here); }
.dirs-none { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }

/* daily challenge: a dashed seal waiting for ink */
.challenge { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); border-radius: var(--radius); background: var(--ticket); box-shadow: inset 0 0 0 2px var(--stamp); }
.challenge.is-done { box-shadow: inset 0 0 0 2px var(--perf); }
.seal-mini { display: grid; place-items: center; width: 44px; height: 44px; color: var(--stamp); }
.seal-mini svg { width: 44px; height: 44px; }
.is-done .seal-mini { transform: rotate(-10deg); }
.ch-title { font-weight: 800; font-stretch: var(--wide); font-size: 1.1rem; line-height: 1.1; }
.ch-desc { color: var(--ink-2); font-size: var(--text-xs); }
.ch-steps { list-style: none; display: flex; gap: var(--space-2xs); margin: var(--space-2xs) 0 0; padding: 0; }
.ch-steps li { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: var(--text-xs); font-weight: 800; color: var(--muted); box-shadow: inset 0 0 0 2px var(--perf); }
.ch-steps li.done { background: var(--ln, var(--stamp)); color: var(--ticket); box-shadow: none; }
.ch-reward { color: var(--stamp); font-weight: 800; font-size: var(--text-xs); text-align: right; max-width: 8ch; line-height: 1.15; }

/* your station card: five slots, one per level */
.eggs-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-lg) !important; }
.eggs-count { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.clear { display: grid; justify-items: end; }
.clear-slots { list-style: none; display: flex; gap: var(--space-2xs); margin: 0; padding: 0; }
.slot span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 800; font-size: var(--text-xs); }
.slot.is-open span { box-shadow: inset 0 0 0 2px var(--here); color: var(--ink); }
.slot.is-found span { background: var(--paper); color: var(--muted); box-shadow: inset 0 2px 3px var(--hole-shade); }
.slot.is-mine span { background: var(--stamp); color: var(--ticket); }
.slot.is-empty span { box-shadow: inset 0 0 0 2px var(--perf); color: var(--muted); }
.clear-note { margin-top: var(--space-2xs); color: var(--ink-2); font-size: var(--text-xs); }
.clear-note b { color: var(--ink); }

/* egg stubs: body, tear line, stub with the points and the action */
.stubs { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; gap: var(--space-xs); }
.stub { position: relative; display: grid; grid-template-columns: 44px 1fr 84px; gap: var(--space-sm); align-items: center; min-height: 76px; padding-left: var(--space-sm); background: var(--ticket); border-radius: var(--radius); border-left: 6px solid var(--here); }
.stub-body { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: var(--space-xs); padding-block: var(--space-sm); }
.stub-name { font-weight: 800; font-stretch: var(--wide); font-size: 1.3rem; line-height: 1.05; }
.stub-meta { grid-column: 1 / -1; color: var(--muted); font-size: var(--text-sm); }
.pips { display: inline-flex; gap: var(--space-3xs); }
.pips i { width: 6px; height: 12px; border-radius: 2px; background: var(--perf); }
.pips i.on { background: var(--ink); }
.stub-act {
  position: relative; align-self: stretch; display: grid; place-content: center; justify-items: center; gap: var(--space-3xs);
  border: 0; padding: 0; background: repeating-linear-gradient(to bottom, var(--perf) 0 5px, transparent 5px 10px) left / 2px 100% no-repeat;
  color: var(--here); font: inherit; text-decoration: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}
html[data-line="Orange"] .stub-act { color: var(--here-deep); }
div.stub-act { cursor: default; }
.stub-act::before, .stub-act::after { content: ""; position: absolute; left: calc(var(--notch) * -1 + 1px); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--paper); }
.stub-act::before { top: calc(var(--notch) * -1); }
.stub-act::after { bottom: calc(var(--notch) * -1); }
.stub-act b { font-weight: 800; font-stretch: 80%; font-size: 1.7rem; line-height: 1; }
.stub-act span { font-weight: 700; font-size: var(--text-sm); }
button.stub-act { transition: background-color var(--dur-micro) var(--ease-out); }
button.stub-act:hover { background-color: var(--paper-3); }
button.stub-act:active { transform: translateY(1px); }
button.stub-act[aria-disabled="true"] { opacity: 0.5; cursor: progress; }
.punch { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--here); color: var(--here-ink); font-weight: 800; font-size: 1.3rem; }
.is-hot .stub-meta { color: var(--stamp); font-weight: 700; }
.is-found, .is-mine { border-left-color: var(--perf); }
.is-found .punch { background: var(--paper); color: var(--muted); box-shadow: inset 0 2px 3px var(--hole-shade); }
.is-mine .punch { background: none; color: var(--stamp); box-shadow: inset 0 0 0 2px var(--stamp); }
.is-found .stub-name, .is-mine .stub-name { color: var(--ink-2); }
.is-empty { background: none; border-left: 0; padding-left: var(--space-md); outline: 2px dashed var(--perf); outline-offset: -2px; }
.is-empty .punch { background: none; color: var(--muted); box-shadow: inset 0 0 0 2px var(--perf); }
.is-empty .stub-act { color: var(--ink); }
.is-empty .stub-act::before, .is-empty .stub-act::after { display: none; }

/* ---------- play ---------- */
.play-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 44px; }
.play-title { color: var(--ink-2); font-size: var(--text-sm); }
.play-title b { color: var(--ink); font-weight: 800; font-stretch: var(--wide); font-size: 1.15rem; }
.egg-photo { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--ink); }
.egg-photo img { width: 100%; height: 100%; object-fit: contain; }
.egg-photo-empty { display: grid; place-items: center; padding: var(--space-lg); background: var(--paper-3); box-shadow: inset 0 0 0 2px var(--perf); }
.photo-empty { color: var(--ink-2); text-align: center; max-width: 30ch; }
.hide-tk #pick { margin-top: var(--space-sm); }
.blur-tag { position: absolute; right: var(--space-xs); bottom: var(--space-xs); padding: var(--space-3xs) var(--space-xs); border-radius: 4px; background: var(--ink); color: var(--ticket); font-size: var(--text-xs); font-weight: 700; }
.mini-hidden { display: grid; place-items: center; height: 100%; padding: var(--space-xs); color: var(--muted); font-size: var(--text-xs); font-weight: 700; text-align: center; }
.first-tag { position: absolute; left: var(--space-xs); top: var(--space-xs); padding: var(--space-3xs) var(--space-xs); border-radius: 4px; background: var(--stamp); color: var(--ticket); font-size: var(--text-xs); font-weight: 700; }
.hint { margin-top: var(--space-sm); color: var(--ink-2); }
.hint b { color: var(--ink); margin-right: var(--space-2xs); }
.clock-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-sm); }
.clock { font-size: 4.6rem; line-height: 0.85; font-weight: 800; font-stretch: 75%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.clock.is-low { color: var(--low); }
.bonus { text-align: right; }
.bonus-label { color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; }
.bonus-val { font-weight: 800; font-stretch: 75%; font-size: 2.4rem; line-height: 1; color: var(--here); font-variant-numeric: tabular-nums; }
html[data-line="Orange"] .bonus-val { color: var(--here-deep); }
.punchclock { list-style: none; display: grid; grid-template-columns: repeat(18, 1fr); gap: var(--space-2xs); margin: var(--space-sm) 0 0; padding: 0; }
.punchclock li { aspect-ratio: 1; border-radius: 50%; background: var(--here); transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
.punchclock li.p { background: var(--paper); box-shadow: inset 0 1px 2px var(--hole-shade); transform: scale(0.86); }
.clock-ctx { margin-top: var(--space-xs); color: var(--muted); font-size: var(--text-xs); }
.play-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); align-items: center; }
.report { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-sm); color: var(--muted); font-size: var(--text-sm); }

/* ---------- the find ---------- */
.win-head { font-size: 2.2rem; padding-right: 120px; }
.win-sub { color: var(--ink-2); margin-top: var(--space-xs); }
.win-pts { font-size: 6rem; line-height: 0.9; font-weight: 800; font-stretch: 75%; color: var(--here); margin-top: var(--space-xs); font-variant-numeric: tabular-nums; }
html[data-line="Orange"] .win-pts { color: var(--here-deep); }
/* Confetti from celebrate() in app.js: each piece gets its colour, size, drift, spin and timing as custom properties. */
.confetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; left: var(--ox); top: var(--oy); width: var(--w); height: var(--h); margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2); border-radius: 2px; background: var(--c); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .win-pts { transform-origin: left bottom; animation: win-pop 560ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .confetti i { animation: confetti var(--t) var(--d) forwards; }
  @keyframes win-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  /* Shoot up and out fast, then fall past the bottom of the screen. */
  @keyframes confetti {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); animation-timing-function: cubic-bezier(0.15, 0.7, 0.3, 1); }
    35% { opacity: 1; transform: translate(calc(var(--x) * 0.55), var(--up)) rotate(calc(var(--r) * 0.4)); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), 110vh) rotate(var(--r)); }
  }
}
.match-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.m { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.m img { width: 100%; height: 100%; object-fit: cover; }
.m figcaption { position: absolute; left: var(--space-xs); bottom: var(--space-xs); padding: var(--space-3xs) var(--space-xs); border-radius: 4px; background: var(--ticket); font-size: var(--text-xs); font-weight: 700; }
.match-verdict { display: flex; align-items: center; gap: var(--space-2xs); margin-top: var(--space-xs); color: var(--ink-2); font-size: var(--text-sm); }
.match-verdict.is-ok { color: var(--good); font-weight: 700; }
.match-verdict svg { width: 18px; height: 18px; flex: none; }
.gains { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.gains:empty { display: none; }
.gain { display: grid; grid-template-columns: 40px 1fr; gap: var(--space-sm); align-items: center; padding: var(--space-sm); border-radius: var(--radius); background: var(--ticket); font-size: var(--text-sm); }
.gain b { font-weight: 800; }
.gain-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--ticket); font-weight: 800; font-size: var(--text-sm); }
.gain-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gain-line { background: var(--ln); font-size: 1.1rem; }
.gain-card { background: none; color: var(--ink); box-shadow: inset 0 0 0 2px var(--here); font-stretch: 80%; }
.gain-rival { background: var(--paper-3); color: var(--ink); }
.gain-stamp { box-shadow: inset 0 0 0 2px var(--stamp); }
.gain-stamp b { color: var(--stamp); }
.gain-stamp-ico { background: none; color: var(--stamp); transform: rotate(-10deg); }
.gain-stamp-ico svg { width: 36px; height: 36px; }
.gain-seal { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: var(--space-md); box-shadow: inset 0 0 0 2px var(--stamp); }
.seal-svg { width: 170px; height: 170px; color: var(--stamp); transform: rotate(-12deg); }
.seal-ring { font: 800 13px var(--font); fill: currentColor; }
.seal-mid { font: 800 26px var(--font); fill: currentColor; }
.next-egg { display: grid; gap: var(--space-sm); }
.next-egg-copy { color: var(--ink-2); }

/* ---------- hide ---------- */
.rules { margin: 0; padding-left: var(--space-md); color: var(--ink-2); font-size: var(--text-sm); display: grid; gap: var(--space-2xs); }

/* ---------- ranks ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-xs); padding: var(--space-md); }
.versus-top { display: block; }
.vs-top { font-size: 1.1rem; }
.vs-side { display: grid; gap: var(--space-3xs); min-width: 0; }
.vs-them { text-align: right; }
.vs-name { font-weight: 700; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-sc { font-weight: 800; font-stretch: 75%; font-size: 2.6rem; line-height: 1; color: var(--here); font-variant-numeric: tabular-nums; }
html[data-line="Orange"] .vs-sc { color: var(--here-deep); }
.vs-them .vs-sc { color: var(--ink); }
.vs-rk { color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.vs-mid { text-align: center; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius); background: var(--stamp); color: var(--ticket); }
.vs-gap { font-weight: 800; font-stretch: 80%; font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.vs-gap-l { font-size: var(--text-xs); font-weight: 600; }
.vs-bar { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--paper-3); overflow: hidden; }
.vs-bar span { display: block; height: 100%; background: linear-gradient(to right, var(--here) var(--p), transparent var(--p)); }
.war { padding: var(--space-md); }
.war-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-xs); flex-wrap: wrap; }
.war-title { font-size: 1.3rem; }
.war-sub { color: var(--muted); font-size: var(--text-xs); }
.war-bars { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; gap: var(--space-xs); }
.war-bars li { display: grid; grid-template-columns: 56px 1fr 52px; gap: var(--space-xs); align-items: center; }
.war-name { font-weight: 700; font-size: var(--text-sm); }
.war-bar { height: 14px; border-radius: 3px; background: linear-gradient(to right, var(--ln) var(--w), var(--paper-3) var(--w)); }
.war-bars b { font-weight: 800; font-stretch: 85%; text-align: right; font-variant-numeric: tabular-nums; }
.podium { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: var(--space-xs); margin: var(--space-md) 0 0; padding: 0; }
.pod a { display: grid; justify-items: center; text-align: center; gap: var(--space-3xs); text-decoration: none; }
.pod a:hover .pod-name { text-decoration: underline; }
.pod-name { font-weight: 700; font-size: var(--text-xs); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-sc { font-weight: 800; font-stretch: 80%; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.pod-rk { display: grid; place-items: center; width: 100%; border-radius: var(--radius) var(--radius) 0 0; background: var(--ticket); font-weight: 800; font-stretch: 80%; font-size: 1.8rem; color: var(--ink-2); }
.pod-1 .pod-rk { height: 84px; background: var(--ink); color: var(--ticket); }
.pod-2 .pod-rk { height: 62px; }
.pod-3 .pod-rk { height: 46px; }
.pod.is-me .pod-rk { box-shadow: inset 0 0 0 3px var(--here); }
.ranks { list-style: none; margin: var(--space-xs) 0 0; padding: 0; }
.ranks li + li { border-top: 2px dashed var(--perf); }
.ranks a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-xs); text-decoration: none; border-radius: var(--radius); transition: background-color var(--dur-micro) var(--ease-out); }
.ranks a:hover { background: var(--ticket); }
.rk { font-weight: 800; font-stretch: var(--wide); font-size: 1.3rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.who { display: grid; }
.who b { font-weight: 600; }
.who small { color: var(--muted); font-size: var(--text-sm); }
.sc { font-weight: 800; font-stretch: 80%; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ranks .is-me a { background: var(--here); color: var(--here-ink); }
.ranks .is-me .rk, .ranks .is-me small { color: inherit; }
.ranks .is-me + li { border-top-color: transparent; }

/* ---------- tickets (profile) ---------- */
.level-top { display: grid; grid-template-columns: 1fr 64px; gap: var(--space-sm); align-items: center; }
.level-badge { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--ticket); font-weight: 800; font-stretch: 75%; font-size: 2.2rem; box-shadow: 0 0 0 4px var(--ticket), 0 0 0 6px var(--ink); }
.level-tk .page-h { font-size: 2rem; }
.level-tk .page-sub { font-size: var(--text-sm); }
.xp { height: 12px; border-radius: 6px; background: var(--paper-3); overflow: hidden; }
.xp span { display: block; height: 100%; background: linear-gradient(to right, var(--here) var(--p), transparent var(--p)); }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); margin: var(--space-sm) 0 0; }
.tk-bottom.mini-stats { margin: 0; }
.mini-stats dt { color: var(--muted); font-size: var(--text-xs); line-height: 1.2; }
.mini-stats dd { margin: 0; font-weight: 800; font-stretch: 80%; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.line-badges { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
.lb { display: grid; justify-items: center; gap: var(--space-2xs); padding: var(--space-sm) var(--space-2xs); border-radius: var(--radius); background: var(--ticket); }
.lb-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--perf); color: var(--muted); font-weight: 800; }
.lb.is-got .lb-dot { background: var(--ln); color: var(--ticket); box-shadow: none; }
.lb-n { font-size: var(--text-xs); color: var(--ink-2); font-weight: 600; }
.stamps { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md) var(--space-xs); }
.st { display: grid; justify-items: center; gap: var(--space-2xs); text-align: center; }
.st p { font-size: var(--text-xs); color: var(--muted); line-height: 1.25; }
.st-seal { display: grid; place-items: center; width: 80px; height: 80px; padding: var(--space-xs); border-radius: 50%; color: var(--muted); font-weight: 800; font-stretch: var(--wide); line-height: 1.05; overflow-wrap: normal; word-break: keep-all; hyphens: none; box-shadow: inset 0 0 0 2px var(--perf); outline: 2px dashed var(--perf); outline-offset: -9px; }
.st.is-got .st-seal { color: var(--stamp); background: var(--ticket); box-shadow: inset 0 0 0 3px var(--stamp); outline: 1.5px solid var(--stamp); transform: rotate(-8deg); }
.st.is-got:nth-child(2n) .st-seal { transform: rotate(6deg); }
.st.is-got .st-station { color: var(--ln); box-shadow: inset 0 0 0 3px var(--ln); outline-color: var(--ln); }
.st.is-got p { color: var(--ink-2); font-weight: 600; }
.book { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.mini { position: relative; padding-bottom: var(--space-xs); border-radius: var(--radius); background: var(--ticket); overflow: hidden; }
.mini-band { padding: var(--space-2xs) var(--space-xs); background: var(--ln); color: var(--ticket); font-weight: 800; font-stretch: var(--wide); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-band-dark { color: var(--ink); }
.mini-pic { margin: var(--space-xs) var(--space-xs) 0; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--paper-3); }
.mini-pic img { width: 100%; height: 100%; object-fit: cover; }
.mini-lv { padding: var(--space-xs) var(--space-sm) 0; color: var(--ink-2); font-size: var(--text-sm); }
.mini-lv b { color: var(--ink); }
.mini .hole { position: absolute; right: var(--space-sm); bottom: var(--space-sm); }
.devices { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; gap: var(--space-2xs); }
.devices li { display: grid; padding: var(--space-sm) var(--space-md); border-radius: var(--radius); background: var(--ticket); }
.devices small { color: var(--muted); font-size: var(--text-sm); }
.tag { justify-self: start; padding: 0 var(--space-xs); border-radius: 999px; background: var(--paper-3); font-size: var(--text-xs); font-weight: 700; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }

/* ---------- friend groups ---------- */
.grp-forms .tk-top, .grp-forms .tk-bottom { display: grid; gap: var(--space-xs); }
.grp-forms .sec-h { font-size: 1.3rem; }
.grp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.grp-head .page-h { font-size: 2.2rem; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.invite-code { font-weight: 800; font-stretch: 80%; font-size: 1.9rem; letter-spacing: 0.12em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ranks .rk-none { color: var(--perf); }
.ranks .tag { margin-left: var(--space-2xs); vertical-align: 2px; }
.ranks .is-me .tag { background: var(--here-ink); color: var(--here); }
.grp-pane > * + * { margin-top: var(--space-sm); }

/* sticker chat: trash talk with stamps, no typing */
.feed { height: min(46dvh, 420px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); }
.feed .empty { margin: auto; padding: 0; }
.msg { align-self: flex-start; max-width: 80%; display: grid; justify-items: start; }
.msg.mine { align-self: flex-end; justify-items: end; text-align: right; }
.msg-emoji { font-size: 3rem; line-height: 1.05; }
.msg-cap { display: inline-block; margin-top: var(--space-2xs); padding: var(--space-3xs) var(--space-xs); border-radius: 5px; color: var(--stamp); box-shadow: inset 0 0 0 2px var(--stamp); font-weight: 800; font-stretch: var(--wide); font-size: var(--text-sm); transform: rotate(-3deg); }
.msg.mine .msg-cap { color: var(--here-deep); box-shadow: inset 0 0 0 2px var(--here); transform: rotate(3deg); }
html[data-line="Orange"] .msg.mine .msg-cap { color: var(--ink); }
.msg-meta { margin-top: var(--space-2xs); color: var(--muted); font-size: var(--text-xs); }
.msg-meta .rank-chip { margin-left: var(--space-2xs); }
.chat-hint { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.stickers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-xs); }
.stk { display: grid; justify-items: center; gap: var(--space-3xs); min-width: 0; padding: var(--space-xs) var(--space-3xs); border: 0; border-radius: var(--radius); background: var(--ticket); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.stk:hover { background: var(--paper-3); }
.stk:active { transform: scale(0.94); }
.stk:disabled { opacity: 0.45; cursor: progress; }
.stk span { font-size: 1.75rem; line-height: 1.1; }
.stk small { max-width: 100%; color: var(--ink-2); font-size: 0.625rem; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- map ---------- */
.map-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.map-tally p { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius); background: var(--ticket); color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; }
.map-tally b { display: block; color: var(--ink); font-weight: 800; font-stretch: 80%; font-size: 1.7rem; line-height: 1.05; font-variant-numeric: tabular-nums; }

.map-tk { overflow: hidden; }
.map-tk > .band-lines { border-radius: var(--radius) var(--radius) 0 0; }
.map-bar { padding: var(--space-sm) var(--space-sm) var(--space-xs); }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2xs); }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs); min-width: 0; min-height: 36px; padding: 0 var(--space-2xs); white-space: nowrap; border: 0; border-radius: 999px; background: var(--paper-3); color: var(--ink-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.chip i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ln); }
.chip:hover { color: var(--ink); background: var(--paper); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ticket); }
.chip[aria-pressed="true"][style] { background: var(--ln); color: var(--ticket); }
.chip[aria-pressed="true"][style] i { background: var(--ticket); }
.chip[data-line="Orange"][aria-pressed="true"] { color: var(--ink); }
.chip[data-line="Orange"][aria-pressed="true"] i { background: var(--ink); }
.map-toggle { display: inline-flex; align-items: center; gap: var(--space-2xs); flex: none; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); cursor: pointer; }
.map-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.map-wrap { position: relative; margin: 0 var(--space-sm); border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.map { height: calc(100dvh - 380px); min-height: 440px; background: var(--paper-3); }
/* a quiet basemap, warmed toward the paper so the line colours carry the map */
/* one cheap opacity on the whole tile layer lets the warm paper show through; no per-tile filters, so zooming stays fast */
.map .leaflet-tile-pane { opacity: 0.8; }
.map .leaflet-tile { outline: 1px solid transparent; }
.train-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.map .leaflet-container, .map.leaflet-container { font-family: var(--font); background: var(--paper-3); }
.map .leaflet-control-zoom { border: 0; box-shadow: 0 1px 3px var(--hole-shade); border-radius: 10px; overflow: hidden; }
.map .leaflet-control-zoom a { width: 36px; height: 36px; line-height: 34px; color: var(--ink); background: var(--ticket); border-color: var(--rule); font-weight: 700; }
.map .leaflet-control-zoom a:hover { background: var(--paper-3); }
.map-locate { display: grid; place-items: center; width: 36px; height: 36px; margin-top: var(--space-xs) !important; border: 0; border-radius: 10px; background: var(--ticket); color: var(--ink); box-shadow: 0 1px 3px var(--hole-shade); cursor: pointer; }
.map-locate svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-locate:hover { background: var(--paper-3); }
.map-locate:active { transform: translateY(1px); }
.map .leaflet-control-attribution { background: color-mix(in oklab, var(--ticket) 80%, transparent); color: var(--muted); font-size: 10px; border-radius: 6px 0 0 0; }
.map .leaflet-control-attribution a { color: var(--ink-2); }

/* stations: punch holes on the line */
.stn-wrap, .veh-wrap, .me-wrap { background: none; border: 0; }
.stn { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--ticket); box-shadow: inset 0 0 0 3px var(--ln), 0 1px 2px var(--hole-shade); cursor: pointer; transition: transform var(--dur-short) var(--ease-out); }
.stn:hover { transform: scale(1.18); }
.stn.hub { box-shadow: inset 0 0 0 3px var(--ink), 0 1px 2px var(--hole-shade); }
.stn.has-eggs { background: var(--ln); box-shadow: 0 0 0 2.5px var(--ticket), 0 2px 4px var(--hole-shade); }
.stn.has-eggs b { color: var(--ticket); font-weight: 800; font-size: 12px; line-height: 1; }
.stn.mine::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--stamp); box-shadow: 0 0 0 1.5px var(--ticket); }
.stn.sel { transform: scale(1.35); box-shadow: 0 0 0 2.5px var(--ticket), 0 0 0 5px var(--ink), 0 3px 8px var(--hole-shade); }
.stn.live::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--stamp); }
@media (prefers-reduced-motion: no-preference) {
  .stn.live::before { animation: ping 1.8s var(--ease-out) infinite; }
  @keyframes ping { from { transform: scale(0.75); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
}

/* station names: hidden when zoomed out, then egg stations, then all */
.leaflet-tooltip.stn-label { padding: 1px var(--space-xs); border: 0; border-radius: 4px; background: color-mix(in oklab, var(--ticket) 92%, transparent); color: var(--ink-2); font: 700 11px/1.3 var(--font); box-shadow: 0 1px 2px var(--hole-shade); }
.leaflet-tooltip.stn-label::before { display: none; }
.leaflet-tooltip.stn-label-eggs { opacity: 0 !important; color: var(--ink); transition: opacity var(--dur-short) var(--ease-out); }
.z-eggs .leaflet-tooltip.stn-label-eggs { opacity: 1 !important; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-sm); }
.key-row .map-foot { margin-top: 0 !important; }


/* you */
.me-dot { position: relative; display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--focus); box-shadow: 0 0 0 3px var(--ticket), 0 2px 6px var(--hole-shade); }

/* the station card: a ticket stub that slides up over the map */
.map-sheet { position: absolute; left: var(--space-xs); right: var(--space-xs); bottom: var(--space-xs); z-index: 1000; border-radius: var(--radius); background: var(--ticket); box-shadow: 0 10px 28px color-mix(in oklab, var(--ink) 25%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .map-sheet:not([hidden]) { animation: sheet 320ms var(--ease-out) both; }
  @keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
}
.map-sheet .tk-perf::before, .map-sheet .tk-perf::after { background: color-mix(in oklab, var(--paper-3) 60%, var(--ticket)); }
.sheet-band { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-md); border-radius: var(--radius) var(--radius) 0 0; background: var(--ln); color: var(--ticket); font-weight: 800; font-stretch: var(--wide); }
.sheet-lines { display: inline-flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; }
.sheet-lines .also { padding: 0 var(--space-xs); border-radius: 4px; background: var(--ln); color: var(--ticket); font-size: var(--text-sm); box-shadow: 0 0 0 1.5px var(--ticket); }
.sheet-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.sheet-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.sheet-x:hover { background: color-mix(in oklab, var(--ticket) 20%, transparent); }
.sheet-x:active { transform: translateY(1px); }
.sheet-top { position: relative; padding: var(--space-sm) var(--space-md); }
.sheet-h { font-size: 1.9rem; padding-right: 112px; }
.sheet-sub { color: var(--ink-2); font-size: var(--text-sm); margin-top: var(--space-3xs); min-height: 1.2em; }
.sheet-keeper { position: absolute; right: var(--space-md); top: var(--space-sm); font-size: var(--text-sm); }
.sheet-bottom { padding: var(--space-sm) var(--space-md) var(--space-md); }
.sheet-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2xs); margin: 0; }
.sheet-stats div { padding: var(--space-xs) var(--space-xs); border-radius: 8px; background: var(--paper-3); }
.sheet-stats dt { color: var(--muted); font-size: var(--text-xs); line-height: 1.2; }
.sheet-stats dd { margin: 0; font-weight: 800; font-stretch: 80%; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sheet-stats dd small { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.sheet-stats .is-on { background: color-mix(in oklab, var(--ln) 14%, var(--ticket)); }
.sheet-stats .is-live { background: color-mix(in oklab, var(--stamp) 12%, var(--ticket)); }
.sheet-stats .is-live dd { color: var(--stamp); }
.sheet-note { color: var(--ink-2); font-size: var(--text-xs); margin: var(--space-xs) 0 var(--space-sm); }
.sheet-go { background: var(--ln); color: var(--ticket); }
.sheet-go[aria-pressed="true"] { background: var(--ink); }
.sheet-acts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs); }
.sheet-acts .btn { min-height: 44px; }
.sheet-acts .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-stats dd.dd-text { font-size: 1rem; line-height: 1.2; font-stretch: var(--wide); padding-top: var(--space-2xs); overflow-wrap: anywhere; }
.is-train .sheet-top { padding-bottom: var(--space-xs); }
.is-train .sheet-h { padding-right: 0; font-size: 1.7rem; }
.is-train .sheet-sub b { color: var(--ink); }
.is-train .sheet-bottom { padding-top: var(--space-sm); }
.train-no { margin-left: var(--space-xs); }
.train-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-xs); }
.train-k { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.train-cars { list-style: none; display: flex; gap: var(--space-2xs); margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.train-cars li { position: relative; flex: none; padding: var(--space-3xs) var(--space-xs); border-radius: 4px; background: var(--paper-3); box-shadow: inset 3px 0 0 var(--ln); font-weight: 700; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.train-cars li.low::after, .train-cars li.mid::after, .train-cars li.high::after { content: ""; position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; }
.train-cars li.low::after, .crowd-key i.low { background: var(--good); }
.train-cars li.mid::after, .crowd-key i.mid { background: var(--line-orange); }
.train-cars li.high::after, .crowd-key i.high { background: var(--bad); }
.crowd-key { display: flex; align-items: center; gap: var(--space-2xs); margin-top: var(--space-xs); color: var(--muted); font-size: var(--text-xs); }
.crowd-key i { width: 7px; height: 7px; margin-left: var(--space-xs); border-radius: 50%; }
.crowd-key i:first-child { margin-left: 0; }
.map.over-train { cursor: pointer; }
.sheet-go:hover { background: color-mix(in oklab, var(--ln) 85%, var(--ink)); }

/* the key under the map */
.map-key { padding-top: var(--space-sm); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin: 0; padding: 0; color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; }
.legend li { display: inline-flex; align-items: center; gap: var(--space-xs); }
.lg-stn { position: relative; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--ticket); box-shadow: inset 0 0 0 3px var(--ln); }
.lg-stn.has-eggs { width: 20px; height: 20px; background: var(--ln); box-shadow: 0 0 0 2px var(--ticket); }
.lg-stn.has-eggs b { color: var(--ticket); font-size: 10px; font-weight: 800; }
.lg-stn.done, .stn.done { background: var(--ticket); box-shadow: inset 0 0 0 2.5px var(--ln), 0 0 0 1px var(--ticket); opacity: 0.8; }
.lg-stn.done b, .stn.done b { color: var(--ln); }
.stn.done.sel { opacity: 1; box-shadow: 0 0 0 2.5px var(--ticket), 0 0 0 5px var(--ink), 0 3px 8px var(--hole-shade); }
.map-tally { margin-bottom: var(--space-sm); }
.lg-stn.mine::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--stamp); }
.lg-stn.live::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--stamp); }
.lg-car { display: grid; place-items: center; width: 14px; height: 18px; transform: rotate(45deg); }
.lg-car i { width: 8px; height: 15px; border-radius: 4px 4px 2px 2px; background: var(--ln); }
.map-foot { color: var(--muted); font-size: var(--text-xs); margin-top: var(--space-sm) !important; }

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
  .punchclock li, .btn, .seg button, button.stub-act, .tabs a, .st-list a, .ranks a, .mypts, .stn, .chip, .leaflet-tooltip.stn-label-eggs { transition: none; }
  .chad { display: none; }
}

/* ---------- profile: names and activity ---------- */
.field-hint { margin: calc(-1 * var(--space-2xs)) 0 0; color: var(--muted); font-size: var(--text-sm); }
.names .name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); padding: var(--space-md); }
.names .name-row small { display: block; color: var(--muted); font-size: var(--text-sm); }
.name-val { margin: 0; font-size: 1.25rem; font-weight: 800; overflow-wrap: anywhere; }
.name-form { display: grid; gap: var(--space-2xs); padding: 0 var(--space-md) var(--space-md); }
.name-form[hidden] { display: none; }
.name-edit { display: flex; gap: var(--space-xs); }
.name-edit .input { flex: 1; min-width: 0; }
.name-tools { display: flex; gap: var(--space-md); }
.name-tools [hidden] { display: none; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3xs); }
.activity li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md); border-radius: var(--radius); background: var(--ticket); }
.activity p { margin: 0; overflow-wrap: anywhere; }
.activity small { display: block; color: var(--muted); font-size: var(--text-sm); }
.activity a { color: inherit; font-weight: 700; }
.act-ic { font-size: 1.25rem; }
.act-pts { font-weight: 800; }

/* ---------- notifications ---------- */
.nt-tally { margin: var(--space-md) 0; }
.nt-ask { display: grid; gap: var(--space-sm); margin-bottom: var(--space-md); }
.nt-list .is-new { box-shadow: inset 4px 0 0 var(--here); }
.nt-egg { grid-template-columns: 48px 1fr !important; }
.nt-egg img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }

.map-totals { margin: var(--space-sm) 0; }

/* ---------- train lobbies ---------- */
.train-bar { display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-xs); padding: var(--space-xs) var(--space-sm); border-radius: 999px; background: var(--ln); color: var(--ticket); font-size: var(--text-sm); text-decoration: none; }
.train-bar span:last-child { margin-left: auto; font-weight: 600; opacity: 0.9; }
.train-band { display: flex; justify-content: space-between; padding: var(--space-xs) var(--space-md); background: var(--ln); color: var(--ticket); font-weight: 800; border-radius: var(--radius) var(--radius) 0 0; }
.pledge-head { display: flex; align-items: center; justify-content: space-between; }
.pledge-n { margin: var(--space-2xs) 0 var(--space-xs); color: var(--ink-2); }
.pledge-n b { color: var(--ink); font-size: 2rem; font-weight: 800; font-stretch: 80%; }
.pledge-bar span { background: linear-gradient(to right, var(--ln) var(--p), transparent var(--p)); }
.pledge-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-sm); }
.pledge-btns { display: flex; gap: var(--space-xs); }
.pledge-btns .btn { min-width: 52px; }
.msg-text { margin: 0; padding: var(--space-xs) var(--space-sm); border-radius: 14px 14px 14px 4px; background: var(--paper-3); color: var(--ink); overflow-wrap: anywhere; text-align: left; }
.msg.mine .msg-text { border-radius: 14px 14px 4px 14px; background: var(--ink); color: var(--ticket); }
.msg-report { margin-left: var(--space-2xs); font-size: var(--text-xs); color: var(--muted); }
.say { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); }
.say .input { flex: 1; min-width: 0; }

/* ---------- egg collection ---------- */
.egg-shelf .shelf-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.shelf-total { margin: 0; color: var(--ink-2); }
.shelf-total b { color: var(--ink); font-size: 2rem; font-weight: 800; font-stretch: 80%; margin-right: 2px; }
.shelf { list-style: none; margin: 0; padding: var(--space-sm) var(--space-sm) var(--space-md); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2xs); }
.shelf-egg { display: grid; justify-items: center; text-align: center; gap: 2px; }
.shelf-pic { position: relative; display: grid; place-items: end center; width: 100%; height: 78px; border-radius: 10px; background: radial-gradient(ellipse 60% 18% at 50% 92%, rgb(0 0 0 / 0.14), transparent 70%); }
.shelf-pic .egg-art { width: min(52px, 100%); height: auto; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.18)); transition: transform var(--dur-short) var(--ease-out); }
.shelf-egg:not(.is-none):hover .egg-art { transform: translateY(-3px) rotate(-4deg); }
.shelf-n { position: absolute; top: 2px; right: 2px; min-width: 24px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--ticket); font-size: 11px; font-weight: 800; line-height: 20px; }
.lv-3 .shelf-n { background: linear-gradient(135deg, #e0a060, #8a4f1d); }
.lv-4 .shelf-n { background: linear-gradient(135deg, #fff0a8, #b8860b); color: #2b2205; }
.lv-5 .shelf-n { background: linear-gradient(135deg, #ffffff, #9aa5b3); color: #2b313a; box-shadow: 0 0 0 1px #c5ccd6; }
.shelf-name { margin: 0; font-weight: 800; font-size: var(--text-xs); }
.shelf-sub { margin: 0; color: var(--muted); font-size: 11px; }
.shelf-egg.is-none .egg-art { filter: grayscale(1) brightness(0.55) contrast(0.6); opacity: 0.28; }
.shelf-egg.is-none .shelf-name { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .lv-4 .egg-spark, .lv-5 .egg-spark { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .lv-5 .egg-spark:nth-of-type(2n) { animation-delay: .8s; }
  .lv-5 .egg-spark:nth-of-type(3n) { animation-delay: 1.5s; }
  @keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
}
.train-sim { background: repeating-linear-gradient(135deg, var(--ink) 0 12px, #2b3038 12px 24px); }

/* ---------- train lobby: 100 pts per rider ---------- */
.riders { list-style: none; margin: var(--space-sm) 0; padding: 0; display: grid; gap: var(--space-2xs); }
.riders li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); }
.riders .rd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.riders .is-me .rd-name { color: var(--ln, var(--ink)); }
.rd-bar { height: 8px; border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.rd-bar i { display: block; height: 100%; width: var(--p); background: var(--ln, var(--here)); border-radius: 4px; }
.riders .is-done .rd-bar i { background: var(--stamp); }
.rd-n { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; }
.rd-help { font-size: var(--text-sm); font-weight: 700; }
.pledge-box { margin-top: var(--space-sm); padding: var(--space-sm); border-radius: var(--radius); background: var(--paper-3); }
.pledge-for { margin: 0 0 var(--space-xs); font-size: var(--text-sm); }
.stash { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stash li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: var(--space-xs); padding: 4px 6px; border-radius: 8px; background: var(--ticket); }
.stash li.is-none { opacity: .45; }
.st-lv { font-weight: 700; font-size: var(--text-sm); }
.st-lv small { display: block; color: var(--muted); font-weight: 500; font-size: var(--text-xs); }
.st-pick { display: inline-flex; align-items: center; gap: 6px; }
.st-pick b { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.st-b { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--ink); color: var(--ticket); font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer; }
.st-b:disabled { background: var(--perf); cursor: default; }
.pledge-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); }
.msg-help { align-self: stretch; max-width: none; }
.help-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin: 0; padding: var(--space-xs) var(--space-sm); border-radius: 12px; background: #fff4d6; box-shadow: inset 0 0 0 2px #f0c419; font-size: var(--text-sm); text-align: left; }
.help-btn { margin-left: auto; min-height: 32px; padding: 0 var(--space-sm); }

/* empty egg slots, folded into one row */
.stub-empties { display: grid; gap: var(--space-sm); padding: var(--space-md); border-radius: var(--radius); border: 2px dashed var(--perf); color: var(--ink-2); font-size: var(--text-sm); }
.stub-empties b { color: var(--ink); }
.hide-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.hide-chip { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 44px; padding: 0 var(--space-sm); border: 0; border-radius: 999px; background: var(--ticket); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.hide-chip b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--here); color: var(--ticket); font-size: var(--text-xs); }
.hide-chip .hide-pts { color: var(--muted); font-weight: 600; }
.hide-chip .hide-pts::before { content: "+"; }
.hide-chip:hover { background: var(--paper-3); }
.hide-chip:active { transform: translateY(1px); }
.hide-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the map keeps its layers (and the card over it) inside itself, under the tab bar */
.map-wrap { isolation: isolate; }

.for-chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: var(--space-2xs) 0 var(--space-xs); }
.for-chip { display: grid; justify-items: start; min-height: 44px; padding: 4px var(--space-sm); border: 0; border-radius: 12px; background: var(--ticket); color: var(--ink); font: inherit; font-weight: 700; font-size: var(--text-sm); text-align: left; box-shadow: inset 0 0 0 1.5px var(--perf); cursor: pointer; }
.for-chip small { color: var(--muted); font-weight: 600; font-size: var(--text-xs); }
.for-chip.is-on { background: var(--ink); color: var(--ticket); box-shadow: none; }
.for-chip.is-on small { color: var(--ticket); opacity: .8; }
.for-chip:disabled { opacity: .5; cursor: default; }

.pledge-head .pledge-n { margin: 0; }
.pledge-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-xs) 0 0; padding: 0; }
.pledge-rules li { padding: 2px 10px; border-radius: 999px; background: var(--paper-3); font-size: var(--text-xs); font-weight: 700; }
.pledge-rules .is-wait { background: #fff4d6; }

/* Profile activity: a fixed-height box that scrolls on its own, with a fade at the edge. */
.activity-scroll { max-height: min(46dvh, 360px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); padding-bottom: 20px; }
.activity-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.hide-any { display: grid; gap: var(--space-xs); margin-top: var(--space-sm); }
.hide-any .hide-chips[hidden] { display: none; }
.hide-chip .hide-when { color: var(--muted); font-weight: 600; font-size: var(--text-xs); }
