/* ===========================================================
   The Why Door - June's curiosity comic
   Mobile-first. Strong contrast. Reduced-motion + print aware.
   On-brand curiosity palette: deep curious violet + discovery
   teal + key-gold amber. Bloom is the glowing pink brain accent.
   =========================================================== */

:root {
  --indigo:       #5638a8;   /* curiosity / the wondering violet */
  --indigo-dark:  #331f63;
  --teal:         #1f9d80;   /* discovery / the open-door teal */
  --teal-deep:    #157a62;
  --amber:        #f6b41e;   /* the key / the door's glow */
  --amber-deep:   #cf8e00;
  --green:        #1f9d6b;
  --orange:       #f0662a;
  --bloom:        #e15b8f;   /* Bloom the pink brain */
  --bloom-deep:   #c23c72;
  --ink:          #1a1526;
  --cream:        #fbf5ec;
  --paper:        #ffffff;
  --muted:        #5b5468;

  --outline: 3px solid var(--ink);
  --radius: 16px;
  --shadow: 6px 6px 0 var(--ink);
  --maxw: 880px;

  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.5px);
  background-size: 14px 14px;
  background-attachment: fixed;
}
@media (prefers-reduced-motion: reduce) { body { background-attachment: scroll; } }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; letter-spacing: 0.2px; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; margin: 0; }

a { color: var(--indigo); }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--amber); color: var(--ink); padding: 0.6rem 1rem;
  font-weight: bold; border: var(--outline);
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; box-shadow: 0 0 0 2px var(--ink); }

.hidden { display: none !important; }

/* header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--indigo-dark);
  border-bottom: var(--outline);
}
.nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.5rem; padding: 0.6rem 1rem;
}
.brand {
  color: var(--amber); font-weight: 800; font-size: 1.2rem;
  text-decoration: none; margin-right: auto;
}
.nav-toggle {
  background: var(--amber); color: var(--ink);
  border: var(--outline); border-radius: 10px;
  font-weight: 700; padding: 0.4rem 0.7rem; cursor: pointer;
}
.nav-links { display: none; width: 100%; flex-direction: column; gap: 0.25rem; }
.nav-links.open { display: flex; }
.nav-links a {
  color: var(--cream); text-decoration: none; font-weight: 600;
  padding: 0.5rem 0.4rem; border-radius: 8px;
}
.nav-links a:hover, .nav-links a:focus { background: var(--indigo); }
.founder-badge{ display:inline-flex; align-items:center; padding:.3rem .7rem; border:1.5px solid rgba(255,255,255,.55); border-radius:999px; font-size:.78rem; font-weight:700; color:#fff; white-space:nowrap; }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .nav-links { display: flex; flex-direction: row; width: auto; gap: 1rem; }
}

/* shared panel */
.panel {
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin: 1.2rem auto;
  max-width: var(--maxw);
}

main { padding: 0 1rem 2rem; }

/* hero */
.hero {
  margin-top: 1.4rem;
  display: grid; gap: 1rem;
  background: linear-gradient(150deg, var(--indigo), var(--indigo-dark));
  color: var(--cream);
}
html, body { overflow-x: hidden; }
.hero-art {
  position: relative; min-width: 0; margin: 14px 10px;
}
.hero-art::before {
  content: ""; position: absolute; inset: 0; border-radius: 18px;
  background: var(--indigo-dark); transform: rotate(4deg); z-index: 0;
}
.hero-art img, .hero-art video {
  position: relative; z-index: 1; border-radius: 18px;
  width: 100%; max-height: 360px; object-fit: contain; object-position: center;
  background: #eef3f7; box-shadow: var(--shadow);
  transform: rotate(-4deg); border: 6px solid #fff;
}
.hero-text { min-width: 0; }
.hero h1 { color: #fff; margin: 0.2rem 0; }
.kicker {
  display: inline-block; background: var(--amber); color: var(--ink);
  font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 999px; margin: 0;
}
.lead { font-size: 1.15rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.6rem; }
.credit { font-size: 0.9rem; opacity: 0.9; margin-top: 0.9rem; }

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-weight: 800; padding: 0.7rem 1.1rem; border-radius: 12px;
  border: var(--outline);
}
.btn-primary { background: var(--amber); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.btn:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

@media (min-width: 720px) {
  .hero { grid-template-columns:2fr 3fr; align-items: center; }
}

/* focus meter (no-JS fallback; hidden in player mode) */
.meter-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 0.6rem 0.2rem;
  text-align: center;
}
.meter-label { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 0.3rem; }
.meter {
  height: 22px; background: #e7efe9; border: var(--outline); border-radius: 999px;
  overflow: hidden; max-width: 520px; margin: 0 auto;
}
#meter-fill {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(45deg, var(--teal), var(--teal) 12px, #26c0c0 12px, #26c0c0 24px);
  transition: width 0.4s ease;
}
@media (prefers-reduced-motion: reduce) { #meter-fill { transition: none; } }
#meter-text { margin: 0.4rem 0 0; font-weight: 600; }

/* section headings */
.section-heading { max-width: var(--maxw); margin: 1.6rem auto 0; text-align: center; }
.section-heading h2 {
  display: inline-block; background: var(--indigo); color: #fff;
  padding: 0.4rem 1rem; border: var(--outline); border-radius: 12px;
  box-shadow: var(--shadow); transform: rotate(-1deg);
}
@media (prefers-reduced-motion: reduce) { .section-heading h2 { transform: none; } }

/* episodes */
.episodes { display: block; }
.episode .ep-head {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  border-bottom: 3px dashed var(--indigo); padding-bottom: 0.5rem; margin-bottom: 0.8rem;
}
.ep-num {
  background: var(--orange); color: var(--ink); font-weight: 800;
  padding: 0.15rem 0.6rem; border-radius: 999px; border: 2px solid var(--ink);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.ep-art { position: relative; margin-bottom: 0.8rem; }
.ep-art img {
  border: var(--outline); border-radius: 12px; width: 100%;
  max-height: 320px; object-fit: contain; object-position: center; background: #f3eee4;
}

/* speech bubbles */
.bubble {
  position: relative; display: inline-block;
  background: #fff; border: var(--outline); border-radius: 14px;
  padding: 0.5rem 0.8rem; font-weight: 700; max-width: 80%;
}
.bubble::after {
  content: ""; position: absolute; bottom: -14px; left: 28px;
  border-width: 14px 12px 0; border-style: solid;
  border-color: var(--ink) transparent transparent;
}
.bubble-shadow {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--ink); color: #fff;
}
.bubble-shadow::after { border-color: var(--ink) transparent transparent; }

.caption { font-size: 1.12rem; line-height: 1.65; margin: 0.2rem 0 0.6rem; }
.caption strong { color: var(--indigo-dark); }
.lesson {
  background: #ecebfb; border-left: 6px solid var(--indigo);
  padding: 0.6rem 0.8rem; border-radius: 0 10px 10px 0; margin: 0.6rem 0;
}

/* the spoken "Say it" line under each part */
.say {
  background: #fff5e2; border: 2px dashed var(--amber-deep);
  border-radius: 10px; padding: 0.5rem 0.8rem; margin: 0.8rem 0 0;
  font-weight: 700; color: var(--indigo-dark);
}

/* activities */
.activity {
  background: var(--cream); border: 2px dashed var(--indigo);
  border-radius: 12px; padding: 0.9rem; margin: 0.8rem 0;
}
.activity-title { font-weight: 800; margin: 0 0 0.2rem; color: var(--indigo-dark); }
.hint { font-size: 0.92rem; color: var(--muted); margin: 0.6rem 0; }

.flip-row, .yet-row, .choice-row, .power-row, .pass-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.flip-card, .yet-card, .choice-btn, .power-btn, .pass-btn, .breath-btn {
  cursor: pointer; font-weight: 700; font-family: inherit; font-size: 1rem;
  background: #fff; color: var(--ink); border: var(--outline);
  border-radius: 12px; padding: 0.6rem 0.9rem; text-align: left;
  min-height: 44px;
}
.flip-card.flipped, .yet-card.flipped { background: var(--teal); color: var(--ink); }
.flip-card.flipped.soft-flip { background: var(--amber-deep); color: var(--ink); }
.choice-btn:hover, .power-btn:hover, .pass-btn:hover,
.flip-card:hover, .yet-card:hover { background: var(--amber); }
.flip-card.flipped:hover, .yet-card.flipped:hover { background: var(--teal); }
.flip-card.flipped.soft-flip:hover { background: var(--amber-deep); }
.choice-btn.good, .power-btn.chosen, .pass-btn.chosen { background: var(--teal); color: var(--ink); }
.choice-btn.soft { background: var(--amber-deep); color: var(--ink); }

.choice-output, .power-output, .pass-output, .breath-output {
  margin: 0.6rem 0 0; font-weight: 700; min-height: 1.2em;
}
.pass-output.show, .choice-output.show, .power-output.show {
  background: #fff5e2; border: 2px solid var(--amber-deep);
  border-radius: 10px; padding: 0.5rem 0.7rem;
}

/* ===========================================================
   READING-STAMINA STACK (Part 4) - the literacy core
   =========================================================== */
.stamina { text-align: center; }
.stamina-bloom {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; margin: 0.3rem 0 0.6rem;
}
.stamina-brain {
  font-size: 2.4rem; line-height: 1;
  filter: drop-shadow(0 0 0 rgba(225,91,143,0));
  transition: transform 0.5s ease, filter 0.5s ease;
}
.stamina-brain.grown { filter: drop-shadow(0 0 14px rgba(225,91,143,0.75)); }
.stamina-read {
  background: #fff; border: var(--outline); border-radius: 12px;
  padding: 0.9rem 1rem; margin: 0.4rem 0; text-align: left;
  font-size: 1.14rem; line-height: 1.7; color: var(--ink);
  min-height: 3.2em;
}
.stamina-btn {
  cursor: pointer; font-family: inherit; font-weight: 800; font-size: 1.05rem;
  background: var(--amber); color: var(--ink); border: var(--outline);
  border-radius: 999px; padding: 0.7rem 1.3rem; min-height: 44px; margin-top: 0.3rem;
}
.stamina-btn:hover { filter: brightness(0.97); }
.stamina-btn:disabled { background: var(--teal); cursor: default; filter: none; }
.stamina-progress { font-weight: 800; color: var(--teal-deep); margin: 0.5rem 0 0; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .stamina-brain { transition: none; } }

/* finale + finish */
.finale { border-color: var(--amber-deep); box-shadow: 6px 6px 0 var(--amber-deep); }
.finish-wrap { max-width: var(--maxw); margin: 0 auto; text-align: center; padding: 1rem; }
.finish-msg {
  background: var(--amber); border: var(--outline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; font-size: 1.3rem; font-weight: 800;
}
.finish-bridge {
  background: #ecebfb; border-left: 6px solid var(--indigo);
  border-radius: 0 10px 10px 0; padding: 0.7rem 0.9rem; margin: 0.9rem auto 0;
  max-width: 620px; text-align: left; font-weight: 600;
}
.grownup-tip { font-weight: 700; color: var(--indigo-dark); }

/* guides + privacy */
.guide h3 { margin-top: 1rem; color: var(--indigo-dark); }
.guide code { background: #ecebfb; padding: 0.1rem 0.35rem; border-radius: 6px; }
.privacy { background: #e7f7ef; border-color: var(--green); box-shadow: 6px 6px 0 var(--green); }

/* footer */
.site-footer {
  background: var(--indigo-dark); color: var(--cream);
  border-top: var(--outline); padding: 1.2rem 1rem; text-align: center;
}
.site-footer .fine { font-size: 0.85rem; color: #cdc7e6; max-width: 640px; margin: 0.5rem auto 0; }
.site-footer .mccray { font-weight: 700; margin: .5rem 0 0; opacity: .95; }

/* print */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .meter-wrap, .nav, .btn-row, .skip-link,
  .flip-row, .yet-row, .choice-row, .power-row, .pass-row, .hint,
  .word-row, .record-moment, .breath-btn, .stamina-btn { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #000; page-break-inside: avoid; }
  .ep-art img { max-height: 200px; }
  a { color: #000; text-decoration: none; }
}

/* ===========================================================
   WORD POWER - the vocabulary ritual (tap to hear, flips to
   big HTML/CSS word art in the site's indigo/amber palette)
   =========================================================== */
.wordpower { text-align: center; }
.wp-instruction { font-weight: 700; color: var(--indigo-dark); }
.word-row {
  display: grid; grid-template-columns: 1fr; gap: 0.8rem;
  max-width: 760px; margin: 1rem auto 0;
}
@media (min-width: 640px) { .word-row { grid-template-columns: repeat(3, 1fr); } }
.word-card {
  cursor: pointer; font-family: inherit;
  background: var(--paper); color: var(--ink);
  border: var(--outline); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 1rem 0.8rem; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem;
}
.word-card:hover { background: var(--amber); }
.word-front {
  font-weight: 900; font-size: 1.7rem; letter-spacing: 1.5px;
  color: var(--indigo-dark);
}
.word-tap { font-size: 0.85rem; font-weight: 700; color: #3f394d; }
.word-art { display: none; }
.word-card.word-open {
  background: linear-gradient(150deg, var(--indigo), var(--indigo-dark));
  border-color: var(--ink); box-shadow: 4px 4px 0 var(--amber-deep);
  animation: flipPop .45s ease;
}
.word-card.word-open:hover { background: linear-gradient(150deg, var(--indigo), var(--indigo-dark)); }
.word-card.word-open .word-front, .word-card.word-open .word-tap { display: none; }
.word-card.word-open .word-art {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.word-big {
  font-weight: 900; font-size: 2.1rem; line-height: 1.05; letter-spacing: 2px;
  color: var(--amber); text-shadow: 3px 3px 0 var(--ink);
}
.word-mean { font-weight: 700; font-size: 1rem; color: var(--cream); }
@media (prefers-reduced-motion: reduce) { .word-card.word-open { animation: none; } }

/* ===========================================================
   RECORD MOMENT - device-only "say it" voice recording
   (in-memory only; the JS revokes and discards everything)
   =========================================================== */
.record-moment {
  max-width: 560px; margin: 1.2rem auto 0;
  background: var(--cream); border: 2px dashed var(--indigo);
  border-radius: 12px; padding: 0.9rem; text-align: center;
}
.record-title { font-weight: 800; color: var(--indigo-dark); margin: 0 0 0.4rem; }
.record-line { color: var(--ink); }
.record-fallback { font-weight: 700; color: var(--indigo-dark); margin: 0.3rem 0 0; }
.record-controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.4rem;
}
.record-btn {
  cursor: pointer; font-family: inherit; font-weight: 800; font-size: 1rem;
  background: var(--amber); color: var(--ink); border: var(--outline);
  border-radius: 999px; padding: 0.7rem 1.2rem; min-height: 44px;
}
.record-btn:hover { filter: brightness(0.96); }
.record-btn.rec-live {
  background: var(--orange); color: var(--ink);
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,102,42,.5); }
  50%      { box-shadow: 0 0 0 10px rgba(240,102,42,0); }
}
.record-status { font-weight: 700; margin: 0.5rem 0 0; min-height: 1.2em; }
.record-note { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; }
.record-skip { font-size: 0.9rem; font-weight: 700; color: var(--indigo-dark); margin: 0.5rem 0 0; }
@media (prefers-reduced-motion: reduce) { .record-btn.rec-live { animation: none; } }

/* ===========================================================
   ANIMATION + CLARITY LAYER
   All motion is gentle, non-flashing, and disabled under
   prefers-reduced-motion.
   =========================================================== */

/* hero entrance */
.hero-text > * { animation: riseIn .7s both; }
.hero-text > *:nth-child(2) { animation-delay: .08s; }
.hero-text > *:nth-child(3) { animation-delay: .16s; }
.hero-text > *:nth-child(4) { animation-delay: .24s; }
.hero-art img { animation: popIn .6s both; }

/* a gentle bob on the main call-to-action to pull the eye */
.btn-primary { animation: bob 2.4s ease-in-out infinite; }

/* 3D-ish flip on flip / yet cards */
.flip-card, .yet-card { transition: transform .35s ease, background .2s ease; }
.flip-card.flipped, .yet-card.flipped { animation: flipPop .45s ease; }

/* answers / badges slide in when revealed */
.choice-output.show, .power-output.show, .pass-output.show { animation: slideIn .35s ease; }

/* breathing orb (injected by JS) - calm teal for the reset breath */
.breath-orb {
  width: 139px; height: 141px; margin: 2.2rem auto 2.6rem;
  display: grid; place-items: center;
  /* 4s matches this site's inhale step in script.js - keep them together */
  transform: scale(1); transition: transform 4s ease-in-out;
}
.breath-orb img { width: 100%; }
.breath-orb.inhale, .breath-orb.hold { transform: scale(1.45); }
.breath-orb.exhale { transform: scale(1); transition-duration:6s; }

/* "finish muscle grew" toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(120%);
  background: var(--amber); color: var(--ink); font-weight: 800; font-size: 1.05rem;
  padding: 0.7rem 1.2rem; border: var(--outline); border-radius: 999px;
  box-shadow: var(--shadow); z-index: 80; opacity: 0; pointer-events: none;
  transition: transform .4s ease, opacity .4s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* star burst particles */
.star {
  position: fixed; z-index: 79; font-size: 1.1rem; pointer-events: none;
  animation: starUp .9s ease-out forwards;
}

/* keyframes */
@keyframes riseIn   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn    { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bob      { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes flipPop  { 0% { transform: rotateX(0) scale(1); } 50% { transform: rotateX(90deg) scale(1.05); } 100% { transform: rotateX(0) scale(1); } }
@keyframes slideIn  { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes starUp   { 0% { opacity: 1; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-70px) scale(1.2); } }

/* respect reduced motion: keep meaning, drop movement */
@media (prefers-reduced-motion: reduce) {
  .hero-text > *, .hero-art img, .btn-primary,
  .flip-card.flipped, .yet-card.flipped,
  .choice-output.show, .power-output.show, .pass-output.show { animation: none !important; }
  .breath-orb { transition: none; }
  .toast { transition: opacity .2s ease; }
  .toast.show { transform: translateX(-50%) translateY(0); }
  .star { display: none; }
}

/* ── Video intro section ── */
.video-intro { text-align: center; }
.video-intro h2 { margin-bottom: 1rem; }
.video-wrap { max-width: 680px; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.18); }
.video-wrap video { display: block; width: 100%; height: auto; background: #000; }

/* ============================================================
   STORY PLAYER (My Brave Friends-style paged layout)
   Applied only when JS adds body.player-mode; without JS the
   page stays a plain scrolling story.
   ============================================================ */
body.player-mode .section-heading,
body.player-mode .meter-wrap,
body.player-mode .nav-links a:not(.lib-link) { display: none !important; }

body.player-mode .episode { opacity: 1 !important; transform: none !important; }

/* every screen hidden unless active */
body.player-mode .hero,
body.player-mode .video-intro,
body.player-mode .episode,
body.player-mode .finish-wrap,
body.player-mode .guide,
body.player-mode .privacy { display: none; }
body.player-mode .screen-active { display: block; max-width: 940px; margin: 0 auto; }
body.player-mode .hero.screen-active { display: grid; }
body.player-mode .wordpower:not(.screen-active) { display: none !important; }

@keyframes screen-in {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes screen-in-back {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: none; }
}
body.player-mode .screen-active.enter { animation: screen-in .45s ease both; }
body.player-mode .screen-active.enter-back { animation: screen-in-back .45s ease both; }

/* player top bar */
.pbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  max-width: 940px; margin: 0 auto .8rem;
  background: #ffffffee; backdrop-filter: blur(4px);
  border-radius: 0 0 18px 18px; padding: .5rem .8rem;
  box-shadow: var(--shadow);
}
.pbar.hidden { display: none; }
.pbar-btn {
  border: 0; border-radius: 999px; padding: .5rem .9rem;
  font: inherit; font-weight: 700; cursor: pointer;
  background: #ecebfb; color: var(--indigo-dark);
  min-height: 44px;
}
.pbar-btn:hover { filter: brightness(.96); }
.pbar-mid { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--indigo-dark); }
.pbar-pip { transition: transform .4s ease; display: inline-block; }
.pbar-meter {
  width: 90px; height: 10px; border-radius: 999px; background: #e6e3f2; overflow: hidden; display: inline-block;
}
.pbar-fill { display: block; height: 100%; width: 0; background: var(--indigo); border-radius: 999px; transition: width .4s ease; }
.pbar-audio { display: flex; gap: .4rem; }

/* continue button */
.pcontinue {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(90px);
  z-index: 50; border: 0; cursor: pointer;
  font: inherit; font-size: 1.35rem; font-weight: 800;
  padding: .9rem 2.2rem; border-radius: 999px;
  background: var(--amber, #f7a91e); color: #201d59;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; transition: transform .35s ease, opacity .35s ease;
}
.pcontinue.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,.25); }
  50% { box-shadow: 0 6px 26px rgba(247,169,30,.8); }
}
.pcontinue.show { animation: gentle-pulse 1.8s ease-in-out infinite; }
body.player-mode main { padding-bottom: 110px; }

/* hero: one clear start button */
.btn-start { font-size: 1.5rem; padding: 1rem 2.4rem; }
.btn-start { animation: gentle-pulse 1.8s ease-in-out infinite; }
.hero-hint { font-size: 1.05rem; margin-top: .5rem; font-weight: 600; }
.grownup-link { margin-top: 1.2rem; }
.grownup-link a { color: #d8cff0; font-size: .95rem; text-decoration: underline; }

/* celebration actions */
.finish-actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }

/* quick links to the side screens */
.side-links { margin: 0.8rem 0 0; font-weight: 600; }
.side-links a {
  color: var(--indigo); text-decoration: underline;
  display: inline-block; min-height: 44px; line-height: 44px; padding: 0 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  body.player-mode .screen-active.enter,
  body.player-mode .screen-active.enter-back,
  .pcontinue.show,
  .btn-start { animation: none; }
}
@media (max-width: 600px) {
  .pbar { flex-wrap: wrap; }
  .pbar-meter { width: 60px; }
  .pcontinue { font-size: 1.15rem; padding: .8rem 1.7rem; }
}

/* celebration finale video */
.badge-wrap .celebrate-video { display:block; width:100%; max-width:720px; margin:0 auto .9rem; border-radius:18px; box-shadow:var(--shadow); }
.scene-art video, .ep-art video { border-radius: 18px; width: 100%; max-height: 340px; object-fit: contain; object-position: center; display: block; }

/* player-mode: hero text sits on the light page background */
body.player-mode .hero { background: var(--cream); }
body.player-mode .hero h1 { color: #201d59 !important; text-shadow: none !important; }
body.player-mode .hero .kicker { color: #201d59 !important; }
body.player-mode .hero p { color: #3a3a3a !important; }
body.player-mode .hero .hero-hint { color: #157a7a !important; }
body.player-mode .hero .grownup-link a { color: #6b6b7f !important; }
body.player-mode .hero .credit { color: #5b5468 !important; }

/* MLL-FREDOKA display type - appended */
@font-face{font-family:"Fredoka";src:url("/assets/brand/Fredoka-var.woff2") format("woff2");font-weight:300 700;font-display:swap}
h1,h2,h3,h4,.brand,.kicker,.btn,.btn-primary,.nav-toggle,.nav-links a{font-family:"Fredoka","Trebuchet MS","Segoe UI",system-ui,sans-serif}


/* finale celebration (2026-07-30): confetti burst + badge pop when the story
   completes; calm mode keeps the moment quiet. */
.confetti-bit{ position:fixed; width:10px; height:14px; border-radius:2px; z-index:60;
  pointer-events:none; opacity:0; animation:confetti-fall 2.2s ease-in forwards; }
@keyframes confetti-fall{
  0%{ opacity:1; transform:translate(0,0) rotate(0deg); }
  100%{ opacity:0; transform:translate(var(--dx,0px), 46vh) rotate(var(--rot,240deg)); } }
.finish-pop{ animation:finish-pop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes finish-pop{ from{ transform:scale(.92); opacity:0; } to{ transform:scale(1); opacity:1; } }
@media (prefers-reduced-motion: reduce){
  .confetti-bit{ display:none; }
  .finish-pop{ animation:none; } }
