/* Phonics reader styles. Tablet-first, works on phone + desktop (§8.1).
   Visually independent from the aliensbrain OMR design system (§4.1 branding note):
   a paper-sticker storybook world — candy-colored book covers with inked borders and
   cast shadows, a sky backdrop with drifting clouds. No external assets except one
   Google Font. Color floor: Safari 15.4 / oklch (same as the existing :focus-visible
   and aspect-ratio usage). */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Andika:wght@400;700&display=swap');

:root {
  --paper: oklch(0.995 0.008 95);
  --ink: oklch(0.27 0.025 70);
  --ink-soft: oklch(0.47 0.025 70);
  --accent: #D62828;        /* target-letter red, §8.1 — pedagogy, not decoration */
  --accent-soft: #FFE3E3;
  --sky-1: oklch(0.92 0.05 235);
  --sky-2: oklch(0.965 0.03 230);
  --sun: #FFD66B;
  --grass: oklch(0.72 0.16 147);
  --shade: oklch(0.86 0.05 245);      /* cast-shadow blue: the sky's own shadow */
  --shade-deep: oklch(0.8 0.07 245);
  --tap: 64px;
  --bd: 3px solid var(--ink);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);   /* ease-out-quart */
  /* candy cover palette: each book owns one (cycled via nth-child below) */
  --candy-1: oklch(0.67 0.19 25);  --candy-1-soft: oklch(0.94 0.045 25);
  --candy-2: oklch(0.65 0.14 255); --candy-2-soft: oklch(0.94 0.04 255);
  --candy-3: oklch(0.66 0.14 305); --candy-3-soft: oklch(0.945 0.045 305);
  --candy-4: oklch(0.7 0.16 147);  --candy-4-soft: oklch(0.94 0.05 147);
  --candy-5: oklch(0.78 0.14 75);  --candy-5-soft: oklch(0.95 0.05 75);
  --candy-6: oklch(0.7 0.16 55);   --candy-6-soft: oklch(0.94 0.05 55);
  --candy-7: oklch(0.67 0.11 205); --candy-7-soft: oklch(0.94 0.04 205);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Andika', 'Baloo 2', system-ui, sans-serif;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 70%);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { text-wrap: balance; }

/* ------------------------------------------------- backdrop: the storybook sky
   Fixed scenery behind everything: a pulsing sun, three drifting clouds, two
   rolling hills. Purely ambient (slow, backgrounded), pointer-inert, aria-hidden. */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bd-sun {
  position: absolute; top: -70px; right: -70px; width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, oklch(0.94 0.11 95), oklch(0.86 0.17 85));
  box-shadow: 0 0 90px 34px oklch(0.9 0.12 90 / 0.5);
  animation: sun-breathe 9s ease-in-out infinite;
}
@keyframes sun-breathe { 0%,100% { transform: scale(1);} 50% { transform: scale(1.05);} }
.bd-cloud { position: absolute; background: oklch(0.99 0.005 230 / 0.9); border-radius: 999px; }
.bd-cloud::before, .bd-cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.bd-cloud::before { width: 58%; height: 170%; left: 14%; bottom: 18%; }
.bd-cloud::after { width: 40%; height: 120%; right: 12%; bottom: 24%; }
.bd-cloud-1 { width: 190px; height: 54px; top: 11%; animation: drift 85s linear infinite; animation-delay: -12s; }
.bd-cloud-2 { width: 130px; height: 40px; top: 26%; animation: drift 115s linear infinite; animation-delay: -60s; opacity: 0.75; }
.bd-cloud-3 { width: 230px; height: 62px; top: 55%; animation: drift 95s linear infinite; animation-delay: -38s; opacity: 0.6; }
@keyframes drift { from { transform: translateX(-260px);} to { transform: translateX(calc(100vw + 260px));} }
.bd-hill { position: absolute; bottom: -14vh; height: 34vh; border-radius: 100% 100% 0 0; }
.bd-hill-1 { left: -25%; width: 115%; background: oklch(0.8 0.11 150); }
.bd-hill-2 { right: -30%; width: 120%; bottom: -17vh; background: oklch(0.73 0.14 148); }

/* ----------------------------------------------------------------- layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 18px; position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 20px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 25px; font-family: 'Baloo 2', sans-serif; letter-spacing: 0.2px;
}
.brand .dot {
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 24px;
  border: var(--bd); box-shadow: 3px 3px 0 var(--shade-deep);
  rotate: -6deg; transition: rotate 0.25s var(--ease-out);
}
.brand:hover .dot { rotate: 6deg; }
.muted { color: var(--ink-soft); }
a.plain {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 8px 16px; box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
a.plain:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shade); color: var(--ink); }
a.plain:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }

/* --------------------------------------------------------------- library */
.blurb {
  font-size: 18px; color: var(--ink-soft); font-weight: 700;
  margin: 2px 0 24px; max-width: 54ch; text-wrap: pretty;
}
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 22px;
}

/* every cover owns a candy color; the shelf reads as 13 distinct picture books */
.book:nth-child(7n+1) { --cover: var(--candy-1); --cover-soft: var(--candy-1-soft); }
.book:nth-child(7n+2) { --cover: var(--candy-2); --cover-soft: var(--candy-2-soft); }
.book:nth-child(7n+3) { --cover: var(--candy-3); --cover-soft: var(--candy-3-soft); }
.book:nth-child(7n+4) { --cover: var(--candy-4); --cover-soft: var(--candy-4-soft); }
.book:nth-child(7n+5) { --cover: var(--candy-5); --cover-soft: var(--candy-5-soft); }
.book:nth-child(7n+6) { --cover: var(--candy-6); --cover-soft: var(--candy-6-soft); }
.book:nth-child(7n+7) { --cover: var(--candy-7); --cover-soft: var(--candy-7-soft); }

.book {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border: var(--bd); border-radius: 26px;
  box-shadow: 7px 7px 0 var(--cover-soft, var(--shade));
  padding: 18px 16px 16px; position: relative; overflow: hidden;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  animation: shelf-pop 0.55s var(--ease-out) both;
}
/* staggered arrival, one shelf row at a time */
.book:nth-child(n+1):nth-child(-n+4)  { animation-delay: 0.02s; }
.book:nth-child(n+5):nth-child(-n+8)  { animation-delay: 0.1s; }
.book:nth-child(n+9):nth-child(-n+12) { animation-delay: 0.18s; }
.book:nth-child(n+13)                 { animation-delay: 0.26s; }
@keyframes shelf-pop { from { opacity: 0; transform: translateY(16px) scale(0.96);} to { opacity: 1; transform: none;} }
.book:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 11px 12px 0 var(--cover-soft, var(--shade)); }
.book:active { transform: translateY(-1px) scale(0.99); }
.book:focus-visible { outline: 4px solid var(--cover, var(--accent)); outline-offset: 3px; }

.book .letters {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 58px; line-height: 1.05;
  background: var(--cover-soft, var(--accent-soft)); border-radius: 18px;
  padding: 14px 10px 10px; text-align: center; margin-top: 14px;
}
.book .letters .hl { color: var(--cover, var(--accent)); display: inline-block; }
.book .letters .hl:first-child { rotate: -4deg; }
.book .letters .hl:last-child { rotate: 3deg; margin-left: 6px; }
.book .btitle {
  font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 12px;
  min-height: 1.2em; text-align: center; text-wrap: balance;
}
.book .stars { margin-top: 8px; font-size: 22px; letter-spacing: 4px; text-align: center; color: oklch(0.75 0.15 85); }
.book .badge {
  position: absolute; top: 12px; right: 12px; background: var(--paper); color: var(--ink-soft);
  border: 2px solid var(--ink-soft); border-radius: 999px; font-size: 12px; font-weight: 700;
  padding: 3px 10px;
}
.book .vline {
  margin-top: 10px; text-align: center; font-size: 12.5px; font-weight: 700;
  color: var(--cover, var(--ink-soft)); letter-spacing: 0.2px; opacity: 0.9;
}
.book.ungenerated {
  opacity: 0.75; border-style: dashed; border-color: var(--ink-soft);
  box-shadow: none; animation: none;
}
.book.ungenerated:hover { transform: none; }
.book.ungenerated .letters { background: none; border: 2px dashed oklch(0.75 0.03 70); }
.book.ungenerated .letters .hl { color: var(--ink-soft); rotate: 0deg; }
.ribbon {
  position: absolute; top: 0; left: 26px; width: 16px; height: 30px;
  background: var(--cover, var(--accent));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}
/* suggested-next: a candy-colored breathing ring instead of the old red glow */
.suggest-glow { animation: shelf-pop 0.55s var(--ease-out) both, suggest-breathe 2.6s ease-in-out 0.6s infinite; }
@keyframes suggest-breathe {
  0%,100% { box-shadow: 7px 7px 0 var(--cover-soft, var(--shade)), 0 0 0 3px oklch(0.99 0 0 / 0); }
  50%     { box-shadow: 7px 7px 0 var(--cover-soft, var(--shade)), 0 0 0 10px var(--cover-soft, var(--shade)); }
}

/* ---------------------------------------------------------------- reader */
.reader { max-width: 720px; margin: 0 auto; padding: 14px 12px; position: relative; z-index: 1; }
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reader-title {
  font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: clamp(24px, 4vw, 32px); letter-spacing: 0.2px; text-align: center; flex: 1;
}
.reader-title .hl { color: var(--accent); }
.reader-tools { display: flex; gap: 8px; }
/* version switcher: one pill per story when a letter has variants (difficulty/theme) */
.versions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0 2px; }
.ver {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 16px; border-radius: 16px; text-decoration: none;
  background: var(--paper); border: var(--bd); color: var(--ink);
  box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background 0.15s ease;
}
.ver b { font-family: 'Baloo 2', sans-serif; font-size: 15px; line-height: 1.1; }
.ver span { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.ver:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shade); background: oklch(0.96 0.03 90); }
.ver.on { background: var(--accent); border-color: var(--accent); box-shadow: 3px 3px 0 oklch(0.55 0.2 25); }
.ver.on span { color: #ffe3e3; }
.btn {
  font-family: 'Andika', sans-serif; font-weight: 700; font-size: 16px;
  background: var(--paper); color: var(--ink); border: var(--bd); border-radius: 999px;
  padding: 10px 18px; cursor: pointer; min-height: var(--tap);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.btn:hover { background: oklch(0.96 0.03 90); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shade); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shade); }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 4px 4px 0 oklch(0.55 0.2 25); }
.btn.lg { width: 60px; justify-content: center; padding: 0; font-size: 22px; }
.btn:focus-visible, .ver:focus-visible, a.plain:focus-visible,
.hunt-word:focus-visible, .match-word:focus-visible, .dot:focus-visible {
  outline: 4px solid var(--accent); outline-offset: 2px;
}

/* the page card: sentence top (~30%), scene below (~70%), §8.1 — framed like a
   real picture-book page: inked border + a cast shadow the color of the sky */
.page-card {
  background: var(--paper); border: var(--bd); border-radius: 30px;
  box-shadow: 10px 12px 0 var(--shade);
  margin: 14px auto 0; overflow: hidden; position: relative;
  aspect-ratio: 3 / 4; max-height: 72vh; max-width: 100%;
  display: flex; flex-direction: column;
}
.sentence {
  flex: 0 0 30%; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 22px; text-align: center;
  font-size: clamp(32px, 6vw, 48px); line-height: 1.25; font-weight: 700;
  letter-spacing: 0.5px;
  position: relative; z-index: 2;
  background: linear-gradient(180deg,
    oklch(0.995 0.008 95 / 0.95) 0%,
    oklch(0.995 0.008 95 / 0.86) 68%,
    oklch(0.995 0.008 95 / 0) 100%);
}
.sentence .s-inner { max-width: 100%; animation: sent-in 0.4s var(--ease-out) both; }
@keyframes sent-in { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none;} }
.sentence .w {
  display: inline-block; padding: 2px 5px; border-radius: 10px; cursor: pointer;
  transition: background 0.12s ease, transform 0.12s var(--ease-out);
}
.sentence .w:hover { background: var(--accent-soft); transform: scale(1.05); }
.sentence .w.spoken { background: var(--sun); transform: scale(1.08); }
.sentence .hl { color: var(--accent); font-weight: 800; }
/* the scene fills the WHOLE card behind the sentence panel; the 600x800 canvas is the
   same 3:4 shape as the card, so the artwork maps 1:1. A fresh <svg> is mounted on every
   page turn, which re-triggers this entrance — the page-turn feel, for free. */
.scene {
  position: absolute; inset: 0; overflow: hidden; background: #BFE3FF;
}
.scene svg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  animation: scene-in 0.5s var(--ease-out) both;
}
@keyframes scene-in { from { opacity: 0; transform: translateX(26px) scale(1.02);} to { opacity: 1; transform: none;} }
.scene .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-soft); font-weight: 700; }

/* char interactivity: tap bounce + phoneme */
.sc-char { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: filter 0.12s ease; }
.sc-char:hover { filter: brightness(1.05); }
.sc-char.bounce { animation: bounce 0.5s ease; }
@keyframes bounce { 0%,100% { transform: scale(1);} 30% { transform: scale(1.12) translateY(-8px);} 60% { transform: scale(0.96);} }
/* tappable props (§8.2): same affordance as characters - cursor, hover, bounce on tap */
.sc-prop { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: filter 0.12s ease; }
.sc-prop:hover { filter: brightness(1.06); }
.sc-prop.bounce { animation: bounce 0.5s ease; }
/* keyboard focus ring for the tappable scene/word elements (a11y, §8.4) */
.sc-char:focus-visible, .sc-prop:focus-visible, .sentence .w:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sc-spin { transform-box: fill-box; transform-origin: center; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg);} }
.sc-twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%,100%{ opacity: 0.7; transform: scale(0.9);} 50%{ opacity: 1; transform: scale(1.1);} }
.sc-fall { transform-box: fill-box; transform-origin: center; animation: fall 6s ease-in-out infinite; }
@keyframes fall { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(10px);} }

/* nav */
.nav {
  display: flex; align-items: center; justify-content: space-between; margin-top: 16px;
}
.dots { display: flex; gap: 9px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%; cursor: pointer;
  background: var(--paper); border: 2.5px solid var(--ink-soft);
  transition: all 0.18s var(--ease-out);
}
.dot:hover { transform: scale(1.2); border-color: var(--ink); }
.dot.on { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.dot.done { background: var(--grass); border-color: var(--grass); }
/* z-index 1: above the scene (which is absolute inset:0) but below the sentence,
   so edge taps turn pages while words stay tappable. */
.navzone { position: absolute; top: 0; bottom: 0; width: 18%; cursor: pointer; z-index: 1; }
.navzone.left { left: 0; }
.navzone.right { right: 0; }

/* mini-game overlay */
.game-overlay {
  position: fixed; inset: 0; background: oklch(0.27 0.025 70 / 0.55); display: none;
  place-items: center; padding: 20px; z-index: 50;
}
.game-overlay.on { display: grid; }
.game-card {
  background: var(--paper); border: var(--bd); border-radius: 28px;
  box-shadow: 10px 10px 0 var(--shade-deep);
  max-width: 560px; width: 100%; padding: 28px 26px; text-align: center;
  animation: game-pop 0.35s var(--ease-out) both;
}
@keyframes game-pop { from { opacity: 0; transform: scale(0.9) translateY(14px);} to { opacity: 1; transform: none;} }
.game-card h2 { font-family: 'Baloo 2', sans-serif; font-size: 32px; margin: 0 0 6px; }
.game-prompt { color: var(--ink-soft); font-weight: 700; margin-bottom: 20px; }
.hunt-words { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hunt-word {
  font-family: 'Andika', sans-serif; font-size: 27px; font-weight: 700;
  padding: 12px 20px; border-radius: 18px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer; min-height: var(--tap);
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.hunt-word:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--shade); }
.hunt-word:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.hunt-word.right { background: var(--grass); border-color: var(--ink); color: #fff; box-shadow: 4px 4px 0 oklch(0.55 0.14 150); }
.hunt-word.wrong { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* match game (§8.2 item 4): picture cards on top, word buttons below */
.match-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.match-pic {
  width: 120px; height: 150px; border-radius: 18px; overflow: hidden;
  background: oklch(0.96 0.045 90); border: var(--bd); position: relative; cursor: pointer;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.match-pic:hover { transform: translateY(-3px); box-shadow: 5px 7px 0 var(--shade); }
.match-pic svg { width: 100%; height: 100%; display: block; }
.match-pic.sel { border-color: var(--accent); box-shadow: 4px 4px 0 oklch(0.6 0.18 25); transform: translateY(-3px); }
.match-pic.done { border-color: var(--grass); opacity: 0.9; }
.match-pic.done::after { content: '✓'; position: absolute; top: 4px; right: 8px; color: var(--grass); font-weight: 800; font-size: 24px; text-shadow: 0 1px 0 #fff; }
.match-words { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.match-word {
  font-family: 'Andika', sans-serif; font-size: 25px; font-weight: 700;
  padding: 10px 18px; border-radius: 18px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer; min-height: var(--tap);
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.match-word:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--shade); }
.match-word.done { background: var(--grass); color: #fff; pointer-events: none; box-shadow: 4px 4px 0 oklch(0.55 0.14 150); }
.match-word.wrong { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; }

/* sticker shelf: a per-letter sticker badge on the book cover when story+game are done */
.sticker {
  position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FFE9A8, #F2B134); display: grid; place-items: center;
  font-size: 19px; box-shadow: 0 2px 6px oklch(0.27 0.025 70 / 0.25); border: 2.5px solid #fff;
  rotate: 8deg; animation: sticker-pop 0.45s var(--ease-out) both;
}
@keyframes sticker-pop { from { transform: scale(0) rotate(-40deg);} to { transform: scale(1) rotate(0deg);} }

/* progress / utilities */
.progress-line { color: var(--ink-soft); font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }
.empty {
  text-align: center; padding: 60px 20px; color: var(--ink-soft); font-weight: 700;
}
.empty .big { font-size: 48px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
footer { text-align: center; color: var(--ink-soft); font-size: 13px; font-weight: 700; padding: 36px 0 44px; }

/* activities banner on the library page */
.ws-banner { margin: 32px 0 8px; }
.ws-banner-link {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper); border: var(--bd); border-radius: 24px;
  padding: 20px 24px; text-decoration: none; color: var(--ink);
  box-shadow: 6px 6px 0 var(--shade);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.ws-banner-link:hover { transform: translateY(-3px); box-shadow: 8px 9px 0 var(--shade); }
.ws-banner-link:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shade); }
.ws-banner-icon {
  font-size: 32px; width: 56px; height: 56px; border-radius: 16px;
  background: var(--accent); display: grid; place-items: center; color: #fff;
  border: var(--bd); box-shadow: 3px 3px 0 oklch(0.55 0.2 25); flex-shrink: 0;
}
.ws-banner-text { flex: 1; font-size: 17px; font-weight: 700; }
.ws-banner-text b { font-family: 'Baloo 2', sans-serif; font-size: 20px; }
.ws-banner-arrow { font-size: 26px; font-weight: 800; color: var(--ink-soft); }

/* ---------------------------------------------------------- learning path */
.learning-page { max-width: 900px; }
.learning-hero, .learning-concepts {
  background: var(--paper); border: var(--bd); border-radius: 26px; padding: 26px;
  box-shadow: 7px 7px 0 var(--shade); margin: 18px 0 24px;
}
.learning-kicker { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.learning-hero h1 { font-family: 'Baloo 2', sans-serif; font-size: clamp(32px, 7vw, 58px); margin: 4px 0; }
.learning-hero p { color: var(--ink-soft); font-size: 18px; font-weight: 700; }
.learning-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.learning-actions button, .learning-stage, .learning-concept {
  min-height: 58px; border: var(--bd); border-radius: 18px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer; padding: 12px 18px; box-shadow: 3px 3px 0 var(--shade);
}
.learning-primary { background: var(--accent) !important; color: #fff !important; }
.learning-actions button:active, .learning-stage:active, .learning-concept:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.learning-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.learning-stage { display: grid; gap: 4px; place-items: center; text-align: center; font-size: 14px; }
.learning-stage-icon { font-size: 28px; }
.learning-concepts h2 { font-family: 'Baloo 2', sans-serif; margin: 0 0 14px; }
.learning-concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.learning-concept { display: grid; gap: 2px; justify-items: start; text-align: left; }
.learning-concept.current { background: var(--accent-soft); border-color: var(--accent); }
.learning-concept-mark { font-family: 'Baloo 2', sans-serif; font-size: 30px; color: var(--accent); }
.learning-concept small { color: var(--ink-soft); }
@media (max-width: 680px) { .learning-stages { grid-template-columns: repeat(2, 1fr); } .learning-hero, .learning-concepts { padding: 20px; } }
.learning-session { margin-top: 24px; }
.learning-session h2 { font-family: 'Baloo 2', sans-serif; font-size: 20px; margin: 0 0 10px; }
.learning-blocks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.learning-block { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.learning-block-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.learning-block-label { flex: 1; font-weight: 600; font-size: 15px; }
.learning-block-dur { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 540px) {
  .topbar { justify-content: center; }
  .topbar a.plain { display: none; }
  .sentence { font-size: clamp(28px, 8vw, 40px); }
  .reader-title { font-size: 22px; }
  .brand { font-size: 21px; }
  .book { box-shadow: 5px 5px 0 var(--cover-soft, var(--shade)); }
  .page-card { box-shadow: 7px 8px 0 var(--shade); }
  .bd-sun { width: 150px; height: 150px; top: -50px; right: -50px; }
}

/* ================================================================ worksheets */
.ws-section { margin-bottom: 36px; }
.ws-section-title {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 26px;
  margin: 0 0 4px; letter-spacing: 0.2px;
}
.ws-section-sub { color: var(--ink-soft); font-weight: 700; font-size: 15px; margin: 0 0 18px; }

.ws-letter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px;
}
.ws-letter-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--paper); border: var(--bd); border-radius: 18px;
  padding: 14px 8px 10px; text-decoration: none; color: var(--ink);
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 30px;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.ws-letter-chip span {
  font-family: 'Andika', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--ink-soft);
}
.ws-letter-chip:hover { transform: translateY(-3px); box-shadow: 5px 7px 0 var(--shade); }
.ws-letter-chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.ws-letter-chip.empty { opacity: 0.5; border-style: dashed; box-shadow: none; }
.ws-letter-chip.empty:hover { transform: none; }

.ws-act-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
}
.ws-act-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: var(--bd); border-radius: 20px;
  padding: 16px 18px; min-height: 64px; text-decoration: none; color: var(--ink);
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.ws-act-card:hover { transform: translateY(-3px); box-shadow: 5px 7px 0 var(--shade); }
.ws-act-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.ws-act-icon { font-size: 28px; flex-shrink: 0; }
.ws-act-label { font-weight: 700; font-size: 16px; }
.ws-act-count { font-size: 12px; color: var(--ink-soft); font-weight: 700; margin-left: auto; }

.ws-sight-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.ws-sight-chip {
  background: var(--paper); border: var(--bd); border-radius: 999px;
  padding: 10px 20px; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 18px;
  box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}
.ws-sight-chip:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 var(--shade); }

/* player layout */
.ws-play { max-width: 720px; margin: 0 auto; }
.ws-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 8px;
}
.ws-title {
  font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: clamp(22px, 4vw, 30px); flex: 1; text-align: center; margin: 0;
}
.ws-score {
  font-weight: 800; font-size: 18px; color: var(--ink-soft);
  background: var(--paper); border: 2.5px solid var(--ink-soft);
  border-radius: 999px; padding: 6px 16px; min-width: 64px; text-align: center;
}
.ws-prompt {
  text-align: center; color: var(--ink-soft); font-weight: 700;
  font-size: 17px; margin: 4px 0 20px;
}
.ws-area {
  background: var(--paper); border: var(--bd); border-radius: 28px;
  box-shadow: 8px 10px 0 var(--shade);
  padding: 28px 22px; min-height: 320px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.ws-feedback {
  text-align: center; font-weight: 800; font-size: 22px; min-height: 36px;
  margin-top: 12px; transition: opacity 0.3s ease;
  font-family: 'Baloo 2', sans-serif;
}
.ws-feedback.ok { color: var(--grass); }
.ws-feedback.ok::before { content: '✓ '; }
.ws-feedback.no { color: var(--accent); }
.ws-feedback.no::before { content: '✗ '; }

/* buckets (sound sort, word family sort) */
.ws-buckets { display: flex; gap: 18px; justify-content: center; width: 100%; }
.ws-bucket {
  flex: 1; max-width: 240px; min-height: 120px;
  background: oklch(0.96 0.04 235); border: var(--bd); border-radius: 22px;
  padding: 12px; cursor: pointer; text-align: center;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
  box-shadow: 4px 4px 0 var(--shade);
}
.ws-bucket:hover { transform: translateY(-2px); box-shadow: 5px 6px 0 var(--shade); }
.ws-bucket:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.ws-bucket-label {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 34px;
  color: var(--accent); margin-bottom: 8px;
}
.ws-bucket-drop { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ws-bucket-tag {
  background: var(--grass); color: #fff; font-weight: 700; font-size: 15px;
  border-radius: 12px; padding: 4px 12px; border: 2px solid var(--ink);
  animation: shelf-pop 0.3s var(--ease-out) both;
}

/* chips (shared word buttons) */
.ws-chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ws-chip {
  font-family: 'Andika', sans-serif; font-size: 24px; font-weight: 700;
  padding: 12px 22px; border-radius: 18px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer; min-height: var(--tap);
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.ws-chip:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--shade); }
.ws-chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.ws-chip.sel { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-3px); box-shadow: 5px 7px 0 oklch(0.6 0.18 25); }
.ws-chip.done { background: var(--grass); color: #fff; pointer-events: none; box-shadow: 4px 4px 0 oklch(0.55 0.14 150); }
.ws-chip.right { background: var(--grass); color: #fff; box-shadow: 4px 4px 0 oklch(0.55 0.14 150); }
.ws-chip.wrong { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; }

/* sound buttons (CVC builder) */
.ws-sounds { display: flex; gap: 14px; justify-content: center; }
.ws-sound-btn {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 40px;
  width: 80px; height: 80px; border-radius: 50%; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.ws-sound-btn:hover { transform: scale(1.08); }
.ws-sound-btn:active { transform: scale(0.95); box-shadow: 1px 1px 0 var(--shade); }
.ws-sound-btn.on { background: var(--sun); border-color: var(--ink); transform: scale(1.1); }

.ws-blend {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 24px;
  padding: 14px 36px; border-radius: 999px; color: #fff;
  background: var(--accent); cursor: pointer;
  border: var(--bd); box-shadow: 4px 4px 0 oklch(0.55 0.2 25);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}
.ws-blend:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 5px 6px 0 oklch(0.55 0.2 25); }
.ws-blend:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 oklch(0.55 0.2 25); }
.ws-blend:disabled { opacity: 0.4; cursor: default; }

.ws-built-word {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 52px;
  color: var(--accent); animation: game-pop 0.4s var(--ease-out) both;
}

.ws-onsets { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ws-rime-tile {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 28px;
  background: var(--accent-soft); border: var(--bd); border-radius: 16px;
  padding: 10px 18px; color: var(--accent);
}
.ws-onset-tile {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 28px;
  width: 56px; height: 56px; border-radius: 16px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer;
  border: var(--bd); box-shadow: 3px 3px 0 var(--shade);
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease-out), background 0.15s ease;
}
.ws-onset-tile:hover { transform: scale(1.08); }
.ws-onset-tile.on { background: var(--sun); }

/* missing letter */
.ws-word-display {
  display: flex; gap: 8px; font-family: 'Baloo 2', sans-serif;
  font-weight: 800; font-size: 56px; letter-spacing: 6px;
}
.ws-blank {
  display: inline-grid; place-items: center;
  width: 64px; height: 72px; border-bottom: 5px solid var(--accent);
  color: var(--accent);
}
.ws-blank.filled { border-bottom-color: var(--grass); color: var(--grass); animation: game-pop 0.3s var(--ease-out) both; }
.ws-choices { display: flex; gap: 14px; justify-content: center; }
.ws-choice {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 36px;
  width: 72px; height: 72px; border-radius: 20px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.ws-choice:hover { transform: scale(1.06); }
.ws-choice:active { transform: scale(0.95); box-shadow: 1px 1px 0 var(--shade); }
.ws-choice.right { background: var(--grass); color: #fff; box-shadow: 4px 4px 0 oklch(0.55 0.14 150); }
.ws-choice.wrong { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; }

/* picture match */
.ws-pics { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.ws-pic-card {
  width: 130px; height: 160px; border-radius: 20px; overflow: hidden;
  background: oklch(0.96 0.045 90); border: var(--bd); cursor: pointer;
  box-shadow: 4px 4px 0 var(--shade); position: relative;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.ws-pic-card:hover { transform: translateY(-3px); box-shadow: 5px 7px 0 var(--shade); }
.ws-pic-card svg { width: 100%; height: 100%; display: block; }
.ws-pic-card.sel { border-color: var(--accent); box-shadow: 4px 4px 0 oklch(0.6 0.18 25); transform: translateY(-3px); }
.ws-pic-card.done { border-color: var(--grass); opacity: 0.85; pointer-events: none; }
.ws-pic-card.done::after {
  content: '✓'; position: absolute; top: 6px; right: 10px;
  color: var(--grass); font-weight: 800; font-size: 26px; text-shadow: 0 1px 0 #fff;
}

/* rhyme grid */
.ws-rhyme-grid { max-width: 420px; }

/* sight word */
.ws-big-word {
  font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: clamp(56px, 12vw, 88px); color: var(--accent);
  cursor: pointer; letter-spacing: 4px;
  transition: transform 0.15s var(--ease-out);
}
.ws-big-word:hover { transform: scale(1.05); }
.ws-find-prompt { font-weight: 800; font-size: 20px; color: var(--ink-soft); margin: 8px 0 0; }
.ws-sight-grid { max-width: 480px; }

/* letter tiles (hear & build) */
.ws-tiles { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ws-tile {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 36px;
  width: 72px; height: 72px; border-radius: 20px; color: var(--ink);
  background: oklch(0.96 0.045 90); cursor: pointer;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.15s ease;
}
.ws-tile:hover { transform: scale(1.08); }
.ws-tile:active { transform: scale(0.95); box-shadow: 1px 1px 0 var(--shade); }
.ws-tile.used { background: var(--grass); color: #fff; pointer-events: none; box-shadow: 3px 3px 0 oklch(0.55 0.14 150); }
.ws-tile.wrong { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; }

/* sound swap */
.ws-swap-word {
  display: flex; font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: 64px; letter-spacing: 4px;
}
.ws-swap-onset { color: var(--accent); transition: color 0.3s ease; }
.ws-swap-onset.new { color: var(--grass); animation: game-pop 0.4s var(--ease-out) both; }
.ws-swap-instr { font-weight: 800; font-size: 19px; color: var(--ink-soft); margin: 4px 0 0; text-align: center; }

/* sight sentence */
.ws-sentence {
  font-family: 'Andika', sans-serif; font-weight: 700;
  font-size: clamp(26px, 5vw, 36px); text-align: center; line-height: 1.5;
}
.ws-sentence-blank {
  display: inline-grid; place-items: center; min-width: 80px;
  border-bottom: 4px solid var(--accent); color: var(--accent);
  font-family: 'Baloo 2', sans-serif; font-weight: 800; padding: 0 8px;
}
.ws-sentence-blank.filled { border-bottom-color: var(--grass); color: var(--grass); animation: game-pop 0.3s var(--ease-out) both; }

/* sound hunt */
.ws-hunt-letter {
  font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: clamp(64px, 14vw, 96px); color: var(--accent);
  cursor: pointer; line-height: 1;
  transition: transform 0.15s var(--ease-out);
}
.ws-hunt-letter:hover { transform: scale(1.08); }
.ws-chip.miss { background: var(--accent-soft); color: var(--accent); animation: shake 0.4s ease; opacity: 0.5; }

/* word ladder */
.ws-ladder { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.ws-ladder-trail { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ws-ladder-tag {
  font-family: 'Andika', sans-serif; font-weight: 700; font-size: 18px;
  background: oklch(0.94 0.04 147); border: 2px solid var(--ink);
  border-radius: 12px; padding: 4px 14px; color: var(--ink);
}
.ws-ladder-tag.current { background: var(--sun); font-weight: 800; }

/* worksheet focus rings */
.ws-chip:focus-visible, .ws-bucket:focus-visible, .ws-sound-btn:focus-visible,
.ws-choice:focus-visible, .ws-pic-card:focus-visible, .ws-onset-tile:focus-visible,
.ws-letter-chip:focus-visible, .ws-act-card:focus-visible, .ws-sight-chip:focus-visible,
.ws-tile:focus-visible, .ws-hunt-letter:focus-visible {
  outline: 4px solid var(--accent); outline-offset: 2px;
}

@media (max-width: 540px) {
  .ws-letter-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
  .ws-letter-chip { font-size: 24px; padding: 10px 6px 8px; }
  .ws-act-grid { grid-template-columns: 1fr; }
  .ws-sound-btn { width: 64px; height: 64px; font-size: 32px; }
  .ws-word-display { font-size: 42px; }
  .ws-blank { width: 52px; height: 58px; }
  .ws-choice { width: 60px; height: 60px; font-size: 30px; }
  .ws-pic-card { width: 100px; height: 130px; }
  .ws-area { padding: 20px 14px; }
  .ws-buckets { flex-direction: column; align-items: center; }
  .ws-bucket { max-width: 100%; width: 100%; }
  .ws-tile { width: 60px; height: 60px; font-size: 30px; }
  .ws-swap-word { font-size: 48px; }
  .ws-sentence { font-size: 24px; }
  .ws-hunt-letter { font-size: 64px; }
}

/* ------------------------------------------------- gesture unlock (Phase 1) */
.ws-unlock {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 70%);
}
.ws-unlock[hidden] { display: none; }
.ws-unlock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--paper); border: var(--bd); border-radius: 28px;
  padding: 48px 64px; cursor: pointer;
  box-shadow: 8px 10px 0 var(--shade);
  animation: unlock-pulse 2s ease-in-out infinite;
  font-family: 'Baloo 2', sans-serif;
}
.ws-unlock-btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--shade); }
.ws-unlock-icon { font-size: 64px; }
.ws-unlock-text { font-size: 28px; font-weight: 800; color: var(--ink); }
@keyframes unlock-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ------------------------------------------------- replay button (Phase 1) */
.ws-replay {
  position: fixed; top: 16px; right: 16px; z-index: 90;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--paper); border: var(--bd);
  font-size: 32px; cursor: pointer;
  box-shadow: 4px 5px 0 var(--shade);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease-out);
}
.ws-replay:hover { transform: scale(1.1); }
.ws-replay:active { transform: scale(0.95); box-shadow: 1px 1px 0 var(--shade); }

/* ------------------------------------------------- speaking lockout (Phase 1) */
.ws-area.locked { pointer-events: none; opacity: 0.7; }

/* ------------------------------------------------- idle demo pulse (Phase 1) */
@keyframes demo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.7 0.16 55 / 0.6); }
  50% { box-shadow: 0 0 0 12px oklch(0.7 0.16 55 / 0); }
}
.ws-demo-target { animation: demo-pulse 1s ease-in-out 3; }

/* ------------------------------------------------- bottom bar (Phase 7) */
.ws-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: center; gap: 0;
  background: var(--paper); border-top: var(--bd);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 16px oklch(0.2 0.02 245 / 0.12);
}
.ws-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 32px 8px; text-decoration: none; color: var(--ink-soft);
  font-weight: 700; font-size: 12px; min-width: 80px;
  transition: color 0.15s ease;
}
.ws-nav-btn:hover { color: var(--ink); }
.ws-nav-icon { font-size: 26px; line-height: 1; }
.ws-nav-label { font-size: 12px; }
.ws-nav-active { color: var(--accent); }
.ws-nav-active .ws-nav-label { font-weight: 800; }

/* ------------------------------------------------- picture hub (Phase 7) */
.ws-letter-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--paper); border: var(--bd); border-radius: 18px;
  padding: 12px 8px 10px; cursor: pointer; color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
  min-height: 64px;
}
.ws-letter-tile:hover { transform: translateY(-3px); box-shadow: 5px 7px 0 var(--shade); }
.ws-letter-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.ws-letter-tile.empty { opacity: 0.4; border-style: dashed; box-shadow: none; pointer-events: none; }
.ws-letter-big { font-weight: 800; font-size: 30px; line-height: 1; }
.ws-letter-pic { width: 64px; height: 64px; display: block; }
.ws-letter-pic svg { width: 100%; height: 100%; }

.ws-letter-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.ws-letter-hero {
  font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: clamp(64px, 14vw, 96px); color: var(--accent); line-height: 1;
}
.ws-letter-hero-pics { display: flex; gap: 12px; }
.ws-hero-pic {
  width: 80px; height: 80px; border-radius: 18px; overflow: hidden;
  background: oklch(0.96 0.045 90); border: var(--bd); cursor: pointer;
  box-shadow: 3px 3px 0 var(--shade); padding: 6px;
  transition: transform 0.15s var(--ease-out);
}
.ws-hero-pic:hover { transform: scale(1.08); }
.ws-hero-pic:active { transform: scale(0.95); }
.ws-hero-pic svg { width: 100%; height: 100%; }

/* body padding so content isn't hidden behind bottom bar */
body { padding-bottom: 72px; }

/* ------------------------------------------------- colorblind-safe feedback (Phase 8) */
.ws-chip.right::after, .ws-choice.right::after, .ws-tile.used::after {
  content: '✓'; position: absolute; top: 2px; right: 6px;
  font-size: 16px; font-weight: 800; color: #fff;
}
.ws-chip.right, .ws-choice.right, .ws-tile.used { position: relative; }
.ws-chip.wrong::after, .ws-choice.wrong::after, .ws-tile.wrong::after {
  content: '✗'; position: absolute; top: 2px; right: 6px;
  font-size: 16px; font-weight: 800; color: var(--accent);
}
.ws-chip.wrong, .ws-choice.wrong, .ws-tile.wrong { position: relative; }

/* ------------------------------------------------- prefers-reduced-motion (Phase 8) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bd-sun, .bd-cloud { animation: none !important; }
}

/* ------------------------------------------------- target size audit (Phase 8) */
.ws-chip, .ws-choice, .ws-tile, .ws-sound-btn, .ws-onset-tile,
.ws-blend, .ws-nav-btn, .ws-letter-tile, .ws-pic-card, .ws-hero-pic {
  min-height: var(--tap);
}
.ws-chips, .ws-choices, .ws-tiles, .ws-sounds, .ws-onsets {
  gap: max(12px, 3vw);
}

/* ------------------------------------------------- Elkonin sound boxes (Phase 4) */
.ws-elkonin { display: flex; gap: 10px; justify-content: center; }
.ws-elkonin-box {
  width: 72px; height: 72px; border-radius: 16px;
  border: var(--bd); background: oklch(0.96 0.045 90);
  display: grid; place-items: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 36px;
  color: var(--ink); box-shadow: 3px 3px 0 var(--shade);
  transition: background 0.2s ease, transform 0.15s var(--ease-out);
}
.ws-elkonin-box.filled {
  background: var(--sun); transform: scale(1.08);
  animation: game-pop 0.3s var(--ease-out) both;
}

/* ------------------------------------------------- item picture (Phase 4) */
.ws-item-pic {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s var(--ease-out);
}
.ws-item-pic:hover { transform: scale(1.08); }
.ws-item-pic svg { width: 100%; height: 100%; }
.ws-item-pic.ws-bounce { animation: game-pop 0.3s var(--ease-out) both; }

/* ------------------------------------------------- bucket anchor picture (Phase 4) */
.ws-bucket-pic { width: 56px; height: 56px; margin: 0 auto 6px; }
.ws-bucket-pic svg { width: 100%; height: 100%; }

/* ------------------------------------------------- picture fallback (Phase 4) */
.ws-pic-fallback {
  font-family: 'Andika', sans-serif; font-weight: 700; font-size: 18px;
  color: var(--ink-soft); display: grid; place-items: center; height: 100%;
}

/* ------------------------------------------------- hunt scene (Phase 4) */
.ws-hunt-scene {
  width: 100%; max-width: 640px; border-radius: 20px; overflow: hidden;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
}
.ws-hunt-scene svg { width: 100%; height: auto; display: block; }
.ws-found { opacity: 0.5; pointer-events: none; }
.ws-miss { animation: shake 0.4s ease; }

/* ------------------------------------------------- syllable clap (Phase 4) */
.ws-clap-dots { display: flex; gap: 14px; justify-content: center; }
.ws-clap-dot {
  width: 40px; height: 40px; border-radius: 50%;
  border: var(--bd); background: oklch(0.96 0.045 90);
  box-shadow: 3px 3px 0 var(--shade);
  transition: background 0.2s ease, transform 0.15s var(--ease-out);
}
.ws-clap-dot.on { background: var(--sun); transform: scale(1.2); }
.ws-clap-pic { width: 140px; height: 140px; }

/* ------------------------------------------------- Phase 1: never-stuck engine */
@keyframes fall3 { to { transform: translateY(110vh) rotate(720deg); opacity: 0.8; } }

@keyframes ws-pulse-kf {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}
.ws-pulse { animation: ws-pulse-kf 0.7s ease-in-out infinite; }

.ws-pic-card, .ws-chip, .ws-bucket { touch-action: none; }

.ws-undo {
  position: fixed; bottom: 20px; right: 20px;
  width: 60px; height: 60px; border-radius: 50%;
  border: var(--bd); background: var(--paper);
  font-size: 26px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--shade);
  z-index: 100; display: grid; place-items: center;
  transition: transform 0.15s var(--ease-out);
}
.ws-undo:active { transform: scale(0.92); }

/* ------------------------------------------------- Phase 4: I-Spy */
.ws-ispy-scene {
  width: 100%; max-width: 640px; margin: 0 auto;
  border-radius: 20px; overflow: hidden;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
  background: oklch(0.97 0.02 147);
  padding: 16px;
}
.ws-ispy-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.ws-ispy-pic {
  width: 90px; height: 90px; cursor: pointer;
  border-radius: 14px; border: 2.5px solid var(--ink);
  background: var(--paper); padding: 6px;
  box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), opacity 0.2s;
}
.ws-ispy-pic svg { width: 100%; height: 100%; }
.ws-ispy-pic.done { opacity: 0.4; pointer-events: none; border-color: var(--grass); }
.ws-ispy-pic.ws-miss { animation: shake 0.4s ease; }

/* ------------------------------------------------- Phase 4: Blend Slider */
.ws-blend-track {
  display: flex; gap: 0; justify-content: center; margin: 20px auto;
  max-width: 400px; border-radius: 16px; overflow: hidden;
  border: var(--bd); box-shadow: 4px 4px 0 var(--shade);
}
.ws-blend-zone {
  flex: 1; min-width: 80px; min-height: 80px;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 700; font-family: 'Baloo 2', sans-serif;
  background: oklch(0.96 0.04 255);
  border-right: 2px solid var(--ink);
  cursor: pointer; touch-action: none;
  transition: background 0.2s, transform 0.15s;
  user-select: none;
}
.ws-blend-zone:last-child { border-right: none; }
.ws-blend-zone.on { background: var(--sun); transform: scale(1.05); }
.ws-blend-hint {
  text-align: center; font-size: 18px; color: var(--ink-soft);
  margin-top: 8px; animation: ws-pulse-kf 1.5s ease-in-out infinite;
}

/* ------------------------------------------------- Phase 4: Letter Trace */
.ws-trace-wrap {
  width: 240px; height: 310px; margin: 12px auto;
  border-radius: 20px; border: var(--bd);
  box-shadow: 4px 4px 0 var(--shade);
  background: var(--paper);
  touch-action: none; cursor: crosshair;
  overflow: hidden;
}
.ws-trace-svg { width: 100%; height: 100%; }

/* ------------------------------------------------- Phase 4: Sticker Sort */
.ws-stickers {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin: 16px 0;
}
.ws-sticker {
  width: 90px; height: 90px; cursor: grab;
  border-radius: 14px; border: 3px dashed var(--ink);
  background: oklch(0.98 0.02 90); padding: 8px;
  box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.15s var(--ease-out), border-color 0.2s;
  touch-action: none;
}
.ws-sticker svg { width: 100%; height: 100%; }
.ws-sticker.sel { border-color: var(--accent); border-style: solid; transform: scale(1.08); }
.ws-sticker.done { opacity: 0.35; pointer-events: none; border-color: var(--grass); }
.ws-sticker-bucket { min-height: 120px; }

/* ------------------------------------------------- Phase 4: Picture Sentence */
.ws-sentence-blank {
  display: inline-block; min-width: 60px; text-align: center;
  border-bottom: 3px solid var(--accent); color: var(--accent);
  font-weight: 700;
}
.ws-sentence-blank.filled { border-bottom-color: var(--grass); color: var(--ink); }

/* ------------------------------------------------- Phase 4: Rhyme Jukebox */
.ws-jukebox-grid { gap: 14px; }
.ws-jukebox-grid .ws-pic-card.done {
  border-color: var(--sun); background: oklch(0.96 0.06 90);
}

/* ------------------------------------------------- Phase 4: Sound Maze */
.ws-maze-path { text-align: center; }
.ws-maze-trail {
  display: flex; gap: 10px; justify-content: center; margin: 16px 0;
}
.ws-maze-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: oklch(0.94 0.02 255);
}
.ws-maze-dot.done { background: var(--grass); border-color: var(--grass); }
.ws-maze-dot.current { background: var(--sun); border-color: var(--accent); transform: scale(1.3); }

/* ------------------------------------------------- Phase 4: Counting */
.ws-count-grid {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 16px auto; max-width: 400px;
}
.ws-count-item {
  width: 72px; height: 72px; border-radius: 12px;
  border: 2.5px solid var(--ink); background: var(--paper);
  padding: 6px; box-shadow: 2px 2px 0 var(--shade);
}
.ws-count-item svg { width: 100%; height: 100%; }
.ws-count-choice { min-width: 64px; font-size: 28px; }

/* ------------------------------------------------- Phase 4: Picture Morph */
.ws-morph-pic { transition: transform 0.4s var(--ease-out), opacity 0.3s; }
.ws-morph-word {
  font-size: 32px; font-weight: 700; font-family: 'Baloo 2', sans-serif;
  text-align: center; margin: 12px 0;
}
.ws-morph-onset { color: var(--accent); }
.ws-morph-onset.new { animation: ws-pulse-kf 0.5s ease; }

/* ------------------------------------------------- Phase 4: Say-It */
.ws-mic-btn { font-size: 22px; padding: 14px 28px; }

/* ------------------------------------------------- Phase 5: Age Picker */
.ws-age-picker { text-align: center; padding: 40px 20px; }
.ws-age-title {
  font-family: 'Baloo 2', sans-serif; font-size: 32px;
  color: var(--ink); margin-bottom: 32px;
}
.ws-cakes {
  display: flex; gap: 24px; justify-content: center; align-items: flex-end;
  flex-wrap: wrap;
}
.ws-cake {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 20px; border: var(--bd);
  background: var(--paper); cursor: pointer;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
  padding: 12px;
}
.ws-cake:hover, .ws-cake:active {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 6px 8px 0 var(--shade-deep);
}
.ws-cake-emoji { font-size: 48px; line-height: 1; }
.ws-cake-candles { font-size: 18px; margin-top: 4px; letter-spacing: 2px; }

/* ------------------------------------------------- Phase 6: Today's Path */
.ws-today-path { text-align: center; padding: 32px 20px; }
.ws-sticker-count {
  font-size: 24px; font-weight: 700; color: var(--sun);
  margin-bottom: 16px; text-shadow: 1px 1px 0 var(--ink);
}
.ws-path-title {
  font-family: 'Baloo 2', sans-serif; font-size: 28px;
  color: var(--ink); margin-bottom: 20px;
}
.ws-path-sub { color: var(--ink-soft); font-size: 16px; margin-top: 16px; }
.ws-play-big {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 200px; height: 200px; margin: 0 auto;
  border-radius: 50%; border: 5px solid var(--accent);
  background: linear-gradient(135deg, oklch(0.95 0.06 25), oklch(0.92 0.08 25));
  cursor: pointer; box-shadow: 6px 6px 0 var(--shade);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.ws-play-big:hover, .ws-play-big:active {
  transform: scale(1.06); box-shadow: 8px 8px 0 var(--shade-deep);
}
.ws-play-letter { font-size: 56px; font-weight: 800; font-family: 'Baloo 2', sans-serif; color: var(--accent); }
.ws-play-pic { width: 60px; height: 60px; }
.ws-play-pic svg { width: 100%; height: 100%; }
.ws-play-label { font-size: 22px; font-weight: 700; color: var(--ink); }
.ws-all-letters, .ws-back-today {
  margin-top: 24px; padding: 12px 24px;
  border-radius: 12px; border: var(--bd);
  background: var(--paper); font-size: 18px; font-weight: 600;
  cursor: pointer; box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.15s var(--ease-out);
}
.ws-all-letters:active, .ws-back-today:active { transform: scale(0.95); }

/* ------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ws-pulse, .ws-blend-hint { animation: none; }
  .ws-morph-pic { transition: none; }
  .ws-ispy-pic, .ws-sticker, .ws-blend-zone { transition: none; }
}

/* ------------------------------------------------- Phase 8: handedness mirroring */
[data-hand="left"] .ws-buckets { flex-direction: row-reverse; }
[data-hand="left"] .ws-nav-btn { flex-direction: row-reverse; }
[data-hand="left"] .ws-act-card { flex-direction: row-reverse; }
[data-hand="left"] .ws-replay { left: 20px; right: auto; }

/* ------------------------------------------------- Phase 8: standalone display */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 12px); }
  .ws-bottom-bar { padding-bottom: env(safe-area-inset-bottom, 8px); }
  body { overscroll-behavior: none; }
}

/* ------------------------------------------------- Phase 6: parent view */
.parent-page { max-width: 900px; }
.parent-gate, .parent-card, .parent-stat {
  background: var(--paper); border: var(--bd); border-radius: 18px;
  box-shadow: 6px 6px 0 var(--shade);
}
.parent-gate {
  max-width: 430px; margin: 9vh auto 0; padding: 30px 26px 26px;
  text-align: center; transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.parent-gate-open { opacity: 0; transform: scale(0.96); }
.parent-gate-lock {
  width: 74px; height: 74px; margin: 0 auto 10px; display: grid; place-items: center;
  font-size: 34px; background: var(--candy-5-soft); border: var(--bd); border-radius: 50%;
  box-shadow: 3px 3px 0 var(--shade); animation: gate-bob 3s ease-in-out infinite;
}
@keyframes gate-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.parent-gate h1 { font-family: 'Baloo 2', sans-serif; font-size: 34px; margin: 4px 0 6px; }
.parent-gate p { color: var(--ink-soft); font-weight: 700; margin: 0 0 18px; }
.parent-gate-hint { font-size: 13px; margin-top: 12px !important; }
.parent-hold {
  position: relative; overflow: hidden; width: 100%; min-height: 64px;
  border: var(--bd); border-radius: 14px; background: var(--candy-2-soft);
  font-family: 'Baloo 2', sans-serif; font-size: 20px; font-weight: 800; color: var(--ink);
  cursor: pointer; box-shadow: 4px 4px 0 var(--shade); touch-action: none;
  user-select: none; -webkit-user-select: none;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background 0.3s;
}
.parent-hold:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.parent-hold-fill {
  position: absolute; inset: 0; background: var(--candy-4);
  transform: scaleX(0); transform-origin: left center; pointer-events: none;
}
.parent-hold.holding .parent-hold-fill { transition: none; }
.parent-hold-label { position: relative; z-index: 1; }
.parent-hold.unlocked { background: var(--candy-4); color: #fff; cursor: default; }
.parent-dash { display: grid; gap: 18px; margin-top: 8px; }
@keyframes parent-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.parent-card { padding: 20px 20px 18px; animation: parent-rise 0.45s var(--ease-out) both; }
.parent-card:hover { box-shadow: 8px 8px 0 var(--shade); }
.parent-card h3 { font-family: 'Baloo 2', sans-serif; font-size: 22px; margin: 0; }
.parent-card h4 { font-family: 'Baloo 2', sans-serif; font-size: 17px; margin: 14px 0 6px; color: var(--ink-soft); }
.parent-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.parent-card-head small { color: var(--ink-soft); font-weight: 700; }
.parent-hero { padding: 24px 22px; background: linear-gradient(135deg, var(--paper) 55%, var(--accent-soft)); }
.parent-kicker { margin: 0 0 2px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.parent-hero h2 { font-family: 'Baloo 2', sans-serif; font-size: clamp(28px, 6vw, 42px); margin: 0; }
.parent-next { margin: 8px 0 0; font-size: 17px; font-weight: 700; color: var(--ink-soft); }
.parent-next b { color: var(--ink); }
.parent-next-mark {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px;
  margin-left: 6px; border: var(--bd); border-radius: 10px; background: var(--sun);
  font-family: 'Baloo 2', sans-serif; font-size: 18px; box-shadow: 2px 2px 0 var(--shade);
}
.parent-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.parent-stat {
  display: grid; gap: 2px; padding: 16px 14px 14px; text-align: center;
  animation: parent-rise 0.45s var(--ease-out) both; animation-delay: 40ms;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.parent-stat:hover { transform: translateY(-3px); box-shadow: 8px 8px 0 var(--shade); }
.parent-stat-icon { font-size: 26px; }
.parent-stat-big { font-family: 'Baloo 2', sans-serif; font-size: 34px; line-height: 1; }
.parent-stat-big small { font-size: 18px; color: var(--ink-soft); }
.parent-stat-small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.parent-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.parent-status {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  border: 2px solid var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap;
}
.parent-status.can { background: var(--candy-4-soft); color: oklch(0.42 0.11 150); }
.parent-status.practising { background: var(--candy-5-soft); color: oklch(0.45 0.1 70); }
.parent-status.support { background: var(--accent-soft); color: var(--accent); }
.parent-stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.parent-stage-head small { color: var(--ink-soft); font-weight: 700; }
.parent-stage-icon {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  font-size: 26px; border: var(--bd); border-radius: 14px; background: var(--sky-2);
  box-shadow: 2px 2px 0 var(--shade);
}
.parent-counts { margin-left: auto; display: flex; gap: 6px; }
.parent-count {
  min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 800;
}
.parent-count.can { background: var(--candy-4-soft); }
.parent-count.practising { background: var(--candy-5-soft); }
.parent-count.support { background: var(--accent-soft); }
.parent-concepts {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}
.parent-concept {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px;
  padding: 10px 12px; border: 2px solid var(--shade-deep); border-radius: 12px; background: #fff;
  transition: transform 0.15s var(--ease-out), border-color 0.15s, box-shadow 0.15s var(--ease-out);
}
.parent-concept:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 3px 3px 0 var(--shade); }
.parent-concept.next { border-color: var(--accent); background: var(--accent-soft); }
.parent-concept-mark {
  grid-row: span 2; display: grid; place-items: center; min-width: 38px; height: 38px;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--sky-2);
  font-family: 'Baloo 2', sans-serif; font-size: 19px;
}
.parent-concept-label { font-weight: 700; font-size: 14px; line-height: 1.2; }
.parent-concept .parent-status { justify-self: start; font-size: 11px; padding: 2px 8px; }
.parent-meters { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.parent-meter { display: grid; grid-template-columns: minmax(110px, max-content) 1fr 44px; align-items: center; gap: 10px; }
.parent-meter-label { font-size: 14px; font-weight: 700; }
.parent-meter-track { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.parent-meter-fill { display: block; height: 100%; border-radius: 999px; animation: parent-grow 0.8s var(--ease-out) both; transform-origin: left; }
@keyframes parent-grow { from { transform: scaleX(0); } }
.parent-meter-fill.can { background: var(--candy-4); }
.parent-meter-fill.practising { background: var(--candy-5); }
.parent-meter-fill.support { background: var(--accent); }
.parent-meter-score { font-size: 13px; font-weight: 800; text-align: right; color: var(--ink-soft); }
.parent-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-weight: 600; }
.parent-profile-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.parent-profile-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.parent-profile-form input { padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; font-size: 16px; font-family: inherit; }
.parent-profile-form button { padding: 8px 20px; border: none; border-radius: 10px; font-size: 15px; font-weight: 800; cursor: pointer; }
.parent-profile-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.parent-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 6px 0 30px; }
footer .parent-foot-link, .foot-sep { color: var(--ink-soft); }
footer .parent-foot-link { font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color 0.15s; }
footer .parent-foot-link:hover { color: var(--accent); }
@media (max-width: 560px) {
  .parent-concepts { grid-template-columns: 1fr 1fr; }
  .parent-meter { grid-template-columns: 92px 1fr 40px; }
  .parent-counts { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .parent-gate-lock, .parent-card, .parent-stat, .parent-meter-fill { animation: none; }
  .parent-gate, .parent-card, .parent-stat, .parent-concept { transition: none; }
}
