/* Museum Trip — a Grade 1 picture book for one class trip.

   Design system (2026-11-12 redesign):
   - every page is one "sheet": a picture stage on a chapter-coloured
     background, then the words. On a landscape iPad the two sit side by side
     so nothing needs scrolling;
   - each chapter has its own tint (sky, parchment, mint, lilac, sunshine,
     peach, pink), so a child knows where they are without reading;
   - one primary colour per job: blue = listen, orange = next page,
     green = right answer / next question. */
:root {
  --bg: #fbf6ee;
  --card: #ffffff;
  --ink: #22202a;
  --ink-2: #5d5868;
  --ink-3: #6b6576;
  --line: #ece3d3;
  --blue: #2a64cc;
  --blue-deep: #1d4ea6;
  --orange: #ee6a14;
  --orange-soft: #ffe9d8;
  --green: #1d8a4e;
  --green-soft: #ddf4e6;
  --coral-soft: #ffe5df;
  --read: #ffe066;
  --read-soft: #fff6cc;
  --tint: #dcefff;
  --accent: #2a64cc;
  --shadow-sm: 0 1px 0 rgba(70, 45, 10, .06), 0 2px 8px rgba(70, 45, 10, .06);
  --shadow: 0 1px 0 rgba(70, 45, 10, .05), 0 10px 30px -8px rgba(70, 45, 10, .16);
  --radius: 28px;
  --en: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --zh: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: light;
}
body[data-ch="go"]      { --tint: #dcefff; --accent: #2a64cc; }
body[data-ch="story"]   { --tint: #f9ebcc; --accent: #a8620e; }
body[data-ch="hall"]    { --tint: #d9f2e3; --accent: #1d8a4e; }
body[data-ch="manners"] { --tint: #ebe4ff; --accent: #6a4fd0; }
body[data-ch="spy"]     { --tint: #fff0b8; --accent: #9a6a00; }
body[data-ch="words"]   { --tint: #ffe3d6; --accent: #c4501a; }
body[data-ch="quiz"]    { --tint: #fde3ef; --accent: #b8336f; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17151c; --card: #24212b; --ink: #f4f0ea; --ink-2: #c9c2d2; --ink-3: #b3abbd; --line: #37333f;
    --blue: #7aa7ff; --blue-deep: #a8c5ff; --orange: #ff9a52; --orange-soft: #3e2a1c;
    --green: #6fd69a; --green-soft: #1d3628; --coral-soft: #3f2626;
    --read: #7a6514; --read-soft: #3a3418;
    --shadow-sm: 0 1px 0 rgba(0,0,0,.3); --shadow: 0 10px 30px -8px rgba(0,0,0,.5);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) body[data-ch="go"]      { --tint: #1e2f45; --accent: #7aa7ff; }
  :root:not([data-theme="light"]) body[data-ch="story"]   { --tint: #3a2f1b; --accent: #f0b866; }
  :root:not([data-theme="light"]) body[data-ch="hall"]    { --tint: #1c3528; --accent: #6fd69a; }
  :root:not([data-theme="light"]) body[data-ch="manners"] { --tint: #2c2547; --accent: #b4a2ff; }
  :root:not([data-theme="light"]) body[data-ch="spy"]     { --tint: #3a3216; --accent: #f2cf5b; }
  :root:not([data-theme="light"]) body[data-ch="words"]   { --tint: #40261c; --accent: #ffa27a; }
  :root:not([data-theme="light"]) body[data-ch="quiz"]    { --tint: #40202f; --accent: #ff8fc0; }
  :root:not([data-theme="light"]) .listen, :root:not([data-theme="light"]) .primary-btn,
  :root:not([data-theme="light"]) .arrow.next.ready, :root:not([data-theme="light"]) .start-btn { color: #17151c; }
  :root:not([data-theme="light"]) .listen-ico svg, :root:not([data-theme="light"]) .start-btn svg { fill: #17151c; stroke: #17151c; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: var(--en);
  display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
[lang="zh-Hant"] { font-family: var(--zh); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
button:active { transform: scale(.97); }
svg { display: block; }

/* ── Header ──────────────────────────────────────────── */
.top { width: 100%; max-width: 1000px; margin: 0 auto; padding: 10px 16px 0; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.brand { margin: 0; font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-zh { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
/* Deliberately faint: anything bright up here becomes something else to tap. */
.grownup-btn {
  flex: none; white-space: nowrap;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--ink-3); font-family: var(--zh);
}
.grownup-btn:active { transform: none; }

.chapters {
  display: flex; gap: 4px; margin: 8px -4px 0; padding: 2px 4px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.chapters::-webkit-scrollbar { display: none; }
.chap {
  flex: 1 0 auto; min-width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: 2px solid transparent; border-radius: 16px;
  padding: 6px 6px 5px; transition: background-color .2s, border-color .2s;
}
.chap-i { position: relative; font-size: 24px; line-height: 1; }
.chap .tick {
  position: absolute; right: -9px; top: -5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 10px; font-weight: 900; line-height: 15px; text-align: center;
  transform: scale(0); transition: transform .25s;
  box-shadow: 0 0 0 2px var(--bg);
}
.chap.done .tick { transform: scale(1); }
/* Labels are English only (Lewis, 2026-11-13); the Chinese stays in aria-label. */
.chap-t { font-size: 12.5px; font-weight: 700; line-height: 1.15; color: var(--ink-3); white-space: nowrap; text-align: center; }
.chap.on { background: var(--tint); border-color: var(--accent); }
/* Home sits a little apart from the chapters, behind a thin divider. */
.chap-home { position: relative; margin-right: 6px; }
.chap-home::after { content: ""; position: absolute; right: -6px; top: 18%; bottom: 18%; width: 1.5px; border-radius: 2px; background: var(--line); }
.chap.on .chap-t { color: var(--ink); }
.chap.on .tick { box-shadow: 0 0 0 2px var(--tint); }
@media (max-width: 600px) {
  /* Eight chips with Home: each takes the room its label needs. */
  .chapters { gap: 2px; }
  .chap { flex: 1 1 auto; min-width: 0; padding: 6px 1px 5px; }
  .chap-home { margin-right: 4px; }
  .chap-home::after { right: -4px; }
  /* Two short lines on a phone: "Get / ready", "Kids’ / Hall". */
  .chap-t { font-size: 11px; letter-spacing: -.01em; white-space: normal; min-height: 2.3em; display: flex; align-items: center; }
}

.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .35s ease, background-color .3s; }

/* ── Page & sheet ────────────────────────────────────── */
.page {
  flex: 1; width: 100%; max-width: 1000px; margin: 0 auto;
  padding: 14px 16px 28px; outline: none;
  display: flex; flex-direction: column; align-items: center;
}
.sheet {
  width: 100%; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.enter-fwd .sheet  { animation: in-fwd .32s cubic-bezier(.2,.8,.2,1); }
.enter-back .sheet { animation: in-back .32s cubic-bezier(.2,.8,.2,1); }
@keyframes in-fwd  { from { opacity: 0; transform: translateX(28px); } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } }

.stage {
  background: var(--tint);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 26px 16px 22px; min-height: 180px;
}
.stage .g {
  font-size: clamp(64px, 17vw, 112px); line-height: 1;
  filter: drop-shadow(0 6px 8px rgba(60, 40, 10, .18));
  animation: bob-in .5s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d);
}
@keyframes bob-in { from { opacity: 0; transform: translateY(14px) scale(.85); } }
.stage-svg { padding: 0; min-height: 0; display: block; }
.stage-svg .scene { width: 100%; height: auto; }

.copy { padding: 20px 22px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.tag {
  margin: 0 0 8px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px;
  background: var(--tint); color: var(--accent); border-radius: 999px; padding: 6px 14px;
  font-weight: 800; font-size: 14px; line-height: 1.35;
}
.lines { display: flex; flex-direction: column; gap: 16px; max-width: 34em; }
.line .en, .line .zh { margin: 0; text-wrap: balance; }
.line .en { font-size: clamp(21px, 4.6vw, 28px); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; cursor: pointer; }
.line.lead .en { font-size: clamp(25px, 5.6vw, 36px); line-height: 1.22; }
.line .zh { font-size: clamp(16px, 3.6vw, 20px); font-weight: 500; line-height: 1.55; color: var(--ink-2); margin-top: 5px; text-wrap: pretty; }

/* Reading highlights: the spoken word, or the whole line as a fallback. */
.w { border-radius: 7px; padding: 0 1px; transition: background-color .12s, box-shadow .12s; }
.w.on { background: var(--read); box-shadow: 0 0 0 3px var(--read); }
.reading:not(.words-live) { background: var(--read-soft); border-radius: 10px; box-shadow: 0 0 0 6px var(--read-soft); }

/* Listen */
.listen {
  margin-top: 18px; min-height: 60px; padding: 10px 26px 10px 18px;
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; border-radius: 999px; background: var(--blue); color: #fff;
  font-weight: 800; font-size: 20px; box-shadow: 0 6px 16px -6px rgba(42, 100, 204, .55);
  transition: background-color .2s;
}
.listen-ico svg { width: 28px; height: 28px; fill: #fff; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.listen-ico svg path:first-child { stroke: none; }
.listen-ico .wave1, .listen-ico .wave2 { fill: none; }
.listen.playing { background: var(--blue-deep); }
.listen.playing .wave1 { animation: wave 1s infinite; }
.listen.playing .wave2 { animation: wave 1s .2s infinite; }
@keyframes wave { 50% { opacity: .2; } }
.listen.compact { margin: 0; width: 56px; height: 56px; min-height: 0; padding: 0; justify-content: center; flex: none; }

/* Compact sheet: tiles and games. Small picture, words, a round Listen. */
.sheet.compact { flex-direction: row; align-items: stretch; }
.sheet.compact .stage { min-height: 0; padding: 12px 16px; flex: none; }
.sheet.compact .stage .g { font-size: 48px; }
.sheet.compact .copy { flex: 1; padding: 14px 16px; align-items: stretch; text-align: left; justify-content: center; }
.copy-row { display: flex; align-items: center; gap: 14px; }
.copy-row .lines { flex: 1; }
.sheet.compact .line .en { font-size: clamp(19px, 4.4vw, 25px); }
.sheet.compact .line .zh { font-size: clamp(15px, 3.6vw, 18px); margin-top: 2px; }
@media (max-width: 420px) {
  .sheet.compact .stage { display: none; }
}

/* iPad landscape and laptops: picture beside the words. */
@media (min-width: 760px) {
  .kind-story .sheet, .kind-end .sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: stretch; }
  .kind-story .stage, .kind-end .stage { min-height: 380px; }
  .kind-story .stage-svg, .kind-end .stage-svg { display: flex; align-items: center; background: var(--tint); }
  .kind-story .copy, .kind-end .copy { align-items: flex-start; text-align: left; justify-content: center; padding: 32px 36px; }
  .kind-story .tag { justify-content: flex-start; }
  .kind-story .lines { text-align: left; }
}

.note {
  margin: 16px 0 0; width: 100%; display: flex; gap: 10px; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink-2); background: var(--card); border: 2px dashed var(--line);
  border-radius: 18px; padding: 12px 16px; text-align: left;
}
.talk { margin-top: 18px; width: 100%; max-width: 560px; font-size: 15px; color: var(--ink-2); }
.talk summary { cursor: pointer; text-align: center; list-style: none; padding: 8px; color: var(--ink-3); font-size: 14px; }
.talk summary::-webkit-details-marker { display: none; }
.talk p { margin: 4px 16px; }
.talk[open] { background: var(--card); border-radius: 16px; padding-bottom: 12px; box-shadow: var(--shadow-sm); }

/* ── Tiles (hall, spy, words) ────────────────────────── */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr));
  gap: 12px; width: 100%; margin-top: 16px;
}
.tile {
  position: relative; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  background: var(--card); border: 0; border-radius: 22px;
  padding: 16px 12px 14px; box-shadow: var(--shadow-sm); text-align: center;
  transition: box-shadow .2s, background-color .2s;
}
.tile-art {
  width: 72px; height: 72px; border-radius: 50%; background: var(--tint);
  display: grid; place-items: center; font-size: 40px; line-height: 1; margin-bottom: 4px;
}
.tile-en { font-weight: 800; font-size: 17px; line-height: 1.28; text-wrap: balance; }
.tile-zh { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.words .tile { min-height: 0; padding: 14px 10px 12px; }
.words .tile-en { font-size: 23px; }
.words .tile-zh { font-size: 18px; }
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 0; padding: 14px 8px 12px; }
  .tile-art { width: 60px; height: 60px; font-size: 34px; }
  .tile-en { font-size: 15.5px; }
  .tile-zh { font-size: 14px; }
  .words .tile-en { font-size: 20px; }
  .words .tile-zh { font-size: 16px; }
}
.spy .stamp {
  position: absolute; top: 8px; right: 10px; font-size: 28px;
  opacity: 0; transform: scale(.3) rotate(-30deg); transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .2s;
}
.spy .tile[aria-pressed="true"] { background: var(--green-soft); box-shadow: inset 0 0 0 3px var(--green); }
.spy .tile[aria-pressed="true"] .tile-art { background: var(--card); }
.spy .tile[aria-pressed="true"] .stamp { opacity: 1; transform: none; }
.meter { width: 100%; max-width: 520px; margin-top: 16px; text-align: center; }
.meter-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffc531, #ff9f1a); border-radius: 999px; transition: width .4s cubic-bezier(.3,1.4,.5,1); }
.meter p { margin: 8px 0 0; font-size: 17px; color: var(--ink-2); }
.meter b { color: var(--ink); font-size: 19px; }

/* ── Games (manners, quiz) ───────────────────────────── */
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: .25s; }
.dot.done { background: var(--green); }
.dot.now { background: var(--accent); width: 28px; border-radius: 999px; }
.game { width: 100%; max-width: 640px; margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.situation, .question {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 18px 16px 20px; box-shadow: var(--shadow); transition: box-shadow .25s, background-color .25s;
}
.situation.good { background: var(--green-soft); box-shadow: inset 0 0 0 3px var(--green), var(--shadow); }
.situation.bad  { background: var(--coral-soft); box-shadow: inset 0 0 0 3px #e2603f, var(--shadow); }
.sit-art { font-size: 76px; line-height: 1.1; margin-bottom: 4px; }
.situation .en, .question .en { font-size: clamp(22px, 5vw, 30px); font-weight: 800; line-height: 1.25; text-wrap: balance; }
.situation .zh, .question .zh { font-size: clamp(16px, 3.8vw, 21px); color: var(--ink-2); }
.q-n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--accent);
  display: grid; place-items: center; font-weight: 900; font-size: 17px; margin-bottom: 4px;
}
.thumbs, .opts { display: flex; gap: 12px; width: 100%; justify-content: center; }
.thumb, .opt {
  flex: 1 1 0; min-height: 112px; max-width: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 24px; border: 0; background: var(--card);
  box-shadow: var(--shadow-sm); font-weight: 800; font-size: 18px;
  transition: opacity .25s, box-shadow .2s, background-color .2s, transform .2s;
}
.thumb-i { font-size: 46px; line-height: 1.1; }
.thumb.up { box-shadow: inset 0 0 0 3px #9ad8b2, var(--shadow-sm); }
.thumb.down { box-shadow: inset 0 0 0 3px #f3b4a3, var(--shadow-sm); }
.opt-art { font-size: 52px; line-height: 1.1; margin-bottom: 2px; }
.opt-en { font-size: 17px; line-height: 1.2; text-align: center; }
.opt-zh, .thumb [lang="zh-Hant"] { font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.right { background: var(--green-soft) !important; box-shadow: inset 0 0 0 4px var(--green), var(--shadow-sm) !important; transform: scale(1.04); }
.faded { opacity: .35; }
.why { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.why:empty { display: none; }
.why .en { margin: 0; font-size: 22px; font-weight: 800; color: var(--green); line-height: 1.3; text-wrap: balance; }
.why .zh { margin: 0; font-size: 18px; color: var(--ink-2); }
.done-art { font-size: 96px; line-height: 1.1; animation: bob-in .6s cubic-bezier(.3,1.5,.5,1) both; }
.game > .en { margin: 0; font-size: 28px; font-weight: 800; text-align: center; }
.game > .zh { margin: 0; font-size: 20px; color: var(--ink-2); }

.primary-btn, .ghost-btn {
  min-height: 60px; padding: 12px 28px; border-radius: 999px; font-weight: 800; font-size: 19px; margin-top: 6px;
}
.primary-btn { border: 0; background: var(--green); color: #fff; box-shadow: 0 6px 16px -6px rgba(29, 138, 78, .6); }
.ghost-btn { border: 2px solid var(--line); background: var(--card); color: var(--ink-2); margin-top: 16px; }

/* ── End badge ───────────────────────────────────────── */
.badge { flex-direction: column; gap: 0; padding: 28px 20px 22px; text-align: center; }
.medal {
  width: 112px; height: 112px; margin: 0 auto 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc531 55%, #e09400);
  display: grid; place-items: center; font-size: 52px;
  box-shadow: 0 0 0 6px #fff1c2, 0 0 0 8px #ffd25c, 0 12px 24px -8px rgba(160, 100, 0, .5);
  animation: bob-in .7s cubic-bezier(.3,1.5,.5,1) both;
}
.badge-en { margin: 8px 0 0; font-size: 28px; font-weight: 900; letter-spacing: -.01em; }
.badge-zh { margin: 2px 0 10px; font-size: 19px; color: var(--ink-2); }
.badge-stars { margin: 0; font-size: 22px; letter-spacing: 2px; }
.badge-stars i { font-style: normal; color: var(--ink-3); opacity: .45; }
.badge-note { margin: 10px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: var(--ink-2); }

/* ── Bottom nav ──────────────────────────────────────── */
.nav {
  position: sticky; bottom: 0; z-index: 5;
  width: 100%; max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, rgba(251, 246, 238, 0));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav { background: linear-gradient(to top, var(--bg) 62%, rgba(23, 21, 28, 0)); }
}
.arrow { border: 0; display: grid; place-items: center; transition: background-color .25s, opacity .2s, box-shadow .25s; }
.arrow svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.arrow.prev { width: 64px; height: 64px; border-radius: 50%; background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.arrow.next { width: 128px; height: 68px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); }
.arrow.next.ready { background: var(--orange); color: #fff; animation: ready 1.8s ease-in-out infinite; }
@keyframes ready { 0%, 100% { box-shadow: 0 8px 20px -8px rgba(238, 106, 20, .7), 0 0 0 0 rgba(238, 106, 20, .35); } 50% { box-shadow: 0 8px 20px -8px rgba(238, 106, 20, .7), 0 0 0 10px rgba(238, 106, 20, 0); } }
.arrow:disabled { opacity: .25; cursor: default; animation: none; }
.counter { font-weight: 700; color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ── Start screen ────────────────────────────────────── */
.start {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  display: grid; place-items: center; padding: 20px 16px;
  background: linear-gradient(180deg, #bfe3ff 0%, #fbf6ee 70%);
  transition: opacity .26s, transform .26s;
}
.start[hidden] { display: none; }
.start.leaving { opacity: 0; transform: scale(1.03); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .start { background: linear-gradient(180deg, #1e2f45 0%, #17151c 70%); }
}
.start-card { position: relative; width: 100%; max-width: 520px; text-align: center; }
/* The way home to the Learning Corner, on a family device only (see the note
   in index.html). It sits on the corner of the cover picture, the way the
   "real photo" chip sits on a photo, so it costs the screen no height. */
.start-home {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--ink-2);
  box-shadow: var(--shadow-sm), 0 0 0 2px var(--line);
}
.start-home[hidden] { display: none; }
.start-home svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.start-home:active { transform: scale(.94); }
.start-home:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.start-art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.start-art svg { width: 100%; height: auto; }
.start-kicker { margin: 22px 0 0; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.start h1 { margin: 4px 0 0; font-size: clamp(38px, 10vw, 54px); line-height: 1.05; letter-spacing: -.02em; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.start-zh { font-size: .52em; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.start-sub { margin: 12px 0 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); font-size: 16px; }
.start-btn {
  margin-top: 26px; min-height: 76px; padding: 14px 36px 14px 26px;
  display: inline-flex; align-items: center; gap: 12px;
  border: 0; border-radius: 999px; background: var(--orange); color: #fff;
  font-weight: 900; font-size: 26px;
  animation: ready 1.8s ease-in-out infinite;
}
.start-btn svg { width: 34px; height: 34px; fill: #fff; }
.start-btn [lang="zh-Hant"] { font-size: 20px; font-weight: 700; opacity: .9; }
.start-hint { margin: 16px 0 0; color: var(--ink-3); font-size: 14px; }

/* ── Motion ──────────────────────────────────────────── */
.wobble { animation: wobble .45s; }
@keyframes wobble { 20% { transform: translateX(-8px) rotate(-3deg); } 40% { transform: translateX(8px) rotate(3deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.pop { animation: pop .32s; }
@keyframes pop { 50% { transform: scale(1.06); } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti span { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 2s cubic-bezier(.25,.6,.4,1) forwards; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Grown-up dialog ─────────────────────────────────── */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px); background: var(--card); color: var(--ink);
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(30, 20, 10, .45); }
.g-inner { padding: 16px 20px 22px; font-family: var(--zh); font-size: 15px; line-height: 1.6; }
.g-inner [lang="en"] { font-family: var(--en); color: var(--ink-2); }
.g-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -16px; background: var(--card); padding: 4px 0; z-index: 1; }
.g-head h2 { margin: 0; font-size: 19px; }
.g-close { border: 0; background: var(--bg); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; }
.g-inner h3 { font-size: 15px; margin: 18px 0 6px; color: var(--orange); }
.g-inner p { margin: 6px 0; }
.g-inner ul { margin: 0; padding-left: 18px; }
.g-inner li { margin-bottom: 8px; }
.g-inner a { color: var(--blue); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--orange); }
.row select { max-width: 100%; font-size: 15px; padding: 6px; border-radius: 8px; }
.row input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--orange); }
.mini { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 12px; font-size: 14px; }
.mini.wide { width: 100%; }
.small { font-size: 13px; color: var(--ink-2); }
@media (max-width: 420px) { .g-en { display: none; } }

/* Phones: a shorter stage, so the words and Listen sit higher. */
@media (max-width: 600px) {
  .stage { min-height: 0; padding: 18px 12px 16px; }
  .stage .g { font-size: clamp(56px, 16vw, 76px); }
  .copy { padding: 16px 18px 20px; }
  .lines { gap: 12px; }
  .tag { font-size: 13px; padding: 5px 12px; }
  .listen { margin-top: 14px; }
}

/* Start screen: the one reminder for parents. */
.start-notice {
  margin: 18px auto 0; max-width: 420px; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid #ffc531; border-radius: 18px;
  padding: 12px 16px; text-align: left; box-shadow: var(--shadow-sm);
}
.sn-ico { font-size: 30px; line-height: 1; flex: none; }
.start-notice p { margin: 0; }
.sn-zh { font-size: 17px; color: var(--ink); }
.sn-zh b { color: var(--orange); }
.sn-en { font-size: 13.5px; color: var(--ink-2); margin-top: 2px !important; }
@media (max-height: 720px) {
  .start-art { max-width: 300px; margin: 0 auto; }
  .start-kicker { margin-top: 14px; }
  .start-btn { margin-top: 18px; min-height: 66px; }
}

/* ── Real photos ─────────────────────────────────────────
   The photo fills the stage; a chip says it is real, and the
   photographer's credit sits small in a corner. */
.stage-photo { position: relative; margin: 0; padding: 0; min-height: 0; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.stage-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; animation: photo-in .5s ease both; }
@keyframes photo-in { from { opacity: 0; transform: scale(1.04); } }
.stage-photo.contain img { object-fit: contain; padding: 44px 16px 26px; box-sizing: border-box; filter: drop-shadow(0 8px 12px rgba(60, 40, 10, .22)); }
.real-chip {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: rgba(255, 255, 255, .94); color: #3a2a10; font-weight: 800; font-size: 13px;
  border-radius: 999px; padding: 5px 11px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.credit {
  position: absolute; right: 8px; bottom: 6px; z-index: 1; max-width: 90%;
  font-size: 10.5px; line-height: 1.3; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .85); opacity: .92;
}
.stage-photo.contain .credit { color: var(--ink-2); text-shadow: none; }
@media (max-width: 600px) {
  .stage-photo { aspect-ratio: 16 / 10; }
  .stage-photo.contain { aspect-ratio: 4 / 3; }   /* a tall object needs the height */
  .stage-photo.contain img { padding: 40px 12px 22px; }
  .real-chip { font-size: 12px; padding: 4px 10px; }
}
/* Side by side: the photo keeps its 4:3 shape as a framed print, so a wide
   subject (the whole cloud wall and its name) is not cropped to a strip. */
@media (min-width: 760px) {
  .kind-story .stage-photo { aspect-ratio: 4 / 3; min-height: 0; align-self: center; margin: 20px 0 20px 20px; border-radius: 18px; }
}
.credits { padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.credits li { margin: 4px 0; }

/* ── Video ───────────────────────────────────────────────
   A thumbnail and a big play button; the YouTube player only
   replaces it when tapped. Always 16:9. */
.stage-video, .stage-video.stage-photo { aspect-ratio: 16 / 9; background: #000; }
.video-play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.video-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.play-ico {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; margin: -27px 0 0 -38px;
  border-radius: 16px; background: #e62117; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35); transition: transform .15s;
}
.play-ico svg { width: 30px; height: 30px; fill: #fff; }
.video-play:hover .play-ico, .video-play:focus-visible .play-ico { transform: scale(1.08); }
.stage-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-video.playing .real-chip, .stage-video.playing .credit { display: none; }
.stage-video .credit { left: 8px; text-align: right; }
@media (max-width: 600px) { .stage-video.stage-photo { aspect-ratio: 16 / 9; } }
@media (min-width: 760px) { .kind-story .stage-video.stage-photo { aspect-ratio: 16 / 9; } }
