/* ==========================================================================
   LIGHT SHOW — the Christmas scavenger hunt (/lightshow)
   --------------------------------------------------------------------------
   Like /tap, this page does NOT load components.css. It has no header, no
   mega menu, no drawer and no modal, and pulling 254KB of them in to reuse a
   button would be the whole page's weight spent on one control. So the stack
   is tokens.css + base.css + this file, and the handful of things that look
   like site components are restated here under a `hunt-` namespace so nobody
   points them back at .btn and drags components.css in behind them.

   Everything the page needs to be is decided by where it gets used: outdoors,
   after dark, one-handed, on a cold phone, by a family who are also driving
   past a display. That is why the appearance is fixed to night (see
   .theme-lights in tokens.css), why the targets are 56px rather than 44,
   why there is one thing on screen at a time, and why the primary action is
   always in the bottom third where a thumb already is.

   The interaction model is Duolingo's, deliberately: one question per screen,
   a segmented progress bar you can see yourself finishing, an answer that is
   judged the instant you commit to it, and a result sheet that has to be
   dismissed before the next question — the beat that makes a right answer
   feel like something rather than a colour change.
   ========================================================================== */

/* Same reasoning as tap.css: base.css leaves the UA underline on <a>, which is
   right for prose and wrong here, where every link is a button or a card. */
.hunt-btn,
.hunt-opt,
.hunt-link--plain { text-decoration: none; }

/* Every glyph comes out of the sprite at 1em, and is resized by whatever it
   sits inside. A default rather than a rule: the sizes that matter are stated
   at the call sites below. */
.hunt-i { width: 1em; height: 1em; flex: none; }

/* The only place on the page where a link has to look like a link, because it
   sits inside a sentence: "Welcome back, the Andersons. Not you?" */
.hunt-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* base.css turns on smooth scrolling for the whole site, which is right for a
   page with in-page anchors and wrong for an app with none. Every scroll here
   is a jump to the top of a screen that has just replaced another one, and
   animating that means the new screen arrives already scrolled — the heading
   slides up out of view while the family is still reading it. There is nothing
   on this page to scroll smoothly TO. */
html { scroll-behavior: auto; }   /* this sheet loads on one page */

body.hunt {
  /* The ground is painted by base.css from --surface-page, which .theme-lights
     has already re-pointed at the night ramp. Stated nowhere else: a
     full-screen colour belongs in the canvas, because a fixed layer stops at
     the edge of the viewport and iOS reveals the gap behind its toolbars. */
  min-height: 100svh;
  overflow-x: hidden;
}

.hunt {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* One column, phone-width, centred. The page is a phone app that happens to
   open on a laptop sometimes — widening it on a big screen would buy nothing
   except longer lines of copy and answer buttons a metre apart. */
.hunt__stage {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  padding-inline: var(--space-sm);
  /* A column, so the screen above can take whatever height is left after the
     footer instead of both of them claiming a full viewport each. Before
     this, every screen was 100svh and the footer sat under it — which meant
     the mark was always exactly one scroll below the fold, on every screen,
     for no reason. */
  display: flex;
  flex-direction: column;
}
.hunt__stage > main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ==========================================================================
   THE SKY
   Three decorative layers, all pointer-transparent, all aria-hidden: a star
   field, snowfall, and a string of lights across the top.

   Absolutely positioned inside the app rather than fixed. Fixed would keep the
   stars in place while the page scrolls, which sounds better and is not: on
   iOS a fixed layer is repainted every time the toolbar moves, and the stars
   would swim against the copy on every scroll. Anchored to the top of the
   document, they simply scroll away, which is what a sky does when you look
   down at your phone.
   ========================================================================== */
.hunt-sky {
  position: absolute;
  inset-inline: 0;
  top: 0;
  /* The star field alone may sit under the notch: it is texture, and losing
     its top 47px to a status bar costs nothing. */
  height: 78svh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* The sky fades out rather than stopping at a line, so there is no seam
     between "the part with stars in it" and the rest of the page. */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

/* The Kids star field, painted through a mask so the stars take a token
   instead of the artwork's baked-in pine fill — the same technique the Kids
   hill uses, and the reason the two sub-brands can share one drawing. */
.hunt-sky__stars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-color: var(--lit-snow-100);
  -webkit-mask-image: url("../img/kids/scene/stars.svg");
          mask-image: url("../img/kids/scene/stars.svg");
  -webkit-mask-position: 50% 0;   mask-position: 50% 0;
  -webkit-mask-size: cover;       mask-size: cover;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* Snow. Two tiled fields of dots at different sizes and speeds, each twice the
   height of its box and translated by exactly half — which is what makes the
   loop seamless, since the second half is a copy of the first.

   transform, not background-position: only the former is composited off the
   main thread, and this runs for the whole time the page is open. */
.hunt-sky__snow {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 200%;
  background-repeat: repeat;
  will-change: transform;
  animation: hunt-fall var(--fall, 22s) linear infinite;
}
.hunt-sky__snow--near {
  --fall: 17s;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 12%, var(--lit-snow-100) 0 1.6px, transparent 1.7px),
    radial-gradient(circle at 72% 38%, var(--lit-snow-100) 0 1.9px, transparent 2px),
    radial-gradient(circle at 45% 76%, var(--lit-snow-100) 0 1.4px, transparent 1.5px);
  background-size: 180px 180px, 240px 240px, 200px 200px;
}
.hunt-sky__snow--far {
  --fall: 34s;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 62% 22%, var(--lit-snow-100) 0 1.1px, transparent 1.2px),
    radial-gradient(circle at 15% 64%, var(--lit-snow-100) 0 1.2px, transparent 1.3px);
  background-size: 150px 150px, 190px 190px;
}
@keyframes hunt-fall {
  from { transform: translate3d(0, -50%, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* --------------------------------------------------------------------------
   THE GARLAND
   A swag of lights hung across the top of every screen. It is the one piece of
   ornament the page carries, and it earns its place by doing the job a header
   would otherwise do: it tells you, before a word is read, what this is.
   -------------------------------------------------------------------------- */
/* The swag keeps its own aspect ratio, so its painted height is always some
   fixed fraction of its width — and --garland-ratio carries that fraction,
   written onto the app root by build.py straight from the SVG's viewBox. The
   fallback is only there so this sheet still makes sense read on its own; the
   page always supplies the real one. That is what lets the screens below keep
   clear of the lights at 375px and at 1440px without a media query, and
   without a number here that has to be remembered when the drawing changes.

   The width stops growing at 46rem for the same reason the app column does:
   past that the string is not more festive, only larger, and a garland scaled
   to a desktop pushes the first heading of every screen a third of the way
   down it. Slightly wider than the stage, so the swag runs off both sides and
   reads as part of a longer string rather than as a decal centred over the
   content. */
.hunt {
  /* How far the hero is pulled up into the wordmark. See .hunt-hero. */
  /* With --hat-rise cancelling the difference between the five, this is the
     whole overlap control: raise it and every animal breaks further into the
     wordmark by the same amount. 3.1rem puts about 6px of the tallest point
     of the hat over the mark's baseline - enough to read as one composition,
     not enough to eat a letter. */
  --hero-lift: 3.1rem;
  --garland-w: min(108vw, 46rem);
  --garland-h: calc(var(--garland-w) * var(--garland-ratio, 0.16));
  /* The page is served with viewport-fit=cover, so it runs UNDER the status
     bar and the notch — which is right for the night ground and wrong for
     everything drawn on it. Everything that has to stay visible is pushed
     down by this instead of by a guessed number; on a device with no notch it
     resolves to zero and nothing moves. */
  --top-safe: env(safe-area-inset-top, 0px);
}
.hunt-garland {
  position: absolute;
  top: var(--top-safe);
  left: 50%;
  transform: translateX(-50%);
  width: var(--garland-w);
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgb(252 222 128 / 0.18));
}
.hunt-garland__wire {
  fill: none;
  stroke: var(--lit-night-600);
  stroke-width: 2.5;
  stroke-linecap: round;
}
/* Every bulb breathes on the same 4s clock, offset by its index, so the string
   reads as one object being lit rather than as thirteen independent blinkers.
   The floor is 0.55, not 0: lights that go out look broken, not festive. */
.hunt-garland__bulb {
  transform-box: fill-box;
  transform-origin: center;
  animation: hunt-twinkle 4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.31s);
}
@keyframes hunt-twinkle {
  0%, 100% { opacity: 0.62; }
  50%      { opacity: 1; }
}
/* Four colours, cycled, so no two neighbours match and the string never falls
   into a pattern the eye can finish. */
.hunt-garland__bulb--bulb  { fill: var(--lit-bulb-300); }
.hunt-garland__bulb--berry { fill: var(--lit-berry-400); }
.hunt-garland__bulb--ice   { fill: var(--lit-ice-300); }
.hunt-garland__bulb--sage  { fill: var(--gl-sage-400); }
/* The flex from the wire to the glass. Thinner than the cable and dimmer than
   the bulb, so it reads as the thing holding the light up rather than as part
   of either. */
.hunt-garland__stem {
  stroke: var(--lit-snow-500);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.55;
}

/* ==========================================================================
   SCREENS
   The whole app is one document; a screen is a <section> and only one is ever
   un-hidden. `hidden` alone would be enough for the browser, but a screen also
   has to lay out as a full-height panel when it IS shown, so display is set
   explicitly for both states rather than left to the UA sheet.
   ========================================================================== */
/* Every screen moves focus to its own heading so a screen reader announces
   where it has arrived. A heading is not a control, though, and it carries
   tabindex="-1" precisely so it can never be tabbed to — so the gold ring the
   browser paints on it is telling the user something that is not true. It was
   showing up as a border around "Light Show Scavenger Hunt" the moment the
   page loaded. Suppressed on the headings only; every real control keeps its
   ring. */
.hunt [data-head]:focus,
.hunt [data-head]:focus-visible { outline: none; }

.hunt-screen[hidden] { display: none; }
.hunt-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  /* Takes the height the stage has left after the footer, so the primary
     action still lands in the same place on every screen and the thumb stops
     hunting for it — but the mark below is on screen rather than one scroll
     under it. Content longer than that grows the screen and the page scrolls
     normally. */
  flex: 1;
  /* Clears the garland. Stated as the garland's own height plus a gap rather
     than as a number that happens to work, so moving the lights moves what
     they hang over — otherwise the first line of every screen ends up behind a
     bulb the next time the swag is redrawn. */
  padding-block: calc(var(--top-safe) + var(--garland-h) + var(--space-sm))
                 calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
}

/* Screens arrive from the right and leave to the left, one step of a flow
   rather than a page swap. Only the incoming screen is animated: running both
   means holding two full-height panels on screen at once, which on a mid-range
   Android is a dropped frame at exactly the moment the app should feel quick. */
/* The quiz is the one screen with the bar above it, and the bar has already
   cleared the notch and covered the lights. Reserving the garland's height a
   second time would open a band of empty sky between the bar and the first
   question. */
.hunt-screen[data-screen="quiz"] { padding-top: var(--space-sm); }

.hunt-screen[data-enter] {
  animation: hunt-slide-in 320ms var(--ease-out) both;
}
.hunt-screen[data-enter="back"] {
  animation-name: hunt-slide-back;
}
@keyframes hunt-slide-in {
  from { opacity: 0; transform: translate3d(22px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes hunt-slide-back {
  from { opacity: 0; transform: translate3d(-22px, 0, 0); }
  to   { opacity: 1; transform: none; }
}

/* The block that holds a screen's primary action. Pushed to the bottom of the
   panel by the auto margin, so short screens and long ones both put the button
   in the thumb zone instead of directly under the last paragraph. */
.hunt-actions {
  margin-top: auto;
  display: grid;
  gap: var(--space-2xs);
  padding-top: var(--space-md);
}

/* ==========================================================================
   BUTTONS
   The press is the point. A flat button on a touch screen gives nothing back
   until the next screen paints, and on a phone with one bar of signal that can
   be half a second of wondering whether the tap registered. This one has a
   solid bottom edge that collapses under the finger — the whole control moves
   down by exactly the depth of its own edge, so it reads as a physical key.
   ========================================================================== */
.hunt-btn {
  --lift: 4px;
  --edge: transparent;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-ui);
  line-height: 1;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 var(--lift) 0 0 var(--edge);
  transition: transform 90ms var(--ease-out),
              box-shadow 90ms var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.hunt-btn:active {
  transform: translateY(var(--lift));
  box-shadow: 0 0 0 0 var(--edge);
}
.hunt-btn[disabled] {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Sage ground, night ink — the site's fixed pairing, at 9.37:1. The edge is
   sage-600, which is the same colour with the light taken off it rather than
   a second green chosen to sit under the first. */
.hunt-btn--go {
  --edge: var(--gl-sage-600);
  background: var(--surface-accent);
  color: var(--text-on-accent);
}
.hunt-btn--go:hover { background: var(--surface-accent-hover); }

/* Used once per screen at most, for the thing that is not the point of the
   screen: skipping ahead, going back, seeing the board instead of playing. */
.hunt-btn--quiet {
  background: transparent;
  color: var(--text-secondary);
  min-height: 48px;
  box-shadow: none;
}
.hunt-btn--quiet:hover { color: var(--text-primary); }

.hunt-btn--wrong {
  --edge: #C2543C;
  background: var(--lit-berry-400);
  color: var(--lit-night-950);
}

/* A round 44px control for the two pieces of chrome that are not content:
   leaving the quiz, and sharing the result. */
.hunt-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.hunt-icon:hover { background: var(--surface-hover); color: var(--text-primary); }
.hunt-icon svg { width: 22px; height: 22px; }
/* Four controls have to share a 375px bar, so the two that are not the
   progress shrink. 40px is still over the 40px floor a thumb needs for a
   control it is not aiming at in a hurry. */
.hunt-icon--sm { width: 40px; height: 40px; }
.hunt-icon--sm svg { width: 19px; height: 19px; }

/* One button, two glyphs, and the state picks which is painted — rather than
   swapping innerHTML, which would rebuild an SVG on every tap. */
.hunt-icon__off { display: none; }
.hunt-icon[aria-pressed="false"] .hunt-icon__on  { display: none; }
.hunt-icon[aria-pressed="false"] .hunt-icon__off { display: block; }
.hunt-icon[aria-pressed="false"] { color: var(--text-muted); opacity: 0.7; }

/* ==========================================================================
   THE CAST
   The five Kids animals, in hats. A guide who is already a member of the
   family reads as belonging here in a way a bought mascot never would, and
   the animal a family picks for the board is one of the same five — so the
   thing cheering you on and the thing with your name beside it are drawn by
   the same hand.

   The hat is a separate SVG laid over the artwork rather than five more
   files: one drawing per animal, dressed for December, and the Kids pages
   keep the cast they already have.
   ========================================================================== */
/* The box IS the artwork: width set, height following the drawing's own ratio.
   That is load-bearing, not incidental — the hat is placed in percentages of
   this box, so a box that is not the same shape as the picture inside it puts
   every hat somewhere else. A square box with object-fit:contain was tried and
   slid all five hats down over the animals' eyes, because a contained 103x146
   fox in a 132 square paints 93 wide with 19px of empty box either side, and
   "13% from the left" then measures from the empty part. */
.hunt-animal {
  position: relative;
  flex: none;
  width: var(--animal, 96px);
  line-height: 0;
}
.hunt-animal__art {
  display: block;
  width: 100%;
  height: auto;
}

/* The two places that needed the five to line up as a set rather than stand at
   their own sizes — the picker row and the leaderboard — no longer contain the
   full figure at all. They use the generated tiles, which are already square
   and already cropped. See APP ICONS in build.py. */

/* Where the hat lands is DERIVED, not written here — see hat_geometry() in
   build.py, which solves it from one tuned brow line per animal so the brim is
   always exactly as wide as the head it sits on. The three values arrive as
   inline custom properties on each .hunt-animal, and lightshow.js rewrites
   them when a family swaps their animal.
   
   Five hand-kept rules used to live here, and that is precisely what broke:
   "top: -11%" cannot mean the same thing on a bear and on a turkey, because
   their heads are different fractions of their boxes.
   
   The rotation angle comes from build.py too. It has to: hat_geometry()
   compensates for it, so an angle set independently here would slide every
   hat sideways without failing anywhere. */
.hunt-animal__hat {
  position: absolute;
  top: var(--hat-t);
  left: var(--hat-l);
  width: var(--hat-w);
  height: auto;
  transform: rotate(var(--hat-tilt, -9deg));
}

/* --------------------------------------------------------------------------
   THE MASCOT IS ALIVE
   Three states, and the idle one is the one that matters: a character that
   only moves when you score is a sprite, and a character that is breathing
   before you touch anything is company. The bob is 4px over 3.4s — slow
   enough that you have to watch to see it, which is the point.
   -------------------------------------------------------------------------- */
.hunt-animal { animation: hunt-bob 3.4s ease-in-out infinite; }
@keyframes hunt-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* The reactions replace the idle rather than layering over it, so the two
   can never fight for the same transform. Both run once and hand back. */
.hunt-verdict__icon[data-mood="right"],
.hunt-animal[data-mood="right"] {
  animation: hunt-cheer 620ms var(--ease-out) 1, hunt-bob 3.4s ease-in-out infinite 620ms;
}
@keyframes hunt-cheer {
  0%   { transform: translateY(0) rotate(0); }
  25%  { transform: translateY(-14px) rotate(-6deg); }
  45%  { transform: translateY(0) rotate(0); }
  65%  { transform: translateY(-8px) rotate(4deg); }
  100% { transform: translateY(0) rotate(0); }
}
.hunt-verdict__icon[data-mood="wrong"],
.hunt-animal[data-mood="wrong"] {
  animation: hunt-shrug 520ms ease-in-out 1, hunt-bob 3.4s ease-in-out infinite 520ms;
}
/* A head-shake, not a wobble: it moves sideways and tips, which is a "no"
   rather than a stumble. Smaller than the cheer, because a miss should be
   answered quietly. */
@keyframes hunt-shrug {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%  { transform: translateX(-5px) rotate(-4deg); }
  50%  { transform: translateX(5px)  rotate(4deg); }
  78%  { transform: translateX(-3px) rotate(-2deg); }
}

/* The fox says things. A speech bubble rather than a caption, because the
   difference between "Question 3 of 7" and a character telling you that you
   are three questions in is the entire difference in tone this page is for. */
.hunt-says {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2xs);
}

/* A FIXED SLOT, and the animal sized by HEIGHT inside it.
   The five drawings have five aspect ratios, so a shared width made the deer
   tower over the turkey — 96px wide is 117 tall on one and 86 on the other.
   Matching heights instead is what "the same size" actually means here, and
   the slot keeps the bubble's left edge still while the animal inside it
   changes.

   The animal's own box must keep the ARTWORK's shape, because the hat is
   placed in percentages of it — so the fixed box is this outer slot and never
   .hunt-animal itself. Sizing .hunt-animal to the slot instead is the bug
   that slid every hat down over the animals' eyes. */
.hunt-says__slot {
  flex: none;
  display: grid;
  place-items: end center;
  width: 6.75rem;    /* the widest of the five at this height, plus a hair */
  height: var(--animal, 6rem);
}
/* The ARTWORK is given the height, as a length. Percentages here go round in
   a circle — .hunt-animal has no height of its own, so an image asking for
   100% of it gets nothing to measure against and falls back to its natural
   size, which is how all five ended up sized by the slot's WIDTH again. With
   a length on the image, .hunt-animal shrinks to fit it and still matches the
   artwork's shape, which is what the hat percentages need. */
.hunt-says__slot .hunt-animal { width: auto; height: auto; }
.hunt-says__slot .hunt-animal__art {
  width: auto;
  height: var(--animal, 6rem);
}
.hunt-says__bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: var(--space-xs) var(--space-sm);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.hunt-says__bubble strong { color: var(--text-primary); }
/* A bubble standing on its own, with no animal to point its tail at. */
.hunt-says__bubble--wide { border-bottom-left-radius: var(--radius-lg); }
/* A second sentence inside the welcome, on its own line and a step quieter —
   it is a caveat about a replay, not part of the greeting. */
.hunt-says__aside {
  display: block;
  margin-top: var(--space-3xs);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}
.hunt-says__aside[hidden] { display: none; }

/* ==========================================================================
   HERO — the start screen
   ========================================================================== */
.hunt-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  /* Pulled up under the wordmark so the animal's hat just breaks into it.
     A hat that stops politely short reads as two stacked blocks; a few pixels
     of overlap reads as one composition with a character standing in it.

     --hat-rise cancels out the difference between the five. Each hat's
     painted top reaches a different distance above its animal's box — the
     wolverine's by 43px at hero size, the deer's not at all, because the
     deer's sits low between antlers that are themselves the tallest thing it
     has. Pushing each animal back down by its own rise puts the topmost
     painted pixel in the same place whichever one is showing, so --hero-lift
     alone decides the overlap and means the same thing for all five.

     Measured before that: a single margin gave the wolverine 45px of overlap
     on a 27px-tall wordmark and the deer an 8px gap. */
}
.hunt-hero .hunt-animal {
  /* The lift lives HERE, not on .hunt-hero, because --hat-rise is written
     inline on this element and --animal is declared on it. On the parent both
     resolved to their fallbacks and the compensation silently did nothing —
     the margin was simply -(lift) for all five, which is exactly what it
     looked like. */
  margin-top: calc(var(--animal) * var(--hat-rise, 0) - var(--hero-lift));
  /* .hunt-animal is already position: relative, so it paints above the
     wordmark's non-positioned box without needing a z-index. Stated here so
     nobody removes the relative and wonders why the hat went behind. */
  z-index: 1;
}
/* THE HEADER
   The page has no site chrome, so this is the only thing on the first screen
   that says whose light show it is — and it is a link home for the same reason
   /tap's monogram is: somebody who arrives here off a sign in a car park has
   no other way back to the site.

   The full wordmark, in white, centred, sitting above everything. It replaced
   a muted GL monogram tucked over the animal, which was both smaller than the
   brand deserves on its own landing page and close enough to the hat that the
   pom kept landing on it. */
.hunt-head {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
}
.hunt-head__link { display: block; line-height: 0; }
.hunt-head__mark {
  height: 34px;
  width: auto;
  color: var(--text-primary);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.hunt-head__link:hover .hunt-head__mark { opacity: 0.75; }

.hunt-hero .hunt-animal { --animal: 132px; }
.hunt-hero__title {
  font-size: var(--display-lg);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
/* The one word that is the show. Gold on night at 14.25:1 — it can afford to
   be the brightest thing on the screen because it is also the largest. */
.hunt-hero__lit { color: var(--text-accent); }
/* Every screen after the first opens on a heading rather than a hero, and a
   display-lg on a form is the page shouting at somebody filling in a field. */
.hunt-hero__title--sm { font-size: var(--display-md); }
.hunt-hero__lede {
  max-width: 26rem;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  text-wrap: pretty;
}

/* Three facts, in a row, as chips rather than a bulleted list — the list is
   the shape of a page and the row is the shape of a rule sheet. */
.hunt-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xs);
}
.hunt-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4rem 0.75rem;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hunt-fact svg { width: 14px; height: 14px; color: var(--text-accent); }

/* ==========================================================================
   CARDS
   One inset group with hairline separators, not five bordered boxes — the
   same rule tap.css states, and for the same reason: every drawn edge is a
   line the eye has to resolve before it reaches a word.
   ========================================================================== */
.hunt-card {
  padding: var(--space-md);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.hunt-card__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-condensed);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3xs);
}
.hunt-card__label svg { width: 14px; height: 14px; color: var(--text-accent); }

/* The prize. A card with a gold hairline and a warm glow behind it, because
   it is the reason a family in a warm car gets their phone out at all. */
.hunt-prize__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-ui);
}
.hunt-prize__when { color: var(--text-secondary); font-size: var(--text-sm); }

/* ==========================================================================
   THE SIGN-UP
   Three fields and nothing else. Every extra field here is a family who does
   not finish, and the only ones that have a job to do are the name that goes
   on the board and the two ways to tell somebody they won.
   ========================================================================== */
.hunt-field { display: grid; gap: var(--space-3xs); }
.hunt-field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}
.hunt-field__hint { font-size: var(--text-xs); color: var(--text-muted); }
.hunt-field__error {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-danger);
}
.hunt-field__error[hidden] { display: none; }

.hunt-input {
  width: 100%;
  /* 16px minimum, always. Anything smaller and iOS Safari zooms the page on
     focus, which on this layout means the family is now looking at a
     half-width form they have to pinch back out of. */
  font-size: var(--text-base);
  font-family: inherit;
  min-height: 56px;
  padding: 0 var(--space-sm);
  background: var(--surface-sunken);
  border: var(--border-width-thick) solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.hunt-input::placeholder { color: var(--text-muted); }
.hunt-input:focus { border-color: var(--border-accent); }
.hunt-field[data-invalid] .hunt-input { border-color: var(--lit-berry-400); }

/* Consent is a real checkbox with a real label, not a pre-ticked line of small
   print. It is unticked on arrival by design — see the note in build.py. */
.hunt-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2xs);
  padding: var(--space-xs);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  cursor: pointer;
}
.hunt-check:hover { background: var(--surface-hover); }
.hunt-check input {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  accent-color: var(--surface-accent);
}

/* --------------------------------------------------------------------------
   THE PICKER
   Five radios wearing animal costumes. The input is clipped to a 1px box
   rather than display:none, which would take it out of the tab order and out
   of the accessibility tree with it — the control has to stay a real radio
   group or arrow keys stop working and nothing is announced.
   -------------------------------------------------------------------------- */
.hunt-picker {
  min-width: 0;   /* a fieldset defaults to min-content and will not shrink */
  padding: 0;
  border: 0;
  /* NOT `margin: 0`. This sheet loads after base.css and the two selectors
     have equal specificity, so zeroing the margin here quietly beat
     `.stack > * + *` and glued "Pick your animal" to the phone field's hint.
     The picker asks a different KIND of question from the three text fields
     above it, so it takes a step more than the stack's own rhythm rather than
     just getting it back. */
  margin-top: var(--space-lg);
}
/* minmax(0, 1fr), not 1fr. A grid track's implicit minimum is min-content, and
   the min-content of a column holding an <img> is that image's intrinsic
   width — 103px for the fox, 201 for the deer — so plain 1fr columns refuse to
   shrink to a fifth of a phone and the row bursts its container. The same
   reason `min-width: 0` appears twice below. */
.hunt-picker__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3xs);
  margin-top: var(--space-2xs);
}
.hunt-picker__opt {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  min-width: 0;
  cursor: pointer;
}
/* The legend's inset is a UA quirk from when fieldsets had visible borders. */
.hunt-picker legend { padding: 0; }
.hunt-picker__opt input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The icon carries its own ground and its own corners, so the chip is a frame
   around it and nothing else. A bordered box with a tile inside it draws two
   rounded rectangles a couple of pixels apart, which reads as a rendering
   fault rather than as a selection. */
/* --icon-radius is a PERCENTAGE, written onto the app root by build.py from
   the same ICON_RADIUS the tiles are drawn with. It has to be a percentage,
   not a px value: the tile's own corner is 23.5% of its width, so it grows
   with the tile — 15px at 64px in the picker, 8px at 34px on the board. A
   fixed --radius-md was 14px in both places, which left the CSS clip and the
   painted corner disagreeing by a pixel at one size and six at the other, and
   the selected ring following the wrong one of the two. */
.hunt-picker__box {
  display: block;
  width: 100%;
  border-radius: var(--icon-radius, 23.5%);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.hunt-picker__icon {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--icon-radius, 23.5%);
}

.hunt-picker__name {
  font-family: var(--font-condensed);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.hunt-picker__opt:hover .hunt-picker__box { background: var(--surface-hover); }

/* Chosen: a sage ring drawn OUTSIDE the tile, and a step forward. Three
   signals — ring, lift, label — because one of them is colour and this is a
   page read in the dark. box-shadow rather than an outline so the ring follows
   the tile's own corner radius. */
.hunt-picker__opt input:checked ~ .hunt-picker__box {
  box-shadow: 0 0 0 3px var(--gl-sage-400);
  transform: translateY(-3px);
}
.hunt-picker__opt input:checked ~ .hunt-picker__name { color: var(--gl-sage-400); }
/* :focus-visible on a clipped input paints nothing, so the ring is drawn on
   the box the eye is actually on. */
.hunt-picker__opt input:focus-visible ~ .hunt-picker__box {
  outline: var(--border-width-thick) solid var(--focus-ring);
  outline-offset: 3px;
}
/* Only the chosen tile breathes, and it bobs as one object rather than the
   animal moving inside its own ground. Five idling tiles in a row is a row
   that will not sit still to be read. */
.hunt-picker__opt input:checked ~ .hunt-picker__box {
  animation: hunt-bob 3.4s ease-in-out infinite;
}

.hunt-fine {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}
.hunt-fine a { color: var(--text-secondary); }

/* ==========================================================================
   THE QUIZ BAR
   Sticky, because the progress is the reason anyone answers a seventh
   question. Three parts: the way out, how far along you are, and what you
   have won so far.
   ========================================================================== */
.hunt-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) 0;
  /* The bar sits over scrolling content on short screens, so it needs a ground
     of its own. A blurred one, since the star field passes underneath it. */
  background: rgb(6 19 26 / 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  margin-inline: calc(var(--space-sm) * -1);
  padding-inline: var(--space-sm);
  /* The bar is the one thing that sticks to the top of the window, so it is
     the one thing that has to pad ITSELF out of the notch rather than be
     pushed down — a margin would leave a strip of scrolling content showing
     above it. */
  padding-top: calc(var(--space-2xs) + var(--top-safe));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hunt-bar { background: var(--lit-night-950); }
}

/* One segment per question, so the length of the thing is legible at a glance
   before the first answer — a single continuous bar tells you how far you are
   but never how much is left in units you can count. */
.hunt-seg {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
}
.hunt-seg__i {
  flex: 1;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  transition: background-color var(--dur-normal) var(--ease-out);
}
.hunt-seg__i[data-state="right"] { background: var(--gl-sage-400); }
.hunt-seg__i[data-state="wrong"] { background: var(--lit-berry-400); }
.hunt-seg__i[data-state="now"] {
  background: var(--lit-bulb-300);
  /* The live segment pulses. It is the only moving thing in the bar, so it
     never competes with itself for attention. */
  animation: hunt-pulse 1.8s ease-in-out infinite;
}
@keyframes hunt-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.hunt-points {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  flex: none;
  font-family: var(--font-condensed);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--lit-bulb-300);
}
.hunt-points svg { width: 15px; height: 15px; }
/* A short, sharp lift when the number changes. Nothing else on the screen
   moves at that moment, so a 14% scale is plenty to be seen. */
.hunt-points[data-bump] { animation: hunt-bump 420ms var(--ease-out); }
@keyframes hunt-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* The stars earned for one clue, floating off the counter they were just
   added to. It is the same number the verdict sheet already states, said a
   second time in the place the total lives — which is what connects "you got
   that one" to "this is what you have". Absolute, so a three-digit gain
   cannot widen the bar as it appears. */
.hunt-points__gain {
  position: absolute;
  top: 0;
  right: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.hunt-points { position: relative; }
.hunt-points__gain[data-show] { animation: hunt-float 1100ms var(--ease-out) 1; }
@keyframes hunt-float {
  0%   { opacity: 0; transform: translateY(4px)   scale(0.85); }
  18%  { opacity: 1; transform: translateY(-6px)  scale(1.1); }
  62%  { opacity: 1; transform: translateY(-18px) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.95); }
}

/* ==========================================================================
   THE QUESTION
   ========================================================================== */
/* Answers follow the question immediately rather than being pushed to the
   bottom of the panel. Pushing them down was tried and is wrong twice over: it
   opens a screen-height void between the question and its answers, and it
   parks the options exactly where the verdict sheet is about to appear — so
   the correct answer is revealed underneath the thing revealing it. Where they
   sit naturally, on a 375x812 phone, is already inside thumb reach. */
.hunt-q { display: grid; gap: var(--space-sm); }

/* Where to look. On a scavenger hunt the hardest part of a question is not the
   answer, it is knowing which display it is about — so the location is stated
   above the question rather than buried inside it. */
.hunt-q__where {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-accent-subtle);
  color: var(--gl-sage-400);
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.hunt-q__where svg { width: 13px; height: 13px; }

.hunt-q__text {
  font-size: var(--display-sm);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   ANSWERS
   Full-width rows, not a two-up grid. A grid fits more on screen and costs the
   one thing that matters at arm's length in the dark: every option starts at
   the same left edge, so the eye runs down a single column instead of
   zig-zagging across four boxes.
   -------------------------------------------------------------------------- */
.hunt-opts {
  display: grid;
  gap: var(--space-2xs);
  list-style: none;
  margin: 0;
  padding: 0;
}
.hunt-opt {
  --edge: var(--lit-night-600);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 60px;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--surface-raised);
  border: var(--border-width-thick) solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 0 0 var(--edge);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-align: left;
  cursor: pointer;
  transition: transform 90ms var(--ease-out),
              box-shadow 90ms var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.hunt-opt:active { transform: translateY(4px); box-shadow: none; }

/* The letter key. It is not decoration: it gives the answer a short, spoken
   name, which is how a car full of people argues about which one to pick. */
.hunt-opt__key {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: var(--border-width-thick) solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-condensed);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
}
.hunt-opt__text { flex: 1; min-width: 0; }

.hunt-opt[data-state="picked"] {
  --edge: #2E6A82;
  border-color: var(--lit-ice-300);
  background: var(--lit-night-700);
}
.hunt-opt[data-state="picked"] .hunt-opt__key {
  border-color: var(--lit-ice-300);
  color: var(--lit-ice-300);
}

/* Right and wrong are never carried by colour alone — the key swaps to a tick
   or a cross, so the state survives both a colour-blind reader and a phone
   screen in bright headlights. */
.hunt-opt[data-state="right"] {
  --edge: var(--gl-sage-600);
  border-color: var(--gl-sage-400);
  background: var(--surface-accent-subtle);
}
.hunt-opt[data-state="right"] .hunt-opt__key {
  border-color: var(--gl-sage-400);
  background: var(--gl-sage-400);
  color: var(--lit-night-950);
}
.hunt-opt[data-state="wrong"] {
  --edge: #7E3524;
  border-color: var(--lit-berry-400);
  background: rgb(239 124 99 / 0.12);
}
.hunt-opt[data-state="wrong"] .hunt-opt__key {
  border-color: var(--lit-berry-400);
  background: var(--lit-berry-400);
  color: var(--lit-night-950);
}
.hunt-opt[data-state="right"] .hunt-opt__key svg,
.hunt-opt[data-state="wrong"] .hunt-opt__key svg { width: 18px; height: 18px; }

/* Once an answer is judged, the others stop being controls. They stay legible
   — you should be able to read what you nearly picked — but they lose their
   edge and their press. */
.hunt-opt[disabled] { cursor: default; }
.hunt-opt[disabled]:not([data-state]) {
  box-shadow: none;
  opacity: 0.55;
}

/* ==========================================================================
   THE VERDICT SHEET
   Fixed to the bottom, over everything, and it holds the Continue button — so
   the answer, the reason and the way forward are all in one place under the
   thumb rather than scattered up the screen.
   ========================================================================== */
.hunt-sheet {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  padding: var(--space-md) var(--space-sm)
           calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  transform: translateY(101%);
  transition: transform var(--dur-normal) var(--ease-out);
}
.hunt-sheet[hidden] { display: none; }
.hunt-sheet[data-state] { transform: translateY(0); }
.hunt-sheet__inner {
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  display: grid;
  gap: var(--space-sm);
}
.hunt-sheet[data-state="right"] { background: var(--surface-accent-subtle); }
.hunt-sheet[data-state="wrong"] { background: #3A1A14; }

.hunt-verdict {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.hunt-verdict__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
}
.hunt-verdict__mark svg { width: 24px; height: 24px; }
.hunt-sheet[data-state="right"] .hunt-verdict__mark {
  background: var(--gl-sage-400);
  color: var(--lit-night-950);
}
.hunt-sheet[data-state="wrong"] .hunt-verdict__mark {
  background: var(--lit-berry-400);
  color: var(--lit-night-950);
}
/* The family's own tile, reacting, at the moment the answer lands — the same
   icon that is beside their name on the board, not the standing figure. At
   46px in a crowded row the figure was mostly legs; the tile is a face. */
.hunt-verdict__icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: var(--icon-radius, 23.5%);
}

/* The words take all the free space, which is what puts the gain and the tick
   hard against the right edge without either of them needing an auto margin —
   two auto margins in one row would split the space between them and land the
   gain in the middle. */
.hunt-verdict__said { flex: 1; min-width: 0; }

.hunt-verdict__head {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-ui);
  line-height: var(--leading-snug);
}
.hunt-sheet[data-state="right"] .hunt-verdict__head { color: var(--gl-sage-400); }
.hunt-sheet[data-state="wrong"] .hunt-verdict__head { color: var(--lit-berry-300); }
.hunt-verdict__body {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
}
.hunt-verdict__body strong { color: var(--text-primary); }

/* Sits above the sheet's own top edge so it reads as landing ON the sheet. */
.hunt-gain {
  align-self: center;
  font-family: var(--font-condensed);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--lit-bulb-300);
}

/* --------------------------------------------------------------------------
   THE STREAK TOAST
   Three right in a row is the only moment the app interrupts itself, and it
   does so for about a second and a half. Any more often and the interruption
   becomes the texture of the page rather than a reward inside it.
   -------------------------------------------------------------------------- */
.hunt-toast {
  position: fixed;
  left: 50%;
  top: 18svh;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--lit-bulb-300);
  color: var(--lit-night-950);
  font-weight: var(--weight-bold);
  white-space: nowrap;
  box-shadow: 0 10px 30px -8px rgb(252 222 128 / 0.45);
  animation: hunt-toast 1600ms var(--ease-out) both;
}
.hunt-toast[hidden] { display: none; }
.hunt-toast svg { width: 20px; height: 20px; }
@keyframes hunt-toast {
  0%   { opacity: 0; transform: translate(-50%, 14px) scale(0.9); }
  14%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  80%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(0.96); }
}

/* ==========================================================================
   THE RESULT
   ========================================================================== */
.hunt-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}
.hunt-result .hunt-animal { --animal: 116px; }

/* The number, at the size the number deserves. Tabular figures so the count-up
   does not shuffle the layout on every frame it passes through. */
.hunt-score {
  font-family: var(--font-condensed);
  font-size: clamp(3.5rem, 2rem + 9vw, 5.5rem);
  font-weight: var(--weight-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--lit-bulb-300);
  text-shadow: 0 0 34px rgb(252 222 128 / 0.35);
}
.hunt-score__unit {
  display: block;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Three numbers about the run, sharing one card and separated by hairlines
   rather than sitting in three boxes. */
.hunt-tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hunt-tally__i {
  padding: var(--space-sm) var(--space-2xs);
  text-align: center;
}
.hunt-tally__i + .hunt-tally__i { border-left: var(--border-width) solid var(--border-subtle); }
.hunt-tally__n {
  display: block;
  font-family: var(--font-condensed);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.hunt-tally__l {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-condensed);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The draw entry, drawn as a ticket: a card with two bites taken out of its
   sides by a pair of radial gradients, and a dashed rule where it would tear.
   It is the only skeuomorph on the page, and it is here because a family needs
   to believe something was actually entered on their behalf. */
/* --------------------------------------------------------------------------
   THE TICKET
   A card with two bites taken out of its sides, and the gold hairline carries
   on around the bites instead of stopping at them.

   The bites are a real MASK, not discs painted in the page colour. Painting
   them was simpler and had two costs: the ticket only looked right over one
   background, and the border drew a straight line across each bite's mouth —
   a circle with a chord through it rather than a piece missing. Masking cuts
   the border away with everything else, which leaves the mouth open and lets
   the arc do the closing.

   The arc itself is a background ring sized to start exactly where the mask
   becomes opaque, so the two meet with no hairline of ground between them.
   -------------------------------------------------------------------------- */
.hunt-ticket {
  --notch-r: 11px;
  --notch-y: 58%;
  --ticket-arc: rgb(252 222 128 / 0.55);

  /* Where the mask stops cutting, and where the ring is drawn. Stated once so
     the two cannot drift apart by the half pixel that would show as a gap. */
  --notch-edge: calc(var(--notch-r) + 0.5px);
  --notch-out:  calc(var(--notch-r) + 1.7px);

  --ticket-rings:
    radial-gradient(circle at left var(--notch-y), transparent 0 var(--notch-edge),
      var(--ticket-arc) var(--notch-edge) var(--notch-out), transparent var(--notch-out)),
    radial-gradient(circle at right var(--notch-y), transparent 0 var(--notch-edge),
      var(--ticket-arc) var(--notch-edge) var(--notch-out), transparent var(--notch-out));
  --ticket-body: linear-gradient(var(--lit-night-800), var(--lit-night-800));

  position: relative;
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--ticket-rings), var(--ticket-body);
  border: var(--border-width) solid rgb(252 222 128 / 0.3);
  text-align: left;

  /* Two holes, so the layers have to INTERSECT — the default is `add`, which
     unions the opaque parts and cuts nothing at all. That is also the graceful
     failure: where mask-composite is unsupported the ticket simply keeps its
     square edges rather than breaking. */
  -webkit-mask-image:
    radial-gradient(circle at left var(--notch-y), transparent 0 var(--notch-r), #000 var(--notch-edge)),
    radial-gradient(circle at right var(--notch-y), transparent 0 var(--notch-r), #000 var(--notch-edge));
          mask-image:
    radial-gradient(circle at left var(--notch-y), transparent 0 var(--notch-r), #000 var(--notch-edge)),
    radial-gradient(circle at right var(--notch-y), transparent 0 var(--notch-r), #000 var(--notch-edge));
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* Tonight's prize wears the same ticket as the draw entry it is promising —
   the thing you might win and the stub that says you are in the draw for it
   are the same object seen twice. It keeps the warm glow it always had, which
   is the only thing separating the two. */
.hunt-ticket--glow {
  background: var(--ticket-rings),
    radial-gradient(120% 140% at 50% -20%, rgb(252 222 128 / 0.13), transparent 62%),
    var(--ticket-body);
  border-color: rgb(252 222 128 / 0.35);
}
.hunt-ticket__rule {
  height: 0;
  margin: var(--space-xs) 0;
  border-top: 1px dashed rgb(252 222 128 / 0.35);
}
.hunt-ticket__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-ui);
}

/* ==========================================================================
   THE LEADERBOARD
   ========================================================================== */
.hunt-board {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hunt-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  min-height: 56px;
}
.hunt-row + .hunt-row { border-top: var(--border-width) solid var(--border-subtle); }
.hunt-row__rank {
  flex: none;
  width: 2rem;
  font-family: var(--font-condensed);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: center;
}
/* Top three get the gold, and only the gold — no medals, no trophies. The
   ramp already says first, second and third in the order it is printed. */
.hunt-row[data-top] .hunt-row__rank { color: var(--lit-bulb-300); }
/* The tile, at the size a row can afford. This is the whole reason the icons
   exist: a standing figure contained in 34px is four legs and a smudge, and a
   leaderboard is read by scanning down it. Standing still, too — twenty-five
   bobbing animals is a list nobody can scan. */
.hunt-row__icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--icon-radius, 23.5%);
}
.hunt-row__name {
  flex: 1;
  min-width: 0;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-ui);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hunt-row__pts {
  flex: none;
  font-family: var(--font-condensed);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
/* The family reading the page. Marked with a ground and a rail rather than a
   colour on the text, so it is findable while scrolling past at speed. */
.hunt-row[data-you] {
  background: var(--surface-accent-subtle);
  box-shadow: inset 3px 0 0 0 var(--gl-sage-400);
}
.hunt-row[data-you] .hunt-row__name { color: var(--gl-sage-400); }

.hunt-empty {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ==========================================================================
   THE INVITATION
   The last screen, and the actual point of the whole exercise: a family who
   drove through a light show is a family who might come at Christmas. It is
   the only section on the page that carries the church's own sage, so it does
   not read as another part of the game.
   ========================================================================== */
.hunt-invite {
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 120% at 50% 0%, rgb(122 199 153 / 0.14), transparent 60%),
    var(--surface-raised);
  border: var(--border-width) solid rgb(122 199 153 / 0.28);
  text-align: center;
}
.hunt-invite__title {
  font-size: var(--display-sm);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.hunt-times {
  display: grid;
  gap: var(--space-sm);
  margin-block: var(--space-sm);
  text-align: left;
}
/* One campus, its times under it. Grouped rather than run together because
   two buildings with different times on the same two nights is exactly the
   thing somebody misreads in a car park. */
.hunt-times__group { display: grid; gap: var(--space-3xs); }
.hunt-times__campus {
  display: flex;
  align-items: baseline;
  gap: var(--space-2xs);
  font-family: var(--font-condensed);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-secondary);
}
/* The campus they are parked at, marked so they do not have to work it out. */
.hunt-times__here {
  color: var(--gl-sage-400);
  letter-spacing: var(--tracking-ui);
  text-transform: none;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
}
.hunt-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}
.hunt-time__what {
  min-width: 0;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-ui);
}
/* The time never wraps; the label does. "9:00 & 10:30 AM" broken across two
   lines with the meridiem alone on the second is unreadable, and it is the
   half of the pair somebody is actually looking for. */
.hunt-time__when {
  flex: none;
  white-space: nowrap;
  font-family: var(--font-condensed);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: right;
}

/* The way back to the rest of the site. Deliberately the quietest thing on the
   page: this is an app, and a full site footer at the end of it would be the
   nav the page was built without. */
/* Flex, not text-align. base.css resets every svg to display:block, and a
   block box is not centred by text-align — it is centred by auto margins or
   by its parent being a flex column, which is what this is. The wordmark sat
   hard left for exactly that reason. */
.hunt-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-md) var(--space-sm)
           calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.hunt-foot__mark {
  height: 24px;
  width: auto;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.hunt-foot a:hover .hunt-foot__mark { color: var(--text-secondary); }
.hunt-foot__line {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   WIDER THAN A PHONE
   The app does not become a desktop layout — it becomes the same app with room
   around it. Only two things change: the stage gets a frame so it does not
   float in a black field, and the sheet stops being full-bleed.
   ========================================================================== */
@media (min-width: 34rem) {
  .hunt-screen { padding-inline: var(--space-sm); }
  .hunt-sheet {
    inset-inline: auto;
    left: 50%;
    transform: translate(-50%, 101%);
    width: min(32rem, 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .hunt-sheet[data-state] { transform: translate(-50%, 0); }
}

/* ==========================================================================
   REDUCED MOTION
   base.css already collapses transitions and animations globally. What it
   cannot do is decide what should still be true when nothing moves, which is
   the part that matters here: the snow and the twinkle are removed outright
   rather than run at 1ms, because a snowflake that teleports once is worse
   than no snow, and the sheet and the toast keep their end states so the
   verdict is still readable and the streak is still announced.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hunt-sky__snow { display: none; }
  .hunt-garland__bulb { animation: none; opacity: 0.9; }
  .hunt-seg__i[data-state="now"] { animation: none; }
  .hunt-toast { animation: none; }
  .hunt-btn:active,
  .hunt-opt:active { transform: none; }
  /* The cast stops breathing and stops reacting. The reactions carry no
     information the verdict sheet does not already say in words, so they are
     removed rather than shortened. */
  .hunt-animal,
  .hunt-verdict__icon { animation: none !important; }
  /* The gain would otherwise land on its own end frame, which is opacity 0 —
     the number would never be seen at all. */
  .hunt-points__gain[data-show] { animation: none; opacity: 1; }
}
