:root {
  --bg: #fff8ee; --ink: #23201b; --muted: #6f675c; --card: #ffffff; --line: #eadfcd;
  --accent: #e2672b; --accent-ink: #fff; --yes: #2e9e5b; --no: #c4472f; --soft: #fdeedd;
  --kid: 'Andika', 'Comic Sans MS', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d1a16; --ink: #f4ede3; --muted: #b3a998; --card: #29251f; --line: #3d372e; --soft: #3a2a1d; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 17px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
h1, h2 { line-height: 1.15; }
h2 { font-size: 1.1rem; margin: 24px 0 10px; }
a { color: var(--accent); }
.small { font-size: .88rem; } .muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.circle, .circle-space { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 18px; flex: none; }
.circle-space { visibility: hidden; }
.hero { text-align: center; padding: 8px 0 4px; }
.hero h1 { font-family: var(--kid); font-size: clamp(1.9rem, 6vw, 2.6rem); margin: 0; }
.tagline { font-family: var(--kid); font-size: 1.3rem; color: var(--accent); margin: 4px 0 8px; font-weight: 700; }
.lede { color: var(--muted); max-width: 34em; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 16px 0; }
.card summary { font-weight: 700; cursor: pointer; }
.card ol { padding-left: 1.2em; margin: 10px 0 0; } .card li { margin: 8px 0; }
.switch { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.switch input { width: 22px; height: 22px; }

.kids { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 18px; font-weight: 600; min-height: 46px; }
.chip.on { border-color: var(--accent); background: var(--soft); }
.chip.add { border-style: dashed; color: var(--muted); }

.start { display: block; width: 100%; margin: 18px 0 0; padding: 16px; border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-size: 1.3rem; font-weight: 800; }
.start small { display: block; font-size: .85rem; font-weight: 500; opacity: .9; margin-top: 2px; }
.start.car { background: #2c5d8f; margin-top: 10px; }
.ghost { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 16px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.cell b { font-size: .75rem; color: var(--muted); font-weight: 600; }
.cell .lt { font-family: var(--kid); font-size: 1.5rem; line-height: 1; }
.cell.done { background: var(--soft); }
.cell.next { outline: 3px solid var(--accent); outline-offset: -1px; }
.cell i { position: absolute; top: 3px; right: 6px; font-style: normal; color: var(--yes); font-size: .8rem; font-weight: 800; }
.foot { text-align: center; margin-top: 24px; }

/* lesson */
.lt-head { text-align: center; display: flex; flex-direction: column; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.kidcard { background: var(--card); border: 2px solid var(--line); border-radius: 22px; min-height: 38vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 12px; text-align: center; user-select: none; -webkit-user-select: none; }
.big { font-family: var(--kid); font-size: clamp(7rem, 30vw, 11rem); line-height: 1; }
.ear { font-size: 6rem; }
.tag { color: var(--muted); margin-top: 12px; font-size: 1rem; }
.word { position: relative; display: flex; gap: .06em; font-family: var(--kid); font-size: clamp(4rem, 17vw, 7rem); line-height: 1.1; padding-bottom: 40px; touch-action: none; }
.word .u { position: relative; padding: 0 .04em; border-radius: 10px; transition: background .15s; }
.word .u.lit { background: var(--soft); }
.word .dot { position: absolute; left: 50%; bottom: -26px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--line); border: 2px solid var(--muted); }
.word .u.lit .dot { background: var(--accent); border-color: var(--accent); }
.word .arrow { position: absolute; left: 0; right: -10px; bottom: 6px; height: 3px; background: var(--muted); opacity: .5; }
.word .arrow::after { content: ''; position: absolute; right: -2px; top: -6px; border: 7px solid transparent; border-left: 11px solid var(--muted); }
.story { font-family: var(--kid); font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.5; margin: 4px 0; }
.story-all .story { font-size: clamp(1.5rem, 6vw, 2.2rem); }
.sw { border-radius: 8px; padding: 0 .1em; }
.sw.cur { background: var(--soft); outline: 3px solid var(--accent); }
.sw.read { color: var(--muted); }

.grownup { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.gu-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
#script p { margin: 8px 0; }
.you span, .they span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--accent); }
.they span { color: var(--yes); }
.they { padding-left: 12px; border-left: 3px solid var(--yes); }
.note { color: var(--muted); font-size: .92rem; }
.snd { letter-spacing: .03em; }
.heard { min-height: 1.2em; color: var(--muted); font-size: .92rem; margin: 6px 0; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btns .yes, .btns .no { flex: 1 1 140px; border: 0; border-radius: 16px; padding: 16px; font-size: 1.2rem; font-weight: 800; color: #fff; }
.btns .yes { background: var(--yes); } .btns .no { background: var(--no); }
.btns .ghost { flex: 1 1 100%; }
body.car .grownup #script { font-size: .9rem; opacity: .8; }

/* done */
.donebox { text-align: center; padding: 40px 0; display: flex; flex-direction: column; gap: 10px; }
.star { font-size: 5rem; }
.donebox h1 { font-family: var(--kid); margin: 0; }
.addform label { font-weight: 700; display: block; margin-bottom: 8px; }
.addform .row { display: flex; gap: 8px; flex-wrap: wrap; }
.addform input { flex: 1 1 160px; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.yesbtn { border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; padding: 12px 18px; }
