/* LAWS:
   - design only. Every rule here decides how a COSTUME looks and nothing about what it says, what
     it measures, or when it appears. A presenter names classes; this sheet owns the paint.
   - colours come from ui/kit tokens — there is not one hex in this file, so all four looks restyle
     the costume layer without opening it. Geometry comes from the --mg* raw tokens.
   - M22: pressed · armed · right · wrong each carry a SHAPE or a MARK as well as a colour. Every
     ::after in this sheet exists for that reason and none of them is decoration.
   - A126: .mg-bat is absolutely positioned inside .card (which is already relative + overflow:hidden)
     and is pointer-events:none except for the beat card. Battle chrome may NEVER add layout height —
     a phone session column that scrolls is the defect this whole clause exists to prevent.
   History: NOTES.md */

/* ══ SHARED ═════════════════════════════════════════════════════════════════════════════════════ */
.mg{ font-family:var(--fbody); }
.mg-sheep, .mg-fly{ display:block; }

@keyframes mgwob{ 0%,100%{ transform:translateX(0) } 25%{ transform:translateX(-.28rem) } 75%{ transform:translateX(.28rem) } }
@keyframes mgpop{ 0%{ transform:scale(1) } 45%{ transform:scale(1.14) } 100%{ transform:scale(1) } }
@keyframes mgin { from{ opacity:0; transform:translateY(.6rem) } to{ opacity:1; transform:none } }
@keyframes mgglow{ 0%,100%{ opacity:.55 } 50%{ opacity:1 } }

/* ══ SHEEP SORT — skins the `sort` step ═════════════════════════════════════════════════════════
   The flock at the top, the pens below. It is the plain sort's own two-tap shape wearing a field:
   the chips are the same size and the same type scale, so nothing about the reading load moves. */
.mg-flock{
  display:flex; flex-wrap:wrap; justify-content:center; gap:var(--mgGap);
  min-height:var(--mgTap); margin-bottom:var(--mgPad);
}
.mg-pens{ display:flex; gap:var(--mgGap); align-items:stretch; }
.mg-pens[data-n="2"] > *{ flex:1 1 0; }

.mg-sh{
  position:relative; display:inline-flex; align-items:center; gap:.35rem;
  min-height:var(--mgTap); padding:.3rem .7rem .3rem .45rem;
  font-family:var(--fdisp); font-weight:900; font-size:var(--fqm); color:var(--tileInk);
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  border:none; border-radius:var(--mgPill); cursor:pointer;
  box-shadow:inset 0 -2px 0 var(--tileEdge), var(--float-drop);
  transition:transform .09s ease, box-shadow .09s ease;
}
/* the sheep itself: a woolly disc with a face-side notch. Drawn, not an asset — one more png for a
   shape this simple is a download a child pays for and never sees. */
.mg-shb{
  width:1.35rem; height:1.35rem; border-radius:var(--mgPill); flex:0 0 auto;
  background:radial-gradient(circle at 35% 30%, var(--parchLit), var(--parch2));
  box-shadow:inset 0 0 0 var(--trHair) var(--parchInk2);
}
.mg-shw{ white-space:nowrap; }

/* PICKED UP — M22: it lifts (shape), it rings (colour), and it grows a caret (mark). */
.mg-sh.sel{ transform:translateY(-.25rem); box-shadow:inset 0 -2px 0 var(--tileEdge), var(--elev-chip-sel); }
.mg-sh.sel::after{
  content:'▲'; position:absolute; left:50%; bottom:-.9rem; transform:translateX(-50%);
  font-size:var(--fqb); line-height:1; color:var(--goldInk);
}
.mg-sh.in{ font-size:var(--fqb); min-height:auto; padding:.2rem .55rem .2rem .3rem; }
.mg-sh.in .mg-shb{ width:1rem; height:1rem; }

/* SETTLED — the only place right and wrong are drawn, and both carry a mark. */
.mg-sh.settled{ cursor:default; }
.mg-sh.ok{ background:linear-gradient(180deg,var(--okHi),var(--okLo)); box-shadow:inset 0 -2px 0 var(--okEdge), var(--float-drop); }
.mg-sh.ok::after{ content:'✓'; margin-left:.2rem; color:var(--tileOkInk); font-size:var(--fqb); }
.mg-sh.no{ background:linear-gradient(180deg,var(--tileDimHi),var(--tileDimLo)); box-shadow:inset 0 -2px 0 var(--tileDimEdge), var(--float-drop); }
.mg-sh.no::after{ content:'↺'; margin-left:.2rem; color:var(--goldInk); font-size:var(--fqb); }

.mg-pen{
  position:relative; display:flex; flex-direction:column; align-items:center; gap:.3rem;
  min-height:calc(var(--mgTap) * 2); padding:var(--mgPad) .5rem .6rem;
  background:linear-gradient(180deg,var(--shelfHi),var(--shelfLo));
  border:var(--mgRule) solid transparent; border-radius:var(--mgRsm);
  color:var(--ink); font-family:var(--fbody); cursor:pointer; text-align:center;
  box-shadow:var(--elev-shelf);
}
/* the rail across the top of a pen — the thing that makes it read as a pen and not as a box */
.mg-penrail{
  position:absolute; left:.5rem; right:.5rem; top:.35rem; height:var(--mgRule);
  background:repeating-linear-gradient(90deg, var(--line) 0, var(--line) .6rem, transparent .6rem, transparent 1rem);
}
/* ARMED — M22: dashed edge (shape) as well as the gold (colour) */
.mg-pen.armed{ border-color:var(--goldInk); border-style:dashed; }
.mg-penl{ font-size:var(--fqb); font-weight:800; line-height:1.25; }
.mg-penin{ display:flex; flex-wrap:wrap; justify-content:center; gap:.3rem; width:100%; }
.mg-penin[data-empty]:empty::before{ content:attr(data-empty); font-size:var(--fqb); color:var(--mut); opacity:.7; }
.mg-sheep.over .mg-sh{ pointer-events:none; }

/* ══ FIREFLY TRAIL — skins the show-then-hide `flash` serving ═══════════════════════════════════
   The word is the app's word at the app's own type scale (--fqw). The costume is the light around
   it and the caption under it; the ROOM the word occupies does not change when it goes, which is
   what stops the card jumping on a timer the child did not cause. */
.mg-fly{ position:relative; text-align:center; }
.mg-flyw{
  font-family:var(--fdisp); font-weight:900; font-size:var(--fqw); color:var(--wordInk);
  letter-spacing:.5px; line-height:1.15; min-height:1.15em;
  text-shadow:var(--glow-misswant);
  transition:opacity var(--mgBeat) ease;
}
.mg-fly.gone .mg-flyw{ opacity:0; }
.mg-flybug{
  position:absolute; left:50%; top:-.2rem; width:var(--mgFlyBug); height:var(--mgFlyBug);
  border-radius:var(--mgPill); transform:translateX(-50%);
  background:radial-gradient(circle at 50% 45%, var(--goldL), var(--gold) 55%, transparent 72%);
  animation:mgglow 1.6s ease-in-out infinite;
}
.mg-fly.gone .mg-flybug{ animation:none; opacity:0; transition:opacity var(--mgBeat) ease; }
.mg-flycap{ margin-top:.35rem; font-size:var(--fqb); color:var(--mut); min-height:1.3em; }
.mg-fly.no .mg-flyw{ animation:mgwob var(--mgWobble) ease; }
.mg-fly.ok .mg-flybug{ animation:mgpop var(--mgBeat) ease; opacity:1; }

/* ══ LANTERN NIGHT — the second `sort` costume ═══════════════════════════════════════════════════
   The same two-tap shape at half the volume. A lantern is UNLIT in the bank and on the post; it
   lights only when the host says the placement was right, and — this is the whole of the no-fail law
   in this costume — no rule in this sheet turns one off again. */
.mg-lbank{
  display:flex; flex-wrap:wrap; justify-content:center; gap:var(--mgGap);
  min-height:var(--mgTap); margin-bottom:var(--mgPad);
}
.mg-posts{ display:flex; gap:var(--mgGap); align-items:stretch; }
.mg-posts[data-n="2"] > *{ flex:1 1 0; }

.mg-lan{
  position:relative; display:inline-flex; align-items:center; gap:.35rem;
  min-height:var(--mgTap); padding:.3rem .7rem .3rem .45rem;
  font-family:var(--fdisp); font-weight:900; font-size:var(--fqm); color:var(--tileInk);
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  border:none; border-radius:var(--mgRsm); cursor:pointer;
  box-shadow:inset 0 -2px 0 var(--tileEdge), var(--float-drop);
  transition:transform .09s ease, box-shadow .09s ease;
}
/* the lantern body: a dark glass box with a ring on top. Unlit is the resting state, deliberately. */
.mg-lanb{
  position:relative; width:1.1rem; height:1.35rem; flex:0 0 auto; border-radius:.25rem .25rem .35rem .35rem;
  background:linear-gradient(180deg,var(--well),var(--card2));
  box-shadow:inset 0 0 0 var(--trHair) var(--line);
}
.mg-lanb::before{
  content:''; position:absolute; left:50%; top:-.3rem; width:.5rem; height:.35rem;
  transform:translateX(-50%); border:var(--trHair) solid var(--line); border-bottom:none;
  border-radius:.3rem .3rem 0 0;
}
.mg-lanw{ white-space:nowrap; }
/* …AND THE GLASS IS NOT DRAWN ON THE CHIPS ANY MORE (owner, 2026-10-04, on the sort: "what are these symbols next to
   the words? I don't think we need them"). An unlit lantern beside every word read as an unexplained icon, not as
   a lantern. The chips are the words alone; a sorted one still says what happened with a MARK as well as colour
   (✦ lit, ↺ moved — M22), and the posts, the dusk and the light coming on keep the costume's quiet temperature. */
.mg-lanb{ display:none !important; }
.mg-lan.sel{ transform:translateY(-.25rem); box-shadow:inset 0 -2px 0 var(--tileEdge), var(--elev-chip-sel); }
.mg-lan.sel::after{
  content:'▲'; position:absolute; left:50%; bottom:-.9rem; transform:translateX(-50%);
  font-size:var(--fqb); line-height:1; color:var(--goldInk);
}
.mg-lan.hung{ font-size:var(--fqb); min-height:auto; padding:.2rem .55rem .2rem .3rem; }
.mg-lan.hung .mg-lanb{ width:.85rem; height:1.05rem; }
.mg-lan.settled{ cursor:default; }
/* LIT — M22: the glass fills (colour), it glows (light) AND it grows a flame (mark). */
.mg-lan.lit .mg-lanb{ background:radial-gradient(circle at 50% 60%, var(--goldL), var(--gold) 70%); box-shadow:var(--glow-misswant); }
.mg-lan.lit::after{ content:'✦'; margin-left:.2rem; color:var(--goldInk); font-size:var(--fqb); }
/* MOVED — it walked to its own post and lit there. Never "wrong", never dark. */
.mg-lan.moved::after{ content:'↺'; margin-left:.2rem; color:var(--goldInk); font-size:var(--fqb); }
.mg-lan.moved .mg-lanb{ background:linear-gradient(180deg,var(--tileDimHi),var(--tileDimLo)); }

.mg-post{
  position:relative; display:flex; flex-direction:column; align-items:center; gap:.3rem;
  min-height:calc(var(--mgTap) * 2); padding:var(--mgPad) .5rem .6rem;
  background:linear-gradient(180deg,var(--shelfHi),var(--shelfLo));
  border:var(--mgRule) solid transparent; border-radius:var(--mgRsm);
  color:var(--ink); font-family:var(--fbody); cursor:pointer; text-align:center;
  box-shadow:var(--elev-shelf);
}
/* the crossbar the lanterns hang from — one solid rule, where a pen's rail is dashed */
.mg-posthook{ position:absolute; left:.5rem; right:.5rem; top:.35rem; height:var(--mgRule); background:var(--line); }
.mg-post.armed{ border-color:var(--goldInk); border-style:dashed; }
.mg-postl{ font-size:var(--fqb); font-weight:800; line-height:1.25; }
.mg-postin{ display:flex; flex-wrap:wrap; justify-content:center; gap:.3rem; width:100%; }
.mg-postin[data-empty]:empty::before{ content:attr(data-empty); font-size:var(--fqb); color:var(--mut); opacity:.7; }
.mg-lant.over .mg-lan{ pointer-events:none; }

/* ══ GOLEM RUNE-SORT — the `sort` costume for the morphology band ════════════════════════════════
   Drawn, not downloaded: the golem is three boxes and two eyes out of the same tokens the rest of
   the app uses. He wakes at the END of the round (the .awake class) and not one moment earlier —
   nothing in this costume reacts to a single placement, because a single placement is not a verdict. */
.mg-rbank{
  display:flex; flex-wrap:wrap; justify-content:center; gap:var(--mgGap);
  min-height:var(--mgTap); margin-bottom:var(--mgPad);
}
.mg-rune{
  position:relative; min-height:var(--mgTap); padding:.3rem .7rem;
  font-family:var(--fdisp); font-weight:900; font-size:var(--fqm); color:var(--tileInk);
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  border:var(--trHair) solid var(--tileEdge); border-radius:.2rem; cursor:pointer;
  box-shadow:inset 0 -2px 0 var(--tileEdge), var(--float-drop);
  transition:transform .09s ease, box-shadow .09s ease;
}
.mg-rune.sel{ transform:translateY(-.25rem); box-shadow:inset 0 -2px 0 var(--tileEdge), var(--elev-chip-sel); }
.mg-rune.sel::after{
  content:'▲'; position:absolute; left:50%; bottom:-.9rem; transform:translateX(-50%);
  font-size:var(--fqb); line-height:1; color:var(--goldInk);
}
.mg-rune.set{ font-size:var(--fqb); min-height:auto; padding:.2rem .5rem; }
.mg-rune.settled{ cursor:default; }
.mg-rune.ok{ background:linear-gradient(180deg,var(--okHi),var(--okLo)); box-shadow:inset 0 -2px 0 var(--okEdge), var(--float-drop); }
.mg-rune.ok::after{ content:'✓'; margin-left:.2rem; color:var(--tileOkInk); font-size:var(--fqb); }
.mg-rune.moved{ background:linear-gradient(180deg,var(--tileDimHi),var(--tileDimLo)); box-shadow:inset 0 -2px 0 var(--tileDimEdge), var(--float-drop); }
.mg-rune.moved::after{ content:'↺'; margin-left:.2rem; color:var(--goldInk); font-size:var(--fqb); }

.mg-gbody{
  position:relative; padding:var(--mgPad) .5rem .6rem;
  background:linear-gradient(180deg,var(--shelfHi),var(--shelfLo));
  border-radius:var(--mgRsm); box-shadow:var(--elev-shelf);
}
/* two eyes on a stone brow. They light with the chest, so "awake" is a shape change and not a hue. */
.mg-gface{
  display:block; height:1.1rem; margin:0 auto .4rem; width:3.2rem; border-radius:var(--mgPill);
  background:var(--well); box-shadow:inset 0 0 0 var(--trHair) var(--line);
  position:relative;
}
.mg-gface::before, .mg-gface::after{
  content:''; position:absolute; top:.35rem; width:.4rem; height:.4rem; border-radius:var(--mgPill);
  background:var(--mut);
}
.mg-gface::before{ left:.7rem; } .mg-gface::after{ right:.7rem; }
.mg-golem.awake .mg-gface::before, .mg-golem.awake .mg-gface::after{ background:var(--goldInk); box-shadow:var(--glow-misswant); }
.mg-chest{ display:flex; gap:var(--mgGap); align-items:stretch; }
.mg-chest[data-n="2"] > *{ flex:1 1 0; }
.mg-slot{
  display:flex; flex-direction:column; align-items:center; gap:.3rem;
  min-height:var(--mgSlot); padding:.4rem .4rem .5rem;
  background:var(--well); color:var(--ink); font-family:var(--fbody); text-align:center;
  border:var(--mgRule) solid transparent; border-radius:.3rem; cursor:pointer;
  box-shadow:inset 0 0 0 var(--trHair) var(--line);
}
.mg-slot.armed{ border-color:var(--goldInk); border-style:dashed; }
.mg-slotl{ font-size:var(--fqb); font-weight:800; line-height:1.25; }
.mg-slotin{ display:flex; flex-wrap:wrap; justify-content:center; gap:.3rem; width:100%; }
.mg-slotin[data-empty]:empty::before{ content:attr(data-empty); font-size:var(--fqb); color:var(--mut); opacity:.7; }
.mg-golem.over .mg-rune{ pointer-events:none; }

/* ══ PIP'S PARCELS — skins the `cloze` step ══════════════════════════════════════════════════════
   TWO LAWS SHAPE EVERY RULE BELOW.
   ① THE BOX IS #cloze's BOX. Font, line-height, padding, margin and cap all come from the --mgPc*
     tokens, which mirror the plain carrier's own. This costume stands in the session column, and
     A126 says that column never scrolls on a phone: the skin may repaint the box, never resize it.
   ② EVERY PIECE OF CHROME IS ABSOLUTE. The dashed frame, the TO: stamp and the wax seal are all out
     of flow, so the parcel adds exactly zero height to the card.
   And the gap has a FIXED minimum width that has nothing to do with the answer: sizing it from the
   word would leak the letter count on the one step kind whose whole job is retrieval. */
.mg-parcel{ position:relative; }
.mg-pbox{
  position:relative;
  font-size:var(--mgPcFont); font-weight:700; line-height:var(--mgPcLine); text-align:center;
  max-width:var(--mgPcMax); margin:var(--mgPcMar); padding:var(--mgPcPad);
  border-radius:var(--mgR); color:var(--parchInk);
  background:linear-gradient(180deg,var(--parchHi),var(--parch2));
}
/* the dashed edge, drawn OUTSIDE the box's own padding and costing nothing in flow */
.mg-pbox::before{
  content:''; position:absolute; inset:0; pointer-events:none;
  border:var(--mgRule) dashed var(--parchInk2); border-radius:inherit;
}
.mg-paddr{ display:block; }
.mg-pgap{
  /* A CLONE OF #cloze .gap's METRICS, and the differences are all paint. No display font (its taller
     ascent raises the line box), and the rule under the blank is an INSET shadow rather than a border
     — a border on an inline-block is 2px of extra line height, and there were none going spare. */
  display:inline-block; min-width:var(--mgGapMin); padding:0 .625rem;
  font-weight:900; color:var(--parchInk2); border-radius:.3rem;
  box-shadow:inset 0 calc(-1 * var(--mgRule)) 0 var(--parchInk2);
}
.mg-pgap.has{ color:var(--parchInk); }
/* THE SEAL IS SCENERY, and it straddles the parcel's edge the way a wax seal straddles a flap. It
   was briefly the send button, with the app's ✓ hidden behind it; that made the cloze the one typing
   step in the app without a ✓, which A120 caught the moment costumes became the default. Absolute,
   so it costs the card nothing either way. */
.mg-pseal{
  position:absolute; right:.1rem; bottom:-.7rem;
  display:grid; place-items:center;
  width:var(--mgSeal); height:var(--mgSeal); border-radius:var(--mgPill);
  background:radial-gradient(circle at 40% 35%, var(--goldL), var(--goldD));
  box-shadow:0 2px 0 var(--shadeSoft);
  opacity:.55; transform:scale(.86);
  transition:transform var(--mgBeat) ease, opacity var(--mgBeat) ease;
}
/* SENT — M22: the seal presses down (shape), fills (colour) AND grows its stamp (mark). */
.mg-parcel.sent .mg-pseal{ opacity:1; transform:scale(1.05) rotate(-8deg); }
.mg-parcel.sent .mg-pseal::after{ content:'✦'; color:var(--parchInk); font-size:var(--fqb); }
.mg-parcel.sent .mg-pbox::before{ border-style:solid; }
.mg-parcel.no .mg-pbox{ animation:mgwob var(--mgWobble) ease; }
/* the blank travels with its neighbours, exactly as it does in the plain carrier (index.html
   `#cloze .gapgrp`, law A126 ⑪). Scoped to the address so it cannot reach anything else. */
.mg-paddr .gapgrp{ white-space:nowrap; }
/* …AND THE PHONE'S SIX PIXELS. index.html trims #cloze's BOTTOM padding at 560px (P9 R③: the top
   padding may not move because the float that keeps the speaker's corner clear is a line deep, so the
   air comes off the bottom). The mirror has to carry that too — those six pixels were the difference
   between a costumed cloze that fits a 360×740 phone and one that scrolls it, measured. */
@media (max-width:35em){
  .mg-pbox{ padding:var(--mgPcPadSm); }
}
/* …AND THE PORTRAIT PHONE'S WHOLE SIDE INSET (QUEST-TOP-SPEC §3③). Below 420px in portrait the
   teacher stands beside the sentence and index.html drops #cloze's left/right padding and its auto
   margins outright — the mascot's 90px indent is doing that job now. Law ① is that this box is
   #cloze's box, so it drops them too. It has to come after the 35em step to win: same specificity,
   later rule. */
@media (orientation:portrait) and (max-width:440px){
  .mg-pbox{ padding:var(--mgPcPadPh); margin:var(--mgPcMarPh); max-width:none; }
}

/* ══ THE BATTLE — skins a boss sub-spot fight ═══════════════════════════════════════════════════
   ABSOLUTE, INSET, POINTER-EVENTS OFF. This is the whole of the A126 compliance: the overlay is
   laid over the card that already exists, adds no height to it, and cannot swallow a tap meant for
   the word underneath. The one exception is the beat card, which is a real dialogue.
   THE FIGURE STANDS IN THE TEACHER'S SPOT (handover §6B, owner 2026-10-20, "placement A"): the host lends
   battle.js the teacher's face box and the DOCK moves into it, out of this overlay. So every rule for the
   figure is written against `.mg-batdock` and the state battle.js mirrors onto it, never against
   `.mg-bat` above it — a selector through the overlay would stop matching the moment he is lent a stand. */
.mg-bat{ position:absolute; inset:0; pointer-events:none; z-index:3; }
.mg-bat, .mg-batdock{ --mgshrunk:calc(1 - var(--mgShrink) * var(--mgstep, 0)); }
.mg-ink{ position:absolute; inset:0; }
/* A SPLAT ON THE SIGN (2026-10-20). "Someone has smudged all the signs!" — so the ink is ON the place's sign,
   the level cue at the top of the card, and never on the work: the old per-cent spots put grey bubbles over
   the keys, the ask row and Done on a phone. --mgsx/--mgsy/--mgsw/--mgsh are the sign's box, measured by
   battle.js; --mgfx/--mgfy are where on it this splat lies, as fractions; --mgrot how it lies. */
.mg-blob{
  position:absolute;
  left:calc(var(--mgsx, 0px) + var(--mgfx, .5) * var(--mgsw, 0px));
  top:calc(var(--mgsy, 0px) + var(--mgfy, .5) * var(--mgsh, 0px));
  width:var(--mgSplatSm); height:var(--mgSplatSm);
  margin:calc(var(--mgSplatSm) / -2) 0 0 calc(var(--mgSplatSm) / -2);
  transform:rotate(var(--mgrot, 0deg));
  transition:opacity var(--mgBeat) ease, transform var(--mgBeat) ease;
}
.mg-blobink{ display:block; width:100%; height:100%; }
/* CLEANED — it does not merely fade: it lifts off the sign as it goes, and battle.js throws its ink as it
   does, because a sign coming clean is the one reward this fight has and a fade is not one. M22: the state is
   a SHAPE gone from the sign, never only a colour changed. */
.mg-blob.clean{ opacity:0; transform:rotate(var(--mgrot, 0deg)) translateY(-.7rem) scale(.35); }

/* ── THE STORM (the second framing; spec §7.1) ────────────────────────────────────────────────
   TWO WEATHER LAYERS AND A RACK OF LAMPS, all off the SAME --mgstep the figure shrinks on. The veil
   and the rain step DOWN as lamps light, so the storm weakening and the progress rising are one
   number drawn three ways — they cannot disagree, and there is no state in which the weather worsens.
   `--mgleft` is that fraction: 1 at the start, 0 when the last lamp is lit. */
.mg-bat[data-mark="lamp"]{ --mgleft:calc(1 - var(--mgstep, 0) / var(--mgtot, 1)); }
.mg-veil{
  position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg, var(--shade), var(--shadeSoft));
  opacity:calc(var(--mgVeil) * var(--mgleft));
  transition:opacity var(--mgBeat) ease;
}
.mg-rain{
  position:absolute; inset:0; pointer-events:none; overflow:hidden;
  background:repeating-linear-gradient(74deg, var(--line) 0, var(--line) var(--trHair), transparent var(--trHair), transparent .55rem);
  opacity:calc(var(--mgRain) * var(--mgleft));
  transition:opacity var(--mgBeat) ease;
  animation:mgrain 1.1s linear infinite;
}
@keyframes mgrain{ from{ background-position:0 0 } to{ background-position:-1.2rem 2.4rem } }

/* THE RACK, ON THE SIGN like the Smudge's splats (2026-10-20; it stood over the bottom-left keys on a phone).
   A lamp is dark glass until it is lit and there is NO RULE IN THIS SHEET THAT UNLIGHTS ONE — the same
   absence that keeps the splotch bar from ever shortening. Lit carries a flame mark as well as the colour
   and the glow (M22). */
.mg-rack{
  position:absolute;
  left:calc(var(--mgsx, 0px) + var(--mgsw, 0px) / 2); top:calc(var(--mgsy, 0px) + var(--mgsh, 0px) / 2);
  transform:translate(-50%, -50%);
  display:flex; gap:.3rem; align-items:flex-end;
}
.mg-lamp{
  position:relative; display:block; width:var(--mgLamp); height:calc(var(--mgLamp) * 1.3);
  border-radius:.2rem .2rem .3rem .3rem;
  background:linear-gradient(180deg,var(--well),var(--card2));
  box-shadow:inset 0 0 0 var(--trHair) var(--line);
  transition:background var(--mgBeat) ease, box-shadow var(--mgBeat) ease;
}
.mg-lamp.lit{
  background:radial-gradient(circle at 50% 60%, var(--goldL), var(--gold) 70%);
  box-shadow:var(--glow-misswant);
}
.mg-lamp.lit::after{
  content:'✦'; position:absolute; left:50%; top:-.75rem; transform:translateX(-50%);
  font-size:var(--fqb); line-height:1; color:var(--goldInk);
}

.mg-batchip{
  position:absolute; left:50%; top:0; transform:translateX(-50%);
  display:inline-flex; align-items:baseline; gap:.4rem; max-width:100%;
  padding:.2rem .7rem; border-radius:var(--mgPill);
  background:var(--pill); color:var(--ink);
  font-size:var(--fqb); letter-spacing:.6px; white-space:nowrap;
}
.mg-batchip b{ font-family:var(--fdisp); font-weight:900; color:var(--goldInk); }
.mg-batplace{ color:var(--mut); }

.mg-batprog{
  position:absolute; left:50%; top:1.9rem; transform:translateX(-50%);
  display:flex; align-items:center; gap:.45rem; font-size:var(--fqb); color:var(--mut);
}
.mg-batbar{
  display:block; width:6rem; height:var(--mgBar); border-radius:var(--mgPill);
  background:var(--well); box-shadow:inset 0 0 0 var(--trHair) var(--line); overflow:hidden;
}
/* IT ONLY EVER FILLS. There is no rule in this sheet that shortens it, and none may be added:
   boss health that falls is the no-fail law broken (spec §1). */
.mg-batbar i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--goldD),var(--gold)); transition:width var(--mgBeat) ease; }
/* …AND IN THE APP THE SIGN IS THE BAR. Docked, the title is the level cue's own words and the count is the
   splats on it, so the chip and the bar would only be a second copy drawn over the cue (they sat on top of it
   on every layout, measured 2026-10-20). The lab has no cue, and keeps both. */
.mg-bat[data-docked="1"] .mg-batchip, .mg-bat[data-docked="1"] .mg-batprog{ display:none; }

/* THE DOCK — the figure's own box. Undocked (the lab, or no stand) it stands where the sprite always stood,
   bottom-right of the card; docked it fills the teacher's face box, which app.js makes its containing block. */
.mg-batdock{
  position:absolute; right:.4rem; bottom:.4rem;
  width:var(--mgArtSm); height:var(--mgArtSm);
  pointer-events:none;
}
.mg-batdock[data-docked="1"]{ left:0; top:0; right:0; bottom:0; width:auto; height:auto; z-index:1; }
/* THE SHRINK LIVES ON THE WRAPPER and the beats' animations on the still inside it. Both used to be one
   element's `transform`, so a giggle's keyframes replaced the shrink for their half second and he snapped
   back to full size on every miss. Now they compose: the wrapper is smaller, the still inside it wobbles.
   The dial is at 0 since v486 (tokens.raw.css --mgShrink, the owner's ruling): the painted Smudge keeps his size all
   fight. The wrapper still reads it, so turning it back up is one number. */
.mg-batfig{
  position:absolute; left:0; right:0; bottom:0; height:min(100%, var(--mgBossCap));
  transform-origin:50% 100%; transform:scale(var(--mgshrunk));
  opacity:0; transition:opacity var(--mgIntro) ease, transform var(--mgBeat) ease;
}
/* the INTRO, and the owner's reservation answered: the smudges are on the sign first and the Smudge
   himself arrives afterwards. state=intro means he is not here yet. */
.mg-batdock[data-state="fight"] .mg-batfig{ opacity:1; }
/* the keeper stands still through it. She does not shrink — a lighthouse keeper is not the enemy, and
   the framing that treats the weather as the opponent has nobody in it to diminish. */
.mg-batdock[data-mark="lamp"] .mg-batfig{ transform:none; }
/* PAINTED, NEVER PIXELATED, NEVER STRETCHED (the delivery contract). The STAGE is the frame drawn whole at its own
   shape, standing on the floor of the box — battle.js sizes it, because `contain` is what a background cannot do —
   and each face is a STRIP of frames side by side as that stage's background, stepped one frame at a time. One face is
   shown; the others wait, already loaded. */
.mg-batstage{ position:absolute; bottom:0; }
.mg-batsprite{
  position:absolute; inset:0;
  background-repeat:no-repeat;
  opacity:0;
}
.mg-batsprite.on{ opacity:1; }
/* A STILL GETS A CSS BEAT; A PAINTED STRIP DOES NOT (2026-10-20). The pop on a right word and the wobble on a giggle gave
   one picture some life. Under a painted reaction they read as glitches — the pop scaled him 14% about his middle, so his
   feet sank below the floor on every right word, and the wobble slid his feet sideways under a painted giggle (the owner:
   "occasional shift of position, and a few times his size changes"). A still's pop grows from its feet. */
.mg-batdock[data-anim="still"] .mg-batsprite{ transform-origin:50% 100%; }
.mg-batdock[data-anim="still"].giggle .mg-batsprite.on{ animation:mgwob var(--mgWobble) ease 2; }
.mg-batdock[data-anim="still"].hit .mg-batsprite.on{ animation:mgpop var(--mgBeat) ease; }

/* THE MESS (owner, 2026-10-20: "messier and messier if they make more mistakes, but a little bit messy even if they
   get everything right"). His ink, landing where his flicks would — on the card's edges, at his feet, in the empty
   corners of his box — and never on the work: battle.js drops any slot that would touch what the host keeps clear.
   It is decoration and never progress, so it has no rule that counts anything, and the win wipes it all away. */
.mg-mess{ position:absolute; inset:0; pointer-events:none; }
.mg-messpiece{
  position:absolute; width:calc(var(--mgMess) * var(--mgmk, 1)); height:calc(var(--mgMess) * var(--mgmk, 1));
  margin:calc(var(--mgMess) * var(--mgmk, 1) / -2) 0 0 calc(var(--mgMess) * var(--mgmk, 1) / -2);
  transform:rotate(var(--mgrot, 0deg)); opacity:.92;
  animation:mgland .34s cubic-bezier(.2, 1.4, .4, 1) both;
  transition:opacity var(--mgIntro) ease, transform var(--mgIntro) ease;
}
.mg-messpiece.gone{ opacity:0; transform:rotate(var(--mgrot, 0deg)) scale(.4); }
@keyframes mgland{
  0%{ opacity:0; transform:rotate(var(--mgrot, 0deg)) scale(.2); }
  60%{ opacity:1; transform:rotate(var(--mgrot, 0deg)) scale(1.14, .88); }
  100%{ opacity:.92; transform:rotate(var(--mgrot, 0deg)) scale(1); }
}

.mg-batline{
  position:absolute; left:0; right:0; bottom:.2rem; text-align:center;
  font-size:var(--fqb); color:var(--mut); padding:0 var(--mgArtSm);
}
.mg-bat[data-docked="1"] .mg-batline{ padding:0 var(--mgPad); }
/* ON A PHONE THE KEYBOARD IS THE CARD'S FLOOR, so the narration line stood on its bottom row of keys (measured
   2026-10-20 at 390x844). Docked, his face says what the line said — a snicker IS "the Smudge giggles" — so the
   line steps out there; the cards at the end still say everything in words. */
@media (orientation:portrait) and (max-width:37.5em){
  .mg-bat[data-docked="1"] .mg-batline{ display:none; }
}
.mg-batwon{
  /* painted art is never drawn pixelated (house style); battle.js gives it the @800/@1440 tiers (launch board #110) */
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  border-radius:inherit;
  animation:mgin var(--mgIntro) ease both;
}

/* THE BEAT CARD — parchment on a night app, deliberately: it is the world speaking rather than the
   game, and every other parchment surface here (the trophy map, the certificate) means the same. */
.mg-batcard{
  /* CENTRED BY `translate`, NOT `transform` (2026-10-20). The card arrives on `mgin`, whose last keyframe is
     `transform:none` and whose fill is `both` — so a `transform:translate(-50%,-50%)` here was replaced the moment
     the card appeared, and every beat card stood with its LEFT edge on the card's middle, half off a phone's
     screen (measured at 390x844: the rematch and the valve alike). The individual property composes with the
     animation instead of losing to it. */
  position:absolute; left:50%; top:50%; translate:-50% -50%;
  width:min(92%, 26rem); pointer-events:auto;
  padding:var(--mgPad) 1.1rem 1rem; border-radius:var(--mgR);
  background:linear-gradient(180deg,var(--parchHi),var(--parch2));
  border:var(--mgRule) solid var(--parchInk2); color:var(--parchInk);
  box-shadow:0 1.4rem 3rem -1rem var(--shadeSoft);
  animation:mgin var(--mgIntro) ease both;
  text-align:center;
}
/* HIS FACE ON THE CARD, standing on its top edge: the shrug that concedes the win, the snicker of the
   rematch, the sleepy one who oozed away. The card covers where he stood, so the card is where he is. */
.mg-batportrait{
  display:block; height:var(--mgPortrait); width:auto; max-width:80%;
  margin:calc(var(--mgPortrait) * -.66) auto .3rem;
  background-repeat:no-repeat;
}
/* …and on a win he slips off it, trailing ink (battle.js throws the drops) */
.mg-batportrait.slip{ animation:mgslip .75s ease-in forwards; }
@keyframes mgslip{ 0%{ transform:none; opacity:1 } 22%{ transform:translateX(.35rem) } 100%{ transform:translateX(-11rem) rotate(-7deg); opacity:0 } }
.mg-batp{ margin:0 0 .5rem; font-size:var(--fqb); line-height:1.4; }
.mg-batlead{ font-family:var(--fdisp); font-weight:900; font-size:var(--fqm); }
.mg-batrow{ display:flex; flex-wrap:wrap; justify-content:center; gap:var(--mgGap); margin-top:.7rem; }

/* ══ PATTERNSMITH — skins the `forge` surface (the word builder) ═════════════════════════════════
   IT STANDS WHERE THE PLAIN ROWS STOOD, so every metric below is the plain builder's own, through
   the --mgSm* tokens: a slot is .fslot's height, a stock piece is .fchunk's, and the two rows keep
   #buildslots' and #buildbank's min-heights and margins. That is not tidiness — this costume takes
   layout height in the session column (the exercise is a row of tap targets; it cannot overlay), so
   the ONLY way it can honour A126 is to be the same size as what it replaced. Measured, both phones.

   THE LOOK IS STONE AND RUNE, sharing TOKENS with the golem and not one line of its code (spec §8.1).
   A smithy at the morphology stages should feel like the same world the rune tablets come from; the
   way to get that is the palette, which is what ui/kit is for. */
.mg-smith{ display:block; }
.mg-anvil{
  display:flex; gap:.5rem; justify-content:center; flex-wrap:wrap;
  margin:14px 0 6px; min-height:var(--mgSmSlotRow);
}
.mg-bench{
  display:flex; gap:.62rem; justify-content:center; flex-wrap:wrap;
  margin:12px 0 4px; min-height:var(--mgSmStockRow);
  border-radius:var(--mgSmR); border:var(--mgRule) dashed transparent; padding:4px;
}
/* THE ANVIL'S SPACES. An empty one is a dashed outline — the plain .fslot's own idea, kept because a
   drop slot with no perceivable edge is not a slot (M22, index.html's own words). */
.mg-smithslot{
  position:relative; min-width:var(--mgSmMinW); height:var(--mgSmSlotH); padding:0 10px;
  display:flex; align-items:center; justify-content:center;
  background:none; color:var(--ink); cursor:default;
  font-family:var(--fdisp); font-weight:900; font-size:var(--mgSmFont); letter-spacing:1px;
  border:var(--mgRule) dashed var(--line); border-radius:var(--mgSmR);
  transition:transform .1s ease, border-color .1s ease;
}
/* WHERE THE NEXT PIECE GOES — M22: the edge changes colour AND the space grows a caret. */
.mg-smithslot.next{ border-color:var(--gold); }
.mg-smithslot.next::after{
  content:'▾'; position:absolute; left:50%; top:-.85rem; transform:translateX(-50%);
  font-size:var(--fqb); line-height:1; color:var(--goldInk);
}
/* FORGED IN — solid edge, filled ground, a raised lip. Shape first, colour second. */
.mg-smithslot.set{
  border-style:solid; border-color:var(--gold); background:var(--tile);
  box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop); cursor:pointer;
}
@media (hover:hover){ .mg-smithslot.set:hover{ transform:translateY(-3px); } }
/* THE WOBBLE IS GOLD and it is the only mark a wrong arrangement gets — no red anywhere in this app,
   and a piece in the wrong space is a placement mistake, never a spelling one. */
.mg-smithslot.wob{ animation:mgwob var(--mgWobble) ease; box-shadow:var(--elev-chip-sel); }

.mg-stock{
  min-width:var(--mgSmMinW); height:var(--mgSmStockH); padding:0 14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(180deg,var(--btn2Hi),var(--btn2Lo)); color:var(--ink);
  border:var(--mgRule) solid var(--line); border-radius:var(--mgSmR);
  font-family:var(--fdisp); font-weight:900; font-size:var(--mgSmStockFont); letter-spacing:1px;
  box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop);
  transition:transform .1s ease, border-color .1s ease;
}
@media (hover:hover){ .mg-stock:hover{ transform:translateY(-3px); border-color:var(--gold); } }
/* the piece's MEANING (P10c), on the same pieces the plain bench captions and out of the same item.
   The tile becomes a column so the caption sits under the letters; a piece with no meaning is
   untouched, which is every piece of every word the canon cannot vouch for. */
.mg-stock:has(.mg-mean){ flex-direction:column; gap:1px; height:auto; min-height:var(--mgSmStockH); padding:7px 12px; }
.mg-stock .mg-mean{
  font-family:var(--fbody); font-weight:800; font-size:11px; letter-spacing:0;
  line-height:1.15; opacity:.72; max-width:120px; text-align:center;
}
/* the box STAYS when its piece is on the anvil: a bench that reflowed under a travelling finger is
   the plain builder's own note, kept verbatim. */
.mg-stock.used{ visibility:hidden; }
/* the hint after four arrangements — the host decides WHEN, this only draws it. Never a dead end. */
.mg-stock.lit{ border-color:var(--gold); box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop), var(--elev-chip-on)   /* the lit glow without --glow-misswant's 3px edge (2026-10-25) */; }

/* THE SMITH'S PATTERN — the no-clip beat. The host shows the whole word once when there is no
   recording for it; under the costume that has to happen here or the child is asked to assemble a
   word they were never given. Same row, same height: the peek replaces the spaces, it does not
   arrive above them. */
.mg-smithpeek{
  min-width:var(--mgSmMinW); height:var(--mgSmSlotH); padding:0 18px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--fdisp); font-weight:900; font-size:var(--mgSmFont); letter-spacing:1px;
  color:var(--ink); background:var(--tile);
  border:var(--mgRule) solid var(--gold); border-radius:var(--mgSmR); box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop);
}
.mg-smithcap{ flex:1 0 100%; text-align:center; font-size:var(--fqb); color:var(--mut); }
/* FINISHED — the word comes off the anvil stamped: the pieces lock (shape) and the row lights (glow).
   M22 twice over, and nothing about it says a score. */
.mg-smith.stamped .mg-smithslot.set{ border-color:var(--goldInk); box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop), var(--elev-chip-on)   /* the lit glow without --glow-misswant's 3px edge (2026-10-25) */; }
.mg-smith.over .mg-stock, .mg-smith.over .mg-smithslot{ pointer-events:none; }

@media (max-width:35em){
  .mg-stock{ font-size:23px; }         /* index.html's own phone step for #buildbank .fchunk */
}

/* ══ TRAIL OF EMBERS — skins a review-provenance `recall` step ═══════════════════════════════════
   ABSOLUTE, INSET, POINTER-EVENTS OFF — the battle's clause, for the battle's reason (A126). A recall
   step is a TYPING step: the keyboard, the typed row and Done ✓ all have to fit, so this costume adds
   no layout height at all and cannot swallow a tap meant for any of them.

   AND NOTHING HERE EVER SUBTRACTS. There is no rule in this block that empties a pedestal or dims a
   returned gem, and none may be added: a hoard that could shrink is boss health that falls, which is
   the no-fail law wearing different scales. */
.mg-ember{
  position:absolute; inset:0; pointer-events:none; z-index:3;
  font-family:var(--fbody);
}
.mg-hoard{
  position:absolute; left:.6rem; bottom:2.1rem;
  display:flex; gap:.4rem; align-items:flex-end;
}
/* M22: an empty pedestal is a RING, a returned treasure is a filled diamond. The shapes differ before
   the colours do, and the one being sought carries a slow glow on top of both. */
.mg-gem{
  width:var(--mgGem); height:var(--mgGem); border-radius:var(--mgPill);
  box-shadow:inset 0 0 0 var(--trHair) var(--line); background:var(--well);
  transition:background var(--mgBeat) ease, transform var(--mgBeat) ease, border-radius var(--mgBeat) ease;
}
.mg-gem.in{
  border-radius:.15rem; transform:rotate(45deg);
  background:linear-gradient(180deg,var(--goldD),var(--gold));
  box-shadow:0 0 0 var(--trHair) var(--goldInk);
}
.mg-gem.seek{ animation:mgglow 1.9s ease-in-out infinite; box-shadow:inset 0 0 0 var(--mgRule) var(--goldInk); }
.mg-gem.landed{ animation:mgpop var(--mgBeat) ease; }

.mg-dragon{
  position:absolute; left:.4rem; bottom:.4rem;
  width:var(--mgDragon); height:var(--mgDragon);
  image-rendering:pixelated; transform-origin:0% 100%;
  opacity:.92; transition:transform var(--mgBeat) ease, opacity var(--mgIntro) ease;
}
/* SHE SETTLES when a treasure comes back — a small sink, never a cheer that would talk over the app's
   own praise line. A miss RUMMAGES: she is still looking, and nothing has been taken from anyone. */
.mg-ember[data-state="returned"] .mg-dragon{ transform:translateY(.18rem); }
.mg-ember.rummage .mg-dragon{ animation:mgwob var(--mgWobble) ease 1; }

.mg-emberline{
  position:absolute; left:0; right:0; bottom:.2rem; text-align:center;
  font-size:var(--fqb); color:var(--mut); padding:0 var(--mgDragon);
}

/* ══ THE WOBBLY TOWER — skins an ORDINARY `recall` step ═════════════════════════════════════════
   ABSOLUTE, INSET, POINTER-EVENTS OFF — Ember's clause, for Ember's reason (A126). A recall step is a
   TYPING step and every pixel of the card belongs to the keyboard, the typed row and Done ✓.

   AND NOTHING HERE EVER SUBTRACTS. There is no rule in this block that removes a block, shortens the
   stack or dims one that is laid, and none may be added: a tower that could fall is boss health that
   drops, which is the no-fail law wearing different bricks. `.wob` is the whole of what a miss does —
   a lean that settles, on a transform, touching no block's existence. */
.mg-tower{
  position:absolute; inset:0; pointer-events:none; z-index:3;
  font-family:var(--fbody);
}
.mg-tyard{
  position:absolute; right:.7rem; bottom:1.9rem;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
}
/* column-reverse so the FIRST block in the DOM is the one on the ground: appending a brick puts it on
   top and moves nothing underneath it, which is the promise the costume is making, kept in a
   stylesheet rather than in a comment. */
.mg-tstack{
  position:relative; display:flex; flex-direction:column-reverse; align-items:center; gap:var(--mgTGap);
  transform-origin:50% 100%;
  transition:transform var(--mgBeat) ease;
}
.mg-tb{
  width:var(--mgTBlockW); height:var(--mgTBlockH); border-radius:.18rem;
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  box-shadow:0 1px 0 var(--tileEdge);
  position:relative;
}
/* M22: a hot brick is WIDER and carries two notches; a warm one carries one. The shapes differ before
   any colour does, and a printed screenshot still tells them apart. */
.mg-tb.hot{ width:var(--mgTBlockWHot); height:var(--mgTBlockHHot); }
.mg-tb::after{
  content:'·'; position:absolute; right:.28rem; top:50%; transform:translateY(-50%);
  font-size:var(--fqb); line-height:0; color:var(--tileEdge);
}
.mg-tb.hot::after{ content:'··'; letter-spacing:.1em; }
.mg-tb.landed{ animation:mgpop var(--mgBeat) ease; }
/* the blocks that are BELOW the drawn window — a tall tower seen from close up. `+7` is a count, not
   a score, and it appears only when there is something under the fold to count. */
.mg-tstack[data-hidden]:not([data-hidden=""])::before{
  content:'+' attr(data-hidden);
  font-size:var(--fqb); color:var(--mut); line-height:1; margin-bottom:.1rem;
}
/* THE BEST-EVER MARK — a dashed rule and a flag, never a coloured line and never a target. It is
   drawn only while the tower is below it; a mark you are standing above has stopped meaning anything. */
.mg-tbest{
  position:absolute; right:0; bottom:calc(var(--mgTBest, 0) * (var(--mgTBlockH) + var(--mgTGap)));
  display:flex; align-items:center; gap:.25rem; pointer-events:none;
}
.mg-tbest i{ display:block; width:3.6rem; height:0; border-top:var(--trHair) dashed var(--line); }
.mg-tbest b{ font-weight:400; font-size:var(--fqb); color:var(--mut); white-space:nowrap; }
/* THE WOBBLE, AND IT ALWAYS COMES BACK. One animation, one iteration, ending where it started. */
.mg-tower.wob .mg-tstack{ animation:mgtlean var(--mgTWob) ease 1; }
@keyframes mgtlean{
  0%{ transform:rotate(0) } 22%{ transform:rotate(calc(var(--mgTLean) * -1)) }
  55%{ transform:rotate(calc(var(--mgTLean) * .45)) } 80%{ transform:rotate(calc(var(--mgTLean) * -.18)) }
  100%{ transform:rotate(0) }
}
.mg-tline{
  position:absolute; left:0; right:0; bottom:.2rem; text-align:center;
  font-size:var(--fqb); color:var(--mut);
}

/* ══ WAVE 4A — THE YOUNG LAYER AND THE HEAT DIAL (BOSS-MINIGAME-SPEC §9) ═════════════════════════
   Every rule below is reached through `[data-young]` or `[data-heat]`, both of which are written
   onto a costume's root from `item.young` / `item.heat` — fields the HOST computes and hands over.
   A presenter never decides either, and no rule here changes what an exercise asks, what counts as
   correct, or how long the child has: the ONE pacing number heat moves is the flash beat, and that
   is computed by app.js so the plain rendering obeys the identical number (§9.0/§9.2).

   YOUNG IS A TAP TARGET AND A LANDMARK, and it is deliberately not a bigger TYPE size: the word is
   the thing being learned and it already renders at the app's own scale in every costume. What a
   five-year-old needs is a button their finger lands on and a second, non-linguistic way to tell two
   piles apart while a word is in their hand. */
.mg-sheep[data-young="1"] .mg-sh,
.mg-lant[data-young="1"] .mg-lan{ min-height:var(--mgTapY); padding:.45rem .85rem .45rem .55rem; }
.mg-sheep[data-young="1"] .mg-pen,
.mg-lant[data-young="1"] .mg-post{ min-height:calc(var(--mgTapY) * 2); }
/* the mark beside a pen's name. A SHAPE, never a picture of the sound — there is no icon vocabulary
   for `oa` against `ow`, and inventing one would be new content wearing a costume's clothes. */
.mg-penmark{ margin-right:.35em; font-size:var(--mgMark); opacity:.85; }
/* a word already in a pen shrinks; for a young finger it shrinks less far, because a settled sheep
   is still a thing they will want to point at. */
.mg-sheep[data-young="1"] .mg-sh.in,
.mg-lant[data-young="1"] .mg-lan.hung{ min-height:var(--mgTap); }

/* THE STORM AT A FIVE-YEAR-OLD'S STRENGTH. One token pair, and nothing else in the fight changes:
   same lamps, same counter, same monotonic rule. Atmosphere is not difficulty, but a dark screen
   that a child has to look past to find the word is. */
.mg-bat[data-young="1"] .mg-veil{ opacity:calc(var(--mgVeilY) * var(--mgleft)); }
.mg-bat[data-young="1"] .mg-rain{ opacity:calc(var(--mgRainY) * var(--mgleft)); }

/* HEAT — three dials, all of them light. The firefly burns a little brighter for a child who is
   cruising; the pile shimmers; the anvil throws more spark. The PULSE is unchanged on purpose:
   speeding an animation up would read as pressure, and there is no pressure in this app. */
.mg-fly[data-heat="hot"] .mg-flybug{ width:var(--mgFlyBugHot); height:var(--mgFlyBugHot); }
/* the tower's young pair: a BIGGER brick (fewer of them, each easier to see across a room) and a
   gentler lean. Neither number is reachable by a presenter — both are written from `item.young`,
   which the host computes, which is what keeps a knob that only exists under a costume cosmetic. */
.mg-tower[data-young="1"] .mg-tb{ width:var(--mgTBlockWY); height:var(--mgTBlockHY); }
.mg-tower[data-young="1"] .mg-tb.hot{ width:calc(var(--mgTBlockWY) + .5rem); height:calc(var(--mgTBlockHY) + .18rem); }
.mg-tower[data-young="1"] .mg-tbest{ bottom:calc(var(--mgTBest, 0) * (var(--mgTBlockHY) + var(--mgTGap))); }
.mg-tower[data-young="1"].wob .mg-tstack{ animation-duration:calc(var(--mgTWob) * 1.15); }
.mg-tower[data-young="1"]{ --mgTLean:var(--mgTLeanY); }
.mg-ember[data-heat="hot"] .mg-gem.in{ box-shadow:var(--glow-misswant); }
.mg-ember[data-heat="hot"] .mg-dragon{ filter:brightness(calc(1 + var(--mgShimmer))); }
.mg-smith[data-heat="hot"] .mg-smithslot.set{ box-shadow:inset 0 -2px 0 var(--btn2Edge), var(--float-drop), var(--elev-chip-on)   /* the lit glow without --glow-misswant's 3px edge (2026-10-25) */; }

@media (min-width:56.25em){
  .mg-blob{ width:var(--mgSplat); height:var(--mgSplat); margin:calc(var(--mgSplat) / -2) 0 0 calc(var(--mgSplat) / -2); }
  .mg-batdock{ width:var(--mgArt); height:var(--mgArt); }
  .mg-batline{ padding:0 var(--mgArt); }
  .mg-dragon{ width:var(--mgArt); height:var(--mgArt); }
  .mg-emberline{ padding:0 var(--mgArt); }
}
@media (prefers-reduced-motion:reduce){
  .mg-blob, .mg-batfig, .mg-batsprite, .mg-batbar i, .mg-flyw, .mg-flybug{ transition:none; animation:none; }
  .mg-batcard, .mg-batwon, .mg-batportrait.slip, .mg-messpiece{ animation:none; }
  .mg-messpiece{ transition:none; }
  .mg-rain, .mg-veil, .mg-lamp, .mg-pseal{ transition:none; animation:none; }
  .mg-gem, .mg-dragon, .mg-smithslot, .mg-stock{ transition:none; animation:none; }
  /* the tower stops leaning and stops popping. It still never loses a block, because losing one was
     never an animation — see the banner over .mg-tower. */
  .mg-tstack, .mg-tb{ transition:none; animation:none; }
  .mg-twinactor, .mg-twinactor.bow, .mg-twin.closed .mg-twinboards{ transition:none; animation:none; }
}

/* ── THE TWIN VOICE STAGE (skins the tangler bonus, twin-voice family only) ─────────────────────
   The embers law: absolutely positioned, pointer-events:none, zero layout height. A little
   proscenium across the top of the card; two masked actors; the reveal comes only through
   finish() and only on a win. CSS shapes only — no sprite. */
.mg-twin{
  position:absolute; inset:0; pointer-events:none; z-index:3;
  font-family:var(--fbody);
}
.mg-twinplate{
  position:absolute; top:.35rem; left:50%; transform:translateX(-50%);
  font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; color:var(--mut);
}
.mg-twinboards{
  position:absolute; top:1.35rem; left:0; right:0;
  display:flex; justify-content:center; gap:2.2rem;
}
.mg-twinactor{
  display:flex; flex-direction:column; align-items:center; gap:.18rem;
  transition:transform .5s ease;
}
.mg-twinmask{
  min-width:2.1rem; padding:.2rem .55rem; text-align:center;
  border-radius:50% 50% 42% 42% / 60% 60% 40% 40%;
  background:var(--well); box-shadow:inset 0 0 0 var(--trHair) var(--line);
  font-weight:800; color:var(--ink);
}
.mg-twintag{ font-size:.62rem; color:var(--mut); }
.mg-twincap{
  position:absolute; top:4.6rem; left:0; right:0; text-align:center;
  font-size:.7rem; color:var(--mut);
}
/* the bow: each actor dips toward centre stage, masks already swapped for the word */
.mg-twinactor.bow{ transform:rotate(-7deg) translateY(.15rem); }
.mg-twinactor.b.bow{ transform:rotate(7deg) translateY(.15rem); }
.mg-twin.won .mg-twinmask{ box-shadow:inset 0 0 0 var(--trHair) var(--line), var(--glow-misswant); }
/* a miss: the curtains simply close — the boards fade, the caption stays warm and unchanged */
.mg-twin.closed .mg-twinboards, .mg-twin.closed .mg-twinplate{ opacity:.25; transition:opacity .6s ease; }
/* young: bigger masks, wider gap — a picture read at arm's length (drawing decision, host's item.young) */
.mg-twin[data-young="1"] .mg-twinmask{ font-size:1.05rem; padding:.3rem .7rem; }
.mg-twin[data-young="1"] .mg-twinboards{ gap:3rem; }
