/* Jigwalk. Colours come from the Da Nang dusk poster: marble-ivory days, Han-night nights,
   lantern red for actions, and dragon gold only for what you have earned. */

:root {
  --paper: oklch(0.955 0.02 80);
  --paper-2: oklch(0.915 0.026 78);
  --surface: oklch(0.99 0.008 85);
  --ink: oklch(0.22 0.065 275);
  --ink-2: oklch(0.42 0.055 282);
  --ink-3: oklch(0.49 0.045 286);
  --line: oklch(0.86 0.022 78);
  --lacquer: oklch(0.52 0.19 30);
  --lacquer-2: oklch(0.46 0.18 30);
  --on-lacquer: oklch(0.985 0.012 80);
  --gold: oklch(0.82 0.15 78);
  --gold-ink: oklch(0.5 0.11 68);
  --jade: oklch(0.46 0.075 195);
  --jade-soft: oklch(0.93 0.035 190);
  --socket: oklch(0.905 0.024 80);
  --socket-line: oklch(0.78 0.035 78);
  --scrim: oklch(0.17 0.06 275 / 0.9);
  --night: oklch(0.19 0.065 275);
  --dusk: oklch(0.36 0.1 300);
  --shadow: 0 1px 2px oklch(0.25 0.06 275 / 0.08), 0 8px 24px -8px oklch(0.25 0.07 275 / 0.2);
  --s1: oklch(0.82 0.15 78); --s2: oklch(0.62 0.13 155); --s3: oklch(0.6 0.13 250);
  --s4: oklch(0.6 0.16 318); --s5: oklch(0.7 0.16 50); --s6: oklch(0.56 0.2 30);

  --font-ui: "Be Vietnam Pro", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --t-xs: 0.75rem; --t-sm: 0.875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.5625rem; --t-2xl: 1.953rem; --t-3xl: 2.441rem; --t-4xl: 3.3rem;
  /* semantic tokens (themes override these; see /play/themes/README.md) */
  --on-night: oklch(0.95 0.02 80);          /* text on night surfaces: splash, veil, share card */
  --on-night-2: oklch(0.84 0.035 290);      /* secondary text on night */
  --on-night-accent: oklch(0.88 0.11 85);   /* gold text on night */
  --on-night-line: oklch(1 0 0 / 0.12);
  --on-night-fill: oklch(1 0 0 / 0.08);
  --night-line: oklch(0.34 0.07 285);
  --night-socket: oklch(0.14 0.05 275);
  --night-socket-line: oklch(0.38 0.08 285);
  --splash-glow: oklch(0.45 0.12 300 / 0.7);
  --success-bg: oklch(0.34 0.07 195);       /* Region unlocked banner, good toasts */
  --success-ink: oklch(0.97 0.02 150);
  --success-2: oklch(0.44 0.08 195);
  --success-glow: oklch(0.2 0.06 200 / 0.6);
  --caption-bg: oklch(0.15 0.06 275 / 0.65);
  --backdrop: oklch(0.15 0.06 275 / 0.5);
  --piece-edge: oklch(0.98 0.03 85 / 0.55);
  --piece-shade: oklch(0.1 0.06 275 / 0.45);
  --cut-line: oklch(0.97 0.03 85);
  --matte: oklch(0.2 0.05 275);             /* behind photos shown whole */
  --alert-ink: var(--lacquer);
  --clue-ink: var(--lacquer);
  --gold-fill: linear-gradient(160deg, oklch(0.88 0.13 85), oklch(0.76 0.15 72));
  --s7: oklch(0.86 0.012 80);               /* unlocked with help */
  --primary-glow: 0 6px 18px -8px oklch(0.45 0.18 30 / 0.6);
  --gold-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), 0 10px 30px -10px oklch(0.75 0.15 75 / 0.55);
  --lid-shadow: 0 30px 60px -20px oklch(0.05 0.05 275 / 0.8), 0 0 0 1px oklch(0.82 0.15 78 / 0.35);
  --gold-halo: drop-shadow(0 0 6px oklch(0.82 0.15 78 / 0.8));
  --gold-wash: oklch(0.82 0.15 78 / 0.16);
  --scan: linear-gradient(to bottom, transparent, oklch(0.85 0.12 85 / 0.35) 85%, oklch(0.9 0.12 88 / 0.9));
  --sheen: linear-gradient(115deg, transparent 35%, oklch(0.95 0.1 88 / 0.55) 50%, transparent 65%);
  --leaf: linear-gradient(135deg, oklch(0.93 0.1 90), oklch(0.72 0.13 75));   /* celebration flecks */
  --leaf-glow: 0 0 6px oklch(0.85 0.12 85 / 0.6);
  --drop-sm: drop-shadow(0 3px 4px oklch(0.2 0.06 275 / 0.35));
  --drop-md: drop-shadow(0 10px 16px oklch(0.2 0.06 275 / 0.35));
  --drop-lg: drop-shadow(0 18px 28px oklch(0.05 0.05 275 / 0.55));
  --photo-shadow: 0 20px 50px -20px oklch(0 0 0 / 0.8);
  --sheet-shadow: 0 -10px 40px oklch(0 0 0 / 0.25);
  --r-btn: 16px; --r-card: 22px; --r-sheet: 24px;
  /* the puzzle picture: pieces and the board are cut from these (quoted paths) */
  --poster-small: "/play/themes/img/a/dragon-bridge-1080.webp";
  --poster: "/play/themes/img/a/dragon-bridge-1600.webp";
  --poster-download: "/play/themes/img/a/dragon-bridge-2000.jpg";
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r: 18px;
  --gutter: 16px;
  /* zones and rides (zoned cities such as Agra); each falls back to a base token, so a theme may leave them alone */
  --pass-bg: var(--surface);                /* the Rickshaw pass card */
  --pass-ink: var(--ink);
  --pass-edge: var(--gold);                 /* its outline and tear line */
  --pass-label: var(--gold-ink);            /* "Show this to your driver" */
  --pass-btn-bg: var(--surface);            /* the Open drop-off in Maps button on the pass (set both if the pass is a night surface) */
  --pass-btn-ink: var(--ink);
  --paused-bg: var(--paper-2);              /* the "Clock paused" chip */
  --paused-ink: var(--ink-2);
  --quiz-right: var(--jade);                /* quiz answers */
  --quiz-right-bg: var(--jade-soft);
  --quiz-wrong: var(--alert-ink);
  --quiz-wrong-bg: color-mix(in oklch, var(--alert-ink) 12%, var(--surface));
  --font-hi: var(--font-display);           /* the Hindi drop-off; without Devanagari in the font, the phone's own fills in */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: oklch(0.19 0.065 275);
  --paper-2: oklch(0.155 0.055 275);
  --surface: oklch(0.245 0.075 283);
  --ink: oklch(0.95 0.02 80);
  --ink-2: oklch(0.83 0.035 290);
  --ink-3: oklch(0.67 0.045 290);
  --line: oklch(0.33 0.075 285);
  --lacquer: oklch(0.55 0.2 30);
  --lacquer-2: oklch(0.5 0.19 30);
  --gold: oklch(0.83 0.15 78);
  --gold-ink: oklch(0.83 0.15 78);
  --jade: oklch(0.74 0.09 188);
  --jade-soft: oklch(0.3 0.06 200);
  --socket: oklch(0.15 0.055 275);
  --socket-line: oklch(0.38 0.08 285);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 10px 30px -10px oklch(0.05 0.05 275 / 0.7);
  --alert-ink: oklch(0.8 0.13 35);
  --clue-ink: oklch(0.8 0.12 40);
  --s7: oklch(0.9 0.01 80);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; min-height: calc(100dvh - var(--jw-pad, 0px)); background: var(--paper); color: var(--ink);
  font: 400 var(--t-md)/1.5 var(--font-ui); font-kerning: normal;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
:root[data-theme="dark"] body { line-height: 1.58; letter-spacing: 0.005em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--gold-ink); outline-offset: 3px; border-radius: 6px; }
.ic { width: 22px; height: 22px; flex: none; }

/* ---- screen frame ---------------------------------------------------------------- */
.screen {
  min-height: calc(100dvh - var(--jw-pad, 0px)); /* --jw-pad: the design vote bar, pre-play only */ display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 10px) var(--gutter) calc(var(--safe-b) + 16px);
  max-width: 560px; margin: 0 auto; gap: 20px;
}
::view-transition-old(root) { animation: 160ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bar-title { font-weight: 600; font-size: var(--t-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-right: auto; }
.bar .icon-btn:first-child { margin-left: -10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center-stack { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.glyph .ic { width: 44px; height: 44px; color: var(--ink-3); }

.title { font: 600 var(--t-2xl)/1.12 var(--font-display); letter-spacing: -0.01em; font-optical-sizing: auto; }
.display { font: italic 600 var(--t-3xl)/1.05 var(--font-display); letter-spacing: -0.015em; }
.sub { color: var(--ink-2); max-width: 36ch; }
.fine { color: var(--ink-3); font-size: var(--t-sm); }
.eyebrow { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.eyebrow i { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--gold)); }
.s7 { --c: var(--s7); } .s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); } .s5 { --c: var(--s5); } .s6 { --c: var(--s6); }

/* ---- buttons -------------------------------------------------------------------------- */
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: var(--r-btn); font-weight: 600; font-size: 1.0625rem;
  text-decoration: none; user-select: none; transition: transform 140ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.42; cursor: default; }
.btn-primary { background: var(--lacquer); color: var(--on-lacquer); box-shadow: inset 0 1px 0 var(--on-night-fill), var(--primary-glow); }
.btn-primary:active:not(:disabled) { background: var(--lacquer-2); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet { min-height: 48px; color: var(--ink-2); font-weight: 500; font-size: var(--t-md); }
.btn-quiet.armed { color: var(--alert-ink); font-weight: 600; }
.btn-gold { background: var(--gold-fill); color: var(--night); box-shadow: var(--gold-shadow); }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); transition: transform 140ms var(--ease-out), background-color 160ms; }
.icon-btn:active { transform: scale(0.94); background: var(--paper-2); }
.link-btn { color: var(--ink-2); font-weight: 600; font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); padding: 10px 4px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; border-radius: 999px; background: var(--paper-2); font-size: var(--t-sm); font-weight: 600; }
.chip-btn .ic { width: 18px; height: 18px; }
.code-chip { font-weight: 700; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 7px; background: var(--paper-2); white-space: nowrap; }

/* ---- splash --------------------------------------------------------------------------- */
.splash {
  --paper: var(--night); --ink: var(--on-night); --ink-2: var(--on-night-2);
  background: radial-gradient(80% 40% at 50% 28%, var(--splash-glow), transparent 75%), var(--night);
  color: var(--ink); justify-content: flex-start; position: relative; overflow: hidden;
}
.splash.boot { justify-content: center; align-items: center; }
.splash .wordmark { font: italic 700 var(--t-4xl)/1 var(--font-display); color: var(--gold); letter-spacing: -0.02em; }
.splash-art { position: relative; width: min(100%, 420px, 46dvh); aspect-ratio: 1; margin: calc(var(--safe-t) + 18px) auto 0; border-radius: 6px; box-shadow: var(--lid-shadow); animation: lid-in 900ms var(--ease-out) both; }
.splash-art svg, .splash-art .lid { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; border-radius: 6px; }
.splash-art .lid { object-fit: cover; filter: brightness(0.92); }
@keyframes lid-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.splash-art path { fill: none; stroke: var(--cut-line); stroke-width: 1.1; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.5; animation: draw 1300ms 500ms var(--ease-io) forwards; }
.splash-art path:nth-child(13) { stroke: var(--gold); stroke-width: 3.5; opacity: 1; filter: var(--gold-halo); animation-delay: 1100ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.splash-copy { position: relative; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; animation: rise 700ms 400ms var(--ease-out) both; }
.splash .lede { font-size: 1.0625rem; color: var(--ink-2); max-width: 32ch; }
.splash .eyebrow { color: var(--on-night-accent); }
.splash .actions { position: relative; margin-top: auto; animation: rise 700ms 700ms var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---- code entry ------------------------------------------------------------------------- */
.code .stack { margin-top: 12px; }
.bar .acct { margin-left: auto; }
.my-codes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.my-codes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.my-codes li { display: flex; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line); }
.mc-meta { flex: 1; font-size: var(--t-sm); color: var(--ink-2); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: var(--t-md); border-radius: 12px; }
.splash-codes { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; }
.splash-codes li { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--on-night-line); }
.splash-codes .code-chip { background: var(--on-night-fill); }
.splash .mc-meta { color: var(--ink-2); }
.btn-quiet.on-night { color: var(--ink-2); }
/* City switcher: the city's name and a chevron. A pill in bars; inside the splash eyebrow it keeps the eyebrow's type. */
.city-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--paper-2); color: var(--ink); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; transition: transform 140ms var(--ease-out); }
.city-btn:active { transform: scale(0.96); }
.city-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow .city-btn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; min-height: 32px; margin: -6px 0; padding: 0 8px 0 10px; }
.eyebrow .city-btn.on-night { background: var(--on-night-fill); }
.bar .city-btn + .acct { margin-left: auto; }
.city-games { margin: 0 0 16px; }
.city-games b { color: var(--ink); font-size: var(--t-md); }
.city-games em { font-style: normal; margin-left: 8px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); }
.city-games .code-chip { font-size: var(--t-xs); }
.city-sheet > .btn { width: 100%; }
.splash-foot { text-align: center; font-size: var(--t-sm); color: var(--ink-2); padding-top: 6px; }
.splash-foot a { color: var(--on-night-accent); font-weight: 600; text-underline-offset: 3px; }
.code-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.code-field { position: relative; display: block; }
.code-field input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.01; border: 0; font-size: 16px; caret-color: transparent; }
.code-slots { display: flex; align-items: center; gap: 6px; pointer-events: none; }
.code-slots i {
  flex: 1; height: 64px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  display: grid; place-items: center; font: 600 1.75rem/1 var(--font-ui); font-style: normal; letter-spacing: 0; transition: box-shadow 160ms;
}
.code-slots i:not(:empty) { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.code-slots i.caret { box-shadow: inset 0 0 0 2px var(--lacquer); }
.code-slots i.caret::after { content: ""; width: 2px; height: 28px; background: var(--lacquer); animation: blink 1s steps(1) infinite; }
.code-slots b { font-weight: 400; color: var(--ink-3); width: 10px; text-align: center; }
@keyframes blink { 50% { opacity: 0; } }
.field-msg { min-height: 1.5em; color: var(--alert-ink); font-size: var(--t-sm); font-weight: 500; }

/* ---- how to play ---------------------------------------------------------------------------- */
.howto { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; flex: 1; }
.howto::-webkit-scrollbar { display: none; }
.howto-card { flex: 0 0 100%; scroll-snap-align: center; padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 12px; justify-content: center; text-align: center; }
.howto-card h2 { font: 600 var(--t-2xl)/1.12 var(--font-display); }
.howto-card p { color: var(--ink-2); max-width: 34ch; margin-inline: auto; font-size: 1.0625rem; }
.howto-art { height: 250px; display: grid; place-items: center; margin-bottom: 12px; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width 240ms var(--ease-out), background-color 240ms; }
.dots i.on { width: 22px; background: var(--ink); }
.art-clues { position: relative; width: 210px; height: 200px; }
.art-clues span b { line-height: 1 !important; }
.art-clues span { position: absolute; left: 14px; right: 14px; height: 124px; top: 86px; border-radius: 14px; background: var(--surface); box-shadow: 0 6px 16px -8px oklch(0.25 0.07 275 / 0.35), inset 0 0 0 1px var(--line); transform: translateY(calc((var(--k) - 1) * -21px)) scale(calc(1 - (var(--k) - 1) * 0.045)); transform-origin: top center; display: flex; flex-direction: column; gap: 9px; padding: 8px 16px; }
.art-clues span b { font: italic 600 0.95rem/1.2 var(--font-display); color: var(--ink-3); }
.art-clues span i { height: 7px; border-radius: 4px; background: var(--paper-2); }
.art-clues span i:nth-of-type(2) { width: 88%; } .art-clues span i:nth-of-type(3) { width: 60%; }
.art-clues span:last-child { padding-top: 16px; }
.art-clues span:last-child b { color: var(--lacquer); font-size: 1.35rem; }
.art-clues span:not(:last-child) i { display: none; }
.art-snap { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.art-snap .frame { position: absolute; inset: 0; width: 100%; height: 100%; stroke-width: 0.7; color: var(--ink-2); }
.art-snap .pc { width: 150px; height: 150px; filter: var(--drop-md); transform: rotate(-6deg); }
.art-score .mini { width: 210px; height: 210px; }

/* ---- mode ---------------------------------------------------------------------------------- */
.modes { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.mode { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow 160ms, transform 140ms var(--ease-out); position: relative; }
.mode:active { transform: scale(0.985); }
.mode input { position: absolute; opacity: 0; }
.mode:has(input:checked) { box-shadow: inset 0 0 0 2px var(--lacquer); }
.mode:has(input:focus-visible) { outline: 2.5px solid var(--gold-ink); outline-offset: 3px; }
.mode-vis { width: 64px; height: 64px; flex: none; border-radius: 14px; background: var(--paper-2); display: grid; place-items: center; position: relative; }
.mode-vis svg { width: 46px; height: 46px; }
.mode-vis em { position: absolute; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink-2); }
.mode-easy svg { transform: translateY(-5px) scale(0.86); }
.mv-ring { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.mv-arrow { fill: var(--lacquer); }
.mv-dot { fill: var(--ink-3); }
.mode-txt { display: flex; flex-direction: column; gap: 2px; }
.mode-txt strong { font: 600 var(--t-lg)/1.2 var(--font-display); }
.mode-txt span { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.45; }

/* ---- play: top bar ------------------------------------------------------------------------- */
.play { gap: 16px; padding-bottom: calc(var(--safe-b) + 190px); }
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.mini-btn { width: 46px; height: 46px; border-radius: 12px; padding: 5px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 140ms var(--ease-out); }
.mini-btn:active { transform: scale(0.94); }
.mini { width: 100%; height: 100%; overflow: visible; }
.mini path { stroke: var(--paper); stroke-width: 7; stroke-linejoin: round; }
.mini .empty { fill: var(--socket-line); opacity: 0.5; }
.mini .cur { fill: var(--gold); animation: pulse 1.8s ease-in-out infinite; }
.mini .s1 { fill: var(--s1); } .mini .s2 { fill: var(--s2); } .mini .s3 { fill: var(--s3); } .mini .s4 { fill: var(--s4); } .mini .s5 { fill: var(--s5); } .mini .s6 { fill: var(--s6); } .mini .s7 { fill: var(--s7); }
@keyframes pulse { 50% { opacity: 0.35; } }
.top-mid { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.top-count { font-size: var(--t-sm); color: var(--ink-2); }
.top-count b { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.top-score { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: 0.04em; }
.top-score b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.chips:empty { display: none; }
.model-chip { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: var(--t-xs); font-weight: 500; animation: rise 300ms var(--ease-out) both; }
.model-chip .ic { width: 16px; height: 16px; color: var(--jade); }
.model-chip .link-btn { padding: 0 2px; font-size: var(--t-xs); }
.howto-screen .model-chip { align-self: center; }
.mc-bar { position: relative; width: 44px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; flex: none; }
.mc-bar i { position: absolute; inset: 0; background: var(--gold-ink); transform-origin: left; transition: transform 200ms linear; }
.net-pill { display: flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: var(--t-xs); font-weight: 500; }
.net-pill[hidden] { display: none; }
.net-pill .ic { width: 16px; height: 16px; }

/* ---- play: clue card, with a jigsaw blank cut into its top edge for the stop medal ---------------------- */
.clue-card {
  --notch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 40'%3E%3Cpath d='M0 0H24C30 0 32 3 30 8C20 13 21 30 46 30C71 30 72 13 62 8C60 3 62 0 68 0H92V-10H0Z' fill='%23000'/%3E%3C/svg%3E");
  position: relative; padding: 44px 20px 20px; border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow);
  -webkit-mask: var(--notch) top center / 92px 40px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: var(--notch) top center / 92px 40px no-repeat exclude, linear-gradient(#000 0 0);
}
.clue-wrap { position: relative; margin-top: 30px; }
.medal {
  position: absolute; z-index: 1; top: -30px; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px var(--gold); background: var(--paper); color: var(--ink);
}
.medal span { font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); margin-top: 2px; }
.medal b { font: 600 1.45rem/1 var(--font-display); font-variant-numeric: lining-nums; }
.clue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.clue-h { font: italic 600 var(--t-xl)/1 var(--font-display); color: var(--clue-ink); }
.clue-h span { color: var(--ink-3); font-size: var(--t-md); font-style: normal; font-family: var(--font-ui); font-weight: 500; }
.clue-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.par { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.top-score em { font-style: normal; font-weight: 700; color: var(--ink-2); }
.spare { margin-top: 4px; }
.spare summary { cursor: pointer; font-weight: 600; font-size: var(--t-sm); color: var(--gold-ink); min-height: 40px; display: flex; align-items: center; list-style: none; }
.veil .spare summary { color: var(--on-night-accent); }
.spare summary::-webkit-details-marker { display: none; }
.spare ol { margin: 4px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.spare[open] ol { animation: rise 300ms var(--ease-out) both; }
.lunch { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--on-night-fill); font-size: var(--t-sm); }
.lunch .ic { color: var(--gold); }
.break { display: flex; flex-direction: column; gap: 12px; margin: auto 0; }
.break-art { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); margin-bottom: 8px; }
.break-art .ic { width: 32px; height: 32px; stroke-width: 1.4; }
.break-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; padding: 16px 0; border-block: 1px solid var(--line); }
.break-stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.break-stats dt { font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.break-stats dd { margin: 0; font: 600 var(--t-xl)/1 var(--font-display); }
.break-stats dd span { font: 500 var(--t-sm) var(--font-ui); color: var(--ink-3); }
.on-break { padding-bottom: calc(var(--safe-b) + 16px); }
.pips { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.pips li { width: 16px; height: 6px; border-radius: 3px; background: var(--line); }
.pips li.used { background: var(--ink-3); }
.pips li.now { background: var(--lacquer); }
.clue-text { font-size: 1.25rem; line-height: 1.5; font-weight: 500; letter-spacing: -0.003em; }
.earlier { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.earlier summary { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 36px; }
.earlier summary::-webkit-details-marker { display: none; }
.earlier summary::after { content: ""; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg) translateY(-2px); transition: transform 200ms var(--ease-out); }
.earlier[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.earlier ol { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; font-size: var(--t-sm); }
.hours { margin-top: 14px; display: flex; gap: 8px; align-items: center; font-size: var(--t-sm); color: var(--ink-2); }
.hours .ic { width: 18px; height: 18px; }

.stop-new { animation: card-in 520ms var(--ease-out) both; }
.clue-next .clue-text, .clue-next .clue-h { animation: slide-in 420ms var(--ease-out) both; }
.clue-next .pips li.now { animation: pip 500ms 200ms var(--ease-out) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); filter: blur(3px); } }
@keyframes pip { from { transform: scaleX(0.2); } }

/* ---- play: guide ------------------------------------------------------------------------------------ */
.guide { display: flex; align-items: center; gap: 20px; min-height: 150px; padding: 6px 2px; }
.dial { position: relative; width: 146px; height: 146px; flex: none; }
.dial-face { position: absolute; inset: 0; }
.dial-ring { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.dial-tick { stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; }
.dial-north { position: absolute; inset: 0; will-change: transform; }
.dial-north span { position: absolute; top: 18px; left: 50%; translate: -50% 0; font-size: 11px; font-weight: 700; color: var(--lacquer); }
.dial-arrow { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); will-change: transform; }
.dial-arrow path { fill: var(--lacquer); stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; filter: var(--drop-sm); }
.dial.found .dial-ring { stroke: var(--jade); stroke-width: 3; fill: var(--jade-soft); }
.dial.found .dial-arrow path { fill: var(--jade); }
.g-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-dist { font: 600 var(--t-3xl)/1 var(--font-display); font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.g-title { font: 600 var(--t-lg)/1.2 var(--font-display); display: flex; align-items: center; gap: 6px; }
.g-in { color: var(--jade); }
.g-temp { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.g-temp-bar { display: flex; flex-direction: column-reverse; gap: 3px; }
.g-temp-bar i { width: 26px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--ink-3) 22%, transparent); transition: background 0.3s; }
.g-temp[data-t="cold"] .g-temp-bar i:first-child { background: var(--temp-cold, #2f6fd6); }
.g-temp[data-t="warm"] .g-temp-bar i:nth-child(-n+2) { background: var(--temp-warm, #e8930c); }
.g-temp[data-t="hot"] .g-temp-bar i { background: var(--temp-hot, #d93a2b); }
/* Easy's live meter: the marker slides with every GPS fix between the cold end and the hot end.
   Its boxes fill the card, so the meter keeps one width whatever the line beside it says. */
.g-easy, .g-easy > div:last-child, .g-easy .g-temp > span:last-child { flex: 1; min-width: 0; }
.g-heat { position: relative; display: block; width: 100%; max-width: 260px; height: 8px; margin-top: 10px; border-radius: 99px;
  background: linear-gradient(90deg, var(--temp-cold, #2f6fd6), var(--temp-warm, #e8930c), var(--temp-hot, #d93a2b)); }
.g-heat i { position: absolute; top: 50%; left: calc(var(--heat, 0) * 100%); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--surface, #fff); box-shadow: 0 0 0 3px var(--ink, #222); transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .g-heat i { transition: none; } }
.g-temp-word { display: block; font: 700 var(--t-xl)/1.1 var(--font-display); }
.g-temp[data-t="cold"] .g-temp-word { color: var(--temp-cold, #2f6fd6); }
.g-temp[data-t="warm"] .g-temp-word { color: var(--temp-warm, #b86e00); }
.g-temp[data-t="hot"] .g-temp-word { color: var(--temp-hot, #d93a2b); }
.g-temp-sub { font-size: var(--t-sm); color: var(--ink-2); }
.g-sub { color: var(--ink-2); font-size: var(--t-sm); }
.g-note { color: var(--ink-3); font-size: var(--t-xs); margin-top: 4px; }
.g-acc { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.g-acc:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--jade); }
.g-acc[data-q="ok"]::before { background: var(--s5); }
.g-acc[data-q="poor"]::before { background: var(--s6); }
.g-msg { display: flex; gap: 16px; align-items: center; }
.g-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.g-ring { position: relative; width: 92px; height: 92px; flex: none; }
.g-ring i { position: absolute; inset: calc(var(--k, 0) * 16px); border-radius: 50%; border: 1.5px dashed var(--ink-3); opacity: 0.6; }
.g-ring i:nth-child(2) { --k: 1; } .g-ring i:nth-child(3) { --k: 2; border-style: solid; background: var(--paper-2); }
.g-ring.on i { border-color: var(--jade); opacity: 1; }
.g-ring.on i:nth-child(3) { background: var(--jade); }

/* ---- dock: thumb-zone actions -------------------------------------------------------------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0 auto; max-width: 560px;
  padding: 14px var(--gutter) calc(var(--safe-b) + 10px); gap: 2px;
  background: linear-gradient(to top, var(--paper) 72%, transparent);
}
.btn-cam { min-height: 60px; font-size: 1.125rem; }

/* ---- region unlocked + toasts --------------------------------------------------------------------------- */
.unlock {
  position: fixed; top: calc(var(--safe-t) + 10px); left: var(--gutter); right: var(--gutter); z-index: 70; max-width: 528px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--success-bg); color: var(--success-ink); box-shadow: 0 16px 40px -12px var(--success-glow);
  animation: drop 520ms var(--ease-drawer) both;
}
.unlock.out { animation: lift 300ms var(--ease-out) forwards; }
.unlock b { display: block; font: italic 600 var(--t-lg)/1.15 var(--font-display); color: var(--on-night-accent); }
.unlock em { font-style: normal; font-size: var(--t-sm); opacity: 0.9; }
.unlock-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--success-2); flex: none; }
/* On a stop screen the banner sits in the flow above the guide (it pushes the guide down, never covers the clue),
   and folds away when it leaves. Under the dock (z 10), so it never covers the camera button either. */
.screen .unlock { position: relative; top: auto; left: auto; right: auto; z-index: 1; max-width: none; margin: 0; max-height: 14rem; animation: unlock-in 420ms var(--ease-out) both; }
.screen .unlock.out { overflow: hidden; animation: unlock-out 360ms var(--ease-out) forwards; }
@keyframes unlock-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
@keyframes unlock-out { to { opacity: 0; max-height: 0; padding-block: 0; margin-bottom: -16px; } }
@keyframes drop { from { transform: translateY(-120%); } }
@keyframes lift { to { transform: translateY(-130%); opacity: 0; } }
.toasts { position: fixed; top: calc(var(--safe-t) + 10px); left: var(--gutter); right: var(--gutter); z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: 528px; margin: 0 auto; }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: var(--t-sm); font-weight: 500; box-shadow: var(--shadow); animation: drop 400ms var(--ease-drawer) both; }
.toast.good { background: var(--success-bg); color: var(--success-ink); }
.toast.bad { background: var(--lacquer); color: var(--on-lacquer); }
.toast.out { animation: lift 260ms var(--ease-out) forwards; }
.toast .ic { width: 18px; height: 18px; }

/* ---- veil: checking, results ----------------------------------------------------------------------------- */
body.veiled { overflow: hidden; }
.veil {
  position: fixed; inset: 0; z-index: 40; background: var(--scrim); color: var(--on-night); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; overflow-y: auto; animation: fade 220ms var(--ease-out) both;
  --ink-2: var(--on-night-2); --line: var(--night-line);
}
.veil.out { animation: fade-out 240ms var(--ease-out) forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
.veil-body { margin: auto; width: 100%; max-width: 480px; padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.shot { position: relative; width: min(74vw, 300px); aspect-ratio: 1; animation: shot-in 380ms var(--ease-out) both; }
@keyframes shot-in { from { opacity: 0; transform: scale(0.94); } }
.shot > img { width: 100%; height: 100%; object-fit: contain; background: var(--matte); border-radius: 20px; box-shadow: var(--photo-shadow); transition: opacity 400ms var(--ease-out), filter 400ms; }
.scan { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; pointer-events: none; }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; background: var(--scan); animation: scan 1400ms var(--ease-io) infinite; }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(250%); } }
.veil-copy { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.veil-title { font: italic 600 var(--t-2xl)/1.1 var(--font-display); }
.veil-sub { color: var(--ink-2); max-width: 30ch; }
.dl { width: 240px; display: flex; flex-direction: column; gap: 8px; font-size: var(--t-sm); color: var(--ink-2); }
.dl[hidden] { display: none; }
.bar { position: relative; }
.dl .bar { height: 4px; min-height: 0; border-radius: 2px; background: var(--on-night-fill); overflow: hidden; }
.dl .bar i { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); transition: transform 200ms linear; }
.veil-actions { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.veil .btn-quiet { color: var(--ink-2); }
.tips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: var(--t-sm); color: var(--on-night); }
.tips li { display: flex; gap: 10px; align-items: baseline; }
.tip-dot { width: 6px; height: 6px; border-radius: 2px; background: var(--gold); flex: none; transform: translateY(-2px); }
.is-no .shot > img { filter: saturate(0.4) brightness(0.7); }
.is-unsure .shot { width: min(46vw, 180px); transition: width 300ms var(--ease-out); }
.is-unsure .shot > img { filter: blur(1.5px) brightness(0.8); }
.is-unsure .scan, .is-no .scan, .is-match .scan { display: none; }
/* match: the photo is cut into its piece, then becomes the poster piece */
.shot .pc { position: absolute; inset: 0; width: 100%; height: 100%; }
.shot .cut { opacity: 0; animation: appear 300ms 60ms var(--ease-out) forwards; filter: var(--drop-lg); }
.shot .cut .pc-edge { stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 700; stroke-dashoffset: 700; animation: trace 700ms 100ms var(--ease-io) forwards; }
.is-match .shot > img { opacity: 0; filter: blur(4px); transition-delay: 250ms; }
.shot .tile { opacity: 0; animation: tile-in 360ms 850ms var(--ease-out) forwards; filter: var(--drop-lg); }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes tile-in { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0) var(--drop-lg); } }
.is-result .veil-body { justify-content: flex-start; }
.is-result .shot { position: fixed; left: 50%; top: 58%; translate: -50% -50%; width: min(52vw, 210px); transition: width 400ms var(--ease-out); }
.is-result .veil-body > .veil-copy { display: none; }
.result { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.result-board { width: 100%; max-width: 290px; margin: 0 auto; animation: fade 300ms var(--ease-out) both; }
.result-copy, .result .veil-actions { opacity: 0; transform: translateY(12px); transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); }
.result.shown .result-copy { opacity: 1; transform: none; }
.result.shown .veil-actions { opacity: 1; transform: none; transition-delay: 150ms; }
.result-copy { display: flex; flex-direction: column; gap: 10px; }
.result .eyebrow { color: var(--on-night-2); }
.result-title { font: 600 var(--t-2xl)/1.1 var(--font-display); }
.result-title small, .reveal-title small { display: block; margin-top: 6px; font: 500 var(--t-md)/1.3 var(--font-ui); letter-spacing: 0; color: var(--ink-2); }
.result-note { color: var(--on-night-accent); font-weight: 500; }
.fact { color: var(--ink-2); line-height: 1.6; }

/* ---- board -------------------------------------------------------------------------------------------------- */
.board { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; }
.sockets { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sock { fill: var(--socket); stroke: var(--socket-line); stroke-width: 1.2; }
.veil .sock { fill: var(--night-socket); stroke: var(--night-socket-line); }
.sock.cur { fill: var(--gold-wash); stroke: var(--gold); stroke-width: 2.5; animation: pulse 1.8s ease-in-out infinite; }
.pc { position: absolute; overflow: visible; pointer-events: none; }
.pc image { image-rendering: auto; }
.pc-shade { fill: none; stroke: var(--piece-shade); stroke-width: 5; }
.pc-edge { fill: none; stroke: var(--piece-edge); stroke-width: 0.9; transition: opacity 700ms var(--ease-out); }
.board .pc.in { filter: var(--drop-sm); }
.board .pc.pending { visibility: hidden; }
.board.whole .pc-edge, .board.whole .pc-shade { opacity: 0; }
.board.whole .pc.in { filter: none; }
.board.whole::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--sheen); background-size: 300% 100%; animation: sheen 1600ms 200ms var(--ease-io) both; border-radius: 4px; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.slot-btn { position: absolute; width: 20%; height: 20%; border-radius: 8px; z-index: 2; }
.slot-btn:active { background: var(--on-night-line); }
.flying { pointer-events: none; filter: var(--drop-lg); }
.burst { position: fixed; z-index: 90; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; width: var(--w); height: calc(var(--w) * 0.55); margin: -2px; border-radius: 1px; background: var(--leaf); box-shadow: var(--leaf-glow); }

/* ---- reveal -------------------------------------------------------------------------------------------------- */
.reveal { display: flex; flex-direction: column; gap: 14px; animation: card-in 520ms var(--ease-out) both; }
.reveal-title { font: 600 var(--t-3xl)/1.05 var(--font-display); letter-spacing: -0.015em; }
.ref { margin: 0; border-radius: var(--r); overflow: hidden; background: var(--paper-2); position: relative; }
.ref img { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.ref figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 10.5px; padding: 3px 8px; border-radius: 6px; background: var(--caption-bg); color: oklch(0.95 0.01 80); backdrop-filter: blur(4px); }
.ref-piece { aspect-ratio: 4 / 3; display: grid; place-items: center; background: radial-gradient(70% 80% at 50% 40%, var(--dusk), var(--night)); }
.ref-piece .rp-art { width: 58%; aspect-ratio: 1; }
.ref-piece .pc { position: static; width: 100%; height: 100%; filter: var(--drop-lg); transform: rotate(-4deg); }
.look-for { display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.look-for b { font-size: var(--t-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.goto { display: flex; align-items: center; gap: 18px; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.radar { position: relative; width: 112px; height: 112px; flex: none; }
.radar svg { position: absolute; inset: 0; }
.radar circle { fill: none; stroke: var(--line); stroke-width: 1.2; }
.radar circle:first-child { fill: var(--paper-2); }
.radar .me { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.radar-rot { position: absolute; inset: 0; will-change: transform; }
.pin { position: absolute; left: 50%; top: 50%; color: var(--lacquer); will-change: transform; transform: translate(-50%, calc(-50% - 30px)); }
.pin .ic { width: 26px; height: 26px; fill: var(--surface); }
.goto-txt { display: flex; flex-direction: column; gap: 4px; }
.revealed .actions { gap: 6px; }

/* ---- sheets (dialog) ------------------------------------------------------------------------------------------ */
dialog.sheet {
  margin: auto auto 0; padding: 8px 20px calc(var(--safe-b) + 20px); width: 100%; max-width: 560px; max-height: 92dvh;
  border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: var(--sheet-shadow);
}
dialog.sheet[open] { animation: sheet-in 380ms var(--ease-drawer) both; }
dialog.sheet::backdrop { background: var(--backdrop); animation: fade 300ms ease both; }
dialog.sheet.full { height: 92dvh; }
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 8px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { font: 600 var(--t-xl)/1.15 var(--font-display); }
.sheet-head p { color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; }
.sheet-head .icon-btn { margin: -6px -10px 0 0; }
.board-view { width: 100%; max-width: 420px; margin: 8px auto 0; }
.board-hint { text-align: center; color: var(--ink-2); font-size: var(--t-sm); margin: 18px 0 12px; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: var(--t-xs); color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.12); }
.relive { display: flex; flex-direction: column; gap: 12px; }
.relive-img { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; }
.relive-img img { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.relive-img figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--caption-bg); color: oklch(0.95 0.01 80); }
.relive-img figcaption:empty { display: none; }
.menu-list { display: flex; flex-direction: column; }
.menu-list button { display: flex; align-items: center; gap: 14px; min-height: 56px; text-align: left; border-bottom: 1px solid var(--line); padding: 0 2px; font-weight: 500; }
.menu-list button span { flex: 1; }
.menu-list button em { font-style: normal; color: var(--ink-3); font-size: var(--t-sm); }
.menu-set { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.set-label { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--paper-2); gap: 2px; }
.seg button { flex: 1; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: var(--t-sm); color: var(--ink-2); transition: background-color 160ms, color 160ms; }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px oklch(0 0 0 / 0.12); }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 500; position: relative; }
.switch input { position: absolute; opacity: 0; right: 0; width: 52px; height: 32px; margin: 0; cursor: pointer; }
.switch i { width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; transition: background-color 200ms; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px oklch(0 0 0 / 0.25); transition: transform 220ms var(--ease-out); }
.switch input:checked + i { background: var(--jade); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--gold-ink); outline-offset: 3px; }
.menu-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: var(--t-sm); color: var(--ink-2); align-items: flex-start; }

/* ---- group ------------------------------------------------------------------------------------------------------ */
.group-body { display: flex; flex-direction: column; gap: 18px; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.members li { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); }
.members em { font-style: normal; font-size: var(--t-xs); font-weight: 600; color: var(--jade); }
.m-count { margin-left: auto; color: var(--ink-3); font-size: var(--t-sm); }
.group-board { display: flex; align-items: center; gap: 16px; }
.group-board .mini { width: 88px; height: 88px; flex: none; }
.group-board b { font: 600 var(--t-xl)/1 var(--font-display); }
.empty-note { padding: 16px; border-radius: var(--r); background: var(--paper-2); color: var(--ink-2); font-size: var(--t-sm); line-height: 1.7; }
.link-form label, .key-form label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.link-row { display: flex; gap: 8px; margin-top: 6px; }
.link-row input, .key-form input { flex: 1; min-width: 0; height: 56px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); padding: 0 16px; font-size: 1.125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.key-form input { text-transform: none; letter-spacing: 0; width: 100%; }
.key-form { display: flex; flex-direction: column; gap: 8px; }
.link-row input:focus, .key-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--lacquer); }

/* ---- finish + assembly ---------------------------------------------------------------------------------------------- */
.finish { gap: 18px; }
.finish-head { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.finish .display { font-size: var(--t-3xl); }
.pile { position: relative; height: 250px; margin: 6px 0; }
.pile > div { position: absolute; left: 50%; top: 50%; width: 138px; height: 138px; translate: -50% -50%; animation: pile-in 600ms calc(var(--i) * 60ms) var(--ease-out) both; }
.pile > div:nth-child(1) { transform: translate(-80px, -30px) rotate(-18deg); }
.pile > div:nth-child(2) { transform: translate(70px, -38px) rotate(14deg); }
.pile > div:nth-child(3) { transform: translate(-20px, 20px) rotate(6deg); }
.pile > div:nth-child(4) { transform: translate(100px, 36px) rotate(-10deg); }
.pile > div:nth-child(5) { transform: translate(-110px, 44px) rotate(22deg); }
.pile > div:nth-child(6) { transform: translate(34px, -6px) rotate(-26deg); }
.pile > div:nth-child(7) { transform: translate(-44px, -62px) rotate(30deg); }
.pile .pc { position: static; width: 100%; height: 100%; filter: var(--drop-md); }
@keyframes pile-in { from { opacity: 0; translate: -50% -80%; } }
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.choice { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transition: transform 140ms var(--ease-out); }
.choice:active { transform: scale(0.98); }
.choice b { display: block; font: 600 var(--t-lg)/1.2 var(--font-display); }
.choice em { font-style: normal; color: var(--ink-2); font-size: var(--t-sm); }
.choice-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--lacquer); color: var(--on-lacquer); flex: none; }
.assemble { gap: 14px; }
.asm-head { margin-top: 8px; }
.asm-head.row { display: flex; align-items: baseline; justify-content: space-between; }
.asm-count { font-size: var(--t-sm); color: var(--ink-2); }
.asm-count b { font: 600 var(--t-xl)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.asm-board { width: 100%; max-width: 420px; margin: auto; }
.asm-stage { position: relative; flex: 1; display: flex; flex-direction: column; gap: 14px; touch-action: none; min-height: 0; }
.stage .board-wrap { width: min(100%, calc((100dvh - 250px) * 0.55)); margin: 0 auto; }
.stage .tray { flex: 1; min-height: 240px; border-radius: var(--r); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.stage > .pc { position: absolute; left: 0; top: 0; pointer-events: auto; transform-origin: center; touch-action: none; cursor: grab; transition: transform 180ms var(--ease-out), filter 180ms; filter: var(--drop-sm); z-index: 1; }
.stage > .pc .pc-edge { pointer-events: all; }
.stage > .pc.held { transition: none; cursor: grabbing; filter: var(--drop-lg); }
.stage > .pc.snapped { pointer-events: none; filter: none; }
.asm-tools { display: flex; justify-content: center; gap: 8px; }
.stage.done .tray, .assemble:has(.stage.done) .asm-tools { opacity: 0; transition: opacity 400ms var(--ease-out); pointer-events: none; }

/* ---- done / pickup ------------------------------------------------------------------------------------------------------- */
.done { gap: 20px; }
.done-art { margin: 8px -4px 0; padding: 14px; border-radius: 10px; background: linear-gradient(160deg, var(--dusk), var(--night)); box-shadow: var(--shadow); }
.done-art.fresh { animation: card-in 600ms var(--ease-out) both; }
.pickup { display: flex; flex-direction: column; gap: 10px; }
.pickup .display { font-size: var(--t-2xl); line-height: 1.1; }
.addr { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.addr .ic { color: var(--lacquer); margin-top: 1px; }
.proof { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--t-sm); color: var(--ink-2); margin-top: 4px; }
.stack-actions { align-items: stretch; }
.stack-actions .link-btn { align-self: center; }

/* ---- share card --------------------------------------------------------------------------------------------------------- */
.share-card {
  border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 18px;
  background: radial-gradient(120% 90% at 30% 0%, var(--dusk), var(--night) 75%); color: var(--on-night);
  box-shadow: var(--shadow);
}
.sc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t-sm); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-night-2); }
.sc-mark { font: italic 700 var(--t-xl)/1 var(--font-display); letter-spacing: -0.01em; text-transform: none; color: var(--gold); }
.sc-grid .mini { width: 100%; height: auto; aspect-ratio: 1; }
.sc-grid .mini path { stroke: var(--night); stroke-width: 6; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; gap: 8px; }
.sc-stats:has(> :nth-child(4)) { grid-template-columns: repeat(2, 1fr); } /* with the walk time: two by two */
.sc-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.sc-stats dt { font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: var(--on-night-2); }
.sc-stats dd { margin: 0; font: 600 var(--t-xl)/1 var(--font-display); font-variant-numeric: lining-nums; }
.share-card .legend { color: var(--on-night-2); }
/* finish images (keepsake.js): tabs, a preview of the exact file that is shared, Share and Save */
.ks { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.ks .share-actions { margin-top: 0; }
.ks-preview { position: relative; margin: 0 auto; max-width: 100%; height: 50vh; border-radius: 14px; overflow: hidden; background: var(--paper-2); box-shadow: var(--shadow); }
.ks-preview img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 240ms var(--ease-out); }
.ks-preview[aria-busy="false"] img { opacity: 1; }
.ks-wait { position: absolute; inset: auto 0 45% 0; text-align: center; font-size: var(--t-sm); color: var(--ink-3); }
.ks-preview[aria-busy="false"] .ks-wait { display: none; }
.ks-note { text-align: center; margin: -4px 0 0; }
.ks-h { margin: 22px 0 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .ks-preview img { transition: none; } }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.share-text { margin: 16px 0 0; padding: 14px; border-radius: 14px; background: var(--paper-2); font: 500 var(--t-sm)/1.45 var(--font-ui); white-space: pre-wrap; color: var(--ink-2); }

/* ---- admin, scout, simulator ------------------------------------------------------------------------------------------ */
.admin .menu-list { margin-top: 6px; }
.scout-list { list-style: none; margin: 0; padding: 0; }
.scout-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left; border-bottom: 1px solid var(--line); }
.scout-list b { font: 600 var(--t-lg)/1 var(--font-display); width: 32px; color: var(--ink-3); }
.scout-list strong { display: block; font-weight: 600; }
.scout-list em { display: block; font-style: normal; color: var(--ink-3); font-size: var(--t-xs); }
.scout-list span:nth-child(2) { flex: 1; min-width: 0; }
.scout-n { min-width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; font-weight: 700; font-size: var(--t-sm); background: var(--paper-2); color: var(--ink-2); }
.scout-n.ok { background: var(--jade); color: var(--surface); }
.scout-target { padding: 12px 14px; border-radius: 14px; background: var(--paper-2); display: flex; flex-direction: column; gap: 2px; }
.scout-target b { font-size: var(--t-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.scout-shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scout-shots li { display: flex; align-items: center; gap: 12px; font-size: var(--t-sm); color: var(--ink-2); }
.scout-shots img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.scout-shots li.ok span { color: var(--jade); font-weight: 600; }
.scout-shots li.bad span { color: var(--lacquer); }
.sim-badge {
  position: fixed; z-index: 95; right: 0; top: 42%; writing-mode: vertical-rl; border-radius: 10px 0 0 10px !important;
  padding: 10px 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: oklch(0.55 0.2 300); color: oklch(0.98 0.01 300); box-shadow: 0 4px 12px oklch(0.3 0.15 300 / 0.4);
}
.demo-chip { position: fixed; z-index: 94; right: 8px; bottom: calc(var(--safe-b) + 4px); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); opacity: 0.7; pointer-events: none; }
.sim[open] { display: flex; flex-direction: column; gap: 14px; }
.sim-live { font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sim-map svg { width: 100%; aspect-ratio: 1; border-radius: 14px; background: var(--paper-2); cursor: crosshair; }
.sim-route { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; }
.sim-stop { fill: var(--gold-ink); }
.sim-cur { fill: var(--lacquer); }
.sim-region { fill: oklch(0.6 0.1 168 / 0.18); stroke: var(--jade); stroke-width: 1; }
.sim-me { fill: oklch(0.55 0.2 300); stroke: var(--surface); stroke-width: 2; }
.sim-field { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); border: 0; padding: 0; margin: 0; }
.sim-field legend { padding: 0; margin-bottom: 6px; }
.sim-field input[type=range] { width: 100%; accent-color: var(--lacquer); }
.sim-check { display: flex; gap: 10px; align-items: center; font-size: var(--t-sm); }
.sim-check input { width: 20px; height: 20px; accent-color: var(--lacquer); }

/* ---- motion preferences ------------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .splash-art path { stroke-dashoffset: 0; }
  .scan::after { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
  .menu-list button:hover span { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---- photos shown whole: contain on a matte, with a soft blurred copy of the photo filling the edges ---------- */
.ref, .relive-img { background: var(--matte); isolation: isolate; }
.ref[style*="--img"]::before, .relive-img[style*="--img"]::before { content: ""; position: absolute; inset: -24px; background: var(--img) center / cover; filter: blur(22px) saturate(1.1); opacity: 0.55; z-index: 0; }
.ref figcaption, .relive-img figcaption { z-index: 1; }

/* ---- puzzle: board + tray, score view, tools ----------------------------------------------------------------- */
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.mini-switch { min-height: 40px; gap: 10px; font-size: var(--t-sm); }
.mini-switch i { width: 44px; height: 26px; }
.mini-switch i::after { width: 20px; height: 20px; }
.mini-switch input:checked + i::after { transform: translateX(18px); }
.chip-btn:disabled { opacity: 0.45; }
.stage .tray { position: relative; min-height: 120px; }
.tray-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--ink-3); font-size: var(--t-sm); pointer-events: none; }
.tray-empty:empty { display: none; }
.stage.show-scores .pc .pc-edge { stroke: var(--c, var(--piece-edge)); stroke-width: 4; opacity: 1; }
.stage.show-scores .pc.s0 .pc-edge { stroke: var(--piece-edge); stroke-width: 0.9; }
.sock.hint { fill: var(--gold-wash); stroke: var(--gold); stroke-width: 3; animation: pulse 0.45s ease-in-out 3; }
.puzzle-sheet .board-stage, .finish-stage { position: relative; display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; }
.puzzle-sheet .board-wrap { width: min(100%, 420px, 52dvh); margin: 0 auto; }
.finish-stage .board-wrap { width: min(100%, 420px, 44dvh); margin: 0 auto; }
.finish .display { font-size: var(--t-2xl); }
.finish { gap: 14px; }
.finish .finish-head { margin-top: 8px; }
.pc.pending { visibility: hidden; }

/* won piece flies into the tray on the result screen */
.result-tray { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 290px; margin: -6px auto 0; }
.rt-label { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-night-2); }
.rt-pieces { display: flex; flex-wrap: wrap; gap: 2px; min-height: 52px; padding: 4px; border-radius: 12px; background: var(--on-night-fill); }
.rt-slot { position: relative; width: 52px; height: 52px; }
.rt-slot .pc { position: absolute; inset: 0; width: 100%; height: 100%; filter: var(--drop-sm); }

/* ---- never stuck: move on ------------------------------------------------------------------------------------ */
.move-on { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); animation: rise 300ms var(--ease-out) both; }
.move-on[hidden] { display: none; }
.move-on p { font-weight: 500; }

/* ---- confirm sheet, test tools, difficulty note ------------------------------------------------------------- */
.confirm { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 4px; }
.confirm h2 { font: 600 var(--t-xl)/1.15 var(--font-display); }
.confirm p { color: var(--ink-2); }
.confirm-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.test-tools { align-self: center; display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 5px 12px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.test-tools .ic { width: 15px; height: 15px; }
.set-note { font-size: var(--t-xs); color: var(--ink-2); margin-top: -8px; }

/* ---- competitive, leaderboard, VS ------------------------------------------------------------- */
.mode-competitive .ic { position: absolute; width: 26px; height: 26px; color: var(--gold-ink); }
.comp-opts { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--paper-2); animation: rise 240ms var(--ease-out) both; }
.vs-join { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.vs-join input, .nick-form input { height: 52px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); color: var(--ink); padding: 0 16px; font-size: 1.125rem; font-weight: 600; }
.vs-join input { letter-spacing: 0.14em; text-transform: uppercase; }
.nick-form input { text-transform: none; letter-spacing: 0; }
.set-note.locked { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.set-note.locked .ic { width: 20px; height: 20px; color: var(--gold-ink); flex: none; }

/* gate countdown: the button drains like a fuse until it opens */
.btn.gated { position: relative; overflow: hidden; opacity: 1; background: var(--paper-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.gated::before { content: ""; position: absolute; inset: 0; background: var(--gold-wash); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 250ms linear; }
.btn.gated > * { position: relative; }
.btn.gated b { color: var(--ink); font-variant-numeric: tabular-nums; }
.btn.gated .ic { width: 20px; height: 20px; }

.lifelines { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; } /* one to three, by mode */
.life { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t-sm); font-weight: 600; color: var(--ink); transition: transform 140ms var(--ease-out); }
.life:active:not(:disabled) { transform: scale(0.96); }
.life .ic { width: 22px; height: 22px; color: var(--gold-ink); }
.life em { font-style: normal; font-size: var(--t-xs); font-weight: 500; color: var(--ink-3); }
.life:disabled { opacity: 0.5; }
.life.on { opacity: 1; background: var(--gold-wash); box-shadow: inset 0 0 0 1.5px var(--gold-ink); }
.life.on em { color: var(--ink-2); font-weight: 700; }
.life-dist { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--gold-wash); font-size: var(--t-sm); color: var(--ink-2); }
.life-dist .ic { width: 20px; height: 20px; color: var(--gold-ink); }
.life-dist b { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }

.rival { display: flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: var(--paper-2); font-size: var(--t-sm); color: var(--ink-2); font-weight: 600; }
.rival b { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.rival .ic { width: 18px; height: 18px; color: var(--gold-ink); }

.vs-code-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.vs-code { font: 700 2.4rem/1 var(--font-ui); letter-spacing: 0.18em; font-variant-numeric: tabular-nums; color: var(--ink); padding-left: 0.18em; }
.vs-share { display: flex; gap: 8px; }
.vs-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vs-players li { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); font-weight: 600; }
.vs-players em { display: inline-flex; align-items: center; gap: 6px; font-style: normal; font-weight: 500; color: var(--ink-3); font-size: var(--t-sm); }
.vs-players em.ok { color: var(--jade); font-weight: 600; }
.vs-players .ic { width: 18px; height: 18px; }
.vs-count { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 28px 0 8px; }
.vs-count span { font-size: var(--t-sm); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.vs-count b { font: italic 700 7rem/1 var(--font-display); color: var(--lacquer); font-variant-numeric: tabular-nums; }

.compete-end { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.vs-result { padding: 16px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.vs-result .ic { width: 16px; height: 16px; }
.vs-result h2 { font: 600 var(--t-xl)/1.15 var(--font-display); }
.vs-result.won h2 { color: var(--gold-ink); }
.vs-table { display: flex; flex-direction: column; margin: 0; }
.vs-table div { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.vs-table dt { font-weight: 600; }
.vs-table dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vs-table dd:last-child { text-align: right; }
.lb-post { display: flex; flex-direction: column; gap: 10px; }
.lb-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-card); background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--line); }
.lb-card > .ic { width: 30px; height: 30px; color: var(--gold-ink); flex: none; }
.lb-rank { font: 600 var(--t-2xl)/1.1 var(--font-display); color: var(--ink); }
.lb-rank span { font: 600 var(--t-md)/1.3 var(--font-ui); color: var(--ink-2); }
.nick-form { display: flex; flex-direction: column; gap: 4px; }
.nick-form label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }

.lb .eyebrow .ic { width: 16px; height: 16px; color: var(--gold-ink); }
.lb-you { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--gold-wash); color: var(--ink); }
.lb-you .ic { width: 22px; height: 22px; color: var(--gold-ink); flex: none; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lb-list li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; min-height: 58px; border-bottom: 1px solid var(--line); }
.lb-list li.me { background: var(--gold-wash); border-radius: 12px; border-bottom-color: transparent; padding: 0 8px; margin: 0 -8px; }
.lb-n { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.lb-list li:nth-child(-n+3) .lb-n { color: var(--gold-ink); }
.lb-who { display: flex; flex-direction: column; min-width: 0; }
.lb-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who em { font-style: normal; font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lb-crew { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 1px 6px 1px 4px; border-radius: 999px; background: color-mix(in srgb, currentColor 16%, transparent); color: inherit; font-weight: 600; vertical-align: 1px; }
.lb-crew .ic { width: 13px; height: 13px; }
.vs-crew { display: flex; gap: 8px; align-items: flex-start; }
.vs-crew .ic { width: 18px; height: 18px; flex: none; }
.lb-moves { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--t-xs); color: var(--ink-3); }
.lb-moves b { font: 600 var(--t-xl)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-list .lb-time b { font-size: 1.3rem; } /* h:mm:ss is wider than a move count; every theme */
.lb-list .lb-empty { display: block; padding: 18px 0; color: var(--ink-3); border: 0; }

.art-podium { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.art-podium span { width: 62px; height: calc(var(--h) * 170px); border-radius: 12px 12px 4px 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); display: flex; justify-content: center; padding-top: 10px; }
.art-podium span:nth-child(2) { background: var(--gold-fill); box-shadow: var(--gold-shadow); }
.art-podium b { font: italic 700 var(--t-2xl)/1 var(--font-display); color: var(--ink); }

/* ---- zones and rides (zoned cities such as Agra) ------------------------------------------------------------ */
.zone-mark { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -6px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.04em; transition: transform 140ms var(--ease-out); }
.zone-mark:active { transform: scale(0.96); }
.zone-mark .ic { width: 16px; height: 16px; color: var(--gold-ink); }
.zone-start { padding-bottom: calc(var(--safe-b) + 16px); }
.zone-intro { display: flex; flex-direction: column; gap: 12px; margin: auto 0; animation: card-in 520ms var(--ease-out) both; }
.zone-intro .sub { font-size: 1.0625rem; }
.zone-count { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.zone-tickets { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.zone-tickets .ic { color: var(--gold-ink); margin-top: 1px; }
.zone-tickets p { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-sm); }
.zone-tickets b { font-size: var(--t-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.zone-sheet { display: flex; flex-direction: column; gap: 12px; }

.paused-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--paused-bg); color: var(--paused-ink); font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.paused-chip .ic { width: 16px; height: 16px; animation: pulse 2.4s ease-in-out infinite; }

.pass { display: flex; flex-direction: column; gap: 14px; animation: card-in 520ms var(--ease-out) both; }
.pass-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
/* a ticket: two half-moon notches where the tear line runs above the Maps button */
.pass-card {
  --tear: calc(100% - 80px);
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 20px; border-radius: var(--r-card);
  background: var(--pass-bg); color: var(--pass-ink); box-shadow: inset 0 0 0 1.5px var(--pass-edge);
  -webkit-mask: radial-gradient(circle 10px at 0 var(--tear), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at 100% var(--tear), #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 10px at 0 var(--tear), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at 100% var(--tear), #0000 97%, #000) right / 51% 100% no-repeat;
}
.pass-label { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pass-label); }
.pass-to { font: 600 var(--t-2xl)/1.12 var(--font-display); letter-spacing: -0.01em; margin-top: 4px; }
.pass-hi { font: 600 var(--t-2xl)/1.4 var(--font-hi); }
.pass-sub { font-size: var(--t-md); font-weight: 600; line-height: 1.4; } /* a boat's pier and board line (Auckland) */
.pass-foot { margin: 12px -20px 0; padding: 14px 20px 0; border-top: 1.5px dashed var(--pass-edge); }
.pass-foot .btn { width: 100%; }
.pass-map { background: var(--pass-btn-bg); color: var(--pass-btn-ink); box-shadow: inset 0 0 0 1px var(--pass-edge); }
.pass-facts { margin: 0; display: flex; flex-direction: column; }
.pass-facts div { display: grid; grid-template-columns: 5.2em 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pass-facts div:first-child { border-top: 0; }
.pass-facts dt { padding-top: 3px; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.pass-facts dd { margin: 0; }
.pass-walk { color: var(--ink-2); font-size: var(--t-sm); }
.pass-quiz { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--gold-wash); font-size: var(--t-sm); font-weight: 600; }
.pass-quiz .ic { width: 18px; height: 18px; color: var(--gold-ink); }

.quiz-screen { gap: 18px; }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quiz-count { font-size: var(--t-sm); color: var(--ink-2); }
.quiz-count b { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.quiz { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { font: 600 var(--t-xl)/1.25 var(--font-display); }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500; transition: transform 140ms var(--ease-out), box-shadow 160ms, background-color 160ms, opacity 160ms; }
.quiz-opt:active:not(:disabled) { transform: scale(0.985); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt:disabled:not(.right):not(.wrong) { opacity: 0.5; }
.quiz-opt b { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--paper-2); color: var(--ink-2); font-size: var(--t-sm); transition: background-color 160ms, color 160ms; }
.quiz-opt.right { background: var(--quiz-right-bg); box-shadow: inset 0 0 0 2px var(--quiz-right); animation: q-pop 360ms var(--ease-out); }
.quiz-opt.wrong { background: var(--quiz-wrong-bg); box-shadow: inset 0 0 0 2px var(--quiz-wrong); animation: q-no 360ms var(--ease-out); }
.quiz-opt.right b { background: var(--quiz-right); color: var(--surface); }
.quiz-opt.wrong b { background: var(--quiz-wrong); color: var(--surface); }
@keyframes q-pop { 40% { transform: scale(1.02); } }
@keyframes q-no { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
.quiz-note { min-height: 1.5em; color: var(--ink-2); font-size: var(--t-sm); }
.quiz-note b { color: var(--ink); }
.quiz-note.is-right b { color: var(--quiz-right); }
.quiz-note.is-wrong b { color: var(--quiz-wrong); }
.quiz-opt b .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.quiz-plus { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--gold-wash); color: var(--gold-ink); font-weight: 700; }
.quiz-gate { display: flex; flex-direction: column; gap: 14px; margin: auto 0; }
.quiz-gate-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--gold-wash); color: var(--gold-ink); }
.quiz-gate-icon .ic { width: 30px; height: 30px; }
/* the 30 s countdown on a shown question: a bar that empties, then the seconds; red for the last 10 */
.quiz-timer { display: flex; flex-direction: column; gap: 6px; }
.qt-bar { height: 8px; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.qt-bar i { display: block; height: 100%; background: var(--gold-ink); transform-origin: left; transition: transform 200ms linear, background-color 200ms; }
.qt-txt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); }
.qt-txt b { font: 600 var(--t-lg)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.qt-txt .ic { width: 18px; height: 18px; color: var(--gold-ink); }
.quiz-timer.low .qt-bar i { background: var(--quiz-wrong); }
.quiz-timer.low b, .quiz-timer.low .ic { color: var(--quiz-wrong); }
.quiz-timer.stopped { opacity: 0.5; }
.quiz-end { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; text-align: center; animation: card-in 520ms var(--ease-out) both; }
.quiz-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.quiz-score b { font: italic 700 6rem/1 var(--font-display); color: var(--gold-ink); font-variant-numeric: lining-nums tabular-nums; }
.quiz-score span { font: 500 var(--t-md)/1.3 var(--font-ui); color: var(--ink-2); }

.life.extra em { color: var(--gold-ink); font-weight: 700; }
.life-extra { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: -8px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--gold-wash); font-size: var(--t-xs); font-weight: 700; color: var(--ink); }
.life-extra .ic { width: 15px; height: 15px; color: var(--gold-ink); }
.home-note { margin-top: 2px; }

/* ---- satellite view of an unlocked search area (satmap.js) ---------------------------------------------- */
.sat-btn { align-self: flex-start; margin-top: 8px; }
dialog.sheet.satmap[open] { display: flex; flex-direction: column; overflow: hidden; }
.satmap .sheet-head { margin-bottom: 12px; }
.sat-map { flex: 1; min-height: 240px; border-radius: var(--r-card); overflow: hidden; background: var(--matte); }
.sat-map .leaflet-control-attribution { font: 500 10px/1.4 var(--font-ui); background: oklch(1 0 0 / 0.75); color: oklch(0.25 0 0); }
.sat-ring { stroke: var(--gold); stroke-width: 3; fill: var(--gold); fill-opacity: 0.1; filter: drop-shadow(0 0 2px oklch(0 0 0 / 0.7)); }
.sat-me { stroke: #fff; stroke-width: 3; fill: #2f7bf6; fill-opacity: 1; }
.sat-pin { color: var(--on-lacquer); }
.sat-pin .ic { width: 40px; height: 40px; fill: var(--lacquer); stroke: var(--on-lacquer); stroke-width: 1.4; filter: var(--drop-sm); }
.sat-go { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
.sat-go [aria-disabled] { opacity: 0.42; pointer-events: none; }
.sat-note { text-align: center; color: var(--ink-2); font-size: var(--t-sm); margin-top: 4px; }
.sat-map > .sat-note { display: grid; place-items: center; height: 100%; padding: 16px; color: var(--on-night-2); }
