/* ==========================================================================
   Theme: GLOW  —  "Glow Party" birthday
   Mood: a party in a dark green room; mint paper, cream card stock, a mint
   wax seal. Flip the lights off and the hidden friends glow (app.js, glowHunt).
   Pairing: Fredoka (round, friendly display) / Nunito (body) / Nunito (labels).
   Contrast: ink #17301F on paper #FBF7EA ≈ 14:1; ink-soft #3F5A49 ≈ 7:1;
   paper text on primary #2E6B49 ≈ 6:1. Mint (#8FD9B0) is fill only.
   Themes never set `transform` or `position` on hooks (base.css owns layout).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600&family=Nunito:ital,wght@0,400;0,600;0,700;1,400&display=optional');

:root {
  /* --- required contract --- */
  --c-page:      #E4F1E8;   /* pale mint room */
  --c-paper:     #FBF7EA;   /* cream card stock */
  --c-paper-2:   #CFF3DD;   /* mint stock */
  --c-ink:       #17301F;   /* forest night — 14:1 on paper */
  --c-ink-soft:  #3F5A49;   /* ≈7:1 on paper */
  --c-primary:   #2E6B49;   /* party green */
  --c-accent:    #1F4A33;   /* deep green */
  --c-foil:      #8FD9B0;   /* mint highlight — fill only */
  --font-script: 'Fredoka', 'Arial Rounded MT Bold', 'Helvetica Neue', sans-serif;
  --font-serif:  'Nunito', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --font-sans:   'Nunito', 'Avenir Next', 'Helvetica Neue', sans-serif;

  /* --- extended tokens --- */
  --c-on-paper-2:      #17301F;
  --c-on-paper-2-soft: #3F5A49;
  --c-on-primary:      #FBF7EA;
  --c-on-accent:       #FBF7EA;
  --c-text-accent:     #2E6B49;
  --c-foil-ink:        #17301F;
  --c-envelope:        #1F4A33;   /* dark green envelope */
  --c-photo-paper:     #FFFDF6;
  --c-line:            rgba(23, 48, 31, .22);
  --c-focus:           #17301F;
  --misregister:       2px 1.5px 0 rgba(143, 217, 176, .9);   /* mint glow offset */
  --shadow-rgb:        14, 38, 24;
  --shadow-paper: 0 1px 0 rgba(var(--shadow-rgb), .18),
                  0 8px 14px -8px rgba(var(--shadow-rgb), .30);
  --shadow-lift:  0 2px 0 rgba(var(--shadow-rgb), .14),
                  0 16px 22px -12px rgba(var(--shadow-rgb), .36);
  --radius-paper: 10px;
  --grain: url(../assets/shared/paper-grain.svg);
  --grain-size: 180px;
  --ease-paper: cubic-bezier(.2, .7, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.4, .64, 1);
  --dur-lift: 200ms;
}

/* ---------- page ground ---------- */
body {
  background-color: var(--c-page);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
  color: var(--c-ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.55;
  font-optical-sizing: auto;
}

/* ---------- shared paper behaviour ---------- */
.card, .card--alt, .polaroid, .tag-button, .envelope, .page {
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
}
.card, .card--alt, .polaroid, .tag-button, .seal, .envelope {
  transition: translate var(--dur-lift) var(--ease-bounce),
              scale 120ms ease-out,
              box-shadow var(--dur-lift) var(--ease-paper);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .polaroid:hover, .tag-button:hover, .envelope:hover {
    translate: 0 -5px;
    box-shadow: var(--keyline, 0 0 #0000), var(--shadow-lift);
  }
  .seal:hover { translate: 0 -3px; }
}
.card:active, .polaroid:active, .tag-button:active, .seal:active { scale: .97; }

:where(.card, .card--alt, .polaroid, .tag-button, .seal, .envelope, .btn, a, button, input, select, textarea):focus-visible {
  outline: 3px dotted var(--c-focus);
  outline-offset: 5px;
}

.polaroid, .tag-button, .envelope { --keyline: 0 0 #0000; }

/* ---------- envelope ---------- */
.envelope {
  background-color: var(--c-envelope);
  color: var(--c-on-primary);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
}
.envelope {
  --envelope-liner-image: url(../assets/glow/envelope-liner.svg);
  --envelope-interior: #BFE9CF;
}

/* ---------- invitation card ---------- */
.card {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  /* fat tomato keyline, printed slightly inside the trim */
  --keyline: inset 0 0 0 10px var(--c-paper),
              inset 0 0 0 13px var(--c-primary);
  box-shadow: var(--keyline), var(--shadow-paper);
  text-align: left;
}
.card :where(h1, h2, .card__names) {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--c-primary);
  line-height: .95;
  text-shadow: var(--misregister);
}
.card :where(.card__kicker, small) {
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- yellow card ---------- */
.card--alt {
  background-color: var(--c-paper-2);
  color: var(--c-on-paper-2);
  --keyline: inset 0 0 0 10px var(--c-paper-2),
              inset 0 0 0 12px var(--c-ink);
  box-shadow: var(--keyline), var(--shadow-paper);
}
.card--alt :where(h1, h2, .card__names, .card__date) { color: var(--c-ink); text-shadow: 2px 1.5px 0 rgba(143, 217, 176, .9); }
.card--alt :where(.card__kicker, small, p) { color: var(--c-on-paper-2-soft); }

/* ---------- "seal": a sticker, not wax ---------- */
.seal {
  background: url(../assets/glow/seal.svg) center / contain no-repeat;
  border-radius: 50%;
  color: var(--c-on-accent);
  font-family: var(--font-script);
  min-width: 44px;
  min-height: 44px;
  filter: drop-shadow(0 1px 0 rgba(var(--shadow-rgb), .3));
}

/* ---------- polaroids ---------- */
.polaroid {
  background-color: var(--c-photo-paper);
  color: var(--c-ink);
  padding: 6% 6% 20%;
  border-radius: 2px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.2;
  text-align: center;
}
.polaroid img, .polaroid .polaroid__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: #CFE7D6;
}
/* zig-zag cut tape in blue */
.polaroid::before {
  content: '';
  position: absolute;
  top: -11px; left: 50%;
  width: 40%; height: 22px;
  margin-left: -20%;
  rotate: 3deg;
  background-color: rgba(46, 107, 73, .6);
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ---------- round "details" tag ---------- */
.tag-button {
  background-color: var(--c-accent);
  color: var(--c-on-accent);
  border: 0;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-sans);
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.tag-button :where(em, .tag-button__script) {
  display: block;
  font-family: var(--font-script);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 2.2em;
  line-height: 1;
}
.tag-button::before {
  content: '';
  position: absolute;
  top: 9%; left: 50%;
  width: 11%; aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--c-page);
  box-shadow: 0 0 0 3px var(--c-paper-2);
}
/* scalloped sticker rim */
.tag-button::after {
  content: '';
  position: absolute;
  inset: 6%;
  border: 2px dotted rgba(251, 247, 234, .6);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- countdown band ---------- */
.countdown {
  background-color: var(--c-primary);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
  color: var(--c-on-primary);
  font-family: var(--font-serif);
}
.countdown :where(.countdown__title) {
  font-family: var(--font-script);
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  line-height: 1;
  text-shadow: 2px 1.5px 0 rgba(23, 48, 31, .35);
}
.countdown :where(.countdown__unit) {
  background-color: var(--c-paper-2);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
}
.countdown :where(.countdown__unit:nth-child(even)) { background-color: var(--c-paper); }
.countdown :where(.countdown__num) {
  font-family: var(--font-serif);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.countdown :where(.countdown__label) {
  font-family: var(--font-sans);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- inner pages ---------- */
.page {
  background-color: var(--c-paper);
  color: var(--c-ink);
  box-shadow: var(--shadow-lift);
}
.page__title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  line-height: .95;
  color: var(--c-primary);
  text-shadow: var(--misregister);
}
.page :where(h2, h3) {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.page :where(a:not(.btn)) {
  color: var(--c-text-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .18em;
}

/* ---------- form fields ---------- */
.field label, .field legend {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.field :where(input, select, textarea) {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--c-ink);
  background-color: var(--c-page);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius-paper);
  min-height: 48px;
  padding: .55rem .75rem;
}
.field :where(input, select, textarea)::placeholder { color: var(--c-ink-soft); opacity: 1; }
.field :where(input, select, textarea):focus { border-color: var(--c-accent); background-color: var(--c-paper); }
.field :where(input[type=radio], input[type=checkbox]) { accent-color: var(--c-primary); width: 22px; height: 22px; min-height: 0; }
.field [aria-invalid=true] { border-color: #A3271A; }
.field .field__error { color: #A3271A; font-size: .9375rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  min-width: 44px;
  padding: .75rem 1.5rem;
  background-color: var(--c-primary);
  color: var(--c-on-primary);
  border: 0;
  border-radius: var(--radius-paper);
  font-family: var(--font-sans);
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--c-ink);        /* offset print, like a second riso pass */
  cursor: pointer;
  transition: translate 120ms ease, box-shadow 120ms ease, background-color 160ms ease;
}
.btn:hover { background-color: #245A3C; }
.btn:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--c-ink); }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn--ghost {
  background: var(--c-paper);
  color: var(--c-ink);
  box-shadow: inset 0 0 0 2px var(--c-ink), 3px 3px 0 var(--c-accent);
}

@media (prefers-reduced-motion: reduce) {
  .card, .card--alt, .polaroid, .tag-button, .seal, .envelope, .btn { transition: none; }
  .card:hover, .polaroid:hover, .tag-button:hover, .envelope:hover, .seal:hover { translate: none; }
}

/* ==========================================================================
   PHASE 2 — launch fixes (design/design-system.md §5, BRIEF-v2 fix list)
   ========================================================================== */

/* page-title ornament: rendered by the engine as <img class="page__sprig"> (header-sprig.svg) */
.page__title::after { content: none; }
.page__sprig { display: block; width: 120px; max-width: 40%; height: auto; margin: .35em 0 0; }

/* polaroid captions: serif italic, never below 16px */
.polaroid__caption,
.gallery__item .polaroid__caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: max(16px, 10cqi);
  letter-spacing: .01em;
  line-height: 1.2;
  color: var(--c-ink);
}
.gallery__item .polaroid__caption { font-size: 1.0625rem; }

/* real photos: a touch of warmth, printed grain and a fine edge, so phone snaps sit on the paper */
.photo-frame img, .polaroid img, .gallery__photo img {
  filter: sepia(.04) saturate(.92) contrast(.96) brightness(1.02);
}
.photo-frame::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-color: rgba(143, 217, 176, .14);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 160px;
  background-blend-mode: multiply;
  mix-blend-mode: multiply;
  opacity: .5;
  box-shadow: inset 0 0 0 1px rgba(var(--shadow-rgb), .14), inset 0 0 18px rgba(var(--shadow-rgb), .10);
}

/* attendance tickets */
.choices--tickets .choice {
  font-family: var(--font-sans);
  font-size: .8125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.35;
  hyphens: manual;
  overflow-wrap: normal;
  word-break: normal;
  font-family: var(--font-sans);
  font-weight: 500;
  border: 2px solid var(--c-ink);
  border-radius: var(--radius-paper);
  background-color: var(--c-paper);
  box-shadow: 3px 3px 0 var(--c-accent);
  transition: translate 120ms ease, box-shadow 120ms ease, background-color 160ms ease;
}
.choices--tickets .choice:hover { translate: -1px -1px; box-shadow: 4px 4px 0 var(--c-accent); }
.choices--tickets .choice:has(input:checked) {
  background-color: var(--c-paper-2);
  color: var(--c-ink);
  box-shadow: 3px 3px 0 var(--c-primary);
  transform: rotate(-2deg);
}
/* the second ticket tilts the other way when picked */
.choices--tickets .choice:nth-child(2):has(input:checked) { transform: rotate(2deg); }

/* RSVP success: the reply card comes back stamped */
.rsvp-thanks {
  rotate: -1.2deg;
  margin: .5rem auto 0;
  max-width: 30rem;
  padding: 2.75rem 1.75rem 2.25rem;
  background-color: var(--c-paper-2);
  color: var(--c-ink);
  --keyline: inset 0 0 0 10px var(--c-paper-2), inset 0 0 0 12px var(--c-ink);
}
.rsvp-thanks:hover { translate: none; box-shadow: var(--keyline), var(--shadow-paper); }
.page .rsvp-thanks__title {
  font-family: var(--font-script);
  font-size: clamp(2.5rem, 11vw, 3.25rem);
  line-height: 1;
  color: var(--c-primary);
  margin: .1em 0 0;
  text-shadow: var(--misregister);
}
.rsvp-thanks p {
  max-width: 24ch;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.5;
}
.rsvp-thanks p::before {
  content: '';
  display: block;
  width: 56px; height: 0;
  margin: 0 auto .9rem;
  border-top: 1px dashed var(--c-ink);
}
.rsvp-thanks .demo-note { font-style: normal; font-size: .8125rem; color: var(--c-ink-soft); }
.rsvp-thanks .demo-note::before { display: none; }
.rsvp-thanks p { font-family: var(--font-serif); color: var(--c-ink); }
.rsvp-thanks .demo-note { color: var(--c-on-paper-2-soft); }
.polaroid__caption, .gallery__item .polaroid__caption { font-family: var(--font-serif); }

/* ==========================================================================
   Lights-out hunt (app.js renderGlowHunt) — glow theme only
   ========================================================================== */
.stage { position: relative; }
.glow-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.glow-friend {
  position: absolute; left: var(--gx); top: var(--gy); width: var(--gw); aspect-ratio: 1;
  padding: 0; border: 0; background: none; cursor: default;
  opacity: .14;                                            /* lights on: a faint paper shape */
  transition: opacity .6s ease, filter .6s ease, transform .25s var(--ease-bounce);
}
.glow-friend__art { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
@media (min-width: 1024px) {
  .glow-layer { left: 2rem; right: 2rem; }
  .glow-friend { left: var(--gdx); top: var(--gdy); width: var(--gdw); }
}

/* the room */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 25; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, rgba(10, 32, 20, .86), rgba(4, 16, 9, .95));
  opacity: 0; transition: opacity .7s ease;
}
body.lights-out::after { opacity: 1; }
body.lights-out .glow-layer { pointer-events: auto; }
body.lights-out .glow-friend {
  opacity: 1; cursor: pointer;
  filter: brightness(1.25) saturate(1.2)
          drop-shadow(0 0 6px rgba(184, 247, 208, .95))
          drop-shadow(0 0 18px rgba(143, 217, 176, .75));
  animation: glow-breathe 2.8s ease-in-out var(--gd) infinite;
}
body.lights-out .glow-friend:hover { transform: scale(1.08); }
body.lights-out .glow-friend.is-found {
  animation: none; transform: scale(1.12);
  filter: brightness(1.45) drop-shadow(0 0 10px #fff) drop-shadow(0 0 26px rgba(184, 247, 208, 1));
}
body.lights-out .glow-friend:focus-visible { outline: 3px solid #B8F7D0; outline-offset: 4px; border-radius: 50%; }
@keyframes glow-breathe {
  0%, 100% { filter: brightness(1.1) drop-shadow(0 0 5px rgba(184, 247, 208, .8)) drop-shadow(0 0 14px rgba(143, 217, 176, .55)); }
  50%      { filter: brightness(1.35) drop-shadow(0 0 8px rgba(184, 247, 208, 1)) drop-shadow(0 0 24px rgba(143, 217, 176, .85)); }
}
/* the switch and the counter sit above the dark */
.glow-controls {
  position: relative; z-index: 31; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  margin: 1.1rem auto 0; padding: 0 1.25rem; max-width: 34rem; text-align: center;
}
.glow-switch {
  display: inline-flex; align-items: center; gap: .7rem; padding: .55rem 1.1rem .55rem .6rem;
  border: 0; border-radius: 999px; background: var(--c-envelope); color: #FBF7EA;
  font: 600 1rem/1.2 var(--font-script); letter-spacing: .01em; cursor: pointer;
  box-shadow: var(--shadow-paper);
}
.glow-switch__plate {
  position: relative; width: 26px; height: 38px; border-radius: 6px; background: #FBF7EA;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.glow-switch__toggle {
  position: absolute; left: 8px; top: 6px; width: 10px; height: 14px; border-radius: 3px; background: #2E6B49;
  transition: top .2s var(--ease-bounce);
}
.glow-switch[aria-pressed="true"] { background: #8FD9B0; color: #17301F; box-shadow: 0 0 18px rgba(143, 217, 176, .7); }
.glow-switch[aria-pressed="true"] .glow-switch__toggle { top: 18px; }
.glow-switch:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.glow-status { margin: 0; font-size: .95rem; color: var(--c-ink-soft); transition: color .5s ease; }
body.lights-out .glow-status { color: #CFF3DD; }
body.glow-complete .glow-status { font-family: var(--font-script); font-size: 1.25rem; color: #B8F7D0; text-shadow: 0 0 12px rgba(143, 217, 176, .8); }
body.lights-out .glow-switch[aria-pressed="true"]:focus-visible { outline-color: #B8F7D0; }
/* finding everyone lights the cake: florals-1's flames bloom */
body.glow-complete .decor img[src$="florals-1.svg"] { filter: drop-shadow(0 0 14px rgba(240, 201, 106, .9)); }
body.lights-out .decor img[src$="florals-1.svg"] { position: relative; }
body.glow-complete .collage .decor:has(img[src$="florals-1.svg"]) { z-index: 30; }
.scatter-fall { z-index: 40; }

@media (prefers-reduced-motion: reduce) {
  body::after, .glow-friend, .glow-switch__toggle { transition: none; }
  body.lights-out .glow-friend { animation: none; }
}

/* ---------- finale: tap each candle (app.js renderGlowCake) ---------- */
.glow-cake { width: min(100%, 22rem); margin: .4rem auto 0; animation: glow-cake-in .6s var(--ease-bounce) both; }
.glow-cake__title { margin: 0 0 .3rem; font: 600 1.15rem/1.3 var(--font-script); color: var(--c-ink); }
body.lights-out .glow-cake__title { color: #CFF3DD; }
.glow-cake.is-blown .glow-cake__title { font-size: 1.6rem; color: #B8F7D0; text-shadow: 0 0 14px rgba(143, 217, 176, .9); }
.glow-cake__stage { position: relative; aspect-ratio: 4 / 3; margin-top: 30%; } /* room for the candles that stand above the art */
.glow-cake__art { position: absolute; inset: 0; width: 100%; height: 100%; }
body.lights-out .glow-cake__art { filter: brightness(1.15) drop-shadow(0 0 16px rgba(240, 201, 106, .55)); }
.glow-cake.is-blown .glow-cake__art { filter: none; transition: filter .8s ease; }
/* each candle sits on the top tier (y ≈ 18.5% of the cake canvas) */
.glow-candle {
  position: absolute; left: var(--cx); bottom: 81.5%; width: 12%; height: 42%;
  translate: -50% 0; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.glow-candle__stick {
  position: absolute; left: 50%; bottom: 0; width: 34%; height: 46%; translate: -50% 0; border-radius: 3px;
  background: repeating-linear-gradient(-35deg, #FBF7EA 0 5px, #8FD9B0 5px 9px);
  box-shadow: inset 0 0 0 1px rgba(23, 48, 31, .55);
}
.glow-candle__flame {
  position: absolute; left: 50%; bottom: 46%; width: 46%; height: 34%; translate: -50% 0;
  border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #FFF8D8 0 22%, #F7D77A 42%, #F0A94A 78%);
  box-shadow: 0 0 10px 3px rgba(240, 201, 106, .75), 0 0 26px 8px rgba(240, 201, 106, .35);
  transform-origin: 50% 90%; animation: glow-flicker 1.1s ease-in-out var(--cd) infinite alternate;
  transition: opacity .25s ease, scale .25s ease;
}
.glow-candle.is-out .glow-candle__flame { opacity: 0; scale: .2; animation: none; }
.glow-candle__smoke {
  position: absolute; left: 50%; bottom: 50%; width: 30%; height: 30%; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 232, 224, .85), rgba(220, 232, 224, 0) 70%); opacity: 0;
}
.glow-candle.is-out .glow-candle__smoke { animation: glow-smoke 1.4s ease-out forwards; }
.glow-candle:focus-visible { outline: 3px solid #B8F7D0; outline-offset: 2px; border-radius: 8px; }
.glow-candle.is-out { cursor: default; }
.glow-layer.is-cheering .glow-friend { animation: glow-hop .5s var(--ease-bounce) var(--gd) 3 both; }
@keyframes glow-flicker { 0% { rotate: -3deg; scale: 1 1; } 50% { scale: .94 1.06; } 100% { rotate: 3deg; scale: 1.04 .96; } }
@keyframes glow-smoke { 0% { opacity: .9; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-160%) scale(1.8) rotate(25deg); } }
@keyframes glow-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18%) rotate(-4deg); } }
@keyframes glow-cake-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@media (prefers-reduced-motion: reduce) {
  .glow-cake, .glow-candle__flame, .glow-layer.is-cheering .glow-friend { animation: none; }
  .glow-candle.is-out .glow-candle__smoke { animation: none; }
}

/* ---------- Smiski on the main card and pages (owner-supplied PNGs) ---------- */
.decor img[src$=".png"] { filter: drop-shadow(0 3px 4px rgba(14, 38, 24, .22)); }
.page__sprig--character { width: 170px; height: auto; margin: .4rem auto 0; display: block; }
@media (min-width: 1024px) { .page__sprig--character { width: 210px; } }
.page__crew {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(.5rem, 4vw, 2rem);
  margin: 2rem auto 1rem; padding: 0 1rem; max-width: 40rem;
}
.page__crew-item { width: clamp(84px, 26vw, 150px); }
.page__crew-item img { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 4px rgba(14, 38, 24, .2)); }
.page__crew-item:nth-child(2) { translate: 0 -10px; }
@media (prefers-reduced-motion: no-preference) {
  .page__crew-item { animation: crew-bob 3.2s ease-in-out calc(var(--i) * .4s) infinite; }
}
@keyframes crew-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-5px) rotate(1.5deg); } }

/* ---------- the finale cake belongs to the dark only ---------- */
body:not(.lights-out) .glow-cake { display: none; }
/* lights on: hidden friends are just faint shapes (no filter, cheaper to composite during the opening) */
.glow-friend { filter: none; }
