:root {
  --paper: #FBF6EC;
  --card: #FFFFFF;
  --ink: #1F2A44;
  --muted: #6B6F7B;
  --line: #E8E0D0;
  --coral: #F26B4F;
  --teal: #2A9D8F;
  --sun: #F4B942;
  --grape: #7B61C9;
  --mastered: #2E9E6B;
  --learning: #E9A93A;
  --struggling: #E0574F;
  --new: #D6CFC0;
  --radius: 22px;
  --shadow: 0 2px 0 rgba(31, 42, 68, .06), 0 10px 30px rgba(31, 42, 68, .08);
  --read: 'Andika', 'Comic Sans MS', system-ui, sans-serif;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 600;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-weight: 800; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px);
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a {
  text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap;
}
.nav a.active { background: var(--ink); color: var(--paper); }
.banner {
  background: #FFF1CC; border-bottom: 1px solid #F0D98A; padding: 8px 16px; text-align: center; font-size: .9rem;
}

main { max-width: 1040px; margin: 0 auto; padding: clamp(16px, 4vw, 32px); outline: none; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 12px 20px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 800; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: transform .08s ease;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.teal { background: var(--teal); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border: 2px solid var(--line); }
.btn.danger { background: transparent; box-shadow: none; color: var(--struggling); border: 2px solid #F3C9C5; }
.btn.small { padding: 7px 14px; font-size: .875rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.back { text-decoration: none; color: var(--muted); display: inline-block; margin-bottom: 10px; }

/* ---------- cards / grids ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack > * + * { margin-top: 16px; }

.student-tile {
  display: block; text-decoration: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; border-top: 8px solid var(--c, var(--teal)); transition: transform .12s ease;
}
.student-tile:hover { transform: translateY(-3px); }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px;
  background: color-mix(in srgb, var(--c, var(--teal)) 18%, white);
}
.student-tile .name { font-size: 1.4rem; font-weight: 800; margin: 10px 0 6px; }

.section-tile {
  display: flex; gap: 16px; align-items: center; text-decoration: none; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; transition: transform .12s ease;
}
.section-tile:hover { transform: translateY(-3px); }
.section-tile .icon {
  width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 34px; flex: none;
  font-family: var(--read); font-weight: 700; color: #fff;
}
.section-tile .title { font-size: 1.25rem; font-weight: 800; }

/* mastery bar */
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--new); margin: 6px 0; }
.bar span { display: block; height: 100%; }
.bar .m { background: var(--mastered); } .bar .l { background: var(--learning); } .bar .s { background: var(--struggling); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .8rem;
  background: var(--paper); border: 1px solid var(--line);
}
.pill.s { background: #FCE4E2; border-color: #F3C9C5; color: #A33A33; }
.pill.m { background: #DFF2E8; border-color: #B9E0CB; color: #1F6E4A; }

/* ---------- setup chooser ---------- */
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-block; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
}
.choice input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.choice input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 800; margin-bottom: 8px; }

/* ---------- flashcard ---------- */
.session { max-width: 720px; margin: 0 auto; }
.session-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-dots { display: flex; gap: 5px; flex: 1; }
.progress-dots i { flex: 1; height: 8px; border-radius: 999px; background: var(--line); }
.progress-dots i.ok { background: var(--mastered); } .progress-dots i.no { background: var(--learning); }
.progress-dots i.now { background: var(--ink); }

.flash {
  perspective: 1400px; width: 100%; aspect-ratio: 4 / 3; max-height: 62vh; margin: 0 auto; cursor: pointer;
}
.flash-inner {
  position: relative; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.2, .7, .3, 1);
  transform-style: preserve-3d;
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 32px; background: var(--card);
  box-shadow: 0 3px 0 rgba(31, 42, 68, .08), 0 24px 60px rgba(31, 42, 68, .14);
  display: grid; place-items: center; text-align: center; padding: 24px;
  border: 3px solid var(--c, var(--teal));
}
.face.back { transform: rotateY(180deg); }
.big-glyph { font-family: var(--read); font-weight: 700; line-height: 1; font-size: clamp(7rem, 28vw, 15rem); }
.big-word { font-family: var(--read); font-weight: 700; line-height: 1.05; font-size: clamp(4rem, 15vw, 9rem); }
.hint-pic { font-size: clamp(4rem, 14vw, 7rem); line-height: 1; }
.hint-word { font-family: var(--read); font-size: clamp(2rem, 6vw, 3rem); margin-top: 8px; }
.hint-word b { color: var(--coral); }
.case-tag { position: absolute; top: 16px; left: 20px; font-size: .8rem; color: var(--muted); }
.tap-tag { position: absolute; bottom: 14px; left: 0; right: 0; font-size: .8rem; color: var(--muted); }

.judge { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 18px; align-items: center; }
.judge .btn { justify-content: center; padding: 18px; font-size: 1.15rem; }
.btn.notyet { background: #FFF2DA; color: #8A5A00; }
.btn.gotit { background: var(--mastered); color: #fff; }
.btn.hear { border-radius: 50%; width: 64px; height: 64px; padding: 0; justify-content: center; font-size: 1.6rem; }
.keys { text-align: center; margin-top: 10px; font-size: .8rem; color: var(--muted); }
kbd { background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-family: var(--ui); }

.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.95); } 100% { transform: scale(1); } }

/* summary */
.summary { text-align: center; }
.summary .score { font-size: 4rem; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-family: var(--read); font-weight: 700; font-size: 1.4rem; padding: 6px 14px; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line);
}
.chip.s { border-color: var(--struggling); } .chip.l { border-color: var(--learning); }
.chip.m { border-color: var(--mastered); } .chip.n { border-color: var(--new); color: var(--muted); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti span { position: absolute; top: -40px; font-size: 28px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

/* ---------- stories ---------- */
.story-tile {
  display: flex; gap: 14px; align-items: center; text-decoration: none; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.story-tile .pic { font-size: 44px; width: 64px; text-align: center; }
.reader { max-width: 860px; margin: 0 auto; }
.page {
  background: var(--card); border-radius: 32px; box-shadow: var(--shadow); padding: clamp(24px, 6vw, 56px);
  min-height: 46vh; display: grid; place-items: center; text-align: center; border: 3px solid var(--line);
}
.page .pic { font-size: 5rem; margin-bottom: 10px; }
.sentence { font-family: var(--read); font-size: clamp(2rem, 6.5vw, 3.6rem); line-height: 1.5; }
.w {
  border: 0; background: transparent; padding: 0 .08em; border-radius: 10px; cursor: pointer;
  font: inherit; line-height: inherit; border-bottom: 4px solid transparent;
}
.w.sight { border-bottom-color: color-mix(in srgb, var(--teal) 35%, transparent); }
.w.missed { background: #FFE3C4; border-bottom-color: var(--coral); }
.w.speaking { background: #FFF1B8; }
.w.reading { background: #FFE27A; box-shadow: 0 0 0 4px #FFE27A; border-bottom-color: var(--sun); transition: background .08s; }
.speed { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.speed-btn {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 800;
  min-height: 40px;
}
.speed-btn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.reader-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------- progress ---------- */
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.word-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cell {
  font-family: var(--read); font-weight: 700; border-radius: 10px; padding: 6px 8px; text-align: center;
  font-size: 1.25rem; border: 0; color: var(--ink); background: var(--new); position: relative;
}
.cell.s { background: var(--struggling); color: #fff; }
.cell.l { background: var(--learning); }
.cell.m { background: var(--mastered); color: #fff; }
.cell.n { background: #EFEAE0; color: #A39C8C; }
.cell.word { font-size: 1.05rem; padding: 5px 10px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 70px; }
.spark div { flex: 1; background: var(--teal); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.spark div.zero { background: var(--line); }
.spark-labels { display: flex; gap: 4px; font-size: .7rem; color: var(--muted); }
.spark-labels span { flex: 1; text-align: center; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list td, table.list th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-size: .8rem; font-weight: 800; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); }
.tabs a.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* ---------- notes ---------- */
textarea, input[type=text], select {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); font-weight: 600;
}
textarea { min-height: 90px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--teal); }
.note { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; border-left: 6px solid var(--sun); }
.note.observation { border-left-color: var(--grape); }
.note.done { opacity: .55; }
.note.done .note-text { text-decoration: line-through; }
.note-text { white-space: pre-wrap; margin: 6px 0 8px; font-weight: 600; }
.note-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: .8rem; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 999px; transition: transform .25s ease, visibility .25s; z-index: 30; max-width: calc(100% - 32px);
  visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

.empty { text-align: center; padding: 30px; color: var(--muted); }

@media (max-width: 560px) {
  .brand span { display: none; }
  .topbar { padding: 10px 12px; }
  .nav a { padding: 7px 9px; font-size: .9rem; }
  .judge { grid-template-columns: 1fr 1fr; }
  .judge .hear { grid-column: 1 / -1; justify-self: center; order: -1; }
  .flash { aspect-ratio: 3 / 4; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- checks (self-graded tests) ---------- */
.choice.wide { flex: 1 1 260px; }
.choice.wide span { display: block; line-height: 1.3; }
.quiz .q-card {
  position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 3px solid var(--c, var(--line)); padding: 22px 18px 18px; text-align: center; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.q-type { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-prompt { font-size: 1.3rem; font-weight: 800; }
.q-glyph { font-family: var(--read); font-weight: 700; font-size: clamp(5rem, 22vw, 9rem); line-height: 1; }
.q-pic { font-size: clamp(5rem, 22vw, 8rem); line-height: 1.1; }
.q-sentence { font-family: var(--read); font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.5; }
.q-sentence .gap {
  display: inline-block; min-width: 3.2em; border-bottom: 4px solid var(--c, var(--ink)); margin: 0 .2em;
  color: var(--mastered); font-weight: 700;
}
.quiz .q-card .btn.hear { position: absolute; top: 12px; right: 12px; }
.choices-grid { display: grid; gap: 12px; margin-top: 18px; grid-template-columns: repeat(3, 1fr); }
.choices-grid.n4 { grid-template-columns: repeat(2, 1fr); }
.choice-btn {
  font-family: var(--read); font-weight: 700; color: var(--ink); background: var(--card);
  border: 3px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); cursor: pointer;
  min-height: 96px; padding: 10px; transition: transform .12s, background .2s, border-color .2s;
}
.choice-btn.glyph { font-size: clamp(2.8rem, 12vw, 4.4rem); line-height: 1; }
.choice-btn.word { font-size: clamp(1.6rem, 7vw, 2.6rem); }
.choice-btn:active:not(:disabled) { transform: scale(.96); }
.choice-btn:focus-visible { outline: 4px solid var(--sun); outline-offset: 2px; }
.choice-btn.right { background: #DFF2E8; border-color: var(--mastered); animation: pop-in .35s; }
.choice-btn.wrong { background: #FCE4E2; border-color: var(--struggling); animation: wobble .4s; }
.choice-btn.dim { opacity: .35; }
.choice-btn:disabled { cursor: default; }
@keyframes pop-in { 50% { transform: scale(1.08); } }
@keyframes wobble { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.mixes { margin: 6px 0 0; padding-left: 1.2em; line-height: 1.8; }
.cell.proven { position: relative; box-shadow: inset 0 0 0 3px #1F6E4A; }
.cell.proven::after {
  content: '✓'; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: #1F6E4A; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-family: var(--ui);
}
.cell.cmiss { position: relative; }
.cell.cmiss::after {
  content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--struggling); border: 2px solid #fff;
}
.legend .proven-key { display: inline-grid; place-items: center; background: #1F6E4A; color: #fff; font-style: normal; font-size: 10px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .choice-btn.right, .choice-btn.wrong { animation: none; } }
.legend .proven-key { width: 14px; height: 14px; }
.choice input:checked + span .muted { color: #E8E0D0; }
.quiz .q-prompt { padding: 0 58px; }

/* ---------- add a story ---------- */
.pill.rec { background: #FFF1CC; border-color: #F0D98A; color: #7A5B00; }
.link-edit { font-size: .85rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.pv { background: var(--paper); border-radius: 16px; padding: 12px 14px; }
.pv-page { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px dashed var(--line); font-family: var(--read); font-size: 1.15rem; }
.pv-page:first-of-type { border-top: 0; }
.pv-n { font-family: var(--ui); font-size: .75rem; color: var(--muted); min-width: 1.2em; }
.pv-sight { border-bottom: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); }
.pv-other { border-bottom: 3px dotted var(--coral); }
form[data-form="story"] label { display: block; font-weight: 800; }
form[data-form="story"] label input, form[data-form="story"] label select, form[data-form="story"] label textarea { margin-top: 4px; }

/* ---------- say / stretch / spell ---------- */
.spell-pop {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 25; text-align: center;
  background: var(--card); border-radius: 24px; padding: 10px 26px 14px; box-shadow: 0 12px 40px rgba(31, 42, 68, .22);
  border: 3px solid var(--sun); animation: pop .25s ease; max-width: calc(100% - 32px);
}
.spell-pop.bye { opacity: 0; transition: opacity .25s; }
.sp-phase { font-size: .85rem; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.sp-word { font-family: var(--read); font-weight: 700; font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.15; letter-spacing: .04em; white-space: nowrap; }
.sp-word .lt { display: inline-block; padding: 0 .04em; border-radius: 10px; transition: background .12s, transform .12s; }
.spell-pop.whole .sp-word .lt { background: #FFF1B8; }
.sp-word .lt.done { color: var(--teal); }
.sp-word .lt.on { background: #FFE27A; transform: scale(1.1); }

/* ---------- syllables ---------- */
.sp-word .syl { display: inline-block; border-radius: 12px; padding: 0 .05em; transition: background .12s, transform .12s, color .12s; }
.sp-word .syl.on { background: #FFE27A; transform: scale(1.1); }
.sp-word .syl.done { color: var(--teal); }
.sp-word .dot { display: none; color: var(--coral); margin: 0 .1em; }
.spell-pop.breaking .sp-word .dot { display: inline; }

/* ---------- long story pages, series, page pictures ---------- */
.sentence.long { font-size: clamp(1.5rem, 4.6vw, 2.5rem); line-height: 1.55; }
.sentence.xlong { font-size: clamp(1.25rem, 3.8vw, 2rem); line-height: 1.6; }
.page .sentence.long, .page .sentence.xlong { text-align: left; }
.series-head { margin: 22px 0 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-img { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 18px; margin: 0 auto 14px; }

/* ---------- picture books: cover, picture on top, page dots, page turn ---------- */
.tile-cover { width: 96px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; }
.summary-cover { display: block; width: min(100%, 420px); border-radius: 18px; margin: 0 auto 10px; }
.book-cover {
  background: var(--card); border-radius: 32px; box-shadow: var(--shadow); border: 3px solid var(--line);
  padding: clamp(14px, 4vw, 28px); display: grid; gap: 10px; justify-items: center; text-align: center;
}
.cover-img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 20px; }
.cover-series { font-weight: 900; letter-spacing: .12em; color: var(--coral); margin-top: 6px; }
.cover-title { font-family: var(--read); font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1.15; margin: 0; }
.btn.big { font-size: 1.25rem; padding: 14px 28px; margin-top: 8px; }
.page.picture-page { display: block; padding: clamp(12px, 3vw, 24px); min-height: 0; }
.picture-page .page-img { width: min(100%, 72vh); max-height: none; aspect-ratio: 3 / 2; object-fit: cover; margin: 0 auto 8px; }
.picture-page .pic { width: min(100%, 72vh); margin-left: auto !important; margin-right: auto !important; }
.cover-img { width: min(100%, 90vh); }
.sentence .tok { white-space: nowrap; }
.picture-page .pic { font-size: 5rem; aspect-ratio: 3 / 2; display: grid; place-items: center; background: var(--paper); border-radius: 18px; margin: 0 0 8px; }
.picture-page .sentence { padding: 4px clamp(4px, 2vw, 16px) 8px; }
.page-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.page-dots .dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; }
.page-dots .dot.on { background: var(--c, var(--coral)); transform: scale(1.35); }
.page.turn-next { animation: turn-next .32s ease-out; }
.page.turn-back { animation: turn-back .32s ease-out; }
@keyframes turn-next { from { opacity: 0; transform: translateX(40px) rotate(.6deg); } to { opacity: 1; transform: none; } }
@keyframes turn-back { from { opacity: 0; transform: translateX(-40px) rotate(-.6deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page.turn-next, .page.turn-back { animation: none; } }
/* picture pages: same phone sizes, smaller ceiling so picture + words fit a tablet screen */
.picture-page .sentence { font-size: clamp(2rem, 6.5vw, 2.5rem); }
.picture-page .sentence.long { font-size: clamp(1.5rem, 4.6vw, 2.1rem); }
.picture-page .sentence.xlong { font-size: clamp(1.25rem, 3.8vw, 1.75rem); }
@media (min-aspect-ratio: 1/1) { .picture-page .page-img, .picture-page .pic { width: min(100%, 64vh); } }
