/* ═══════════════════════════════════════════════════════════════════
   Prophet Stories Reader
   Phone-shaped by design. On a real phone the frame IS the screen; the
   desktop framing (rounded card on blurred foliage) is presentation only.
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--parchment);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
img { max-width: 100%; }
button { font-family: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold-accent); outline-offset: 2px; }

.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;
}

/* ── Desk backdrop (desktop only) ──────────────────────────────
   On a wide screen the phone frame leaves a lot of empty space either side.
   It is filled with the landing page's own garden — the same foliage art,
   blurred well past legibility so it reads as colour and light rather than
   as a picture competing with the story. The veil is a radial rather than a
   flat wash: it holds a pool of calm cream immediately around the frame and
   lets the garden keep its colour only out at the edges.               */
.desk {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: var(--parchment);
}
.desk img {
  position: absolute; inset: -10%; width: 120%; height: 120%;
  object-fit: cover; filter: blur(18px) saturate(1.16);
  transform: scale(1.18); opacity: 0.8;
}
.desk::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 38% 72% at 50% 50%,
      rgba(250, 246, 234, 0.97), rgba(250, 246, 234, 0.8) 44%, rgba(250, 246, 234, 0.08) 84%),
    linear-gradient(180deg, rgba(250, 246, 234, 0.3), rgba(243, 236, 218, 0.48));
}

/* ── The phone frame ───────────────────────────────────────── */
.frame {
  position: relative; z-index: 1;
  width: min(100vw, 430px); height: min(100dvh, 932px);
  margin: 0 auto; overflow: hidden;
  background: var(--cream-page);
  border-radius: 30px; box-shadow: var(--sh-frame);
}
/* Full-bleed on anything phone-sized — no rounded card, no wasted pixels. */
@media (max-width: 460px), (max-height: 940px) and (max-width: 460px) {
  .frame { width: 100vw; height: 100dvh; border-radius: 0; box-shadow: none; }
  .desk { display: none; }
}
@media (min-width: 461px) {
  body { display: grid; place-items: center; }
}

/* ═══════════ HOME — episode selection ═══════════ */
.home {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 26px 20px calc(14px + var(--sa-bottom));
  background-image:
    linear-gradient(180deg, rgba(251, 247, 235, 0.4), rgba(251, 247, 235, 0.82) 32%, rgba(251, 247, 235, 0.93)),
    url("../img/bg-foliage-web.jpg");
  background-size: cover; background-position: center;
}
.home[hidden] { display: none; }

.home-settings {
  position: absolute; top: calc(14px + var(--sa-top)); right: 16px; z-index: 5;
  width: 40px; height: 40px;
}
.home-settings svg { width: 19px; height: 19px; }

.home-head { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 18px; text-align: center; }
.home-logo {
  height: 98px; width: auto;
  filter: drop-shadow(0 10px 18px rgba(80, 90, 40, 0.28));
  animation: homeLogoIn 1s cubic-bezier(0.22, 0.9, 0.24, 1) both, floatSoft 5s ease-in-out 1s infinite;
}
@keyframes homeLogoIn {
  0% { opacity: 0; transform: scale(0.6) translateY(20px) rotate(-6deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}
.home-head h1 {
  margin: 0; font-family: var(--font-round); font-weight: 800;
  font-size: 32px; line-height: 1.05; color: var(--blue);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
  animation: fadeUpSm 0.7s ease 0.25s both;
}
.home-tagline {
  font-family: var(--font-round); font-weight: 700; font-size: 14.5px; color: var(--green);
  animation: fadeUpSm 0.7s ease 0.38s both;
}

.divider-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  animation: fadeUpSm 0.7s ease 0.48s both;
}
.divider-row hr { flex: 1; height: 1.5px; border: none; margin: 0; }
.divider-row hr:first-child { background: linear-gradient(90deg, rgba(143, 164, 106, 0), rgba(143, 164, 106, 0.6)); }
.divider-row hr:last-child { background: linear-gradient(90deg, rgba(143, 164, 106, 0.6), rgba(143, 164, 106, 0)); }
.divider-row span {
  font-family: var(--font-round); font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; color: var(--sage); white-space: nowrap;
}

.story-list { display: flex; flex-direction: column; gap: 13px; }
.story-card {
  display: flex; gap: 14px; text-align: left; width: 100%;
  background: rgba(253, 250, 241, 0.96);
  border: 2px solid var(--gold-border); border-radius: var(--r-card);
  padding: 12px; box-shadow: var(--sh-story);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: fadeUpSm 0.65s ease var(--d, 0.55s) both;
}
.story-card:hover { transform: translateY(-2px); border-color: var(--green); box-shadow: var(--sh-story-hover); }
.story-card:active { transform: scale(0.98); }
.story-card img { width: 86px; height: 86px; border-radius: var(--r-cover); object-fit: cover; flex: none; }
.story-card-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.story-pill {
  align-self: flex-start;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-to));
  color: #fff; border-radius: var(--r-pill); padding: 3px 10px;
  font-family: var(--font-round); font-weight: 800; font-size: 10.5px; letter-spacing: 0.1em;
}
.story-title { font-family: var(--font-round); font-weight: 800; font-size: 18px; line-height: 1.15; color: var(--blue); }
.story-lesson { font-family: var(--font-body); font-weight: 700; font-size: 12.5px; color: var(--green-lesson); }
.story-cta {
  align-self: flex-start; margin-top: 2px;
  background: var(--blue); color: #fff; border-radius: var(--r-pill);
  padding: 6px 13px; font-family: var(--font-round); font-weight: 800; font-size: 11.5px;
}

.more-panel {
  margin-top: 16px; border: 1.5px dashed rgba(62, 142, 79, 0.45);
  border-radius: 22px; background: rgba(234, 244, 226, 0.6);
  padding: 16px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fadeUpSm 0.65s ease 0.9s both;
}
.more-panel h2 { margin: 0; font-family: var(--font-round); font-weight: 800; font-size: 15.5px; color: var(--green-deep); }
.more-panel p { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 12.5px; line-height: 1.5; color: var(--sage-copy); max-width: 30ch; }
.more-dots { display: flex; gap: 6px; }
.more-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.more-dots i:nth-child(1) { background: rgba(62, 142, 79, 0.45); }
.more-dots i:nth-child(2) { background: rgba(62, 142, 79, 0.3); }
.more-dots i:nth-child(3) { background: rgba(62, 142, 79, 0.18); }

.back-shelf {
  display: inline-flex; align-self: center; margin-top: 16px;
  background: rgba(253, 250, 241, 0.95); border: 2px solid rgba(43, 90, 167, 0.3);
  border-radius: var(--r-pill); padding: 11px 20px;
  font-family: var(--font-round); font-weight: 800; font-size: 14.5px;
  color: var(--blue); text-decoration: none;
}
.home-footer {
  margin-top: 18px; text-align: center;
  font-family: var(--font-body); font-weight: 800; font-size: 11.5px;
  letter-spacing: 0.06em; color: rgba(62, 142, 79, 0.6);
}

/* ═══════════ READER ═══════════ */
.reader { position: absolute; inset: 0; overflow: hidden; }
.reader[hidden] { display: none; }

.scene { position: absolute; inset: 0; background: var(--dusk-1); }
.scene img, .scene video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: sceneIn 0.7s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}
@keyframes sceneIn {
  from { opacity: 0; transform: scale(1.045); }
  to { opacity: 1; transform: scale(1); }
}
/* The reveal-after image cross-fades over the first. */
.scene .after-art { animation: fadeIn 2s ease both; z-index: 2; }

.missing-art {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--parchment-mid) 0 10px, var(--parchment-deep) 10px 20px);
}
.missing-art .glyph { font-size: 30px; color: rgba(120, 112, 82, 0.6); }
.missing-art .label { font-family: var(--font-round); font-weight: 800; font-size: 15px; color: var(--muted-label-2); }
.missing-art code { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted-ink); word-break: break-all; }

.tap-layer { position: absolute; inset: 0; z-index: 8; background: none; border: none; padding: 0; }

.scrim { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none; }
.scrim-narration { height: 46%; background: linear-gradient(180deg, transparent, rgba(43, 71, 46, 0.16) 40%, rgba(36, 60, 42, 0.52)); }
.scrim-tall { height: 60%; background: linear-gradient(180deg, transparent, rgba(43, 71, 46, 0.2) 34%, rgba(36, 60, 42, 0.6)); }

/* ── Page-turn wipe ────────────────────────────────────────── */
.wipe { position: absolute; inset: 0; z-index: 30; background: var(--cream-page); pointer-events: none; animation: pageWipe 0.6s ease-out both; }
@keyframes pageWipe {
  0% { opacity: 0.92; }
  60% { opacity: 0.35; }
  100% { opacity: 0; }
}

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--sa-top)) 14px 26px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(252, 248, 238, 0.92), rgba(252, 248, 238, 0.5) 55%, transparent);
}
.icon-btn {
  pointer-events: auto; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(253, 250, 241, 0.95); border: 1.5px solid rgba(43, 90, 167, 0.15);
  box-shadow: var(--sh-circle);
  display: grid; place-items: center;
  transition: transform 0.18s ease;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; }

.progress {
  pointer-events: auto;
  background: rgba(253, 250, 241, 0.93); border-radius: var(--r-capsule);
  padding: 9px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.progress-track {
  width: 150px; max-width: 34vw; height: 8px; border-radius: var(--r-pill);
  background: var(--parchment-mid); border: 1.5px solid rgba(150, 140, 110, 0.45); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold-from), var(--gold-to));
  box-shadow: 0 0 8px rgba(240, 180, 60, 0.6);
  transition: width 0.4s ease;
}
.progress-label { font-family: var(--font-round); font-weight: 800; font-size: 12.5px; letter-spacing: 0.07em; color: var(--muted-label); white-space: nowrap; }

/* ── Caption cards ─────────────────────────────────────────── */
.card-stack {
  position: absolute; left: 16px; right: 16px;
  bottom: calc(18px + var(--sa-bottom)); z-index: 20;
  display: flex; flex-direction: column; gap: 10px;
}
.card {
  background: var(--cream-card); border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-card); padding: 18px 21px;
  box-shadow: var(--sh-card); animation: fadeUpSm 0.6s ease both;
}
.card-prompt { border-radius: var(--r-prompt); padding: 15px 18px; }
.eyebrow-card { font-family: var(--font-round); font-weight: 800; font-size: 10.5px; letter-spacing: 0.14em; color: var(--gold-accent); }
.card-body {
  margin-top: 6px; font-family: var(--font-body); font-weight: 700;
  font-size: calc(17px * var(--ts)); line-height: 1.6; color: var(--blue-deep); text-wrap: pretty;
}

.tap-hint {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  animation: fadeUpSm 0.6s ease var(--hd, 0s) both;
}
.tap-hint .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--cream-page); display: grid; place-items: center;
  animation: floatSoft 2.8s ease-in-out infinite;
}
.tap-hint .dot::after {
  content: ""; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--gold-accent);
}
.tap-hint span {
  font-family: var(--font-round); font-weight: 800; font-size: 13px;
  color: var(--cream-on-dark); text-shadow: 0 2px 6px rgba(20, 40, 20, 0.6);
}

.caption-label {
  text-align: center; font-family: var(--font-round); font-weight: 800;
  font-size: 12px; letter-spacing: 0.12em; color: var(--cream-on-dark);
  text-shadow: 0 2px 6px rgba(20, 40, 20, 0.6);
}

/* ── Choice ────────────────────────────────────────────────── */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 56px;
  text-align: left; background: rgba(255, 253, 246, 0.96);
  border: 2px solid rgba(43, 90, 167, 0.16); border-radius: var(--r-option);
  padding: 13px 18px; transition: transform 0.18s ease, border-color 0.18s ease, background 0.25s ease;
}
.option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold-border); }
.option:active:not(:disabled) { transform: scale(0.97); }
.option .marker { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--sage-dot); }
.option .label { font-family: var(--font-round); font-weight: 700; font-size: 17px; color: var(--blue); line-height: 1.25; }
.option .tick { margin-left: auto; color: var(--green); font-weight: 800; }
.option[aria-pressed="true"] { background: var(--warm-1); border-color: var(--gold-border); }
.option[aria-pressed="true"] .marker { width: auto; height: auto; border-radius: 0; background: none; color: var(--gold-accent); font-size: 14px; }
.option:disabled { cursor: default; }
.option.dimmed { opacity: 0.5; }

.response {
  background: var(--mint); border: 1.5px solid rgba(62, 142, 79, 0.4);
  border-radius: var(--r-prompt); padding: 15px 18px;
  font-family: var(--font-body); font-weight: 800;
  font-size: calc(17px * var(--ts)); line-height: 1.55; color: var(--green-deep);
  animation: fadeUpSm 0.45s ease both;
}
.btn-continue {
  align-self: center;
  background: linear-gradient(180deg, var(--gold-from), var(--gold-to));
  color: #fff; border: none; border-radius: var(--r-pill);
  padding: 14px 26px; font-family: var(--font-round); font-weight: 800; font-size: 17px;
  box-shadow: var(--sh-gold); animation: fadeUpSm 0.5s ease 0.25s both;
}
.btn-continue.ghost {
  background: rgba(253, 250, 241, 0.55); color: rgba(43, 90, 167, 0.55);
  border: 1.5px solid rgba(43, 90, 167, 0.22); box-shadow: none;
}
.btn-continue.pulse { animation: fadeUpSm 0.5s ease 0.25s both, breathe 2.8s ease-in-out 1s infinite; }

/* ── Reveal ────────────────────────────────────────────────── */
.dusk-wash {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, var(--dusk-1), var(--dusk-2) 55%, var(--dusk-3));
  mix-blend-mode: multiply; opacity: 1; transition: opacity 1.8s ease;
}
.dusk-wash.lifted { opacity: 0; }

.btn-reveal {
  position: absolute; left: 50%; top: 42%; z-index: 12;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, var(--blue-reveal-from), var(--blue-reveal-to));
  color: #fff; border: 3px solid var(--warm-2); border-radius: var(--r-pill);
  padding: 16px 26px;
  font-family: var(--font-round); font-weight: 800; font-size: 18px;
  box-shadow: 0 16px 38px rgba(6, 20, 40, 0.55), 0 0 0 6px rgba(255, 233, 168, 0.18), inset 0 -3px 0 rgba(10, 32, 70, 0.35);
  animation: breatheC 2.6s ease-in-out infinite;
}
@keyframes breatheC {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.06); }
}
.btn-reveal .token {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, var(--warm-3), var(--gold-from) 70%);
  display: grid; place-items: center; color: var(--gold-accent); font-size: 15px;
}

.reveal-card .reveal-title { font-family: var(--font-round); font-weight: 800; font-size: 10.5px; letter-spacing: 0.14em; color: var(--gold-accent); }
.reveal-card .dua {
  margin-top: 7px; font-family: var(--font-round); font-weight: 800;
  font-size: calc(18.5px * var(--ts)); line-height: 1.45; color: var(--blue); text-wrap: pretty;
}
.reveal-card .meaning { margin-top: 8px; font-family: var(--font-body); font-weight: 700; font-size: calc(17px * var(--ts)); line-height: 1.55; color: var(--blue-deep); }
.reveal-card .after { margin-top: 8px; font-family: var(--font-body); font-weight: 800; font-size: calc(17px * var(--ts)); line-height: 1.55; color: var(--green); }
.hint-line {
  text-align: center; font-family: var(--font-round); font-weight: 800;
  font-size: 13.5px; color: var(--cream-on-dark); text-shadow: 0 2px 6px rgba(20, 40, 20, 0.6);
}
.hint-line span { color: var(--warm-2); }

/* ── Explore ───────────────────────────────────────────────── */
.counter-pill {
  position: absolute; top: calc(66px + var(--sa-top)); left: 50%; transform: translateX(-50%);
  z-index: 12; background: rgba(253, 250, 241, 0.93); border-radius: var(--r-pill);
  padding: 7px 16px; font-family: var(--font-round); font-weight: 800; font-size: 13px;
  color: var(--blue); white-space: nowrap; box-shadow: var(--sh-circle);
}
.counter-pill span { color: var(--gold-to); }

/* NB: the breathing animation MUST be `breatheC`, which re-applies the
   translate(-50%,-50%) in every keyframe. Plain `breathe` only sets scale(),
   which replaces the whole transform — the hotspot then hangs down-right of
   its coordinate while animating and snaps into place the moment the
   animation stops. */
.hotspot {
  position: absolute; z-index: 9; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%; padding: 0;
  background: rgba(255, 246, 214, 0.5); border: 3.5px solid var(--gold-to);
  box-shadow: var(--sh-hotspot);
  display: grid; place-items: center;
  animation: breatheC 2.6s ease-in-out infinite;
}
.hotspot::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 3px solid rgba(227, 163, 42, 0.85);
  animation: pulseRing 2.6s ease-out infinite;
}
.hotspot .core {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, var(--warm-3), var(--gold-from));
}
.hotspot.found {
  width: 50px; height: 50px; border-width: 3px; animation: none;
  background: rgba(255, 246, 214, 0.85);
}
.hotspot.found::before { display: none; }
.hotspot.found .core { width: auto; height: auto; background: none; color: var(--green-check); font-size: 22px; font-weight: 800; }

.hotspot-card .hs-title { font-family: var(--font-round); font-weight: 800; font-size: 16.5px; color: var(--blue); }
.hotspot-card .hs-title span { color: var(--gold-to); }
.hotspot-card .hs-text { margin-top: 6px; font-family: var(--font-body); font-weight: 700; font-size: calc(17px * var(--ts)); line-height: 1.55; color: var(--blue-deep); }
.btn-gotit {
  margin-top: 12px; align-self: flex-start;
  background: linear-gradient(180deg, var(--gold-from), var(--gold-to));
  color: #fff; border: none; border-radius: var(--r-pill);
  padding: 10px 20px; font-family: var(--font-round); font-weight: 800; font-size: 14px;
  box-shadow: var(--sh-gold);
}

/* ── Nuh page 12 — day/night cycle ─────────────────────────── */
.nightfall, .nightstars { position: absolute; inset: 0; pointer-events: none; animation: nightFall 9s ease-in-out infinite; }
.nightfall { z-index: 2; background: linear-gradient(180deg, var(--night-1), var(--night-2) 48%, var(--night-3)); mix-blend-mode: multiply; }
.nightstars { z-index: 3; }
.nightstars i { position: absolute; display: block; border-radius: 50%; background: var(--warm-3); }
@keyframes nightFall {
  0%, 8% { opacity: 0; }
  44%, 56% { opacity: 0.74; }
  92%, 100% { opacity: 0; }
}

/* ── The End ───────────────────────────────────────────────── */
.end-wash {
  position: absolute; inset: 0; z-index: 10;
  background: radial-gradient(ellipse at 50% 36%, rgba(251, 247, 235, 0.9), rgba(251, 247, 235, 0.66) 52%, rgba(240, 232, 210, 0.42));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 26px; overflow-y: auto;
}
.end-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 330px; text-align: center; animation: fadeUpSm 0.7s ease both;
}
.end-inner img { height: 96px; width: auto; animation: floatSoft 4.5s ease-in-out infinite; }
.end-title { font-family: var(--font-round); font-weight: 800; font-size: 32px; color: var(--blue); }
.end-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-cream {
  background: var(--cream-card); color: var(--blue);
  border: 2px solid rgba(43, 90, 167, 0.32); border-radius: var(--r-pill);
  padding: 13px 22px; font-family: var(--font-round); font-weight: 800; font-size: 15px;
}

/* ── Settings sheet ────────────────────────────────────────── */
.settings {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(20, 34, 22, 0.42);
  display: flex; align-items: flex-end;
  animation: fadeIn 0.25s ease both;
}
.settings[hidden] { display: none; }
.settings-sheet {
  width: 100%; background: var(--cream-page);
  border-radius: 26px 26px 0 0; padding: 22px 22px calc(26px + var(--sa-bottom));
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 -20px 50px rgba(30, 50, 30, 0.3);
  animation: sheetUp 0.32s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.settings-sheet h2 { margin: 0; font-family: var(--font-round); font-weight: 800; font-size: 20px; color: var(--blue); }
.setting-row { display: flex; flex-direction: column; gap: 8px; }
.setting-row > label { font-family: var(--font-round); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; color: var(--muted-label); }
.setting-row input[type="range"] { width: 100%; accent-color: var(--gold-to); }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; background: rgba(253, 250, 241, 0.9); border: 2px solid rgba(43, 90, 167, 0.18);
  border-radius: var(--r-pill); padding: 11px 8px;
  font-family: var(--font-round); font-weight: 800; font-size: 14px; color: var(--blue);
}
.seg button[aria-pressed="true"] { background: var(--warm-1); border-color: var(--gold-border); }
.settings-close {
  align-self: stretch; background: linear-gradient(180deg, var(--gold-from), var(--gold-to));
  color: #fff; border: none; border-radius: var(--r-pill); padding: 14px;
  font-family: var(--font-round); font-weight: 800; font-size: 16px; box-shadow: var(--sh-gold);
}

/* The sound toggle sits inside the frame on the reader, clear of the cards. */
/* 44px minimum — the smallest comfortable touch target, and these are
   children's fingers. */
.reader-sound { position: absolute; right: 12px; bottom: auto; top: calc(74px + var(--sa-top)); z-index: 45; width: 44px; height: 44px; }
.reader-sound svg { width: 19px; height: 19px; }

/* Short landscape phones: shrink the chrome so the art still reads. */
@media (max-height: 520px) {
  .card-stack { bottom: calc(10px + var(--sa-bottom)); left: 10px; right: 10px; gap: 7px; }
  .card { padding: 13px 16px; }
  .card-body { font-size: calc(15px * var(--ts)); line-height: 1.45; }
  .home-logo { height: 66px; }
  .home-head h1 { font-size: 25px; }
}
