/* Layout: one slate chalkboard in a wooden frame, as in Tom's Chalkboard. Deliberately single-theme (a blackboard is always dark). No pictures: Alpha-Phonics keeps the eye on the letters. */
:root {
  --board: #26332d;
  --board-2: #2f3e37;
  --chalk: #eeece3;
  --chalk-dim: #a9b5ab;
  --yellow: #f3d77a;
  --pink: #f2a7b8;
  --blue: #9fcbe9;
  --green: #a9d9a1;
  --orange: #f5b47e;
  --wood: #8a6240;
  --wood-dark: #5e4129;
  --room: #1b2420;
  --font: "Andika", "Trebuchet MS", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { background: var(--room); color: var(--chalk); font-family: var(--font); font-size: 18px; line-height: 1.45; margin: 0; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); padding-block: max(20px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 780px; margin: 0 auto; }
.board {
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.05), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(255,255,255,.04), transparent 50%),
    var(--board);
  border: 14px solid var(--wood);
  border-bottom-width: 22px;
  border-bottom-color: var(--wood-dark);
  border-radius: 10px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4);
  padding: clamp(18px, 4vw, 36px);
  min-height: 520px;
  display: flex; flex-direction: column; gap: 22px;
}
@media (max-width: 520px) { .board { border-width: 8px; border-bottom-width: 14px; } body { font-size: 17px; } }
h1, h2 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--yellow); line-height: 1.1; }
h2 { font-size: 1.05rem; color: var(--chalk-dim); letter-spacing: .06em; text-transform: uppercase; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: none; color: var(--chalk-dim); text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; font-size: .95rem; }
.link:hover { color: var(--chalk); }
.meta { color: var(--chalk-dim); margin: 0; font-size: .95rem; }
section { display: flex; flex-direction: column; gap: 12px; }
.start { align-self: flex-start; background: var(--yellow); color: var(--board); border: none; font-weight: 700; font-size: 1.35rem; padding: 14px 30px; border-radius: 16px 12px 18px 10px; box-shadow: 0 4px 0 #b99a3d; }
.start:active { transform: translateY(3px); box-shadow: 0 1px 0 #b99a3d; }
.ghost { background: transparent; border: 2px solid rgba(238,236,227,.35); border-radius: 12px; padding: 10px 20px; font-weight: 700; }
.row-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.note { color: var(--chalk-dim); font-size: .88rem; margin: 0; }
.pick { font: inherit; font-size: .95rem; background: var(--board-2); color: var(--chalk); border: 2px solid rgba(238,236,227,.3); border-radius: 10px; padding: 6px 10px; max-width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.danger { color: var(--pink); border-color: rgba(242,167,184,.5); }
.danger-text { color: var(--pink); }

/* home */
.lesson-card { border: 2px dashed rgba(238,236,227,.28); border-radius: 16px 12px 18px 11px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.lesson-card .num { color: var(--chalk-dim); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.lesson-card .title { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 700; color: var(--chalk); line-height: 1.2; }
.preview { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 1.5rem; color: var(--chalk); }
.tally { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.tally svg { width: 46px; height: 40px; }
.tally line { stroke: var(--chalk); stroke-width: 3.2; stroke-linecap: round; }
.tally line.slash { stroke: var(--orange); }
.name-form { display: flex; flex-direction: column; gap: 8px; }
.name-form label { font-weight: 700; }
.name-input { width: 12em; font-size: 1.1rem; }

/* play */
.play-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticks { display: flex; gap: 6px; flex-wrap: wrap; }
.ticks span { width: 22px; height: 6px; border-radius: 3px; background: rgba(238,236,227,.15); }
.ticks span.done { background: var(--green); }
.ticks span.some { background: var(--orange); }
.ticks span.now { background: var(--yellow); }
.page-label { color: var(--chalk-dim); font-size: .9rem; }
.page { display: flex; flex-direction: column; align-items: center; gap: 18px; min-height: 330px; justify-content: center; text-align: center; }
.fam { display: inline-block; border: 3px solid var(--chalk); border-radius: 6px 4px 7px 4px; padding: 0 .35em; font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.fam.review { border-style: dashed; border-color: var(--blue); color: var(--blue); font-size: 1.15rem; padding: 2px 12px; }
.fam.tricky { border-style: dashed; border-color: var(--pink); color: var(--pink); font-size: 1.15rem; padding: 2px 12px; }
.col { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.col li { display: grid; grid-template-columns: 1.2em auto 1.2em; align-items: center; gap: 14px; font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.25; color: rgba(238,236,227,.45); }
.col li .w { text-align: left; }
.col li.now { color: var(--chalk); font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; }
.col li.now .arrow { color: var(--yellow); }
.col li.ok { color: rgba(169,217,161,.75); }
.col li.miss { color: rgba(242,167,184,.85); }
.col li .mark { font-size: .6em; text-align: center; }
.arrow { font-size: .6em; color: transparent; }
.syl { display: block; font-size: .5em; color: var(--chalk-dim); font-weight: 400; letter-spacing: .04em; }
.boxed { display: inline-block; border: 3px solid currentColor; border-radius: 6px 4px 7px 4px; padding: 0 .25em; }
.hl { color: var(--yellow); }
.pair { display: inline-flex; gap: .9em; }
.sentence { font-size: clamp(1.9rem, 7vw, 2.9rem); line-height: 1.45; max-width: 22ch; font-weight: 700; }
.sentence .tok { background: none; border: none; padding: 0 .04em; font: inherit; color: inherit; border-bottom: 4px solid transparent; border-radius: 0; cursor: pointer; }
.sentence .tok.flag { color: var(--pink); border-bottom-color: var(--pink); }
.sentence.done-s { color: var(--green); }
.mark-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.yes { background: var(--green); color: var(--board); border: none; font-weight: 700; font-size: 1.3rem; padding: 14px 28px; border-radius: 16px 12px 18px 10px; box-shadow: 0 4px 0 #6f9b68; min-width: 9em; }
.yes:active { transform: translateY(3px); box-shadow: 0 1px 0 #6f9b68; }
.helped { background: transparent; color: var(--pink); border: 3px solid rgba(242,167,184,.6); font-weight: 700; font-size: 1.15rem; padding: 11px 22px; border-radius: 16px 12px 18px 10px; }
.say { background: transparent; border: 2px solid rgba(159,203,233,.5); color: var(--blue); border-radius: 999px; padding: 8px 16px; display: inline-flex; gap: 8px; align-items: center; font-weight: 700; }
.say svg { width: 22px; height: 22px; }
.hint { color: var(--chalk-dim); font-size: .95rem; min-height: 1.4em; margin: 0; text-align: center; }
.grownup-tip { color: var(--chalk-dim); font-size: .85rem; text-align: center; margin: 0; }

/* done */
.done-words { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 1.6rem; }
.done-words .miss { color: var(--pink); }
.write { border: 2px dashed rgba(169,217,161,.5); border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.write h2 { color: var(--green); }
.write .words { font-size: 1.5rem; display: flex; gap: 22px; flex-wrap: wrap; }
.stars { display: flex; flex-wrap: wrap; gap: 8px; }
.stars svg { width: 40px; height: 40px; }
.cheer { margin: 0; font-size: 1.15rem; max-width: 34ch; }

/* grown-ups */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: transparent; border: 2px solid rgba(238,236,227,.25); border-radius: 12px 9px 13px 8px; padding: 4px 12px; font-size: 1.05rem; }
.chip.off { opacity: .4; text-decoration: line-through; }
.chip.irr { border-color: rgba(242,167,184,.55); color: var(--pink); }
.chip small { color: var(--chalk-dim); margin-left: 6px; }
.fam-row { display: grid; grid-template-columns: 4.5em 1fr; gap: 10px; align-items: start; }
.fam-row > strong { color: var(--chalk-dim); font-size: .95rem; padding-top: 6px; }
.seg { display: inline-flex; border: 2px solid rgba(238,236,227,.3); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: none; padding: 6px 14px; }
.seg button[aria-pressed="true"] { background: var(--chalk); color: var(--board); font-weight: 700; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(238,236,227,.12); padding-bottom: 4px; align-items: center; }
.list li > span:last-child { color: var(--chalk-dim); text-align: right; font-variant-numeric: tabular-nums; }
.tutor { border-left: 4px solid var(--yellow); padding: 4px 0 4px 14px; margin: 0; font-size: 1rem; }
.ready { color: var(--green); font-weight: 700; }
.code-input { width: 11em; letter-spacing: .08em; text-transform: uppercase; }
.sync-code { font-size: 1.5rem; letter-spacing: .12em; color: var(--yellow); font-variant-numeric: tabular-nums; user-select: all; }
.lesson-pick { width: 100%; }

/* paper practice */
@media screen { #print { display: none; } }
@media print {
  :root { --board: #ffffff; --chalk: #1d1d1d; --chalk-dim: #5c5c5c; --yellow: #1d1d1d; --room: #ffffff; color-scheme: light; }
  body { background: #fff; color: #1d1d1d; padding: 0; font-size: 15pt; }
  .wrap { display: none; }
  #print { display: block; font-family: var(--font); }
  .pp-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #1d1d1d; margin-bottom: 12pt; }
  .pp-head h1 { color: #1d1d1d; font-size: 22pt; }
  .pp-cols { display: flex; flex-wrap: wrap; gap: 18pt 36pt; margin-bottom: 18pt; }
  .pp-col { break-inside: avoid; display: flex; flex-direction: column; gap: 2pt; font-size: 26pt; }
  .pp-col .fam { font-size: 16pt; align-self: flex-start; margin-bottom: 4pt; border-color: #1d1d1d; }
  .pp-sent { font-size: 22pt; line-height: 1.6; margin: 0 0 18pt; padding-left: 1.2em; }
  .pp-dict { break-before: page; }
  .pp-dict ol { font-size: 16pt; line-height: 2.4; }
  .pp-line { display: inline-block; width: 160pt; border-bottom: 1px solid #1d1d1d; margin-left: 12pt; }
  .boxed { border-color: #1d1d1d; }
}
