/* ===========================================================
   AKAM — Visual Sentences exercise
   Children 2–4 · landscape tablet
   =========================================================== */

/* -----------------------------------------------------------
   RESPONSIVE MODEL (canonical reference — rewritten 2026-05-29)
   The app is LANDSCAPE-FIRST; the 1024×768 landscape tablet is the design
   baseline. Touch devices are LOCKED to landscape (portrait → .rotate-hint),
   so the only real viewports are phones-in-landscape (~568–932 wide, very
   short ~360–430 tall), tablets (1024–1366), and resized desktop windows.

   ⟹ ALL @media RULES LIVE IN v2/media.css (consolidated 2026-05-30), which is
     <link>ed LAST in v2/index.html so it wins the cascade. There are NO @media
     rules in this file, curriculum/styles.css, or the inline <style>. Edit
     breakpoints in v2/media.css. This legend is the philosophy; that file is
     the rules.

   The guiding principle: LET LAYOUT FLOW; use discrete @media breakpoints
   ONLY where a layout physically cannot flow. There is no global width-tier
   ladder to keep in sync (the previous one drifted because nothing actually
   honoured it). Each surface picks its own mechanism:

     SURFACE            MECHANISM                         BREAKPOINTS?
     Picker grids       repeat(auto-fit, minmax(220px))   none — width-driven by the grid
     Sticker grid       repeat(auto-fit, minmax(150px))   none — same
     Lesson scenes      transform:scale fit-to-container  none — resolution-independent
     Chrome bar         progressive collapse (can't flow) 2 OVERFLOW steps (below)

   minmax(220px) was tuned by measuring real rendered columns (headless
   Chromium, real gap/padding): 2 cols ≤768, 3 cols 844–932, 4 cols 1024→≥1600
   (capped at 4 — 200px over-columns to 5, 240px misses 4 at 1024).

   CHROME OVERFLOW STEPS (v2/media.css §3) — the ONLY discrete width
   breakpoints in the app. Chosen by where the brand + 9-button row actually
   overflows, NOT by a device tier. Do not align these to the picker.
   (The old 520/440/400 sub-640 tiers were deleted 2026-05-30 — the smallest
   real target is the Z30 at 640w landscape, handled by the height-based
   COMPACT axis rule below, not a width step.)
     768  -> drop separators + tighten gaps + collapse pills to icon-only
     560  -> shrink buttons (44->40) + widen gap; wordmark stays

   AXIS RULES (orientation / height — device-true, keep as-is):
     (orientation: portrait) and (pointer: coarse)     -> .rotate-hint (lock touch devices to landscape)
     (orientation: landscape) and (max-height: 600px)  -> phone-landscape COMPACT density (chrome/insets shrink)
     (min-width: 1600px) and (min-height: 800px)       -> TV scale-up / overscan safe-area
     (prefers-reduced-motion: reduce)                  -> a11y animation suppression
   ----------------------------------------------------------- */

:root {
  /* Shared content-column width — used by .chrome, .intro grids, and
     .stage > .ak-card so AKAM brand, module/activity grids, the card,
     and BACK/NEXT all align at the same left/right edges regardless of
     viewport width. */
  --ak-content-w: clamp(720px, 90vw, 1400px);   /* card + BACK/NEXT width; cap 1100→1400 (2026-05-31) so the lesson CARD (container) widens on big screens and the content can grow to fill it instead of being scaled down to fit 1100. 1024/phones sit under 90vw so they're unchanged. */
  /* Shared SHELL width — the chrome bar and the picker grid use this same
     max-width + the same horizontal padding so their left/right edges line up
     with the card columns at every viewport (the chrome used to cap at 1100
     while the grid capped at 1180 → ~40px misalignment). Keep them in sync. */
  --ak-shell-w: clamp(1180px, 90vw, 1700px);   /* chrome bar + picker grid width; cap 1180→1700 (2026-05-31) so they widen on big screens. 1024/phones sit under 90vw → unchanged. */
  --ak-shell-pad: clamp(8px, 2vw, 24px);
  /* Side inset shared by .stage and .chrome. The picker grid lives INSIDE the
     stage (so it's inset by this much); the chrome must use the same inset or
     the bar is wider than the cards below the 1180 cap. One value → no drift. */
  --ak-stage-x: 28px;

  --bg: #FFF4D6;
  --card: #FFFFFF;
  --ink: #4A3F35;
  --ink-soft: #8A7A66;
  /* AA-safe muted ink (WCAG 4.5:1 on the white card/chrome-pill — #8A7A66 is
     only 4.15:1 and fails). Used for small muted labels: the activity-card
     "ACTIVITY ·" prefix and the .phase-label readout. Per-theme overrides below. */
  --ink-soft-aa: #6E614E;
  --pink: #FF8FA3;
  --pink-deep: #E85C7A;
  --teal: #7DD3C0;
  --teal-deep: #2E8F7C;       /* WCAG: 5.0:1 on white (was #4FB8A0 at 2.9:1, failing 3:1 Large) */
  --orange: #FFB454;
  --orange-deep: #B86515;     /* WCAG: 5.3:1 on white (was #F08A1F at 2.9:1, failing 3:1 Large) */
  --yellow: #FFDB5E;
  --violet: #B589E8;
  --violet-deep: #845DC2;
  --sky: #5BCBF0;
  /* shadow color, broken out so colored buttons can override the rgb */
  --shadow-rgb: 74, 63, 53;
  /* chunky drop-shadow depth scale */
  --shadow-1: 0  3px 0 rgba(var(--shadow-rgb), 0.08);
  --shadow-2: 0  4px 0 rgba(var(--shadow-rgb), 0.10);
  --shadow-3: 0  6px 0 rgba(var(--shadow-rgb), 0.10);
  --shadow-4: 0  8px 0 rgba(var(--shadow-rgb), 0.10);
  --shadow-5: 0 10px 0 rgba(var(--shadow-rgb), 0.10);
  --shadow-6: 0 12px 0 rgba(var(--shadow-rgb), 0.10);
  --shadow-7: 0 14px 0 rgba(var(--shadow-rgb), 0.12);
  /* radius scale */
  --r-sm:     22px;
  --r-md:     26px;
  --r-lg:     32px;
  --r-xl:     36px;
  --r-2xl:    40px;
  --r-pill:   99px;
  --r-circle: 50%;

  /* Kids' colour palette — bright noun/word-pill colours + a few `-deep` dashed-
     border companions (`--yellow` is defined above). The legacy pronoun-pill
     (coral/lavender/sand), HE/SHE, brown/gray and seagreen families that lived
     here were removed 2026-06-04 — zero consumers (see git history). */
  --red:         #DD2E44;
  --blue:        #5C9DDB;
  --blue-deep:   #2C5C99;
  --yellow-deep: #C99412;
  --green:       #5BBF60;
  --purple:      #A26BD8;
  /* --agree: forest green for grammatical-agreement marks. */
  --agree:       #3D8B50;
  --agree-deep:  #266339;
  /* --gold: the M6 (NUMBERS) module accent colour (splash + module card). */
  --gold:          #FFD25E;
  /* M5 — "THIS IS NOT" (negation). Semantic aliases over the existing red
     family — keeps the ≠ slash and the NOT word pill in sync, and lets a
     future redesign shift NOT without grep-replacing every --red. */
  --not:         #DD2E44;
  --not-deep:    #9C1F2F;
  /* Brand wordmark colours — the "AKAM Lingua" teal + orange. Theme-invariant
     (the brand stays constant across themes), so defined once here. `-rgb` is the
     bare channels for rgba() glows (e.g. the fullscreen-nudge pulse). */
  --brand-teal:     #2BA89B;
  --brand-teal-rgb: 43, 168, 155;
  --brand-orange:   #EF8A2B;
  /* Chrome-pill background — used for .phase-label (blends with the active theme:
     light on light themes, slate on Twilight). */
  --chrome-pill-bg: rgba(255, 255, 255, 0.7);
  /* (Removed 2026-05-30: the `--glyph-xs…2xl` size scale — it was consumed ONLY
     by the `.u-glyph-*` utilities below, which are emitted nowhere. Lessons size
     images via `--ak-img` instead. Dead island removed; see also the matching
     `.u-glyph-*` deletion.) */
}

/* ===========================================================
   Alternate themes — applied via [data-theme] on <html>.
   Default (no data-theme) keeps the original "Sunny" palette above.
   =========================================================== */

/* "Meadow" — softer, calmer palette for sensitive sessions. */
:root[data-theme="meadow"] {
  --bg:          #F4F8EE;
  --card:        #FFFFFF;
  --ink:         #3F4F3A;
  --ink-soft:    #768770;
  --pink:        #D6889A;
  --pink-deep:   #A0506A;
  --teal:        #8CC196;
  --teal-deep:   #4A7350;
  --orange:      #E8AE5A;
  --orange-deep: #8F6618;
  --yellow:      #F2D67E;
  --yellow-deep: #9C7A12;
  --violet:      #B49AC9;
  --violet-deep: #6C4980;
  --sky:         #92BBD3;
  --red:         #BD5D54;
  --not:         #BD5D54;
  --not-deep:    #8A3F38;
  --blue:        #7AA9C9;
  --blue-deep:   #3D6E8E;
  --green:       #6BAE6F;
  --purple:      #9474B8;
  --ink-soft-aa: #5C6B54;   /* AA muted ink on Meadow's white card (5.5:1) */
  --agree:       #6BA77C;
  --agree-deep:  #3F6E4D;
  --gold:          #D9B856;
  --shadow-rgb:  58, 74, 56;
}

/* "Twilight" — dark mode. Backgrounds dark, text light, accents brighter
   to pop on dark. "-deep" variants are LIGHTER than their base for legibility
   on the dark surface (used in word labels). */
:root[data-theme="twilight"] {
  --bg:          #1F2233;
  --card:        #2C3146;
  --ink:         #F4EBD0;
  --ink-soft:    #B0A88F;
  --pink:        #FF99B5;
  --pink-deep:   #FFC1D2;
  --teal:        #7DD3C0;
  --teal-deep:   #B5EBDE;
  --orange:      #FFB454;
  --orange-deep: #FFD08C;
  --yellow:      #FFEC8A;
  --yellow-deep: #FFE26E;
  --violet:      #C9A4FF;
  --violet-deep: #DFC0FF;
  --sky:         #7DC7F0;
  --red:         #FF8E84;
  --not:         #FF8E84;
  --not-deep:    #FFB8AF;
  --blue:        #92BDE8;
  --blue-deep:   #B7D4F1;
  --green:       #8FD89A;
  --purple:      #C4A6E8;
  --agree:       #88D49A;
  --agree-deep:  #B6E5C2;
  --gold:          #FFE08A;
  --shadow-rgb:  0, 0, 0;
  /* Chrome pill (phase label + progress bar wrap) is white-ish by default which
     reads poorly on the dark Twilight background. Warm cream tint at low
     opacity so the pills feel "of the theme" while staying readable. */
  --chrome-pill-bg: rgba(244, 235, 208, 0.14);
}
:root[data-theme="twilight"] .phase-label {
  color: var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* Accessibility: visible focus ring for keyboard users. */
button:focus-visible,
.u-tile:focus-visible {
  outline: 3px solid var(--pink-deep);
  outline-offset: 3px;
}

/* Accessibility: the reduced-motion @media block (the ONE documented
   `!important` exception) moved to v2/media.css 2026-05-30 — ALL @media rules
   now live there. See that file. */

/* ===========================================================
   Utility primitives — additive, use alongside semantic classes.
   Shared visual primitives: surface paint, radius scale,
   chunky drop-shadow scale, press micro-interaction, tile composite.
   =========================================================== */

/* surface — white card paint */
.u-surface { background: var(--card); }

/* radius — only the circle utility is applied in markup; the unused
   .u-r-sm/md/lg/xl/2xl/pill rules were removed 2026-06-04 (the --r-* tokens
   stay — they're used directly by other rules). */
.u-r-circle { border-radius: var(--r-circle); }

/* (Removed 2026-05-30: the `.u-glyph-xs…2xl` utilities — emitted nowhere;
   lessons size images via --ak-img. Their `--glyph-*` tokens went too.) */

/* chunky drop-shadow scale — only u-shadow-2 is applied (the other
   .u-shadow-N rules were removed 2026-06-04; --shadow-* tokens used directly stay). */
.u-shadow-2 { box-shadow: var(--shadow-2); }

/* press-stamp — active also drops the drop-shadow. Pair with u-shadow-*.
   (The plain `.u-press`, `.u-pair-underline` + its keyframes, and `.u-plural-s`
   primitives were emitted nowhere and removed 2026-06-04.) */
.u-press-stamp {
  transition: transform 150ms cubic-bezier(.34,1.56,.64,1),
              box-shadow 150ms;
}
.u-press-stamp:hover  { transform: translateY(-2px); }
.u-press-stamp:active { transform: translateY( 4px); box-shadow: var(--shadow-2); }

/* tile — composite for tappable cards. = u-surface + u-r-lg + u-shadow-6
   plus lift on hover, sink on active. */
.u-tile {
  background: var(--card);
  border: none;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-6);
  transition: transform 220ms cubic-bezier(.34,1.56,.64,1),
              box-shadow  220ms;
  cursor: pointer;
}
.u-tile:hover  { transform: translateY(-4px); box-shadow: var(--shadow-7); }
.u-tile:active { transform: translateY( 2px); box-shadow: var(--shadow-2); }

/* ---------- top chrome ---------- */
.chrome {
  position: fixed; top: 0;
  /* Same side inset as .stage so the bar's box matches the picker grid's box
     (the grid is inside the stage). Combined with --ak-shell-w + --ak-shell-pad
     below, the AKAM wordmark and the controls align with the card columns at
     every width — not just above the 1180 cap. */
  left: var(--ak-stage-x); right: var(--ak-stage-x);
  max-width: var(--ak-shell-w);
  margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  /* Horizontal padding matches .module-grid's --ak-shell-pad so the AKAM
     wordmark lines up with the left card column and the controls line up with
     the right card column. */
  padding: 18px var(--ak-shell-pad);
  z-index: 30;
  /* Opaque background so the picker's scrolling cards tuck BEHIND the fixed bar
     instead of showing through it (the bar is position:fixed, but without a
     background the cards bled over it and it didn't read as fixed). --bg is
     theme-aware. The soft shadow gives the "content scrolls under a fixed bar"
     cue. The bar's box = the grid box (--ak-shell-w/-pad/-stage-x), so its
     opaque extent matches the card columns — consistent with the alignment. */
  background: var(--bg);
  box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 0.2);
}
/* ----- AKAM brand mark — bold wordmark, larger than the original. */
.brand {
  font-weight: 800;
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: 0.01em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;   /* keep "AKAM Lingua" on one line in the chrome bar */
}
/* Two-tone brand wordmark — teal AKAM + orange Lingua, matching the OG / social
   card so the brand colours are consistent everywhere. */
.brand-a { color: var(--brand-teal); }
.brand-l { color: var(--brand-orange); }
.nav-buttons {
  display: flex; gap: 10px;
}
.nav-btn {
  /* visual primitives via utilities: u-r-circle u-surface u-shadow-2 u-press-stamp */
  width: 44px; height: 44px;
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: transform 150ms cubic-bezier(.34,1.56,.64,1),
              box-shadow 150ms, color 140ms;
}
.nav-btn svg { width: 22px; height: 22px; display: block; }
.nav-btn:hover           { color: var(--pink-deep);   }
.nav-btn#home-btn:hover  { color: var(--teal-deep);   }
.nav-btn#mute-btn:hover  { color: var(--violet-deep); }

/* (Legacy `.mute-on` / `.mute-off` SVG-swap rules removed 2026-05-29 — the
   v2 mute button is a single `<img>` with a CSS-only `::after` red slash +
   grayscale filter when `aria-pressed="true"` (see v2/index.html style
   block). The aria-pressed="true" ink-soft colouring is preserved.) */
.nav-btn#mute-btn[aria-pressed="true"]  { color: var(--ink-soft); }

.phase-label {
  font-weight: 600; font-size: 18px; color: var(--ink-soft-aa);
  background: var(--chrome-pill-bg);
  padding: 8px 18px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
/* ---------- stage ---------- */
/* Top inset clears chrome (~80px); bottom inset reserves room for NEXT/BACK
   buttons + the activity progress bar. Equal left/right keeps the scene
   horizontally centered. */
.stage {
  /* SINGLE SOURCE OF TRUTH for the lesson canvas (consolidated 2026-05-29).
     Was split across this file (`position:absolute; inset:84 28 116 28;
     display:grid`) AND v2/index.html's inline `<style>` (`height:100vh;
     display:flex; padding`). The inline `height:100vh` over-constrained the
     absolute box, so the `inset` BOTTOM (116) was silently ignored and
     `display:grid` was dead — the box actually rendered as top:84 + 100vh
     (hanging ~84px below the fold) with a top-anchored flex column. This rule
     states that *effective* model explicitly: one positioning model, nothing
     silently ignored. Content clears the chrome (padding-top) and the NEXT bar
     (padding-bottom); NEXT/BACK/HEAR are fixed to the viewport, so the box's
     below-fold overhang is just clipped empty padding. Media-query overrides
     (TV / phone-landscape / fullscreen) adjust top/left/right only. */
  position: absolute;
  top: 84px;
  left: var(--ak-stage-x);
  right: var(--ak-stage-x);
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: clamp(56px, 7vh, 76px) 0 clamp(112px, 14vh, 148px);
  /* Lesson cell sizing — images/gaps/fonts scale with viewport; fit-to-
     container shrinks long lineups. */
  --ak-img:       clamp(80px, 12vw, 180px);
  --ak-gap:       clamp(20px, 3.5vw, 60px);
  --ak-pill-font: clamp(18px, 2.8vw, 36px);
}

/* (Removed 2026-05-29, dead-code audit: the `.glyph.paired-pronoun-glyph` /
   `.pair-slash` / `.splash-demo` block. It was the OLD M4 "boy/slash/girl"
   paired-pronoun cell — that curriculum moved to M7 HE&SHE long ago, the rules
   were self-documented "currently unreferenced", and neither boot.js nor
   renderer.js emits any of those classes. The live HE/SHE deictic ▶ is the
   `clip-path` `::before` in curriculum/styles.css.) */
/* ---------- big NEXT button ---------- */
.next-btn {
  position: fixed;
  bottom: 24px;
  /* Align NEXT's right edge with the card / grid right edge instead of the
     viewport edge — the wider the viewport, the further inward the button
     pulls so it never drifts past the content column. The max() floor
     keeps a 28px gap from the viewport at very narrow widths where the
     content column is already at 90vw. */
  right: max(28px, calc((100vw - var(--ak-content-w)) / 2));
  height: 78px;
  padding: 0 32px;
  background: var(--orange);
  color: white;
  font-weight: 700; font-size: 24px;
  letter-spacing: 0.08em;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 0 var(--orange-deep);
  transition: transform 150ms;
  display: flex; align-items: center; gap: 14px;
  z-index: 20;
}
.next-btn:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--orange-deep); }
.next-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 var(--orange-deep); }
.next-btn.pulse { animation: next-pulse 1.4s ease-in-out infinite; }
@keyframes next-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* Quiz BACK button — muted-red mirror of .next-btn on the bottom-left.
   Same chassis (height/padding/font/radius/press-stamp) as NEXT so the two
   read as a matched pair; uses --pink instead of --red so it sits one
   step below NEXT in visual weight — present without competing. */
.back-btn {
  position: fixed;
  bottom: 24px;
  /* Mirror of .next-btn — align left edge with the content column. */
  left: max(28px, calc((100vw - var(--ak-content-w)) / 2));
  height: 78px;
  padding: 0 32px;
  background: var(--pink);
  color: white;
  font-weight: 700; font-size: 24px;
  letter-spacing: 0.08em;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 0 var(--pink-deep);
  transition: transform 150ms;
  display: flex; align-items: center; gap: 14px;
  z-index: 20;
}
.back-btn:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--pink-deep); }
.back-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 0 var(--pink-deep); }

/* ---------- correct/incorrect feedback ---------- */
/* ---------- confetti ---------- */
.confetti-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden;
}
.confetti {
  position: absolute; top: -20px;
  width: 12px; height: 18px;
  opacity: 0.95;
  animation: confetti-fall 1.6s linear forwards;
}
@keyframes confetti-fall {
  /* Use calc(100vh + 200px) so confetti continues off-screen even on iOS
     Safari where the address bar reduces visible viewport mid-animation. */
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(calc(100vh + 200px)) rotate(720deg); opacity: 0.6; }
}

/* ---------- intro screen (module picker) ---------- */
.intro {
  /* FIXED scroll layer (2026-05-29). Was `position:absolute; inset:0` inside
     #stage — but #stage is `height:100vh` offset to `top:84px`, so its box hung
     84px BELOW the viewport and the bottom picker cards landed off-screen with
     no overflow to scroll (the content fit the mis-positioned box). Switching to
     `position:fixed; inset:0` makes the picker viewport-relative (no transformed
     ancestor exists, and #stage's `overflow:hidden` doesn't clip fixed children),
     so it scrolls within the real viewport and every card is reachable.
     `padding-top` clears the fixed chrome; horizontal padding stays 0 so the
     grid (which carries --ak-shell-pad) defines the inset and matches the chrome
     box exactly. */
  position: fixed; inset: 0;
  background: var(--bg);
  /* Side padding = --ak-stage-x: now that .intro is full-viewport (not nested
     in #stage, which used to supply this 28px inset), the picker must provide
     it so the grid's box still matches the chrome box (chrome uses the same
     --ak-stage-x left/right). Top padding clears the fixed chrome. */
  padding: clamp(80px, 11vh, 104px) var(--ak-stage-x) clamp(16px, 3vh, 32px);
  overflow-y: auto; overflow-x: hidden;
  /* Native scrollbar HIDDEN. Chrome on Windows 11 uses auto-hiding overlay
     scrollbars that IGNORE `::-webkit-scrollbar` styling (they flash on load
     then fade — verified it can't be forced to a classic bar here, headless
     behaves the same). So we hide the native bar and draw our own always-
     visible-while-overflowing thumb (`.ak-picker-scrollbar`, wired in boot.js
     `_pickerScrollbar`). The custom thumb is `position:fixed` and floats OVER
     the content — it takes no layout width, so the grid never shifts and chrome
     alignment stays Δ=0 whether or not the picker scrolls. */
  scrollbar-width: none;                               /* Firefox */
}
.intro::-webkit-scrollbar { width: 0; height: 0; }     /* Chrome/Safari/Edge */

/* Custom picker scroll indicator — visible ONLY while the picker overflows,
   draggable, floats over content (no layout width → no grid shift). */
.ak-picker-scrollbar {
  position: fixed;
  top: clamp(80px, 11vh, 104px);          /* below the chrome — matches .intro pad-top */
  bottom: clamp(10px, 2vh, 20px);
  right: 5px;
  width: 8px;
  border-radius: 999px;
  background: rgba(120, 110, 90, 0.16);
  z-index: 25;                            /* over the cards, under the chrome (30) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}
.ak-picker-scrollbar.is-active { opacity: 1; pointer-events: auto; }
.ak-picker-thumb {
  position: absolute; left: 0; right: 0; top: 0;
  border-radius: 999px;
  background: var(--ink-soft, #8a7d6d);
  cursor: grab;
  transition: background 120ms;
}
.ak-picker-thumb.is-grabbing { cursor: grabbing; background: var(--ink, #4a3f35); }
.intro-modules {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* TOP-aligned, not centred: vertical centring pushed overflowing rows above
     the scroll origin where they couldn't be reached. Top-align + scroll keeps
     every card reachable; a header + grid reads naturally from the top anyway. */
  justify-content: flex-start;
  gap: clamp(16px, 3vh, 28px);
}
.intro-header {
  text-align: center;
}
/* (Legacy .intro-title rule removed 2026-05-29 — picker renderers emit only
   `<p class="intro-sub">`, not `.intro-title`, so this selector matched
   nothing.) */
.intro-sub {
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--ink-soft);
  margin: 0;
  font-weight: 500;
}
/* Empty-state line — shown by the activity picker when the filter hides every
   activity. (Replaces an inline style="text-align:center;opacity:0.7" in boot.js
   — the only hardcoded inline style string in the app's JS templates.) */
.intro-sub-warn { text-align: center; opacity: 0.7; }

/* Module tile grid — scales 2→12 modules naturally over 2–3 rows */
/* The operative picker-grid rule is `.intro .module-grid` (below) — both the
   module and activity pickers always render the grid inside `.intro`, so the
   former standalone `.module-grid` block here was fully shadowed (and disagreed
   on `gap`); removed 2026-06-04 to keep one source of truth.
   v2/media.css §2f overrides the column track on big screens. */
/* ============================================================================
   Module / activity picker card — "C-Compact" layout (2026-05-28 redesign).

   Card anatomy (4 stacked sections inside a single .module-card button):

     ┌──────────────────────────────────────────┐
     │  MODULE 1 — FIRST WORDS                  │  ← .module-banner (accent bg)
     ├──────────────────────────────────────────┤
     │      🍎    1️⃣    🍌    🍐                │  ← .module-preview (4 emojis,
     │   Basic words, counting, colours         │     space-around full width)
     │   13 NEW WORDS · 3 SENTENCES             │  ← .module-desc + .module-count
     └──────────────────────────────────────────┘

   Sizing target: ~110 px tall so 4 cols × 5 rows fits a 1024×768 viewport
   without scroll (20 modules total — 12 implemented + 8 locked stubs).
   ============================================================================ */
.module-card {
  position: relative;
  padding: 0 0 8px;
  display: flex;
  flex-direction: column;
  min-height: 110px;
  overflow: hidden;
  min-width: 0;
  text-align: center;
}
/* Gentler hover lift than the default `.u-tile:hover` (translateY(-4px)).
   At 4 px the row-1 banner ("MODULE 1 — …") almost kisses the "Pick a
   module to start" header sitting above the grid; 2 px keeps the tactile
   feedback without crowding the upper edge. The active state stays a
   slight push-down. Locked cards still suppress all motion below. */
.module-card:hover  { transform: translateY(-2px); }
.module-card:active { transform: translateY(1px); }
.module-card.locked:hover,
.module-card.locked:active {
  transform: none;
  box-shadow: var(--shadow-6);
}
.module-card.module-teal   { --card-accent: var(--teal);   }
.module-card.module-pink   { --card-accent: var(--pink);   }
.module-card.module-orange { --card-accent: var(--orange); }
.module-card.module-sky    { --card-accent: var(--sky);    }
.module-card.module-red    { --card-accent: var(--not);    }
.module-card.module-gold   { --card-accent: var(--gold);   }
.module-card.module-purple { --card-accent: var(--violet); }
.module-card.module-green  { --card-accent: var(--green);  }

/* Banner = accent-coloured header bar. Replaces the old 10px top stripe AND
   carries the module/activity number + title in a single centred line.
   NOTE (2026-05-30): white-on-accent here fails WCAG AA on the bright accents;
   the fix (deepen bg vs dark text) is a deferred DESIGN call — `color-contrast`
   stays allowlisted in verify-a11y.mjs for this surface. See MEMORY.md. */
.module-banner {
  background: var(--card-accent, var(--ink-soft));
  color: #fff;
  padding: 6px clamp(8px, 1vw, 14px);
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  /* Explicit rounded top corners so the banner colour matches the card's
     rounded shape even when the parent `<button>` + `overflow: hidden`
     combination doesn't subpixel-clip perfectly (visible at wider 2-col
     cards in particular). `inherit` picks up the card's `var(--r-lg)`. */
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.module-banner .module-num   { font-weight: 800; flex-shrink: 0; }
.module-banner .module-sep   { opacity: 0.7; font-weight: 500; flex-shrink: 0; }
.module-banner .module-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Body fills the rest of the card and centres its 3-row content cluster
   vertically — so any extra height from a tall neighbour in the same grid
   row splits evenly above + below the cluster rather than dumping at the
   bottom. No internal blank space at any card height. */
.module-body {
  padding: 6px clamp(8px, 1vw, 14px) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* 4 emoji preview row — `space-around` spreads emojis across the full body
   width so there's no blank horizontal pad either side. Empty preview (locked
   stubs) collapses to 0 height; the body re-centres without it. */
.module-preview {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 2px 4px;
  min-width: 0;
}
.module-preview img {
  width: clamp(22px, 2.6vw, 30px);
  height: clamp(22px, 2.6vw, 30px);
  object-fit: contain;
  flex-shrink: 0;
}
.module-preview:empty { display: none; }

.module-desc {
  font-size: clamp(8px, 0.85vw, 10.5px);
  color: var(--ink-soft-aa);
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.module-desc.is-filter-warn { opacity: 0.6; }
.module-desc:empty { display: none; }

.module-count {
  font-size: clamp(9.5px, 0.95vw, 11px);
  font-weight: 700;
  color: var(--ink-soft-aa);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.15;
  width: 100%;
}

/* ============================================================================
   Activity card variant (Option B — "Number badge, no banner", 2026-05-28).

   Differentiates the activity picker from the module picker so the two
   screens read as distinct. The accent that fills the module banner shrinks
   to a small circular *badge* next to the activity number; the title sits
   beside it in dark ink; a thin accent rule underlines the header. Body
   (4-emoji preview row + desc + count) is identical to module cards.

   Scoped via `.module-card.is-activity` so it applies only to the activity
   picker — the module picker still uses the solid banner above.
   ============================================================================ */
.module-card.is-activity .activity-header {
  position: relative;
  padding: 9px 12px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}
/* Thin accent underline anchored to the bottom of the header — gives each
   card a small "accent identity" without the full coloured banner. */
.module-card.is-activity .activity-header::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 2px;
  background: var(--card-accent, var(--ink-soft));
  opacity: 0.85;
  border-radius: 2px;
}
.module-card.is-activity .activity-badge {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card-accent, var(--ink-soft));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
/* Header text styling — the word "ACTIVITY", the "·" separator, and the
   activity title all render at the same size/weight/colour so they read as
   one continuous phrase wrapping the number badge. The prefix and sep are
   separate spans so the test selector `.module-title` returns just the
   topic text (e.g. "QUIZ"), not the surrounding "ACTIVITY 1 · …". */
.module-card.is-activity .activity-header > .activity-prefix,
.module-card.is-activity .activity-header > .activity-sep,
.module-card.is-activity .activity-header > .module-title {
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 0;
}
.module-card.is-activity .activity-header > .activity-sep {
  opacity: 0.45;
  font-weight: 500;
}
.module-card.is-activity .activity-header > .module-title {
  flex-shrink: 1;   /* title is the longest piece — let it ellipsise first */
}
/* Slightly larger body padding-top so the preview row sits below the
   accent underline with breathing room. */
.module-card.is-activity .module-body { padding-top: 8px; }

/* Locked / coming-soon tile. The banner desaturates (override the accent
   colour) so the locked block reads as muted but still keeps each stub
   visually distinct via its rotated accent palette; the lock icon floats
   inside the banner on the right. */
.module-card.locked {
  cursor: not-allowed;
  opacity: 0.62;
}
.module-card.locked .module-banner {
  background: color-mix(in srgb, var(--card-accent, var(--ink-soft)) 55%, #b8b1a3);
}
.module-card.locked::after {
  content: "🔒";
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 13px;
  opacity: 0.9;
  pointer-events: none;
}
/* One-shot shake fired when a child taps a locked tile (paired with sfx.bloop
   in the click handler) so the tap registers as "not yet ready" rather than
   silently failing. Reduced-motion users get a no-op via the global animation
   override (* { animation-duration: 0.001ms !important } in the
   prefers-reduced-motion query). */
.module-card.shake-once {
  animation: module-shake 360ms cubic-bezier(.36,.07,.19,.97) 1 both;
}
@keyframes module-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px);  }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px);  }
  0%, 100% { transform: translateX(0);    }
}
.start-btn {
  height: 100px; padding: 0 60px;
  background: var(--teal);
  color: white;
  font-weight: 700; font-size: 36px;
  letter-spacing: 0.12em;
  border-radius: var(--r-pill);
  box-shadow: 0 10px 0 var(--teal-deep);
  transition: transform 150ms;
}
.start-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--teal-deep); }
.start-btn:hover { transform: translateY(-2px); }

/* Finish-screen action stack — primary CONTINUE + secondary ALL MODULES */
.finish-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.start-btn.secondary {
  height: 64px;
  padding: 0 36px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  box-shadow: var(--shadow-4);
}
.start-btn.secondary:hover  { transform: translateY(-2px); box-shadow: var(--shadow-5); }
.start-btn.secondary:active { transform: translateY( 4px); box-shadow: var(--shadow-2); }

/* ---------- Splash-go button (now used ONLY by cheer-screen continue buttons,
   which carry `class="splash-go-btn cheer-continue-btn"`; the cheer rules below
   supply the background). The legacy `.splash` between-exercise SCENE and its
   module-themed backgrounds / `.splash-title` were removed 2026-05-29 (dead-code
   audit) — the v2 'splash' card kind renders as an `.ak-card-titleonly` card via
   the renderer, no `.splash` element is ever emitted. ---------- */
.splash-go-btn {
  height: clamp(72px, 10vh, 96px);
  padding: 0 clamp(40px, 6vw, 64px);
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: 0.12em;
  color: white;
  transition: transform 150ms, box-shadow 150ms;
}
.splash-go-btn:hover { transform: translateY(-2px); }

/* Cheer-screen continue button — appears only after the LAST exercise of a
   module, letting the user advance to the finish screen on their own. */
.cheer-continue-btn {
  margin-top: clamp(12px, 2vh, 24px);
  background: var(--pink);
  box-shadow: 0 10px 0 var(--pink-deep);
  animation: next-pulse 1.4s ease-in-out infinite;
}
.cheer-continue-btn:hover  { transform: translateY(-2px); }
.cheer-continue-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--pink-deep); }

/* ---------- cheer screen (between exercises) ---------- */
.cheer {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(16px, 2.4vh, 28px);
  background: var(--bg);
  text-align: center;
}
.cheer-stars { display: flex; gap: 24px; }
.cheer-stars span {
  font-size: clamp(70px, 9vw, 120px);
  animation: star-spin 1.6s ease-in-out infinite;
}
.cheer-stars span:nth-child(2) { animation-delay: 180ms; }
.cheer-stars span:nth-child(3) { animation-delay: 360ms; }
.cheer-title {
  font-size: clamp(56px, 7vw, 100px);
  margin: 0;
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}
.cheer-sub {
  font-size: clamp(20px, 2.4vw, 32px);
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0;
}
/* (Removed 2026-05-29, dead-code audit: `.cheer-buddy` + its `buddy-bounce`
   keyframe, and `.intro-greeting`. The buddy character and the "Hi, <name>!"
   greeting were removed with personalization on 2026-05-25; boot.js emits
   neither `cheer-buddy`/`toast-buddy` nor `intro-greeting`. `star-spin` is kept
   — `.cheer-stars span` still uses it.) */

/* ---------- finish screen ---------- */
/* star-spin keyframe is used by .cheer-stars span (above). */
@keyframes star-spin {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50%      { transform: rotate(10deg) scale(1.15); }
}

/* ---------- transition between cards ---------- */
.scene-enter { animation: scene-in 480ms cubic-bezier(.34,1.56,.64,1); }
@keyframes scene-in {
  0%   { transform: scale(0.94); }
  100% { transform: scale(1); }
}


/* ---------- settings overlay ---------- */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: rgba(var(--shadow-rgb), 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: settings-fade 200ms ease-out;
}
.settings-overlay[hidden] { display: none; }
@keyframes settings-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
.settings-panel {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-7);
  padding: clamp(18px, 3vh, 40px) clamp(22px, 3vw, 44px);
  width: min(880px, 94vw);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 22px);
  /* Safety net for ultra-short screens — cap to the viewport and scroll rather
     than clip (the old bug was a fixed-height panel with no scroll). */
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  animation: settings-pop 320ms cubic-bezier(.34,1.56,.64,1);
}
/* Card grid: each setting is its own tile. Landscape-friendly — the app is
   locked to wide-but-short screens, so tiles auto-fit into 2–3 COLUMNS and
   collapse to 1 column on a genuinely narrow window. */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: clamp(10px, 1.6vh, 16px) clamp(12px, 1.6vw, 18px);
}
@keyframes settings-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.settings-head {
  display: flex; justify-content: space-between; align-items: center;
}
.settings-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}
.settings-close {
  width: 40px; height: 40px;
  border-radius: var(--r-circle);
  background: rgba(0,0,0,0.06);
  color: var(--ink-soft);
  font-size: 28px; line-height: 1;
  display: grid; place-items: center;
  transition: background 150ms;
}
.settings-close:hover { background: rgba(0,0,0,0.12); }
.settings-tile {
  display: flex; flex-direction: column; gap: 11px;
  background: rgba(0,0,0,0.035);
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: var(--r-xl, 24px);
  padding: 14px 16px 16px;
}
/* The `display: flex` above outranks the UA [hidden] rule, so a `hidden`
   tile would still show. Restore hiding for tiles gated behind ?demo. */
.settings-tile[hidden] { display: none; }
.settings-tile-head {
  display: flex; align-items: center; gap: 9px;
}
.settings-emoji {
  font-size: clamp(18px, 2vw, 22px); line-height: 1;
}
.settings-label {
  font-weight: 700;
  font-size: clamp(12.5px, 1.4vw, 15px);
  letter-spacing: 0.12em;
  color: var(--ink-soft-aa);
  text-transform: uppercase;
}
/* Quiet legal/links footer at the bottom of the panel. */
.settings-foot {
  text-align: center;
  color: var(--ink-soft-aa);
  font-size: clamp(11.5px, 1.2vw, 13px);
  font-weight: 500;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.settings-foot a { color: var(--pink-deep); font-weight: 700; text-decoration: none; }
.settings-foot a:hover { text-decoration: underline; }

/* Offline-download tile (Settings). Teal action button (brand colour) to set it
   apart from the pink option toggles. */
.settings-tile-offline .offline-body { display: flex; flex-direction: column; gap: 9px; }
.offline-btn {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: #1F7A68;            /* AA-safe (~5.2:1 with white) — matches the HEAR pill */
  color: #fff;
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 14px);
  box-shadow: 0 4px 0 #155e50;
  transition: transform 150ms, background 150ms, opacity 150ms;
}
.offline-btn:hover  { background: #1a6a5a; }
.offline-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #155e50; }
.offline-btn:disabled { opacity: 0.65; cursor: default; }
.offline-progress {
  height: 8px; border-radius: 99px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.offline-bar {
  height: 100%; width: 0%;
  background: var(--brand-teal);
  border-radius: 99px;
  transition: width 200ms ease;
}
.offline-status {
  font-size: clamp(11.5px, 1.2vw, 13px);
  color: var(--ink-soft-aa);
  font-weight: 600;
}
.offline-status.is-saved { color: #1F7A68; }
.offline-status.is-error { color: var(--pink-deep); }
.settings-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.settings-row button {
  /* Compact enough that a 3-option row (Sunny / Meadow / Twilight) stays on one
     line inside the grid columns at every size — including the ~240px columns of
     the 3-column desktop layout — instead of wrapping. */
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.04);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 14px);
  white-space: nowrap;
  transition: background 180ms, transform 150ms;
}
.settings-row button:hover  { background: rgba(0,0,0,0.10); }
.settings-row button:active { transform: scale(0.96); }
.settings-row button.on {
  background: var(--pink);
  color: white;
  box-shadow: 0 4px 0 var(--pink-deep);
}
/* (Removed 2026-06-02: dead .settings-hint / .settings-input / .settings-buddies
   rules — the child-name input + buddy picker were removed 2026-05-25 and no
   element uses these classes any more.) */
.nav-btn#settings-btn:hover { color: var(--violet-deep); }

/* ---------- Info / About hub overlay ----------
   Reuses .settings-overlay (backdrop) + .settings-panel (card) from above, so
   it inherits the pop-in animation, scroll safety, and theming. These rules
   only style its inner content. */
.info-panel { width: min(560px, 94vw); }
.info-acronym {
  margin: -2px 0 4px;
  color: var(--brand-teal);
  font-weight: 600;
  font-size: clamp(12.5px, 1.4vw, 14px);
  letter-spacing: 0.2px;
}
.info-method {
  margin: 0 0 11px;
  color: var(--ink-soft-aa);
  font-size: clamp(12.5px, 1.5vw, 14px);
  line-height: 1.5;
}
.info-lead {
  margin: 0;
  color: var(--ink-soft-aa);
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.55;
}
.info-links { display: flex; flex-direction: column; gap: 10px; }
.info-link {
  display: flex; align-items: center; gap: 14px;
  background: rgba(0,0,0,0.035);
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: var(--r-xl, 24px);
  padding: 13px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: background 160ms, transform 140ms;
}
.info-link:hover  { background: rgba(0,0,0,0.07); }
.info-link:active { transform: scale(0.98); }
.info-link-em { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.info-link span:last-child { display: flex; flex-direction: column; }
.info-link strong { font-size: clamp(15px, 1.7vw, 17px); font-weight: 700; }
.info-link small  { color: var(--ink-soft-aa); font-size: clamp(12px, 1.3vw, 13.5px); }
.info-social-head {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: clamp(11.5px, 1.2vw, 13px); color: var(--ink-soft-aa); margin-top: 2px;
}
.info-social { display: flex; flex-wrap: wrap; gap: 8px; }
.info-social a {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.05);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-weight: 700; font-size: clamp(13px, 1.3vw, 14px);
  color: var(--ink); text-decoration: none;
  transition: background 160ms, transform 140ms;
}
.info-social a:hover  { background: rgba(0,0,0,0.10); }
.info-social a:active { transform: scale(0.96); }
.nav-btn#info-btn:hover { color: var(--teal-deep, #1F7A68); }

/* ---------- portrait-orientation guard ----------
   The app is designed for landscape tablets (~1024×768). On portrait or very
   narrow viewports the layout is unusable. Show a friendly hint overlay
   asking to rotate the device. */
.rotate-hint {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  align-items: center; justify-content: center; flex-direction: column;
  gap: 24px;
  text-align: center;
  padding: 32px;
}
.rotate-hint .icon {
  font-size: 96px;
  animation: rotate-hint-spin 2s ease-in-out infinite;
}
.rotate-hint h2 {
  font-size: clamp(24px, 5vw, 40px);
  color: var(--pink-deep);
  margin: 0;
}
.rotate-hint p {
  font-size: clamp(16px, 3vw, 22px);
  color: var(--ink-soft);
  margin: 0;
  max-width: 400px;
}
@keyframes rotate-hint-spin {
  0%, 100% { transform: rotate(-10deg); }
  50%      { transform: rotate(80deg);  }
}
/* (The landscape-lock `@media (orientation:portrait) and (pointer:coarse)` and
   the TV-overscan `@media (min-width:1600) and (min-height:800)` blocks moved to
   v2/media.css 2026-05-30 — ALL @media rules now live there. The `.rotate-hint`
   base styling above stays here; only the @media that flips it to display:flex
   moved.) */

/* ============================================================
   Session 21 — Voice synthesis UI
   ============================================================ */

/* --- Onboarding overlays (audience picker + voice prompt) --- */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: rgba(var(--shadow-rgb), 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: clamp(16px, 3vw, 32px);
}
.onboarding-overlay[hidden] { display: none; }
.onboarding-panel {
  background: var(--card);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-7);
  padding: clamp(24px, 4vw, 48px);
  max-width: 720px;
  width: 100%;
}
.onboarding-title {
  margin: 0 0 clamp(16px, 2.4vh, 28px);
  text-align: center;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--ink);
}
.voice-prompt-body {
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 clamp(20px, 3vh, 32px);
}
.voice-prompt-actions {
  display: flex; justify-content: center;
  gap: clamp(12px, 2vw, 24px);
}
.voice-prompt-btn {
  background: var(--card);
  border: 3px solid var(--ink-soft);
  border-radius: var(--r-pill);
  padding: clamp(10px, 1.6vh, 16px) clamp(20px, 3vw, 36px);
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 700;
  cursor: pointer;
}
.voice-prompt-btn.primary {
  background: var(--pink);
  border-color: var(--pink-deep);
  color: var(--ink);
}

/* --- Per-card "Hear" button — wrapped pill + icon ---
   Both elements live inside a soft teal-tinted capsule that unifies them as
   one tappable affordance while keeping the HEAR word and speaker pictogram
   visually distinct. The capsule has a subtle stacked-paper shadow matching
   the rest of AKAM's surface tokens. */
.hear-btn {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 20px);
  background: color-mix(in srgb, var(--teal) 35%, var(--card));
  border: 3px solid var(--teal-deep);
  border-radius: var(--r-pill);
  padding: clamp(8px, 1.2vh, 14px) clamp(14px, 2vw, 22px);
  cursor: pointer;
  /* Overlap upward into the card's bottom padding zone (~26–44px tall) so the
     Hear button visually hugs the sentence row rather than sitting far below
     the card's empty padding area. The button stays a DOM sibling OUTSIDE the
     card; only its rendering position overlaps. z-index keeps it above the
     card's surface fill. */
  margin: clamp(-44px, -4.4vh, -28px) auto 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 5px 0 rgba(var(--shadow-rgb), 0.12);
  transition: transform 100ms ease, box-shadow 100ms ease, opacity 100ms ease;
}
.hear-btn-pill {
  display: inline-flex;
  align-items: center;
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: 0.04em;
  /* Dedicated darker teal: --teal-deep (#2E8F7C) is only 3.94:1 on the white
     pill, and at the 18px .stage size (below the 18.66px bold "large text"
     cutoff) AA wants 4.5:1. #1F7A68 = 5.2:1. Twilight overrides to dark-on-white
     below, so this only affects the light themes. (Contrast pass 2026-05-30.) */
  color: #1F7A68;
  text-transform: uppercase;
}
.hear-btn-icon {
  width:  clamp(48px, 5vw, 72px);
  height: clamp(48px, 5vw, 72px);
  pointer-events: none;
}
.hear-btn:hover  { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(var(--shadow-rgb), 0.14); }
.hear-btn:active { transform: translateY(2px);  box-shadow: none; }
.hear-btn[hidden] { display: none; }

/* Tap-to-speak bob lives in curriculum/styles.css now (.ak-tap-bob keyframe);
   legacy .vocab-bob / .pill-bob selectors removed along with the legacy
   sentence engine 2026-05-27. */


/* ============================================================================
   MIGRATED 2026-05-30 from v2/index.html inline <style> — SHELL rules (chrome,
   fullscreen, crumb, segment bar, picker grid/intro-sub, next/back/hear, toasts,
   twilight). The inline <style> is GONE; this is the single home for these.
   ============================================================================ */
/* ===== Chrome nav buttons — bigger emoji icons, friendlier feel =====
   Each nav button shows a single large twemoji-style emoji centred in
   a circular surface. Sizing is generous so the icon is the focal
   point, not just decoration. The mute button keeps its colour-coded
   state (green = unmuted, gray = muted, red slash overlay). */
.v2-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  /* 44×44 — WCAG 2.5.5 + Apple HIG minimum tap target. The 15% shrink
     to 37px shipped 2026-05-29 was reverted 2026-05-29 (later same day)
     after the a11y audit flagged it as the largest single regression for
     the kid + reading-disability audience this app is built for. The
     chrome row + crumb pill still fit comfortably at this size. */
  width:  44px;
  height: 44px;
}
.v2-nav-btn:hover  { transform: translateY(-2px); }
.v2-nav-btn:active { transform: translateY(1px); }
/* Explicit focus-visible — the generic button rule in styles.css uses
   outline-offset:3px, which on a round button with overflow:hidden ends
   up partly clipped. Use an inset box-shadow ring instead so it lives
   inside the round surface. */
.v2-nav-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--pink-deep), 0 0 0 3px rgba(255, 122, 158, 0.35);
}

/* Activity-filter pill — wider than the round nav buttons; shows state. */
.v2-filter-pill {
  /* Label removed 2026-06-01 — icon-only at every size now (was a labelled
     pill). With no explicit width it inherits .v2-nav-btn's square 44/clamp box,
     and the pill radius on a square renders as a circle — so it matches the
     round nav buttons (home, mute, star…) and scales with them. */
  border-radius: var(--r-pill);
  padding: 0;
  gap: 0;
}
.v2-filter-glyph { width: clamp(20px, 2.3vw, 26px); height: clamp(20px, 2.3vw, 26px); object-fit: contain; }
.v2-filter-caret { font-size: 0.8em; opacity: 0.7; }
body.is-fullscreen .v2-filter-label,
body.is-fullscreen .v2-filter-caret { display: none; }   /* collapse to glyph in fullscreen */

/* ----- Language popover — 2×2 grid of language tiles (flag + native name) */
.language-popover .lang-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.lang-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid rgba(0,0,0,0.08);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.lang-tile:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(0,0,0,0.10); border-color: var(--orange, #ff8a3d); }
/* Inside-the-tile focus ring — the popover's tight padding clips the
   default outline:3px / outline-offset:3px combination. */
.lang-tile:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--pink-deep, #ff7a9e);
}
.lang-tile.is-active { border-color: var(--orange, #ff8a3d); background: #fff8e3; }
.lang-tile img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.10);
  flex-shrink: 0;
}
.lang-tile-name { font-size: 14px; font-weight: 800; }
/* `.lang-tile` sets `display: flex`, which overrides the HTML `hidden`
   attribute's UA `display: none` — so `[hidden]` tiles would still show.
   Force-hide them. (2026-05-30: SQ/DE/IT carry `hidden` until translated
   content ships; un-hide a tile to reactivate that language.) */
.lang-tile[hidden] { display: none; }

/* (Help overlay styles removed 2026-05-30 — the .help-list rules went with the
   erased #help-overlay. The .ak-legal footer below survives: it was relocated
   into the Settings overlay.) */
/* Copyright + Terms footer inside the Settings overlay (IP / DMCA basis). */
.ak-legal { border-top: 1px solid rgba(0,0,0,0.08); margin-top: 4px; padding-top: 14px; }
.ak-copyright { color: var(--ink-soft); font-size: 13px; margin: 0 0 4px; }
.ak-legal-links { margin: 0; font-size: 13px; }
.ak-legal-links a { color: var(--pink-deep); text-decoration: underline; }

.filter-popover {
  position: fixed;
  z-index: 60;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.22);
  padding: clamp(14px, 1.6vw, 20px);
  max-width: min(92vw, 360px);
}
.filter-popover-title {
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
  font-size: clamp(15px, 1.8vw, 18px);
}
.filter-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1vw, 12px);
}
.filter-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: none;
  cursor: pointer;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: 0 3px 8px rgba(var(--shadow-rgb), 0.12);
  font: inherit;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(11px, 1.3vw, 13px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.filter-tile .filter-tile-emoji { font-size: clamp(22px, 2.6vw, 30px); }
/* Bumped from 0.38 → 0.55 — off tiles still read as "off" without
   dropping below WCAG-readable contrast. */
.filter-tile.is-off { opacity: 0.55; box-shadow: none; }
.filter-tile.is-locked { cursor: default; }
.filter-tile:active:not(.is-locked) { transform: translateY(1px); }
/* Focus-visible parity with .lang-tile (same tight-padding clipping issue). */
.filter-tile:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--pink-deep, #ff7a9e);
}
/* Icon sizes shrunk ~15 % (2026-05-29) from previous footprint so the
   7-button chrome row (home / mute / language / filter / star /
   settings / fullscreen) fits beside the crumb pill at tablet
   widths without forcing the row to wrap. */
.v2-nav-icon {
  width:  clamp(22px, 2.55vw, 29px);
  height: clamp(22px, 2.55vw, 29px);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.08));
}
#settings-btn .v2-nav-icon { width: clamp(22px, 2.6vw, 29px); height: clamp(22px, 2.6vw, 29px); }
/* Match the named-icon size (~26-30px) + soften the pure-black expand arrows to
   the chrome ink tone with reduced opacity, so the windowed full-view button
   reads as a peer of the soft pastel glyphs beside it, not a harsh black blob. */
#fullscreen-btn .v2-nav-icon-fs { width: clamp(16.2px, 1.76vw, 19.6px); height: clamp(16.2px, 1.76vw, 19.6px); flex: none; opacity: 0.85; }  /* −15% 2026-06-03 */
/* Speaker on the mute button stays slightly larger than peers — it's
   the most-tapped chrome control and was previously washed out. Shrink
   applied proportionally. */
.v2-nav-icon-mute {
  width:  clamp(18px, 2.08vw, 24.3px);   /* −10% 2026-06-03 */
  height: clamp(18px, 2.08vw, 24.3px);
}
/* Group separators — thin vertical hairlines between α-grouped clusters
   so home/repeat, mute/language, filter/star, settings/help/fullscreen
   read as separate functional groups. */
.v2-nav-sep {
  width: 1px;
  height: 22px;
  background: rgba(0, 0, 0, 0.10);
  margin: 0 3px;
  flex-shrink: 0;
}
/* ----- Language button (2026-05-29) — pill with flag SVG + 2-letter
   native code + caret. Same height as the other round chrome buttons,
   auto width. Click opens the language picker overlay. The active flag +
   code are updated by boot.js when the user changes language. */
.v2-lang-btn {
  /* Flag-only at every size now ("EN" code removed 2026-06-01) — same round
     treatment as .v2-filter-pill. */
  border-radius: var(--r-pill);
  padding: 0;
  gap: 0;
}
.v2-lang-flag {
  width: clamp(18px, 1.8vw, 22px);
  height: calc(clamp(18px, 1.8vw, 22px) * 0.7);
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10);
  flex-shrink: 0;
  display: block;
}
/* Chrome text labels + dropdown carets removed 2026-06-01 — the language button
   shows just the flag, the activities button just its icon. Kept in the DOM
   (hidden) so boot.js can still write to #lang-code / #filter-label safely. */
.v2-lang-code, .v2-lang-caret,
.v2-filter-label, .v2-filter-caret { display: none; }
/* (Help button styles removed 2026-05-30 — .v2-help-btn / .v2-help-glyph went
   with the erased chrome #help-btn.) */
/* Mute states — green halo when audio is on, gray when muted. */
.nav-btn.mute-speaker-btn[aria-pressed="false"] {
  background: #d1fae5; border: 2px solid #16a34a;
}
.nav-btn.mute-speaker-btn[aria-pressed="true"] {
  background: #e5e7eb; border: 2px solid #9ca3af;
}
.mute-speaker-btn[aria-pressed="true"] .v2-nav-icon-mute {
  filter: grayscale(100%) drop-shadow(0 1px 0 rgba(0, 0, 0, 0.08));
  opacity: 0.6;
}
/* Red diagonal slash that appears over the speaker when muted. */
.mute-speaker-btn[aria-pressed="true"]::after {
  content: ''; position: absolute; top: 50%; left: 8%; right: 8%;
  height: 3px; background: #ef4444; border-radius: 2px;
  transform: translateY(-50%) rotate(-22deg); pointer-events: none;
}

/* Fullscreen toggle — icon is now an asset <img id="fs-icon"> swapped by
   boot.js (full_view.svg ↔ close_view.svg), 2026-05-30. The old inline-SVG
   .fs-enter/.fs-exit display-swap rules were removed with that markup. */
/* Subtle indicator that fullscreen is active — soft halo. */
.fullscreen-btn[aria-pressed="true"] {
  background: #e0f2fe; border: 2px solid #38bdf8;
}

/* ----- Fullscreen mode (2026-05-29 redesign) -----
   Strategy: collapse chrome to a minimal 4-button floating cluster
   (home · repeat · mute · fullscreen), keep the crumb pill but
   abbreviate its content via JS, and let the stage take the rest of
   the canvas. Picker scenes (module + activity) also enlarge their
   cards to fill the freed canvas — see the `.is-fullscreen .module-grid`
   scaling rules further down.

   What's visible in the cluster:
     home          (always — exit the lesson)
     repeat        (always — re-render the current card)
     mute          (always — silence audio without exiting fullscreen)
     fullscreen    (always — exit fullscreen)
   What's HIDDEN in fullscreen:
     brand AKAM    — visual noise during a lesson
     phase-label   — same
     settings      — preferences are rare mid-lesson
     filter pill   — picker-only context
     language      — preference
     stickers      — picker-only context
     help          — rare mid-lesson
     separators    — no visual grouping needed for 4 buttons
   */
body.is-fullscreen .chrome {
  position: fixed;
  /* Full-width top row (2026-05-30 user req): crumb TEXT pinned top-LEFT, the
     close-view icon top-RIGHT, on one row at the very top edge. The left/right
     insets MATCH the BACK/NEXT buttons (same content-column math) so the crumb's
     left edge lines up with BACK and the icon's right edge lines up with NEXT. */
  top: 8px;
  /* Match the fullscreen .stage's wider --ak-content-w (BACK/NEXT live inside
     .stage and read THAT value). The chrome is outside .stage, so without this
     it reads the narrower ROOT --ak-content-w (1100) and its insets drift inward
     vs BACK/NEXT on wide screens (39px@1280, 110px@1920). */
  --ak-content-w: clamp(720px, 92vw, 1320px);
  left:  max(28px, calc((100vw - var(--ak-content-w)) / 2));
  right: max(28px, calc((100vw - var(--ak-content-w)) / 2));
  width: auto;
  /* Override the base chrome's max-width:--ak-shell-w + margin:auto so the
     left/right insets above actually position the row. */
  max-width: none;
  margin: 0;
  padding: 0;
  /* No wrapper bubble — bare text + icon over the page background. */
  background: transparent;
  box-shadow: none;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* crumb ← │ → icon */
  gap: 8px;
}
/* Crumb (text) sits FIRST (left); the nav-buttons group (just the fullscreen
   toggle now) sits LAST (right). Source order is brand · nav · crumb, so pull
   the crumb ahead with order. `margin-right: auto` on the crumb ALWAYS pushes
   the X to the right — even on splash/vocab cards where the crumb is empty (a
   bare `space-between` with one visible child would otherwise drop the X to the
   LEFT). The crumb keeps the start, the auto margin shoves the nav group right. */
body.is-fullscreen #ak-act-crumb { order: -1; margin: 0 auto 0 0; }
body.is-fullscreen .nav-buttons  { order: 1; margin: 0; gap: 6px; }
/* Fullscreen leaves ONLY the fullscreen toggle + the activity-crumb title
   (2026-05-30 user req). Home + mute now hidden too: Escape and the fullscreen
   button itself both exit back to the full chrome bar, so no nav is stranded. */
body.is-fullscreen .brand,
body.is-fullscreen .phase-label,
body.is-fullscreen #home-btn,
body.is-fullscreen #mute-btn,
body.is-fullscreen #settings-btn,
body.is-fullscreen #info-btn,
body.is-fullscreen #filter-btn,
body.is-fullscreen #language-btn,
body.is-fullscreen #stickers-btn,
body.is-fullscreen .v2-nav-sep { display: none; }
/* Fullscreen toggle + crumb default to a comfortable TABLET size (2026-05-30
   user req): no wrapper bubble, but the X icon and crumb text are large enough
   to read on a standard tablet. They shrink back to the compact size (14px /
   12px) only on small screens via the compact @media block in v2/media.css. */
body.is-fullscreen .v2-nav-btn { width: 30px; height: 30px; box-shadow: none; border: none; background: transparent; }
body.is-fullscreen .v2-nav-btn .v2-nav-icon-fs { width: 26px; height: 26px; }
/* Crumb text — no bubble (transparent, no border/shadow); plain text only.
   Wider max-width since it now owns the whole left side (full crumb text). */
body.is-fullscreen #ak-act-crumb {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-size: 15px;
  padding: 0;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Fullscreen: the top cluster is now a thin one-line row (~24px at top:8), so
   the lesson card needs much less top clearance than before. Pull it up close
   to the cluster (2026-05-30 user req — reduce the gap to the content). */
body.is-fullscreen .stage { top: 20px; left: 18px; right: 18px; padding-top: clamp(8px, 2vh, 18px); }
/* Fullscreen scales the LESSON card + emoji to use the freed canvas, mirroring
   the picker scale-up below (2026-05-30). The picker already grew in fullscreen
   but the splash/lesson card did not — same box + same --ak-img as windowed.
   Widen the content box (1100 → 1320 cap) and bump the lesson emoji/gap/pill.
   Scoped to `.stage` so it cascades into `--ak-content-w` (card max-width) +
   `--ak-img` (cell size). Tall composite cards (question/trace/connect) keep
   their own smaller --ak-img from the compact block / base — only the plain
   single-row lesson + splash cards read this larger value. */
body.is-fullscreen .stage {
  --ak-content-w: clamp(720px, 92vw, 1320px);
  /* Dimension-AWARE so this scale-up works at EVERY screen size, not just tall
     ones (2026-05-30 fix). A pure width driver (14vw) shrank the emoji on a
     short landscape phone — 14vw of 640 = 90px is LESS than the compact block's
     height-driven 28vh = ~100px, and this rule (0,2,0) out-specifies the compact
     `.stage` (0,1,0), so it was overriding the good value with a smaller one.
     `max(vw, vh)` picks whichever axis has room: tall screens use the width
     term, short-wide phones use the height term (>compact, so it grows). The
     clamp ceiling keeps it sane on huge monitors. */
  --ak-img:       clamp(96px, max(14vw, 30vh), 220px);
  --ak-gap:       clamp(24px, max(4vw, 5vh), 72px);
  --ak-pill-font: clamp(20px, max(3vw, 4vh), 40px);
}
/* Match: its draggable picture pills live in a WRAPPING .ak-tray, so a big
   --ak-img makes a 5-pair round wrap to 4+1, overflowing the card and clipping
   the word slots off the top — on tablets in fullscreen (~214px) AND on wide
   laptop/desktop screens (the base 180px ceiling). Cap the image + gap (set on
   the card, inherited by the pills + slots) so up to 5 stay in ONE row at every
   width / mode. Other activities keep the larger default. */
.ak-match-card { --ak-img: clamp(64px, 10vw, 140px); --ak-gap: clamp(14px, 2vw, 36px); }
/* Reduced INTERNAL card padding in fullscreen (2026-05-30 user req) — base card
   pads clamp(28px,4vw,64px) (≈51px at 1280); fullscreen is an explicit "more
   room for content" mode, so tighten it. Needs `.stage > .ak-card` (0,3,0) to
   beat the base (0,1,0) AND the §2 compact (0,2,0) rules. */
body.is-fullscreen .stage > .ak-card { padding: clamp(14px, 2vw, 28px); }
/* Picker (intro) top clearance in fullscreen. Reduced 66→34px (2026-05-30 user
   req): fullscreen now collapses the chrome to just the small top-RIGHT X, so
   the old 66px (reserved for the former full button cluster) left a big empty
   band above the centred "PICK A MODULE" title + cards. The X sits in the
   corner, clear of the centred header, so 34px pulls the picker up without
   overlap. Applies to all breakpoints (it's a class rule, not a @media). */
body.is-fullscreen .intro { padding-top: 34px; }

/* ----- Fullscreen picker scale-up (2026-05-29) -----
   When fullscreen collapses the chrome and reclaims the canvas, the
   picker cards (both module and activity) genuinely enlarge to use the
   freed space — bigger banners/headers, bigger emoji previews, bigger
   desc + count text, bigger grid gaps. Same 4×3 module picker / 3×N
   activity picker structure, just larger cells.

   Both pickers share .module-card chrome, so the rules below scope to
   `.module-grid .module-card` and target the appropriate elements for
   module vs activity variants. */
body.is-fullscreen .intro .intro-sub      { font-size: clamp(26px, 3vw, 40px); }
body.is-fullscreen .intro .module-grid    { gap: clamp(14px, 1.9vw, 28px); }
body.is-fullscreen .intro .module-card    { min-height: 150px; }
/* Module-card banner enlarges */
body.is-fullscreen .intro .module-card .module-banner       { font-size: clamp(14px, 1.4vw, 18px); padding: 8px 14px; }
/* Activity-card header enlarges (badge + prefix + title spans) */
body.is-fullscreen .intro .module-card.is-activity .activity-badge,
body.is-fullscreen .intro .module-card.is-activity .activity-header > .activity-prefix,
body.is-fullscreen .intro .module-card.is-activity .activity-header > .activity-sep,
body.is-fullscreen .intro .module-card.is-activity .activity-header > .module-title {
  font-size: clamp(13px, 1.35vw, 17px);
}
body.is-fullscreen .intro .module-card.is-activity .activity-badge {
  width: 28px; height: 28px; font-size: 14px;
}
/* Body of the card (emoji preview + desc + count) — applies to both
   module + activity variants since they share `.module-body`. */
body.is-fullscreen .intro .module-card .module-preview img {
  width:  clamp(30px, 3.3vw, 42px);
  height: clamp(30px, 3.3vw, 42px);
}
body.is-fullscreen .intro .module-card .module-desc  { font-size: clamp(13px, 1.15vw, 16px); }
body.is-fullscreen .intro .module-card .module-count { font-size: clamp(12px, 1.05vw, 14px); }

/* (The legacy boot-injected ".ak-answer-panel" reveal + its CSS were removed —
   answer reveals are now solely the renderer-baked .ak-answer-reveal.) */

/* ----- Compact NEXT / BACK / HEAR ----- */
.stage > .next-btn, .stage > .back-btn {
  height: 52px; padding: 0 22px; font-size: 17px; bottom: 18px;
  box-shadow: 0 5px 0 var(--orange-deep, #c46810);
}
.stage > .back-btn { box-shadow: 0 5px 0 var(--pink-deep, #c45a6f); }
.stage .hear-btn {
  margin-top: clamp(14px, 2vh, 24px); padding: 6px 14px; gap: 10px;
}
.stage .hear-btn .hear-btn-pill { font-size: 18px; }
.stage .hear-btn .hear-btn-icon { width: 32px; height: 32px; }

/* ----- Activity breadcrumb pill — chrome-embedded (2026-05-29) -----
   Replaces the previously-floating #ak-activity-progress block. Sits at
   the right edge of the chrome row, after the nav buttons. Updated by
   boot.js's updateActivityProgress() with text like
   "Module 1 · Activity 1 · Exercise · 3 / 10". Hidden when empty
   (intro/picker scenes). The body class `v2-no-actbar` (added on
   non-activity scenes) hides it as a belt-and-braces measure. */
#ak-act-crumb {
  /* Font floor lowered 11→9px + tighter letter-spacing + wider max-width
     (2026-05-30 user req): the full "MODULE 1 · ACTIVITY 4 · MATCH" was
     ellipsis-truncating on the narrow phone (scrollW 253 > clientW 219).
     Clamp keeps desktop ~13px; only the narrow end shrinks to fit. */
  font-size: clamp(9px, 1.1vw, 13px);
  color: var(--ink, #2d2a26);
  letter-spacing: 0.03em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 14px;
  background: #fff;
  border: 2px solid var(--orange, #ff8a3d);
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44vw;
  flex-shrink: 1;
  line-height: 1.15;
  /* Push the crumb pill to the right edge of the chrome row. */
  margin-left: auto;
}
#ak-act-crumb:empty { display: none; }
#ak-act-crumb .crumb-sep { opacity: 0.4; margin: 0 4px; }
#ak-act-crumb .crumb-count {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 9px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 0.06em;
}
body.v2-no-actbar #ak-act-crumb { display: none; }

/* ----- Segmented progress bar — bottom band between BACK and NEXT.
   One cell per card in the current phase. Cells before the current
   index are .done (gradient-filled); the current cell is .current
   (white halo + small scale boost); upcoming cells are empty. Click
   any cell to scrub directly to that card.

   The whole bar is `position: fixed` bottom-centre with margins that
   respect BACK/NEXT corner buttons. On picker scenes it's hidden via
   body.v2-no-actbar. */
#ak-segment-bar {
  position: fixed;
  left:   50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  gap: 4px;
  width: min(56vw, 560px);
  height: 14px;
  cursor: pointer;
  user-select: none;
}
#ak-segment-bar .seg-cell {
  flex: 1;
  background: rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.10);
  border-radius: 6px;
  transition: background 200ms, transform 200ms, box-shadow 200ms;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
#ak-segment-bar .seg-cell.done {
  background: linear-gradient(90deg, var(--orange, #ff8a3d), var(--pink, #ff8fa3));
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
#ak-segment-bar .seg-cell.current {
  background: var(--orange, #ff8a3d);
  border-color: var(--orange-deep, #c46810);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--orange, #ff8a3d);
  transform: scale(1.08);
}
body.v2-no-actbar #ak-segment-bar { display: none; }

/* ---- Full-screen nudge — a gentle pulsing ring on the ⛶ button while the app
   is NOT in fullscreen, until the user enters fullscreen once (then never again,
   via localStorage). Uses a ::after ring so it doesn't fight the button's own
   shadow. No motion under prefers-reduced-motion (a soft static ring instead). */
.fullscreen-btn.fs-nudge {
  animation: fs-nudge-glow 2s ease-in-out infinite;
}
@keyframes fs-nudge-glow {
  0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(var(--brand-teal-rgb), 0.5); }
  50%      { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 6px rgba(var(--brand-teal-rgb), 1), 0 0 22px 5px rgba(var(--brand-teal-rgb), 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .fullscreen-btn.fs-nudge { animation: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(125, 211, 192, 0.6); }
}

/* ---- Live drag trail — a comet tail of sparkles following a tile while a real
   user drags it (match/quiz/letter). Colour + glyph are set inline per exercise
   in renderer.js; this is just the geometry + fade. Skipped for reduced-motion
   (renderer.js doesn't emit any). ---- */
.ak-drag-trail {
  position: fixed; z-index: 9990;
  margin: -16px 0 0 -16px;
  font-size: 31px; line-height: 1;
  pointer-events: none;
  /* Strong, glowing presence — coloured halo (currentColor = the inline colour)
     plus a dark edge for contrast on light + dark backgrounds. */
  text-shadow: 0 0 10px currentColor, 0 0 4px currentColor, 0 1px 3px rgba(0, 0, 0, 0.35);
  animation: ak-drag-trail 760ms ease-out forwards;
}
@keyframes ak-drag-trail {
  0%   { opacity: 1; transform: scale(1.2) rotate(0deg); }
  30%  { opacity: 1; transform: scale(1) rotate(10deg); }
  100% { opacity: 0; transform: scale(0.5) rotate(50deg) translateY(16px); }
}

/* ---- Demo / auto-play mode (recording) ---- */
body.ak-demo-running .hear-btn { opacity: 0; pointer-events: none; }   /* HEAR is pointless during auto-play; the voice still plays */
body.ak-demo-running .ak-card { isolation: isolate; }   /* stacking context so the z-index:-1 trail layer sits above the card bg but below the tiles */
#ak-demo-restart {
  position: fixed; left: 14px; bottom: 14px; z-index: 9997;
  font: 700 13px/1 "Fredoka", system-ui, sans-serif; color: var(--ink, #4a3f35);
  background: var(--card, #fff); border: 2px solid var(--teal-deep, #3aa893);
  border-radius: var(--r-pill, 999px); padding: 7px 13px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14); opacity: 0.85; transition: opacity 0.3s ease;
}
#ak-demo-restart:hover { opacity: 1; }
#ak-demo-restart.is-playing { opacity: 0; pointer-events: none; }   /* out of frame during a take */
.ak-demo-tap {
  position: fixed; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--teal, #7dd3c0);
  pointer-events: none; z-index: 9999; animation: ak-demo-tap 620ms ease-out forwards;
}
@keyframes ak-demo-tap { from { transform: scale(0.35); opacity: 0.85; } to { transform: scale(4.2); opacity: 0; } }
/* Flight-trail particles — one identity per exercise (letters=star, match=sun,
   quiz=sparkle). They live in .ak-demo-trail-layer, a z-index:-1 child of the
   card, so the emoji squares + the flying piece render ON TOP of the trail
   (it's the path underneath the moving piece, not an overlay). Shared geometry +
   animation; only colour/glyph differ. */
.ak-demo-trail-layer { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ak-demo-star, .ak-demo-sun, .ak-demo-spark {
  position: absolute; line-height: 1; pointer-events: none;
  animation: ak-demo-star 820ms ease-out forwards;
}
.ak-demo-star  { margin: -17px 0 0 -17px; font-size: 34px; color: #ffd24a; text-shadow: 0 0 8px rgba(255, 200, 40, 0.55), 0 1px 3px rgba(0, 0, 0, 0.3); }
.ak-demo-sun   { margin: -17px 0 0 -17px; font-size: 34px; color: #ff8a3d; text-shadow: 0 0 9px rgba(255, 138, 61, 0.6), 0 1px 3px rgba(0, 0, 0, 0.3); }
.ak-demo-spark { margin: -16px 0 0 -16px; font-size: 32px; color: #3a9bd6; text-shadow: 0 0 9px rgba(58, 155, 214, 0.6), 0 1px 3px rgba(0, 0, 0, 0.3); }
/* Landing particle — bigger + lingers on the target spot. */
.ak-demo-star.is-land, .ak-demo-sun.is-land, .ak-demo-spark.is-land {
  animation: ak-demo-land 1000ms ease-out forwards;
}
.ak-demo-star.is-land  { margin: -28px 0 0 -28px; font-size: 56px; color: #ffc21a; text-shadow: 0 0 14px rgba(255, 190, 20, 0.7), 0 2px 5px rgba(0, 0, 0, 0.3); }
.ak-demo-sun.is-land   { margin: -28px 0 0 -28px; font-size: 56px; color: #ff7a1a; text-shadow: 0 0 14px rgba(255, 122, 26, 0.7), 0 2px 5px rgba(0, 0, 0, 0.3); }
.ak-demo-spark.is-land { margin: -26px 0 0 -26px; font-size: 52px; color: #2f8fcf; text-shadow: 0 0 14px rgba(47, 143, 207, 0.7), 0 2px 5px rgba(0, 0, 0, 0.3); }
@keyframes ak-demo-star {
  0%   { transform: scale(0.3) rotate(0deg);    opacity: 0; }
  30%  { transform: scale(1.1) rotate(40deg);   opacity: 1; }
  100% { transform: scale(0.5) rotate(120deg) translateY(18px); opacity: 0; }
}
@keyframes ak-demo-land {
  0%   { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  35%  { transform: scale(1.25) rotate(0deg);  opacity: 1; }
  70%  { transform: scale(1) rotate(0deg);     opacity: 1; }
  100% { transform: scale(0.85) rotate(0deg);  opacity: 0; }
}
/* NEXT button press feedback during the demo (so viewers see the click). */
#next-btn.ak-demo-press { animation: none; transform: scale(0.9); filter: brightness(0.92); }

/* (Old #ak-exercise-progress + #ak-ex-bar + #ak-ex-readout + #ak-ex-dots
   block REMOVED 2026-05-29 — the segmented bar above now carries the only
   progress signal at the bottom. Their DOM nodes no longer exist; references
   in boot.js were cleaned up in the same change.) */

/* Twilight (dark mode) — bump brand + nav-btn + HEAR to white-ish so
   they have proper contrast against the dark background. */
[data-theme="twilight"] .brand          { color: #fff; }
[data-theme="twilight"] .nav-btn        { color: #fff; }
[data-theme="twilight"] .hear-btn       { background: #fff; }
[data-theme="twilight"] .hear-btn-pill  { color: #2d2a26; }

/* Canvas-locked viewport is set globally in styles.css:281 (`html, body
   { height: 100%; overflow: hidden }`). Duplicate v2 block removed. */
/* Intro / activities pickers don't show NEXT/BACK or the bottom
   exercise progress bar — reclaim that padding so the picker grid
   fits the canvas without overflowing. */
body.v2-no-actbar .stage {
  padding-bottom: clamp(24px, 4vh, 48px);
}
/* (The redundant `.intro { display:flex; overflow-y:auto; … }` re-assertion that
   came over from the inline <style> was DROPPED during the 2026-05-30 migration —
   the base `.intro` rule above (position:fixed; overflow-y:auto) + `.intro-modules`
   (display:flex column; align-items:center) already provide all of it.) */

/* ----- Module + activity picker grid — CONTAINER-DRIVEN (2026-05-29) -----
   The column count is chosen by the grid itself via `auto-fit` + a tuned
   `minmax()` min — NOT by discrete column breakpoints. Measured (headless
   Chromium, real gap/padding) the 220px min yields the intended ladder with
   no media queries and no drift:
      ≤768  → 2 cols   (small phone-in-landscape)
      844–932 → 3 cols (large phone-in-landscape)
      1024 → 4 cols    (tablet baseline) … capped at 4 through ≥1600
   220px is the sweet spot: 200px over-columns to 5 on desktop; 240px (the
   old dead rule in /styles.css) failed to reach 4 at 1024. Both pickers share
   this one rule now — the activity picker's old fixed `repeat(3)` is gone, so
   its 8 cards lay out 4+4 instead of a ragged 3+3+2.
   Rows auto-size to content (not forced equal-height) so cards shrink to fit. */
.intro .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: auto;
  align-content: start;            /* rows pinned to top, not centered */
  gap: clamp(10px, 1.4vw, 18px);
  /* Self-contained box that MATCHES the chrome bar exactly: same
     --ak-shell-w max-width + --ak-shell-pad horizontal padding, centred.
     (.intro provides the --ak-stage-x side inset and the centring context;
     see the chrome rule in styles.css.) So the AKAM wordmark + controls
     always line up with the card columns. */
  width: 100%;
  max-width: var(--ak-shell-w);
  padding: 0 var(--ak-shell-pad);
  margin: 0 auto;
  /* Flow naturally and let .intro own the scroll. The old
     flex:1 1 auto / min-height:0 / overflow:hidden CLIPPED the bottom rows
     (they rendered off-box but couldn't be scrolled to) whenever the cards
     needed more height than the viewport — at narrow widths (many rows) or
     short windows. Removed so .intro scrolls instead of cropping. */
}
/* (The activity picker shares the auto-fit rule above — no separate
   column override. Both pickers pick their column count from width.) */

/* (Narrow-viewport picker CARD relaxation @max-width:900 — banner two-line
   wrap + card grow — moved to v2/media.css 2026-05-30. ALL @media rules now
   live in that one file.) */
/* (Removed 2026-05-29: the @700 → 2-col and @500 → 1-col picker overrides —
   auto-fit minmax(220px) reaches 1 column on its own.)
   (Phone-LANDSCAPE compact block @(landscape) and (max-height:600) moved to
   v2/media.css 2026-05-30 — ALL @media rules now live in that one file.) */
/* (Chrome overflow steps @768/660/520/440 moved to v2/media.css 2026-05-30 —
   ALL @media rules now live in that one file.) */
/* (The C-Compact card layout — banner + 4-emoji preview + desc + count
   — is fully self-contained in /styles.css's .module-card block. The old
   .intro overrides (.module-card-head padding, picker-vs-activity emoji
   sizes, 2-line desc clamp, lock-icon position) targeted a layout that
   no longer exists; removed 2026-05-28 to let the base rules win. Both
   pickers now share one auto-fit grid, so emoji sizing follows the
   clamp(2.6vw) in .module-preview img automatically — no per-screen
   override needed.) */
.intro .intro-header { margin-bottom: clamp(6px, 1vh, 14px); }
/* (Stale `.intro-title` override removed 2026-05-29 — picker renderers
   emit only `<p class="intro-sub">`, not `.intro-title`.) */
/* Promote the "Pick a module / Pick an activity" prompt — larger,
   bolder, full-ink color so it reads as a clear call-to-action. */
.intro .intro-sub {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 700;
  color: var(--ink, #2d2a26);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== Triumph tiers ====================================================
   1) Round  — per quiz/match card. Tiny floating "GREAT!" toast (1 star).
               Fires when all slots in a card are correctly filled.
               Non-blocking; user still taps NEXT to advance.
   2) Exercise — between work-phases within an activity. Larger toast
                ("EXERCISE DONE!" + 2 stars + sub) that auto-advances
                after ~1400ms. Still an overlay, NOT a separate page.
   3) Activity — full-page .cheer (3 stars + buttons).
   4) Module   — full-page .cheer (3 gold stars + ALL MODULES + extra
                confetti bursts).
   ======================================================================= */
/* Toast is inserted INSIDE the .ak-card, absolutely positioned in the
   card's lower zone — directly below the text lineup row, but lifted
   ABOVE the quiz / match card's draggable tray so the toast isn't
   hidden behind tray pills. Present / vocab / splash cards (no tray)
   just see the toast a bit higher than card bottom; still under the
   content. z-index keeps it above tray contents regardless. */
.cheer-toast {
  position: absolute;
  bottom: clamp(70px, 11vh, 110px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid var(--pink-deep, #c45a6f);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  pointer-events: none;
  animation: cheer-toast-in 280ms cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
}
/* (Removed 2026-05-29: `.toast-buddy` — buddy character gone since 2026-05-25;
   toasts emit only .toast-stars + .cheer-toast-text. Its `buddy-bounce`
   keyframe was removed from styles.css too.) */
.cheer-toast .toast-stars { display: inline-flex; gap: 6px; }
.cheer-toast .toast-stars span {
  font-size: clamp(22px, 2.6vw, 32px);
  display: inline-block;
  animation: star-spin 1.2s ease-in-out infinite;
}
.cheer-toast .toast-stars span:nth-child(2) { animation-delay: 160ms; }
.cheer-toast-text {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
  color: var(--pink-deep, #c45a6f);
  letter-spacing: 0.06em;
}
/* (Removed 2026-05-29: `.cheer-toast-sub` — never emitted by boot.js's toast
   HTML, which uses only .cheer-toast-text.) */
/* Exercise variant — slightly larger pill, 2 stars. */
.cheer-toast.is-exercise {
  padding: 12px 28px;
  gap: 14px;
  border-color: var(--orange, #ff8a3d);
}
.cheer-toast.is-exercise .toast-stars span { font-size: clamp(28px, 3.2vw, 40px); }
.cheer-toast.is-exercise .cheer-toast-text  {
  font-size: clamp(22px, 2.4vw, 32px);
  color: var(--orange, #ff8a3d);
}
.cheer-toast.fading { animation: cheer-toast-out 500ms ease-in forwards; }
@keyframes cheer-toast-in {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes cheer-toast-out {
  0%   { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.92); }
}

/* Module cheer — golden stars + bigger title for the biggest moment. */
.cheer.is-module .cheer-title {
  background: linear-gradient(180deg, #f5b942, #c98a2d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cheer.is-module .cheer-stars span { filter: drop-shadow(0 0 8px rgba(245, 185, 66, 0.6)); }
