:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #5d6874;
  --line: #e4dfd3;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --primary-soft: #e8efff;
  --good: #15803d;
  --good-soft: #e5f6ea;
  --oops: #b45309;
  --oops-soft: #fff4e0;
  --star: #f2a91c;
  --accent: #2563eb;
  --radius: 20px;
  --shadow: 0 1px 0 rgba(31, 41, 51, .05), 0 10px 30px rgba(31, 41, 51, .07);
  /* Sassoon is used when it's installed on the device, or when a licensed web-font file
     is set in words.js (fontFile). Otherwise Andika, a free font also made for early readers. */
  --font: "Sassoon Web", "Sassoon Primary", "Sassoon Primary Std", "SassoonPrimary", "Sassoon Infant",
    "Sassoon Infant Std", "SassoonInfant", "Andika", "Century Gothic", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
}

a { color: var(--primary); }

h1, h2 { line-height: 1.2; margin: 0 0 .4em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 6px; flex-shrink: 0; }
.navlink {
  font: inherit; font-size: .95rem; color: var(--ink); text-decoration: none;
  background: none; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.navlink:hover { background: var(--primary-soft); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }

/* ---------- Buttons ---------- */

.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px;
  border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: #fbfaf6; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .navlink:focus-visible, .list-card:focus-visible, .answer:focus-visible {
  outline: 4px solid #93b4ff; outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { font-size: 1.3rem; min-height: 64px; padding: 12px 36px; }

.row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }

/* ---------- Home ---------- */

.hero { text-align: center; padding: 16px 0 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
.lead { font-size: 1.25rem; color: var(--muted); margin: 0 0 20px; letter-spacing: .02em; }
.steps {
  list-style: none; padding: 0; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 760px;
}
.steps li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 8px; font-size: 1rem; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.step-icon { font-size: 1.8rem; }

.stage { margin-top: 40px; }
.stage h2 {
  font-size: 1.35rem; display: flex; align-items: center; gap: 10px;
}
.stage h2::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.list-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--accent);
  border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.list-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 41, 51, .12); }
.lc-example { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.lc-title { font-weight: 700; }
.lc-count { font-size: .9rem; color: var(--muted); }

/* ---------- Panels ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px clamp(16px, 4vw, 40px) 32px;
  max-width: 760px; margin: 0 auto;
}
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-weight: 700; }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0 0 4px; }
.start { text-align: center; }
.start .back { display: block; text-align: left; }
.start h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.tip {
  background: var(--primary-soft); border-radius: 14px; padding: 12px 16px;
  font-size: 1.1rem; max-width: 560px; margin: 12px auto;
}
.meta { color: var(--muted); }
.warn { color: var(--oops); font-weight: 700; }
.pupil { margin: 4px auto 16px; max-width: 360px; }
.pupil p { margin: 0; }
.pupil-field { text-align: left; font-size: 1.1rem; }
.pupil-field input { font-size: 1.4rem; text-align: center; }
.linklike { font: inherit; color: var(--primary); background: none; border: 0; padding: 4px; cursor: pointer; text-decoration: underline; }
.sent { color: var(--good); font-weight: 700; margin: 4px 0 0; }
.teacher { margin-top: 28px; text-align: left; color: var(--muted); }
.teacher summary { cursor: pointer; font-weight: 700; }
.wordlist { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.mini-word { font-size: 1.6rem; font-weight: 700; color: var(--ink); display: inline-flex; padding-bottom: .5em; }
.mk-preview { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 8px; }

.sound-report { text-align: left; background: var(--oops-soft); border-radius: 16px; padding: 14px 18px; margin-top: 16px; }
.sound-report h2 { font-size: 1.15rem; margin: 0 0 6px; }
.sound-report ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.chip { display: inline-block; min-width: 2.6em; text-align: center; font-weight: 700; background: var(--surface); border: 2px solid var(--oops); color: var(--oops); border-radius: 999px; padding: 0 10px; margin-right: 6px; }

/* ---------- Practice ---------- */

.practice { text-align: center; }
.progress { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); }
.stop { color: var(--muted); text-decoration: none; cursor: pointer; font-size: .95rem; }
.stop:hover { color: var(--ink); }
.earned { color: var(--star); }
.bar { height: 10px; background: #efebe1; border-radius: 999px; overflow: hidden; margin: 8px 0 20px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

.phase { font-size: 1.3rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dot.look { background: var(--accent); }
.dot.write { background: var(--oops); }
.dot.good { background: var(--good); }
.dot.check { background: var(--primary); }

.word-box {
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  border-radius: 24px; border: 3px solid var(--line); background: #fffdf7;
  padding: 16px; margin: 0 auto; overflow-wrap: anywhere;
}
.word { font-size: clamp(3rem, 13vw, 6.5rem); font-weight: 700; letter-spacing: .04em; line-height: 1.1; }
.word-box.covered { background: repeating-linear-gradient(45deg, #f3efe4, #f3efe4 14px, #ece7da 14px, #ece7da 28px); font-size: 4rem; }
.word-box.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.word-box.reveal { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* Sound buttons: dot = one-letter sound, line = two/three-letter sound, arc = split digraph */
.sounds { display: inline-flex; align-items: flex-end; padding-bottom: .45em; }
.g { position: relative; display: inline-block; cursor: pointer; border-radius: .12em; }
.g::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: currentColor; }
.g.single::after { width: .16em; height: .16em; border-radius: 50%; bottom: -.28em; }
.g.multi::after { width: 80%; height: .09em; border-radius: 99px; bottom: -.24em; }
.g.whole { cursor: default; }
.g.whole::after, .g.sv::after { display: none; }
.split { position: relative; display: inline-block; }
.split::after {
  content: ""; position: absolute; left: .18em; right: .18em; bottom: -.38em; height: .34em;
  border: .08em solid currentColor; border-top: 0; border-radius: 0 0 999px 999px;
}
.split > .g.single::after { bottom: -.2em; }
.g.missed, .split.missed > .sv { color: var(--oops); }
.g.lit { animation: lit .6s ease; }
@keyframes lit { 0% { background: transparent; } 30% { background: #fff1b8; } 100% { background: transparent; } }

.sound-count { margin: 14px 0 0; font-weight: 700; color: var(--accent); }
.prompt { color: var(--muted); margin: 8px auto 0; max-width: 520px; }

/* Sound boxes (Elkonin boxes) */
.boxes { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.box {
  font: inherit; font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 700;
  min-width: 2.2em; height: 2.2em; padding: 0 .3em; border-radius: 14px;
  border: 3px solid var(--line); background: #fffdf7; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
button.box { cursor: pointer; }
.box.lit { background: color-mix(in srgb, var(--accent) 22%, white); border-color: var(--accent); }
.box.ok { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.box.bad { background: var(--oops-soft); border-color: var(--oops); color: var(--oops); }
.tip-inline { display: block; margin-top: 6px; font-weight: 400; color: var(--ink); }

.timer { height: 12px; background: #efebe1; border-radius: 999px; overflow: hidden; margin: 16px auto 0; max-width: 420px; }
.timer span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 999px; }

.spell-form { display: flex; gap: 12px; margin: 20px auto 0; max-width: 560px; }
.answer {
  flex: 1; min-width: 0; font: inherit; font-size: clamp(2rem, 8vw, 3rem); font-weight: 700; text-align: center;
  letter-spacing: .05em; padding: 8px 12px; border-radius: 18px; border: 3px solid var(--line);
  background: #fff; color: var(--ink);
}
.answer:focus { border-color: var(--accent); }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.tries { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.try { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); }
.try.used { background: #e2ddd1; }
.tries-label { color: var(--muted); margin-left: 6px; }

.feedback { min-height: 1.5em; font-size: 1.15rem; margin: 14px 0 0; }
.feedback.oops { color: var(--oops); font-weight: 700; }
.attempts-label { margin: 12px 0 0; color: var(--muted); }
.attempts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.attempts li {
  background: var(--oops-soft); color: var(--oops); border-radius: 999px; padding: 2px 14px;
  font-size: 1.2rem; text-decoration: line-through;
}

.stars-big { font-size: 3rem; color: var(--star); margin: 12px 0 0; letter-spacing: .1em; }
.stars-big .dim { color: #e6e1d6; }

/* ---------- Summary ---------- */

.summary { text-align: center; }
.trophy { font-size: 4rem; margin: 0; }
.results { width: 100%; border-collapse: collapse; margin-top: 20px; text-align: left; }
.results th { font-size: .9rem; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px; }
.results td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: middle; }
.rw { font-size: 1.35rem; font-weight: 700; }
.star-cell { color: var(--star); font-size: 1.3rem; letter-spacing: .08em; }
.miss { color: var(--oops); font-weight: 700; }
.missed .rw { color: var(--oops); }
.tries-cell s { color: var(--muted); margin-right: 8px; }

/* ---------- Make a list ---------- */

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin-top: 16px; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; font-size: 1.2rem; }
.hint { color: var(--muted); font-size: .95rem; margin: 8px 0 0; }
.mk-result { margin-top: 24px; padding-top: 8px; border-top: 2px dashed var(--line); }

/* ---------- Settings ---------- */

dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--ink);
}
dialog::backdrop { background: rgba(20, 24, 31, .45); }
.settings-form { padding: 24px; }
.settings-form h2 { margin: 0; }
.field-row { display: flex; align-items: flex-end; gap: 12px; }
.grow { flex: 1; }
.field input[type="range"] { padding: 0; border: 0; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }

/* ---------- Sentences and new-word challenges ---------- */

.sentence { font-size: 1.3rem; margin: 14px auto 0; max-width: 560px; }
.sentence b { color: var(--accent); }
.blank { display: inline-block; min-width: 4.5em; border-bottom: 3px solid var(--accent); color: transparent; line-height: 1; }
.phase.challenge { color: var(--primary); }
.challenge-result { font-size: 1.15rem; background: var(--primary-soft); border-radius: 14px; padding: 10px 14px; }
.new-tag { font-size: .75rem; font-weight: 700; color: var(--primary); border: 2px solid var(--primary); border-radius: 999px; padding: 0 6px; vertical-align: middle; }

/* ---------- The pupil's corner on the home page ---------- */

.me {
  max-width: 760px; margin: 28px auto 0; padding: 16px 20px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.me .pupil { margin: 0 auto 10px; }
.me-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.me-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 16px;
  border: 2px solid var(--line); background: #fffdf7; color: var(--ink); text-decoration: none; font-size: 1.1rem;
}
a.me-card:hover { border-color: var(--primary); }
.me-card.review { border-color: var(--star); background: #fff6df; }
.me-card.quiet { color: var(--muted); }
.me-icon { font-size: 1.6rem; }

.assigned { margin-top: 16px; text-align: left; }
.assigned h2 { font-size: 1.15rem; margin: 0 0 8px; text-align: center; }
.class-name { display: inline-block; margin: -8px 0 16px; padding: 4px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* Help request, beside the progress line */
.help-btn {
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; border-radius: 999px;
  padding: 4px 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
.help-btn.on { background: #ffedd5; border-color: #c2410c; color: #c2410c; }

/* ---------- My sounds ---------- */

.sounds-page h2 { font-size: 1.15rem; margin-top: 24px; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.sound-card {
  font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border-radius: 16px; border: 2px dashed var(--line); background: #faf8f2; color: var(--muted);
}
.sc-label { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.sc-badge { min-height: 1.3em; font-size: .9rem; }
.sound-card.learning { border-style: solid; border-color: var(--good); background: #fff; color: var(--ink); }
.sound-card.tricky { border-style: solid; border-color: var(--oops); background: var(--oops-soft); color: var(--oops); }
.sound-card.secure { border-style: solid; border-color: var(--star); background: #fff3cf; color: var(--ink); }
.dots { color: var(--good); letter-spacing: 1px; }
.dots .dim { color: #ddd6c6; }
.sound-detail {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px;
  border-radius: 16px; background: var(--primary-soft); position: sticky; top: 70px; z-index: 2;
}
.sound-detail[hidden] { display: none; }
.chip.big { font-size: 1.6rem; border-color: var(--primary); color: var(--primary); }
.new-stars { background: #fff3cf; border: 2px solid var(--star); border-radius: 16px; padding: 12px 16px; margin-top: 12px; }
.new-stars p { margin: 0 0 8px; font-weight: 700; font-size: 1.15rem; }
.star-badge { display: inline-block; font-size: 1.4rem; font-weight: 700; margin: 0 8px 6px; }

/* ---------- Joining a class ---------- */

.join-box { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0 auto 8px; }
.join-box label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.join-box input { font: inherit; text-transform: uppercase; letter-spacing: .1em; width: 8.5em; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; }
.join-box .btn { min-height: 40px; padding: 4px 16px; }

/* ---------- Teacher area ---------- */

.t-message h1 { font-size: 1.8rem; }
.t-wrap { max-width: 1160px; margin: 0 auto; }
.t-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.t-top h1 { font-size: 1.7rem; margin: 0; }
.t-top .meta { margin: 2px 0 0; }
.t-role { font-size: .8rem; vertical-align: middle; background: #fff3cf; color: #92400e; border: 2px solid var(--star); border-radius: 999px; padding: 1px 8px; }
.t-class { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.t-class select, .t-wrap select, .t-wrap input[type="text"], .t-wrap input[type="email"] {
  font: inherit; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; max-width: 100%;
}
.t-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.t-tab { font: inherit; font-weight: 700; border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.t-tab[aria-selected="true"] { background: var(--primary-soft); color: var(--primary); }
.t-error { background: var(--oops-soft); color: var(--oops); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.t-h2 { font-size: 1.15rem; margin: 22px 0 10px; }
.t-row { align-items: center; margin-top: 0; }
.t-row .hint { margin: 0; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.btn.small { min-height: 0; padding: 2px 12px; font-size: .9rem; }

.summary-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pill { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.pill.help { background: #ffedd5; border-color: #c2410c; color: #c2410c; }
.pill.stuck { background: var(--oops-soft); border-color: var(--oops); color: var(--oops); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.kid { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 6px; }
.kid.help { border-color: #c2410c; background: #ffedd5; animation: pulse 1.6s ease-in-out infinite; }
.kid.stuck { border-color: var(--oops); }
.kid.finished { border-color: var(--good); }
.kid.idle { opacity: .6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(194, 65, 12, .15); } }
.kid-top { display: flex; align-items: center; gap: 8px; }
.kid-name { font-size: 1.2rem; font-weight: 700; }
.badge { margin-left: auto; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: #eef0f3; color: var(--muted); }
.badge.working { background: var(--primary-soft); color: var(--primary); }
.badge.finished { background: var(--good-soft); color: var(--good); }
.badge.stuck { background: var(--oops-soft); color: var(--oops); }
.kid-list { color: var(--muted); font-size: .95rem; }
.kid-bar { height: 8px; background: #efebe1; border-radius: 999px; overflow: hidden; }
.kid-bar span { display: block; height: 100%; background: var(--primary); }
.kid-stats { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); }
.help-row { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #c2410c; }
.help-row .btn { margin-left: auto; }

.t-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; margin-top: 10px; }
.t-table th, .t-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t-table th { font-size: .85rem; color: var(--muted); background: #fbfaf6; }
.who { font-weight: 700; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.t-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 2px 4px 2px 10px; font-weight: 700; font-size: .9rem; }
.t-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.add-row .btn { min-height: 40px; padding: 4px 16px; }

.pupil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.pcard h3 { margin: 0 0 4px; font-size: 1.2rem; }
.pcard .meta { font-size: .9rem; margin: 0 0 8px; }
.sound-chip { display: inline-block; background: var(--oops-soft); color: var(--oops); border: 2px solid var(--oops); border-radius: 999px; padding: 0 9px; margin: 0 4px 4px 0; font-weight: 700; }
.recent { margin: 8px 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.t-code { font-size: 2rem; font-weight: 700; letter-spacing: .15em; margin: 4px 0; color: var(--primary); }
.t-link { flex: 1; min-width: 0; font-size: .9rem !important; }

.credits { max-width: 760px; margin: -32px auto 32px; padding: 0 16px; text-align: center; font-size: .8rem; color: var(--muted); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .topbar { padding: 10px 12px; }
  .navlink { padding: 8px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .spell-form { flex-direction: column; }
  .word-box { min-height: 140px; }
  .tries-cell s { display: inline-block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .btn, .list-card, .bar span { transition: none; }
}

/* ---------- Print (results sheet) ---------- */

@media print {
  body { background: #fff; }
  .topbar, .no-print { display: none !important; }
  .panel { box-shadow: none; border: 0; }
}
