/* ============================================================================
   DRILL KIT — the shared OBJECT language for prom/js/drills/*.js
   ============================================================================
   Why this file exists: three drills built by three hands must look like ONE
   game. A cup at Mochi's counter and a herb jar on Nak's bench are the same
   craft — same ink line, same cream stock, same hard shadow, same way liquid
   rises — because they are the same CSS, not because three people agreed to
   be careful.

   TWO HALVES. The DISCIPLINE LAYER first (type scale, palette, materials) —
   the tokens every drill must reach for instead of typing a px or a hex — then
   the OBJECT LANGUAGE (vessels, dockets, chips, scales, the ring, the counter).
   A rebuild agent should never need to invent a size, a colour or a surface;
   if the layer is missing one, that is a gap to raise, not a local override.

   THE RULES THIS FILE ENCODES
   - Nothing may read as a form control. Every class below is a physical thing:
     a vessel, a slip of paper, a beam balance, a die-cut sticker.
   - FOUR type sizes, and text a player must read to play never goes under
     16px (hanzi never under 20px). See "THE TYPE SCALE".
   - TEXT NEVER SITS ON BARE ART: it sits on paper, on lacquer, or in a scrim.
     See "MATERIALS".
   - Ink, paper, ONE accent, and the semantic three (gold = active, teal =
     correct, vermillion = wrong). Nothing else. See "THE PALETTE, CAPPED".
   - Motion reports state. A fill rises because the cup is filling; a counter
     flinches because the number went down. No decorative animation lives here,
     and every animation is switched off under prefers-reduced-motion.
   - Ink and paper are MATERIALS, not chrome, so they do not flip with the
     theme (#241335 ink is ink in daylight too). The kit's theme-sensitive
     surfaces borrow prom.css tokens (--paper, --haze, --card, --gold) instead,
     so a docket dropped into a light-mode payout card still reads. Inside
     .minigame prom.css clamps those tokens to night values (see prom.css
     "8.13 drills: the night stage, in BOTH themes"), which is what keeps the
     stage dark in both themes with no work here.
   - Sizes come in through custom properties (--w, --ht, --lvl, --t, --tilt),
     never through a drill's own stylesheet. A drill that needs a different cup
     sets --w; a drill that needs a different SHAPE adds a modifier here.

   Loaded after prom.css from prom/index.html. Ships no colours of its own that
   prom.css hasn't already committed to: ink #241335, cream stock #f2e4c2,
   lantern gold #ffc84a, vermillion #e04a3a, night purple #191026.
   ========================================================================= */

:root {
  /* Materials. Same values in both themes on purpose — see the header. */
  --dk-ink: #241335;                       /* the outline everything is drawn with */
  --dk-stock: #f2e4c2;                     /* paper stock: dockets, tickets, labels */
  --dk-stock-2: #f8eed4;                   /* the same paper, catching light */
  /* NOT "correct" — that word used to be in this comment, sitting eleven lines
     above the table that says teal is correct and gold means only "active".
     The token that anchors the palette cannot describe itself in the next
     token's job; that is how .dk-chip.right ended up gold. */
  --dk-gold: #ffc84a;                      /* lantern gold: LIVE — your turn, the lit thing, the one to look at now */
  /* GOLD'S INK-SIDE TWIN — and it is the value below, not #b8860b, because
     #b8860b was never one. Round-5 measured it at 2.58:1 on --dk-stock: under
     the 4.5 body floor AND under the 3.0 large-text floor, i.e. a token whose
     one documented job it could not do. The cost of that wrong comment is on
     the record — FOUR drill sheets caught it independently and wrote the same
     correction into their own files (cloze2 "2.58:1 … under even the 3:1
     large-text floor", boba2 "GOLD AS A HIGHLIGHTER, NOT AS INK", forge2 which
     minted a private --f2-bronze #6d4f06 at 6.0:1, chengyu2 the same story for
     jade below) — while the one sheet that TRUSTED the comment, ktv2, shipped
     开声音 / 字幕 at a measured 2.81:1 in light theme. A lying comment in a
     shared file is not a documentation bug; it is a defect that propagates.
     The value is forge2's, adopted rather than re-derived, so the build has one
     dark gold instead of two. Every one of the thirteen call sites is on CREAM
     (paper tools, cream tags, a cream speech bubble, the patience bar) and every
     border use pairs it with a bright rgba(255,200,74,.5) halo that carries the
     "gold = active" hue, so this move takes those edges from 2.58:1 to 6.01:1
     against the surface they are actually drawn on. It is NOT a night-stage
     colour: on #191026 it is 2.42:1, and there the ordinary --dk-gold is 11.9:1. */
  --dk-gold-deep: #6d4f06;                 /* gold for INK ON CREAM: 6.0:1 on cream stock, 6.2:1 on the light head plaque */
  --dk-verm: #e04a3a;                      /* vermillion: WRONG, and about-to-lapse. Nothing else — not even the chop */
  --dk-jade: #3ee6c4;                      /* the game's "yes" colour */
  /* The ink-side twins of the semantic pair, for TEXT ON CREAM — where the
     bright versions fail contrast outright. Four drill sheets each derived
     #a8231a independently before the kit had a name for it, which is how a
     shared value quietly becomes a second red. Named here so the next drill
     inherits it instead of guessing.
     Both numbers below are round-5 measurements, and both replace a number that
     was wrong in the direction that matters: the jade twin was published as
     "5.1:1" while #1d7a63 actually measures 4.15:1 — under the body floor — and
     four verdict lines (cloze2, forge2, history2, lyric2) are painted with it.
     chengyu2 measured the same 4.14:1 and switched to #0d6b57 locally; that is
     now the shared value, so those four inherit the fix. */
  --dk-verm-deep: #a8231a;                 /* vermillion for ink-on-paper: 5.7:1 on cream stock */
  --dk-jade-deep: #0d6b57;                 /* teal for ink-on-paper: 5.1:1 on cream stock (was #1d7a63, a measured 4.15:1) */
  --dk-glass: rgba(255, 255, 255, 0.14);   /* what an empty vessel is made of */

  /* ======================================================= THE TYPE SCALE
     FOUR sizes on screen at once, and there are only four to pick from. The
     numbers are floors, not suggestions — Lau, after playtesting three drills:
     "a lot of the text is hard to read and small". Rules encoded here:
     · nothing a player must READ TO PLAY goes below --dk-label (16px);
     · HANZI a player must read goes at --dk-read (20px) or above, because a
       misread character is the failure state of this game and hanzi need more
       pixels than latin to survive at the same nominal size;
     · --dk-caption is for PINYIN AND GLOSSES ONLY — the two things a player can
       lose entirely and still play the round. It is not a place to put a short
       instruction, a counter, a field name or anything else that is the only
       home of a fact. If you are about to caption something that isn't a
       pronunciation or a translation, it belongs at --dk-label.
     If a label does not fit, shorten the WORDS. Never the type. */
  --dk-display: clamp(26px, 4.4vw, 36px);  /* the one thing the round is about: the order, the character, the price */
  --dk-read: var(--prom-text-zh, 1.25rem);                         /* readable-to-play: hanzi, the sentence, the option you pick — the floor for hanzi */
  --dk-label: var(--prom-text-latin, 1rem);                        /* latin labels, buttons, object names — the absolute readable floor */
  /* Supporting pinyin/gloss uses the same 16px floor; weight and color
     distinguish it from the primary Chinese role. */
  --dk-caption: var(--prom-text-utility, 1rem);                      /* pinyin · gloss. Never load-bearing, never the only place a fact lives */
  --dk-measure: 34ch;                      /* max line length for a sentence (~50 latin chars); longer lines lose the reader */
  --dk-lh-tight: 1.15;                     /* display: set solid, it is one phrase */
  --dk-lh-read: 1.45;                       /* reading size: room to breathe between hanzi rows */

  /* ==================================================== THE PALETTE, CAPPED
     The PAINTING carries the colour; the chrome is nearly monochrome so the
     art can sing. A drill gets: ink, paper, ONE accent, and the semantic
     three. Nothing else. A screenshot with more than three saturated hues in
     the chrome is a bug (benchmarks doc, "Colour").
     Objects that must be told apart are distinguished by SHAPE, LABEL and
     POSITION first. If colour is genuinely needed, use tints of --dk-accent —
     never a rainbow. The first clinic build shipped six differently-coloured
     jars; that is the exact failure this cap exists to prevent. */
  --dk-paper: var(--dk-stock);             /* alias: "paper" in the palette IS the cream stock above */
  --dk-accent: #c22d75;                    /* THE one accent. A drill may re-point this on its own root element — and only this */
  --dk-accent-soft: rgba(194, 45, 117, 0.18); /* the accent as a wash, for a tint that isn't a second hue */
  --dk-active: var(--dk-gold);             /* GOLD = your turn / live / the thing to look at now. Never decorative */
  /* Gold as a WASH, for marking the live line/cell/band without tinting the
     text on it. Text stays full ink over this — a coloured text run is how a
     drill ends up borrowing a semantic colour it has no right to (see
     .dk-docket-row.now below). clinic2 measured 0.26 as the lightest alpha that
     still reads as a marked row on cream stock; that value is now shared. */
  --dk-active-wash: rgba(255, 200, 74, 0.26);
  --dk-right: var(--dk-jade);              /* TEAL = correct. This colour means nothing else, anywhere */
  --dk-wrong: var(--dk-verm);              /* VERMILLION = wrong. This colour means nothing else, anywhere */
  /* The classes that APPLY these three (.is-active / .is-right / .is-wrong plus
     .dk-state-fill / -edge / -text) live at the BOTTOM of this file, so state
     always wins the tie against an object's own fill. */
  --dk-ink-soft: rgba(36, 19, 53, 0.68);   /* secondary ink on cream — 5.4:1, the darkest "quiet" allowed */
  --dk-ink-faint: rgba(36, 19, 53, 0.34);  /* struck-through / spent only. NOT for text a player reads */

  /* ================================================ MATERIALS UNDER TEXT
     No text sits on bare art. These are the three surfaces text is allowed on;
     each is measured against the worst case (a blown-out white painting) so a
     drill author never has to run the numbers.
     --dk-mat-scrim  ink material at 0.90. Re-measured in round 5, because the
                     numbers that were here (9.5 / 5.3) were both understated
                     and an understated promise gets worked around too: --paper
                     text over it is 16.8:1 on the night stage and still 13.3:1
                     when the art behind it is BLOWN-OUT WHITE. Even --haze,
                     the quiet token, holds 5.9:1 in that worst case.
     --dk-mat-veil   0.55, a stage-wide dim. NEVER put text on this alone — and
                     here is the number that says why: over the same blown-out
                     white art, --paper on the veil is 3.74:1 and --haze is
                     1.67:1. The veil dims a painting; it does not carry text. */
  --dk-mat-scrim: rgba(18, 9, 30, 0.9);
  --dk-mat-veil: rgba(18, 9, 30, 0.55);
  /* Construction. One border width and one shadow, so every object in every
     drill is cut from the same die. */
  --dk-line: 3px solid var(--dk-ink);
  --dk-drop: 0 4px 0 rgba(14, 6, 24, 0.75);
  --dk-drop-lift: 0 7px 0 rgba(14, 6, 24, 0.75);
  /* The four-way drop-shadow trick prom.css already uses on host cutouts:
     an ink outline that traces a clipped silhouette, which border cannot do. */
  --dk-outline: drop-shadow(2px 0 0 var(--dk-ink)) drop-shadow(-2px 0 0 var(--dk-ink))
    drop-shadow(0 2px 0 var(--dk-ink)) drop-shadow(0 -2px 0 var(--dk-ink));
}

/* ================================================================ TYPE CLASSES
   Use these instead of a font-size. Four steps, named for their JOB, so a
   reviewer can see at a glance whether a drill has more than four sizes on
   screen. Every one of them is a floor the kit guarantees; a drill that needs
   something bigger than display is a drill whose display is in the wrong place. */
.dk-display {                               /* the round's subject: the order, the price, the character being carved */
  font-family: var(--han); font-size: var(--dk-display); font-weight: 900;
  line-height: var(--dk-lh-tight); letter-spacing: 0.01em;
}
.dk-read {                                  /* anything the player must read to play — hanzi lives here or bigger */
  font-family: var(--han); font-size: var(--dk-read); font-weight: 800;
  line-height: var(--dk-lh-read); max-width: var(--dk-measure);
}
.dk-label {                                 /* latin labels, object names, button faces. The floor: 16px */
  font-size: var(--dk-label); font-weight: 700; line-height: 1.3; letter-spacing: 0.01em;
}
.dk-caption {                               /* pinyin and gloss. Never the only home of a fact */
  font-size: var(--dk-caption); font-weight: 700; line-height: 1.35; letter-spacing: 0.02em;
}
/* THE HANZI FLOOR, as a rule rather than as a paragraph in a comment. Round-2
   judging found hanzi at 12.5px in five drills, and every instance got there
   the same way: a .han that nobody sized, inheriting whatever its container
   happened to be — a 12.5px counter, a 13px browser <button>. This makes the
   default 20px instead.
   :where() so it has ZERO specificity: it can never fight a rule that sizes
   hanzi deliberately, and max(…, 1em) means a .han sitting inside display type
   keeps the display size rather than being dragged down to the floor. It moves
   only the hanzi that nothing was looking after — which is exactly the set the
   judges found. prom/dev/type-audit.mjs is the guard that keeps it true. */
:where(.minigame .han) { font-size: max(var(--dk-read), 1em); }
/* Latin captions on cream stay at 5.4:1; on the night stage they borrow the
   theme's own muted token, which prom.css has already contrast-checked. */
.dk-plate .dk-caption, .dk-docket .dk-caption { color: var(--dk-ink-soft); }
.dk-slab .dk-caption, .dk-scrim .dk-caption { color: var(--haze, #a49fae); }
/* One phrase per line, and the line stops before it becomes a paragraph. */
.dk-measure { max-width: var(--dk-measure); }

/* Contract D aliases on physical boards preserve the existing material palette. */
.dk-drill {
  --prom-paper: var(--dk-stock); --prom-ink: var(--dk-ink);
  --prom-ink-muted: var(--dk-ink-soft); --prom-accent: var(--dk-gold-deep);
  --prom-success: var(--dk-jade-deep); --prom-danger: var(--dk-verm-deep);
}

/* ============================================================ MATERIALS
   TEXT NEVER SITS ON BARE ART. Put it on one of these three and the contrast
   is already solved. They are surfaces in the fiction, not panels: a slip of
   paper, a lacquer slab, a pool of shadow the lantern doesn't reach. */
.dk-plate {                                 /* PAPER: cream stock, ink text. ~14:1. The safest surface in the kit */
  background: var(--dk-stock); color: var(--dk-ink);
  border: var(--dk-line); border-radius: 10px; box-shadow: var(--dk-drop);
  padding: 10px 14px;
}
.dk-slab {                                  /* LACQUER: the night side of the same object, for text that sits ON the painting */
  background: var(--card, #2a1c44); color: var(--paper, #f2efe9);
  border: var(--dk-line); border-radius: 10px; box-shadow: var(--dk-drop);
  padding: 10px 14px;
}
.dk-scrim {                                 /* SHADOW: ink material at 0.9 — for text over art with no object to sit on */
  background: var(--dk-mat-scrim); color: var(--paper, #f2efe9);
  border-radius: 12px; padding: 9px 14px;
}
.dk-veil {                                  /* the stage-wide dim over a painting. Decoration only — never put text on this alone */
  position: absolute; inset: 0; background: var(--dk-mat-veil); pointer-events: none;
}
/* A caption strip that must survive on a phone (where prom.css takes the host
   cutout off stage): scrimmed, centred, in the page flow, never floating. */
.dk-legend {
  /* Wider than --dk-measure on purpose. That token is 34ch, tuned for a latin
     sentence at reading size; a legend written in hanzi at 20px gets ~17
     characters out of it and wraps a one-line instruction into three. 46ch is
     ~46 latin characters (inside the ~50 the house rules ask for) and ~23
     hanzi, which is one line for every legend either drill writes. */
  display: block; margin: 6px auto; width: fit-content; max-width: min(46ch, 92vw);
  background: var(--dk-mat-scrim); color: var(--paper, #f2efe9);
  border-radius: 10px; padding: 7px 13px; text-align: center;
}
/* A legend is the last line a lost player reads, so it never drops below the
   label floor — and any hanzi inside one takes the reading step regardless of
   what size class the strip itself was given. Three boba legends were written
   as .dk-legend.dk-label and were therefore rendering whole Chinese sentences
   at 16px; this makes that unreachable rather than a thing to remember.
   :where() so the floor has ZERO specificity — a legend that explicitly asks
   for .dk-read or .dk-display still gets it, and only a legend that asks for
   nothing lands on the floor. */
:where(.dk-legend) { font-size: var(--dk-label); }
.dk-legend .han { font-size: var(--dk-read); }

/* ---------------------------------------------------------------- VESSELS
   A drawn container the player fills, pours from, or hands over: a boba cup,
   a herb jar, a medicine flask, a hot pot. The shell is a clipped silhouette
   with an ink outline and a hard drop, so it reads as a cut-paper object
   rather than a progress widget. Size with --w/--ht; pick a silhouette with
   .cup / .jar / .bowl. */
.dk-vessel {
  --w: 96px; --ht: 132px; --taper: 13px;
  position: relative; width: var(--w); height: var(--ht); flex: none;
  filter: var(--dk-outline) drop-shadow(0 6px 0 rgba(14, 6, 24, 0.55));
}
/* the well: the inside of the vessel, and the box the liquid layers live in.
   Its clip-path IS the silhouette — the outline filter above traces this. */
.dk-vessel-well {
  position: absolute; inset: 0; overflow: hidden; background: var(--dk-glass);
  border-radius: 7px 7px 16px 16px;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--taper)) 100%, var(--taper) 100%);
}
.dk-vessel.cup { --taper: 13px; }            /* a takeaway cup: wide mouth, narrow base */
/* an apothecary jar: a narrow neck over shoulders, so it reads as something you
   pour FROM rather than drink from (the silhouette is the affordance) */
.dk-vessel.jar { --taper: 0px; --w: 82px; --ht: 118px; }
.dk-vessel.jar .dk-vessel-well {
  border-radius: 4px 4px 14px 14px;
  clip-path: polygon(28% 0, 72% 0, 72% 14%, 100% 30%, 100% 100%, 0 100%, 0 30%, 28% 14%);
}
.dk-vessel.bowl { --taper: 26px; --ht: 84px; } /* a bowl or pot: shallow and splayed */
.dk-vessel.bowl .dk-vessel-well { border-radius: 4px 4px 42px 42px; }
/* the lid/rim: a stuck-on band that says the vessel is a made thing, and gives
   the cup somewhere to be labelled (糖度, 冰度, a herb name) */
.dk-vessel-lid {
  position: absolute; left: -7%; right: -7%; top: -15px; height: 30px; z-index: 2;
  background: var(--dk-stock); border: var(--dk-line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  /* was 10.5px. The lid carries 大杯 / 半糖 — the words the round is ABOUT —
     so it takes the hanzi floor, and the band grew to hold it. */
  font-family: var(--han); font-size: var(--dk-read); font-weight: 800;
  line-height: 1; color: var(--dk-ink); letter-spacing: 0.02em;
}
/* the paper label pasted on the front — what this vessel IS, in hanzi.
   Sits over the fill, so a full cup still says what it is. */
.dk-vessel-label {
  position: absolute; left: 50%; top: 46%; z-index: 2; transform: translate(-50%, -50%) rotate(-2deg);
  padding: 3px 8px; background: var(--dk-stock); border: 2.5px solid var(--dk-ink); border-radius: 4px;
  font-family: var(--han); font-size: var(--dk-read); font-weight: 800; color: var(--dk-ink);
  box-shadow: 0 2px 0 rgba(14, 6, 24, 0.4); white-space: nowrap;
}

/* ------------------------------------------------------------ LIQUID FILL
   One layer of what is in the vessel. The drill sets --lvl (0..1, this
   layer's own depth) and --base (0..1, where its floor sits, so layers stack:
   milk on top of syrup on top of pearls) and --c (its colour). Height is
   TRANSITIONED, never jumped: the rise is the feedback. */
/* The fallback is --dk-stock and not --dk-gold, which is what it used to be.
   Every drill sets --c, so the fallback is only ever reached by a drill that
   forgot to — and the thing it should show then is "an unnamed liquid", not
   "this vessel is the active one", which is the only thing gold is allowed to
   mean. A default that quietly borrows a semantic colour is a trap laid for
   whoever writes the sixteenth drill. */
.dk-fill {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--base, 0) * 100%); height: calc(var(--lvl, 0) * 100%);
  background: var(--c, var(--dk-stock));
  transition: height 0.55s cubic-bezier(0.3, 0.9, 0.3, 1), bottom 0.55s cubic-bezier(0.3, 0.9, 0.3, 1);
}
/* the meniscus: the lighter ellipse riding on top of a liquid, rocking gently
   while the drill is live. It is how you tell liquid from a coloured bar. */
.dk-fill::after {
  content: ""; position: absolute; left: -6%; right: -6%; top: -5px; height: 10px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.28);
  animation: dkSlosh 2.6s ease-in-out infinite;
}
.dk-fill.flat::after { animation: none; }   /* for a liquid that has settled (or a solid layer) */
@keyframes dkSlosh { 50% { transform: translateX(3%) scaleY(0.72); } }
/* solids that SETTLE rather than pour: pearls, seeds, dried herb. Each <i> is
   one object; they drop in on a stagger and stay put. */
.dk-pearls { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; pointer-events: none; }
.dk-pearls i {
  position: absolute; bottom: 6%; width: 13px; height: 13px; border-radius: 50%;
  background: var(--dk-ink); box-shadow: inset -2px -2px 0 rgba(255, 255, 255, 0.22);
  animation: dkSettle 0.5s cubic-bezier(0.5, 0, 0.7, 1) both;
}
.dk-pearls i:nth-child(1) { left: 12%; animation-delay: 0.02s; }
.dk-pearls i:nth-child(2) { left: 30%; bottom: 15%; animation-delay: 0.09s; }
.dk-pearls i:nth-child(3) { left: 48%; animation-delay: 0.05s; }
.dk-pearls i:nth-child(4) { left: 64%; bottom: 17%; animation-delay: 0.13s; }
.dk-pearls i:nth-child(5) { left: 80%; animation-delay: 0.08s; }
.dk-pearls i:nth-child(n+6) { left: 40%; bottom: 26%; animation-delay: 0.17s; }
@keyframes dkSettle { from { transform: translateY(-320%); } 70% { transform: translateY(6%); } }
/* steam coming off something hot — a wok, a fresh pot, a scalding 汤. Local to
   the vessel (prom.css .mg-steam is the stage-wide version). */
.dk-heat { position: absolute; left: 12%; right: 12%; bottom: 96%; height: 46px; pointer-events: none; }
.dk-heat i {
  position: absolute; bottom: 0; width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.5); animation: dkSteam 2.1s ease-out infinite;
}
.dk-heat i:nth-child(1) { left: 8%; }
.dk-heat i:nth-child(2) { left: 44%; animation-delay: 0.55s; }
.dk-heat i:nth-child(3) { left: 76%; animation-delay: 1.1s; }
@keyframes dkSteam {
  from { opacity: 0; transform: translateY(0) scale(0.6); }
  30% { opacity: 0.75; }
  to { opacity: 0; transform: translateY(-42px) scale(1.7); }
}

/* -------------------------------------------------------- POURING (verb)
   The jar you pour FROM. .dk-pourer is the held object; add .pouring while
   the player is holding, and the vessel tips from its own spout corner with
   a stream running out of it. The tip is the affordance — no button. */
.dk-pourer { transform-origin: 82% 88%; transition: transform 0.24s cubic-bezier(0.3, 1.4, 0.5, 1); cursor: pointer; }
.dk-pourer.pouring { transform: rotate(-42deg); }
/* the stream itself: a ribbon between spout and target, alive only mid-pour */
.dk-stream {
  position: absolute; width: 7px; border-radius: 4px; z-index: 1;
  background: var(--c, var(--dk-stock));  /* fallback first: if color-mix ever fails to parse, the stream is still there */
  background: linear-gradient(180deg, var(--c, var(--dk-stock)), color-mix(in srgb, var(--c, var(--dk-stock)) 70%, #000));
  animation: dkStream 0.45s linear infinite;
}
@keyframes dkStream { 50% { transform: scaleX(0.72); } }
/* the spill/overshoot warning: the pour has gone past what was asked for */
.dk-pourer.over, .dk-vessel.over .dk-vessel-well { animation: dkOver 0.4s ease-in-out 2; }
@keyframes dkOver { 50% { filter: brightness(1.25) saturate(1.4); } }

/* -------------------------------------------------------- WEIGHING (verb)
   A beam balance: the reading is the TILT, not a number. Drill sets --tilt in
   degrees (negative = left pan heavy). Pans counter-rotate so their contents
   stay level, which is what makes it read as a real scale. */
.dk-scale { --tilt: 0deg; position: relative; width: min(230px, 70vw); height: 108px; flex: none; }
.dk-scale-post {                            /* the stand the beam pivots on */
  position: absolute; left: 50%; bottom: 0; width: 12px; height: 62px; margin-left: -6px;
  background: var(--dk-stock); border: var(--dk-line); border-radius: 3px 3px 0 0;
}
.dk-scale-foot {                            /* the base: what stops it being a floating icon */
  position: absolute; left: 50%; bottom: -4px; width: 88px; height: 12px; margin-left: -44px;
  background: var(--dk-stock); border: var(--dk-line); border-radius: 6px; box-shadow: var(--dk-drop);
}
.dk-scale-beam {                            /* the arm that tips: the whole answer, visually */
  position: absolute; left: 6%; right: 6%; top: 34px; height: 9px;
  background: var(--dk-stock); border: var(--dk-line); border-radius: 5px;
  transform: rotate(var(--tilt)); transform-origin: 50% 50%;
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.dk-pan {                                   /* a hanging pan; put chips or hanzi in it */
  position: absolute; top: 14px; width: 86px; min-height: 38px; padding: 5px 6px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center;
  background: var(--dk-stock); border: var(--dk-line); border-radius: 4px 4px 30px 30px;
  font-family: var(--han); font-size: var(--dk-read); font-weight: 800; color: var(--dk-ink);
  transform: rotate(calc(-1 * var(--tilt))); transform-origin: 50% 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.5, 1);
}
/* the string it hangs by — without it the pans float next to the beam instead
   of off it, and the whole object stops reading as a balance */
.dk-pan::before {
  content: ""; position: absolute; left: 50%; top: -14px; width: 3px; height: 15px; margin-left: -1.5px;
  background: var(--dk-stock); box-shadow: -1.5px 0 0 var(--dk-ink), 1.5px 0 0 var(--dk-ink);
}
.dk-pan.left { left: -6%; }
.dk-pan.right { right: -6%; }
/* The two states of a weighing, written as the MEANING and not as two rgba()
   literals that happen to be --dk-jade and --dk-verm typed out by hand. Same
   pixels; the point is that a sweep for "who is using the correct-answer
   colour" now finds this rule. */
.dk-scale.balanced .dk-scale-beam { box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-right) 45%, transparent); }  /* it matched */
.dk-scale.off .dk-scale-beam { box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-wrong) 45%, transparent); }       /* it didn't */

/* ------------------------------------------------------- PAPER: DOCKETS
   The order slip, the prescription, the receipt, the exam docket: the thing
   the round ASKS FOR, written on the shop's own paper. Cream stock, ink rule,
   hard shadow — never a panel, never a card with a heading. */
.dk-docket {
  width: min(430px, 92vw); padding: 11px 15px 10px; position: relative;
  background: var(--dk-stock); color: var(--dk-ink);
  border: var(--dk-line); border-radius: 10px; box-shadow: var(--dk-drop);
  font-family: var(--han);
}
.dk-docket-hd {                             /* who wrote it / what it is, above the rule */
  display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; margin-bottom: 7px;
  border-bottom: 2px dashed rgba(36, 19, 53, 0.34);
  /* The kicker names the OBJECT — "prescription", "order", "docket" — which is
     the one word that tells a player what they are holding. It sat at caption
     size on the argument that it was chrome; it is not, so it sits at the label
     floor. The slip's actual content is the rows below, at reading size. */
  font-size: var(--dk-label); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.dk-docket-hd .han { font-size: var(--dk-read); text-transform: none; letter-spacing: 0; }
.dk-docket-row {                            /* one line item: label left, value right */
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0;
}
.dk-docket-row .han { font-size: var(--dk-read); font-weight: 800; }   /* the line item IS the lesson */
.dk-docket-row .dim { font-size: var(--dk-caption); color: var(--dk-ink-soft); }  /* gloss only */
/* The line the player is answering NOW. GOLD, because the token table twelve
   screens up says gold IS "your turn / the thing to look at now" and vermillion
   means WRONG and nothing else, anywhere. This rule used to paint the active
   line's hanzi #a8231a, so the one row the player had not got wrong was the
   only row on the slip wearing the wrong-colour — and on a bare kit docket that
   red text was the ONLY signal the row was live at all, which is a state cue
   built entirely out of a colour that contradicts it.
   The mark now lives behind the words instead of in them: a gold wash across
   the line, a gold edge around it, and the hanzi at FULL ink — which is also
   the only way the lesson keeps its contrast, since the thing being highlighted
   is the character the player has to read. 5.4:1 became 12.9:1 by removing a
   colour rather than adding one.
   Everything is background and spread-shadow — no padding, no margin, no
   pseudo-element. Drills grid these rows (clinic2) and re-pad them (boba's
   ticket), so a row that resized when it went live would shove the line the
   player is mid-read of, and a ::before rail would stack on top of a rail a
   drill had already drawn for itself. A spread ring sits entirely outside the
   row box: it costs no layout, nothing can touch it, and a drill that wants its
   own mark (clinic2's inset gold rail) replaces it cleanly by declaring
   box-shadow. clinic2's .c2-row.now already worked this way and now agrees with
   the kit instead of being overridden by it. */
.dk-docket-row.now {
  background: var(--dk-active-wash);
  box-shadow: 0 0 0 5px var(--dk-active-wash), 0 0 0 7px var(--dk-active);
  border-radius: 3px;
  /* the wash arrives, it does not blink on. Background only: it is the one
     property every drill's own .now rule sets to the same value, so the
     transition survives being overridden. */
  transition: background-color 0.22s cubic-bezier(0.2, 1, 0.3, 1);
}
.dk-docket-row.now .han { color: var(--dk-ink); }
.dk-docket-row.done .han { color: var(--dk-ink-faint); text-decoration: line-through; }
/* a tear-off stub: the half the player keeps (a ticket, a claim slip). The
   punched perforation is what tells you it tears. */
.dk-docket.stub { border-radius: 10px 10px 4px 4px; padding-bottom: 16px; }
.dk-docket.stub::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 3px;
  background: repeating-linear-gradient(90deg, rgba(36, 19, 53, 0.5) 0 5px, transparent 5px 11px);
}
/* the chop: a seal SLAMMED on the docket when it is settled/paid/graded. It
   arrives, it does not fade in. The docket makes room for it rather than
   letting it land on the last line item.
   IT IS NOT VERMILLION ANY MORE, and the reason is the palette law rather than
   taste. This rule used to hardcode --dk-wrong, on the reasoning that a real
   Chinese chop is red — but the three drills that stamp things stamp them with
   the OUTCOME: rush2 slams 好 or 错 on the same tray, boba2 slams 出杯 (served,
   the win) / 收回 / 重做, clinic2 slams 已抓 on a prescription it just filled
   correctly. Vermillion means WRONG and nothing else, anywhere, so the kit was
   painting a player's best moment in the colour of their worst one, and the
   colour carried no information at all because both outcomes wore it.
   So the default chop is INK — honest, and the character inside it (好 vs 错)
   is doing the telling, which is the kit's own rule: distinguish by SHAPE,
   LABEL and POSITION first. A drill that wants the outcome in colour adds the
   semantic class and gets the ink-side twins, because a chop lands on cream
   where the bright pair is 1.29:1 (jade) and 3.30:1 (vermillion). */
.dk-docket:has(.dk-stamp) { padding-bottom: 44px; }
.dk-stamp {
  position: absolute; right: 8px; bottom: 8px; padding: 4px 9px; z-index: 2;
  font-family: var(--han); font-size: var(--dk-read); font-weight: 900; color: var(--dk-ink);
  border: 2.5px solid var(--dk-ink); border-radius: 5px; transform: rotate(-11deg);
  animation: dkStamp 0.3s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.dk-stamp.is-right { color: var(--dk-jade-deep); border-color: var(--dk-jade-deep); }  /* 5.1:1 on cream */
.dk-stamp.is-wrong { color: var(--dk-verm-deep); border-color: var(--dk-verm-deep); }  /* 5.7:1 on cream */
@keyframes dkStamp { from { transform: rotate(-11deg) scale(2.4); opacity: 0; } }

/* --------------------------------------------------- DIE-CUT STICKER CHIP
   The unit of language you can pick up: a word tile, a topping, a chat reply,
   a herb name. Die-cut edge, hard shadow, lifts on hover, presses on click.
   A chip is a <button> so it stays keyboard-reachable — it just must never
   LOOK like one. Pinyin/gloss ride under the hanzi in the same chip. */
.dk-chip {
  display: grid; justify-items: center; gap: 1px; padding: 6px 13px; cursor: pointer;
  background: var(--dk-stock); color: var(--dk-ink);
  border: var(--dk-line); border-radius: var(--r-pill, 999px); box-shadow: var(--dk-drop);
  font-family: var(--han); transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}
.dk-chip .han { font-size: var(--dk-read); font-weight: 800; line-height: 1.2; }   /* a chip you must read is a chip at reading size */
.dk-chip small { font-size: var(--dk-caption); font-weight: 700; color: var(--dk-ink-soft); }  /* pinyin/gloss only */
.dk-chip:hover:not(:disabled) { background: var(--dk-stock-2); transform: translateY(-3px); box-shadow: var(--dk-drop-lift); }
.dk-chip:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 0 rgba(14, 6, 24, 0.75); }
.dk-chip.on { background: var(--dk-gold); }                                   /* chosen, in hand */
/* CORRECT IS TEAL. This pair used to be gold-on-cream (#ffe9b0 + a gold edge)
   against a vermillion-family wrong — i.e. the kit's own "it was correct" state
   wearing the ACTIVE colour, which the palette table eight screens up says
   means "your turn / the thing to look at now" and nothing else. It got there by
   copying prom.css's LIGHT-theme .mg-board.right, which is gold; the same
   board in dark theme is #3ee6c4, so the light theme is the odd one out and the
   kit had frozen the odd one in a theme-independent rule.
   Teal on cream is the one thing that needs care — #3ee6c4 is 1.29:1 there — so
   this is the same construction as .wrong: a pale wash of the hue, the deep
   twin on the edge, full ink for the text. 14.6:1 for the hanzi either way. */
.dk-chip.right { background: #d9f2ea; color: var(--dk-ink); border-color: var(--dk-jade-deep); } /* it was correct */
.dk-chip.wrong { background: #f0d8d0; color: #6b1610; border-color: var(--dk-verm-deep); }       /* it was not */
.dk-chip.live { background: var(--dk-active); }                               /* it is YOUR TURN on this chip */
/* ---- SPENT IS A MATERIAL, NOT AN ALPHA ---------------------------------
   ROUND 6, and it is a ROSTER-WIDE finding written here rather than in any one
   drill's sheet, because this is the shared rule every drill inherits. It read
   `opacity: 0.34`, and a chip at 34% drags BOTH its 20px hanzi and its 14px
   pinyin toward whatever happens to be behind the rail. Measured on the live
   board while assembling a reply in stream2: 2.55:1 on "qù", 2.79:1 on "tā",
   2.88:1 on "fàngxué", 3.31:1 on "tǐyùguǎn" — four runs under the body floor,
   and the 20px hanzi drifting 0.43 of its declared material's luminance.
   This is the same defect four drill sheets already removed from their own
   objects — stream2's answered stickers and aired tape tiles, its cooling hype
   pad — each of them writing the same sentence: a thing that is SPENT is
   printed on TIRED PAPER. Solid stock one step down in value, ink at full
   strength, no lift, no shadow. The state still reads at a glance, it reads
   identically under prefers-reduced-motion, and the type stays legible.
   Measured after: 10.5:1 hanzi and 4.8:1 pinyin on the cream die, 10.7:1 and
   6.8:1 on the lacquer one. */
.dk-chip.spent, .dk-chip:disabled {
  cursor: default; box-shadow: none; transform: none;
  background: #d5c9ac; color: var(--dk-ink); border-color: rgba(36, 19, 53, 0.55);
}
.dk-chip.spent small, .dk-chip:disabled small { color: var(--dk-ink-soft); }
.dk-chip.lacquer.spent, .dk-chip.lacquer:disabled {
  background: #1d1430; color: #cfc7d8; border-color: rgba(14, 6, 24, 0.9);
}
.dk-chip.lacquer.spent small, .dk-chip.lacquer:disabled small { color: var(--haze, #a49fae); }
/* a lacquer chip: the same die on the night side, for chips that sit ON the
   painting rather than on paper (the player's own reply, a spoken line) */
.dk-chip.lacquer { background: var(--card, #2a1c44); color: var(--paper, #f2efe9); }
.dk-chip.lacquer small { color: var(--haze, #a49fae); }
.dk-chip.lacquer:hover:not(:disabled) { background: var(--card-2, #332352); border-color: var(--dk-gold); }

/* the socket a chip goes into: an empty die-cut hole in the order, so the
   shape of the answer is visible BEFORE it is filled */
.dk-slot {
  min-width: 62px; min-height: 40px; padding: 4px 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px dashed rgba(var(--edge-rgb, 255, 255, 255), 0.4); border-radius: var(--r-pill, 999px);
  color: var(--haze, #a49fae); font-size: var(--dk-label);
}
.dk-slot .han { font-size: var(--dk-read); }   /* a slot labelled 杯型 is read-to-play */
.dk-slot.filled { border-style: solid; border-color: var(--dk-ink); padding: 0; }
.dk-slot.next { border-color: var(--dk-gold); color: var(--dk-gold); }  /* where the next chip lands */
/* the rail chips are laid out on: the sentence/order being built, left to right */
.dk-rail { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }

/* ------------------------------------------------------ THE DRAINING RING
   The round clock, emitted by ringHTML() in minigames.js and driven by
   startRing(). One silhouette for every drill so "time left" always looks the
   same. --t runs 1 -> 0; pathLength="100" on the drain circle is what lets CSS
   express that as one dashoffset regardless of radius. .low arrives under 30%. */
.dk-ring { position: relative; width: 58px; height: 58px; flex: none; }
/* rotate so the arc starts at 12 o'clock; the remaining time then sweeps
   clockwise and its tip RETREATS anticlockwise back to 12 as the clock drains */
.dk-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dk-ring-track { fill: none; stroke: rgba(var(--edge-rgb, 255, 255, 255), 0.16); stroke-width: 7; }
.dk-ring-drain {
  fill: none; stroke: var(--dk-gold); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 * (1 - var(--t, 1)));
}
.dk-ring-face {                             /* the number/glyph/face in the middle */
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--han); font-size: var(--dk-read); font-weight: 900; color: var(--paper, #f2efe9);
}
.dk-ring.low .dk-ring-drain { stroke: var(--dk-verm); }
.dk-ring.low { animation: dkRingLow 0.7s ease-in-out infinite; }   /* the last seconds are FELT */
.dk-ring.low .dk-ring-face { color: var(--dk-verm); }
@keyframes dkRingLow { 50% { transform: scale(1.07); } }

/* ------------------------------------------------------------- THE COUNTER
   A number that reacts: followers, tips, cups served, 灵石. Driven by
   tickCounter() in minigames.js. Up jumps and settles, down recoils — the
   direction is legible before the digits are read. The delta chip floats off
   and removes itself. */
/* The two colours the counter is allowed to flash, as properties rather than
   as hexes, for two reasons.
   SEMANTICS: the up-flash used to be --dk-gold while the +3 chip floating off
   the SAME event was already --dk-jade. Gold means "your turn / look here now",
   which a till is not, so the number and its own delta were disagreeing about
   what had just happened in two different semantic colours. Teal means correct;
   a counter going up is the correct thing happening; they agree now.
   SURFACE: a counter is not always on the night stage. Four drills park one in
   the shared header (boba's tip jar, rush's till, haggle's savings, clinic's
   healed count), and in LIGHT theme that header is cream — where the bright
   pair measures 1.29:1 (teal) and 3.30:1 (vermillion), i.e. a state flash the
   player cannot see and a number that drops under the floor while it flinches.
   Any surface that is cream re-points these two to the ink-side twins; the
   light-theme header does it in THE SHARED CHROME at the bottom of this file,
   and a drill putting a counter on its own paper does the same one-line move. */
.dk-counter {
  --dk-count-up: var(--dk-right);           /* the number went UP: teal, same as its own +N chip */
  --dk-count-down: var(--dk-wrong);         /* the number went DOWN: vermillion, a real loss */
  position: relative; display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--han); font-variant-numeric: tabular-nums;
}
.dk-counter-n { font-size: 22px; font-weight: 900; color: var(--paper, #f2efe9); }
.dk-counter.tick { animation: dkTick 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.dk-counter.flinch { animation: dkFlinch 0.42s ease both; }
/* The two state rules carry a .minigame prefix and the resting rule above does
   not, and that asymmetry is load-bearing. "State is later, and later wins the
   tie" is the rule at the bottom of this file, and it is only true INSIDE this
   file — every drill sheet loads after it. Two drills give the counter its own
   resting colour (rush2 and haggle2 both write
   `.minigame.rush2 .dk-counter-n { color: var(--dk-stock) }` so the till reads
   as brass), and at (0,3,0) that tied the kit's `.dk-counter.tick
   .dk-counter-n` and won on file order — so in the two drills whose counters
   move the most, the flash had no colour at all. Caught by playing a shift:
   the till went to `class="dk-counter tick"` and stayed #f2e4c2 through it.
   (0,4,0) puts the momentary state back above the resting fill without taking
   the resting fill away, and a drill that really wants its own flash still has
   the front door: set --dk-count-up / --dk-count-down.

   ROUND 6 — AND THE FLASH HAS TO END. Those two rules were STATIC colours keyed
   to a class, and minigames.js's tickCounter adds `tick`/`flinch` and never
   takes them off again (it only swaps one for the other on the next call). So
   the counter did not flash teal, it TURNED teal, and stayed teal — or
   vermillion — through the whole of the next round. Measured on boba2's tip jar
   by sampling the header pixels: after a miss the number is rgb(84,32,41) red
   for the entire following build, after a hit rgb(37,94,94) teal. That is the
   semantic pair used as decoration on a running total, which is exactly what
   the palette law forbids, and it is roster-wide — four drills park a live
   counter in that header.
   The colour is now inside the ANIMATION, with NO fill-mode, so it flashes for
   0.42s and the number returns to whatever the cascade says it rests at. That
   also retires the specificity gymnastics above: an animated value outranks any
   plain declaration, so a drill's own brass resting fill can no longer swallow
   the flash, and the flash can no longer swallow the drill's resting fill. */
.minigame .dk-counter.tick .dk-counter-n { animation: dkFlashUp 0.42s ease; }
.minigame .dk-counter.flinch .dk-counter-n { animation: dkFlashDown 0.42s ease; }
/* no `to` stop on purpose: the 100% frame is the element's OWN computed colour,
   so the number eases back to its resting fill instead of snapping */
@keyframes dkFlashUp { from, 55% { color: var(--dk-count-up); } }
@keyframes dkFlashDown { from, 55% { color: var(--dk-count-down); } }
@keyframes dkTick { 40% { transform: translateY(-5px) scale(1.14); } }
@keyframes dkFlinch { 25% { transform: translateX(-4px) rotate(-3deg); } 60% { transform: translateX(3px); } }
.dk-counter-delta {                         /* +3 / -1 floating off the counter */
  position: absolute; left: 100%; bottom: 60%; margin-left: 4px; white-space: nowrap;
  font-size: 13px; font-weight: 900; pointer-events: none;
  animation: dkDelta 0.95s ease-out both;
}
.dk-counter-delta.up { color: var(--dk-count-up, var(--dk-jade)); }
.dk-counter-delta.down { color: var(--dk-count-down, var(--dk-verm)); }
@keyframes dkDelta { from { opacity: 0; transform: translateY(6px); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-18px); } }

/* ------------------------------------------------------------------ PHONES
   Below 720px prom.css takes the host cutout off stage; the objects have to
   shrink with the room or the court scrolls. Vessels and scales are the two
   that actually overflow. */
@media (max-width: 720px) {
  .dk-vessel { --w: 76px; --ht: 106px; }
  .dk-vessel.jar { --w: 62px; }
  .dk-scale { height: 96px; }
  .dk-ring { width: 52px; height: 52px; }
  .dk-chip { padding: 5px 10px; }
  /* Objects shrink on a phone. TYPE DOES NOT — this block used to take chip
     hanzi to 16px and the ring face to 17px, which is exactly the "small and
     hard to read" finding. A narrower object with the same type is the trade. */
}

/* ============================================ SEMANTIC STATE — THE LAST WORD
   Write the MEANING, not the hex. Three states, three colours, and those
   colours mean nothing else anywhere in the game. A drill that wants a fourth
   colour wants shape, label or position instead.
   THIS BLOCK IS LAST ON PURPOSE: state must beat an object's own fill. .dk-chip
   sets its own background, and a same-specificity rule earlier in the file
   loses the tie — which is exactly how a gold "it's your turn" chip came out
   cream in the kit's first swatch. Ties go to whoever is later. State is later. */
.is-active { --dk-state: var(--dk-active); }   /* your turn / live / look here now */
.is-right  { --dk-state: var(--dk-right); }    /* correct */
.is-wrong  { --dk-state: var(--dk-wrong); }    /* wrong */
.dk-state-text { color: var(--dk-state, var(--paper, #f2efe9)); }
.dk-state-edge { border-color: var(--dk-state, var(--dk-ink)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-state, transparent) 45%, transparent); }
.dk-state-fill { background: var(--dk-state, var(--dk-stock)); color: var(--dk-ink); }
/* -------------------------------------- THE ANSWER IS NOT THE MISTAKE
   Round-6 judging, roster-wide: three drills printed the CORRECT answer in the
   wrong-answer ink on a fail card. The character a learner is meant to take away
   from the round they got wrong — 塞翁失马 at 36px, 炎 at 56px, 土 on the ward
   strip — was painted in the one colour this game uses to say "this is the
   mistake". A player who trusts the palette reads that as "the right answer is
   wrong", which is worse than no colour at all.

   It is not three coincidences, it is one shape of mistake: `.is-wrong` lands on
   the verdict CONTAINER, and the biggest thing inside that container is the
   answer, so the state colour flows onto the fact. So the kit closes it here
   rather than each drill remembering not to do it.

   --dk-display is the kit's own name for "the one thing the round is about" —
   the order, the price, the character being carved. That is a FACT, and a fact
   has no opinion about how the round went: it is printed in the material's own
   ink in both outcomes. Vermillion still says wrong, on the things that WERE
   wrong (the slip carried over, the count that missed, the frame, the edge of
   the card) — which is also the better read, because the eye lands on the answer
   first and on what was done instead of it second.

   `inherit`, not a token, because the answer is written in whatever ink the
   surface under it is written in: ink on a paper plate, cream on a lacquer slab
   or a drill's own dark strip. One rule that is right on every surface, in both
   themes, including surfaces the kit has not met yet.

   `!important` because this is an invariant, not a default — a drill that types
   `.x-verdict.is-wrong .dk-display { color: … }` out-specifies anything the kit
   can say politely, and "remember not to" is what failed five times. A drill
   that genuinely needs to paint the player's MISTAKE keeps every one of its own
   selectors; this rule only ever touches the round's subject.
   Two deliberate limits. It is a DESCENDANT selector, so a drill that marks the
   display glyph ITSELF wrong (`.dk-display.is-wrong` — the player's own answer,
   shown big) still gets vermillion, because there the glyph really is the
   mistake. And is-right is left alone: teal on a display glyph means the player
   produced the correct thing, which is exactly what teal means. */
.is-wrong .dk-display { color: inherit !important; }
/* …and the outcome has to land SOMEWHERE, so it lands on the judgement. A plate
   that carries a state class is a verdict card — measured, not assumed: across
   all fifteen drills the only elements that are `.dk-plate` AND take
   `.is-right`/`.is-wrong` are the four reveal cards (cloze2, lyric2, history2,
   forge2). Everything else those two classes touch is a window, a groove, a
   slot, a hold, a strip, a measure — none of them plates.
   Two of those four owners had already reached this by hand (forge2 a 6px band
   on the top edge, talisman2 a rule down the leading edge of its strip), which
   is the tell that it belongs in the kit rather than in four stylesheets. Same
   6px, same tokens, so forge2's own rule is now a duplicate of this one rather
   than a disagreement with it. The ink-on-paper twins, because a band on cream
   stock is a graphic and needs 3:1: bright jade is 1.29:1 there and would be a
   decoration that says nothing. */
.dk-plate.is-right, .dk-plate.is-wrong { border-top-width: 6px; }
.dk-plate.is-right { border-top-color: var(--dk-jade-deep); }
.dk-plate.is-wrong { border-top-color: var(--dk-verm-deep); }
/* The accent, and its only sanctioned uses: a hairline, a wash, a mark. It is
   ONE hue per drill — set --dk-accent on the drill's root, never per element. */
.dk-accent-text { color: var(--dk-accent); }
.dk-accent-wash { background: var(--dk-accent-soft); }

/* ======================================================= SHUT — THE OFF-STATE
   ROSTER-WIDE, and the single biggest legibility win the FTUE census found.

   THE MEASUREMENT. Fifteen blind judges, one board each, told they had never
   played a video game: mean confidence they could start playing, 2.33/5; ten of
   fifteen could not name a first action; 255 elements unidentifiable. The census
   (prom/dev/ui-census.mjs) explains most of it in one line: clinic ships 20
   controls with 2 enabled, cloze 20 with 3. The staging is CORRECT — the drill
   is telling the player "these two, now" — and the player cannot see it,
   because the off-state did not exist. `.c2-drawer:disabled { cursor: default }`.
   `.b2-cupslot:disabled { cursor: default }`. `.c2-jar:disabled { opacity:.62 }`.
   Sixteen dead word tiles painted exactly like the two live ones. That is what a
   beginner calls a cockpit.

   THE OTHER FAILURE MODE, designed against. Sixteen properly-dimmed tiles must
   not read as a FAILED LOAD or an empty cabinet — trading "everything is live"
   for "nothing works" is not a win. So this is NOT a grey-out. It is the idiom
   .dk-chip:disabled already proved above: a thing that is shut is printed on
   TIRED PAPER. Solid stock one step down in value, ink at full strength, the
   lift removed and a shallow recess in its place. The object is plainly still
   there, plainly closed.

   HOW IT STAYS MATERIAL-AGNOSTIC. The kit cannot know whether a drill's control
   is cream stock (cloze's drawers, boba's cup slots) or lacquer (clinic's wall
   jars, a night-stage tile), so it does not repaint anything. `filter` steps the
   element's OWN colour down, and the two numbers were measured off the board
   rather than guessed: a cloze word tile ships rgb(225,208,165), and
   saturate(0.72) brightness(0.88) puts it at rgb(194,183,156) — a step down in
   value, chroma spread 60 -> 38, i.e. the same paper in shadow. It is
   deliberately NOT further desaturated: the first pass ran saturate(0.55) and
   landed on rgb(197,188,167), spread 30, which went grey-olive and started to
   look like a skeleton placeholder instead of a closed drawer. Warmth is what
   keeps it paper. On a dark lacquer tile the same filter simply sinks it into
   the board. Text goes down with it by less than a step of value, so a 20px
   hanzi on a shut drawer is still a 20px hanzi. Nothing here touches `opacity`:
   opacity drags type toward whatever art is behind the rail, which is the exact
   defect the .dk-chip note above documents (2.55:1 on "qù").

   THE SHADOW IS THE OTHER HALF, and this shape is BORROWED, not invented. A live
   kit object carries a hard drop (`0 3px 0`), which is the whole "this is a
   physical thing you can press" cue. cloze2 already worked out what shut looks
   like in this house — `.c2-drawer.shut` keeps the ledge and adds a deep inset,
   so the drawer front sits in its own shadow. That is the shape here, one step
   flatter: the ledge drops 3px -> 2px (the edge flattens, the object stops
   offering itself) and a 13px inset says the front is pushed in.
   KEEPING THE LEDGE IS NOT OPTIONAL — the first pass removed it entirely, and
   the cloze cabinet went pale and flat, because those sixteen little drop
   shadows were what made the wood BETWEEN the drawers read dark. Take them all
   away at once and the cabinet stops being a cabinet, which is the "failed
   load" read arriving by the back door. The ledge is what keeps sixteen shut
   drawers reading as sixteen drawers.

   SPECIFICITY, STATED. drill-kit.css loads before every drill-*2.css, so an
   equal-specificity rule here loses the tie to a drill's base paint. The
   `[class]` twin (0,2,1) clears a plain `.cloze2 .c2-drawer` (0,2,0) for the two
   properties that must land; the bare rule carries the rest and covers controls
   with no class of their own. No `!important`: a drill that deliberately
   overrides its own shut look (`.cloze2 .c2-drawer.shut`, 0,3,0) still wins,
   which is right — that rule exists to say the same thing louder.

   Covers :disabled (real form controls) and [aria-disabled="true"] (the divs and
   buttons a drill keeps focusable on purpose). Scoped to .minigame so the
   dialogue sheet and the hub keep their own chrome. */
.minigame :disabled,
.minigame [aria-disabled="true"] {
  cursor: default;
  filter: saturate(0.75) brightness(0.92);
}
.minigame [class]:disabled,
.minigame [class][aria-disabled="true"] {
  border-color: rgba(36, 19, 53, 0.72);
  box-shadow: 0 2px 0 rgba(14, 6, 24, 0.6), inset 0 7px 14px rgba(36, 19, 53, 0.34);
}
/* A shut control does not react to the mouse either — half the "is this live?"
   question a player answers by waving the cursor at it. */
.minigame :disabled:hover,
.minigame [aria-disabled="true"]:hover,
.minigame [class]:disabled:hover,
.minigame [class][aria-disabled="true"]:hover {
  transform: none;
}

/* ============================================================ LIVE — THE MARK
   THE CORRELATION, from the same fifteen-judge census: the ONLY two boards that
   ring their live control (cloze's .c2-scissors.is-active, lyric's
   .l2-mark.is-active) are the only two where a judge named the correct gesture
   on the correct target. Every other board left the player's eye to the
   character art, which won the first fixation on nine of fifteen screens. So the
   ring stops being two drills' private idea and becomes kit furniture.

   EXACTLY ONE .dk-live PER BOARD AT ANY TIME. Two gold rings is the same "which
   one do I touch" question the mark exists to answer, and it is worse than none
   because it looks deliberate. setLive(box, el) in minigames.js enforces it by
   clearing the board first; drills should go through it rather than toggling the
   class by hand.

   BUILT FROM outline + drop-shadow, NOT box-shadow or a pseudo-element, and
   that is deliberate: `outline` costs no layout, follows the element's own
   border-radius, and does not clobber the hard drop shadow a kit object is
   drawn with; `filter: drop-shadow()` composes with a drill's existing filter
   instead of replacing it; and neither needs `position: relative`, which a
   pseudo-ring would have forced onto controls the drills already position.

   SIZED TO COMPETE WITH THE ART: 3.5px of lantern gold standing 5px off the
   object, breathing out to 9px, with a halo. Gold is the kit's one "look here
   now" colour (see --dk-gold) and this is its loudest sanctioned use. */
.dk-live {
  outline: 4px solid var(--dk-gold);
  outline-offset: 5px;
  filter: drop-shadow(0 0 14px rgba(255, 200, 74, 0.55)) drop-shadow(0 0 4px rgba(255, 200, 74, 0.7));
  animation: dkLive 2.4s ease-in-out infinite;
}
@keyframes dkLive {
  0%, 100% { outline-offset: 5px; outline-color: var(--dk-gold);
             filter: drop-shadow(0 0 12px rgba(255, 200, 74, 0.5)) drop-shadow(0 0 4px rgba(255, 200, 74, 0.62)); }
  50%      { outline-offset: 10px; outline-color: #ffe6a8;
             filter: drop-shadow(0 0 26px rgba(255, 200, 74, 0.72)) drop-shadow(0 0 6px rgba(255, 200, 74, 0.8)); }
}

/* -------------------------------------------------- MOTION RESPECTS THE PLAYER
   Same contract as prom.css 8.14: entrances land in their final state, loops
   stop, nothing jitters. State still reads — a fill still has its height, a
   tilted beam is still tilted, .low is still vermillion — because every piece
   of state above is carried by a property, not by an animation. */
@media (prefers-reduced-motion: reduce) {
  .dk-fill { transition: none; }
  .dk-fill::after, .dk-pearls i, .dk-heat i, .dk-stream, .dk-pourer.over,
  .dk-vessel.over .dk-vessel-well, .dk-stamp, .dk-ring.low,
  .dk-counter.tick, .dk-counter.flinch, .dk-counter-delta { animation: none; }
  .dk-counter-delta { opacity: 1; }
  /* dkFlashUp / dkFlashDown are deliberately NOT in that list. They move
     nothing — they are a 0.42s colour fade on the digits, and the colour IS the
     information (teal you gained, vermillion you lost). Killing them would take
     the state away, which is the one thing this block must never do; the +N chip
     above already carries the same fact in text for anyone who wants it. */
  .dk-pourer, .dk-scale-beam, .dk-pan, .dk-chip { transition: none; }
  /* the active line keeps its gold wash and its gold ring — only the fade goes */
  .dk-docket-row.now { transition: none; }
  /* THE RING STAYS, the breathing goes. .dk-live's ring is state — it is the
     answer to "which one do I touch" — and this block never takes state away;
     the pulse is only the invitation. Killing the animation leaves the 0%
     keyframe's values, which are the declared ones. */
  .dk-live { animation: none; }
}

/* ==================================================== THE SHARED CHROME
   Three pieces of furniture come free with every drill and are drawn by
   prom.css, not by the drill: the title plaque, the host's speech bubble, and
   the round/score readout. They predate this type scale, so each landed a pixel
   or two under it — and then NINE of the ten hands-on rebuilds wrote the same
   three corrections into their own stylesheet while two wrote none and one
   wrote a different number. That is "twelve games instead of one" in miniature,
   in four selectors. The corrections live here now, once, so a drill inherits
   the chrome instead of re-deriving it, and a drill written next month gets it
   for free. (The per-drill copies that duplicate these values are harmless and
   were left alone; the two that DISAGREED were brought back to this value.) */
.minigame .mg-head b.han { font-size: var(--dk-read); }   /* the drill's own name */
/* the one-line subtitle. :not(.mg-score) because the counter is also a > span,
   and a type selector would otherwise out-specify the counter's own rule. */
/* --mg-sub / --mg-count are unset for a classic drill and set on a rebuild's
   root; see ".dk-drill: THE HEADER, FIXED" below for the whole wiring. */
.minigame .mg-head > span:not(.mg-score) { font-size: var(--mg-sub, var(--dk-caption)); line-height: 1.25; }
.minigame .mg-score { font-size: var(--mg-count, var(--dk-caption)); }
/* The host's line is the most-read hanzi in the game and it was shipping at
   19px, one pixel under the floor the kit itself declares. */
.minigame .mg-bubble .han { font-size: var(--dk-read); line-height: var(--dk-lh-read); }

/* ------------------------------------------------- .dk-drill: THE HEADER, FIXED
   Round-2 judging, verbatim: "the smallest text a player must read is 12.5px in
   every drill, and in five of them that 12.5px carries hanzi." Both halves were
   true, and both lived in the three selectors above.

   The previous pass looked at 16px, saw it wrap the CLASSIC drills' long English
   subtitles inside the title plaque, and kept 12.5px for everyone. That was the
   wrong trade: it froze the ten drills Lau actually plays at the size of the ten
   she keeps only for comparison. The fix is to stop making the classics pay for
   the rebuilds and stop making the rebuilds pay for the classics — everything
   above stays exactly as it shipped and applies to the classic runners, and the
   ten hands-on drills carry .dk-drill on their root and get the real floors:

     subtitle  --dk-label (16px)  it tells you how to play; that is not a caption
     counter   --dk-label (16px)  "which order am I on" is a fact
     its hanzi --dk-read  (20px)  单 · 对 · 摊 · 提问 · 病人 · 小费 are hanzi, and
                                  hanzi never goes under the reading step. The old
                                  comment argued the counter was the one exception
                                  because "its facts are latin digits". A player
                                  who cannot read 单 cannot read the counter, and
                                  this is a game about reading hanzi.
     sound cue --dk-label / --dk-read — same argument, and it is the line that
                                  tells a player the round is audio-first.

   Nothing wraps: the header is one row at 920px because the SUBTITLES were
   shortened to fit the bigger type (drill-kit's own rule — shorten the words,
   never the type), and it wraps to a second row gracefully if a translation
   ever runs long. Verified by prom/dev/type-audit.mjs, which walks every visible
   text node in all ten drills in both themes and fails on latin < 16, hanzi < 20
   or caption < 14.

   HOW IT IS WIRED, and why it is not just ".dk-drill .mg-score { 16px }": the
   sizes are carried by four inherited custom properties set on the drill ROOT,
   and the selectors that consume them are the same three that shipped above. So
   there is exactly one rule per piece of chrome in this file, a classic drill —
   which sets none of the four — keeps the caption step by falling back, and a
   rebuild opts in by carrying .dk-drill. The ten root class names are listed
   alongside the marker as belt-and-braces: a rebuild that gets its root element
   rewritten and loses the marker keeps its type anyway. */
:is(.dk-drill,
    .minigame.b2-game, .minigame.rush2, .minigame.chengyu2,
    .minigame.hp-game, .minigame.dz-game, .minigame.stream2-drill,
    .minigame.clinic2, .minigame.tk-host, .minigame.tg-host) {
  --mg-sub: var(--dk-label);   /* the subtitle: it tells you how to play */
  --mg-count: var(--dk-label); /* the counter's latin: which round, how many right */
  --mg-han: var(--dk-read);    /* any hanzi in either: 单 · 对 · 摊 · 提问 · 病人 */
  --mg-cue: var(--dk-label);   /* 开声音 — the line that says the round is audio-first */
}
.minigame .mg-head { flex-wrap: wrap; row-gap: 1px; }
.minigame .mg-head > span:not(.mg-score) .han,
.minigame .mg-score .han,
.minigame .mg-score b.han { font-size: var(--mg-han, inherit); font-weight: 800; }
.minigame .mg-soundhint { font-size: var(--mg-cue, 12px); }
.minigame .mg-soundhint .han { font-size: var(--mg-han, inherit); }
/* Narrow stages cannot hold title + subtitle + counter on one row at the real
   sizes. The counter and the title are facts and stay; the subtitle is the one
   thing every drill also says in its in-flow legend, so it is the one thing that
   may drop. (Five drills already did this at 700px in their own sheets; it is
   here once now, at the width where the header actually stops fitting.) */
@media (max-width: 900px) {
  .dk-drill .mg-head > span:not(.mg-score) { display: none; }
}

/* --------------------------------- THE COUNTER IS NOT A WRONG ANSWER (light)
   The round-5 roster finding, and it was true in all fifteen drills at once:
   in LIGHT theme every round counter and every score number was painted
   #8c2333 by prom.css 13.3, so the wrong-answer family decorated the header of
   the entire build. Measured, before: 28 text runs across the fifteen drills,
   every one of them #8c2333. Its hue is 351deg — which is not even the
   vermillion the palette owns (--dk-verm is 6deg, --dk-verm-deep 4deg), so it
   was simultaneously a semantic lie and a FOURTH red in a chrome that is capped
   at three saturated hues.
   The lie is worth spelling out because it is what a player actually sees:
   chengyu's header reads "round 1/5 · right 0 · pen 0", and the shipped build
   painted the "right" count and the penalty count in the same red — a colour
   that means WRONG carrying a number that means RIGHT, and carrying it in
   exactly the same shade as the number that does mean wrong. The colour was
   not merely misapplied; it was doing no work at all.
   The DARK theme never had this: there the counter is --paper and its labels
   are --haze, with the emphasis carried by weight (800 vs 400). That is the
   correct design and it already exists, so light theme is brought into line
   with it rather than given something new — ink where dark has paper, ink-soft
   where dark has haze. 7.14:1 becomes 14.08:1 for the numbers and 4.55:1
   becomes 5.52:1 for the labels, so this removes a colour AND buys contrast.
   Fixed here rather than in prom.css because prom.css also dresses the ten
   classic v1 drills Lau keeps for comparison, and this file is the layer that
   already owns the shared chrome's corrections. Same selector as prom.css's,
   loaded after it.

   ROUND-7 CORRECTION — HALF OF THAT NEVER SHIPPED. The numbers did: measured
   just now in all fifteen drills, `.mg-score b` is rgb(36,19,53). The LABELS
   did not. Measured in all fifteen, `.mg-score` is still rgba(36,19,53,0.62) —
   prom.css's value, not --dk-ink-soft's 0.68 — because "same selector as
   prom.css's" was not true of the selector that actually paints them.
   prom.css 13.3 has TWO rules on this text and the round-5 note only answered
   one. The other is `:root[data-theme="light"] .minigame .mg-head > span`,
   which weighs (0,4,1) against the (0,4,0) below, and every `.mg-score` in the
   build is a direct span child of `.mg-head` — so the heavier rule won on
   specificity and loading later never got a say. The promised 5.52:1 stayed a
   measured 4.56:1: a pass by 0.06, on the line that tells the player which
   round they are in.
   The rule below is kept (it is correct for a `.mg-score` nested deeper than a
   direct child, which is where a future drill will put one) and the missing
   twin is added at the weight that lands. It re-points the SUBTITLE at the same
   time, because that span has the identical problem and THREE drills have each
   derived the identical local patch for it — history2, cloze2 and lyric2 all
   ship `.mg-head > span:not(.mg-score) { rgba(36,19,53,0.72) }` with the same
   comment ("4.56:1, a pass by 0.06, which is not a margin on the line that
   tells a player how to play"). Three sheets writing one fix is the roster
   pattern this file exists to end; the other twelve get it here for nothing,
   and those three keep their (0,5,1) rules and simply read higher. */
:root[data-theme="light"] .minigame .mg-score { color: var(--dk-ink-soft); }
:root[data-theme="light"] .minigame .mg-head > span { color: var(--dk-ink-soft); }
:root[data-theme="light"] .minigame .mg-score b { color: var(--dk-ink); }
/* Four drills park a live .dk-counter in that header (boba's tip jar, rush's
   till, haggle's savings, clinic's healed count). On the cream plaque its state
   flashes are 1.29:1 (teal) and 3.30:1 (vermillion) — a tick the player cannot
   see and a flinch that drops the number under the floor while it is flinching.
   The counter carries both as properties precisely so a cream surface can
   re-point them; this is the kit doing it once for the one cream surface the
   kit itself owns. 5.3:1 and 5.9:1. */
:root[data-theme="light"] .minigame .mg-score .dk-counter {
  --dk-count-up: var(--dk-jade-deep);
  --dk-count-down: var(--dk-verm-deep);
}
/* The resting colour has to be stated here and not left to the object, because
   .dk-counter-n falls back to --paper and prom.css clamps --paper to its NIGHT
   value inside .minigame in BOTH themes — so an unhandled counter in the light
   header is near-white on cream. Measured while writing this: 1.04:1. It also
   has to out-specify the two drills that give their till its own brass fill
   (rush2, haggle2, both at (0,3,0)), which is why it is written out in full
   rather than hidden in a :where().
   The two state rules used to have to out-specify THAT as well, and since
   round 6 they do not: the flash is an animation, and an animated value beats
   every plain declaration in the cascade regardless of selector weight. What is
   left here is the RESTING fill, which is all this block ever needed to say. */
:root[data-theme="light"] .minigame .mg-score .dk-counter-n { color: var(--dk-ink); }

/* -------------------------------- THE LIGHT PLAQUE IS THIS FILE'S OWN PAPER
   ROUND-7. The judges photographed history and forge in light theme and named
   what they saw as "a cream title plaque" sitting over the drill — and the
   plaque IS the odd object in that frame, but not for the reason the finding
   gave (see the note at the end of this block). It is odd because it is a
   SECOND CREAM.
   Measured, light theme, all fifteen:
     the plaque      linear-gradient(178deg, #faf3df, #f0e8d1) · 2px · 0 3px 0
                     rgba(20,10,32,0.5) · radius 10        (prom.css 13.3)
     everything else #f2e4c2 flat · 3px · 0 4px 0 rgba(14,6,24,0.75) · radius 10
                     (--dk-stock / --dk-line / --dk-drop, this file)
   Three properties out of four differ, on two pieces of paper that are in the
   same screenshot, eight pixels apart — history's title plaque and the twelve
   idiom slips under it. That is the "one design system" bar failing on the
   single most-looked-at element in the build, and it fails in fifteen drills at
   once. prom.css wrote that plaque when its neighbours were .mg-board answer
   cards; after the round-4 gesture rebuild NOT ONE of the fifteen hands-on
   drills emits .mg-board, so the plaque's cream is now the only one of its kind
   on the stage and every object beside it is cut from this file's die.
   So the plaque takes .dk-plate's recipe exactly — the class cannot be added
   from CSS, so its four properties are written out.

   THE PADDING IS PICKED TO HOLD THE BOX, not chosen for looks: prom.css runs
   5px padding inside a 2px border for a 42px plaque, and 4px inside a 3px
   border is the same 42px. Measured after, all fifteen: thirteen unchanged at
   42px, and the two that put the head back in the flow (rush, haggle) grow
   37->39px, where the clearance to the sound nudge below was -7px and -8px.
   Nothing moves and nothing collides.

   COLOUR IS SET WITH THE BACKGROUND, which is the whole reason .dk-plate ships
   them as a pair. .mg-head inherits rgb(243,234,255) from .minigame (prom.css
   clamps --ink to its night value inside the stage in BOTH themes), so today
   every run in the header survives only because prom.css names `b.han` and
   `> span` one at a time. No live run fails — this is a trap, not a defect —
   but the next header element that is an <i> or an <em> is near-white on cream
   at 1.04:1, which is exactly how the counter got there in round 6.

   SCOPED TO .dk-drill, like the dark rule below it, so the ten classic v1
   drills Lau keeps for comparison stay on prom.css's plaque untouched. (0,4,0)
   ties prom.css 13.3 and wins on load order; the drills that dress their own
   header — cloze2 and talisman2, both (0,2,0) — were already losing to that
   same weight in light and are unaffected, and dance2's and ktv2's are
   dark-only by their own guard. */
:root[data-theme="light"] .dk-drill > .mg-head {
  background: var(--dk-stock); color: var(--dk-ink);
  border: var(--dk-line); border-radius: 10px;
  box-shadow: var(--dk-drop); padding: 4px 14px;
}

/* WHAT THE ROUND-7 FINDING ASKED FOR INSTEAD, and why this file did not do it.
   The finding was that .dk-scrim and .dk-slab are theme-invariant "so four
   drills paint their primary reading panel as a night slab in light mode while
   every other drill's panel flips to cream". Two of those three clauses do not
   survive measurement, and the third is this file's stated rule:
   · .dk-plate and .dk-docket do not flip. Measured in both themes, all fifteen:
     rgb(242,228,194) in DARK and rgb(242,228,194) in LIGHT. Cream is a MATERIAL
     here, not a theme (the header of this file, rule five). Nothing flips, so
     the four are not out of step with a flip.
   · The stage does not light up either. history and forge both run
     art/bg/library.jpg through the same blur/0.8-brightness filter, the same
     rgba(18,9,30,0.58) inline scrim and the same stage gradient in BOTH themes
     — prom.css 8.13, "the theme toggle keeps its say on reading surfaces, not
     on stages". The "daylit bookshop painting" is the art, and it is just as
     daylit in the dark-theme screenshot, where the same panel was passed.
   · It is not four drills. Counting what is PAINTED rather than which class was
     typed — every element on the light-theme stage whose composited background
     is under 0.18 luminance and carries text at 16px or more — FOURTEEN of the
     fifteen drills have at least one and stream2 has NINE, while the four the
     finding names carry between one and three each. ktv2 is the only drill on
     the roster with none. The four were simply the four that spell the material
     as a CLASS; the rest reach the identical rgba(18,9,30,0.9) through
     --dk-mat-scrim and were invisible to a class query.
   Flipping the two classes would therefore not unify anything — it would split
   one material into two colours INSIDE one drill. Counted at HEAD: the classes
   appear 9 times across five drill modules, the token 27 times across ten drill
   sheets, and talisman2 uses BOTH. It would also strand every child: the colour
   contract those surfaces publish (talisman2's own header states it — --paper /
   --haze / --dk-gold on night, --dk-ink / --dk-ink-soft / --dk-verm-deep on
   cream) is written into the drill sheets this file may not edit, and --paper is
   clamped to #f2efe9 inside .minigame in BOTH themes, so a cream .dk-scrim would
   print near-white text on cream at 1.04:1 in nine places on contact. */

/* ------------------------------------- THE HEADER SITS ON A MATERIAL (dark)
   "TEXT NEVER SITS ON BARE ART" is the second rule this file declares, and in
   dark theme the shared header broke it in all fifteen drills: prom.css gives
   the plaque a cream stock in LIGHT and nothing at all in dark, so the title,
   the subtitle and the counter float directly on the stage painting.
   It mostly survives today only because the stages are still dark CSS
   gradients — measured across all fifteen, most land 6-8:1. Boba's stage is the
   brightest and it already FAILS: --haze at 16px over #3e353b is 4.37:1 against
   a 4.5 bar. That is the whole warning. The paintings in ART-SHOPPING-LIST.md
   are real art, and real art is far lighter than a gradient; over blown-out
   white the same run would be 1.7:1.
   So the header gets the material the kit already defines for exactly this —
   .dk-scrim's ink at 0.90 — which holds --paper at 13.3:1 and even --haze at
   5.9:1 against the worst case the file measures.
   THREE DRILLS HAD ALREADY WRITTEN THIS THEMSELVES, in this same round, in
   three different constructions: dance2 ("the dark theme had it on NOTHING —
   measured backgroundColor rgba(0,0,0,0)"), ktv2 ("nothing in this drill sits
   on bare painting in either theme"), cloze2 ("lands on the desks at 4.31:1,
   measured, 430x932"). That is the roster pattern this file exists to end, so
   it moves here and the other twelve get it for nothing. All three keep their
   own version — each sets background, border, radius and padding, all of which
   out-specify this rule, so nothing here leaks into a header that has already
   been dressed.
   WHICH IS WHY THIS RULE SETS NO box-shadow AND NO width, and why its theme
   guard is wrapped in :where() so the whole selector weighs (0,2,0). Both
   choices exist to LOSE: a spread ring or a width from here would have drawn a
   scrim halo outside dance2's and ktv2's ink-bordered cards, and at any real
   specificity this rule would have out-ranked cloze2's own padding. Zero-weight
   guard + the three shapes those drills already declare = they win every
   property, and the other twelve get the material.
   The padding is affordable — checked, not assumed. prom.css pins this header
   at top:18px with .mg-timerwrap at top:46px, about 2px of clearance, which is
   why the light-theme hem note at the bottom of this file says padding is not
   available. That was true when the drills were four-option quizzes: the timer
   bar is emitted by runChoiceQuiz, and after the round-4 gesture rebuild NOT
   ONE of the fifteen hands-on drills calls it — measured live, .mg-timerwrap
   renders in zero of fifteen (the only file still emitting it is the classic
   hoops.js, which never carries .dk-drill and is not selected here).
   The `top` walks back most of what the padding spends, so the words stay where
   they were and only the hem moves: the glyphs land within a pixel of their old
   baseline and the card's bottom edge grows by 5px, not 9. Everything under the
   pinned header still clears it (measured, all fifteen, both themes).
   Light theme is untouched: this rule cannot match there at all. */
:where(:root:not([data-theme="light"])) .dk-drill > .mg-head {
  background: var(--dk-mat-scrim);
  border-radius: 12px;
  padding: 3px 14px 4px;
  top: 16px;                    /* ignored by the drills that put the head back in flow */
}

/* NOT FIXED HERE, and the reason is worth writing down. In LIGHT mode the
   title plaque grows a border, padding and a drop (prom.css 10.x) and its hem
   lands on the sound nudge — measured at 1200x760: plaque bottom 60px, nudge
   top 56px, in every captioned drill. The nudge cannot move down and it cannot
   grow: it is the first item in the drill's normal flow, the plaque is
   ABSOLUTE over that flow, and in the classic drills the band between them is
   ~16px before the first prompt line starts. Scrimming it, padding it, and
   pushing it were each tried and each landed the nudge on the line below.
   The fix belongs where the layout is: prom.css should reserve the plaque's
   real height instead of positioning it over the flow. Filed rather than
   bodged, because a bodge here breaks a classic drill Lau is comparing against.

   ROUND-7 RE-MEASURE, same 1200x760, light theme, all fifteen hands-on drills:
   it no longer reproduces in ANY of them. "Every captioned drill" was true of
   the four-option build; the twelve that still park an absolute plaque at
   bottom:60px now render no .mg-soundhint at all, and the three that do have
   one — rush, haggle, lyric — put the head back in the normal flow themselves,
   where it clears the nudge by 7px, 8px and 8px. So the filing above stands
   only for the classic v1 drills, which carry no .dk-drill and are not selected
   by anything in this file. Left filed rather than deleted for exactly that
   reason, and dated so the next reader does not re-chase a live bug. */

/* ======================================================================
   THE SHELL — 甲骨. One shared, PERSISTENT collection.
   ======================================================================
   Used by prom/js/drills/shell2.js, which is read and written by exactly two
   drills: 拆字课 Radical Forge and 符咒课 Talisman Craft. It lives in the kit
   and not in either drill's sheet for the same reason the store lives in one
   module: the benchmark asks for ONE shell shared between those two classes,
   and two copies of a stylesheet block is how one shell becomes two again.

   ROUND-7 FINDING it answers: "None of the three shells persists … so the game
   has no completion meter." The row now paints the whole save — every character
   the player has ever carved, in the order they carved it — with a
   `carved/goal` number that is the meter itself.

   COLOUR. The chips are BONE (#ffe9b0) on the night slab, and that is the whole
   palette. A permanent record must not wear gold: gold means "your turn, look
   here now", and twenty-three gold plates sitting on a shelf all night is the
   exact decorative use the house rules forbid — forge2's own sheet already
   wrote that lesson down for its chips and talisman2's slots had not learnt it
   (they were ink-on-gold, kept lit for the whole session). Tonight's carvings
   are told from the kept ones by BRIGHTNESS AND PLATE, and a lent one — a ward
   Rip drew — by having no plate at all. Shape and fill, never a second hue.

   LAYOUT. ONE ROW, fixed height, scrolls sideways. It cannot be allowed to wrap:
   drill-history2.css already carries the measurement of what happens when a
   growing chip row is a flex item above the drill's display object (a groove
   that went 58px → 36.2px over five rounds), and a persistent shell holds
   twenty-three of them rather than five. Fixed height means the shelf can fill
   up completely without moving a single pixel of the drill under it. */
.dk-shell {
  width: 100%; display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  padding: 7px 12px;
}
.dk-shell-hd { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
/* The object's name, at reading size. It was --dk-display in talisman2 and that
   made the label the second-biggest thing on a board whose subject is the
   paper; the shelf titles itself, it does not compete. */
.dk-shell-hd .han {
  font-family: var(--han); font-size: var(--dk-read); font-weight: 900;
  line-height: 1; color: var(--paper, #f2efe9);
}
/* THE METER. Bone on the slab, weight for the emphasis, no colour — the same
   design the kit's round counter uses in dark theme, for the same reason. */
.dk-shell-n {
  font-family: var(--han); font-size: var(--dk-label); font-weight: 700;
  line-height: 1; color: var(--haze, #a49fae); letter-spacing: 0.02em;
}
.dk-shell-n b { font-weight: 900; color: var(--paper, #f2efe9); }
.dk-shell-hd .dk-label { color: var(--haze, #a49fae); font-weight: 700; line-height: 1; }
.dk-shell-row {
  flex: 1 1 auto; min-width: 0;
  /* A SCROLLING ROW'S WIDTH MUST NEVER DEPEND ON ITS CONTENTS. Without this,
     the row's max-content (every card side by side) propagates up through the
     shrink-to-fit ancestors and INFLATES THE OBJECT AROUND IT: measured at
     375px, Wan's plastron went from 360px to 550px — 175px of it off the right
     of the phone — as soon as the row held eight cards. `min-width: 0` and
     `max-width: 100%` do not stop it; inline-size containment does, because it
     is the one declaration that says "my width is not my content's business". */
  contain: inline-size;

  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; padding: 2px 0;
  /* WHOLE GLYPHS ONLY. A free-scrolling row rests wherever the last programmatic
     scroll left it, and the cell straddling the left edge loses a radical —
     sh7-out/20-forge-states-light-wide.png caught 清 painted as 青, which in a
     game about reading characters is the worst possible way to clip. Two
     defences, because either one alone has a hole in it:
     (1) shell2.js's reveal() rounds every rest position onto a cell start, and
         scroll snapping holds a hand-dragged row to the same grid;
     (2) the ends FADE, so a cell that is genuinely mid-scroll dissolves instead
         of being chopped — a fading 清 cannot be misread as 青, and the fade is
         also the only thing on the strip that says "there is more this way".
     Nothing a player must READ sits in the fade: every measured contrast on
     this strip is taken with the cell scrolled into the clear. */
  scroll-snap-type: x proximity;
}
/* The fade is per EDGE and only on the side that actually has more shelf on it
   (shell2.js sets the two classes on every scroll). A row parked at its start
   with a fade on that start is dimming the oldest character you own for no
   reason at all — which is what a single is-over class did. */
.dk-shell-row.is-over-l.is-over-r {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13px, #000 calc(100% - 13px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13px, #000 calc(100% - 13px), transparent 100%);
}
.dk-shell-row.is-over-l:not(.is-over-r) {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13px);
  mask-image: linear-gradient(90deg, transparent 0, #000 13px);
}
.dk-shell-row.is-over-r:not(.is-over-l) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 13px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 13px), transparent 100%);
}
.dk-shell-row::-webkit-scrollbar { display: none; }
.dk-shellchip {
  flex: 0 0 auto; scroll-snap-align: start;
  font-family: var(--han); font-size: var(--dk-read); font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 1.5em; height: 1.5em; border-radius: 7px;
  font-style: normal;
}
/* KEPT — carved on an earlier night. Quiet, but never below the reading floor:
   bone at 0.72 on the slab measures 6.6:1, and these are hanzi a player is
   meant to be able to read back. */
.dk-shellchip.kept {
  color: rgba(255, 233, 176, 0.72);
  background: rgba(0, 0, 0, 0.30);
  border: 2px solid rgba(255, 233, 176, 0.26);
}
/* TONIGHT — full bone, a plate, and a rim. The difference from `kept` is
   luminance and material, both readable in one glance and neither of them a
   hue the palette has spent elsewhere. */
.dk-shellchip.fresh {
  color: #ffe9b0;
  background: rgba(0, 0, 0, 0.46);
  border: 2px solid rgba(255, 233, 176, 0.66);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}
/* the cell that just landed, and only that one — see shell2.js */
.dk-shellchip.just { animation: dk-shell-carve .5s cubic-bezier(.2, 1, .3, 1) both; }
/* LENT — Rip drew this one across the paper first. It is on the shelf, because
   it happened; it is not in the number, because it is not yours. No plate, and
   the glyph sits in outline: the record of the assist, legible at the end of
   the week rather than only in the moment it was paid. */
.dk-shellchip.lent {
  color: rgba(255, 233, 176, 0.62);
  background: transparent;
  border: 2px solid rgba(255, 233, 176, 0.44);
}
/* NEXT — one dashed cell so the shelf is never a bare label on a fresh save.
   DASHED IS RESERVED FOR IT. A lent chip was dashed too and, sitting next to
   this one on the shelf, the pair read as two of the same thing (seen in
   sh7-out/12-tal-lent-dark.png). Lent is hollow-but-solid, empty is dashed:
   three fills — plate, hollow, nothing — across four states. */
.dk-shellchip.next {
  border: 2px dashed rgba(242, 239, 233, 0.30);
  background: transparent;
}
/* PAD — the same cell with nothing drawn on it, kept on a completed shelf purely
   so the scroll range still ends on a boundary. See shell2.js's trailing cell. */
.dk-shellchip.pad { border-color: transparent; background: transparent; }
@keyframes dk-shell-carve {
  from { transform: scale(.42) rotate(-11deg); opacity: 0; }
  60%  { transform: scale(1.06) rotate(1deg); }
  to   { transform: none; opacity: 1; }
}
@media (max-width: 720px) {
  .dk-shell { gap: 9px; padding: 6px 10px; }
  .dk-shell-hd { gap: 6px; }
  /* the object name and the meter stay; the latin gloss is the one thing on the
     strip a player can get elsewhere, so it is what a 375px row gives up */
  .dk-shell-hd .dk-label { display: none; }
  .dk-shellchip { width: 1.4em; height: 1.4em; }
}
@media (prefers-reduced-motion: reduce) {
  /* the carve is motion; WHICH ones are tonight's is state, and state stays */
  .dk-shellchip.just { animation: none; }
  .dk-shell-row { scroll-behavior: auto; }
}

/* ===========================================================================
   .tool INSIDE A DRILL — ROSTER-WIDE, and a fix that belongs to no one drill
   ===========================================================================
   ROUND-7 finding, raised against boba but true of six drills: 再说一遍, 提示,
   字幕 and every other small control on a drill board is a `.tool`, and
   prom.css paints `.tool` in the dialogue chrome's night purple (#332352 on
   #241335, text #cfc3e8). prom.css already re-paints it as a paper chit in
   LIGHT theme (":root[data-theme=light] .minigame .tool") — so in dark theme
   every drill was carrying a saturated 260deg purple that belongs to the
   dialogue sheet and to no token in the drill palette, and the same control
   was two different objects depending on the time of day. Measured at the boba
   counter's 茶底 station, dark theme: bg rgb(51,35,82) at hue 260, one of five
   saturated buckets against a cap of three (prom/dev/b2-r7-audit.mjs).
   A drill's small controls are the same material as everything else it puts on
   the counter: paper, ink, hard shadow. This is that, in BOTH themes — the
   light rule above is more specific and lands on the same values, so the two
   agree instead of one overriding the other.
   Drills using .tool today: boba2, clinic2, forge2, dance2, hoops2, stream2.
   Fixed here rather than in any drill sheet because it is roster-wide.
   Nothing here touches .tool outside .minigame: the dialogue sheet keeps its
   own chrome. */
.minigame .tool {
  background: var(--dk-stock-2); border: 2px solid var(--dk-ink); color: var(--dk-ink);
  box-shadow: 0 2px 0 rgba(20, 10, 32, 0.45);
}
.minigame .tool:hover {
  background: #fff; border-color: var(--dk-ink); color: var(--dk-ink);
}
/* pressed IN, the ptab.sel idiom the kit uses everywhere: ink, not gold. Gold
   means "the thing to look at now" and a toggle that is already on is not it.
   :not(.mg-cc) because 字幕 armed IS gold and prom.css 12.8 owns that state —
   this file loads after prom.css, so an unqualified .on here would silently
   out-order it and take the captions toggle's armed colour away. */
.minigame .tool.on:not(.mg-cc), .minigame .tool[aria-pressed="true"]:not(.mg-cc) {
  background: var(--dk-ink); border-color: var(--dk-ink); color: var(--dk-stock);
  box-shadow: 0 1px 0 rgba(20, 10, 32, 0.45); transform: translateY(1px);
}

/* ===========================================================================
   TAP / HOVER TO DEFINE — the reading surface of a board
   ===========================================================================
   The three-line label (hanzi / pinyin / English) is what fifteen blind judges
   kept calling busy: "nearly every single label is printed three times over...
   a six-row ticket is really eighteen lines of text". So a label now carries
   the hanzi plus ONE gloss, and the line it lost is on demand — a card with
   hanzi, pinyin, meaning and the word spoken, opened by hovering (pointer) or
   tapping (touch) any wrapped word. The seam is readable() in minigames.js.

   A beginner will not guess that. This is the whole on-board affordance: a
   hairline under a word that answers, no legend, no badge, no extra row. Two
   things it must never become: (1) loud enough to read as a live control —
   the board's ONE gold ring is the only thing allowed to say "touch me here";
   (2) present on an answer or a control — .w never survives inside one (the
   audit in game.js strips it and names the drill), and the handler refuses it
   regardless, so nothing here can make a drag handle look definable.
   Scoped to .minigame on purpose: the dialogue sheet's own words are unchanged.
   :where() keeps this at zero specificity weight against a drill's own colours,
   so a board that paints its ticket ink can still override without !important. */
.minigame :where(.w) {
  cursor: help;
  text-decoration: underline dotted 1px;
  text-decoration-color: rgba(160, 140, 190, 0.45);
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.24em;
}
@media (hover: hover) {
  .minigame :where(.w:hover) { text-decoration-color: currentColor; }
}
/* A word the audit DEFUSED (it was inside a control) is plain text again — it
   keeps the marker class purely so a probe can find it, and must look like
   nothing at all. */
.minigame .w-off { text-decoration: none; cursor: inherit; }
/* Reduced motion says nothing about underlines; forced-colors does — let the
   OS palette own it there rather than shipping a colour it can't see. */
@media (forced-colors: active) {
  .minigame :where(.w) { text-decoration-color: currentColor; }
}

/* the "characters are tappable" note, stamped onto the manual's book by
   minigames.js (stampReadNote) so every drill says it once, on the one page
   every drill shows on first play. Quiet: one line, small, dim, no border. It
   sits below the actions and must not push the book past a phone screen —
   ftue-verify.mjs asserts the book fits 375x812. */
.dm-book .dk-readnote {
  margin: -2px 0 0; flex: none; text-align: center; font-size: 11px; line-height: 1.3;
  color: var(--dk-ink-soft, rgba(36, 19, 53, 0.68)); letter-spacing: 0.01em; opacity: 0.9;
}
.dm-book .dk-readnote b.han { font-size: 12px; color: var(--dk-ink, #241335); font-weight: 800; }

/* the title names the game; the board teaches the next move. */
.minigame.dk-drill > .mg-head,
:root[data-theme="light"] .minigame.dk-drill > .mg-head {
  border-width: 1px; border-radius: 10px; box-shadow: none; padding: 8px 12px;
  gap: 8px 12px;
}
.minigame.dk-drill > .mg-head > span:not(.mg-score) { display: none; }
.minigame.dk-drill > .mg-head b.han { font-family: var(--han); }
.minigame.dk-drill > .mg-head .tool { min-width: 44px; min-height: 44px; box-shadow: none; }
