/* Σχολικά Παιχνίδια — "Aegean and sun" style (see the design canvas and docs/DESIGN_BRIEF.md). */

:root {
  --paper: #FBF7F0;
  --surface: #FFFFFF;
  --line: #E7DFD2;
  --ink: #1D2733;
  --ink-soft: #4A5563;
  --track: #EDE6DA;
  --muted: #F4EEE4;

  --primary: #1E6FA8;
  --primary-dark: #17567F;
  --primary-tint: #E3EEF7;

  --sun: #F2B441;
  --sun-tint: #FDF1D8;
  --sun-ink: #6E4800;
  --sun-strong: #8A5A00;

  --success: #2F7D4F;
  --success-dark: #22603B;
  --success-tint: #E4F2E9;

  --error: #B8432F;
  --error-dark: #8E2F1F;
  --error-tint: #FBE9E5;

  --font-ui: 'Commissioner', system-ui, sans-serif;
  --font-read: 'Andika', 'Commissioner', system-ui, sans-serif;

  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 22px;
  --radius-xl: 28px;
  --press: 0 4px 0;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 24px; font-weight: 800; }
img { max-width: 100%; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.reading { font-family: var(--font-read); }
.text-red { color: var(--error-dark); font-weight: 600; }
.text-green { color: var(--success-dark); font-weight: 600; }
.points-text { color: var(--sun-ink); font-weight: 700; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex-shrink: 0; }
.icon--star { color: #B07A12; fill: var(--sun); }

/* ---------- messages ---------- */
.messages { max-width: 1180px; margin: 16px auto 0; padding: 0 40px; }
.message { padding: 14px 18px; border-radius: var(--radius-m); background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; }
.message--success { background: var(--success-tint); color: var(--success-dark); }
.message--error { background: var(--error-tint); color: var(--error-dark); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--radius-m);
  font: 700 17px/1 var(--font-ui); text-decoration: none; cursor: pointer; border: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 currentColor; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--press) var(--primary-dark); }
.btn--primary:hover { color: #fff; background: #1A639A; }
.btn--secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--line); box-shadow: var(--press) var(--line); }
.btn--secondary:hover { color: var(--ink); }
.btn--success { background: var(--success); color: #fff; box-shadow: var(--press) var(--success-dark); }
.btn:disabled { background: var(--track); color: #6B6357; box-shadow: none; cursor: not-allowed; }
.btn--big { min-height: 64px; padding: 0 32px; font-size: 20px; }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn--block { width: 100%; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); cursor: pointer;
}
/* Children do not recognise a bare icon, so the player's exit button carries its name. */
.icon-btn--labelled { width: auto; gap: 8px; padding: 0 16px; font: 700 16px var(--font-ui); color: var(--ink); }
/* The breadcrumbs go unnoticed (and are hidden on small screens): every child page below the home page
   also has this button. */
.back-btn { align-self: flex-start; }
.quiet-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 8px; background: none; border: none;
  color: var(--ink-soft); font: 600 16px var(--font-ui); text-decoration: none; cursor: pointer;
}
.quiet-link:hover { color: var(--ink); }

/* ---------- header ---------- */
.topbar {
  min-height: 76px; padding: 0 32px; display: flex; align-items: center; gap: 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar--plain { background: transparent; border: none; min-height: 88px; padding: 0 40px; }
.topbar__spacer { flex-grow: 1; }
.topbar__link {
  display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font: 600 16px var(--font-ui);
  text-decoration: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.topbar__link--muted { color: var(--ink-soft); }
.topbar form { margin: 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__mark { width: 40px; height: 40px; border-radius: var(--radius-s); background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.logo__text { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.crumbs { flex-grow: 1; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; min-width: 0; }
.crumbs a { text-decoration: none; }
.crumbs__sep { color: #9A9082; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--muted); color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.points-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--sun-tint); color: var(--sun-ink); font-size: 17px; font-weight: 700; white-space: nowrap;
}
.points-pill--center { align-self: center; }

/* profile menu */
.profile-menu { position: relative; z-index: 10; }
.profile-menu__button {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 6px; border-radius: var(--radius-m);
  background: var(--surface); border: 2px solid var(--line); font: 600 16px var(--font-ui); color: var(--ink); cursor: pointer;
}
.profile-menu__list {
  position: absolute; top: 66px; right: 0; width: 280px; padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 40px rgba(29, 39, 51, .16);
  display: flex; flex-direction: column; gap: 4px;
}
.profile-menu__who { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 14px; color: var(--ink-soft); }
.profile-menu__who strong { font-size: 17px; color: var(--ink); }
.profile-menu__list a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; color: var(--ink); font-weight: 600; text-decoration: none; }
.profile-menu__list a:hover { background: var(--muted); }

/* ---------- avatars ---------- */
.avatar { display: block; flex-shrink: 0; border-radius: 32%; }
.avatar--40 { width: 40px; height: 40px; }
.avatar--64 { width: 64px; height: 64px; }
.avatar--72 { width: 72px; height: 72px; }
.avatar--128 { width: 128px; height: 128px; }
.avatar--168 { width: 168px; height: 168px; }

/* ---------- layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 28px; }
.page--narrow { max-width: 820px; }
.page__intro { display: flex; flex-direction: column; gap: 8px; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.eyebrow--blue { color: var(--primary-dark); }
.eyebrow--sun { color: var(--sun-strong); font-size: 15px; }
.icon-tile { width: 88px; height: 88px; border-radius: 26px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-tile--48 { width: 48px; height: 48px; border-radius: 14px; }
.icon-tile--blue { background: var(--primary-tint); color: var(--primary-dark); }
.icon-tile--sun { background: var(--sun-tint); color: var(--sun-strong); width: 72px; height: 72px; border-radius: 22px; }
.icon-tile--sun.icon-tile--48 { width: 48px; height: 48px; border-radius: 14px; }

/* subject tones */
.tone-0 { --tone-bg: var(--error-tint); --tone-ink: var(--error); --tone-bar: var(--error); }
.tone-1 { --tone-bg: var(--primary-tint); --tone-ink: var(--primary-dark); --tone-bar: var(--primary); }
.tone-2 { --tone-bg: var(--sun-tint); --tone-ink: var(--sun-strong); --tone-bar: var(--sun); }
.tone-3 { --tone-bg: var(--success-tint); --tone-ink: var(--success); --tone-bar: var(--success); }
.tone-sun { background: var(--sun-tint); color: var(--sun-ink); }
.tone-green { background: var(--success-tint); color: var(--success-dark); }
.tone-red { background: var(--error-tint); color: var(--error-dark); }
.chip.tone-0, .chip.tone-1, .chip.tone-2, .chip.tone-3 { background: var(--tone-bg); color: var(--tone-ink); }

/* progress bars */
.bar { display: block; width: 100%; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar--thin { height: 8px; }
.bar--140 { width: 140px; }
.bar--280 { width: 280px; }
.bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--tone-bar, var(--sun)); }
.bar__fill--green { background: var(--success); }
.progress-line { display: flex; align-items: center; gap: 12px; }

/* ---------- auth ---------- */
.auth { max-width: 480px; margin: 48px auto; padding: 0 16px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.auth .card { width: 100%; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form h1 { font-size: 28px; }
.form__errors { padding: 12px 16px; border-radius: var(--radius-m); background: var(--error-tint); color: var(--error-dark); font-weight: 600; }
.form__actions { display: flex; justify-content: flex-end; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; border: none; margin: 0; padding: 0; }
.field label, .field legend { font-size: 16px; font-weight: 700; padding: 0; }
.field input[type=text], .field input[type=email], .field input[type=password], .field select, textarea,
.report-inline select, .report-inline input[type=text] {
  min-height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  font: 18px var(--font-ui); color: var(--ink); width: 100%;
}
textarea { padding: 12px 14px; min-height: 0; resize: vertical; font-size: 17px; }
.field--error input, .field--error select { border-color: var(--error); }
.field__error { color: var(--error-dark); font-size: 15px; font-weight: 600; }
.field__help { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.field__help ul { margin: 4px 0 0; padding-left: 18px; }
.field--check { justify-content: flex-end; }
.field--check label { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.field--check input { width: 22px; height: 22px; accent-color: var(--primary); }
.avatar-choices { display: flex; gap: 20px; flex-wrap: wrap; }
.avatar-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.avatar-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-choice img { border: 3px solid transparent; padding: 3px; border-radius: 30px; box-sizing: content-box; }
.avatar-choice input:checked + img { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-tint); }
.avatar-choice input:focus-visible + img { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- profiles & PIN ---------- */
.profiles { min-height: calc(100vh - 176px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; padding: 0 16px; text-align: center; }
.profiles h1 { font-size: 44px; }
.profiles__list { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.profile-tile { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: var(--radius-xl); color: var(--ink); text-decoration: none; }
.profile-tile:hover { background: var(--surface); color: var(--ink); }
.profile-tile__avatar { position: relative; }
.profile-tile__lock { position: absolute; right: -8px; bottom: -8px; width: 40px; height: 40px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.profile-tile__name { font-size: 24px; font-weight: 700; }
.profile-tile__grade { color: var(--ink-soft); margin-top: -6px; }
.profiles__footer { min-height: 88px; display: flex; align-items: center; justify-content: center; }
.pin { min-height: calc(100vh - 88px); display: flex; align-items: center; justify-content: center; gap: 96px; padding: 0 16px 60px; flex-wrap: wrap; }
.pin__who { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 340px; text-align: center; }
.pin__who h1 { font-size: 34px; }
.pin__form { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pin__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pin__dots { display: flex; gap: 16px; margin-top: 8px; }
.pin__dot { width: 22px; height: 22px; border-radius: 999px; border: 3px solid #C9BCA8; }
.pin__dot--on { background: var(--primary); border-color: var(--primary); }
.keypad { display: grid; grid-template-columns: repeat(3, 88px); gap: 16px; }
.key { height: 72px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--press) var(--line); font: 700 28px var(--font-ui); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.key--link { border: none; box-shadow: none; background: none; font-size: 17px; color: var(--primary); text-decoration: none; }

/* ---------- child home ---------- */
.dashboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mistakes-card { grid-column: span 2; display: flex; align-items: center; gap: 24px; }
.mistakes-card__text { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.mistakes-card form { margin: 0; }
.points-card { padding: 24px 28px; border-radius: 24px; background: var(--sun-tint); border: 1px solid #F3DCA6; color: var(--sun-ink); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.points-card__value { display: flex; align-items: center; gap: 12px; font-size: 56px; font-weight: 800; line-height: 1; }
.points-card__label { font-size: 18px; font-weight: 700; }
.points-card__note { font-size: 15px; }
.book-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--press) var(--line); }
.book-card:hover { color: var(--ink); border-color: var(--tone-ink); }
.book-card__cover { height: 96px; background: var(--tone-bg); color: var(--tone-ink); display: flex; align-items: center; justify-content: center; }
.book-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.book-card__subject { font-size: 14px; font-weight: 700; color: var(--tone-ink); }
.book-card__title { font-size: 19px; font-weight: 700; line-height: 1.25; min-height: 48px; }
.book-card__meta { font-size: 14px; color: var(--ink-soft); }
.book-card .bar { margin-top: 8px; }

/* ---------- book & chapter ---------- */
.book-head { display: flex; align-items: center; gap: 24px; }
.book-head__cover { width: 96px; height: 120px; border-radius: 18px; background: var(--tone-bg); color: var(--tone-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.book-head__text { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.row-card { display: flex; align-items: center; gap: 18px; min-height: 104px; padding: 16px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--press) var(--line); text-decoration: none; color: var(--ink); }
.row-card:hover { color: var(--ink); }
.row-card--current { border: 2px solid var(--primary); box-shadow: var(--press) var(--primary); }
.row-card__body { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; }
.row-card__title { font-size: 20px; font-weight: 700; }
.row-card__chev { color: #9A9082; }
.badge { width: 52px; height: 52px; border-radius: 999px; background: var(--muted); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; flex-shrink: 0; }
.badge--56 { width: 56px; height: 56px; font-size: 24px; }
.badge--done { background: var(--success); color: #fff; }
.badge--current { background: var(--primary); color: #fff; }
/* How a finished lesson went (learning.services.score_band): the badge and the score pill use the same three
   bands, so a child sees at a glance which lessons are worth playing again. */
.badge--perfect { background: var(--success); color: #fff; }
.badge--good { background: var(--sun); color: var(--sun-ink); }
.badge--poor { background: var(--error-tint); color: var(--error); }
.lesson-row { display: flex; align-items: center; gap: 20px; min-height: 116px; padding: 16px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--press) var(--line); }
.lesson-row--current { border: 2px solid var(--primary); box-shadow: var(--press) var(--primary); }
.lesson-row__body { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.lesson-row__title { font-size: 22px; font-weight: 700; }
.lesson-row__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.score-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--muted); color: var(--ink-soft); font-size: 16px; font-weight: 700; white-space: nowrap; }
.score-pill--perfect { background: var(--success-tint); color: var(--success-dark); }
.score-pill--good { background: var(--sun-tint); color: var(--sun-ink); }
.score-pill--poor { background: var(--error-tint); color: var(--error-dark); }

/* ---------- lesson player ---------- */
.player { min-height: 100vh; display: flex; flex-direction: column; }
.player__bar { min-height: 88px; padding: 0 40px; display: flex; align-items: center; gap: 24px; }
.progress { flex-grow: 1; height: 16px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: var(--sun); transition: width .3s ease; }
.player__count { min-width: 64px; text-align: right; font-size: 17px; font-weight: 700; color: var(--ink-soft); }
.player__main { flex-grow: 1; display: flex; justify-content: center; padding: 16px 40px 32px; }
.exercise { width: 100%; max-width: 920px; display: flex; flex-direction: column; gap: 28px; }
.exercise__label { font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.exercise__question { font-size: 32px; font-weight: 700; line-height: 1.4; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.option {
  display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 12px 20px; border-radius: 18px;
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--press) var(--line);
  font: 24px/1.3 var(--font-read); color: var(--ink); text-align: left; cursor: pointer;
}
.option:disabled { cursor: default; }
.option--big { min-height: 128px; justify-content: center; font: 800 28px var(--font-ui); }
.option__badge { width: 40px; height: 40px; border-radius: var(--radius-s); background: var(--muted); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font: 800 18px var(--font-ui); }
.option--big .option__badge { width: 48px; height: 48px; border-radius: 14px; }
.option--selected { background: var(--primary-tint); border-color: var(--primary); box-shadow: var(--press) var(--primary); }
.option--selected .option__badge { background: var(--primary); color: #fff; }
.option--correct { background: var(--success-tint); border-color: var(--success); box-shadow: var(--press) var(--success); }
.option--correct .option__badge { background: var(--success); color: #fff; }
.option--wrong { background: var(--error-tint); border-color: var(--error); box-shadow: var(--press) var(--error); }
.option--wrong .option__badge { background: var(--error); color: #fff; }
.chips { display: flex; gap: 16px; flex-wrap: wrap; }
.chip-option {
  min-height: 64px; padding: 0 28px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line);
  box-shadow: var(--press) var(--line); font: 24px var(--font-read); color: var(--ink); cursor: pointer;
}
.chip-option.option--selected { background: var(--muted); border-style: dashed; border-color: #D9CFBF; box-shadow: none; color: #6B6357; }
.chip-option.option--correct { background: var(--success-tint); border-color: var(--success); box-shadow: var(--press) var(--success); color: var(--success-dark); }
.chip-option.option--wrong { background: var(--error-tint); border-color: var(--error); box-shadow: var(--press) var(--error); color: var(--error-dark); }
.chip-option:disabled { cursor: default; }
.blank { display: inline-block; min-width: 200px; min-height: 1.2em; margin: 0 6px; vertical-align: bottom; border-bottom: 4px dashed #C9BCA8; text-align: center; }
.blank--filled { min-width: 0; padding: 2px 20px; border: 2px solid var(--primary); border-radius: 16px; background: var(--primary-tint); color: var(--primary-dark); }
.is-wrong .blank--filled { border-color: var(--error); background: var(--error-tint); color: var(--error-dark); }
.is-correct .blank--filled { border-color: var(--success); background: var(--success-tint); color: var(--success-dark); }
.content-card { width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 16px; padding: 40px; }
.content-card__html { font-size: 21px; line-height: 1.55; display: flex; flex-direction: column; gap: 14px; }
.content-card__html img { border-radius: 20px; }
.content-card__html p { margin: 0; }
.player__footer {
  position: sticky; bottom: 0; min-height: 112px; padding: 20px 40px; border-top: 2px solid var(--track); background: var(--paper);
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.player__footer--wrong { background: var(--error-tint); border-top-color: #F3C7BD; align-items: flex-end; }
.player__footer--correct { background: var(--success-tint); border-top-color: #BFE0CB; }
.player__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.player__error { color: var(--error-dark); font-weight: 600; }
.feedback { display: flex; gap: 20px; }
.feedback--inline { align-items: center; }
.feedback__icon { width: 56px; height: 56px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.feedback__icon--wrong { background: var(--error); }
.feedback__icon--correct { background: var(--success); }
.feedback__text { display: flex; flex-direction: column; gap: 8px; max-width: 760px; font-size: 19px; }
.feedback__title { font-size: 24px; font-weight: 800; color: var(--error-dark); }
.feedback__title--correct { color: var(--success-dark); }
.feedback__explanation { display: flex; gap: 10px; line-height: 1.5; }
.feedback__explanation .icon { color: var(--sun-strong); }
.feedback__encourage { font-size: 17px; font-weight: 600; color: var(--error-dark); }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
.is-wrong .option--wrong, .is-wrong .blank--filled { animation: shake .3s ease 1; }
.is-correct .option--correct, .is-correct .blank--filled { animation: pulse .35s ease 1; }

/* lesson finished */
.done { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 16px; text-align: center; }
.done h1 { font-size: 44px; }
.medal { width: 128px; height: 128px; border-radius: 999px; background: var(--sun-tint); border: 6px solid var(--sun); display: flex; align-items: center; justify-content: center; }
.tiles { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.tile { width: 190px; padding: 20px; border-radius: var(--radius-l); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 16px; font-weight: 600; }
.tile strong { font-size: 44px; font-weight: 800; line-height: 1.1; }
.tile--green { background: var(--success-tint); color: var(--success-dark); }
.tile--red { background: var(--error-tint); color: var(--error-dark); }
.tile--sun { background: var(--sun-tint); color: var(--sun-ink); }
.done__actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(29, 39, 51, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { width: 100%; max-width: 580px; padding: 32px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: 0 24px 60px rgba(29, 39, 51, .25); display: flex; flex-direction: column; gap: 16px; }
.dialog--center { align-items: center; text-align: center; max-width: 500px; }
.dialog__body { display: flex; flex-direction: column; gap: 16px; }
.dialog__head { display: flex; align-items: center; gap: 14px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 12px; }
.reasons { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reason { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 18px; border-radius: var(--radius-m); border: 2px solid var(--line); font-size: 18px; font-weight: 600; cursor: pointer; }
.reason:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.reason input { width: 22px; height: 22px; accent-color: var(--primary); }

/* ---------- parent ---------- */
.child-card { display: flex; flex-direction: column; gap: 20px; }
.child-card__head { display: flex; align-items: center; gap: 18px; }
.child-card__who { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.child-card__who .muted { display: inline-flex; align-items: center; gap: 6px; }
.child-card__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.facts { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.who { display: flex; align-items: center; gap: 18px; }
.stat { padding: 18px 22px; border-radius: 20px; display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.stat strong { font-size: 36px; font-weight: 800; }
.split { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; align-items: start; }
.split__wide { grid-column: span 3; }
.split__narrow { grid-column: span 2; }
.split h2 { font-size: 20px; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 14px; color: var(--ink-soft); padding: 0 12px 10px; }
.table td { padding: 14px 12px; border-top: 1px solid var(--line); }
.table .num { text-align: right; }
.mistakes { list-style: none; margin: 0; padding: 0; }
.mistakes li { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.report-inline summary { list-style: none; padding: 4px 0; font-size: 14px; }
.report-inline summary::-webkit-details-marker { display: none; }
.report-inline form { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard, .split { grid-template-columns: 1fr; }
  .mistakes-card, .split__wide, .split__narrow { grid-column: auto; }
  .mistakes-card { flex-wrap: wrap; }
  .crumbs { display: none; }
}
@media (max-width: 640px) {
  .page, .player__main, .player__bar, .player__footer, .messages { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .logo__text, .profile-menu__button span, .icon-btn--labelled span { display: none; }
  .icon-btn--labelled { width: 48px; padding: 0; }
  .grid--2, .grid--3, .grid--4, .options { grid-template-columns: 1fr; }
  h1, .exercise__question { font-size: 26px; }
  .player__footer, .lesson-row { flex-direction: column; align-items: stretch; }
  .player__actions { align-items: stretch; margin-left: 0; }
  .book-head { flex-direction: column; align-items: flex-start; }
  .bar--280 { width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
