/* =============================================================================
   Participant screens: sign up, the confirmation, the scorecard and the scanner.
   Held in one hand, outdoors, on cellular.
   ========================================================================== */

/* ─── REGISTER ───────────────────────────── */
.reg-screen { background: var(--sf); min-height: 100dvh; }
.reg-hero {
  background: var(--brand); padding: 32px 22px 26px; text-align: center;
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,0.12), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(0,0,0,0.08), transparent 55%);
}
.reg-hero-logo {
  font-family: var(--fd); font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.65);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.reg-hero-logo svg { width: 12px; height: 12px; color: rgba(255,255,255,0.65); }
.reg-hero-event { font-family: var(--fd); font-size: 26px; font-weight: 800; letter-spacing: -.025em; color: #fff; line-height: 1.15; margin-bottom: 12px; }
.reg-hero-meta { font-size: 13px; color: rgba(255,255,255,0.7); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 14px; }
.reg-hero-meta svg { width: 13px; height: 13px; margin-right: 5px; }
.reg-hero-meta span { display: inline-flex; align-items: center; }
.reg-hero-chip {
  display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.14);
  border-radius: var(--r-f); padding: 5px 13px; font-size: 13px; font-weight: 600; color: #fff;
}
.reg-hero-chip svg { width: 13px; height: 13px; }
.reg-hero-sponsor { margin-top: 14px; display: flex; flex-direction: column; align-items: center; }
.reg-hero-sponsor-label {
  font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,0.65);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px;
}
.reg-hero-sponsor img { max-height: 42px; max-width: 60%; width: auto; height: auto; }

.reg-body { padding: 26px 20px; }
.reg-form-title { font-family: var(--fd); font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 5px; }
.reg-form-sub { font-size: 13.5px; color: var(--ink-3); margin-bottom: 22px; line-height: 1.6; }
.reg-submit {
  width: 100%; margin-top: 4px; padding: 14px; background: var(--brand); border: none; border-radius: var(--r-s);
  font-family: var(--fd); font-size: 15.5px; font-weight: 700; color: #fff; letter-spacing: -.01em;
  box-shadow: var(--sh-brand); transition: background .14s; cursor: pointer;
}
.reg-submit:active { background: var(--brand-hi); transform: scale(.98); }
.how-list { display: flex; flex-direction: column; gap: 11px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.how-item { display: flex; align-items: center; gap: 12px; }
.how-num {
  width: 24px; height: 24px; background: var(--brand-s); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--brand); flex: none;
}
.how-text { font-size: 13.5px; color: var(--ink-3); }

.resend { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.resend summary { font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.resend summary::-webkit-details-marker { display: none; }
.resend summary::before { content: '＋ '; color: var(--brand); font-weight: 700; }
.resend[open] summary::before { content: '－ '; }
.resend .form-stack { margin-top: 14px; }

/* ─── CONFIRM ────────────────────────────── */
.confirm-wrap { background: var(--sf); min-height: 100dvh; padding: 48px 22px; }
.confirm-big { font-size: 46px; margin-bottom: 18px; }
.confirm-head { font-family: var(--fd); font-size: 28px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 7px; }
.confirm-sub { font-size: 15px; color: var(--ink-3); line-height: 1.65; margin-bottom: 26px; }
.confirm-sub strong { color: var(--ink); font-weight: 600; }
.email-card { border: 1.5px solid var(--line-2); border-radius: var(--r); overflow: hidden; margin-bottom: 22px; box-shadow: var(--sh-s); }
.email-top-bar { background: var(--bg); padding: 9px 13px; border-bottom: 1px solid var(--line); display: flex; gap: 5px; }
.email-dot { width: 11px; height: 11px; border-radius: 50%; }
.email-dot-r { background: #FF5F57; }
.email-dot-y { background: #FFBD2E; }
.email-dot-g { background: #28CA40; }
.email-body { padding: 18px 20px; }
.email-from { font-size: 11px; color: var(--ink-3); font-family: var(--fm); margin-bottom: 4px; word-break: break-all; }
.email-subj { font-family: var(--fd); font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 10px; color: var(--ink); }
.email-text { font-size: 13.5px; color: var(--ink-3); margin-bottom: 13px; line-height: 1.6; }
.email-cta-block { background: var(--brand); border-radius: var(--r-s); padding: 12px; text-align: center; font-weight: 700; font-size: 14px; color: #fff; }
.confirm-acts { display: flex; flex-direction: column; gap: 9px; }
.confirm-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-bottom: 22px; }

/* ─── SCORECARD ──────────────────────────── */
.sc-wrap { background: var(--bg); min-height: 100dvh; display: flex; flex-direction: column; }

.sc-top { background: var(--dark); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 9px; }
.sc-logo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-logo {
  font-family: var(--fd); font-size: 12px; font-weight: 800; color: var(--brand);
  letter-spacing: .03em; text-transform: uppercase; display: flex; align-items: center; gap: 5px;
}
.sc-logo svg { width: 12px; height: 12px; color: var(--brand); }
.sc-when { font-size: 11.5px; color: rgba(255,255,255,0.3); text-align: right; }
.sc-ev-name { font-family: var(--fd); font-size: 20px; font-weight: 800; letter-spacing: -.025em; color: #fff; line-height: 1.2; }
.sc-participant { font-size: 13px; color: rgba(255,255,255,0.45); display: flex; align-items: center; gap: 5px; }
.sc-participant svg { width: 13px; height: 13px; }
.sc-sponsor { margin-top: 4px; text-align: center; }
.sc-sponsor-label {
  font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px;
}
/* text-align:center on .sc-sponsor above only centers inline content — theme.css's
   reset makes every <img> display:block, so it needs its own centering, not its
   parent's. */
.sc-sponsor img { display: block; max-height: 34px; max-width: 55%; width: auto; height: auto; opacity: .9; margin: 0 auto; }

.sc-prog { background: var(--sf); padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sc-prog-inner { display: flex; align-items: center; gap: 16px; }
.sc-ring-svg { flex: none; width: 60px; height: 60px; }
.sc-ring-track { stroke: var(--bg); }
.sc-ring-fill { stroke: var(--brand); transition: stroke-dashoffset .5s ease; }
.is-complete .sc-ring-fill { stroke: var(--green); }
.sc-ring-num { font-family: var(--fd); font-size: 14px; font-weight: 800; fill: var(--ink); }
.sc-prog-text { flex: 1; min-width: 0; }
.sc-prog-count { font-family: var(--fd); font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.sc-prog-count span { font-family: var(--fb); font-size: 16px; font-weight: 500; color: var(--ink-3); }
.sc-prog-label { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.sc-bar-track { height: 5px; background: var(--bg); border-radius: var(--r-f); margin-top: 9px; overflow: hidden; }
.sc-bar-fill { height: 100%; background: var(--brand); border-radius: var(--r-f); transition: width .5s ease; }
.is-complete .sc-bar-fill { background: var(--green); }
.sc-prog-pct { font-family: var(--fd); font-size: 18px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; flex: none; }
.is-complete .sc-prog-pct { color: var(--green); }

.sc-flash { padding: 12px 18px 0; background: var(--sf); }

.scan-cta-wrap { padding: 14px 18px; background: var(--sf); border-bottom: 1px solid var(--line); }
.scan-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 22px; min-height: 54px;
  background: var(--brand); border: none; border-radius: var(--r);
  font-family: var(--fd); font-size: 15.5px; font-weight: 700; color: #fff; letter-spacing: -.01em;
  cursor: pointer; position: relative; box-shadow: var(--sh-brand);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.scan-cta svg { width: 20px; height: 20px; }
.scan-cta::after {
  content: ''; position: absolute; inset: -4px; border-radius: calc(var(--r) + 4px);
  border: 2px solid var(--brand); animation: pulse-ring 2.5s ease-out infinite; pointer-events: none;
}
.scan-cta:hover { background: var(--brand-hi); box-shadow: 0 6px 28px -4px rgba(10,171,166,0.5); }
.scan-cta:active { transform: scale(.98); }
.scan-cta-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 9px; }

.sc-loc-list { background: var(--sf); flex: 1; list-style: none; }
.sc-loc-item {
  display: flex; align-items: center; gap: 13px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); transition: background .1s;
}
.sc-loc-item:last-child { border-bottom: none; }
/* The tile itself pops and washes with colour on the load that just stamped
   it — background is an animated property here (not the transition above,
   which is for the plain hover/press case), so the wash reads as a fill
   sweeping through rather than a hard cut. */
.sc-loc-item.is-fresh { animation: tile-pop .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes tile-pop {
  0%   { transform: scale(1); background: var(--sf); }
  30%  { background: var(--green-bg); }
  45%  { transform: scale(1.025); }
  100% { transform: scale(1); background: var(--sf); }
}
.sc-loc-n {
  width: 26px; height: 26px; border-radius: var(--r-2); background: var(--bg);
  border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--fm); font-size: 11px; color: var(--ink-3); flex: none; font-weight: 700;
  transition: all .2s;
}
.sc-loc-item.done .sc-loc-n { background: var(--green-bg); border-color: rgba(22,163,74,0.22); color: var(--green-txt); }
.sc-loc-body { flex: 1; min-width: 0; }
.sc-loc-name { display: block; font-size: 15px; font-weight: 500; color: var(--ink); transition: color .2s; }
.sc-loc-item.done .sc-loc-name { color: var(--ink-3); }
.sc-loc-time { display: block; font-size: 11.5px; color: var(--green-txt); margin-top: 2px; }

/* The stamp: a rotated seal with concentric rings, not a tick in a box. */
.sc-check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink-4);
  display: flex; align-items: center; justify-content: center; flex: none;
  background: transparent; transition: border-color .15s; position: relative;
}
.sc-check svg { width: 14px; height: 11px; stroke: #fff; stroke-width: 3; }
.sc-check.on {
  background: var(--green-txt); border: 2.5px solid var(--green-txt);
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--green-txt), 0 0 0 6px rgba(21,128,61,0.18);
  transform: rotate(-8deg);
}
.sc-loc-item.is-fresh .sc-check.on { animation: stamp-in .32s cubic-bezier(.22,1,.36,1) both; }

/* A small twin of the scan dialog's sparkle burst (.spk/spark-fly), scaled
   down to fit a 30px row stamp instead of an 86px ring — same keyframe,
   shorter reach. */
.sc-check-spark { position: absolute; inset: 0; pointer-events: none; }
.spk2 {
  position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%;
  margin: -2px 0 0 -2px; opacity: 0; animation: spark-fly .5s .1s cubic-bezier(.2,.7,.3,1) both;
}
.spk2:nth-child(4n+1) { background: var(--brand); }
.spk2:nth-child(4n+2) { background: #F05A0E; }
.spk2:nth-child(4n+3) { background: #FFD166; }
.spk2:nth-child(4n)   { background: var(--green); }
.spk2:nth-child(1) { --tx: 0px;   --ty: -26px; }
.spk2:nth-child(2) { --tx: 22px;  --ty: -13px; }
.spk2:nth-child(3) { --tx: 22px;  --ty: 13px;  }
.spk2:nth-child(4) { --tx: 0px;   --ty: 26px;  }
.spk2:nth-child(5) { --tx: -22px; --ty: 13px;  }
.spk2:nth-child(6) { --tx: -22px; --ty: -13px; }
.spk2:nth-child(7) { --tx: 15px;  --ty: -22px; }
.spk2:nth-child(8) { --tx: -15px; --ty: 22px;  }

/* The count that just changed gets a quick bounce instead of silently being
   a different number — applied by app.js the moment it sets the final value. */
.count-pop { animation: count-pop .38s cubic-bezier(.34,1.56,.64,1); }
@keyframes count-pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* The real Google Maps pin (public/img/maps-pin.png) instead of the
   generic outline glyph — 40px tall, 2.5x the old 16px svg, so the tap
   target grows to match rather than clipping/cramping it. */
.loc-map-btn {
  width: 52px; height: 52px; border-radius: var(--r-2); border: none;
  background: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; transition: background .13s;
}
.loc-map-btn img { display: block; width: auto; height: 40px; }
.loc-map-btn:hover { background: var(--brand-s); }

.sc-done-banner {
  background: linear-gradient(135deg, var(--green), #0e9e52);
  padding: 16px 20px; text-align: center; animation: card-in .35s ease both;
}
.sc-done-title { font-family: var(--fd); font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.015em; }
.sc-done-sub { font-size: 12.5px; color: rgba(255,255,255,0.75); margin-top: 3px; }

.sc-foot { padding: 20px; text-align: center; }
.sc-foot-title { font-family: var(--fd); font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.sc-foot-body { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* ─── HUNT COMPLETE ──────────────────────── */
/*
 * Shown once — only on the page load that lands right after the final stamp
 * (card.ejs gates it on `justCompleted`, not on `allDone` alone, so revisiting
 * a finished card never replays it). A lineup of every stop checks itself off
 * in sequence, then the confetti lets go. `.hunt-win` is display:flex by
 * default and Alpine's x-show swaps that for none — no JS-authored inline
 * style, same discipline as the rest of the page.
 */
.hunt-win {
  position: fixed; inset: 0; z-index: 200; background: var(--dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center; overflow: hidden;
}
.hunt-win-badge {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, #FFD166, #F0A500);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  box-shadow: 0 8px 28px -6px rgba(240,165,0,.65); margin-bottom: 18px;
  animation: trophy-drop .6s .1s cubic-bezier(.34,1.56,.64,1) both;
}
/* Falls in from above and lands with a little overshoot, rather than just
   scaling up in place — closer to the "drops into the center" beat. */
@keyframes trophy-drop {
  0%   { transform: translateY(-90px) scale(.5); opacity: 0; }
  60%  { transform: translateY(6px) scale(1.08); opacity: 1; }
  80%  { transform: translateY(-3px) scale(.97); }
  100% { transform: translateY(0) scale(1); }
}
.hunt-win-title { font-family: var(--fd); font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: #fff; margin-bottom: 6px; }
.hunt-win-sub { font-size: 14.5px; color: rgba(255,255,255,0.5); margin-bottom: 26px; }

/* A rubber stamp slamming down right after the trophy lands — oversized and
   transparent, then it hits, overshoots small, and settles rotated like it
   was actually stamped by hand rather than placed dead straight. */
.hunt-win-stamp {
  font-family: var(--fd); font-size: 20px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #F05A0E; border: 3px solid #F05A0E; border-radius: var(--r-s);
  padding: 6px 18px; margin-bottom: 16px; opacity: 0;
  animation: stamp-impact .5s .55s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes stamp-impact {
  0%   { transform: scale(3.2) rotate(-9deg); opacity: 0; }
  55%  { transform: scale(.88) rotate(-9deg); opacity: 1; }
  75%  { transform: scale(1.08) rotate(-9deg); }
  100% { transform: scale(1) rotate(-9deg); opacity: 1; }
}

.hunt-win-lineup {
  list-style: none; width: 100%; max-width: 340px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--r); overflow: hidden;
  margin-bottom: 26px; max-height: 38vh; overflow-y: auto;
}
.hunt-win-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06); opacity: 0;
  animation: card-in .3s ease both;
}
.hunt-win-row:last-child { border-bottom: none; }
.hunt-win-row-n { font-family: var(--fm); font-size: 10.5px; color: rgba(255,255,255,0.3); width: 16px; flex: none; }
.hunt-win-row-name { flex: 1; min-width: 0; text-align: left; font-size: 13.5px; color: #fff; }
.hunt-win-row-check {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green); flex: none;
  display: flex; align-items: center; justify-content: center; opacity: 0;
  animation: check-pop .3s cubic-bezier(.175,.885,.32,1.275) both;
}
.hunt-win-row-check svg { width: 10px; height: 8px; stroke: #fff; stroke-width: 3.5; }
/* Stagger both the row and its check by list position — 22 explicit steps
   covers every hunt this app is realistically sized for; anything past that
   just lands on the last step together, which still reads fine. */
.hunt-win-row:nth-child(1),  .hunt-win-row:nth-child(1)  .hunt-win-row-check { animation-delay: .25s; }
.hunt-win-row:nth-child(2),  .hunt-win-row:nth-child(2)  .hunt-win-row-check { animation-delay: .40s; }
.hunt-win-row:nth-child(3),  .hunt-win-row:nth-child(3)  .hunt-win-row-check { animation-delay: .55s; }
.hunt-win-row:nth-child(4),  .hunt-win-row:nth-child(4)  .hunt-win-row-check { animation-delay: .70s; }
.hunt-win-row:nth-child(5),  .hunt-win-row:nth-child(5)  .hunt-win-row-check { animation-delay: .85s; }
.hunt-win-row:nth-child(6),  .hunt-win-row:nth-child(6)  .hunt-win-row-check { animation-delay: 1.00s; }
.hunt-win-row:nth-child(7),  .hunt-win-row:nth-child(7)  .hunt-win-row-check { animation-delay: 1.15s; }
.hunt-win-row:nth-child(8),  .hunt-win-row:nth-child(8)  .hunt-win-row-check { animation-delay: 1.30s; }
.hunt-win-row:nth-child(9),  .hunt-win-row:nth-child(9)  .hunt-win-row-check { animation-delay: 1.45s; }
.hunt-win-row:nth-child(10), .hunt-win-row:nth-child(10) .hunt-win-row-check { animation-delay: 1.60s; }
.hunt-win-row:nth-child(11), .hunt-win-row:nth-child(11) .hunt-win-row-check { animation-delay: 1.75s; }
.hunt-win-row:nth-child(12), .hunt-win-row:nth-child(12) .hunt-win-row-check { animation-delay: 1.90s; }
.hunt-win-row:nth-child(n+13), .hunt-win-row:nth-child(n+13) .hunt-win-row-check { animation-delay: 2.05s; }

.hunt-win-stats {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-bottom: 26px; opacity: 0; animation: card-in .3s 2.1s ease both;
}
.hunt-win-stat-n { font-family: var(--fd); font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hunt-win-stat-l { font-size: 10.5px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-top: 2px; }
.hunt-win-stat-sep { width: 1px; height: 30px; background: rgba(255,255,255,0.12); }

.hunt-win-acts { width: 100%; max-width: 260px; display: flex; flex-direction: column; gap: 9px; }
.hunt-win-share { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); color: #fff; }
.hunt-win-share:hover { background: rgba(255,255,255,0.14); }

/* Confetti: a real cannon burst from the center, not a rain of ribbons from
   the top edge — every piece starts at 50%/50%, flies out to its own
   (--tx, --ty) by 40% of the animation (the "explosion"), then keeps
   drifting the same direction under gravity while it fades (the "fall").
   60 pieces, each with its own angle/distance/rotation/delay baked into a
   fixed nth-child rule — same reason the sparkle burst below and the
   .w0–.w100 utilities in theme.css do it this way instead of an inline
   style (no style-src 'unsafe-inline' in the CSP). Fires immediately
   (delays are all under half a second) so it lands as the first "you did
   it" impact, alongside the stamp, not an afterthought once the lineup
   finishes. */
.hunt-win-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cf {
  position: absolute; top: 50%; left: 50%; width: 9px; height: 15px; margin: -7px 0 0 -4px;
  opacity: 0; animation: confetti-burst 1.9s cubic-bezier(.15,.65,.35,1) both;
}
.cf:nth-child(6n+1) { background: var(--brand); }
.cf:nth-child(6n+2) { background: #F05A0E; }
.cf:nth-child(6n+3) { background: #FFD166; }
.cf:nth-child(6n+4) { background: var(--green); }
.cf:nth-child(6n+5) { background: #fff; }
.cf:nth-child(6n)   { background: #6FE3D6; }
.cf:nth-child(odd)  { border-radius: 50%; }
.cf:nth-child(1) { --tx: 232px; --ty: 9px; --rot: 460deg; animation-delay: 0.038s; }
.cf:nth-child(2) { --tx: 210px; --ty: 0px; --rot: 600deg; animation-delay: 0.076s; }
.cf:nth-child(3) { --tx: 177px; --ty: 48px; --rot: 740deg; animation-delay: 0.084s; }
.cf:nth-child(4) { --tx: 159px; --ty: 36px; --rot: 880deg; animation-delay: 0.122s; }
.cf:nth-child(5) { --tx: 140px; --ty: 26px; --rot: 320deg; animation-delay: 0.16s; }
.cf:nth-child(6) { --tx: 101px; --ty: 51px; --rot: 460deg; animation-delay: 0.168s; }
.cf:nth-child(7) { --tx: 86px; --ty: 39px; --rot: 600deg; animation-delay: 0.206s; }
.cf:nth-child(8) { --tx: 146px; --ty: 135px; --rot: 740deg; animation-delay: 0.244s; }
.cf:nth-child(9) { --tx: 141px; --ty: 117px; --rot: 880deg; animation-delay: 0.252s; }
.cf:nth-child(10) { --tx: 133px; --ty: 100px; --rot: 320deg; animation-delay: 0.29s; }
.cf:nth-child(11) { --tx: 70px; --ty: 113px; --rot: 460deg; animation-delay: 0.328s; }
.cf:nth-child(12) { --tx: 68px; --ty: 95px; --rot: 600deg; animation-delay: 0.336s; }
.cf:nth-child(13) { --tx: 17px; --ty: 91px; --rot: 740deg; animation-delay: 0.374s; }
.cf:nth-child(14) { --tx: 19px; --ty: 74px; --rot: 880deg; animation-delay: 0.02s; }
.cf:nth-child(15) { --tx: 56px; --ty: 169px; --rot: 320deg; animation-delay: 0.028s; }
.cf:nth-child(16) { --tx: -22px; --ty: 157px; --rot: 460deg; animation-delay: 0.066s; }
.cf:nth-child(17) { --tx: -10px; --ty: 141px; --rot: 600deg; animation-delay: 0.104s; }
.cf:nth-child(18) { --tx: -65px; --ty: 115px; --rot: 740deg; animation-delay: 0.112s; }
.cf:nth-child(19) { --tx: -49px; --ty: 101px; --rot: 880deg; animation-delay: 0.15s; }
.cf:nth-child(20) { --tx: -36px; --ty: 88px; --rot: 320deg; animation-delay: 0.188s; }
.cf:nth-child(21) { --tx: -60px; --ty: 60px; --rot: 460deg; animation-delay: 0.196s; }
.cf:nth-child(22) { --tx: -130px; --ty: 144px; --rot: 600deg; animation-delay: 0.234s; }
.cf:nth-child(23) { --tx: -108px; --ty: 135px; --rot: 740deg; animation-delay: 0.272s; }
.cf:nth-child(24) { --tx: -146px; --ty: 89px; --rot: 880deg; animation-delay: 0.28s; }
.cf:nth-child(25) { --tx: -123px; --ty: 83px; --rot: 320deg; animation-delay: 0.318s; }
.cf:nth-child(26) { --tx: -134px; --ty: 40px; --rot: 460deg; animation-delay: 0.356s; }
.cf:nth-child(27) { --tx: -111px; --ty: 39px; --rot: 600deg; animation-delay: 0.364s; }
.cf:nth-child(28) { --tx: -88px; --ty: 35px; --rot: 740deg; animation-delay: 0.01s; }
.cf:nth-child(29) { --tx: -230px; --ty: 24px; --rot: 880deg; animation-delay: 0.048s; }
.cf:nth-child(30) { --tx: -206px; --ty: 30px; --rot: 320deg; animation-delay: 0.056s; }
.cf:nth-child(31) { --tx: -186px; --ty: -22px; --rot: 460deg; animation-delay: 0.094s; }
.cf:nth-child(32) { --tx: -165px; --ty: -13px; --rot: 600deg; animation-delay: 0.132s; }
.cf:nth-child(33) { --tx: -144px; --ty: -6px; --rot: 740deg; animation-delay: 0.14s; }
.cf:nth-child(34) { --tx: -112px; --ty: -36px; --rot: 880deg; animation-delay: 0.178s; }
.cf:nth-child(35) { --tx: -94px; --ty: -26px; --rot: 320deg; animation-delay: 0.216s; }
.cf:nth-child(36) { --tx: -178px; --ty: -112px; --rot: 460deg; animation-delay: 0.224s; }
.cf:nth-child(37) { --tx: -168px; --ty: -95px; --rot: 600deg; animation-delay: 0.262s; }
.cf:nth-child(38) { --tx: -156px; --ty: -79px; --rot: 740deg; animation-delay: 0.3s; }
.cf:nth-child(39) { --tx: -98px; --ty: -101px; --rot: 880deg; animation-delay: 0.308s; }
.cf:nth-child(40) { --tx: -91px; --ty: -84px; --rot: 320deg; animation-delay: 0.346s; }
.cf:nth-child(41) { --tx: -40px; --ty: -87px; --rot: 460deg; animation-delay: 0.384s; }
.cf:nth-child(42) { --tx: -37px; --ty: -70px; --rot: 600deg; animation-delay: 0.0s; }
.cf:nth-child(43) { --tx: -98px; --ty: -158px; --rot: 740deg; animation-delay: 0.038s; }
.cf:nth-child(44) { --tx: -18px; --ty: -157px; --rot: 880deg; animation-delay: 0.076s; }
.cf:nth-child(45) { --tx: -26px; --ty: -140px; --rot: 320deg; animation-delay: 0.084s; }
.cf:nth-child(46) { --tx: -32px; --ty: -122px; --rot: 460deg; animation-delay: 0.122s; }
.cf:nth-child(47) { --tx: 23px; --ty: -107px; --rot: 600deg; animation-delay: 0.16s; }
.cf:nth-child(48) { --tx: 13px; --ty: -91px; --rot: 740deg; animation-delay: 0.168s; }
.cf:nth-child(49) { --tx: 44px; --ty: -67px; --rot: 880deg; animation-delay: 0.206s; }
.cf:nth-child(50) { --tx: 91px; --ty: -160px; --rot: 320deg; animation-delay: 0.244s; }
.cf:nth-child(51) { --tx: 72px; --ty: -148px; --rot: 460deg; animation-delay: 0.252s; }
.cf:nth-child(52) { --tx: 121px; --ty: -108px; --rot: 600deg; animation-delay: 0.29s; }
.cf:nth-child(53) { --tx: 100px; --ty: -99px; --rot: 740deg; animation-delay: 0.328s; }
.cf:nth-child(54) { --tx: 121px; --ty: -59px; --rot: 880deg; animation-delay: 0.336s; }
.cf:nth-child(55) { --tx: 99px; --ty: -54px; --rot: 320deg; animation-delay: 0.374s; }
.cf:nth-child(56) { --tx: 78px; --ty: -47px; --rot: 460deg; animation-delay: 0.02s; }
.cf:nth-child(57) { --tx: 219px; --ty: -57px; --rot: 600deg; animation-delay: 0.028s; }
.cf:nth-child(58) { --tx: 195px; --ty: -59px; --rot: 740deg; animation-delay: 0.066s; }
.cf:nth-child(59) { --tx: 188px; --ty: -5px; --rot: 880deg; animation-delay: 0.104s; }
.cf:nth-child(60) { --tx: 165px; --ty: -11px; --rot: 320deg; animation-delay: 0.112s; }
@keyframes confetti-burst {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  40%  { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 1; }
  100% { transform: translate(var(--tx), calc(var(--ty) + 240px)) rotate(calc(var(--rot) * 1.6)); opacity: 0; }
}

/* A handful of gold sparkles blooming outward from the trophy the moment it
   lands — .spark-fly is the same keyframe the per-scan sparkle burst uses
   (app.css, PER-SCAN SPARKLE), just bigger reach and gold instead of brand. */
.hw-spark {
  position: absolute; top: 22%; left: 50%; width: 6px; height: 6px; border-radius: 50%;
  margin: -3px 0 0 -3px; opacity: 0; background: #FFD166;
  box-shadow: 0 0 6px rgba(255,209,102,.9);
  animation: spark-fly .9s .65s cubic-bezier(.2,.7,.3,1) both;
}
.hw-spark:nth-child(25) { --tx: 0px;    --ty: -70px; }
.hw-spark:nth-child(26) { --tx: 50px;   --ty: -50px; }
.hw-spark:nth-child(27) { --tx: 70px;   --ty: 0px;   }
.hw-spark:nth-child(28) { --tx: 50px;   --ty: 50px;  }
.hw-spark:nth-child(29) { --tx: 0px;    --ty: 70px;  }
.hw-spark:nth-child(30) { --tx: -50px;  --ty: 50px;  }
.hw-spark:nth-child(31) { --tx: -70px;  --ty: 0px;   }
.hw-spark:nth-child(32) { --tx: -50px;  --ty: -50px; }

@media (prefers-reduced-motion: reduce) {
  .hunt-win-row, .hunt-win-row-check, .cf, .spk, .spk2, .hw-spark, .hunt-win-badge, .hunt-win-stats, .hunt-win-stamp {
    animation: none !important; opacity: 1 !important;
  }
  /* Content-bearing (the checkmark, the tile) still needs to end in its
     correct end state — theme.css's blanket animation-duration: .001ms
     already collapses those to effectively instant, which is what's wanted
     here, not none. Only the purely decorative flash gets removed outright. */
  .sc-loc-item.is-fresh { animation: none !important; }
  .scan-glow { display: none !important; }
}

/* ─── SCAN OVERLAY ───────────────────────── */
.scan-overlay {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  background: rgba(8,8,12,0.97); border: none; padding: 32px; margin: 0;
  color: #fff; overflow: hidden;
}
.scan-overlay::backdrop { background: rgba(8,8,12,0.97); }
.scan-overlay[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-state-a { display: flex; flex-direction: column; align-items: center; }
.scan-state-b { display: none; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.is-found .scan-state-a { display: none; }
.is-found .scan-state-b { display: flex; }
.is-found .scan-cancel { visibility: hidden; }

.scan-loc-title { font-family: var(--fd); font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.02em; text-align: center; margin-bottom: 4px; }
.scan-loc-sub { font-size: 13px; color: rgba(255,255,255,0.38); text-align: center; margin-bottom: 24px; }
.scan-vf { width: 230px; height: 230px; position: relative; margin-bottom: 28px; border-radius: 4px; overflow: hidden; }
.scan-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.scan-corner { position: absolute; width: 24px; height: 24px; border-color: var(--brand); border-style: solid; }
.sc-c-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.sc-c-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 3px 0 0; }
.sc-c-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 3px; }
.sc-c-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }
.scan-sweep {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand) 40%, rgba(10,171,166,.7) 60%, transparent);
  box-shadow: 0 0 14px 4px rgba(10,171,166,.55);
  animation: sweep 1.8s ease-in-out infinite;
}
.scan-success-ring {
  width: 86px; height: 86px; background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; position: relative;
  animation: ring-pop .42s cubic-bezier(.34,1.56,.64,1);
}
.scan-success-ring svg { width: 40px; height: 32px; stroke: #fff; stroke-width: 3; z-index: 1; }
@keyframes ring-pop {
  0%   { transform: scale(.25); opacity: 0; }
  55%  { transform: scale(1.18); opacity: 1; }
  80%  { transform: scale(.94); }
  100% { transform: scale(1); }
}

/* The checkmark draws itself on instead of just popping in — stroke-dasharray
   22 is this path's own length (m4.5 12.5 5 5 10-11, partials/icon.ejs
   'check'), in the icon's own 24-unit viewBox, so it scales correctly
   wherever this class lands regardless of the icon's displayed pixel size. */
.check-draw-svg path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: check-draw .35s .12s ease-out forwards; }
@keyframes check-draw { to { stroke-dashoffset: 0; } }

/* A brief flash of brand light behind the success ring — the "screen glows"
   beat, timed to land right as the ring pops in. */
.scan-glow {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,171,166,.55), rgba(10,171,166,0) 68%);
  animation: glow-flash .7s ease-out both; pointer-events: none;
}
@keyframes glow-flash {
  0%   { opacity: 0; transform: scale(.4); }
  35%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* ─── PER-SCAN SPARKLE ───────────────────── */
/* A dozen fixed particles flung out from the success ring on every stamp. Each
   one's angle and reach is baked into its own nth-child rule rather than an
   inline style — the CSP here has no style-src 'unsafe-inline' (theme.css §RESET
   has the same constraint on the width utilities), so per-particle randomness has
   to live in the stylesheet, not in JS or template-generated style="" text. */
.scan-spark { position: absolute; inset: 0; pointer-events: none; }
.spk {
  position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%;
  margin: -3px 0 0 -3px; opacity: 0; animation: spark-fly .62s cubic-bezier(.2,.7,.3,1) both;
}
.spk:nth-child(4n+1) { background: var(--brand); }
.spk:nth-child(4n+2) { background: #F05A0E; }
.spk:nth-child(4n+3) { background: #FFD166; }
.spk:nth-child(4n) { background: #fff; }
.spk:nth-child(1)  { --tx: 0px;    --ty: -54px; animation-delay: .02s; }
.spk:nth-child(2)  { --tx: 27px;   --ty: -47px; animation-delay: .06s; }
.spk:nth-child(3)  { --tx: 47px;   --ty: -27px; animation-delay: .01s; }
.spk:nth-child(4)  { --tx: 54px;   --ty: 0px;   animation-delay: .08s; }
.spk:nth-child(5)  { --tx: 47px;   --ty: 27px;  animation-delay: .04s; }
.spk:nth-child(6)  { --tx: 27px;   --ty: 47px;  animation-delay: .1s;  }
.spk:nth-child(7)  { --tx: 0px;    --ty: 54px;  animation-delay: .03s; }
.spk:nth-child(8)  { --tx: -27px;  --ty: 47px;  animation-delay: .07s; }
.spk:nth-child(9)  { --tx: -47px;  --ty: 27px;  animation-delay: 0s;   }
.spk:nth-child(10) { --tx: -54px;  --ty: 0px;   animation-delay: .09s; }
.spk:nth-child(11) { --tx: -47px;  --ty: -27px; animation-delay: .05s; }
.spk:nth-child(12) { --tx: -27px;  --ty: -47px; animation-delay: .02s; }
@keyframes spark-fly {
  0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
.scan-s-title { font-family: var(--fd); font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.025em; }
.scan-s-sub { font-size: 14px; color: rgba(255,255,255,0.45); }
.scan-cancel { font-size: 14px; color: rgba(255,255,255,0.28); background: none; border: none; margin-top: 18px; padding: 8px; cursor: pointer; transition: color .13s; }
.scan-cancel:hover { color: rgba(255,255,255,0.55); }
.scan-msg {
  margin-top: 4px; max-width: 280px; text-align: center; font-size: 13.5px; line-height: 1.55;
  color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-s); padding: 11px 14px;
}
.scan-fallback { font-size: 12px; color: rgba(255,255,255,0.28); text-align: center; margin-top: 14px; max-width: 260px; line-height: 1.5; }

/* ─── MESSAGE PAGE ───────────────────────── */
.msg-wrap { background: var(--sf); min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 28px; text-align: center; }
.msg-art {
  width: 68px; height: 68px; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 22px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; box-shadow: var(--sh-xs);
}
.msg-art svg { width: 30px; height: 30px; color: var(--ink-3); }
.msg-title { font-family: var(--fd); font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 9px; }
.msg-body { font-size: 14.5px; color: var(--ink-3); line-height: 1.65; margin-bottom: 26px; max-width: 320px; }
.msg-wrap .btn { width: 100%; }
