/* Eye-PIRLS student — calm, focused, readable, grade-4 friendly.
 * No external resources. */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Student tokens map onto the shared MD3 foundation (md3.css, loaded
   first): warm high-contrast child palette — change the token VALUES
   there, not the components here (lessons-from-Eye-Rec §9). */
:root {
  --bg: var(--md-surface-dim, #f4f6f9);
  --card: var(--md-surface, #ffffff);
  --ink: var(--md-on-surface, #1d2733);
  --muted: var(--md-on-surface-variant, #5a6b7f);
  --line: var(--md-outline-variant, #d4dce5);
  --accent: var(--md-primary, #2563b0);
  --accent-dark: var(--md-primary-dark, #1d4f8e);
  --accent-soft: var(--md-primary-container, #e8f1fb);
  --good: var(--md-success, #1e8e4e);
  --bad: var(--md-error, #b3372f);
}

html { font-size: 18px; }   /* 1rem = 18px: the fs-1/2/3 scale base */

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
}

.hidden { display: none !important; }

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

/* ------------------------------------------------- generic screens */

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 28px;
}

.brand { font-size: 44px; letter-spacing: -0.02em; }
.subtitle { font-size: 20px; color: var(--muted); }
.muted { color: var(--muted); }

.btn {
  font: inherit;
  font-size: 19px;
  font-weight: 600;
  padding: 14px 34px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible,
.option:focus-visible,
.fs-btn:focus-visible,
.cloze-input:focus-visible,
.open-input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-row { display: flex; gap: 18px; }

.error {
  color: var(--bad);
  font-weight: 600;
  max-width: 640px;
  text-align: center;
}

/* --------------------------------------------------------- 1 join */

#join-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

#code-input {
  font: inherit;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 18px 24px;
  border: 2px solid var(--line);
  border-radius: 12px;
  width: min(440px, 90vw);
  background: var(--card);
  color: var(--ink);
}
#code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
#code-input::placeholder { color: #9aa9ba; }

/* ------------------------------------------------------ 2 consent */

.anon-banner { font-size: 24px; }

.anon-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 4px 16px;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 12px;
  padding: 30px 34px;
  max-width: 780px;
}
.notice h2 { margin-bottom: 18px; }
.notice ul {
  padding-left: 22px;
  display: grid;
  gap: 12px;
}

.mock-note {
  margin-top: 18px;
  padding: 10px 14px;
  background: #fff7e0;
  border: 1px solid #e5d28f;
  border-radius: 8px;
  color: #6b5a12;
  font-size: 17px;
}

/* -------------------------------------------------- 3 calibration */

#screen-calibration {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
}

#cal-instructions {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
}
#cal-progress { font-weight: 700; color: var(--ink); }

/* The calibration target is a STAR to catch — identical 9-point
   calibration underneath, only the presentation is a game
   (lessons-from-Eye-Rec §9). The star starts pale, fills with gold on
   each click and shines when caught. clip-path keeps it one plain
   button: same clicks, same coordinates, no library. */
#cal-dot {
  position: absolute;
  width: 46px;
  height: 46px;
  border: none;
  color: #6b4d00;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;                 /* number sits in the star body */
  cursor: pointer;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0%, 62% 34%, 98% 36%, 69% 58%, 79% 92%,
                     50% 72%, 21% 92%, 31% 58%, 2% 36%, 38% 34%);
  background: var(--md-star, #f2b705);
  filter: drop-shadow(0 0 6px var(--md-star-glow, rgba(242, 183, 5, .45)));
}
#cal-dot.done {
  background: var(--md-star, #f2b705);
  filter: drop-shadow(0 0 14px var(--md-star-glow, rgba(242, 183, 5, .8)));
}

#val-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#val-box p {
  position: absolute;
  top: 10px;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
}
#val-target {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 7px var(--accent-soft);
}

/* non-blocking lighting advice during calibration (lessons §11-12):
   friendly, warm, never a gate — calibration continues regardless */
#cal-hint {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  max-width: min(560px, 86vw);
  text-align: center;
  z-index: 45;
  background: #FFF4E5;
  color: #7A4F01;
  border: 1px solid #F0C68A;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 17px;
}

/* keep the WebGazer video preview clear of the calibration dots and
   let clicks pass through it */
#webgazerVideoContainer {
  left: 30% !important;
  top: 12px !important;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 45;
}

/* --------------------------------------------------- 4 instructions */

.rules {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 30px 26px 48px;
  max-width: 680px;
  display: grid;
  gap: 12px;
  font-size: 19px;
}

/* ------------------------------------ shared: phase header + fonts */

.phase-header {
  min-height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}
.phase-left { display: flex; align-items: baseline; gap: 14px; }
.phase-title { font-weight: 700; color: var(--ink); }
.phase-progress { font-weight: 600; }
#q-num, #q-total { font-weight: 700; color: var(--ink); }

/* A / A+ / A++ — the font-size toggle scales the .fs-scope container;
   all reading/question text inside is sized in em so it follows. */
.fs-toggle { display: flex; align-items: center; gap: 6px; }
.fs-title { font-size: 13px; margin-right: 2px; }
.fs-btn {
  font-family: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 3px 10px;
  cursor: pointer;
  line-height: 1.3;
}
.fs-btn[data-fs="1"] { font-size: 13px; }
.fs-btn[data-fs="2"] { font-size: 15px; }
.fs-btn[data-fs="3"] { font-size: 17px; }
.fs-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.fs-scope.fs-1 { font-size: 1rem; }
.fs-scope.fs-2 { font-size: 1.15rem; }
.fs-scope.fs-3 { font-size: 1.3rem; }

/* --------------------------------------------------- 5 reading */

#screen-reading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

#reading-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

#reading-body {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  flex: 1;
}

.reading-hint {
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: 20px;
}

#reading-title {
  font-size: 1.55em;
  line-height: 1.3;
  margin-bottom: 22px;
}

#reading-content { max-width: 65ch; }

.passage-par {
  font-size: 1.06em;
  line-height: 1.75;
  margin-bottom: 1.1em;
  padding: 2px 4px;               /* a little AOI breathing room */
}

.passage-fig {
  margin: 18px 0 26px;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.passage-fig img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.passage-fig figcaption,
.q-fig figcaption {
  color: var(--muted);
  font-size: 0.85em;
}

#reading-footer {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
#reading-wait { font-size: 0.95em; text-align: center; }

/* --------------------------------------------------- 6 questions */

#screen-quiz {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

#quiz-main {
  flex: 1;
  min-height: 0;
  display: flex;
}

#passage-pane {
  flex: 0 0 45%;
  min-width: 0;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 22px 26px 48px;
}

.lookback-hint {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85em;
  line-height: 1.5;
  margin-bottom: 20px;
}

#passage-pane-title {
  font-size: 1.3em;
  line-height: 1.3;
  margin-bottom: 16px;
}

#question-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 28px 30px 56px;
}
#question-pane > * {
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.question-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 30px;
  margin-bottom: 36px;
}

.q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.q-no { font-weight: 700; color: var(--accent-dark); font-size: 0.95em; }
.pts-chip {
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8em;
  font-weight: 700;
  white-space: nowrap;
}
.q-instr {
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: 12px;
}
.q-text {
  font-size: 1.2em;
  line-height: 1.65;
}

.q-fig {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.q-fig img {
  max-width: min(420px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* answers: mcq */

#options {
  display: flex;
  flex-direction: column;
  gap: 32px; /* >= 32px AOI separation between option buttons */
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 1.05em;
  line-height: 1.6;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 20px 26px;
  cursor: pointer;
}
.option:hover { border-color: var(--accent); }
.option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.opt-letter {
  font-weight: 700;
  color: var(--accent);
  min-width: 1.3em;
}
.option[aria-pressed="true"] .opt-letter { color: var(--accent-dark); }
.opt-body {
  display: grid;
  gap: 10px;
  justify-items: start;
  min-width: 0;
}
.opt-img {
  max-width: min(280px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* answers: yes / no */

#yesno-row {
  display: flex;
  gap: 36px; /* generous AOI separation */
}
.yesno-btn {
  flex: 1;
  justify-content: center;
  text-align: center;
  font-size: 1.35em;
  font-weight: 700;
  padding: 30px 20px;
}

/* answers: cloze */

.cloze-sentence {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 30px;
  font-size: 1.15em;
  line-height: 2.1;
}
.cloze-input {
  display: inline-block;
  font: inherit;
  font-size: 1em;
  color: var(--ink);
  text-align: center;
  width: min(240px, 45vw);
  margin: 0 6px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border: none;
  border-bottom: 3px solid var(--accent);
  border-radius: 8px 8px 0 0;
}
.cloze-input::placeholder { color: #8fa3b8; }

/* answers: open */

.open-input {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  font: inherit;
  font-size: 1.05em;
  line-height: 1.6;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
}
.open-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.open-input::placeholder { color: #8fa3b8; }

#quiz-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 44px;
}

/* stacked layout on narrow screens: passage on top, question below */
@media (max-width: 900px) {
  #quiz-main {
    flex-direction: column;
    overflow-y: auto;
  }
  #passage-pane {
    flex: 0 0 auto;
    max-height: 45vh;
    border-right: none;
    border-bottom: 2px solid var(--line);
  }
  #question-pane {
    flex: 1 0 auto;
    overflow: visible;
  }
  #yesno-row { gap: 20px; }
}

/* ----------------------------------------------------------- 7 done */

.done-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 6px solid var(--good);
  border-radius: 14px;
  padding: 44px 56px;
  text-align: center;
  display: grid;
  gap: 16px;
}
.done-card h2 { font-size: 30px; }

/* ------------------------------------------- fullscreen overlay */

#fs-overlay,
#ec-overlay,
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 28, 38, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------------- join-page warmth (owner request 2026-08-19) ------ */

/* playful global counter under the title: shown only once the count is
   big enough to feel like a crowd (client hides below a threshold) */
.join-counter {
  font-size: 18px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 8px 22px;
  margin-top: -8px;
}

/* friendly "what is this?" pill under the join form — inviting, never
   alarming; parents and children both land here */
.about-pill {
  font: inherit;
  font-size: 16px;
  color: var(--accent-dark);
  background: var(--card);
  border: 2px dashed var(--accent-soft);
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
}
.about-pill:hover { border-style: solid; background: var(--accent-soft); }

.about-card {
  max-width: 560px;
  text-align: left;
}
.about-card h2 { text-align: center; }
.about-card p { font-size: 17px; line-height: 1.55; }
.about-card .mascot-slot { justify-self: center; min-height: 0; }
.about-card .btn { justify-self: center; }

#ec-overlay { z-index: 110; } /* above the fullscreen overlay */

.fs-card {
  background: var(--card);
  border-radius: 14px;
  padding: 40px 48px;
  text-align: center;
  display: grid;
  gap: 18px;
  max-width: 500px;
}

/* ------------------------------------------------- research layer
 * Everything below only ever renders when /api/join returned a research
 * context; the classic flow never adds these classes/elements. */

/* join: optional study-code field (coordinator card). The card icon on
 * the label is the SAME glyph printed on the code cards, so the card
 * can say "the box with the card picture" (F11). */
.rs-code-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rs-card-icon { flex: none; }
#rs-code-input {
  font: inherit;
  font-size: 17px;
  text-align: center;
  letter-spacing: 0.14em;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  width: min(320px, 80vw);
  background: var(--card);
  color: var(--ink);
}
/* child-friendly checksum feedback: never blocks, echoes the typed
 * code in large grouped type for side-by-side card comparison */
.rs-hint {
  font-size: 14px;
  color: var(--md-error, #b3372f);
  margin: 6px auto 0;
  max-width: min(360px, 86vw);
}
.rs-hint .rs-echo {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-top: 2px;
  color: var(--ink);
}
/* consent screen: "Card: XXXX XXXX ✓" so the teacher sees at a glance
 * that the card was accepted */
.card-banner {
  font-size: 17px;
  font-weight: 600;
  color: var(--md-primary, #c65f00);
  letter-spacing: 0.08em;
}
.card-banner .rs-card-icon {
  vertical-align: -3px;
  margin-right: 6px;
}

/* --------------------------------------------- child survey (child_v1)
 * Game-like: one question per screen, five big smiley faces, a star
 * progress row. No camera on these screens; everything skippable. */
.sv-invite {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--md-primary-container, #fdf3e7);
  border: 2px dashed var(--md-primary, #c65f00);
}
.sv-invite-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.sv-invite-sub { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.sv-invite-btns { display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; }
.sv-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 22px 20px 16px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 4px 18px rgba(120, 80, 20, .10);
  text-align: center;
}
.sv-stars { font-size: 40px; letter-spacing: 4px; margin-bottom: 10px;
  min-height: 50px; line-height: 1.1; }
.sv-stars .on { color: var(--md-star, #f2b705); }
.sv-stars .off { color: #e3d9c8; }
.sv-question { font-size: 20px; font-weight: 600; margin: 6px 0 16px;
  line-height: 1.35; }
.sv-listen {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; vertical-align: -2px; padding: 2px 6px;
  border-radius: 50%;
}
.sv-listen:hover { background: var(--md-primary-container, #fdf3e7); }
/* 44px = the 16px the question already had + one blank text line.
 * (Sibling margins collapse, so this single value IS the gap.)
 * NEVER wrap: the five faces are an ordered rating scale — a broken
 * row destroys the "worst .. best" reading. They shrink instead. */
.sv-faces { display: flex; gap: 10px; justify-content: center;
  margin: 44px 0 6px; flex-wrap: nowrap; }
.sv-face {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid transparent; background: transparent;
  cursor: pointer; padding: 0; transition: transform .12s;
}
.sv-face img { width: 100%; height: 100%; display: block; }
.sv-face:hover { transform: scale(1.12); }
.sv-face.sel {
  border-color: var(--md-primary, #c65f00);
  animation: sv-pop .35s;
}
@keyframes sv-pop {
  0% { transform: scale(1); } 50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.sv-scale-words { display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin: 0 4px 8px; }
.sv-skip {
  margin-top: 10px; border: none; background: transparent;
  color: var(--muted); font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: underline;
}
#sv-free-text {
  width: 100%; box-sizing: border-box; font: inherit;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 10px; margin-bottom: 10px; background: var(--card);
}
.sv-thanks-title { font-size: 26px; font-weight: 800;
  color: var(--md-primary, #c65f00); margin: 8px 0 4px; }
.sv-thanks-sub { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .sv-face, .sv-face.sel { animation: none; transition: none; }
}
/* Phones: nine big stars and five 58px faces do not fit side by side.
 * Measured budget at 375px = 287px inside the card:
 * 5x50 + 4x6 = 274 fits; at 360px viewport 5x42 + 4x4 = 226 fits. */
@media (max-width: 480px) {
  .sv-stars { font-size: 28px; min-height: 36px; letter-spacing: 2px; }
  .sv-faces { gap: 6px; }
  .sv-face { width: 50px; height: 50px; }
}
@media (max-width: 360px) {
  .sv-stars { font-size: 24px; min-height: 32px; letter-spacing: 1px; }
  .sv-faces { gap: 4px; }
  .sv-face { width: 42px; height: 42px; }
}
#rs-code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* sentence AOIs / evidence selection */
.sent { border-radius: 6px; }
.evidence-mode .sent { cursor: pointer; }
.evidence-mode .sent:hover { background: var(--accent-soft); }
.sent-selected,
.evidence-mode .sent-selected:hover {
  background: #ffe9a8;
  box-shadow: 0 0 0 2px #e8c96a inset;
}

/* two-stage panel: confidence scale + evidence prompt */
#rs-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 14px;
  padding: 20px 26px;
  margin-bottom: 36px;
}
.rs-prompt {
  font-weight: 700;
  font-size: 1.15em;
  margin-bottom: 16px;
}
#rs-conf-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.rs-conf-btn {
  font: inherit;
  font-size: 1.02em;
  font-weight: 600;
  line-height: 1.4;
  padding: 18px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.rs-conf-btn:hover { border-color: var(--accent); }
.rs-conf-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
#rs-ev-row { display: flex; justify-content: flex-end; }

/* the initial answer stays visible but locked during the research steps */
.option:disabled { cursor: default; opacity: 0.85; }

/* intervention (scaffold) card overlay */
#rs-int-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(20, 28, 38, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#rs-int-overlay .fs-card { max-width: 560px; }
#rs-int-title { font-size: 24px; }
#rs-int-text { line-height: 1.7; text-align: left; }
.rs-int-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------- mascot (lessons §9)
   One friendly safari giraffe, plain self-drawn inline SVG, a few CSS
   states — no animation library, no external image. It appears ONLY
   on non-measured screens (join / consent / instructions / validation
   result / done); the calibration grid, passage and question screens
   stay visually quiet because animated or salient elements there
   attract gaze and pollute the AOI data. */
.mascot { line-height: 0; }
.mascot svg { width: 112px; height: 120px; }
.mascot .m-wing { transform-box: view-box; transition: transform .25s; }
.mascot .m-eye-happy, .mascot .m-book { display: none; }
.mascot.cheer .m-eye-happy { display: block; }
.mascot.cheer .m-pupil { display: none; }
/* cheer: the ears perk up (CSS transform replaces the base tilt set in
   the SVG markup, so the lifted angles include it) */
.mascot.cheer .m-wing-l { transform: rotate(-60deg); transform-origin: 44px 28px; }
.mascot.cheer .m-wing-r { transform: rotate(55deg); transform-origin: 76px 26px; }
.mascot.read .m-book { display: block; }
.mascot.read .m-pupil { transform: translateY(3px); }
.mascot.bounce svg { animation: m-bounce 1.4s ease-in-out infinite; }
@keyframes m-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.mascot-slot { min-height: 0; }
.mascot-slot:empty { display: none; }

/* ------------------------------------- encouraging done screen */
.done-card { position: relative; }
.done-card::before,
.done-card::after {
  content: '★';
  position: absolute;
  color: var(--md-star, #f2b705);
  font-size: 30px;
}
.done-card::before { top: 14px; left: 20px; transform: rotate(-15deg); }
.done-card::after { top: 22px; right: 22px; transform: rotate(12deg); }
.done-praise {
  font-size: 21px;
  font-weight: 600;
  color: var(--accent-dark);
}

/* soft MD3 elevation on the big student cards (tokens from md3.css) */
.notice, .done-card, .fs-card {
  box-shadow: var(--md-elev-2, 0 2px 6px rgba(0, 0, 0, .08));
  border-radius: var(--md-radius-l, 16px);
}
.btn { border-radius: var(--md-radius-full, 999px); }
@media (prefers-reduced-motion: reduce) {
  .mascot.bounce svg { animation: none; }
  .mascot .m-wing { transition: none; }
}
/* the very last thing a child reads: nothing more to do here */
.sv-thanks-close {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--md-primary, #c65f00);
}
