/* Cursive Writing, Grade 3 — session list, identify game and the ruled paper.
   Colours: only approved ones (Forest Green #276844, red #B8362A, the app's existing neutrals);
   the red baseline of the paper is pure red #FF0000 (Brandie's rule for the cursive paper).
   All child-facing wording lives in public/cursive-strings.mjs, not here. */

/* ---- fonts (self-hosted, no CDN) ---- */
/* Playwrite US Trad, Version 1.003, SIL OFL 1.1 — public/assets/fonts/playwrite/ (see SHA256.txt
   there for the pins). Variable font, weight pinned to 400 (Regular). The file was renamed from
   the upstream "PlaywriteUSTrad[wght].ttf" (same bytes): the static server does not URL-decode
   paths, so square brackets in a name cannot be served. */
@font-face {
  font-family: 'Playwrite US Trad';
  src: url('/assets/fonts/playwrite/PlaywriteUSTrad.ttf') format('truetype-variations');
  font-weight: 100 400;
  font-style: normal;
  font-display: block;
}
/* The project's own readable print: the bundled Atkinson Hyperlegible Bold (SIL OFL, already used
   for the capital I in Sorting). Full range here so capital I and lowercase l stay distinct
   (Quill §2.2). Different family name from sorting-letters' U+0049-only 'Piko Capital I'. */
@font-face {
  font-family: 'Piko Print';
  src: url('/assets/fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

/* Every cursive glyph: joins need OpenType contextual alternates ON (Brandie's answer 10: each
   word stays ONE shaped text run; the font draws the joins and the lifts — no hand-drawn
   connector). */
.cursive {
  font-family: 'Playwrite US Trad', cursive;
  font-weight: 400;
  font-variation-settings: 'wght' 400;
  font-feature-settings: "calt" 1, "liga" 1;
  font-variant-ligatures: contextual common-ligatures;
}
.ci-print, .cv-print { font-family: 'Piko Print', 'Atkinson Hyperlegible', sans-serif; font-weight: 700; }

/* ---- session list (Quill screen B) ---- */
.cv-screen { position: relative; }
.cv-list-intro { margin-bottom: 10px; }
.cv-menu .sl-lock-text { color: #B8362A; font-weight: 700; font-size: 0.9rem; margin-right: 8px; }
.cv-menu li.sl-locked { opacity: 0.55; }
.cv-menu li.sl-locked .sl-name { text-decoration: none; }

/* ---- shared How to play page (rule 18; Piko top-right, rule 15) ---- */
.cv-help .cv-help-piko { position: absolute; top: 12px; right: 12px; width: 92px; height: auto; }
.cv-help h1 { margin-top: 4px; }
.cv-help-text { max-width: 60ch; line-height: 1.5; }
.cv-help-stylus { font-weight: 700; margin: 10px 0 0; color: #B8362A; font-size: 1.25rem; }

/* ---- identify game (Quill screen C) ---- */
.ci-screen { position: relative; }
.ci-lead { font-weight: 700; }
.ci-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; margin: 8px auto 14px; padding: 10px 16px 52px;
  background: #FFFDF7; border: 1px solid #E8DFCA; border-radius: 12px;
  max-width: 420px;
}
.ci-big { font-size: 9rem; line-height: 1.2; color: #25312C; }
.ci-big.ci-print { font-size: 7.5rem; }
.ci-choices { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 10px; }
.ci-choice {
  min-width: 92px; min-height: 92px; padding: 8px 18px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #E8DFCA; border-radius: 12px; color: #25312C;
}
.ci-choice .cursive { font-size: 3.4rem; line-height: 1; }
.ci-choice .ci-print { font-size: 2.6rem; line-height: 1; }
.ci-choice.ci-right { border-color: #276844; background: #E7F2EB; }
.ci-choice.ci-wrong { opacity: 0.45; background: #EFEAE0; }
.ci-feedback { min-height: 2.2rem; font-size: 1.35rem; font-weight: 700; text-align: center; }
.ci-feedback.good { color: #276844; }
.ci-feedback.try { color: #B8362A; }
.ci-check { color: #276844; }
.ci-actions { display: flex; justify-content: center; margin-top: 6px; }

/* ---- identify summary (Quill screen F) ---- */
.ci-end { text-align: center; }
.ci-end-piko { width: 120px; height: auto; display: block; margin: 0 auto 6px; }
.ci-star { font-size: 3rem; margin: 2px 0; }
.ci-total { font-size: 1.5rem; font-weight: 700; }
.ci-practice { margin: 10px auto 14px; max-width: 480px; }
.ci-practice h2 { font-size: 1.15rem; color: #B8362A; margin-bottom: 6px; }
.ci-practice-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; padding: 0; margin: 0; }
.ci-practice-list li { display: flex; align-items: baseline; gap: 8px; background: #FFFDF7; border: 1px solid #E8DFCA; border-radius: 10px; padding: 6px 12px; }
.ci-practice-glyph { font-size: 2.2rem; }
.ci-practice-list .ci-print { font-size: 1.2rem; }

/* ---- session summary (Quill screen F — the true end of the session, Stage 3) ---- */
.cs-star-line { font-weight: 700; margin: 2px 0 0; }

/* ---- UPDATE (card 204, Nov 3 2026) ---- */
/* Request 1: the "Write the letters" button is BIGGER than the other buttons on the summary
   (the default .btn measures ~60px tall — this is clearly taller, wider and larger type).
   The summary button rows centre-align so the stretch does not level every button to the
   tallest one — only the cursive summaries (.ci-end) are affected. */
.ci-end .button-row { align-items: center; }
.cw-big-btn { font-size: 1.5rem; padding: 18px 34px; min-height: 76px; font-weight: 800; }
/* The WIP label (Question D): small, clear, child-friendly, NEVER a star. One look in both
   places (the session list row and the session summary). Wording in cursive-strings.mjs. */
.cv-wip-chip {
  color: #B8362A; border: 2px solid #B8362A; border-radius: 999px;
  padding: 1px 9px; font-size: 0.78rem; font-weight: 700; margin: 0 6px;
  white-space: nowrap; align-self: center;
}
.cs-wip {
  display: inline-block; color: #B8362A; border: 2px solid #B8362A; border-radius: 999px;
  padding: 4px 16px; font-weight: 700; margin: 8px 0 0;
}
/* The demo screen's big letter card: cropped tight to the glyph (applyArrowsZoom force) and
   shown large at every width. Doubled class = higher specificity than the generic
   .cw-arrows-card zoom rule further down (the demo card carries both classes). */
.cw-arrows-card.cw-demo-card svg.cv-zoomed { max-width: 420px; margin: 0 auto; }
/* the cream panel hugs the big letter instead of spanning the whole row */
.cw-arrows-card.cw-demo-card { max-width: 456px; margin: 0 auto; }
.cw-count { font-variant-numeric: tabular-nums; }
/* Undo button (ROUND 2, Brandie Nov 3 2026): the backward circular arrow ICON (inline SVG from
   cursive-draw.mjs, currentColor so it follows the button's ink) with the word "Undo" beside it. */
.cw-undo, .cx-undo { display: inline-flex; align-items: center; gap: 7px; }
.cw-undo-icon { width: 1.25em; height: 1.25em; flex: none; }
/* TestBoss bypass button: deliberately small and quiet — it is for testing, not for children. */
.cw-skip, .cx-skip { opacity: 0.75; }

/* ---- ROUND 3 (card 6BxW3MjT, Brandie Nov 4 2026): pencil demo, grading marks, list looks ---- */
/* The demo screen's THREE big letter cards: a row on tablet/laptop, stacked on phone. */
.cw-demo-cards { display: flex; gap: 10px; align-items: flex-start; width: 100%; }
.cw-demo-big-card { flex: 1 1 0; min-width: 0; }
.cw-demo-big-card.cw-card-active { outline: 3px solid #4F78D3; outline-offset: 2px; }
.cw-demo-big-card.cw-card-done { border-color: #276844; }
/* CARD 215: every big demo card is a drawing surface (free tracing order) — no touch scrolling */
.cw-demo-big-card svg { max-height: 46vh; width: auto; max-width: 100%; margin: 0 auto; touch-action: none; }
/* the pencil, its reduced-motion marks and the grading marks never eat pointer events; card 213:
   neither does the TOP copy of the numbered stroke badges (numbers stay readable over any ink) */
.cv-pencil-layer, .cv-pencil-static, .cv-grade-marks, .cv-badges-top { pointer-events: none; }
/* "Show me" on the lined page: the small pencil-replay card (replaces the arrows card) */
.cw-showme-card { max-width: 456px; margin: 0 auto; }
.cw-showme-card svg.cv-zoomed { max-width: 340px; margin: 0 auto; }
/* The session list row (answer I): proficient = grayed out with a check mark, still tappable. */
.cv-menu li.cv-row-done { opacity: 0.55; }
.cv-done-check { width: 1.15em; height: 1.15em; flex: none; margin: 0 6px; align-self: center; }
/* The replay choice (answer J): the two buttons, Brandie's exact words. */
.cv-replay .button-row { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }
.cv-replay .button-row .btn { min-width: 300px; max-width: 420px; }
.cv-replay .cv-replay-chip { display: inline-block; margin: 4px 0 0; }

/* ---- ruled paper (public/cursive-paper.mjs) ---- */
/* The card scales with its container; rule widths stay constant in SCREEN pixels because the
   lines use vector-effect="non-scaling-stroke" (production fix for the proof's ~0.7 px lines at
   390 px width). */
.cv-card { background: #FFFDF7; border: 1px solid #E8DFCA; border-radius: 12px; padding: 8px 10px 4px; }
.cv-card svg { display: block; width: 100%; height: auto; }
.cv-trace-fallback { fill: none; stroke: #25312C; stroke-width: 2; stroke-dasharray: 0.1 6; stroke-linecap: round; }

/* ---- drawing layer (public/cursive-draw.mjs): finger, mouse, stylus via Pointer Events ---- */
.cv-card svg.cv-drawable { touch-action: none; cursor: crosshair; }
.cv-start-dot { fill: #3F8F62; stroke: #FFFFFF; stroke-width: 1.3; }

/* ---- write task (Quill screen D, public/cursive-write-ui.mjs) ---- */
.cw-screen, .cx-screen { position: relative; }
.cw-step-label, .cx-step-label { font-weight: 700; }
/* Stylus note (card 204 follow-up; ROUND 2 Brandie Nov 3 2026: "make sure this ... is RED and
   BOLD. and two font sizes bigger"): 0.95rem → 1.25rem, brand red #B8362A (rule 9; contrast
   5.7:1 on the cream panel — WCAG AA), bold as before; above the drawing area, covering neither
   the paper nor the buttons; fits 390/820/1024. */
.cw-stylus-note { text-align: center; font-size: 1.25rem; font-weight: 700; color: #B8362A; margin: 2px 0 0; }
/* ROUND 4 (Brandie Nov 4 2026): the phone warning — short, kind, under the stylus note, shown
   ONLY where the writing pages use the phone layout (the same ≤780px breakpoint that stacks
   .cw-pair and the demo cards). Hidden on tablet and laptop. One short line so it never pushes
   the buttons off screen. Wording in cursive-strings.mjs (placeholder). */
.cw-phone-warning { display: none; }
.cw-cards, .cx-cards { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin: 0 auto; }
.cw-arrows-card svg.cv-zoomed { max-width: 340px; margin: 0 auto; }
.cw-hidden { display: none; }
.cw-pair { display: flex; gap: 10px; align-items: stretch; }
.cw-pair .cw-model-card { flex: 0 0 36%; display: flex; flex-direction: column; justify-content: center; }
.cw-pair .cw-write-card { flex: 1 1 auto; }
.cw-feedback { min-height: 2.2rem; font-size: 1.35rem; font-weight: 700; text-align: center; margin: 6px 0 0; }
.cw-feedback.good { color: #276844; }
.cw-feedback.try { color: #B8362A; }
.cw-actions, .cx-actions { display: flex; justify-content: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
/* CARD 215: Done waits until all three demo cards have ink — a waiting button looks waiting */
.cw-screen .btn:disabled, .cx-screen .btn:disabled { opacity: 0.45; cursor: default; }

/* ---- word practice (Quill screen E, public/cursive-words-ui.mjs) ---- */
/* The model card keeps the full paper row (same width as the write card) so the child sees the
   word on real lines; both cards share the paper component's aspect. No per-card size overrides. */

/* ---- shared "?" page: the writing-task demo (answer 6; public/cursive-demo.mjs) ---- */
.cv-help-demo { margin-top: 18px; }
.cv-help-demo-caption { font-weight: 600; margin-bottom: 6px; }
.cv-help-demo .cv-demo-card { max-width: 460px; margin: 0 auto 8px; }
.cv-help-demo .cv-demo-card svg.cv-zoomed { max-width: 300px; margin: 0 auto; }

@media (max-width: 780px) {
  .ci-big { font-size: 7rem; }
  .ci-big.ci-print { font-size: 6rem; }
  .ci-stage { min-height: 170px; }
  .ci-choice { min-width: 76px; min-height: 76px; }
  .ci-choice .cursive { font-size: 2.8rem; }
  .ci-choice .ci-print { font-size: 2.1rem; }
  .cv-help .cv-help-piko { width: 72px; }
  .cw-pair { flex-direction: column; }
  .cw-pair .cw-model-card { flex: 0 0 auto; }
  .cw-big-btn { font-size: 1.3rem; padding: 16px 26px; min-height: 68px; }
  .cw-arrows-card.cw-demo-card svg.cv-zoomed { max-width: 300px; }
  /* ROUND 3: the three big demo cards stack on a phone */
  .cw-demo-cards { flex-direction: column; align-items: stretch; }
  .cw-demo-big-card svg { max-height: 34vh; }
  /* ROUND 4: the phone warning shows only here (the phone layout of the writing pages) */
  .cw-phone-warning { display: block; text-align: center; font-size: 0.95rem; font-weight: 600; color: #25312C; margin: 2px 0 0; }
}
