/* =========================================================================
   The Sealed Envelope — gender reveal microsite
   Aesthetic: hand-painted invitation. Cream paper, baby blue + pink ribbons,
   brush script + bold uppercase, scribble-on-entry animations.
   ========================================================================= */

/* Local fonts — Jonathan Signature (script) + Portland (body, in 4 weights) */
@font-face {
  font-family: 'Jonathan Signature';
  src: url('../fonts/JonathanSignature-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Portland';
  src: url('../fonts/Portland-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Portland';
  src: url('../fonts/Portland-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Portland';
  src: url('../fonts/Portland-Bold.otf') format('opentype');
  font-weight: 600 700;   /* covers semibold/600 → bold/700 */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Portland';
  src: url('../fonts/Portland-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Palette (matches the invite reference) ── */
  --cream:        #f5ebd8;
  --cream-light:  #faf3e3;
  --cream-deep:   #ead9b9;
  --paper:        #fdf7e8;

  --blue:         #8fb8e3;   /* baby blue — bows, script */
  --blue-deep:    #6a9bd1;
  --blue-pale:    #d6e6f4;

  --pink:         #f4b8c5;   /* baby pink — bows, script */
  --pink-deep:    #e89cae;
  --pink-pale:    #fbe1e7;

  --ink:          #2b2820;   /* warm near-black */
  --ink-soft:     #5b5345;
  --ink-faint:    #9b8f78;

  /* Reveal accents (saturated for the big moment) */
  --pink-500: #ec6f8b;
  --blue-500: #4a8ed6;

  /* ── Typography ── */
  --font-script:  'Jonathan Signature', 'Snell Roundhand', cursive;       /* big looped script */
  --font-body:    'Portland', -apple-system, BlinkMacSystemFont, sans-serif; /* body + labels */
  --font-hand:    'Jonathan Signature', 'Snell Roundhand', cursive;       /* handwritten accents */

  /* ── Motion ── */
  --ease-out-soft:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-xs: 120ms;
  --dur-sm: 240ms;
  --dur-md: 420ms;
  --dur-lg: 720ms;
  --dur-xl: 1400ms;
  --dur-scribble: 2200ms;

  /* ── Shape ── */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* ── Elevation ── */
  --shadow-soft:   0 1px 2px rgba(43, 40, 32, 0.05), 0 8px 24px rgba(43, 40, 32, 0.06);
  --shadow-lifted: 0 2px 4px rgba(43, 40, 32, 0.08), 0 24px 48px rgba(43, 40, 32, 0.1);
  --shadow-press:  0 1px 2px rgba(43, 40, 32, 0.2) inset;

  /* ── Layout ── */
  --content: 720px;
  --wide: 1000px;
  --gap: clamp(1rem, 2vw, 1.5rem);
  --section-y: clamp(3rem, 8vh, 5rem);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  /* faint paper-grain feel using two soft watercolor washes */
  background-image:
    radial-gradient(1100px 700px at 85% -10%, rgba(143, 184, 227, 0.12), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(244, 184, 197, 0.16), transparent 60%);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Typography system ── */
h1, h2, h3, h4 {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--blue-deep);
  line-height: 0.95;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(4rem, 14vw, 8rem); }
h2 { font-size: clamp(3rem, 9vw, 5rem); }
h3 { font-size: clamp(2rem, 5vw, 3rem); }
h4 { font-size: clamp(1.4rem, 3vw, 2rem); }

/* The signature "Boy / Girl" two-tone display */
.script-blue { color: var(--blue); }
.script-pink { color: var(--pink); }
.script-tilt { display: inline-block; transform: rotate(-2deg); }

/* Body, labels */
p {
  margin: 0 0 1em; color: var(--ink-soft);
  text-wrap: pretty;           /* avoid orphans on last line */
}
h1, h2, h3, h4 { text-wrap: balance; }
a { color: var(--blue-deep); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
a:hover { color: var(--pink-deep); }

/* Small "handwritten-feel" copy. Portland italic at readable sizes — Jonathan
 * Signature is too flourishy to read below ~3rem so we reserve it for the
 * big display headings via var(--font-script). */
.hand {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  color: var(--blue-deep);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
.tiny { font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--blue-deep); font-weight: 700;
  font-family: var(--font-body);
}
.label-caps {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-deep);
}

/* ── Layout primitives ── */
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--gap); position: relative; z-index: 1; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.5rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85em 1.7em;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: white; background: var(--blue-deep);
  border: 2px solid var(--blue-deep);
  border-radius: var(--radius-pill);
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur-sm) var(--ease-out-soft),
              box-shadow var(--dur-sm) var(--ease-out-soft),
              background var(--dur-sm) var(--ease-out-soft),
              border-color var(--dur-sm) var(--ease-out-soft);
  will-change: transform;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lifted); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-press); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--ghost {
  color: var(--blue-deep); background: transparent;
}
.btn--ghost:hover { background: var(--blue-pale); }

.btn--pink {
  background: var(--pink-deep); border-color: var(--pink-deep);
}
.btn--pink:hover { background: var(--pink); border-color: var(--pink); }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field label {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-deep); font-weight: 700;
}
.input, .textarea, .select {
  width: 100%;
  padding: 0.85em 1.1em;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--cream-deep);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-sm) var(--ease-out-soft),
              box-shadow var(--dur-sm) var(--ease-out-soft);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(143, 184, 227, 0.2);
}
.textarea { min-height: 120px; resize: vertical; }

/* ── Card ── */
.card {
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-soft);
}

.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.3em 0.95em;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--cream-deep); color: var(--ink-soft);
  border-radius: var(--radius-pill);
}

/* ── Scribble divider ── */
.scribble-rule {
  display: block; margin: 2rem auto;
  width: 220px; height: 24px;
  color: var(--blue);
}
.scribble-rule path {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Hero image (Boy or Girl script) ── */
.hero-title {
  display: block; margin: 1rem auto 0;
  max-width: min(480px, 88vw); width: 100%; height: auto;
  /* Blend into the cream background — the PNG ships on a dark canvas */
  mix-blend-mode: multiply;
}

/* ── Corner ribbon decorations ── */
.corner-ribbon {
  position: fixed; pointer-events: none; z-index: 0;
  width: clamp(120px, 18vw, 220px); height: auto;
  opacity: 0.95;
  mix-blend-mode: multiply;
  animation: ribbonIn 1.4s var(--ease-out-soft) both;
}
.corner-ribbon--tr { top: 0.5rem; right: 0.5rem; }
.corner-ribbon--bl { bottom: 0.5rem; left: 0.5rem; transform: scaleX(-1); }
.corner-ribbon--tl { top: 0.5rem; left: 0.5rem; transform: scaleX(-1); }
.corner-ribbon--br { bottom: 0.5rem; right: 0.5rem; }
@keyframes ribbonIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 0.95; transform: translateY(0) scale(1); }
}
.corner-ribbon--bl { animation-name: ribbonInFlipped; }
.corner-ribbon--tl { animation-name: ribbonInFlipped; }
@keyframes ribbonInFlipped {
  from { opacity: 0; transform: translateY(-8px) scaleX(-1) scale(0.96); }
  to   { opacity: 0.95; transform: translateY(0) scaleX(-1) scale(1); }
}

/* ── Hand-drawn ribbon decorations ── */
.ribbon {
  display: block; color: var(--blue);
  pointer-events: none;
}
.ribbon path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ribbon--pink { color: var(--pink); }
.ribbon--blue { color: var(--blue); }
.ribbon--bow-tl { position: absolute; top: 1rem; left: 1.5rem; width: 110px; opacity: 0.9; transform: rotate(-12deg); }
.ribbon--bow-tr { position: absolute; top: 2rem; right: 1.5rem; width: 130px; opacity: 0.9; transform: rotate(8deg); }
.ribbon--bow-br { position: absolute; bottom: 2rem; right: 1.5rem; width: 140px; opacity: 0.9; transform: rotate(-6deg); }
.ribbon--bow-bl { position: absolute; bottom: 3rem; left: 1.5rem; width: 100px; opacity: 0.85; transform: rotate(15deg); }

/* The "scribbled in" entrance: stroke-draws the path on mount */
.scribble-in path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: scribble var(--dur-scribble) var(--ease-out-soft) forwards;
}
.scribble-in.delay-200 path { animation-delay: 200ms; }
.scribble-in.delay-400 path { animation-delay: 400ms; }
.scribble-in.delay-600 path { animation-delay: 600ms; }
.scribble-in.delay-800 path { animation-delay: 800ms; }
@keyframes scribble {
  to { stroke-dashoffset: 0; }
}

/* Underlines for the script display, drawn like a ribbon */
.script-underline {
  display: block; margin: 0 auto -1rem; width: 70%; height: 14px;
  color: var(--pink);
}
.script-underline path {
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: scribble 1.6s var(--ease-out-soft) 600ms forwards;
}

/* ── Countdown ── */
.countdown {
  display: grid; grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 0.75rem; max-width: 480px; margin: 1.5rem auto;
}
.countdown .cell {
  text-align: center; padding: 1rem 0.5rem;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
}
.countdown .num {
  font-family: var(--font-body); font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700; color: var(--blue-deep); font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown .lbl {
  display: block; margin-top: 0.4rem;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}

/* ── Confetti canvas ── */
.confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
}

/* ── Entrance animations ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise       { animation: rise var(--dur-lg) var(--ease-out-soft) both; }
.rise-200   { animation: rise var(--dur-lg) var(--ease-out-soft) 200ms both; }
.rise-400   { animation: rise var(--dur-lg) var(--ease-out-soft) 400ms both; }
.rise-600   { animation: rise var(--dur-lg) var(--ease-out-soft) 600ms both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scribble-in path { stroke-dashoffset: 0; }
  .ambient { display: none; }
}

/* ── Games nav grid — always 2×2 on desktop/tablet, stacks to 1col on phone ── */
.games-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  max-width: 720px;
  margin: 2rem auto 0;
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr; }
}
.game-card {
  display: block; padding: 1.5rem;
  background: var(--paper);
  border: 2px solid var(--cream-deep);
  border-radius: var(--radius-md);
  text-decoration: none; color: var(--ink);
  transition: transform var(--dur-sm) var(--ease-out-soft),
              border-color var(--dur-sm) var(--ease-out-soft),
              box-shadow var(--dur-sm) var(--ease-out-soft);
}
.game-card:hover {
  transform: translateY(-3px) rotate(-0.5deg);
  border-color: var(--blue);
  box-shadow: var(--shadow-lifted);
}
.game-card .icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.game-card h3 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-deep);
  line-height: 1.15;
}
.game-card:nth-child(2n) h3 { color: var(--pink-deep); }
.game-card p { margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }

/* ── Envelope (kept simple — bingo is the centerpiece) ── */
.envelope-stage {
  position: relative; width: 100%; max-width: 440px;
  aspect-ratio: 3 / 2; margin: 2rem auto;
  perspective: 1200px;
}
.envelope {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 1.2s var(--ease-out-soft);
}
.envelope .body {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream-light) 100%);
  border: 2px solid var(--cream-deep);
  border-radius: 8px;
  box-shadow: var(--shadow-lifted);
}
.envelope .flap {
  position: absolute; top: 0; left: 0; width: 100%; height: 60%;
  background: linear-gradient(180deg, var(--cream-light) 0%, var(--cream-deep) 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  /* JS sequences the animation — no built-in CSS delay */
  transition: transform 0.9s var(--ease-out-soft);
  z-index: 2;
}
.envelope .seal {
  position: absolute; top: 42%; left: 50%;
  width: 56px; height: 56px;
  background: radial-gradient(circle at 35% 35%, var(--pink), var(--pink-deep));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 -2px 4px rgba(0,0,0,0.15);
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); font-family: var(--font-script); font-size: 2rem;
  transition: transform var(--dur-md) var(--ease-out-soft), opacity var(--dur-md);
}
.envelope .card-inside {
  position: absolute; top: 50%; left: 50%;
  width: 88%; height: 80%;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  /* JS sequences timing — no built-in delay */
  transition: transform 0.9s var(--ease-out-soft),
              opacity 0.6s var(--ease-out-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-script); font-size: clamp(2.5rem, 8vw, 4.5rem);
  text-align: center; padding: 0.75rem;
  color: var(--blue-deep);
  z-index: 1;
}
.envelope.is-shaking { animation: shake 0.6s var(--ease-in-out-soft) 3; }
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25%      { transform: translateX(-4px) rotate(-1deg); }
  75%      { transform: translateX(4px) rotate(1deg); }
}
.envelope.is-cracking .seal { transform: translate(-50%, -50%) scale(1.2) rotate(15deg); opacity: 0; }
.envelope.is-opening .flap { transform: rotateX(-180deg); }
.envelope.is-revealing .card-inside {
  transform: translate(-50%, -130%) scale(1.5);
  opacity: 1;
  z-index: 5;
}
.card-inside .reveal-line { display: block; line-height: 1; margin: 0; }
.card-inside .reveal-line--small {
  font-family: var(--font-body); font-size: 0.22em;
  font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 0.7em;
}
.card-inside .reveal-line--shout { color: inherit; }

/* Reveal-state body washes (gentle, not garish) */
body.is-reveal-pink {
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(244, 184, 197, 0.5), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(244, 184, 197, 0.4), transparent 60%),
    var(--cream);
}
body.is-reveal-blue {
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(143, 184, 227, 0.5), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(143, 184, 227, 0.4), transparent 60%),
    var(--cream);
}

/* Status messages */
.status { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.92rem; border-width: 1px; border-style: solid; }
.status--ok { background: #ebf5e8; color: #486e3d; border-color: #c8e6c9; }
.status--err { background: var(--pink-pale); color: #8d3a4a; border-color: var(--pink); }
.status--info { background: var(--blue-pale); color: #2d5a8a; border-color: var(--blue); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Sticker face ────────────────────────────────────── */
.sticker {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: var(--cream-deep);
  font-family: var(--font-body); font-weight: 700;
  color: var(--ink-soft);
  flex-shrink: 0;
  vertical-align: middle;
}
.sticker img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sticker--ring {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--pink), var(--shadow-soft);
}
.sticker--ring-blue {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--blue), var(--shadow-soft);
}
.sticker--ring-neutral {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--cream-deep), var(--shadow-soft);
}
.sticker--placeholder {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white; font-size: 1.2em;
}

.sticker-chip {
  position: fixed; top: 1rem; right: 1rem; z-index: 30;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0;
  background: transparent; border: none; box-shadow: none;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 700;
  color: var(--blue-deep);
  letter-spacing: 0.12em; text-transform: uppercase;
  line-height: 1;
}
.sticker-chip--locked { cursor: default; pointer-events: none; }
.sticker-chip__name {
  padding-right: 0.25rem;
  max-width: 8rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* Sticker capture modal */
.sticker-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(43, 40, 32, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease-out-soft);
}
.sticker-modal.is-on { opacity: 1; }
.sticker-modal__panel {
  width: 100%; max-width: 480px;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lifted);
  transform: translateY(8px);
  transition: transform var(--dur-md) var(--ease-out-soft);
  max-height: 92vh; overflow-y: auto;
}
.sticker-modal.is-on .sticker-modal__panel { transform: translateY(0); }
.sticker-modal__panel h2 {
  font-family: var(--font-script); color: var(--pink-deep);
  font-size: 4rem; line-height: 0.9;
}
.stk-stage { display: flex; justify-content: center; margin: 1.25rem 0; }
.stk-frame {
  position: relative; width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--cream-light);
  border: 2px dashed var(--blue);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.stk-frame .stk-empty {
  font-family: var(--font-body); font-style: italic;
  color: var(--ink-faint); font-size: 0.95rem;
}
.stk-frame video, .stk-frame img, .stk-frame canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.stk-frame video { transform: scaleX(-1); }
.stk-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.stk-actions .btn { padding: 0.7em 1.2em; font-size: 0.78rem; }
.stk-upload { cursor: pointer; }
.stk-footer { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── Bingo (adaptive reveal game) ──────────────────────── */
.bingo {
  max-width: 520px; margin: 1.5rem auto 0;
  padding: 0.5rem;
}
.bingo h2.bingo-title {
  color: var(--blue-deep);
  font-size: clamp(3rem, 8vw, 4.2rem);
  text-align: center; margin-bottom: 0.3rem;
}
.bingo-hint { color: var(--ink-soft); max-width: 420px; margin: 0 auto 1rem; }

.bingo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem;
  perspective: 1200px;
  margin: 0.5rem auto 1rem;
  max-width: 440px;
}

.bingo-cell {
  position: relative; aspect-ratio: 1 / 1;
  background: transparent; border: none; padding: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 90px;
}
.bingo-cell:disabled { cursor: default; }
.bingo-cell.is-flipped { transform: rotateY(180deg); }

.bingo-cell__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-script);
}
.bingo-cell__face--front {
  background: var(--paper);
  border: 2px solid var(--cream-deep);
  font-size: 3rem; color: var(--cream-deep);
  transition: transform var(--dur-sm) var(--ease-out-soft),
              border-color var(--dur-sm) var(--ease-out-soft),
              box-shadow var(--dur-sm) var(--ease-out-soft);
  animation: qPulse 2.8s ease-in-out infinite;
}
@keyframes qPulse {
  0%, 100% { color: var(--cream-deep); }
  50%      { color: var(--gold-soft, #d9c28e); }
}
.bingo-cell:not(:disabled):hover .bingo-cell__face--front {
  transform: scale(1.03) rotate(-1.5deg);
  border-color: var(--blue);
}
.bingo-cell__face--back {
  transform: rotateY(180deg);
}
.bingo-cell[data-value="boy"]  .bingo-cell__face--back {
  background: var(--blue); border: 2px solid var(--blue-deep); color: white;
}
.bingo-cell[data-value="girl"] .bingo-cell__face--back {
  background: var(--pink-deep); border: 2px solid var(--pink-deep); color: white;
}
/* BLANK = the punchline. No gender, no colour, just a whisper of nothing. */
.bingo-cell[data-value="blank"] .bingo-cell__face--back {
  background: var(--cream-light);
  border: 2px dashed var(--cream-deep);
  color: var(--ink-faint);
}

.bingo-cell__blank {
  font-family: var(--font-script); font-size: 4rem; line-height: 0.7;
  color: var(--ink-faint); opacity: 0.6;
}
.bingo-cell__icon {
  font-size: 3rem; line-height: 1; margin-bottom: 0.1rem;
  font-family: 'Portland', var(--font-body);
  font-weight: 900;
}
.bingo-cell__lbl {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
}

/* Padlock shown on the tile reserved for the final reveal */
.bingo-cell__lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease-out-soft);
  pointer-events: none;
  backface-visibility: hidden;
}
.bingo-cell.is-locked .bingo-cell__lock { opacity: 0.9; }
.bingo-cell.is-locked .bingo-cell__face--front { animation: none; color: var(--ink-faint); }
.bingo-cell.is-locked:hover .bingo-cell__face--front { transform: none; border-color: var(--cream-deep); }

/* "Reveal-ready": last remaining tile, pulses with alternating ring colours */
.bingo-cell.is-reveal-ready .bingo-cell__lock { opacity: 0; }
.bingo-cell.is-reveal-ready .bingo-cell__face--front {
  animation: readyGlow 1.5s ease-in-out infinite;
  color: var(--pink-deep);
  font-size: 3.4rem;
}
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 0 0 3px var(--pink), 0 0 18px rgba(236, 111, 139, 0.5), var(--shadow-soft); transform: scale(1); }
  50%      { box-shadow: 0 0 0 3px var(--blue), 0 0 26px rgba(74, 142, 214, 0.5), var(--shadow-lifted); transform: scale(1.04); }
}

/* ── Threat bar (below the grid) ── */
.bingo-threats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 440px; margin: 1rem auto 0;
  align-items: center;
}
.threat {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.threat--girl { direction: rtl; }
.threat--girl > * { direction: ltr; }
.threat__lbl { color: var(--ink-soft); }
.threat__val {
  font-family: var(--font-script); font-size: 2rem;
  color: var(--blue-deep); font-weight: 400; line-height: 1;
  transition: color var(--dur-md);
}
.threat--girl .threat__val { color: var(--pink-deep); }
.threat__bar {
  display: block; height: 6px; border-radius: 3px;
  background: var(--cream-deep); overflow: hidden;
  position: relative;
}
.threat__fill {
  display: block; height: 100%;
  background: var(--blue); width: 0%;
  transition: width 0.6s var(--ease-out-soft);
}
.threat--girl .threat__fill { background: var(--pink-deep); }
.threat.is-dim .threat__val,
.threat.is-dim .threat__lbl { color: var(--ink-faint); opacity: 0.6; }
.threat.is-dim .threat__fill { background: var(--cream-deep); }

/* ── Hero envelope wrapper ── */
.hero-envelope {
  display: flex; flex-direction: column; align-items: center;
  margin: 2rem auto 1rem;
}
.hero-envelope .envelope-stage { margin: 0; max-width: 480px; }
.unlock-form {
  width: 100%; max-width: 460px;
  margin: 1.5rem auto 0;
  display: grid; gap: 0.5rem;
}
.unlock-form .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.unlock-form .row .input { flex: 1; min-width: 160px; }

/* Tug-of-war stickers */
.tug-faces {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; padding: 0 1.25rem; max-width: 45%;
  flex-wrap: wrap; gap: 4px;
}
.tug-faces--pink { left: 0; }
.tug-faces--blue { right: 0; flex-direction: row-reverse; }
.tug-faces .sticker {
  margin-left: -8px; transition: transform var(--dur-md) var(--ease-out-soft);
}
.tug-faces .sticker:hover { transform: scale(1.05); z-index: 1; }
.tug-faces .sticker.is-new { animation: pop-in 0.6s var(--ease-out-soft) both; }
@keyframes pop-in {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Submission feed */
.feed { display: flex; flex-direction: column; gap: 0.5rem; max-width: 600px; margin: 1.5rem auto; }
.feed-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.7rem 1rem;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
  animation: rise 0.5s var(--ease-out-soft) both;
}
.feed-row__name {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.98rem; color: var(--ink);
}
.feed-row__detail { color: var(--ink-soft); font-size: 0.92rem; margin-left: auto; }
.feed-empty {
  text-align: center;
  font-family: var(--font-body); font-style: italic; font-weight: 400;
  color: var(--ink-faint); font-size: 1rem; padding: 2rem 0;
}

/* ── Diaper game ── */
.diaper-stage {
  position: relative; width: 100%; max-width: 520px;
  aspect-ratio: 4 / 3;
  margin: 2rem auto;
  background: linear-gradient(180deg, var(--cream-light) 0%, var(--blue-pale) 100%);
  border: 2px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.diaper-step {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-script); font-size: 2.4rem;
  text-align: center; padding: 1rem;
  background: rgba(253, 247, 232, 0.9);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease-out-soft);
  pointer-events: none;
  color: var(--blue-deep);
}
.diaper-step.is-on { opacity: 1; pointer-events: auto; }
.diaper-step .step-prompt { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.5rem; }
.diaper-tap {
  display: inline-block; padding: 1.2em 2.4em;
  background: var(--pink-deep); color: white;
  border: none; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  cursor: pointer; box-shadow: var(--shadow-lifted);
  transition: transform 80ms var(--ease-out-soft);
  margin-top: 0.75rem;
}
.diaper-tap:active { transform: scale(0.96); }
.diaper-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: var(--cream-deep);
}
.diaper-progress__bar {
  height: 100%; background: var(--pink-deep);
  width: 0%; transition: width 200ms var(--ease-out-soft);
}
.diaper-clock {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.95);
  padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-variant-numeric: tabular-nums;
  font-size: 1.1rem; font-weight: 700; color: var(--blue-deep);
  box-shadow: var(--shadow-soft);
}

body.is-reveal-pink .ambient .scrap, body.is-reveal-blue .ambient .scrap { opacity: 0.3; }

/* ── Reaction recorder PIP ─────────────────────────────── */
.reaction-pip {
  position: fixed; top: 1rem; left: 1rem;
  z-index: 40;
  width: 110px; height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background: black;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--pink), var(--shadow-lifted);
  opacity: 0; transform: scale(0.85);
  transition: opacity var(--dur-md) var(--ease-out-soft),
              transform var(--dur-md) var(--ease-out-soft);
}
.reaction-pip.is-on { opacity: 1; transform: scale(1); }
.reaction-pip video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);
}
.reaction-pip__dot {
  position: absolute; top: 8px; left: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.7);
  animation: blink 1.4s ease-in-out infinite;
}
.reaction-pip__lbl {
  position: absolute; top: 6px; left: 24px;
  font-family: var(--font-body); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.18em; color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Memory book ───────────────────────────────────────── */
.memory-hero {
  text-align: center; padding: 3rem 1rem 1rem;
}
.memory-hero h1 {
  color: var(--pink-deep);
  font-size: clamp(4rem, 14vw, 7rem);
}
.memory-hero p { color: var(--ink-soft); }
.memory-stats {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 620px;
  margin: 2rem auto;
}
@media (max-width: 560px) {
  .memory-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.memory-stat {
  text-align: center; padding: 1.25rem 1rem;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
}
.memory-stat .num {
  font-family: var(--font-script); font-size: 3.2rem;
  color: var(--blue-deep); line-height: 0.9;
}
.memory-stat:nth-child(2n) .num { color: var(--pink-deep); }
.memory-stat .lbl {
  display: block; margin-top: 0.4rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
}

.memory-section { max-width: 720px; margin: 3rem auto; padding: 0 var(--gap); }
.memory-section h2 {
  font-family: var(--font-script); color: var(--blue-deep);
  font-size: clamp(2.5rem, 7vw, 3.6rem); text-align: center; margin-bottom: 1rem;
}
.memory-section h2.pink { color: var(--pink-deep); }

/* Timeline of events */
.timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.timeline-row {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
  animation: rise 0.6s var(--ease-out-soft) both;
}
.timeline-row__main {
  flex: 1; min-width: 0;
}
.timeline-row__name {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.98rem; color: var(--ink); display: inline;
}
.timeline-row__verb {
  color: var(--ink-soft); display: inline;
}
.timeline-row__detail {
  margin: 0.15rem 0 0; font-size: 0.92rem; color: var(--ink-soft);
}
.timeline-row__time {
  font-size: 0.78rem; color: var(--ink-faint);
  white-space: nowrap; align-self: flex-start;
}

/* Reaction video grid */
.reactions-grid {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.reaction-tile {
  position: relative; aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--cream-deep);
  cursor: pointer;
  border: 2px solid var(--cream-deep);
  transition: transform var(--dur-sm) var(--ease-out-soft),
              border-color var(--dur-sm);
}
.reaction-tile:hover { transform: translateY(-2px); border-color: var(--pink); }
.reaction-tile video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);
}
.reaction-tile__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
  color: white; font-weight: 600; font-size: 0.85rem;
}
.reaction-tile__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  font-size: 1.4rem; color: var(--blue-deep);
}

/* Word cloud for names */
.name-wall {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
}
.name-wall .name-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.95rem; line-height: 1.2; color: var(--ink);
}
.name-wall .name-pill:nth-child(2n) { color: var(--pink-deep); }
.name-wall .name-pill:nth-child(3n) { color: var(--blue-deep); }
.name-wall .name-pill .sticker { width: 32px; height: 32px; }
/* Size variations in the memory-book cloud */
.name-wall .name-pill.size-sm { font-size: 0.88rem; }
.name-wall .name-pill.size-md { font-size: 1.05rem; }
.name-wall .name-pill.size-lg { font-size: 1.25rem; }

/* ── Scrapbook treatments (memories page) ─────────────── */
.scrapbook { background:
    radial-gradient(900px 600px at 90% 0%, rgba(143, 184, 227, 0.1), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(244, 184, 197, 0.14), transparent 60%),
    var(--cream);
}
.tilt-1 { transform: rotate(-1.6deg); }
.tilt-2 { transform: rotate(1.2deg); }
.tilt-3 { transform: rotate(-0.8deg); }
.tilt-4 { transform: rotate(2deg); }

/* Polaroid frame around a photo or video */
.polaroid {
  display: inline-block;
  background: white;
  padding: 12px 12px 44px;
  box-shadow: 0 2px 6px rgba(43, 40, 32, 0.1), 0 14px 30px rgba(43, 40, 32, 0.12);
  border-radius: 3px;
  position: relative;
}
.polaroid__media {
  width: 100%; aspect-ratio: 1 / 1;
  background: var(--cream-deep);
  overflow: hidden; border-radius: 1px;
  position: relative;
}
.polaroid__media video,
.polaroid__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.polaroid__media video { transform: scaleX(-1); }
.polaroid__caption {
  position: absolute; left: 12px; right: 12px; bottom: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  line-height: 1.1; color: var(--blue-deep); text-align: center;
}
.polaroid__caption.pink { color: var(--pink-deep); }
.polaroid__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--blue-deep);
  pointer-events: none;
  transition: opacity var(--dur-sm);
}

/* Washi tape strip across a corner */
.washi {
  position: absolute; pointer-events: none;
  width: 80px; height: 22px;
  background: repeating-linear-gradient(135deg, var(--pink) 0 8px, var(--pink-pale) 8px 16px);
  opacity: 0.7;
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.washi--blue { background: repeating-linear-gradient(135deg, var(--blue) 0 8px, var(--blue-pale) 8px 16px); }
.washi--tl { top: -10px; left: 16px; transform: rotate(-12deg); }
.washi--tr { top: -10px; right: 16px; transform: rotate(14deg); }
.washi--bl { bottom: -8px; left: 24px; transform: rotate(-8deg); }
.washi--br { bottom: -8px; right: 22px; transform: rotate(10deg); }

/* Circular sticker face + name caption (used in "Those who joined") */
.sticker-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem;
  max-width: 110px;
}

/* Side-by-side Team Pink / Team Blue in Chapter One */
.teams-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  max-width: 720px; margin: 0 auto;
}
@media (max-width: 560px) {
  .teams-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
.team-col { display: flex; flex-direction: column; gap: 1rem; }
.team-heading {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.95rem; letter-spacing: 0.22em; text-transform: uppercase;
  text-align: center; margin: 0 0 0.25rem;
}
.sticker-card__name {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.06em;
  color: var(--ink); margin: 0;
  text-align: center;
}

/* Sticker pinned to a corner of a polaroid (overlay) */
.pin-sticker {
  position: absolute; top: -16px; right: -16px;
  z-index: 2;
}

/* Story chapter heading */
.chapter {
  max-width: 760px; margin: 4rem auto 1.5rem; padding: 0 var(--gap);
  text-align: center;
}
.chapter__num {
  font-family: var(--font-body); font-size: 0.78rem;
  letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-faint);
}
.chapter__title {
  font-family: var(--font-script);
  font-size: clamp(3rem, 8vw, 5rem);
  color: var(--blue-deep);
  line-height: 0.9; margin: 0.4rem 0 0;
}
.chapter__title.pink { color: var(--pink-deep); }
.chapter__lead {
  max-width: 520px; margin: 1rem auto 0;
  font-size: 1.05rem; color: var(--ink-soft);
}

/* Scrapbook page layout (instead of stark grid) */
.scrap-page {
  position: relative;
  max-width: 760px; margin: 1.5rem auto;
  padding: 1rem var(--gap);
}
.scrap-collage {
  display: flex; flex-wrap: wrap; gap: 1rem 1.25rem;
  align-items: flex-start; justify-content: center;
}
.scrap-collage > * { position: relative; }

/* Chips (sticker + name + verb) — handwritten feel */
.note-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: 4px;
  padding: 1rem 1.2rem 1rem 4.5rem;
  box-shadow: 0 1px 2px rgba(43,40,32,0.08), 0 8px 18px rgba(43,40,32,0.06);
  font-family: var(--font-body); font-style: italic; font-weight: 500;
  font-size: 1.05rem; line-height: 1.35;
  color: var(--ink); max-width: 320px;
}
.note-card .pin-sticker { width: 56px; height: 56px; top: 14px; left: 14px; right: auto; }
.note-card__small {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); display: block; margin-top: 0.4rem;
}

/* Big block-quote name pill (scrapbook style) */
.name-quote {
  display: inline-block;
  font-family: var(--font-script); font-size: 3rem;
  color: var(--blue-deep); line-height: 0.85;
  padding: 0.2em 0.4em;
}
.name-quote:nth-of-type(2n) { color: var(--pink-deep); }

/* The "story line" small narrative above each section */
.narrative {
  max-width: 540px; margin: 0 auto 1.5rem;
  font-family: var(--font-body); font-size: 1.05rem;
  color: var(--ink-soft); text-align: center;
}
.narrative em { color: var(--ink); font-style: normal; font-weight: 600; }

/* ─────────────────────────────────────────────────────────
 *  Phone breakpoint — 480px and below
 *  Covers the reveal-critical components (countdown, bingo,
 *  envelope, reaction PIP, consent modal) plus memory book.
 * ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Tighter page gutters */
  .section { padding: 1.75rem 0; }
  .wrap { padding-inline: 1rem; }

  /* Corner ribbons shrink so they don't dominate a small screen */
  .corner-ribbon { width: clamp(80px, 22vw, 130px); }

  /* Sticker chip: hide the name on narrow screens, keep just the face */
  .sticker-chip__name { display: none; }
  .sticker-chip { top: 0.75rem; right: 0.75rem; gap: 0; }

  /* Countdown: tighter so 4 cells always fit a 360–390px viewport */
  .countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .countdown .cell { padding: 0.75rem 0.25rem; }
  .countdown .num { font-size: clamp(1.35rem, 7.5vw, 2rem); }
  .countdown .lbl { font-size: 0.6rem; letter-spacing: 0.1em; }

  /* Bingo board — drop the 90px floor (aspect-ratio already shapes it) */
  .bingo { padding: 0.25rem; }
  .bingo-grid { gap: 0.45rem; max-width: 100%; }
  .bingo-cell { min-height: 0; }
  .bingo-cell__face--front { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .bingo-cell__face--back  { font-size: clamp(1.8rem, 9vw, 2.6rem); }

  /* Envelope: taller aspect so the card inside has vertical room */
  .envelope-stage, .hero-envelope .envelope-stage {
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }

  /* Unlock form: stack input + button on narrow screens */
  .unlock-form .row { flex-direction: column; }
  .unlock-form .row .input { min-width: 0; width: 100%; }
  .unlock-form .row .btn { width: 100%; }

  /* Reaction PIP smaller — the 110px circle is ~30% of phone width */
  .reaction-pip { width: 72px; height: 72px; top: 0.75rem; left: 0.75rem; }
  .reaction-pip__lbl { font-size: 0.55rem; top: 4px; left: 20px; }
  .reaction-pip__dot { top: 6px; left: 8px; width: 6px; height: 6px; }

  /* Consent / confirm modal: tighter padding, allow scroll on tiny phones */
  .sticker-modal { padding: 0.75rem; }
  .sticker-modal__panel { padding: 1.25rem; }
  .sticker-modal__panel h2 { font-size: 2.4rem; }
  .stk-frame { width: 180px; height: 180px; }

  /* Memory book: stat font shrinks + tighter padding */
  .memory-hero { padding: 2rem 1rem 0.5rem; }
  .memory-stat { padding: 0.9rem 0.5rem; }
  .memory-stat .num { font-size: 2.2rem; }
  .memory-stat .lbl { font-size: 0.62rem; letter-spacing: 0.12em; }

  /* Bingo title + game headings stop eating the visible area */
  .bingo h2.bingo-title { font-size: clamp(2.2rem, 10vw, 3rem); }

  /* Game-card grid is already 1-col here; tighten inside padding */
  .game-card { padding: 1.1rem; }
}

/* Print: clean keepsake — hide nav, controls, ambient */
@media print {
  body { background: white !important; }
  .scrapbook { background: white !important; }
  .ambient, .sticker-chip, .reaction-pip, .ribbon, .no-print, .btn { display: none !important; }
  .polaroid, .note-card, .timeline-row, .memory-stat {
    box-shadow: 0 1px 1px rgba(0,0,0,0.08) !important;
  }
  .tilt-1, .tilt-2, .tilt-3, .tilt-4 { transform: none; }
  .chapter { page-break-before: avoid; break-inside: avoid; }
  .scrap-page { page-break-inside: avoid; break-inside: avoid; }
}

/* ── Ambient scraps (kept light) ── */
.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient .scrap {
  position: absolute; width: 26px; height: 34px;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  opacity: 0.35;
  animation: drift 28s linear infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 110vh, 0) rotate(0deg); }
  100% { transform: translate3d(120px, -20vh, 0) rotate(360deg); }
}
