/* ==========================================================
   Hullabugaloo — cards.css (QUESTIONS lane)
   Every card in #cardLayer: the question card, the quiet page, the
   passage card, number buttons, the keypad, order slots, Pre-K
   pictures and tap-to-count, the owl's note, the SPARKED! stamp, the
   Stump card. site.css variables only, so lamplight (dark) mode comes
   for free (the FIRE key is pinned to red chalk with cream, as hulla.css
   pins FIRE). Sizes are A§4.4 K.CARD: choices ≥ 72 px tall (P/K 112),
   keypad keys 72 × 64, the speaker 64 (P/K 80), option text ≥ 20 px.
   Layouts (D§8.16): .qc-tablet the bottom 55% (.qc-tall up to 75%,
   .qc-passage 80%), .qc-full phones, .qc-cols two columns, .qc-sheet a
   ≤ 40% Reckoning sheet on small screens.
   ========================================================== */

.hb-cardlayer { position: absolute; inset: 0; z-index: 11; pointer-events: none; overflow: hidden; }

.qc-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  pointer-events: auto;
  background: var(--card); background-image: var(--grain);
  color: var(--ink);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -12px 30px -14px rgba(40, 25, 10, .5);
  font-family: var(--ui);
  -webkit-tap-highlight-color: transparent;
  animation: qc-in 220ms cubic-bezier(.34, 1.56, .64, 1) both;
  touch-action: manipulation;
}
.qc-card button { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-family: var(--ui); }
.qc-card button:not(.btn) { color: var(--ink); }
/* tablets: the bottom 55% (at least 300 px); a card whose answers would not show grows, up to 75%, before its body scrolls
   (a Pre-K child never has to scroll to find his two tiles) */
.qc-card.qc-tablet { height: auto; min-height: max(300px, 55%); max-height: 75%; }
.qc-card.qc-tablet.qc-passage { height: 80%; max-height: 80%; }
.qc-card.qc-full { top: 0; height: 100%; border-top: 0; }
.qc-card.qc-sheet { height: auto; max-height: 40%; }
.qc-card.is-leaving { animation: qc-out 200ms ease-in forwards; pointer-events: none; }
.qc-card.qc-static { animation: none; }                 /* the self-test measures cards where they rest */
@keyframes qc-in { from { transform: translateY(46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qc-out { to { transform: translateY(46px); opacity: 0; } }

/* ---------- the header ---------- */
.qc-head {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  padding: 8px 12px 6px 16px; border-bottom: 1px solid var(--line);
}
.qc-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qc-emblem { font-size: 30px; line-height: 1; }
.qc-crest { flex: none; border-radius: 50%; }
.qc-name { font-size: 15px; letter-spacing: .06em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-seal { font-size: 14px; letter-spacing: .06em; color: var(--sanguine); white-space: nowrap; }
.qc-only { font-size: 14px; color: var(--ink-soft); margin-left: auto; }
.qc-speak {
  flex: none; width: 64px; height: 64px; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; cursor: pointer;
}
.qc-only + .qc-speak { margin-left: 0; }
.qc-pk .qc-speak { width: 80px; height: 80px; }
.qc-speak .qc-ico { width: 30px; height: 30px; }
.qc-pk .qc-speak .qc-ico { width: 38px; height: 38px; }
.qc-speak.is-pulse { animation: qc-pulse 1.1s ease-in-out infinite; }
@keyframes qc-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ochre) 70%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ochre) 0%, transparent); transform: scale(1.06); } }

/* ---------- the body (scrolls) ---------- */
.qc-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 16px 12px;
}
.qc-main { min-width: 0; }
.qc-ans { min-width: 0; margin-top: 10px; }
.qc-q { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.qc-pic { flex: none; }
.qc-prompt { margin: 4px 0; font: 700 28px/1.25 var(--ui); text-align: center; overflow-wrap: anywhere; max-width: 100%; }
.qc-pk .qc-prompt { font-size: 36px; }
.qc-longq .qc-prompt { font-size: 26px; }
.qc-pk.qc-longq .qc-prompt { font-size: 30px; }
.qc-w.is-lit, .qc-pw.is-lit { background: color-mix(in srgb, var(--ochre) 32%, transparent); border-radius: 4px; }
.qc-foot { flex: none; padding: 4px 16px 8px; font-size: 15px; color: var(--ink-soft); border-top: 1px solid var(--line); }

/* ---------- choices (choice, tf, number buttons) ---------- */
.qc-opts { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.qc-opt {
  position: relative; flex: 1 1 0; min-width: 120px; min-height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 14px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 30%, transparent);
  font-weight: 700; cursor: pointer;
}
.qc-otext { font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.qc-long .qc-opts { flex-direction: column; align-items: stretch; }
.qc-long .qc-opt { flex: none; }
.qc-long .qc-otext { font-size: 22px; font-weight: 700; text-align: center; }
.qc-opt:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 color-mix(in srgb, var(--ink) 30%, transparent); }
.qc-opt[disabled] { cursor: default; }
.qc-opt.is-reading { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ochre) 55%, transparent); }
.qc-opt.is-right { background: color-mix(in srgb, var(--ochre) 30%, var(--card)); border-color: var(--ochre); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ochre) 45%, transparent); }
.qc-opt.is-wrong { background: color-mix(in srgb, var(--ink) 9%, var(--card)); border-color: var(--line); box-shadow: none; }
.qc-opt.is-wrong .qc-otext { color: var(--ink-soft); }
.qc-opt.is-answer { background: color-mix(in srgb, var(--sage) 24%, var(--card)); border-color: var(--ink); outline: 4px double var(--ink); outline-offset: 2px; }
.qc-opt.is-faded { opacity: .32; }
.qc-opic { display: block; }
.qc-ten { display: block; max-width: 100%; height: auto; }   /* Pre-K's numerals: a ten-frame as wide as the button */
.qc-opt.qc-hasten { padding-left: 8px; padding-right: 8px; }
.qc-thumb svg { width: 34px; height: 34px; display: block; }
/* Pre-K True/False: the nodding and the shaking beetle each carry a still sign (a sage thumb up, a red-chalk thumb down) */
.qc-tfbug { display: inline-flex; align-items: center; gap: 6px; }
.qc-tfbug .qc-thumb svg { width: 36px; height: 36px; }
.qc-tfbug.is-nod .qc-thumb { color: var(--sage); }
.qc-tfbug.is-shake .qc-thumb { color: var(--sanguine); }
.qc-tfbug canvas { display: block; }
.qc-tfbug.is-nod canvas { animation: qc-nod 1.6s ease-in-out infinite; }
.qc-tfbug.is-shake canvas { animation: qc-shake 1.6s ease-in-out infinite; }
@keyframes qc-nod { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) translateY(2px); } 50% { transform: rotate(0); } 75% { transform: rotate(-8deg) translateY(2px); } }
@keyframes qc-shake { 0%, 100% { transform: none; } 20% { transform: rotate(-9deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-9deg); } 80% { transform: rotate(6deg); } }

/* Pre-K and K: big tiles in coloured bug frames ("the red one") */
.qc-pk .qc-opt { min-height: 112px; min-width: 132px; border-radius: 22px; }
.qc-pk .qc-otext { font-size: 40px; }
.qc-framed { border: 6px solid var(--qc-frame, var(--ink)); }
.qc-framed::before {
  content: ""; position: absolute; top: -12px; left: -12px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 40%, #1d140c 0 2.5px, transparent 3px), radial-gradient(circle at 66% 62%, #1d140c 0 2.5px, transparent 3px), var(--qc-frame, var(--ink));
  border: 2px solid #1d140c;
}

/* ---------- the keypad: answer box + Fire!, then 1–9, 0, ⌫ (and "." / "−") ---------- */
.qc-kbox { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qc-krow0 { display: flex; align-items: stretch; gap: 8px; width: 312px; max-width: 100%; }
.qc-kvwrap { flex: 1 1 auto; min-width: 90px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.qc-kval { flex: 1 1 auto; min-width: 0; font: 700 40px/1 var(--ui); text-align: right; overflow: hidden; white-space: nowrap; }
.qc-kval.is-wrong { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 2px; }
.qc-kunit { font-size: 20px; color: var(--ink-soft); }
.qc-keypad { display: grid; grid-template-columns: repeat(4, 72px); grid-auto-rows: 64px; gap: 8px; }
.qc-key {
  width: 72px; height: 64px; min-width: 72px; padding: 0;
  font: 700 28px/1 var(--ui);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--ink) 28%, transparent);
}
.qc-key:active { transform: translate(2px, 2px); box-shadow: none; }
.qc-kback, .qc-kneg { font-size: 26px; }
.qc-kfire { width: 96px; min-width: 96px; background: #a4442b; color: #fff8e6 !important; border-color: color-mix(in srgb, #a4442b 60%, #000); font-size: 24px; }
.qc-kgap { display: block; }

/* ---------- order ---------- */
/* the slots I–IV in a fixed grid: two to a row, four on a card 600 px wide (M2 review: one per row put III, IV and ✓
   below a phone's fold; on a tablet IV sat alone on a row) */
.qc-slots { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qc-w600:not(.qc-cols) .qc-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qc-slots li { min-width: 0; display: flex; }
.qc-slot {
  width: 100%; min-height: 56px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0;
  padding: 4px 10px; text-align: left;
  background: transparent; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer;
}
.qc-slot .qc-roman { min-width: 0; font-size: 18px; line-height: 1.1; }
.qc-slot.is-full { border-style: solid; border-color: var(--ink); background: var(--paper); }
/* a missed order (M4 review): his items in their place glow sage with the double ink outline, the others fade */
.qc-slot.is-answer { background: color-mix(in srgb, var(--sage) 24%, var(--card)); border-color: var(--ink); outline: 3px double var(--ink); outline-offset: 1px; }
.qc-slot.is-faded { opacity: .4; }
.qc-slot[disabled] { cursor: default; }
.qc-roman { min-width: 2.2em; font-size: 20px; color: var(--sanguine); }
.qc-stext { font: 700 22px/1.2 var(--ui); overflow-wrap: anywhere; }
.qc-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.qc-tile { min-height: 56px; min-width: 56px; padding: 6px 14px; font: 700 22px/1.2 var(--ui); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; cursor: pointer; }
.qc-tile[disabled] { opacity: .3; }
.qc-ok { display: block; margin: 0 auto; min-width: 120px; min-height: 72px; font-size: 32px; }

/* ---------- the owl's note, Got it, flashes ---------- */
.qc-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.qc-owl { flex: none; }
.qc-notetext {
  flex: 1 1 220px; margin: 0; font: 400 20px/1.35 var(--ui); color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.qc-got { min-height: 56px; min-width: 120px; font-family: var(--ui); font-weight: 700; }
.qc-pk .qc-got { min-height: 96px; min-width: 160px; font-size: 1.5rem; }
/* Got it (and the quiet note's row) stays in view at the bottom of the scrolling body, however long the why
   (M2 review: on phones it appeared below the scroller's fold) */
.qc-note .qc-got, .qc-note .qc-row { position: sticky; bottom: 0; z-index: 1; }
.qc-note .qc-row { background: var(--card); padding: 4px 0 2px; width: 100%; }
.qc-flash { margin: 0 0 8px; text-align: center; font: 700 24px var(--ui); color: var(--sanguine); }
.qc-hint { margin: 0; text-align: center; font: 700 22px var(--ui); color: var(--ink-soft); }
.qc-toast {
  position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 2; max-width: min(92%, 520px);
  margin: 0; padding: 10px 16px; font: 700 18px/1.3 var(--ui); text-align: center;
  background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; pointer-events: none;
}

/* ---------- SPARKED! ---------- */
.qc-stamp {
  position: absolute; left: 50%; z-index: 3; pointer-events: none;
  width: max-content; max-width: calc(100% - 16px);       /* M3 review: centred on its own width, not wrapped at half the stage */
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transform: translateX(-50%) rotate(var(--qc-tilt, -8deg));
  animation: qc-stamp 220ms ease-out both, qc-fade 260ms ease-in 820ms forwards;
}
.qc-stampline { font-size: 26px; color: var(--sanguine); margin-top: -2px; }
@keyframes qc-stamp { 0% { transform: translateX(-50%) rotate(var(--qc-tilt, -8deg)) scale(0); } 60% { transform: translateX(-50%) rotate(var(--qc-tilt, -8deg)) scale(1.3); } 100% { transform: translateX(-50%) rotate(var(--qc-tilt, -8deg)) scale(1); } }
@keyframes qc-fade { to { opacity: 0; } }

/* ---------- the quiet page: plain paper, a thin sage rule, one ❦ ---------- */
.qc-card.qc-quiet { border-top: 2px solid var(--sage); background-image: none; box-shadow: 0 -10px 26px -16px rgba(40, 25, 10, .35); }
/* the speaker sits in the header's own corner, and the header is tall enough to hold it, so it never covers the verse
   or an answer (M2 review: at 360 wide it covered "God's wo[rks]") */
.qc-quiet .qc-head { position: relative; justify-content: center; border-bottom: 0; padding: 10px 84px 6px 12px; min-height: 80px; }
.qc-quiet.qc-pk .qc-head { padding-right: 100px; min-height: 96px; }
.qc-quiet .qc-speak { position: absolute; top: 8px; right: 10px; margin: 0; border-color: var(--line); }
.qc-fleuron { color: var(--sanguine); font-size: 22px; }
.qc-quiet-h { font-size: 18px; letter-spacing: .14em; color: var(--ink); }
.qc-quiet .qc-q { flex-direction: column; gap: 2px; }
.qc-quiet .qc-prompt, .qc-verse { font: 400 26px/1.4 var(--ui); text-align: center; margin: 6px auto; max-width: 36em; }
.qc-quiet.qc-pk .qc-prompt, .qc-quiet.qc-pk .qc-verse { font-size: 30px; }
.qc-ref { margin: 2px 0 6px; font: 400 18px var(--display); text-align: center; color: var(--ink-soft); }
.qc-quiet .qc-opt { border-color: var(--ink-soft); box-shadow: none; font-weight: 400; }
.qc-quiet .qc-otext { font-size: 26px; font-weight: 400; }
.qc-quiet.qc-long .qc-otext { font-size: 21px; }
.qc-quiet .qc-opt.is-right { box-shadow: none; }
.qc-quiet .qc-note { flex-direction: column; text-align: center; background: transparent; border: 0; }
.qc-well, .qc-here { margin: 0; font-size: 20px; letter-spacing: .08em; color: var(--ink); }
.qc-full-text { margin: 4px auto; }
.qc-honey { margin: 6px 0 0; font: 700 22px var(--ui); }
/* "Who needs the honey?": an even grid of bug buttons, whatever their names (M2 review: 120 and 185 px wide side by side) */
.qc-bugs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; width: 100%; max-width: 640px; margin: 0 auto; }
.qc-bug {
  width: 100%; min-width: 0; min-height: 72px; padding: 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; cursor: pointer;
}
.qc-bname { font: 700 20px var(--ui); }
.qc-hp { display: block; width: 72px; height: 8px; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.qc-hp i { display: block; height: 100%; background: var(--sage); }
.qc-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.qc-together, .qc-lovely { min-height: 56px; font-family: var(--ui); font-weight: 700; }
.qc-pk .qc-lovely { min-height: 96px; min-width: 160px; font-size: 1.5rem; }

/* ---------- the passage card ---------- */
.qc-passage-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 8px 14px 10px; margin-bottom: 8px; }
.qc-ptitle { margin: 0 0 4px; font-size: 16px; letter-spacing: .06em; color: var(--sanguine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-psrc { color: var(--ink-soft); }
.qc-ptext { max-height: 42vh; overflow-y: auto; font: 400 22px/1.5 var(--ui); }
.qc-ptext.is-body { font-family: var(--body); }
.qc-asked .qc-ptext { max-height: 22vh; }                 /* after Ready? the passage stays in view, smaller, above the question */
.qc-sent.qc-under { text-decoration: underline; text-decoration-color: var(--sanguine); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.qc-ready { display: block; margin: 8px auto 0; min-height: 72px; min-width: 160px; font: 700 26px var(--ui); }

/* ---------- tap-to-count ---------- */
/* the acorns are sized by cards.js (--qc-acorn, 96 down to 72 px, as many to a row as fit) so all of them show without
   scrolling; on small screens the item's own dots and the cannon step aside while he counts (M2 review) */
.qc-count { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qc-acorns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.qc-acorn { width: var(--qc-acorn, 96px); height: var(--qc-acorn, 96px); padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 2px dashed var(--line); border-radius: 50%; cursor: pointer; }
.qc-acorn canvas { width: 62%; height: 62%; display: block; }
.qc-acorn.is-hop { animation: qc-hop 420ms ease-in forwards; }
@keyframes qc-hop { 40% { transform: translateY(-34px) scale(1.1); } 100% { transform: translate(60px, -10px) scale(.2); opacity: 0; } }
.qc-cfoot { display: flex; align-items: center; justify-content: center; gap: 10px; }
.qc-cannon { flex: none; }
.qc-small .qc-cannon { display: none; }
.qc-small.qc-counting .qc-q .qc-pic, .qc-cols.qc-counting .qc-q .qc-pic { display: none; }

/* ---------- the Wind-up Count ---------- */
.qc-windup { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qc-go { min-width: 88px; min-height: 88px; border-radius: 50%; font: 700 28px var(--ui); }
/* the key on the card: a brass key that turns a quarter per click, a pip per click, and "Baa-ding!" */
.qc-wkey { display: flex; align-items: center; justify-content: center; gap: 10px; }
.qc-wkeybox { flex: none; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.qc-wkeyc { flex: none; display: block; }
.qc-pips { display: inline-flex; gap: 6px; }
.qc-pip { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.qc-pip.is-on { background: var(--ochre); }
.qc-baa { min-width: 4.6em; font-size: 24px; color: var(--sanguine); text-align: center; }

/* ---------- the Golden card (the Finale, a Last Hurrah, a victory throw): gold from the moment it opens ---------- */
.qc-card.qc-k-golden, .qc-card.qc-k-hurrah {
  border: 3px double var(--ochre); border-bottom: 0;
  box-shadow: 0 0 0 2px rgba(200, 150, 60, .35), 0 -12px 28px -6px rgba(200, 150, 60, .45);
}
.qc-k-golden .qc-head, .qc-k-hurrah .qc-head { border-bottom-color: color-mix(in srgb, var(--ochre) 60%, var(--line)); }
.qc-gthumb { flex: none; display: block; }

/* ---------- M3: the ▲ Dare (a thrilling gamble: the drumroll, the climb, the big gold reveal) ---------- */
/* a dared ARM card wears a red-chalk dashed edge (the Dare is coming); a Dare rung is the gamble itself */
.qc-card.qc-dared { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sanguine) 30%, transparent), 0 -12px 30px -14px rgba(40, 25, 10, .5); }
.qc-card.qc-dare {
  border-top: 4px solid var(--sanguine);
  background-image: var(--grain), repeating-linear-gradient(-45deg, transparent 0 22px, color-mix(in srgb, var(--sanguine) 6%, transparent) 22px 24px);
  animation: qc-in 220ms cubic-bezier(.34, 1.56, .64, 1) both, qc-drum 760ms 220ms linear both;
}
.qc-card.qc-dare.qc-rung2 { border-top-color: color-mix(in srgb, var(--sanguine) 60%, var(--ochre)); }
.qc-card.qc-dare.qc-rung3 { border-top-color: var(--ochre); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ochre) 45%, transparent), 0 -12px 30px -10px rgba(200, 150, 60, .6); }
@keyframes qc-drum {                               /* the card trembles under the drumroll, then holds still to be read */
  0%, 100% { transform: none; }
  10% { transform: translateX(-2px) rotate(-.35deg); } 20% { transform: translateX(2px) rotate(.35deg); }
  30% { transform: translateX(-3px) rotate(-.5deg); } 40% { transform: translateX(3px) rotate(.5deg); }
  50% { transform: translateX(-3px) rotate(-.45deg); } 60% { transform: translateX(3px) rotate(.45deg); }
  70% { transform: translateX(-2px) rotate(-.3deg); } 80% { transform: translateY(-3px) scale(1.01); } 90% { transform: none; }
}
.qc-darebar {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 0 0 6px; padding: 6px 10px; border: 2px dashed var(--sanguine); border-radius: 12px;
  background: color-mix(in srgb, var(--sanguine) 8%, var(--card));
}
.qc-drow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; max-width: 100%; }
/* the gamble's promise where a child reads it (M3 review): "Miss it? Your Acorn Cannon still flies." */
.qc-dsafe { font: 700 18px/1.2 var(--ui); color: var(--ink); text-align: center; }
.qc-dare-t { font-size: 26px; letter-spacing: .1em; color: var(--sanguine); animation: qc-slam 380ms 120ms cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes qc-slam { 0% { transform: scale(2.4) rotate(-6deg); opacity: 0; } 70% { transform: scale(.94) rotate(-2deg); opacity: 1; } 100% { transform: rotate(-2deg); } }
.qc-dpips { display: inline-flex; gap: 4px; font-size: 18px; line-height: 1; }
.qc-dpip { font-style: normal; color: var(--line); }
.qc-dpip.is-won { color: var(--ochre); }
.qc-dpip.is-now { color: var(--sanguine); animation: qc-pip 900ms ease-in-out infinite; }
@keyframes qc-pip { 50% { transform: translateY(-3px) scale(1.25); } }
.qc-dgrow { display: inline-flex; align-items: center; gap: 6px; }
.qc-dthumb { display: block; flex: none; }
.qc-dthumb.is-small { opacity: .7; }
.qc-dthumb.is-big { animation: qc-grow 900ms 200ms cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes qc-grow { 0% { transform: scale(.55); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.qc-darrow { font: 700 22px var(--ui); color: var(--sanguine); }
.qc-dprize { font: 700 28px/1.1 var(--display); color: var(--sanguine); }
.qc-small .qc-dare-t { font-size: 21px; }
.qc-small .qc-dprize { font-size: 22px; }
.qc-rung3 .qc-dprize, .qc-rung2 .qc-dprize { color: color-mix(in srgb, var(--sanguine) 55%, var(--ochre)); }
.qc-pk .qc-dare-t { font-size: 26px; letter-spacing: .04em; text-transform: none; }
/* small screens and two columns (M3 review): one compact row, about 40–60 px with the promise, so the question and every
   answer stay in view; the header already says "CYRUS'S DARE" and the voice reads the rest, so the title steps aside */
.qc-darebar.is-tight { padding: 2px 8px 3px; margin-bottom: 4px; gap: 0; }
.qc-darebar.is-tight .qc-drow { flex-wrap: nowrap; gap: 6px; }
.qc-darebar.is-tight .qc-dare-t { display: none; }
.qc-darebar.is-tight .qc-dpips { font-size: 14px; flex: none; }
.qc-darebar.is-tight .qc-dgrow { flex: none; gap: 3px; }
.qc-darebar.is-tight .qc-darrow { font-size: 16px; }
.qc-darebar.is-tight .qc-dprize { flex: 0 1 auto; min-width: 0; font-size: 19px; line-height: 1.05; text-align: left; }
.qc-darebar.is-tight .qc-dsafe { font-size: 16px; }
/* the climb: "▲ Yes! Next: the Triple Acorn!" in red chalk, as the next rung slides up under it */
.qc-stamp.is-climb .qc-stampline { font-size: 30px; }
/* no room above the new card (a phone's full-height card): smaller, over its header row (M3 review) */
.qc-stamp.is-tight .qc-stampline { font-size: 22px; line-height: 1.05; margin-top: -4px; }
.qc-stamp.is-over { flex-direction: row; gap: 8px; }
.qc-stamp.is-over .qc-stampline { font-size: 19px; margin: 0; text-align: left; min-width: 0; }
/* the big gold reveal: the prize's name in gold over the field as the shot launches (it takes no taps) */
.qc-reveal {
  position: absolute; left: 50%; top: 14%; z-index: 4; pointer-events: none;
  width: max-content; max-width: calc(100% - 24px);       /* M3 review: centred on its own width, never wider than the stage */
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: translateX(-50%);
  animation: qc-reveal 1700ms cubic-bezier(.2, 1.4, .4, 1) both;
}
.qc-rays {
  position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(color-mix(in srgb, var(--ochre) 55%, transparent) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: qc-spin 1700ms linear both;
}
.qc-rthumb { display: block; animation: qc-grow 700ms cubic-bezier(.3, 1.6, .5, 1) both; }
.qc-rtext {
  /* M3 review: "Super-Bouncy Pinecone!" was cut off at both edges of a phone; the name wraps and scales with the screen */
  font: 700 clamp(30px, 9vw, 54px)/1.05 var(--display); letter-spacing: .02em; text-align: center; white-space: normal;
  max-width: 100%; overflow-wrap: break-word;
  color: #f2c14e; -webkit-text-stroke: 2px #4a2e0c; paint-order: stroke fill;
  text-shadow: 0 3px 0 #7a4f12, 0 0 18px rgba(242, 193, 78, .65);
}
@media (min-width: 600px) { .qc-rt3 .qc-rtext { font-size: 62px; } }
.qc-rline { font-size: 30px; color: var(--sanguine); text-shadow: 0 1px 0 var(--card); }
.qc-spk {
  position: absolute; left: 50%; top: 46%; width: 12px; height: 12px; margin: -6px; background: #f2c14e; border: 2px solid #7a4f12;
  transform: rotate(var(--a)) translateY(0) rotate(45deg); animation: qc-spark 1100ms 80ms ease-out both;
}
@keyframes qc-spark {
  0% { transform: rotate(var(--a)) translateY(0) rotate(45deg) scale(.4); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--d, 140px))) rotate(45deg) scale(1); opacity: 0; }
}
@keyframes qc-spin { from { transform: rotate(0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: rotate(80deg) scale(1.15); opacity: 0; } }
@keyframes qc-reveal {
  0% { transform: translateX(-50%) scale(0) rotate(-10deg); opacity: 0; } 14% { transform: translateX(-50%) scale(1.28) rotate(3deg); opacity: 1; }
  24% { transform: translateX(-50%) scale(1) rotate(-2deg); } 78% { transform: translateX(-50%) scale(1.04) rotate(-2deg); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-30px) scale(.9) rotate(-2deg); opacity: 0; }
}
.qc-reveal.is-gentle, .qc-reveal.is-gentle .qc-rays, .qc-reveal.is-gentle .qc-spk, .qc-card.qc-gentle.qc-dare { animation-duration: 1ms; }
.qc-card.qc-static.qc-dare, .qc-card.qc-static.qc-strip, .qc-static .qc-dare-t, .qc-static .qc-dthumb.is-big { animation: none; }   /* measured at rest */
.qc-reveal.is-gentle { animation: qc-fade 1600ms ease-in both; }
.qc-rline { max-width: 100%; text-align: center; }
/* a demo scene holds the reveal at its height for a picture */
.qc-reveal.is-held, .qc-reveal.is-held .qc-rays, .qc-reveal.is-held .qc-spk, .qc-reveal.is-held .qc-rthumb { animation: none; opacity: 1; }
.qc-reveal.is-held .qc-rays { transform: rotate(30deg); }
.qc-reveal.is-held .qc-spk { transform: rotate(var(--a)) translateY(calc(-.7 * var(--d, 140px))) rotate(45deg); }

/* ---------- M3 review: Stump the Grown-up's gotcha on the grown-up's card ("CYRUS PICKED HISTORY! Can Dad do it?") ---------- */
.qc-stumpbar {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 12px;
  margin: 0 0 6px; padding: 4px 12px 6px; border: 2px solid var(--sanguine); border-radius: 12px;
  background: color-mix(in srgb, var(--sanguine) 10%, var(--card));
  animation: qc-slam 380ms 80ms cubic-bezier(.2, 1.6, .4, 1) both;
}
.qc-stump-t { font-size: 22px; letter-spacing: .08em; color: color-mix(in srgb, var(--sanguine) 78%, var(--ink)); text-align: center; }
.qc-stump-s { font-size: 28px; line-height: 1.1; color: var(--ink); }
.qc-stumpbar.is-tight { padding: 2px 8px 3px; margin-bottom: 4px; }
.qc-stumpbar.is-tight .qc-stump-t { font-size: 18px; }
.qc-stumpbar.is-tight .qc-stump-s { font-size: 22px; }
.qc-static .qc-stumpbar { animation: none; }

/* ---------- M3: the Second Key and the locked crate ---------- */
.qc-keybar, .qc-lockbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
  margin: 0 0 6px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--ochre);
  background: color-mix(in srgb, var(--ochre) 10%, var(--card));
}
.qc-lockbar { border-color: var(--ink-soft); background: color-mix(in srgb, var(--ink) 5%, var(--card)); }
.qc-ribico { width: 40px; height: 28px; flex: none; color: var(--ink); }
.qc-rib-t { font-size: 18px; letter-spacing: .1em; color: var(--ink); }
.qc-rib-s { font: 700 17px/1.25 var(--ui); color: var(--ink-soft); text-align: center; }
.qc-kpips { display: inline-flex; gap: 5px; }
.qc-kpip { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.qc-kpip.is-won { background: var(--ochre); }
/* small screens (M3 review): one compact row; the header already names the Key or the crate */
.qc-keybar.is-tight, .qc-lockbar.is-tight { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; padding: 3px 8px; margin-bottom: 4px; }
.is-tight .qc-ribico { width: 30px; height: 22px; }
.is-tight .qc-rib-t { display: none; }
.is-tight .qc-kpips { flex: none; }
.is-tight .qc-rib-s { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.2; text-align: left; }
/* a grown-up's Dare rung: a 20 s sand-glass along the card's top edge (M3 review; never for P–5) */
.qc-sand { position: absolute; left: 0; right: 0; top: 0; height: 8px; z-index: 2; pointer-events: none; color: var(--ochre); }
.qc-sandbar { position: absolute; left: 0; right: 26px; top: 0; height: 8px; overflow: hidden; background: color-mix(in srgb, var(--ochre) 20%, transparent); }
.qc-sandbar i { display: block; height: 100%; background: currentColor; transform-origin: left center; animation: qc-sand 20s linear forwards; }
.qc-sandico { position: absolute; right: 4px; top: 2px; width: 18px; height: 24px; }
.qc-sand.is-low { color: var(--sanguine); }
.qc-sand.is-low .qc-sandico { animation: qc-pip 900ms ease-in-out infinite; }
.qc-sand.is-stopped .qc-sandbar i, .qc-sand.is-stopped .qc-sandico { animation-play-state: paused; }
@keyframes qc-sand { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- M3: Answer Tags (the Bumblebee Dart): a slim strip at the top, the field in view below ---------- */
.qc-card.qc-strip {
  top: 0; bottom: auto; height: auto; max-height: 34%; border-top: 0; border-bottom: 2px solid var(--ink);
  box-shadow: 0 12px 30px -14px rgba(40, 25, 10, .5);
  animation: qc-down 220ms cubic-bezier(.34, 1.56, .64, 1) both;
}
.qc-card.qc-strip.is-leaving { animation: qc-up 200ms ease-in forwards; }
@keyframes qc-down { from { transform: translateY(-46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qc-up { to { transform: translateY(-46px); opacity: 0; } }
.qc-strip .qc-head { padding: 4px 10px 2px 12px; flex-wrap: nowrap; gap: 10px; border-bottom: 0; }
.qc-strip .qc-who { flex: none; }                  /* M3 review: the emblem keeps its own column (it sat over "Which") */
.qc-strip.qc-small .qc-speak { width: 56px; height: 56px; margin-left: 0; }
.qc-strip.qc-small .qc-speak .qc-ico { width: 26px; height: 26px; }
.qc-strip .qc-head .qc-q { flex: 1 1 auto; min-width: 0; justify-content: flex-start; gap: 10px; flex-wrap: nowrap; }
.qc-strip .qc-head .qc-prompt { text-align: left; }
.qc-strip .qc-seal, .qc-strip .qc-foot, .qc-strip .qc-only, .qc-strip .qc-name { display: none; }
.qc-card.qc-strip:not(.qc-phone) .qc-opts.qc-tagrow { display: flex; flex-wrap: nowrap; }
.qc-strip .qc-body { padding: 2px 10px 6px; }
.qc-strip .qc-prompt { font-size: 24px; margin: 0; }
.qc-strip .qc-ans { margin-top: 4px; }
.qc-tagrow { flex-wrap: nowrap; gap: 8px; }
.qc-tagbtn { flex: 1 1 0; min-width: 96px; min-height: 56px; padding: 4px 8px; border-style: dashed; border-radius: 6px 18px 18px 6px; }
.qc-tagbtn .qc-otext { font-size: 22px; }
.qc-strip .qc-note { margin-top: 4px; }
.qc-card.qc-strip.qc-small { max-height: 52%; }
.qc-strip.qc-small .qc-prompt { font-size: 20px; }
.qc-strip.qc-small .qc-tagbtn .qc-otext { font-size: 20px; }
/* a phone (M3 review: two rows of tags and the speaker on its own row left about 40 px of battlefield): one row of tags
   (four, a grown-up's, in a 2 × 2 grid at 96 px each), the speaker inline at the end of the prompt row, the strip at
   most 30% of the stage; a tag's text may take two lines but is never cut short (its tag on the field says it whole) */
.qc-card.qc-strip.qc-phone { max-height: 30%; }
.qc-strip.qc-phone .qc-head { flex-wrap: nowrap; padding: 2px 6px 0 8px; gap: 6px; }
.qc-strip.qc-phone .qc-who { order: 0; flex: none; }
.qc-strip.qc-phone .qc-speak { order: 2; }
.qc-strip.qc-phone .qc-head .qc-q { order: 1; }
.qc-strip.qc-phone .qc-emblem { font-size: 24px; }
.qc-strip.qc-phone .qc-crest { width: 28px !important; height: 28px !important; }
.qc-strip.qc-phone .qc-body { padding: 0 6px 4px; }
.qc-strip.qc-phone .qc-ans { margin-top: 2px; }
.qc-strip.qc-phone .qc-opts.qc-tagrow { display: flex; flex-wrap: nowrap; gap: 6px; }
.qc-strip.qc-phone .qc-opts.qc-tagrow.qc-n4 { display: grid; grid-template-columns: repeat(2, minmax(96px, 1fr)); }
.qc-strip.qc-phone .qc-tagbtn { flex: 1 1 0; min-width: 96px; min-height: 56px; padding: 2px 6px; }
.qc-strip.qc-phone .qc-tagbtn .qc-otext { font-size: 20px; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Stump the Grown-up (M3): the child picks the grown-up's subject from 3 picture seals ---------- */
.qc-card.qc-stump { border-top: 3px solid var(--sanguine); }
.qc-stump .qc-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qc-stump-q { font-size: 30px; }
.qc-stump-hint { margin: -4px 0 4px; font-size: 26px; color: var(--sanguine); text-align: center; }
.qc-seals { width: 100%; max-width: 720px; }
.qc-sealbtn { min-height: 120px; border-radius: 50% / 38%; gap: 2px; }
.qc-pk .qc-sealbtn { min-height: 140px; }
.qc-sealico { width: 52px; height: 52px; display: block; color: var(--sanguine); }
.qc-card .qc-sealbtn .qc-otext { font-size: 20px; letter-spacing: .04em; line-height: 1.1; }
.qc-small .qc-sealbtn { min-height: 96px; padding: 6px 6px; }
.qc-card.qc-small .qc-opts.qc-seals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* M4: Planet Day's five worlds (the same picker): the ink worlds in wash blue, each with its pull under it ("about 1/6
   the pull" for P–3, "× 0.17" for 4–G; M4 review), its two lines balanced */
.qc-card.qc-worlds { border-top-color: var(--wash); }
.qc-worlds .qc-sealico { color: var(--wash); width: 56px; height: 56px; }
.qc-worlds .qc-stump-hint { color: var(--wash); }
.qc-sealsub { display: block; font: 400 16px/1.1 var(--ui); color: var(--ink-soft); pointer-events: none; }
.qc-worlds .qc-opts.qc-seals.qc-n5 .qc-sealbtn { min-width: 0; }
.qc-worlds .qc-sealsub { text-align: center; text-wrap: balance; }
/* on a phone (three seals a row) a world's name keeps to one line: "NEPTUNE" broke as "NEPTUN / E" at 360 × 640 */
.qc-card.qc-small.qc-worlds .qc-sealbtn { padding: 6px 3px 14px; }   /* the sub line's last row clear of the oval's rim */
.qc-card.qc-small.qc-worlds .qc-sealbtn .qc-otext { font-size: 17px; letter-spacing: 0; overflow-wrap: normal; word-break: keep-all; }
.qc-card.qc-small.qc-worlds .qc-sealsub { max-width: 5.6em; margin: 0 auto; }   /* two short lines, inside the oval */
/* a phone held sideways: the five worlds in one row, so Neptune and Jupiter are not below the fold at 640 × 360 */
.qc-card.qc-small.qc-lphone.qc-worlds .qc-opts.qc-seals { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.qc-card.qc-small .qc-stump-q { font-size: 24px; margin: 0; }
.qc-card.qc-small .qc-stump-hint { font-size: 22px; margin: -2px 0 2px; }
.qc-card.qc-small.qc-stump .qc-body { gap: 4px; padding-top: 4px; }
.qc-small .qc-sealico { width: 40px; height: 40px; }
@media (prefers-reduced-motion: reduce) {
  .qc-card.qc-dare, .qc-dare-t, .qc-dpip.is-now, .qc-dthumb.is-big, .qc-rays, .qc-spk, .qc-rthumb, .qc-card.qc-strip { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .qc-rays, .qc-spk { display: none; }               /* the reveal itself stays: a still gold name that fades (is-gentle) */
}

/* ---------- M4: a Pre-K or K card never needs a scroll ----------
   cards.js fitNoScroll adds these one at a time, only while an answer would sit below the fold (at 1024 × 768 a Pre-K
   Dare's pictures did); every tap target keeps its K.CARD minimum (P/K tiles 112 px tall, the speaker 80) */
.qc-card.qc-fit1 .qc-foot { display: none; }
.qc-card.qc-fit2 .qc-head { padding-top: 3px; padding-bottom: 3px; }
.qc-card.qc-fit2 .qc-body { padding-top: 6px; padding-bottom: 6px; }
.qc-card.qc-fit2 .qc-ans { margin-top: 6px; }
.qc-card.qc-fit2 .qc-prompt { margin: 2px 0; }
.qc-card.qc-tablet.qc-fit3 { max-height: 90%; }
.qc-card.qc-fit4.qc-pk .qc-prompt { font-size: 30px; }
.qc-card.qc-fit4 .qc-opic { width: 64px !important; height: 64px !important; }
.qc-card.qc-fit4 .qc-ten { width: auto !important; height: 46px; }
.qc-card.qc-fit4 .qc-tfbug canvas { width: 56px !important; height: 56px !important; }
.qc-card.qc-fit4 .qc-opt { gap: 2px; padding-top: 4px; padding-bottom: 4px; }
.qc-card.qc-fit5 .qc-pic { width: 104px !important; height: 104px !important; }
.qc-card.qc-fit5.qc-pk .qc-otext { font-size: 32px; }
.qc-card.qc-fit5 .qc-opic { width: 52px !important; height: 52px !important; }
.qc-card.qc-fit5 .qc-ten { height: 38px; }
.qc-card.qc-fit6 .qc-opts.qc-n3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.qc-card.qc-fit6 .qc-opts.qc-n3 .qc-opt { min-width: 0; padding-left: 3px; padding-right: 3px; }
.qc-card.qc-fit6.qc-pk .qc-opts.qc-n3 .qc-otext { font-size: 22px; }

/* ---------- two columns (landscape with little height, keypads) ---------- */
.qc-cols .qc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-rows: minmax(0, 1fr); gap: 14px; overflow: hidden; padding: 6px 12px 8px; }
.qc-cols .qc-main, .qc-cols .qc-ans { overflow-y: auto; overflow-x: hidden; min-height: 0; overscroll-behavior: contain; }
/* a keypad's answer column is the wider one, so four keys fit across (M3 review: three across took four rows, and the
   last hid under a phone held sideways) */
.qc-cols.qc-kcols .qc-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); }
/* safe centring: auto margins centre the answers when they fit and fall to 0 when they do not, so an answer column taller
   than the room starts at its top and every key can be scrolled to (M2 review: justify-content: center pushed the top
   row of an overflowing keypad above the scroll origin) */
.qc-cols .qc-ans { margin-top: 0; display: flex; flex-direction: column; justify-content: flex-start; }
.qc-cols .qc-ans > :first-child { margin-top: auto; }
.qc-cols .qc-ans > :last-child { margin-bottom: auto; }
.qc-cols .qc-keypad { gap: 3px; }
.qc-cols .qc-krow0 { width: 297px; gap: 3px; }
.qc-cols .qc-keypad, .qc-cols .qc-krow0 { max-width: 100%; }
.qc-cols .qc-notetext { -webkit-line-clamp: unset; display: block; overflow: visible; }   /* the owl's note scrolls with its column */
/* Pre-K's two tiles side by side in the answer column, so neither waits below the fold */
.qc-cols.qc-pk .qc-opts.qc-n2 { flex-direction: row; align-items: stretch; }
.qc-cols.qc-pk .qc-opts.qc-n2 .qc-opt { flex: 1 1 0; min-width: 0; padding: 6px; }
/* a passage in two columns: the story in the wide one until Ready? (M2 review: it had the narrow one) */
.qc-cols.qc-f-passage:not(.qc-asked) .qc-body { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.qc-cols .qc-head { padding: 4px 4px 6px 4px; }
.qc-cols .qc-q { gap: 10px; }
.qc-cols .qc-foot { border-top: 0; padding: 4px 0 0; }
.qc-cols .qc-opts { flex-direction: column; align-items: stretch; }
.qc-cols .qc-opt { flex: none; }

/* ---------- small screens ---------- */
.qc-small .qc-prompt { font-size: 26px; }
.qc-small.qc-pk .qc-prompt { font-size: 32px; }
.qc-small .qc-otext { font-size: 26px; }
.qc-small.qc-long .qc-otext { font-size: 20px; }
.qc-small .qc-opts.qc-n4, .qc-small .qc-opts.qc-n3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qc-small.qc-long .qc-opts { display: flex; }
.qc-small.qc-pk .qc-opt { min-width: 0; }
.qc-small .qc-opt { min-width: 0; padding-left: 8px; padding-right: 8px; }
.qc-small .qc-opts.qc-n4 .qc-otext { font-size: 24px; }   /* a 2 × 2 grid on a phone: "Quotients" whole, not "Quotient / s" */
.qc-small .qc-head { padding: 6px 8px 4px 10px; gap: 2px 10px; }
.qc-phone .qc-only, .qc-small .qc-only { display: none; }
/* while a ribbon shows on a small screen (M3 review) the foot steps aside: the ribbon says the same (the Dare's promise,
   the Key's count, "it opens either way") and the room goes to the question and the answers */
.qc-small.qc-has-rib .qc-foot, .qc-cols.qc-has-rib .qc-foot { display: none; }
/* a phone's keypad (and a phone held sideways, .qc-lphone): 56 px keys, so every row and the answer box fit without a
   scroll (M3 review: the Lock's 7–0);
   with a ribbon showing, the subject's seal steps aside too (the ribbon names the moment) and the gaps close up */
.qc-phone .qc-keypad, .qc-lphone .qc-keypad { grid-auto-rows: 56px; }
.qc-phone .qc-key, .qc-lphone .qc-key { height: 56px; }
.qc-phone.qc-has-rib .qc-seal, .qc-lphone.qc-has-rib .qc-seal { display: none; }
.qc-phone.qc-has-rib .qc-head, .qc-lphone.qc-has-rib .qc-head { padding-top: 4px; padding-bottom: 2px; }
.qc-phone.qc-has-rib .qc-body { padding-top: 6px; padding-bottom: 6px; }
.qc-phone.qc-has-rib .qc-ans { margin-top: 6px; }
.qc-phone.qc-has-rib .qc-prompt, .qc-lphone.qc-has-rib .qc-prompt { margin: 2px 0; }
.qc-lphone.qc-has-rib .qc-head { flex-wrap: nowrap; }
.qc-lphone.qc-has-rib .qc-who { flex: 1 1 auto; min-width: 0; }
.qc-phone .qc-head { flex-wrap: wrap; }
.qc-phone .qc-who { order: 0; flex: 1 1 0; }
.qc-phone .qc-speak { order: 1; margin-left: 0; }
.qc-phone .qc-seal { order: 2; flex-basis: 100%; margin-top: -6px; }
.qc-small .qc-body { padding: 8px 10px 10px; }
.qc-small .qc-quiet .qc-prompt, .qc-small.qc-quiet .qc-prompt { font-size: 24px; }
.qc-small .qc-ptext { max-height: 36vh; }
.qc-phone .qc-body { padding-left: 6px; padding-right: 6px; }
.qc-phone .qc-keypad { gap: 3px; }
.qc-phone .qc-krow0 { width: 297px; gap: 3px; }
.qc-keypad.qc-k3 { grid-template-columns: repeat(3, 72px); }
.qc-k3box .qc-krow0 { width: 222px; }
.qc-k3box .qc-kfire { width: 72px; min-width: 72px; font-size: 20px; }
.qc-k3box .qc-kval { font-size: 30px; }
.qc-k3box .qc-kvwrap { min-width: 60px; padding: 0 6px; }   /* (M4) the signed keypad's − , answer and Open! fit 222 px */

/* the passage card on a phone: one scroll only (the story no longer scrolls inside the scrolling body), and Ready? pinned
   to the bottom of the body, above the foot (M2 review: 12 px of it showed under the foot) */
.qc-phone .qc-ptext, .qc-phone.qc-asked .qc-ptext { max-height: none; overflow: visible; }
.qc-phone.qc-f-passage:not(.qc-asked) .qc-ans { position: sticky; bottom: 0; z-index: 1; background: var(--card); padding: 2px 0 4px; }
.qc-phone.qc-f-passage .qc-ready { margin-top: 4px; }

/* ---------- the Reckoning sheet (small canvases): compact, so its answers show without scrolling ----------
   (M2 review: at 360 × 640 the header took 93 of 196 px and the body 41; at 640 × 360 the body had 18 px) */
.qc-sheet .qc-head { flex-wrap: nowrap; gap: 8px; padding: 2px 8px; min-height: 0; }
.qc-sheet .qc-seal, .qc-sheet .qc-only, .qc-sheet .qc-foot { display: none; }
.qc-sheet .qc-name { font-size: 13px; }
.qc-sheet .qc-crest { width: 24px !important; height: 24px !important; }
.qc-sheet .qc-emblem { font-size: 20px; }
.qc-sheet .qc-speak { width: 56px; height: 56px; margin-left: auto; }
.qc-sheet .qc-speak .qc-ico { width: 26px; height: 26px; }
.qc-sheet .qc-body { padding: 4px 10px 6px; }
.qc-sheet .qc-prompt, .qc-sheet.qc-small .qc-prompt { font-size: 20px; margin: 2px 0; }
.qc-sheet .qc-q { gap: 8px; }
.qc-sheet .qc-ans { margin-top: 6px; }
.qc-sheet .qc-opts, .qc-sheet.qc-small .qc-opts.qc-n3, .qc-sheet.qc-small .qc-opts.qc-n4 { display: flex; flex-wrap: nowrap; gap: 8px; }
.qc-sheet .qc-opt { flex: 1 1 0; min-width: 0; min-height: 56px; padding: 4px 8px; }
.qc-sheet .qc-otext, .qc-sheet.qc-small .qc-otext { font-size: 24px; }
.qc-sheet .qc-windup { flex-direction: row; align-items: center; justify-content: center; gap: 6px; }
.qc-sheet .qc-wtiles { flex: 0 1 auto; min-width: 0; gap: 6px; }
.qc-sheet .qc-wtiles .qc-opt { flex: 1 1 56px; min-width: 56px; }
.qc-sheet .qc-wkey { flex: none; gap: 4px; }
.qc-sheet .qc-wkeyc { width: 32px !important; height: 32px !important; }
.qc-sheet .qc-wkeybox { gap: 2px; }
.qc-sheet .qc-pips { gap: 3px; }
.qc-sheet .qc-pip { width: 9px; height: 9px; border-width: 1.5px; }
.qc-sheet .qc-baa { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); min-width: 0; font-size: 22px; pointer-events: none; }
.qc-sheet .qc-go { min-width: 56px; min-height: 56px; border-radius: 28px; font-size: 22px; padding: 0 8px; }
/* a sheet on a phone held upright (M4: at 336 × 548 the Wind-up's tiles were cut off): the speaker floats in the header's
   corner and the question flows beside it under the name, so the header, the question and one row of tiles fit the 40% */
.qc-sheet.qc-qhead .qc-head { display: block; padding: 3px 8px 2px; }
.qc-sheet.qc-qhead .qc-head::after { content: ""; display: block; clear: both; }
.qc-sheet.qc-qhead .qc-speak { float: right; margin: 0 0 2px 8px; }
.qc-sheet.qc-qhead .qc-who { display: flex; min-height: 0; }
.qc-sheet.qc-qhead .qc-q { display: block; }
.qc-sheet.qc-qhead .qc-prompt { text-align: left; margin: 0; line-height: 1.2; }
.qc-sheet.qc-qhead .qc-body { padding-top: 2px; }
.qc-sheet.qc-qhead .qc-ans { margin-top: 2px; }
.qc-sheet.qc-qhead .qc-windup, .qc-sheet.qc-qhead .qc-wtiles { gap: 4px; }
.qc-sheet.qc-qhead .qc-wkey { gap: 3px; }
.qc-sheet.qc-qhead .qc-wtiles .qc-opt { padding-left: 2px; padding-right: 2px; }
/* a sheet held sideways: one line for the name, then the prompt beside the answers, the speaker at the right */
.qc-sheet.qc-land .qc-head { padding: 2px 76px 0 10px; border-bottom: 0; }
.qc-sheet.qc-land .qc-head .qc-speak { position: absolute; right: 8px; bottom: 8px; margin: 0; }
.qc-sheet.qc-land .qc-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 2px 76px 6px 10px; }
.qc-sheet.qc-land .qc-main { flex: 1 1 34%; }
.qc-sheet.qc-land .qc-ans { flex: 1 1 60%; min-width: 0; margin-top: 0; }
.qc-sheet.qc-land .qc-note { flex: 1 1 100%; margin-top: 4px; }
/* (M4) a narrow phone held a little sideways (a 458 × 395 stage, under 520 wide): the Wind-up's tiles, key and Go! take
   their own row under the question, as its 280 px row does not fit beside it */
.qc-sheet.qc-land.qc-f-windup.qc-w520 .qc-main, .qc-sheet.qc-land.qc-f-windup.qc-w520 .qc-ans { flex: 1 1 100%; }
/* (M4 integration) a keypad in a tablet's 40% Reckoning sheet (the Scales' Sharing, Halves, Groups, the Clock Sight's
   keypad): the answer box and Fire! stand beside the keys instead of above them, so all three rows of keys show without
   scrolling (at 1180 × 820 the 7 8 9 0 row sat under the sheet's fold) */
.qc-sheet.qc-land.qc-w600:not(.qc-lphone).qc-f-keypad .qc-kbox { flex-direction: row; align-items: center; justify-content: center; gap: 12px; }
.qc-sheet.qc-land.qc-w600:not(.qc-lphone).qc-f-keypad .qc-krow0 { flex-direction: column; width: 200px; }
.qc-sheet.qc-land.qc-w600:not(.qc-lphone).qc-f-keypad .qc-kvwrap { flex: none; height: 64px; }
.qc-sheet.qc-land.qc-w600:not(.qc-lphone).qc-f-keypad .qc-kfire, .qc-sheet.qc-land.qc-w600:not(.qc-lphone).qc-f-keypad .qc-kneg { width: 100%; height: 64px; }
@media (prefers-reduced-motion: reduce) {
  .qc-card, .qc-card.is-leaving, .qc-stamp, .qc-acorn.is-hop, .qc-tfbug canvas, .qc-speak.is-pulse { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

/* ==========================================================
   The Grown-ups' Cabinet (cabinet.js, #scrCabinet): a specimen cabinet of eight drawers, the presets and
   search on top, the fit panel and the brass tap beside the drawers on a tablet held sideways (above them on
   a phone), the dials below, and a foot that never scrolls away (Back, Start, and on a phone the fit line).
   Tap targets 56 px (the tick box 48), Start 72. site.css variables only, so lamplight comes for free.
   ========================================================== */
#scrCabinet { padding-bottom: 0; }
.cb { max-width: 1180px; gap: 12px; }
.cb .hb-setup-head h2 { font-size: clamp(1.7rem, 4.6vw, 2.3rem); }
.cb .hb-setup-head .hb-note { max-width: 40em; margin: 2px auto 0; }
.cb-lbl { margin: 0 0 6px; font-size: .92rem; letter-spacing: .08em; color: var(--sanguine); }
.cb-ico { width: 26px; height: 26px; display: block; }
.cb .hb-chip.cb-small { padding: 4px 12px; font-size: .98rem; }
.cb .hb-chip { text-align: center; }

/* the lock banner (read-only, or a lesson's preset) */
.cb-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 10px 14px; border: 1.5px dashed var(--sanguine); border-radius: 12px; background: var(--card);
}
.cb-banner p { margin: 0; flex: 1 1 220px; font: 400 1.05rem/1.35 var(--ui); }
.cb-banner.is-lesson { border-style: solid; border-color: var(--line); }
.cb-seal {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sanguine); color: var(--paper); font-size: 1.35rem;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--paper) 35%, transparent);
}
.cb-banner .btn.cb-unlock { flex: 0 1 auto; max-width: 100%; white-space: normal; }
@media (max-width: 520px) { .cb-banner .btn.cb-unlock { flex: 1 1 100%; } }

/* the layout: one column; drawers beside a sticky side column on wide screens */
.cb-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.cb-top, .cb-fit, .cb-rhythm, .cb-dials {
  min-width: 0;
  background: var(--card); background-image: var(--grain);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px;
}
.cb-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cb-fit h3, .cb-rhythm h3, .cb-dials h3 { margin: 0 0 8px; font-family: var(--caps); font-weight: 400; font-size: 1.12rem; letter-spacing: .05em; }
.cb-fit h3 small { font: 400 .85rem var(--ui); letter-spacing: 0; color: var(--ink-soft); margin-left: 6px; }
.cb-dials h3 .hb-fig { display: inline; font-size: .85rem; margin-right: 6px; color: var(--sanguine); }
@media (min-width: 880px) {
  .cb-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  .cb-top { grid-column: 1; grid-row: 1; }
  .cb-drawers { grid-column: 1; grid-row: 2; }
  .cb-rhythm { grid-column: 1; grid-row: 3; }
  .cb-dials { grid-column: 1; grid-row: 4; }
  .cb-side { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 8px; max-height: var(--cb-room, 480px); overflow-y: auto; overscroll-behavior: contain; }
  .cb-mini { display: none; }
  .cb-rhythm { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; }
  .cb-rhythm .cb-rhead { grid-column: 1; grid-row: 1 / span 2; flex-direction: row-reverse; justify-content: flex-end; margin: 0; }
  .cb-rhythm .cb-seg, .cb-rhythm > .cb-val { grid-column: 2; grid-row: 1; }
  .cb-rhythm .cb-rline { grid-column: 2; grid-row: 2; margin: 0; }
  .cb-rhythm > .hb-note { grid-column: 1 / -1; }
}

/* presets, saving, search */
.cb-presets .hb-chips { gap: 8px; }
.cb-star { color: var(--ochre); }
.hb-chip[aria-pressed="true"] .cb-star { color: var(--paper); }
.cb-savebtn { border-style: dashed; }
.cb-save { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cb-save .hb-note { margin: 8px 0 6px; }
.cb-forget { font-weight: 400; }
.cb-savemsg { margin-top: 6px; }
.cb-finder { margin-top: 12px; }
.cb-psel { display: none; position: relative; min-width: 0; }
.cb-psel::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-soft); }
.cb-select { width: 100%; padding-right: 34px; -webkit-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis; }
.cb-searchrow { display: flex; gap: 8px; align-items: center; }
.cb-searchrow .hb-text { flex: 1 1 auto; -webkit-appearance: none; appearance: none; }
#cbSearch::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }   /* our own × only */
/* while searching, the matches sit right under the search box: the rhythm and the dials step aside (and on a phone or
   an upright tablet the fit panel too; the foot's fit line stays) (M2 review: hits landed off-screen at every size) */
.cb.is-searching .cb-rhythm, .cb.is-searching .cb-dials { display: none; }
@media (max-width: 879px) { .cb.is-searching .cb-side { display: none; } }
/* a phone held sideways has little room under the box: no label, no "3 packs match" line, slimmer drawer heads */
@media (max-height: 520px) {
  .cb.is-searching .cb-search .cb-lbl { display: none; }
  .cb.is-searching .cb-matches.has-hits { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cb.is-searching .cb-dhead { min-height: 56px; padding-top: 4px; padding-bottom: 4px; }
  .cb.is-searching .cb-dico { width: 34px; height: 34px; }
}
.cb-matches { margin: 0 0 8px; font-weight: 700; }

/* the drawers */
.cb-drawer {
  background: var(--card); background-image: var(--grain);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cb-drawer + .cb-drawer { margin-top: 10px; }
.cb-dhead {
  width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; background: transparent; border: 0; color: var(--ink); text-align: left; cursor: pointer; font-family: var(--ui);
}
.cb-dhead:active { background: var(--paper-deep); }
.cb-dico {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--sanguine);
}
.cb-dname { flex: 1 1 auto; min-width: 0; }
.cb-dname .caps { font-size: 1.2rem; letter-spacing: .05em; color: var(--ink); }
.cb-dname small { display: block; font: 400 .92rem/1.25 var(--ui); color: var(--ink-soft); }
.cb-drawer.has-ticks .cb-dname small { color: var(--ink); font-weight: 700; }
.cb-dfig { flex: none; font-size: .8rem; color: var(--sanguine); letter-spacing: .08em; }
.cb-chev {                      /* the drawer's brass pull */
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ochre); background: color-mix(in srgb, var(--ochre) 20%, var(--card)); color: var(--ink); font-size: 1rem;
}
.cb-dbody { padding: 0 14px 10px; border-top: 1px solid var(--line); }
.cb-dtools { padding: 8px 0 4px; }
.cb-quiet { margin-left: 6px; font: 400 .85rem var(--caps); letter-spacing: .05em; color: var(--sage); white-space: nowrap; }

/* a pack row: the 48 px tick box, topic, grade span, blurb; the counts; variants, "+ one player only", the offer */
.cb-pack { padding: 6px 0 8px; border-top: 1px dashed var(--line); }
.cb-dtools + .cb-pack, .cb-dbody > .cb-pack:first-child { border-top: 0; }
.cb-tick {
  width: 100%; min-height: 56px; display: flex; align-items: flex-start; gap: 12px;
  padding: 6px 2px; background: transparent; border: 0; border-radius: 10px; color: var(--ink); text-align: left; cursor: pointer;
}
.cb-tick:active { background: var(--paper-deep); }
.cb-tick[disabled] { opacity: .5; cursor: not-allowed; }
.cb-box {
  flex: none; width: 48px; height: 48px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--ink); background: var(--paper); color: var(--paper);
}
.cb-box svg { width: 32px; height: 32px; }
.cb-box.is-on { background: var(--ink); }
.cb-ptext { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.cb-topic { font: 700 1.12rem/1.25 var(--ui); overflow-wrap: anywhere; }
.cb-span {
  display: inline-block; margin-left: 8px; padding: 0 8px; vertical-align: 2px;
  border: 1px solid var(--line); border-radius: 999px; font: 700 .8rem/1.5 var(--ui); color: var(--ink-soft); white-space: nowrap;
}
.cb-blurb { display: block; margin-top: 2px; font: 400 1.02rem/1.3 var(--body); color: var(--ink-soft); }
.cb-fitrow, .cb-vars, .cb-only, .cb-offer, .cb-later { margin-left: 62px; }
.cb-fitrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font: 400 .92rem/1.4 var(--ui); color: var(--ink-soft); }
.cb-fc b { font-weight: 700; color: var(--ink); }
.cb-fc.is-none b { color: var(--ink-soft); font-weight: 400; }
.cb-dot { color: var(--line); }
.cb-rkw { font-style: italic; }
.cb-vars, .cb-only, .cb-offer { margin-top: 6px; }
.cb-only .hb-chip { border-style: dashed; }
.cb-only .hb-chip[aria-pressed="true"] { border-style: solid; }
.cb .hb-chip.cb-onlybtn { border-style: dashed; font-weight: 400; color: var(--ink-soft); }
.cb-fitrow .cb-onlybtn { margin-left: 6px; }
.cb .hb-chip.cb-rkoffer {
  text-align: left; border: 2px dashed var(--sanguine); color: var(--sanguine); background: var(--card); font-weight: 700;
}
.cb-later { margin-top: 6px; margin-bottom: 0; font-size: 1.05rem; }
.cb-pack.cb-rk { border-top: 0; margin-top: 6px; padding: 6px 8px 8px; border-radius: 10px; background: color-mix(in srgb, var(--ochre) 9%, transparent); }
.cb-pack.cb-rk .cb-topic { color: var(--sanguine); }

/* read-only: the summary of last time's picks */
.cb-summary ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-summary li { display: flex; align-items: flex-start; gap: 10px; font: 700 1.05rem/1.3 var(--ui); }
.cb-summary li small { font-weight: 400; color: var(--ink-soft); }
.cb-summary .cb-box { width: 28px; height: 28px; border-radius: 6px; border-width: 2px; }
.cb-summary .cb-box svg { width: 20px; height: 20px; }
.cb-fitline { display: block; font: 400 .9rem var(--ui); color: var(--ink-soft); }
.cb-sumsub + .cb-sumsub { border-top: 1px dashed var(--line); padding-top: 8px; }

/* the fit panel */
.cb-fitlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-fp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); }
.cb-fpt {                          /* what he will be asked today */
  flex: 1 1 100%; padding-left: 50px; font: italic 400 .98rem/1.25 var(--body); color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cb-fp .hb-roundel { width: 40px; height: 40px; font-size: 1.15rem; }
.cb-fpn { flex: 1 1 auto; min-width: 0; font: 700 1.08rem/1.2 var(--ui); overflow-wrap: anywhere; }
.cb-fpn small { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.cb-fpc { flex: none; text-align: right; font: 700 1.35rem/1.1 var(--ui); color: var(--ink); }
.cb-fpc small { display: block; font-size: .78rem; font-weight: 400; color: var(--ink-soft); }
.cb-fp.is-zero { border-color: var(--sanguine); }
.cb-fp.is-zero .cb-fpc { color: var(--sanguine); font-size: 1.1rem; }
.cb-fp.is-low .cb-fpc { color: var(--ochre); }
.cb-fp.is-quiet .cb-fpc { color: var(--sage); }
.cb-fp.is-just .cb-fpc { font: italic 400 1rem var(--body); color: var(--ink-soft); }
.cb-warn { margin-top: 10px; }
.cb-warn .hb-redchalk { margin: 0 0 6px; }
.cb .hb-chip.cb-fix { border-color: var(--sanguine); }
.cb-qnote { margin: 10px 0 0; padding: 4px 0 4px 10px; border-left: 3px solid var(--sage); font: 400 1.02rem/1.35 var(--body); color: var(--ink); }
.cb-why { margin: 10px 0 0; font: 700 .95rem/1.3 var(--ui); color: var(--sanguine); }
.cb-key { margin: 10px 0 0; font-size: 1rem; line-height: 1.25; }

/* the Question rhythm: a brass garden tap (its handle turns, the drops fall) beside the heading, three chips below */
.cb-rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 4px; }
.cb-rhead h3 { margin: 0; }
.cb-rhead h3 small { display: block; font: 400 .85rem var(--ui); letter-spacing: 0; color: var(--ink-soft); margin-top: 2px; }
.cb-tap { flex: none; width: 72px; height: 60px; display: block; }
.cb-seg { flex-wrap: nowrap; }
.cb-seg .hb-chip { flex: 1 1 0; min-width: 0; padding: 6px 8px; font-size: 1.1rem; }
.cb-rline { margin: 8px 0 0; font: italic 400 1.05rem/1.35 var(--body); color: var(--ink); }
.cb-val { margin: 0; font: 700 1.1rem/1.3 var(--ui); }

/* the other dials and the grown-up rules */
.cb-dial .hb-note { margin-top: 4px; }
.cb-rules .hb-chip.cb-rule { justify-content: flex-start; text-align: left; flex: 1 1 250px; padding: 6px 12px; }
.cb-rule small { display: block; font: 400 .85rem/1.2 var(--ui); opacity: .85; }
.cb-check {
  flex: none; width: 28px; height: 28px; border-radius: 6px; border: 2px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center;
}
.cb-check svg { width: 20px; height: 20px; }
.cb-gentle { margin-top: 10px; }
.cb-gentle > .hb-lbl { display: block; margin: 0 0 6px; font: 700 .95rem var(--ui); color: var(--ink-soft); }

/* the foot: Back and Start never scroll away; on a phone the fit line rides above them */
.cb-foot {
  position: sticky; bottom: 0; z-index: 3;
  margin: 4px -16px 0; padding: 8px 16px max(10px, env(safe-area-inset-bottom));
  background: var(--paper); background-image: var(--grain);
  border-top: 1.5px solid var(--line); box-shadow: 0 -10px 18px -14px rgba(40, 25, 10, .45);
}
.cb-mini { margin: 0 0 6px; font: 700 .92rem/1.25 var(--ui); color: var(--ink-soft); }
.cb-minibad { color: var(--sanguine); }
.cb-btns { display: flex; gap: 10px; align-items: center; }
.cb-btns .btn { font-family: var(--ui); font-weight: 700; }
.cb-btns .hb-go { flex: 1 1 220px; max-width: 460px; margin-left: auto; }

/* a phone held upright: presets in a picker beside the search, no indents, the drawer's figure label hidden */
@media (max-width: 520px) {
  .cb .hb-setup-head .hb-note { display: none; }
  .cb-presets .cb-pchips, .cb-presets > .cb-lbl { display: none; }
  .cb-save { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 10px; }
  .cb-finder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; margin-top: 0; }
  .cb-psel { display: block; }
  .cb-search .cb-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cb-back span { display: none; }
  .cb-back { padding: 0 16px; font-size: 1.4rem; }
  .cb-btns .btn.hb-go { padding: 10px 12px; font-size: 1.12rem; white-space: nowrap; }
  .cb-fitrow, .cb-vars, .cb-only, .cb-offer, .cb-later { margin-left: 0; }
  .cb-dhead { padding: 8px 10px; gap: 10px; }
  .cb-dbody { padding: 0 10px 8px; }
  .cb-dfig { display: none; }
  .cb-top, .cb-fit, .cb-rhythm, .cb-dials { padding: 10px; }
  .cb-tick { gap: 10px; }
  .cb-btns .hb-go { flex: 1 1 auto; }
}
@media (max-width: 520px) { .cb-fpt { -webkit-line-clamp: 1; } }
/* a short screen (a phone held sideways): the heading on one line, the foot in one row with the fit line between */
@media (max-height: 520px) {
  .cb .hb-setup-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 12px; }
  .cb .hb-setup-head h2 { font-size: 1.45rem; }
  .cb .hb-setup-head .hb-note { display: none; }
  .cb { gap: 8px; }
  .cb-foot { padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .cb-mini { margin-bottom: 4px; font-size: .85rem; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .cb-foot { display: flex; align-items: center; gap: 10px; }
  .cb-btns { display: contents; }
  .cb-back { order: 1; }
  .cb-mini { order: 2; flex: 1 1 auto; min-width: 0; margin: 0; }
  .cb-btns .hb-go { order: 3; flex: 0 1 300px; margin-left: 0; }
}

/* ==========================================================
   Private notebook pages (pages.js, #scrPages) and the Grown-ups' Record Book (#scrRecord): a field notebook
   page for one player at a time. #scrPages sits above the ending's overlay (pages "after each battle" open there).
   ========================================================== */
#scrPages { z-index: 13; display: flex; flex-direction: column; }
.pg-cover, .pg-page {
  width: min(100%, 760px); margin: auto;
  background: var(--card); background-image: var(--grain); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  background-image: var(--grain), repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px);
}
.pg-cover { max-width: 480px; padding: 22px 20px; text-align: center; animation: pg-in .35s ease-out both; }
.pg-cover h2 { margin: 8px 0 4px; font: 700 clamp(1.5rem, 5vw, 2rem)/1.2 var(--ui); }
.pg-cover .pg-open { margin-top: 14px; min-width: 220px; font-family: var(--ui); font-weight: 700; }
.pg-cover.is-pk .pg-open { min-height: 112px; min-width: 260px; font-size: 1.6rem; }
.pg-fig { margin: 0; font-size: .85rem; letter-spacing: .08em; color: var(--sanguine); }
.pg-emblem {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--px, 96px); height: var(--px, 96px); margin: 6px auto; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--paper); font-size: calc(var(--px, 96px) * .55); line-height: 1;
}
.pg-crest { display: block; }
.pg-page { padding: 14px 18px 12px; animation: pg-in .35s ease-out both; }
.pg-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1.5px solid var(--sanguine); }
.pg-head > div { flex: 1 1 auto; min-width: 0; }
.pg-head .pg-emblem { margin: 0; }
.pg-head h2 { margin: 2px 0 0; font: 400 clamp(1.5rem, 4.6vw, 2.1rem)/1.15 var(--display); }
.pg-page.is-pk .pg-head h2 { font: 700 clamp(1.5rem, 5vw, 2rem)/1.2 var(--ui); }
.pg-speak {
  flex: none; width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
}
.pg-speak svg { width: 30px; height: 30px; }
.pg-page.is-pk .pg-speak { width: 80px; height: 80px; }
.pg-facts, .pg-sec ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-fact { display: flex; gap: 8px; align-items: baseline; font: 400 1.12rem/1.35 var(--ui); }
.pg-star { flex: none; width: 1.2em; color: var(--ochre); font-size: 1.15rem; }
.pg-star.is-blank { visibility: hidden; }
.pg-q { color: var(--ink); }
.pg-a { color: var(--sanguine); font-weight: 700; }
.pg-src { color: var(--ink-soft); }
.pg-moment { margin: 10px 0 0; font: italic 400 1.2rem/1.35 var(--body); }
.pg-sec { margin-top: 14px; }
.pg-sec h3 { margin: 0; font-family: var(--caps); font-weight: 400; font-size: 1.12rem; letter-spacing: .05em; }
.pg-sec li { font: 400 1.08rem/1.35 var(--ui); }
.pg-quiet { padding-left: 10px; border-left: 3px solid var(--sage); }
.pg-quiet h3 span { color: var(--sanguine); }
.pg-quietline { margin: 6px 0 0; font: italic 400 1.05rem var(--body); color: var(--ink-soft); }
.pg-hint { margin: 2px 0 0; font-size: 1.15rem; }
.pg-practise li { display: flex; flex-direction: column; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--paper); }
.pg-ans { color: var(--ink-soft); }
.pg-ans b { color: var(--ink); }
.pg-why { font: italic 400 1.02rem/1.3 var(--body); color: var(--ink-soft); }
.pg-best li::before { content: "❧ "; color: var(--sanguine); }
.pg-seals { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pg-seal {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px;
  border: 1.5px solid var(--sanguine); border-radius: 999px; font: 700 1.02rem var(--ui); color: var(--sanguine); background: var(--paper);
}
.pg-wax {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sanguine); color: var(--paper); font-size: 1.2rem; transform: rotate(-12deg);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--paper) 30%, transparent), 0 2px 0 color-mix(in srgb, var(--ink) 25%, transparent);
}
.pg-seal.is-quiet { border-color: var(--sage); color: var(--ink); }
.pg-seal.is-quiet .pg-wax { background: var(--sage); transform: none; }
.pg-tiles { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pg-tile {
  position: relative; min-height: 112px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--paper); text-align: center;
}
.pg-tile .pg-a { font: 700 1.6rem/1.1 var(--ui); color: var(--ink); overflow-wrap: anywhere; }
.pg-tile .pg-star { position: absolute; top: 6px; right: 8px; width: auto; }
.pg-foot { display: flex; justify-content: center; margin-top: 16px; }
.pg-foot .pg-done { min-width: 240px; font-family: var(--ui); font-weight: 700; }
.pg-page.is-pk .pg-done { min-height: 112px; font-size: 1.6rem; }
@keyframes pg-in { from { opacity: 0; transform: translateY(14px) rotate(-.6deg); } }
.pg-emblem { overflow: hidden; }
.pg-emblem canvas { width: 78% !important; height: 78% !important; }
@media (max-width: 520px) {
  .pg-page { padding: 10px 12px; }
  .pg-head { align-items: flex-start; gap: 8px; }
  .pg-head .pg-emblem { --px: 52px !important; }
  .pg-head h2, .pg-page.is-pk .pg-head h2 { font-size: 1.4rem; }
  .pg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .pg-cover, .pg-page { animation: none; } }

/* the Record Book */
.rb { max-width: 900px; }
.rb-tabs { justify-content: center; }
.rb-kid h3 small { font: 400 .9rem var(--ui); color: var(--ink-soft); letter-spacing: 0; }
.rb-kid h4 { margin: 14px 0 4px; font-family: var(--caps); font-weight: 400; font-size: 1rem; letter-spacing: .06em; color: var(--sanguine); }
.rb-life { margin: 0; font: 700 1.05rem var(--ui); }
.rb-rows, .rb-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rb-rows li { font: 400 1rem/1.35 var(--ui); color: var(--ink-soft); }
.rb-items li { display: flex; gap: 10px; align-items: baseline; font: 400 1.05rem/1.35 var(--ui); padding: 4px 0; border-bottom: 1px dotted var(--line); }
.rb-items b { color: var(--sanguine); }
.rb-mark { flex: none; min-width: 1.5em; font-weight: 700; color: var(--sage); }
.rb-items li.is-miss .rb-mark { color: var(--sanguine); }
.rb-why { display: block; font: italic 400 1rem/1.3 var(--body); color: var(--ink-soft); }
.rb-empty { text-align: center; }
