/* Elemath Academy: one question, set like a good printed workbook page (starglyph-qview.js). Every selector starts with .qv.
   Paper and ink come from the daylight palette (art/palette-v4.json, version 4 tuned, the owner's final palette: parchment and ink); change the variables below to retheme.
   Sizes follow the research written up in STARGLYPH.md ("How a question looks"): large type for beginning readers, numerals larger than
   words, a missing number as a big box, and pictures with nothing on them that does not help the question. */
.qv {
  --qv-paper: #fffaf0; --qv-ink: #2b2233; --qv-soft: #5a4e63; --qv-faint: #665b70; --qv-edge: #d9c49a;
  --qv-ask: #1b24b4; --qv-ask-bg: #eef1ff; --qv-cell: #ffffff; --qv-shade: #a1b2fe; --qv-out: #2b2233; --qv-grid: #d8d0c2; --qv-accent: #8a6c03;
  background: var(--qv-paper); color: var(--qv-ink); border: 2px solid var(--qv-edge); border-radius: 18px;
  padding: 14px 18px 16px; box-sizing: border-box; max-width: 100%; text-align: center;
  font-family: 'Andika', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.3;
}
.qv *, .qv *::before, .qv *::after { box-sizing: border-box; }
/* ---- words: few and large; numbers in words bold */
.qv-prompt { margin: 0 0 10px; }
.qv-words { margin: 0 0 8px; font-weight: 700; letter-spacing: .01em; }
.qv-k1 .qv-words { font-size: 34px; } .qv-g2 .qv-words { font-size: 30px; } .qv-up .qv-words { font-size: 24px; font-weight: 400; text-align: left; }
.qv-num { display: inline; font-weight: 800; font-size: 1.08em; font-variant-numeric: tabular-nums; }
/* ---- equations: their own line, numerals larger than words, signs spaced like a worksheet */
.qv-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .12em .28em; margin: 6px auto 10px; font-family: 'Fredoka', 'Andika', system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.qv-k1 .qv-eq { font-size: 52px; } .qv-g2 .qv-eq { font-size: 44px; } .qv-up .qv-eq { font-size: 34px; }
.qv-math { font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: 1.15em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qv-math .qv-op { margin: 0 .18em; }
.qv-op { color: var(--qv-soft); font-weight: 600; }
.qv-n { color: var(--qv-ink); }
/* ---- the missing number: a big empty box that clearly asks to be filled, never a small glyph */
.qv-box { display: inline-block; vertical-align: middle; width: 1.25em; height: 1.25em; min-width: 30px; min-height: 30px; border: .07em solid var(--qv-ask); border-width: max(3px, .07em); border-radius: .14em; background: var(--qv-ask-bg); }
.qv-math .qv-box { width: 1.3em; height: 1.3em; }
.qv-box-word { width: 3.2em; }
.qv-eq .qv-box { width: 1.2em; height: 1.2em; }
/* ---- a counting sequence: each number in its own cell, the missing one is the box */
.qv-seq { gap: 8px; }
.qv-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.4em; padding: 0 .15em; border: 2px solid var(--qv-edge); border-radius: .18em; background: var(--qv-cell); }
.qv-cell .qv-box { border: 0; background: var(--qv-ask-bg); outline: max(3px, .07em) solid var(--qv-ask); outline-offset: -.07em; width: 100%; height: 100%; }
.qv-math.qv-seq .qv-cell { margin: 0 2px; }
/* ---- a column sum: digits lined up on the right, a rule, and the answer box below */
.qv-stack { display: inline-grid; justify-items: end; gap: 2px; padding: 4px 10px; }
.qv-st-row { display: flex; align-items: center; justify-content: flex-end; width: 100%; }
.qv-st-op { min-width: 1em; text-align: left; color: var(--qv-soft); margin-right: .3em; }
.qv-st-n { text-align: right; letter-spacing: .08em; }
.qv-st-rule { width: 100%; height: 0; border-top: 4px solid var(--qv-ink); margin: 4px 0 6px; }
.qv-st-ans .qv-box { width: 100%; min-width: 2.4em; }
/* ---- the picture: centered, scaled by the presenter, never wider than the screen */
.qv-vis { margin: 4px auto 0; text-align: center; overflow-x: auto; }
.qv-vis svg { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
.qv-vis figure { max-width: none !important; }
.qv-vis figure figcaption { color: var(--qv-ink) !important; font-size: 22px !important; line-height: 1.2; }
.qv-vis .vt { font-size: 15px; } .qv-vis .vl { font-size: 14px; }
/* pictures drawn by starglyph-art.js take paper-and-ink colors inside a question card */
.qv-vis .vt { fill: var(--qv-ink); font-weight: 700; } .qv-vis .vl { fill: var(--qv-soft); font-weight: 700; } .qv-vis .vt.big { fill: var(--qv-ink); }
.qv-vis .vg { stroke: var(--qv-grid); } .qv-vis .vax { stroke: var(--qv-ink); stroke-width: 2.5; }
.qv-vis .vb { fill: var(--qv-shade); stroke: var(--qv-ink); stroke-width: 2; } .qv-vis .ve { fill: var(--qv-cell); stroke: var(--qv-ink); stroke-width: 2; }
.qv-vis .vm { stroke: var(--qv-ink); } .qv-vis .vd { stroke: var(--qv-accent); } .qv-vis .vstar { fill: #fcda7c; stroke: #7a5e02; stroke-width: 1.2; }
.qv-vis .vclock { fill: var(--qv-cell); stroke: var(--qv-ink); stroke-width: 4; } .qv-vis .vhand { stroke: var(--qv-ask); stroke-width: 4; } .qv-vis .vhand.h { stroke: var(--qv-ink); stroke-width: 7; }
.qv-vis .vdot { fill: var(--qv-ink); } .qv-vis .vpt { fill: #fa662d; stroke: var(--qv-ink); stroke-width: 1.5; } .qv-vis .vp { fill: #9a0f0a; }
.qv-vis .vpoly { fill: rgba(57, 113, 228, .18); stroke: var(--qv-ask); }
.qv-vis .vtable { border-collapse: collapse; margin: 0 auto; color: var(--qv-ink); }
.qv-vis .vtable caption { font-weight: 800; font-size: 20px; padding-bottom: 6px; color: var(--qv-ink); }
.qv-vis .vtable th, .qv-vis .vtable td { border: 2px solid var(--qv-soft); padding: 8px 18px; font-size: 24px; background: var(--qv-cell); color: var(--qv-ink); }
.qv-vis .vtable th { background: #f3e7c9; } .qv-vis .vtable td.q { color: var(--qv-ask); background: var(--qv-ask-bg); font-weight: 800; }
.qv-k1 .vtable th, .qv-k1 .vtable td { font-size: 28px; padding: 10px 20px; }
/* ---- hints and explanations: the same layout, smaller */
.qv-text { font-size: 18px; line-height: 1.4; }
.qv-text .qv-line { margin: 2px 0; }
.qv-text .qv-eq { font-size: 26px; margin: 4px 0; justify-content: flex-start; }
.qv-text .qv-box { width: 1.15em; height: 1.15em; min-width: 22px; min-height: 22px; border-width: 2px; }
/* ---- phones: the card is the screen's width; type steps down but stays large */
@media (max-width: 560px) {
  .qv { padding: 10px 10px 12px; border-radius: 14px; }
  .qv-k1 .qv-words { font-size: 30px; } .qv-g2 .qv-words { font-size: 26px; } .qv-up .qv-words { font-size: 21px; }
  .qv-k1 .qv-eq { font-size: 44px; } .qv-g2 .qv-eq { font-size: 38px; } .qv-up .qv-eq { font-size: 30px; }
}
/* a picture shown at a glance (v.flash): it hides after --qv-flash; "Look again" restarts it (the keyframes qvflash are in starglyph.css) */
.qv-flash .qv-flash-pic { animation: qvflash var(--qv-flash, 2000ms) steps(1, end) forwards; }
.qv-flash .qv-flash-pic.qv-re { animation: none; }
.qv-again { display: block; margin: 8px auto 0; font: 700 18px 'Andika', sans-serif; padding: 8px 16px; border-radius: 10px; border: 2px solid var(--qv-ink); background: var(--qv-cell); color: var(--qv-ink); cursor: pointer; }
