/* ==========================================================================
   Cape Clash — Battle HUD v1
   Implements docs/specs/HUD-SPEC.md as a *decorator skin*.

   SAFETY VALVE: every rule below is scoped under `body.cc-hud`. Remove that one
   class (CapeHUD.destroy(), or delete this <link>) and the game returns to its
   original look with zero other changes. Nothing here renames, reparents or
   removes an engine-owned node.

   Load order: after index.html's own <style> block.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root{
  /* existing six are declared by index.html and are NOT redefined here:
     --ink --paper --pow --red --panel --panel2 */

  /* life */
  --cc-life:#ff5d6c;
  --cc-life-empty:#3a2f5e;
  --cc-life-glow:rgba(255,93,108,.55);
  /* energy — Cape Clash keeps lightning-yellow, not a teal mana droplet */
  --cc-energy:#ffd23f;
  --cc-energy-deep:#b8901a;
  --cc-energy-lo:#c7bfdc;
  /* semantic */
  --cc-ok:#9be15d;
  --cc-ready:#8fbf74;              /* desaturated ready/afford pulse — --cc-ok is punchier,
                                       reserved elsewhere; the pulse alone stays low-chroma now
                                       that the ring + frame carry rarity colour instead */
  --cc-warn:#ffd23f;
  --cc-danger:#ff6b6b;
  --cc-boss:#ff6b6b;
  /* rarity frame - the 4-step RECORD scale: 1 COMMON, 2 UNCOMMON, 3 RARE, 4 EPIC.
     It ENDS AT EPIC; there is no LEGENDARY step and nothing draws a fifth pip.
     Stars are a RECORD of how unusual a card is, never a gate - every hero and every
     leader is available to every player from the start (house rule 1). The hexes
     mirror index.html's HAND_RARITY_VAR / RARITY_ACC, and --cc-rarity-none is the
     base (unskinned) .slot fallback frame in index.html's own <style> block. */
  --cc-rarity-none:#383347;
  --cc-rarity-common:#6b7280;
  --cc-rarity-uncommon:#4dabf7;
  --cc-rarity-rare:#b197fc;
  --cc-rarity-epic:#ffd23f;
  --cc-rarity-legendary:#c08b1f;   /* RETIRED with the old 3-step scale. Nothing reads it;
                                      kept only so an old override cannot resolve to nothing. */
  /* sides — you = blue, rival = red (matches cinematics.js's kill-forward comet) */
  --cc-you:#4980D5;
  --cc-foe:#e03131;
  --cc-foe2:#ff922b;
  --cc-foe3:#cc5de8;
  /* surfaces */
  --cc-chip:#1d1538;
  --cc-chip2:#2a2150;
  --cc-stroke:#4a3d85;
  --cc-stroke-lit:#6c5bb5;
  --cc-dim:#9d92c9;
  --cc-glass:rgba(14,9,32,.72);

  /* geometry */
  --cc-hud-h:44px;
  --cc-strip-h:44px;      /* WAVE 34 s0.4: 26 -> 44, the mode strip now carries NEXT WAVE */
  --cc-rivals-h:22px;
  --cc-cards-h:90px;      /* W22: +10px for the card's name plate (see 6.4 .nm) */
  --cc-ult-h:50px;
  --cc-bottom-h:68px;
  --cc-gutter:8px;
  --cc-gap:6px;
  --cc-r-pill:999px;
  --cc-r-card:12px;
  --cc-r-chip:7px;
  --cc-r-btn:14px;
  --cc-bw:2px;
  --cc-ring-d:50px;
  --cc-mini-d:44px;

  /* lifts — comic-book hard offsets, never blur */
  --cc-lift-1:0 2px 0 var(--ink);
  --cc-lift-pow:0 4px 0 var(--cc-energy-deep);
  --cc-lift-purple:0 4px 0 #3b2483;
  --cc-glow-pow:0 0 14px rgba(255,210,63,.55);
  --cc-glow-ok:0 0 12px rgba(155,225,93,.65);

  /* motion */
  --cc-pop:cubic-bezier(.2,2,.4,1);
  --cc-lift-ease:cubic-bezier(.2,1.6,.4,1);
  --cc-out:cubic-bezier(.22,1,.36,1);
  --cc-t-fast:160ms;
  --cc-t-pop:300ms;
  --cc-t-shake:360ms;
  --cc-t-count:900ms;
}

/* ============================================================ 6.1 TOP BAR */
body.cc-hud #hud{
  width:100%;max-width:460px;height:var(--cc-hud-h);
  display:flex;align-items:center;justify-content:center;
  gap:var(--cc-gap);flex-wrap:nowrap;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
  padding-top:0;padding-bottom:0;
}
body.cc-hud #pauseBtn{margin-right:auto}
body.cc-hud #muteBtn2{margin-left:auto}

/* pills + chips: one shape language ------------------------------------- */
body.cc-hud .hudBox{
  background:var(--cc-glass);
  border:var(--cc-bw) solid var(--ink);
  outline:0;                                   /* replaces the old double-outline */
  border-radius:var(--cc-r-pill);
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke-lit);
  padding:3px 8px;height:32px;
  display:flex;align-items:center;gap:4px;
  font-weight:800;font-size:13px;line-height:1;
  white-space:nowrap;flex:0 0 auto;
}
/* W12 CLEANUP #10: #lives/#wave/#energy/#foeLives are numeral-only (the icon beside them
   carries the word) - Bangers' digits collide at this size (a 7 reads as a 1), so this
   moves to the tabular-Nunito numeral face already used by .cc-rival-n below. This rule's
   specificity (body.cc-hud .hudBox .big) beats index.html's own .hudBox .big, which is why
   the same fix is applied in both places - the base rule for when hud.js is not running. */
body.cc-hud .hudBox .big{
  font-family:'Nunito',sans-serif;font-weight:800;font-size:17px;letter-spacing:.2px;
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
  color:var(--paper);text-shadow:none;
  display:inline-block;text-align:center;
}

/* --- 6.1.1 quit / mute ------------------------------------------------- */
body.cc-hud #quitBtn,body.cc-hud #pauseBtn,body.cc-hud #muteBtn2{
  width:44px;height:44px;min-width:44px;padding:0;
  display:flex;align-items:center;justify-content:center;
  background:none;border:0;box-shadow:none;color:var(--cc-dim);
  font-family:'Bangers',cursive;font-size:15px;
  transition:transform 100ms var(--cc-out);
}
body.cc-hud #quitBtn::before,body.cc-hud #pauseBtn::before,body.cc-hud #muteBtn2::before{
  content:'';position:absolute;width:36px;height:36px;border-radius:50%;
  background:var(--cc-glass);border:2px solid var(--cc-stroke);z-index:-1;
}
body.cc-hud #quitBtn,body.cc-hud #pauseBtn,body.cc-hud #muteBtn2{position:relative;isolation:isolate}
body.cc-hud #quitBtn:active,body.cc-hud #pauseBtn:active,body.cc-hud #muteBtn2:active{transform:scale(.92)}

/* --- 6.1.2 hearts ------------------------------------------------------ */
/* bible sec4's one highest-value rule: red = opponent, blue = you. The rival pill is
   ringed --cc-foe (#e03131) and YOUR hearts pill used to be ringed #ff5d6c — 12 degrees
   of hue apart and indistinguishable at 26px in a PvP top bar. The ownership now rides
   the RING (--cc-you); the heart GLYPH stays red, because a heart is red by convention
   and the glyph carries the meaning while the ring carries the side. */
body.cc-hud .cc-hearts{
  font-size:0;                                 /* hides the engine's raw heart text node */
  flex:0 1 auto;min-width:0;
  box-shadow:inset 0 0 0 1.5px var(--cc-you);
  position:relative;overflow:hidden;           /* one chip system: 32px everywhere, and the
                                                   segment bar can never poke past the pill's
                                                   own rounded corners no matter the maths */
  padding:2px 8px;height:32px;
  flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;
}
body.cc-hud .cc-hearts .cc-hearts-top{display:flex;align-items:center;gap:4px;height:19px}
body.cc-hud .cc-heart-glyph{width:18px;height:16px;display:block;flex:0 0 auto}
body.cc-hud .cc-heart-glyph .fillp{fill:var(--cc-life);stroke:var(--ink);stroke-width:1.6}
body.cc-hud .cc-hearts #lives{min-width:22px;text-align:left;font-size:17px}
/* Ten 4px slices read as a red dashed line, not a countable life bar - and the number
   directly above already states the value. Above 6 lives the bar goes COARSE: three fat
   segments, one per third of max. (<=6 lives still uses the real pip row above.) */
body.cc-hud .cc-segs{display:flex;gap:2px;width:54px;height:5px}
body.cc-hud .cc-seg{flex:1;min-width:0;border-radius:2px;background:var(--cc-life-empty);
  transition:background 200ms var(--cc-out)}
body.cc-hud .cc-seg.on{background:var(--cc-life)}
/* Mode A — true pip row, only when maxLives <= 6 */
body.cc-hud .cc-pips{display:none;gap:3px;align-items:center;height:14px}
body.cc-hud .cc-hearts.cc-pip-mode{flex-direction:row;height:32px}
body.cc-hud .cc-hearts.cc-pip-mode .cc-pips{display:flex}
body.cc-hud .cc-hearts.cc-pip-mode .cc-segs,
body.cc-hud .cc-hearts.cc-pip-mode .cc-heart-glyph{display:none}
body.cc-hud .cc-hearts.cc-pip-mode #lives{
  position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
}
body.cc-hud .cc-pip{width:11px;height:10px;display:block;flex:0 0 auto}
body.cc-hud .cc-pip .fillp{fill:var(--cc-life);stroke:var(--ink);stroke-width:1.5}
body.cc-hud .cc-pip.spent .fillp{fill:var(--cc-life-empty);stroke:none;opacity:.55}
/* low-life states */
body.cc-hud .cc-hearts.cc-low .cc-heart-glyph,
body.cc-hud .cc-hearts.cc-low .cc-segs{animation:ccBreathe 1.6s ease-in-out infinite}
body.cc-hud .cc-hearts.cc-crit{box-shadow:inset 0 0 0 1.5px var(--cc-danger)}
body.cc-hud .cc-hearts.cc-crit .cc-seg.on{background:var(--cc-danger)}
body.cc-hud .cc-hearts.cc-crit .cc-heart-glyph .fillp{fill:var(--cc-danger)}
body.cc-hud .cc-hearts.cc-crit .cc-heart-glyph,
body.cc-hud .cc-hearts.cc-crit .cc-segs{animation-duration:.9s}
@keyframes ccBreathe{50%{opacity:.75}}
@keyframes ccShake{
  0%,100%{transform:translateX(0) rotate(0)}
  15%{transform:translateX(-3px) rotate(-2deg)}
  38%{transform:translateX(3px) rotate(2deg)}
  60%{transform:translateX(-2px) rotate(-1deg)}
  82%{transform:translateX(2px) rotate(1deg)}
}
@keyframes ccLifeFlash{0%,100%{box-shadow:inset 0 0 0 1.5px var(--cc-you)}
  40%{box-shadow:inset 0 0 0 1.5px var(--cc-danger),0 0 14px var(--cc-life-glow)}}
body.cc-hud .cc-hearts.cc-hit{animation:ccShake var(--cc-t-shake) ease-in-out,
  ccLifeFlash 240ms linear}
body.cc-hud .cc-hearts.cc-heal{animation:ccHealGlow 240ms var(--cc-out)}
@keyframes ccHealGlow{50%{box-shadow:inset 0 0 0 1.5px var(--cc-ok),var(--cc-glow-ok)}}
@keyframes ccBgFlash{50%{background:rgba(255,93,108,.28)}}

/* --- 6.1.3 wave pill --------------------------------------------------- */
body.cc-hud .cc-pill--wave{
  font-size:0;                                 /* hides the engine's own wave icon text node */
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke-lit);
  min-width:56px;height:32px;justify-content:center;   /* one chip system: same 32px as hearts/energy/foe */
}
body.cc-hud .cc-pill--wave .cc-ico{width:12px;height:12px;color:var(--cc-dim);line-height:1;display:inline-flex}
/* W13 BATTLE CHROME: the "W" used to exist ONLY inside the <=340px block, so at every width a
   player actually plays at, the wave pill was a bare integer sitting between two other bare
   integers (lives, energy) and read as one more counter. It is now the WORD + the chevron icon
   at EVERY width - the glyph keeps the bible's no-number-without-an-icon rule, the word says
   which number this is - and the narrow block below only has to drop the icon.
   W13 FIX1: that word was a single letter ('W5'), which is an abbreviation the game never
   teaches anywhere else - the result screen, the coach cards and the banners all say WAVE. The
   label is now the whole word, set two-thirds down from the numeral so the NUMBER still carries
   the read, and the pill's min-width grew by 10px to pay for it. The <=340px block below keeps
   the word and drops only the chevron, so "WAVE n" survives on the narrowest phone. */
body.cc-hud .cc-pill--wave #wave{min-width:38px}
body.cc-hud .cc-pill--wave #wave::before{content:'WAVE';font-size:.55em;opacity:.78;margin-right:2.5px;letter-spacing:.2px}
/* WAVE-12 SLOP-QUICK #2: the old animation ran on the PILL itself (perspective+rotateX),
   which is a real 3D flip - edge-on, at 49%/51%, the pill is a sliver with no width, so its
   own border+background painted as a squashed dark lozenge for two frames. The number is
   the only thing that actually changed; only the number now animates, as an opacity +
   translateY crossfade (both compositable, no layout/paint on the pill itself). */
body.cc-hud .cc-pill--wave.cc-flip #wave{animation:ccFlip 260ms var(--cc-pop)}
@keyframes ccFlip{0%{opacity:1;transform:translateY(0)}
  49%{opacity:0;transform:translateY(-6px)}
  51%{opacity:0;transform:translateY(6px)}
  100%{opacity:1;transform:translateY(0)}}
body.cc-hud .cc-pill--wave.cc-flash #wave{color:var(--cc-ok)}
/* W145 PVP FLOW: in Clash / 4-Player / Co-op this pill is the countdown to the next boss - it says BOSS, not WAVE (the engine adds .flowT), and breathes red for the last ten seconds (.flowUrgent). */
body.cc-hud .cc-pill--wave.flowT #wave::before{content:'BOSS'}
body.cc-hud .cc-pill--wave.flowUrgent #wave{color:var(--cc-danger,#ff6b6b);animation:ccFlowPulse 1s ease-in-out infinite}
body.cc-hud .cc-pill--wave.flowUrgent.cc-flip #wave{animation:ccFlowPulse 1s ease-in-out infinite}
@keyframes ccFlowPulse{50%{opacity:.55}}
body.cc-rm.cc-hud .cc-pill--wave.flowUrgent #wave{animation:none}

/* --- 6.1.4 energy pill ------------------------------------------------- */
body.cc-hud .cc-pill--energy{
  background:linear-gradient(180deg,#2b2150,#1d1538);
  box-shadow:inset 0 0 0 1.5px var(--cc-energy);
  min-width:66px;height:32px;justify-content:center;
  font-size:14px;color:var(--cc-energy);
  text-shadow:0 0 5px rgba(255,210,63,.55);
  transition:box-shadow var(--cc-t-fast) linear;
}
/* One chip rule: the ICON keeps its semantic colour (it carries the meaning), the NUMBER
   is always --paper (it carries the value). Printing both in gold made the pair read as
   one gold smear with the bolt's interior strokes gone. */
body.cc-hud .cc-pill--energy #energy{min-width:40px;text-align:right;color:var(--paper);text-shadow:none}
body.cc-hud .cc-pill--energy.cc-poor #energy{color:var(--cc-energy-lo)}
body.cc-hud .cc-pill--energy.cc-poor{
  box-shadow:inset 0 0 0 1.5px rgba(199,191,220,.55);
  text-shadow:none;color:var(--cc-energy-lo);
}
body.cc-hud .hudBox.pop{animation:ccHudPop var(--cc-t-pop) var(--cc-pop)}
@keyframes ccHudPop{50%{transform:scale(1.10);box-shadow:inset 0 0 0 1.5px var(--cc-energy),var(--cc-glow-pow)}}

/* --- 6.1.5 rival pill (PvP) ------------------------------------------- */
body.cc-hud .cc-pill--foe{
  box-shadow:inset 0 0 0 1.5px var(--cc-foe);
  min-width:56px;height:32px;justify-content:center;font-size:15px;
}
body.cc-hud .cc-pill--foe #foeLives{min-width:22px}
body.cc-hud .cc-pill--foe.cc-has-avatar{font-size:0}
body.cc-hud .cc-foe-avatar{width:18px;height:18px;border-radius:50%;
  border:1.5px solid var(--ink);display:block;flex:0 0 auto}
body.cc-hud .cc-pill--foe.cc-hit{animation:ccShake var(--cc-t-shake) ease-in-out,
  ccFoeFlash 240ms linear}
@keyframes ccFoeFlash{40%{box-shadow:inset 0 0 0 1.5px var(--cc-ok),var(--cc-glow-ok)}}

/* ========================================================= 6.2 STATUS STRIP */
body.cc-hud #ccStrip{
  position:relative;width:100%;max-width:460px;height:var(--cc-strip-h);
  display:flex;align-items:center;gap:var(--cc-gap);flex:0 0 auto;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
}
/* The mutator name is the PERSISTENT, rule-carrying label on this strip, so it gets the
   flexible width; the transient boss chip is capped. All three items now wear the same
   outlined-pill chrome (they used to be an under-barred label, bare gold text and a
   pill), and the clock carries a timer icon so every item is icon + value. */
body.cc-hud .cc-mut{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0;
  max-width:42%;height:20px;padding:0 7px 0 5px;border-radius:var(--cc-r-chip);
  background:var(--cc-glass);box-shadow:inset 0 0 0 1.5px var(--cc-mut-color,var(--cc-stroke-lit))}
body.cc-hud .cc-mut[hidden]{display:none}
body.cc-hud .cc-mut-dot{width:6px;height:6px;border-radius:50%;
  background:var(--cc-mut-color,var(--cc-dim));flex:0 0 auto}
body.cc-hud .cc-mut-dot[hidden]{display:none}
body.cc-hud .cc-mut-ico{flex:0 0 auto;color:var(--cc-mut-color,var(--cc-dim));
  width:13px;height:13px;font-size:13px}
body.cc-hud .cc-mut-name{font:800 11px/1 'Nunito',sans-serif;letter-spacing:.4px;
  color:var(--paper);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* DAILY SEEDED CHALLENGE chip (public/js/hud.js setDaily). It rides beside the mutator
   pill and carries no rule of its own - it only says this run is today's shared lane, so
   it is deliberately the smallest item on the strip and never takes flexible width. */
body.cc-hud .cc-daily{display:flex;align-items:center;gap:3px;flex:0 0 auto;height:20px;
  padding:0 6px 0 4px;border-radius:var(--cc-r-chip);background:var(--cc-glass);
  box-shadow:inset 0 0 0 1.5px var(--cc-daily-color,var(--cc-stroke-lit))}
body.cc-hud .cc-daily[hidden]{display:none}
body.cc-hud .cc-daily-ico{flex:0 0 auto;color:var(--cc-daily-color,var(--cc-dim));
  width:12px;height:12px;font-size:12px}
body.cc-hud .cc-daily-t{font:800 10px/1 'Nunito',sans-serif;letter-spacing:.6px;
  color:var(--cc-daily-color,var(--paper));white-space:nowrap}
body.cc-hud .cc-clock{position:absolute;left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:4px;height:20px;padding:0 7px 0 5px;
  border-radius:var(--cc-r-chip);background:var(--cc-glass);
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke-lit)}
body.cc-hud .cc-clock[hidden]{display:none}
body.cc-hud .cc-clock-ico{flex:0 0 auto;color:var(--cc-dim);width:13px;height:13px;font-size:13px}
body.cc-hud .cc-clock-t{font-family:'Bangers',cursive;font-size:15px;letter-spacing:1px;
  color:var(--paper);min-width:36px;display:inline-block;text-align:center}
/* JUICE-SPEC M09: hud.js's setClock() drives the colour ramp + soft pulse directly via
   inline style (rgba lerp, ~1 Hz opacity) every frame while urgent - no keyframe blink. */
body.cc-hud .cc-boss{
  margin-left:auto;display:flex;align-items:center;gap:4px;
  height:20px;padding:0 6px 0 2px;border-radius:var(--cc-r-chip);
  background:var(--cc-glass);box-shadow:inset 0 0 0 1.5px var(--cc-boss-accent,var(--cc-warn));
  flex:0 1 auto;max-width:38%;min-width:0;position:relative;
}
body.cc-hud .cc-boss-t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body.cc-hud .cc-boss[hidden]{display:none}
body.cc-hud .cc-boss-face{width:18px;height:18px;border-radius:50%;
  border:1.5px solid var(--ink);display:block;flex:0 0 auto}
body.cc-hud .cc-boss-glyph{font-size:14px;line-height:1;color:var(--cc-boss-accent,var(--cc-warn))}
body.cc-hud .cc-boss-t{font:800 11px/1 'Nunito',sans-serif;letter-spacing:.4px;
  color:var(--cc-boss-accent,var(--cc-warn));font-variant-numeric:tabular-nums}
body.cc-hud .cc-boss.cc-inbound{animation:ccBossBreathe 1.2s ease-in-out infinite}
@keyframes ccBossBreathe{50%{opacity:.7;transform:scale(1.04)}}
/* box-shadow is a PAINT property, so the old infinite box-shadow keyframe repainted the
   chip plus its 12px glow region every frame - and the boss chip is on screen at exactly
   the moment particle load peaks. Same treatment as ccShimmer / ccSummonIdle: the static
   ring stays on the element, only a promoted ::after glow fades in and out. */
body.cc-hud .cc-boss.cc-live{box-shadow:inset 0 0 0 1.5px var(--cc-boss),0 0 0 2px var(--cc-boss)}
body.cc-hud .cc-boss.cc-live::after{
  content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  box-shadow:0 0 0 4px rgba(255,107,107,.35),0 0 12px 2px rgba(255,107,107,.55);
  opacity:0;will-change:opacity;animation:ccBossLiveFade 900ms ease-in-out infinite}
@keyframes ccBossLiveFade{50%{opacity:1}}
.street-boss-roads{position:absolute;z-index:4;inset:46% auto auto 50%;transform:translateX(-50%);width:min(92%,380px);display:grid;grid-template-columns:repeat(var(--road-count,2),minmax(0,1fr));gap:3px;pointer-events:none;text-align:center;color:#fff;font:800 clamp(9px,2.7vw,12px)/1.2 system-ui;font-variant-numeric:tabular-nums}
.street-boss-roads[hidden],.street-boss-roads>span[hidden]{display:none}
#ccStrip>.street-boss-roads{position:static;transform:none;order:1;flex:1 1 220px;width:auto;min-width:0;max-width:380px}
.street-boss-roads>span{--road:#ee849a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 2px 6px;background:linear-gradient(90deg,var(--road) var(--base,0%),#ffd46f var(--base,0%) var(--left,0%),#384050 var(--left,0%)) center bottom / 100% 4px no-repeat,#172339;border:1px solid #8391a6;border-radius:5px}
.street-boss-roads>span:first-child{--road:#61dcd6}
/* A thin, steady health gauge leaves the portrait and the road readable, even during rapid fire. */
body.cc-hud .cc-boss.cc-live.cc-measured{min-width:51px;padding-bottom:2px;background-color:#261b32;background-image:linear-gradient(90deg,#ffd478 var(--cc-hp-left),#654863 var(--cc-hp-left));background-size:calc(100% - 8px) 3px;background-position:center bottom 2px;background-repeat:no-repeat}
body.cc-hud .cc-boss.cc-live.cc-measured::after{display:none}
body.cc-hud .cc-boss.cc-measured .cc-boss-t{color:#fff3da}
body.cc-hud .cc-boss.cc-ping{animation:ccBossPing 320ms var(--cc-pop)}
@keyframes ccBossPing{45%{transform:scale(1.14)}}
body.cc-hud .cc-threat{position:absolute;left:8px;right:8px;bottom:0;height:3px;
  border-radius:2px;background:var(--cc-glass);overflow:hidden}
body.cc-hud .cc-threat>i{display:block;height:100%;width:100%;border-radius:2px;
  background:#63e6be;transform:scaleX(0);transform-origin:left center;will-change:transform;
  transition:transform 120ms linear,background 200ms linear}
body.cc-hud .cc-threat.cc-warn>i{background:var(--cc-warn)}
body.cc-hud .cc-threat.cc-danger>i{background:var(--cc-danger)}

/* ===================================================== TWO-BOARD PRESENTATION */
/* The existing 24px/32px W80 strip and #hud box retain their physical sizes.
   Only the intact readout nodes move. The divider anchor comes from the
   current board solve; no board, canvas, road or input geometry changes. */
body.cc-hud .cc-battle-status{display:none}
body.cc-hud.cc-divider-hud #hud{
  gap:7px;
  background:linear-gradient(180deg,rgba(21,62,96,.56),rgba(12,34,57,.18));
}
body.cc-hud.cc-divider-hud #hud .hudBox{height:28px;border:0;padding:2px 7px}
body.cc-hud.cc-divider-hud #hud .hudBox .big{font-size:15px}
body.cc-hud.cc-divider-hud #hud .cc-pill--energy{
  min-width:70px;background:rgba(10,31,50,.88);
}
body.cc-hud.cc-divider-hud #hud .cc-pill--foe{
  min-width:52px;background:rgba(48,21,40,.82);
}
body.cc-hud.cc-divider-hud #quitBtn,
body.cc-hud.cc-divider-hud #pauseBtn,
body.cc-hud.cc-divider-hud #muteBtn2{color:#e5f4ff}
body.cc-hud.cc-divider-hud #quitBtn::before,
body.cc-hud.cc-divider-hud #pauseBtn::before,
body.cc-hud.cc-divider-hud #muteBtn2::before{
  width:30px;height:30px;border:1px solid #52789d;background:#173b59;
}

/* One small RULE icon, not a permanent name banner. The real button remains
   44x44; its 22px painted disc fits the unchanged strip. Existing polish.js
   click delegation reads the retained name and the canonical MUTATORS rule. */
body.cc-hud #ccStrip button.cc-mut{
  position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;
  flex:0 0 44px;min-width:44px;max-width:44px;width:44px;height:44px;
  padding:0;margin:0;border:0;border-radius:50%;gap:0;
  background:none;box-shadow:none;color:var(--cc-mut-color,var(--cc-dim));
  -webkit-tap-highlight-color:transparent;
}
body.cc-hud #ccStrip button.cc-mut[hidden]{display:none}
body.cc-hud #ccStrip button.cc-mut::before{content:'';position:absolute;inset:0}
body.cc-hud #ccStrip button.cc-mut::after{
  content:'';position:absolute;inset:11px;border-radius:50%;z-index:-1;
  background:#153b5b;box-shadow:inset 0 0 0 1.5px var(--cc-mut-color,var(--cc-dim));
}
body.cc-hud #ccStrip button.cc-mut .cc-mut-ico{width:13px;height:13px;font-size:13px}
body.cc-hud #ccStrip button.cc-mut .cc-mut-name{
  position:absolute;width:1px;height:1px;padding:0;overflow:hidden;
  clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;
}
body.cc-hud #ccStrip button.cc-mut:focus-visible{outline:2px solid #f7edb3;outline-offset:-4px}

/* One 24px-high glance lane. The left 104px stays clear for the engine's
   existing on-canvas COMBO chip. CSS_SCALE / --w80-div-y are published by
   the existing board layout; this overlay gives the canvas no new height. */
body.cc-hud.cc-divider-hud #ccStrip .cc-battle-status{
  position:absolute;left:104px;right:4px;
  top:calc(100% + var(--w80-div-y,10px) - 12px);
  z-index:7;height:24px;display:flex;align-items:center;justify-content:flex-end;
  gap:3px;min-width:0;padding:0;pointer-events:none;
}
body.cc-hud.cc-divider-hud #ccStrip .cc-battle-status[hidden]{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus>.hudBox{
  height:22px;padding:1px 3px;border:0;gap:2px;flex:0 0 auto;
  background:rgba(10,31,50,.94);border-radius:6px;
}
body.cc-hud.cc-divider-hud #ccBattleStatus>.hudBox .big{
  font-size:12px;line-height:1;letter-spacing:0;min-width:0;
}
body.cc-hud.cc-divider-hud #ccBattleStatus>.cc-hearts{
  min-width:34px;align-items:center;gap:1px;order:0;
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-hearts-top{height:14px;gap:2px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-heart-glyph{display:block;width:12px;height:12px}
body.cc-hud.cc-divider-hud #ccBattleStatus #lives{
  position:static;width:auto;height:auto;overflow:visible;clip:auto;clip-path:none;
  font-size:12px;min-width:14px;text-align:center;
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-segs{width:26px;height:3px;gap:1px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-pips{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-hearts.cc-pip-mode .cc-segs{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus>.cc-pill--wave{
  min-width:38px;justify-content:center;order:1;
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-pill--wave .cc-ico{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-pill--wave #wave{min-width:0}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-pill--wave #wave::before{
  font-size:7px;letter-spacing:0;margin-right:2px;
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-clock{
  position:relative;left:auto;top:auto;transform:none;order:2;
  height:22px;padding:0 3px;gap:2px;flex:0 0 auto;
  border-radius:6px;background:rgba(10,31,50,.94);
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-clock-ico{width:10px;height:10px;font-size:10px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-clock-t{font-size:12px;letter-spacing:0;min-width:26px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss{
  position:relative;left:auto;top:auto;order:4;margin:0;height:22px;padding:0 4px 0 2px;
  gap:2px;flex:0 1 auto;min-width:20px;max-width:112px;pointer-events:auto;
  border-radius:6px;background:rgba(48,21,40,.94);
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss-face{width:14px;height:14px;border-width:1px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss-glyph{font-size:12px}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss-t{
  font-size:9px;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss::before{top:-11px;bottom:-11px}

/* The existing shared countdown participates in the same flex line, not an
   independently centred overlay. CARRYING stays in the vacated strip-right
   pocket, so even a countdown + round clock + live boss never makes two rows
   across the road. Full labels remain in the same DOM for assistive readers. */
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals{
  display:contents;position:static;height:auto;width:auto;padding:0;z-index:auto;
}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals[hidden]{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-cd{
  position:static;left:auto;right:auto;top:auto;transform:none;order:3;
  height:22px;padding:0 4px;gap:2px;flex:0 0 auto;border-radius:6px;
  background:rgba(10,31,50,.94);
}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-cd-l{font-size:0;letter-spacing:0}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-cd-l::before{
  content:'NEXT';font:800 7px/1 'Nunito',sans-serif;letter-spacing:0;
}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-cd-n{font-size:11px}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-rival:not([hidden]):has(.cc-rival-carry:not([hidden])){
  position:absolute;left:auto;right:0;top:calc(0px - var(--w80-div-y,10px));
  transform:none;height:18px;max-width:112px;margin:0;padding:0 6px;
}
body.cc-hud.cc-divider-hud #ccBattleStatus #ccRivals .cc-rival-carry{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;
}
@media (max-width:360px){
  body.cc-hud.cc-divider-hud #ccStrip .cc-battle-status{gap:2px;right:3px}
  body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss-face{display:none}
}

/* ==================================================== 6.2b NEXT WAVE (w34 C) */
/* THE EARLY CALL. It sits at the RIGHT end of the mode strip, 12px from the edge, above the
   canvas and above the lineup bar - so the two hard placement rules in the spec are
   structural, not a promise. The painted pill is 30px tall so it fits a 36px strip on a
   short phone; ::before inflates the TAP box to >=44px in every breakpoint without costing
   the column a single pixel. */
body.cc-hud .cc-nw{
  position:relative;margin-left:auto;margin-right:6px;flex:0 0 auto;   /* w34 fix2: 4 -> 6, so the pill sits 12px from the edge (spec C) */
  display:flex;align-items:center;gap:6px;height:30px;padding:0 10px;
  border:0;border-radius:var(--cc-r-pill);cursor:pointer;
  background:var(--cc-glass);color:var(--paper);
  box-shadow:inset 0 0 0 1.5px var(--cc-ok,#4ade80),0 0 10px rgba(74,222,128,.22);
  font:900 11px/1 'Nunito',sans-serif;letter-spacing:.6px;white-space:nowrap;
  -webkit-tap-highlight-color:transparent;
}
/* WAVE 34 FIX2: the tap box is a REAL span now, so it can be measured. 30px pill + 7px above
   and below = a 44px rect, and -6px each side keeps the box wider than the paint too. It is
   inert paint-wise and sits under the label, so the button looks exactly as it did. */
body.cc-hud .cc-nw-hit{position:absolute;left:-6px;right:-6px;top:-7px;bottom:-7px;border-radius:var(--cc-r-pill)}
body.cc-hud .cc-nw[hidden]{display:none}
body.cc-hud .cc-nw-b{font:900 12px/1 'Nunito',sans-serif;color:var(--gold,#ffd23f)}
body.cc-hud .cc-nw-b[hidden]{display:none}
body.cc-hud .cc-nw.cc-nw-off{
  cursor:default;opacity:.55;
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke);
}
/* W49 (owner directive 2026-09-23): greyed FOR A BOSS - his wave, him on the board, the last
   wave. Same dim pill, ringed in the boss chip's own red so it reads "boss", not "wait". A tap
   still lands (the engine answers with the reason), so it keeps a pointer. */
body.cc-hud .cc-nw.cc-nw-off.cc-nw-lock{
  cursor:pointer;opacity:.72;
  box-shadow:inset 0 0 0 1.5px var(--cc-boss,#ff6b6b);
}
@media (prefers-reduced-motion: no-preference){
  body.cc-hud .cc-nw:not(.cc-nw-off):active{transform:translateY(1px)}
}

/* ====================================== 6.2c SHARED WAVE COUNTDOWN (w34 A) */
/* One row under the head-to-head chips in Clash / Co-op / 4-Player: the wave turns over for
   EVERYBODY when this reaches zero, so it is one shared read-out, never a per-board timer. */
body.cc-hud .cc-cd{
  display:flex;align-items:center;gap:5px;flex:0 0 auto;height:18px;padding:0 8px;
  border-radius:var(--cc-r-chip);background:var(--cc-glass);
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke-lit);
}
body.cc-hud .cc-cd[hidden]{display:none}
body.cc-hud .cc-cd-l{font:800 9px/1 'Nunito',sans-serif;letter-spacing:.5px;color:var(--cc-dim)}
body.cc-hud .cc-cd-n{font-size:12px}
body.cc-hud .cc-cd.cc-cd-urgent{box-shadow:inset 0 0 0 1.5px var(--cc-crit-color,#ff6b6b)}
body.cc-hud .cc-cd.cc-cd-urgent .cc-cd-n{color:#ff8787}
@media (prefers-reduced-motion: no-preference){
  body.cc-hud .cc-cd.cc-cd-urgent{animation:ccCdFlash 1s steps(2,end) infinite}
}
@keyframes ccCdFlash{50%{opacity:.55}}
body.cc-rm .cc-cd.cc-cd-urgent{animation:none}
/* The leftovers a board is carrying into the shared next wave. */
body.cc-hud .cc-rival-carry{font:800 8.5px/1 'Nunito',sans-serif;letter-spacing:.3px;
  color:var(--cc-dim);margin-left:3px}
body.cc-hud .cc-rival-carry[hidden]{display:none}

/* ============================ 6.2d 44px TAP TARGETS (w34 s0.4) */
/* PADDING ONLY - the painted pill does not change size, only the box a thumb can land in. */
body.cc-hud #pauseBtn,body.cc-hud #muteBtn1,body.cc-hud #muteBtn2,
body.cc-hud #quitBtn,body.cc-hud #closeBtn{min-width:44px;min-height:44px}

/* ========================================================= 6.3 RIVAL ROW */
body.cc-hud #ccRivals{
  width:100%;max-width:460px;height:var(--cc-rivals-h);flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;gap:8px;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
}
body.cc-hud #ccRivals[hidden]{display:none}
/* WAVE 34 FIX2: in Clash and Co-op this row exists for the SHARED COUNTDOWN alone - there are
   no rival chips to carry - so it is a zero-height overlay exactly like the 4-player one and
   the two boards keep every pixel they had while it was hidden. */
body.cc-hud[data-cc-mode="pvp"] #ccRivals,
body.cc-hud[data-cc-mode="coop"] #ccRivals{
  height:0;overflow:visible;position:relative;z-index:6;pointer-events:none;align-items:flex-start;
}
body.cc-hud[data-cc-mode="pvp"] #ccRivals .cc-cd,
body.cc-hud[data-cc-mode="coop"] #ccRivals .cc-cd{
  position:absolute;left:50%;top:1px;transform:translateX(-50%);
}
body.cc-hud .cc-rival{
  min-width:46px;height:18px;border-radius:var(--cc-r-pill);
  display:flex;align-items:center;justify-content:center;gap:4px;
  background:var(--cc-glass);box-shadow:inset 0 0 0 1.5px var(--cc-rc,var(--cc-foe));
  transition:opacity 200ms var(--cc-out);
}
body.cc-hud .cc-rival[data-i="0"]{--cc-rc:var(--cc-foe)}
body.cc-hud .cc-rival[data-i="1"]{--cc-rc:var(--cc-foe2)}
body.cc-hud .cc-rival[data-i="2"]{--cc-rc:var(--cc-foe3)}
body.cc-hud .cc-rival-dot{width:7px;height:7px;border-radius:50%;background:var(--cc-rc)}
body.cc-hud .cc-rival-n{font:800 10px/1 'Nunito',sans-serif;letter-spacing:.4px;color:var(--paper);
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
body.cc-hud .cc-rival[hidden]{display:none}
body.cc-hud .cc-rival.cc-out{opacity:.4;box-shadow:inset 0 0 0 1.5px var(--cc-stroke)}
body.cc-hud .cc-rival.cc-out .cc-rival-dot{background:var(--cc-stroke)}
body.cc-hud .cc-rival.cc-ko{animation:ccKO 320ms var(--cc-out)}
@keyframes ccKO{100%{transform:scale(.86)}}
body.cc-hud .cc-rival.cc-out{transform:scale(.86)}
/* 4-PLAYER: the three identity dots are half of the wave-5 "whose rail is whose" read, but
   a full 22px row stole that height from four boards, so the row used to be hidden outright
   (QA W5R3-3). In ffa4 it becomes a ZERO-HEIGHT overlay instead: the boards keep every pixel
   they had while it was hidden, and the compact chips ride over the top of the canvas. */
body.cc-hud[data-cc-mode="ffa4"] #ccRivals{
  height:0;overflow:visible;position:relative;z-index:6;pointer-events:none;
  align-items:flex-start;gap:6px;
}
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-rival{
  min-width:15px;height:15px;padding:0;gap:0;background:rgba(11,7,26,.78);
}
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-rival-dot{width:6px;height:6px}
/* W12 CLEANUP #7: the mini board's own drawLivesPill already prints this rival's life
   COUNT in its own colour - this row exists for the identity dot alone now (the number
   was the second, duplicate readout QA flagged), so it is dropped rather than sized down. */
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-rival-n{display:none}
/* WAVE 34 SECTION A: in 4-PLAYER the rival row is a zero-height overlay whose chips ride over
   the three mini plates, so the shared countdown cannot share that line - it would print
   through 'CARRYING n'. It used to drop to its own centred line just under them instead -
   but every mini plate's own canvas name tag (public/js/board.js, docked left of that
   board's portal) sits at that SAME y, just at a different x for each board, and the
   centred spot always lands on the MIDDLE one (QA-BETA-CANDIDATE-W46 L-N3, measured live:
   the tag drew at screen y~97-108, dead inside the old chip's 97-115 box). WAVE 48 fix:
   moved into the free margin right of the third dot chip, in the SAME zero-height row as
   the dots and CARRYING labels (y 0-15 here, i.e. screen ~78-93) - a band that sits entirely
   ABOVE every mini plate's header (measured live: boards start at screen y~96), so it can
   never print over a name tag again, on any of the three boards. Shrunk (padding/gap/font)
   to fit the ~79px of clear margin past the third dot chip. */
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-cd{
  position:absolute;left:auto;right:2px;top:0;transform:none;
  padding:0 4px;gap:2px;height:15px;
}
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-cd .cc-cd-l{font-size:7px;letter-spacing:.2px}
/* The number span carries the shared .cc-rival-n class (so pvp/coop's countdown reuses the
   same tabular-nums styling as the per-board life count), but the ffa4 rule two blocks up
   hides .cc-rival-n outright - the per-board dot's OWN count is a duplicate of the mini
   board's own life pill there, so it is dropped. That rule was also silently eating this
   pill's own number every time (found while proving L-N3 live: textContent had the digit,
   layout did not). Restored here, scoped to just this pill's number. */
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-cd .cc-cd-n{font-size:9.5px;display:inline}
body.cc-hud[data-cc-mode="ffa4"] #ccRivals .cc-rival-carry{font-size:8px}

/* ============================================================ 6.4 CARDS */
body.cc-hud #lineupBar{
  width:100%;max-width:460px;height:var(--cc-cards-h);flex:0 0 auto;
  display:flex;gap:5px;align-items:stretch;
  padding-top:6px;padding-bottom:4px;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
}
body.cc-hud #lineupBar .slot{
  flex:1;min-width:0;position:relative;overflow:visible;
  background:linear-gradient(180deg,var(--panel2),var(--panel));
  border:var(--cc-bw) solid var(--slot-rarity,var(--ink));
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke),var(--cc-lift-1);
  border-radius:var(--cc-r-card);
  padding:0 3px;text-align:center;cursor:pointer;
  transition:box-shadow var(--cc-t-fast) linear;
}
body.cc-hud #lineupBar .slot canvas{
  width:var(--cc-mini-d);height:var(--cc-mini-d);display:block;margin:0;
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
}
body.cc-hud .cc-ring{
  position:relative;width:var(--cc-ring-d);height:var(--cc-ring-d);
  margin:14px auto 0;border-radius:50%;
  background:conic-gradient(var(--slot-rarity,var(--cc-you)) calc(var(--cc-pct,0) * 1turn),rgba(255,255,255,.10) 0);
}
body.cc-hud .cc-ring::after{
  content:'';position:absolute;inset:3px;border-radius:50%;
  background:var(--panel);z-index:0;
}
body.cc-hud .cc-ring canvas{z-index:1}
body.cc-hud .slot.cc-max .cc-ring{background:var(--pow)}

/* level badge — engine writes "LV 3" */
body.cc-hud #lineupBar .slot .lvl{
  position:absolute;top:3px;left:3px;z-index:3;
  min-width:26px;height:14px;padding:0 3px;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--cc-r-chip);background:var(--cc-chip);
  box-shadow:inset 0 0 0 1.5px var(--cc-ok);
  font:800 9.5px/1 'Nunito',sans-serif;letter-spacing:.6px;text-transform:uppercase;
  color:var(--cc-ok);
}
body.cc-hud #lineupBar .slot.cc-lvlup .lvl{background:var(--cc-ok);color:var(--ink)}
body.cc-hud #lineupBar .slot.cc-lvlup{animation:ccCardPop var(--cc-t-pop) var(--cc-pop)}
@keyframes ccCardPop{50%{transform:scale(1.10)}}

/* cost pill — engine writes "40 (bolt)" or "MAX" and toggles .no */
/* W13 BATTLE CHROME: the engine now writes "<i class=cLab>LV UP</i>50(bolt)" - see
   syncBars() in index.html. The extra micro-cap needs ~24px, so the pill takes the last 4px
   of its card back (max-width 100%-6 -> 100%-2) and the label is set two sizes down so the
   PRICE is still the loudest thing in the pill. Nothing about the 44px tap target moves:
   the whole .slot is the button, and it is 58x70. */
body.cc-hud #lineupBar .slot .cost{
  position:absolute;left:50%;bottom:13px;transform:translateX(-50%);z-index:3;
  width:56px;max-width:calc(100% - 2px);height:15px;white-space:nowrap;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--cc-r-pill);
  /* W12 CLEANUP #10: already Nunito 800 (never Bangers), tabular figures added so the
     digit width never shifts as the cost ticks and a 7 never leans on its neighbour. */
  font:800 9.5px/1 'Nunito',sans-serif;letter-spacing:.4px;
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
  background:var(--cc-energy);color:var(--ink);box-shadow:var(--cc-lift-1);
}
/* W13 FIX1: 7px was sub-legible at 1x on a 58px card, so the six cards still read as a row of
   summon prices - the label existed but could not be READ, which is the same bug. 9px is the
   smallest size that survives a 390px phone screenshot. The bolt beside it also dropped its
   60%-opacity treatment (see index.html syncBars) so the game prints ONE energy glyph at ONE
   weight in all three places it names this currency: purse, tray, SUMMON. */
body.cc-hud #lineupBar .slot .cost .cLab{
  font:inherit;font-size:8.5px;font-style:normal;letter-spacing:-.2px;opacity:.92;margin-right:1.5px;
}
body.cc-hud #lineupBar .slot .cost.cc-max .cLab{display:none}
/* W22 NAME PLATE. Six busts with a LV chip and a price and no name read as one yellow stripe
   at 360 logical px, and LEVEL UP is the one in-battle tap that asks WHICH hero. The card grew
   by exactly this plate's height instead of cropping the bust - the tray mini stays full-body,
   like a main-board unit. trayName() in index.html owns the long-name rule; the ellipsis here
   is the last safety net, and the slot's aria-label still carries the full name. */
body.cc-hud #lineupBar .slot .nm{
  position:absolute;left:2px;right:2px;bottom:2px;z-index:3;
  /* 8px in real text colour, not 6.8px in --cc-dim. At 6.8px grey the name was the QUIETEST
     thing on a card whose loudest element - the yellow LV UP / price plate - is identical on
     all six, so the tray still read as one yellow stripe. The name is what the player is
     choosing between, so it gets the weight. */
  font:900 8px/1.12 'Nunito',sans-serif;letter-spacing:0;text-transform:uppercase;
  color:#e6dfff;text-align:center;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* A 9+ character name takes the smaller step rather than losing its last letter to the
   ellipsis: 'STAR ARCHER' and 'GRAVETAKER' both print whole. buildLineupBar() adds .nmLong. */
body.cc-hud #lineupBar .slot .nm.nmLong{font-size:7px;letter-spacing:-.2px;}
body.cc-hud #lineupBar .slot .cost.no{
  background:var(--cc-chip2);color:var(--cc-energy-lo);box-shadow:none;
}
body.cc-hud #lineupBar .slot .cost.cc-max{
  background:linear-gradient(var(--pow),#f59f00);color:var(--ink);
  box-shadow:inset 0 0 0 1.5px var(--ink);
}
body.cc-hud #lineupBar .slot .cost.cc-sweep{animation:ccCostSweep 420ms var(--cc-out)}
@keyframes ccCostSweep{40%{box-shadow:var(--cc-lift-1),var(--cc-glow-pow);transform:translateX(-50%) scale(1.08)}}

/* ready glow — one shared animation phase so every ready card breathes in sync */
body.cc-hud #lineupBar .slot.cc-ready{
  box-shadow:inset 0 0 0 1.5px var(--cc-ready),0 0 0 2px rgba(143,191,116,.4),var(--cc-lift-1);
}
/* The outer glow breathes on its OWN layer: box-shadow is a paint property and would
   repaint every ready card at 60Hz all match; opacity on a promoted layer is composited. */
body.cc-hud #lineupBar .slot.cc-ready::after{
  content:'';position:absolute;inset:calc(-1 * var(--cc-bw));border-radius:inherit;pointer-events:none;
  box-shadow:0 0 0 4px rgba(143,191,116,.7);
  opacity:0;will-change:opacity;animation:ccReadyFade 1.9s ease-in-out infinite;
}
@keyframes ccReadyFade{50%{opacity:1}}
body.cc-hud #lineupBar .slot:active{
  transform:translateY(2px);
  box-shadow:inset 0 0 0 1.5px var(--cc-stroke),0 0 0 var(--ink);
}

/* ==================================================== 6.5 ABILITY PUCK */
/* W13 FIX1: the puck was anchored 9px PAST its card's right edge into a 5px inter-card gap,
   so 4px of a 44px tap target sat on the neighbouring card and the left sliver of a tray card
   fired the wrong hero's ability. It is now tucked inside its own footprint (2px of overhang,
   under the 3px minimum gap at every breakpoint) and the visible disc grew from 26px to 36px
   inside the same 44px target, so the control reads as the size it actually is. */
body.cc-hud #lineupBar .abub{
  position:absolute;top:-10px;right:-2px;
  width:44px;height:44px;border:0;background:transparent;padding:0;
  z-index:4;isolation:isolate;
  display:flex;align-items:center;justify-content:center;
  font:800 10px/1 'Nunito',sans-serif;color:var(--paper);cursor:pointer;
}
body.cc-hud #lineupBar .abub::before{
  content:'';position:absolute;inset:9px;border-radius:50%;z-index:-2;
  background:var(--bubble-bg,#3a3357);
  border:2px solid var(--ink);
}
body.cc-hud #lineupBar .abub::after{
  content:'';position:absolute;inset:13px;border-radius:50%;z-index:-1;
  background:var(--panel);box-shadow:inset 0 0 0 1px rgba(0,0,0,.35);
}
/* Cooling down is NOT disabled: the arc keeps its purple ring and the numeral stays
   paper-white - only the unfilled part of the ring is dimmed (see --bubble-bg). */
body.cc-hud #lineupBar .abub:not(.ready):not(.idle){color:var(--paper)}
body.cc-hud #lineupBar .abub:not(.ready):not(.idle)::before{
  box-shadow:0 0 0 1px rgba(112,72,232,.85),0 0 7px rgba(112,72,232,.45);
}
body.cc-hud #lineupBar .abub.ready{color:var(--ink)}
body.cc-hud #lineupBar .abub.ready::before{box-shadow:0 0 10px var(--cc-ok)}
body.cc-hud #lineupBar .abub.ready::after{background:var(--cc-ok)}
/* off cooldown, but the hero isn't on the board to use it: dim the puck instead of showing "0" */
body.cc-hud #lineupBar .abub.idle{color:var(--cc-dim)}
body.cc-hud #lineupBar .abub.idle::before{box-shadow:none}
/* W13 FIX1: only 3-4 of 6 heroes carry an active, so the tray row was a ragged mix of
   card-with-puck and card-without and nothing said why. Heroes with no active get a DEAD
   placeholder disc (index.html buildLineupBar writes a <span>, never a <button>) so all six
   cards share one silhouette; pointer-events:none keeps the whole card a single tap target. */
body.cc-hud #lineupBar .abub.ab-none{pointer-events:none;opacity:.5}
body.cc-hud #lineupBar .abub.ab-none::before{box-shadow:none;background:#2a2542}
body.cc-hud #lineupBar .abub.cc-pulse{animation:ccPuckPulse 500ms var(--cc-pop)}
@keyframes ccPuckPulse{0%{box-shadow:0 0 0 0 rgba(155,225,93,.75)}
  100%{box-shadow:0 0 0 12px rgba(155,225,93,0)}}

/* ======================================================= 6.6 ULTIMATE ROW */
body.cc-hud #ultRow{
  width:100%;max-width:460px;height:var(--cc-ult-h);flex:0 0 auto;
  display:flex;gap:6px;align-items:center;
  padding-top:0;padding-bottom:0;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
}
body.cc-hud #ultRow.hidden{display:none !important}
/* the entrance animation lives on the BUTTONS, never on #ultRow itself -
   #ultRow's class attribute is observed, so animating it would self-trigger */
body.cc-hud .ultBtn.cc-enter{animation:ccUltEnter 220ms var(--cc-out)}
@keyframes ccUltEnter{from{opacity:0;transform:translateY(-6px)}}
/* ONE cooldown language for every timed action (leader ability + every ultimate): a
   left-to-right fill rendered BEHIND the label at low alpha in a desaturated tint of the
   button's OWN hue, driven by --cc-cd = 1-(remaining/total). The label keeps --paper with
   an ink outline so it survives any fill state, and the pill has a min-width so it can
   never collapse to an unreadable sliver. transform:scaleX so the 60Hz write is
   composited and never dirties layout. */
body.cc-hud #abilityBtn::before,body.cc-hud .ultBtn.cd::before{
  content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;
  transform-origin:left center;transform:scaleX(var(--cc-cd,1));transition:none;
}
body.cc-hud .ultBtn.cd::before{background:linear-gradient(180deg,rgba(255,223,107,.55),rgba(245,159,0,.45));
  box-shadow:inset -2px 0 0 rgba(255,235,150,.95)}
body.cc-hud #abilityBtn::before{background:linear-gradient(180deg,rgba(203,182,255,.62),rgba(150,116,246,.52));
  box-shadow:inset -2px 0 0 rgba(226,213,255,.95)}
body.cc-hud .ultBtn{
  flex:1;min-width:92px;height:44px;padding:0 6px;isolation:isolate;
  font-family:'Bangers',cursive;font-size:13px;letter-spacing:1px;
  color:var(--ink);background:linear-gradient(180deg,#ffd23f,#f59f00);
  border:2px solid var(--ink);border-radius:var(--cc-r-pill);
  box-shadow:var(--cc-lift-1),inset 0 1px 0 rgba(255,255,255,.45);
  overflow:hidden;position:relative;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;
}
body.cc-hud .ultBtn:not(.cd)::after{
  content:'';position:absolute;top:-40%;left:-60%;width:40px;height:180%;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);
  transform:rotate(18deg);animation:ccShimmer 2.4s linear infinite;pointer-events:none;
  will-change:transform;
}
/* composited: `left` would relayout the button every frame, for the whole match */
@keyframes ccShimmer{0%{transform:rotate(18deg) translateX(0)}55%,100%{transform:rotate(18deg) translateX(520%)}}
/* cooling down is NOT disabled: the plate darkens, the fill above says how far along it
   is, and the label stays paper-white with an ink outline so it reads over any fill */
body.cc-hud .ultBtn.cd{background:#3f3960;color:var(--paper);box-shadow:var(--cc-lift-1);
  text-shadow:0 1px 0 var(--ink),0 -1px 0 var(--ink),1px 0 0 var(--ink),-1px 0 0 var(--ink)}

/* ========================================================= 6.7 BOTTOM BAR */
body.cc-hud #bottomBar{
  width:100%;max-width:460px;height:var(--cc-bottom-h);flex:0 0 auto;
  display:flex;gap:8px;align-items:stretch;
  padding-top:6px;padding-bottom:12px;
  padding-left:max(var(--cc-gutter),var(--sa-left,env(safe-area-inset-left,0px)));
  padding-right:max(var(--cc-gutter),var(--sa-right,env(safe-area-inset-right,0px)));
}
/* E-015: mirror only the action cluster. Keep text, DOM/tab order, board and input geometry intact. */
body.cc-left-handed #bottomBar{flex-direction:row-reverse}
body.cc-hud #abilityBtn{
  flex:1;position:relative;overflow:hidden;
  font-family:'Bangers',cursive;font-size:13px;letter-spacing:1px;line-height:1.08;   /* FEEL-96 F9: 14 -> 13 px so every leader's ability name still fits the narrower button */
  color:#fff;background:#7048e8;
  border:3px solid var(--ink);border-radius:var(--cc-r-btn);
  box-shadow:var(--cc-lift-purple);min-height:50px;padding:8px 4px 8px 10px;cursor:pointer;
}
body.cc-hud #abilityBtn{isolation:isolate;min-width:118px}
/* The 5px vertical rail plus a right-hand ink shroud were TWO cooldown languages on one
   button and neither was glanceable; both are replaced by the shared #abilityBtn::before
   fill declared with .ultBtn.cd::before above. */
/* Cooling down must not read as DISABLED: the button keeps its purple face, its purple
   lift and its white type - the shroud above is the only thing that dims it. */
body.cc-hud #abilityBtn.cd{background:#3a2c6b;color:var(--paper);
  text-shadow:0 1px 0 var(--ink),0 -1px 0 var(--ink),1px 0 0 var(--ink),-1px 0 0 var(--ink);
  box-shadow:var(--cc-lift-purple),inset 0 0 0 1.5px rgba(255,255,255,.14)}
body.cc-hud #abilityBtn.cc-charged{box-shadow:var(--cc-lift-purple),0 0 0 2px var(--cc-ok)}
body.cc-hud #abilityBtn.cc-charge-hit{animation:ccChargeGlow 500ms var(--cc-out)}
@keyframes ccChargeGlow{40%{box-shadow:var(--cc-lift-purple),0 0 0 2px var(--cc-ok),var(--cc-glow-ok)}}

body.cc-hud #summonBtn{
  flex:1.8;position:relative;   /* FEEL-96 F9: was 1.25 (1.24x the ability button's area at 360 and 390 wide); 1.8 gives 1.7-1.8x */
  font-family:'Bangers',cursive;font-size:22px;letter-spacing:2px;
  color:var(--ink);background:linear-gradient(180deg,#ffdf6b,var(--pow));
  border:3px solid var(--ink);border-radius:var(--cc-r-pill);
  box-shadow:var(--cc-lift-pow),inset 0 2px 0 rgba(255,255,255,.5);
  min-height:50px;padding:8px;cursor:pointer;
}
body.cc-hud #summonBtn.no{
  background:#4f4966;color:var(--paper);
  box-shadow:0 4px 0 #302b42;opacity:.92;animation:none;
}
body.cc-hud #summonBtn:active,body.cc-hud #abilityBtn:active{
  transform:translateY(3px);box-shadow:0 1px 0 #00000044;
}
/* Static lift stays on the button; only the blurred halo pulses, and it pulses on a
   promoted pseudo-element so nothing re-rasterises a 12px blur 60 times a second. */
body.cc-hud #summonBtn:not(.no)::after{
  content:'';position:absolute;inset:-3px;border-radius:inherit;pointer-events:none;
  box-shadow:0 0 12px 1px rgba(255,210,63,.42);
  opacity:0;will-change:opacity;animation:ccSummonIdle 2.2s ease-in-out infinite;
}
@keyframes ccSummonIdle{50%{opacity:1}}
body.cc-hud #summonBtn.cc-just-afford{animation:ccSummonHit 520ms var(--cc-pop)}
@keyframes ccSummonHit{
  0%{transform:scale(1)}
  35%{transform:scale(1.055);box-shadow:var(--cc-lift-pow),var(--cc-glow-pow)}
  100%{transform:scale(1)}
}

/* ============================================================== 6.8 BANNER */
body.cc-hud #banner{will-change:transform}

/* ========================================================== 6.9 RESULTS */
body.cc-hud .overCard{
  background:linear-gradient(180deg,var(--panel2),var(--panel));
  border:3px solid var(--ink);outline:0;
  box-shadow:inset 0 0 0 3px var(--cc-side,var(--red)),inset 0 0 0 7px var(--pow),0 10px 0 rgba(0,0,0,.35);
  border-radius:18px;padding:22px 24px;text-align:center;max-width:344px;
}
body.cc-hud .overCard.cc-enter{animation:ccCardIn 260ms var(--cc-lift-ease)}
@keyframes ccCardIn{from{opacity:0;transform:scale(.94)}}
body.cc-hud .battleStats{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
  margin:14px 0 16px;width:min(330px,82vw);
}
body.cc-hud .battleStat{
  background:var(--cc-chip);border:2px solid var(--cc-stroke);
  border-radius:var(--cc-r-card);padding:8px 5px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07);
}
body.cc-hud .battleStat.cc-in{animation:ccStatIn 260ms var(--cc-out) both}
@keyframes ccStatIn{from{opacity:0;transform:translateY(8px)}}
body.cc-hud .battleStat b{
  display:block;font-family:'Bangers',cursive;color:var(--pow);
  font-size:22px;letter-spacing:1px;line-height:1;
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
}
/* ONE value scale on this card. TOP DAMAGE / MVP used to print a "Hero Name · 1.2K"
   STRING as their value, which forced a 14px face and (for MVP) a full-width tile - the
   emotional payoff line ended up carrying the smallest type on the card. The engine now
   hands every tile a real number and moves the hero name into .statCap, so --text/--long
   only survive as a wrapping safety net and neither drops the 22px display face.
   An odd tile count centres the orphan instead of leaving it hanging on the left. */
body.cc-hud .battleStat--text b,body.cc-hud .battleStat--long b{line-height:1.15;white-space:normal}
body.cc-hud .battleStats > .battleStat:last-child:nth-child(odd){
  grid-column:1/-1;justify-self:center;width:calc(50% - 4px)}
body.cc-hud .battleStat span{
  display:block;color:var(--cc-dim);font-size:14px;font-weight:800;
  letter-spacing:.4px;margin-top:3px;
}

/* ============================================================ FOCUS RINGS */
body.cc-hud .slot:focus-visible,body.cc-hud .abub:focus-visible,
body.cc-hud #quitBtn:focus-visible,body.cc-hud #pauseBtn:focus-visible,body.cc-hud #muteBtn2:focus-visible,
body.cc-hud #abilityBtn:focus-visible,body.cc-hud #summonBtn:focus-visible,
body.cc-hud .ultBtn:focus-visible,body.cc-hud .cc-rival:focus-visible{
  outline:3px solid #fff8e7;outline-offset:2px;
}

/* ====================================================== 8.1 COMPACT HEIGHT */
@media (max-height:700px){
  body.cc-hud{
    --cc-hud-h:38px;--cc-strip-h:40px;--cc-rivals-h:20px;   /* WAVE 34 s0.4: 22 -> 40 */
    --cc-cards-h:76px;--cc-ult-h:44px;--cc-bottom-h:58px;   /* W22: +10px for the name plate */
    --cc-gutter:6px;--cc-gap:4px;--cc-bw:1.5px;
    --cc-ring-d:44px;--cc-mini-d:38px;
  }
  body.cc-hud .hudBox{padding:2px 6px;height:28px}
  body.cc-hud .hudBox .big{font-size:15px}
  body.cc-hud .cc-hearts{height:30px}
  body.cc-hud .cc-heart-glyph{width:15px;height:14px}
  body.cc-hud .cc-seg{height:2px}
  body.cc-hud .cc-mut-name{max-width:104px;font-size:10px}
  body.cc-hud .cc-clock-t{font-size:13px}
  body.cc-hud .cc-boss-face{width:16px;height:16px}
  body.cc-hud .cc-ring{margin-top:11px}
  body.cc-hud #lineupBar .slot .lvl{font-size:8.5px;min-width:23px;height:13px}
  body.cc-hud #lineupBar .slot .cost{font-size:8.5px;height:14px;width:52px;bottom:12px}
  body.cc-hud #lineupBar .slot .nm{font-size:7.5px}
  body.cc-hud #lineupBar .slot .nm.nmLong{font-size:6.6px;letter-spacing:-.25px}
  body.cc-hud #lineupBar .slot .cost .cLab{font-size:8px;margin-right:1.5px}
  body.cc-hud #lineupBar .abub{top:-9px;right:-2px}
  /* The ultimate triggers are the highest-stakes taps in the game: they keep the 44px
     touch minimum on small phones. --cc-ult-h above is already 44, so the row fits. */
  body.cc-hud .ultBtn{font-size:11px;height:44px;padding:0 4px}
  body.cc-hud #abilityBtn{font-size:12px;min-height:48px}
  body.cc-hud #summonBtn{font-size:19px;min-height:48px}
  body.cc-hud #bottomBar{padding-top:4px;padding-bottom:8px}
}
/* --------------------------------------------------------- 8.2 VERY SHORT */
@media (max-height:600px){
  body.cc-hud{--cc-strip-h:36px}   /* WAVE 34 s0.4: 18 -> 36; .cc-nw::before still gives a 48px tap box */
  body.cc-hud .cc-mut-name{display:none}
  body.cc-hud .cc-daily-t{font-size:9px;letter-spacing:.4px}
  body.cc-hud .cc-rival-dot{display:none}
}
/* ------------------------------------------------ 8.2b NARROW TRAY CARDS */
/* At 6-slot tray widths (390px and below) the 44px ability puck's left edge
   reaches far enough into the card to sit on top of the "LV n" level chip's
   digit (round-2/3 QA: 12px overlap at 390, still readable; 17px at 360,
   digit hidden). Shrinking + tucking the puck tighter into the corner keeps
   both legible without touching the level chip's own layout. */
@media (max-width:400px){
  /* W13 FIX1 - THE 58px CARD IS THE REAL CONSTRAINT. `right:-2px` lands the puck's right edge
     exactly on the card's outer edge (the offset is measured from the padding box, inside the
     card's 2px border), so the overhang into the 5px inter-card gap is ZERO and the left
     sliver of a tray card can no longer fire the neighbour's ability - which was the actual
     bug. The rest is the trade that geometry forces: at this width the "LV n" chip and the
     puck share one 58px row, so a bigger puck has to come out of the chip. The chip drops a
     size (it is a two-glyph readout, the puck is a control), and the visible disc grows from
     26px to 26px-at-a-tighter-inset on a 36px target - the same size the shipped build
     actually used here, now with no overhang and no chip collision. */
  body.cc-hud #lineupBar .abub{width:36px;height:36px;top:-8px;right:-2px}
  body.cc-hud #lineupBar .abub::before{inset:5px}
  body.cc-hud #lineupBar .abub::after{inset:9px}
  body.cc-hud #lineupBar .slot .lvl{font-size:8.5px;min-width:19px;padding:0 2px;letter-spacing:.2px}
}
/* --------------------------------------------- 8.2.1 TOP BAR, VERSUS MODES */
/* PAUSE joined the top bar next to QUIT, and versus modes also carry the rival
   life pill - together they pushed the strip ~9px past a 390px phone. The fix
   takes the AIR out (gaps + side gutters), never a tap target: quit / pause /
   mute stay 44x44 and every pill keeps its height. */
@media (max-width:430px){
  /* W13 FIX1: the chevron glyph earned its place while the pill said "W4" - a bare letter is
     not a label, so the bible's no-number-without-an-icon rule needed the glyph to carry the
     meaning. The pill says WAVE now, so on a phone the glyph is the redundant half and it is
     the 16px (icon + gap) that buys the word. The hearts pill, which was the only shrinkable
     item in this row, gets that space back: at 390px it was being squeezed until "10" clipped
     to "1(". Desktop keeps both. */
  body.cc-hud .cc-pill--wave .cc-ico{display:none}
  body.cc-hud .cc-hearts{flex:0 0 auto}
  body.cc-hud.cc-twin #hud{gap:3px;--cc-gutter:5px}
  /* E022: keep the visible versus controls44px; spare row space, not hit targets, absorbs the8px. */
  body.cc-hud.cc-twin #hud #quitBtn,
  body.cc-hud.cc-twin #hud #pauseBtn,
  body.cc-hud.cc-twin #hud #muteBtn2{width:44px;min-width:44px}
  /* The wave glyph STAYS. Being the only unlabelled number is exactly what made a bare
     "1" between two other integers unreadable (bible sec5: no number without an icon).
     The ~14px it costs comes out of pill padding and the row gap instead - one of the three
     40px buttons folds away further down this block (W47: PAUSE, not the X), which frees 40px. */
  body.cc-hud.cc-twin #hud .hudBox{padding:2px 5px}
  body.cc-hud.cc-twin #hud{--cc-gap:3px}
  /* YOUR lives are the number that must never vanish, so the hearts pill stops
     being the only shrinkable item in the row. */
  body.cc-hud.cc-twin #hud .cc-hearts{flex:0 0 auto}
  /* Even after all of the above, a versus top bar carries FOUR pills plus three
     44px buttons - about 35px more than a 390px phone has - and the pill that
     was giving way was the rival's life count. So on a phone-width versus board
     ONE button folds away.
     W47 (QA-BETA-CANDIDATE-W46 H1): it is PAUSE now, never the X. The X used to fold
     "into PAUSE" - but pvp / ffa4 / coop (exactly body.cc-twin, index.html show())
     refuse to pause, so that card never opened and the match had no exit at all on a
     phone. In these three modes PAUSE only ever said "THIS MATCH NEVER STOPS"; the X
     raises LEAVE THE MATCH? (index.html matchLeaveAsk()). Same 40px either way, so the
     row's width budget is unchanged. #pauseBtn stays in the DOM with its listener -
     display only - and endless / story / single-board modes still show both. */
  body.cc-hud.cc-twin #hud #pauseBtn{display:none}
}

/* ------------------------------------------------------------- 8.3 NARROW */
/* W439: the single-board row needs 348px even in the short-height skin, so
   centring its non-shrinking children clipped QUIT and SOUND at 320/360px.
   Give controls their own 44px row and keep all three unchanged readouts below.
   No smaller type/targets, hidden controls or board/road geometry overrides.
   The ordinary 390px-and-up layout and versus-mode pause rule stay untouched. */
@media (max-width:380px){
  body.cc-hud:not(.cc-twin){--cc-hud-h:82px}
  body.cc-hud:not(.cc-twin) #hud{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:44px 32px;gap:2px 4px;
    height:var(--cc-hud-h);min-height:var(--cc-hud-h);flex-shrink:0;
    padding-bottom:4px;justify-items:center;align-items:center;
  }
  body.cc-hud:not(.cc-twin) #hud #quitBtn{grid-column:1;grid-row:1;justify-self:start}
  body.cc-hud:not(.cc-twin) #hud #pauseBtn{grid-column:2;grid-row:1;margin-right:0}
  body.cc-hud:not(.cc-twin) #hud #muteBtn2{grid-column:3;grid-row:1;margin-left:0;justify-self:end}
  body.cc-hud:not(.cc-twin) #hud .cc-hearts{grid-column:1;grid-row:2}
  body.cc-hud:not(.cc-twin) #hud .cc-pill--wave{grid-column:2;grid-row:2}
  body.cc-hud:not(.cc-twin) #hud .cc-pill--energy{grid-column:3;grid-row:2}
  /* Versus already fits because its life/countdown live on the divider. Its
     existing 40px targets can safely regain the full 44px at these widths. */
  body.cc-hud.cc-twin #hud #quitBtn,
  body.cc-hud.cc-twin #hud #muteBtn2{width:44px;min-width:44px}
  body.cc-hud.cc-twin{--cc-hud-h:44px}
}
@media (max-width:340px){
  body.cc-hud .cc-hearts{flex-direction:column}
  body.cc-hud .cc-hearts .cc-pips{display:none}
  /* At 340px the chevron genuinely cannot fit, so only the WORD (added at every width in
     6.1.3) is left to carry the meaning - "WAVE 5" is narrower than icon+word+digit and is
     still self-describing, which a bare "W5" never was. */
  body.cc-hud .cc-pill--wave{min-width:54px}
  body.cc-hud .cc-pill--wave #wave::before{font-size:.5em;margin-right:2px}
  body.cc-hud .cc-pill--wave .cc-ico{display:none}
  body.cc-hud #lineupBar{gap:3px}
}

/* ====================================================== REDUCED MOTION ==== */
/* Paired: the OS query AND the in-game toggle (body.cc-rm), per spec s7.
   Press feedback (:active transforms) is deliberately NOT suppressed.        */
@media (prefers-reduced-motion:reduce){
  body.cc-hud .cc-hearts.cc-hit{animation:ccBgFlash 180ms linear}
  body.cc-hud .cc-hearts.cc-low .cc-heart-glyph,
  body.cc-hud .cc-hearts.cc-low .cc-segs,
  body.cc-hud .cc-hearts.cc-crit .cc-heart-glyph,
  body.cc-hud .cc-hearts.cc-crit .cc-segs,
  body.cc-hud .cc-hearts.cc-heal,
  body.cc-hud .cc-pill--foe.cc-hit,
  body.cc-hud .cc-pill--wave.cc-flip #wave,
  body.cc-hud .hudBox.pop,
  body.cc-hud .cc-boss.cc-inbound,
  body.cc-hud .cc-boss.cc-live,
  body.cc-hud .cc-boss.cc-live::after,
  body.cc-hud .cc-boss.cc-ping,
  body.cc-hud .cc-clock.cc-urgent .cc-clock-t,
  body.cc-hud .cc-rival.cc-ko,
  body.cc-hud #lineupBar .slot.cc-lvlup,
  body.cc-hud #lineupBar .slot.cc-ready,
  body.cc-hud #lineupBar .slot.cc-ready::after,
  body.cc-hud #lineupBar .slot .cost.cc-sweep,
  body.cc-hud #lineupBar .abub.cc-pulse,
  body.cc-hud .ultBtn.cc-enter,
  body.cc-hud .ultBtn:not(.cd)::after,
  body.cc-hud #summonBtn:not(.no),
  body.cc-hud #summonBtn:not(.no)::after,
  body.cc-hud #summonBtn.cc-just-afford,
  body.cc-hud #abilityBtn.cc-charge-hit,
  body.cc-hud .overCard.cc-enter,
  body.cc-hud .battleStat.cc-in{animation:none}
  body.cc-hud .battleStat.cc-in{opacity:1;transform:none}
  body.cc-hud .cc-seg,body.cc-hud .cc-threat>i{transition:none}
  body.cc-hud .cc-clock.cc-urgent .cc-clock-t{color:var(--cc-danger)}
  body.cc-hud .cc-boss.cc-inbound{background:var(--cc-boss)}
  body.cc-hud .cc-boss.cc-inbound .cc-boss-t,
  body.cc-hud .cc-boss.cc-inbound .cc-boss-glyph{color:var(--ink)}
  body.cc-hud #lineupBar .slot.cc-ready{
    box-shadow:inset 0 0 0 1.5px var(--cc-ready),0 0 0 4px rgba(143,191,116,.7),var(--cc-lift-1);
  }
  body.cc-hud #lineupBar .slot.cc-ready::after{display:none}
  body.cc-hud #summonBtn:not(.no)::after{display:none}
  body.cc-hud .cc-boss.cc-live::after{display:none}
}
body.cc-hud.cc-rm .cc-hearts.cc-hit{animation:ccBgFlash 180ms linear}
body.cc-hud.cc-rm .cc-hearts.cc-low .cc-heart-glyph,
body.cc-hud.cc-rm .cc-hearts.cc-low .cc-segs,
body.cc-hud.cc-rm .cc-hearts.cc-crit .cc-heart-glyph,
body.cc-hud.cc-rm .cc-hearts.cc-crit .cc-segs,
body.cc-hud.cc-rm .cc-hearts.cc-heal,
body.cc-hud.cc-rm .cc-pill--foe.cc-hit,
body.cc-hud.cc-rm .cc-pill--wave.cc-flip #wave,
body.cc-hud.cc-rm .hudBox.pop,
body.cc-hud.cc-rm .cc-boss.cc-inbound,
body.cc-hud.cc-rm .cc-boss.cc-live,
body.cc-hud.cc-rm .cc-boss.cc-live::after,
body.cc-hud.cc-rm .cc-boss.cc-ping,
body.cc-hud.cc-rm .cc-clock.cc-urgent .cc-clock-t,
body.cc-hud.cc-rm .cc-rival.cc-ko,
body.cc-hud.cc-rm #lineupBar .slot.cc-lvlup,
body.cc-hud.cc-rm #lineupBar .slot.cc-ready,
body.cc-hud.cc-rm #lineupBar .slot.cc-ready::after,
body.cc-hud.cc-rm #lineupBar .slot .cost.cc-sweep,
body.cc-hud.cc-rm #lineupBar .abub.cc-pulse,
body.cc-hud.cc-rm .ultBtn.cc-enter,
body.cc-hud.cc-rm .ultBtn:not(.cd)::after,
body.cc-hud.cc-rm #summonBtn:not(.no),
body.cc-hud.cc-rm #summonBtn:not(.no)::after,
body.cc-hud.cc-rm #summonBtn.cc-just-afford,
body.cc-hud.cc-rm #abilityBtn.cc-charge-hit,
body.cc-hud.cc-rm .overCard.cc-enter,
body.cc-hud.cc-rm .battleStat.cc-in{animation:none}
body.cc-hud.cc-rm .battleStat.cc-in{opacity:1;transform:none}
body.cc-hud.cc-rm .cc-seg,body.cc-hud.cc-rm .cc-threat>i{transition:none}
body.cc-hud.cc-rm .cc-clock.cc-urgent .cc-clock-t{color:var(--cc-danger)}
body.cc-hud.cc-rm .cc-boss.cc-inbound{background:var(--cc-boss)}
body.cc-hud.cc-rm .cc-boss.cc-inbound .cc-boss-t,
body.cc-hud.cc-rm .cc-boss.cc-inbound .cc-boss-glyph{color:var(--ink)}
body.cc-hud.cc-rm #lineupBar .slot.cc-ready{
  box-shadow:inset 0 0 0 1.5px var(--cc-ready),0 0 0 4px rgba(143,191,116,.7),var(--cc-lift-1);
}
body.cc-hud.cc-rm #lineupBar .slot.cc-ready::after{display:none}
body.cc-hud.cc-rm #summonBtn:not(.no)::after{display:none}

/* ====================================== 6.4b W61d THE SEVEN-CARD STORY TRAY */
/* docs/specs/STORY-ENGINE-61.md 4.5 PLAN A (docs/notes/W61d-coach-seat.md). body.tray7 is set by
   index.html buildLineupBar() ONLY for a seven-card book-2 story tray (the player's six + Coach's
   padlocked seat, or six + seat 7 while he is benched); every other battle - book 1, the tutorial,
   Endless, Clash, Co-op, 4-Player, Daily - never carries it, so nothing above changes for them.
   Seven cards need ~46px each at 360px: a 4px gap, a 28px mini in a 34px ring, the LV UP micro-label
   dropped from the price pill (price + bolt only), names capped at 7 letters by trayName(k,7), and a
   30px ability puck tucked into the corner. The 44px tap width and the card height do not move. */
body.cc-hud.tray7 #lineupBar{gap:4px;--cc-mini-d:28px;--cc-ring-d:34px}
body.cc-hud.tray7 #lineupBar .slot{padding:0 2px}
body.cc-hud.tray7 #lineupBar .cc-ring{margin-top:14px}
body.cc-hud.tray7 #lineupBar .slot .cost .cLab{display:none}
body.cc-hud.tray7 #lineupBar .slot .cost{width:auto;min-width:28px;max-width:calc(100% - 2px);padding:0 3px;font-size:9px;letter-spacing:.2px}
body.cc-hud.tray7 #lineupBar .slot .nm{left:1px;right:1px;font-size:7.4px;letter-spacing:-.1px}
body.cc-hud.tray7 #lineupBar .slot .nm.nmLong{font-size:7px;letter-spacing:-.2px}
body.cc-hud.tray7 #lineupBar .slot .lvl{top:2px;left:2px;min-width:17px;height:13px;padding:0 2px;font-size:8px;letter-spacing:.1px}
body.cc-hud.tray7 #lineupBar .abub{width:30px;height:30px;top:-8px;right:-3px}
body.cc-hud.tray7 #lineupBar .abub::before{inset:4px}
body.cc-hud.tray7 #lineupBar .abub::after{inset:8px}

/* COACH'S SEAT (spec 4.1 / 4.3): the padlocked COACH card - chalkboard green, a lock where the puck
   would sit; in the quiet state NOBODY STAYS BEHIND is chalked across his portrait. */
body.cc-hud #lineupBar .slot.coachSeat{background:linear-gradient(180deg,#2c3d2c,#1c291d)}
body.cc-hud #lineupBar .slot .coachLock{
  position:absolute;top:-5px;right:-4px;z-index:4;width:19px;height:19px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;pointer-events:none;
  background:var(--pow);box-shadow:0 0 0 1.5px var(--ink);color:var(--ink);
}
body.cc-hud #lineupBar .slot .coachLock .ci{width:12px;height:12px;filter:brightness(0)}
body.cc-hud #lineupBar .slot .coachChalk{
  position:absolute;left:1px;right:1px;top:17px;z-index:2;pointer-events:none;text-align:center;
  font:400 7.5px/1.02 'Bangers',cursive;letter-spacing:.45px;color:rgba(255,255,255,.92);
  text-shadow:0 0 1px rgba(255,255,255,.65),0 1px 1px rgba(0,0,0,.9);transform:rotate(-9deg);
}
/* Benched Coach with a spare column: her grey card, SILENT. Not a button (pointer-events none). */
body.cc-hud #lineupBar .slotSilent{
  flex:1;min-width:0;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  border:var(--cc-bw) dashed #6b6780;border-radius:var(--cc-r-card);background:#221d33;
  filter:grayscale(1);opacity:.8;pointer-events:none;
}
body.cc-hud #lineupBar .slotSilent canvas{width:var(--cc-mini-d);height:var(--cc-mini-d);display:block}
body.cc-hud #lineupBar .slotSilent .nm{font:900 7.4px/1.1 'Nunito',sans-serif;color:#cfc8e6;text-transform:uppercase}
body.cc-hud #lineupBar .slotSilent .ssTag{font:400 9px/1 'Bangers',cursive;letter-spacing:.6px;color:#cfc8e6;
  border:1.5px solid currentColor;border-radius:999px;padding:1px 4px 0}

/* COACH'S SPEECH TAB (spec 4.3): above her card (or under the WAVE counter in m1, where she has none).
   Text only, 2.4 s, never a tap target. Reduce Motion drops the slide-in, never the words. */
.coachTab{
  position:absolute;z-index:60;max-width:220px;padding:5px 9px 6px;pointer-events:none;
  background:#fffdf5;color:#1b1430;border:2.5px solid #1b1430;border-radius:12px;
  font:400 13px/1.15 'Bangers',cursive;letter-spacing:.5px;box-shadow:0 3px 0 rgba(0,0,0,.35);
  animation:ctIn .22s cubic-bezier(.2,1.6,.4,1);
}
.coachTab .ctWho{display:block;margin-bottom:2px;font:900 8.5px/1 'Nunito',sans-serif;letter-spacing:1px;color:#6b4e00}
.coachTab::after{
  content:'';position:absolute;left:var(--ct-tail,50%);width:9px;height:9px;background:#fffdf5;
  border:2.5px solid #1b1430;transform:translateX(-50%) rotate(45deg);
}
.coachTab.down::after{bottom:-7px;border-top:0;border-left:0}
.coachTab.up::after{top:-7px;border-bottom:0;border-right:0}
@keyframes ctIn{from{opacity:0;transform:translateY(6px) scale(.92)}}
body.cc-rm .coachTab{animation:none}
@media (prefers-reduced-motion:reduce){.coachTab{animation:none}}

/* ================================= 6.4c W61f THE STORY RULE TIP (book 2 only)
   A book-2 rule's ONE-TIME tip: a small plate at the top of the board, under the HUD strip. Never
   a card that stops the fight, never a pause (the W44 in-battle rule); a tap or ~8.5 sim seconds
   puts it away. Later plays show the caption alone. EXTRA MILE (W61f): the comic CAPTION BOX -
   STORY RULE: <NAME>, in the house lettering - slides in a beat before the words. The element is
   made by index.html (storyTipEl) only when a book-2 rule fires, so book 1 never has one. */
#storyTip{
  position:fixed;left:50%;top:96px;z-index:59;width:min(330px,calc(100vw - 24px));
  transform:translateX(-50%);pointer-events:none;opacity:0;transition:opacity .16s linear;
}
#storyTip.hidden{display:none}
#storyTip.on{opacity:1;pointer-events:auto;cursor:pointer}
#storyTip .stCap{
  position:relative;z-index:2;display:inline-block;max-width:calc(100% - 16px);box-sizing:border-box;margin-left:8px;
  padding:3px 9px 2px;background:#ffd23f;color:#1b1430;border:2.5px solid #1b1430;border-radius:4px;
  font:400 14px/1.15 'Bangers',cursive;letter-spacing:1.1px;box-shadow:0 3px 0 rgba(4,2,12,.45);
  transform:rotate(-2deg);opacity:0;
}
#storyTip .stCapK{color:#8a2a00}
#storyTip.on .stCap{animation:stCapIn .26s cubic-bezier(.2,1.6,.4,1) forwards}
#storyTip .stPlate{
  margin-top:-7px;padding:9px 11px 6px;background:#fff8e7;color:#1b1430;border:3px solid #1b1430;
  border-radius:13px;box-shadow:0 4px 0 rgba(4,2,12,.45);opacity:0;
}
#storyTip.on .stPlate{animation:stPlateIn .2s ease-out .22s forwards}
#storyTip .stText{display:inline;font:800 12px/16px 'Nunito',sans-serif}
#storyTip .stOk{display:inline-block;margin-left:7px;font:400 12px/1 'Bangers',cursive;letter-spacing:1.3px;color:#a3781a;white-space:nowrap}
#storyTip.stChip .stPlate{display:none}
@keyframes stCapIn{from{opacity:0;transform:rotate(-2deg) translateX(-16px)}to{opacity:1;transform:rotate(-2deg) translateX(0)}}
@keyframes stPlateIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
body.cc-rm #storyTip.on .stCap,body.cc-rm #storyTip.on .stPlate{animation:none;opacity:1}
@media (prefers-reduced-motion:reduce){#storyTip.on .stCap,#storyTip.on .stPlate{animation:none;opacity:1}}

/* ================================= 6.4d W61g THE STORY RULE CHIPS (book 2 only)
   A book-2 rule's live readout on the mode strip (#ccStrip): the pile's health, the kettle's name,
   the cold room's thermometer, NOW SERVING, the relay... index.html (storyHudTick) makes #ccStory
   only when a book-2 rule runtime is live, sitting between the (story-hidden) mutator pill and the
   boss chip; it takes the free width of the strip and SHRINKS first, so the boss chip and NEXT
   WAVE never move. One chip seats on a 360 px phone, two where there is room; when the rules have
   more, index.html gives them turns. Label ellipsises, the value never does. */
body.cc-hud .cc-story{display:flex;align-items:center;gap:4px;flex:1 1 0;min-width:0;overflow:hidden;height:20px}
body.cc-hud .cc-story[hidden]{display:none}
body.cc-hud .cc-story .csChip{display:flex;align-items:center;gap:4px;flex:0 1 auto;min-width:0;max-width:100%;
  height:20px;padding:0 6px;box-sizing:border-box;border-radius:var(--cc-r-chip);background:var(--cc-glass);
  box-shadow:inset 0 0 0 1.5px #b08900}
body.cc-hud .cc-story .csChip[hidden]{display:none}
body.cc-hud .cc-story .csL{font:800 10px/1 'Nunito',sans-serif;letter-spacing:.4px;color:var(--paper);
  flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.cc-hud .cc-story .csV{font:400 13px/1 'Bangers',cursive;letter-spacing:.6px;color:#ffd23f;flex:0 0 auto;white-space:nowrap;
  font-variant-numeric:tabular-nums}
body.cc-hud .cc-story .csV[hidden]{display:none}
body.cc-hud .cc-story .csBar{display:block;flex:0 0 auto;width:26px;height:5px;border-radius:3px;background:rgba(255,255,255,.16);overflow:hidden}
body.cc-hud .cc-story .csBar[hidden]{display:none}
body.cc-hud .cc-story .csBar>i{display:block;height:100%;width:100%;border-radius:3px;background:#ffd23f}
body.cc-hud .cc-story .csChip.csWarn{box-shadow:inset 0 0 0 1.5px #ff6b6b,0 0 0 1px rgba(255,107,107,.35)}
body.cc-hud .cc-story .csChip.csWarn .csV{color:#ff8787}
body.cc-hud .cc-story .csChip.csWarn .csBar>i{background:#ff6b6b}
body.cc-hud .cc-story .csChip.csGood{box-shadow:inset 0 0 0 1.5px #74c0fc}
body.cc-hud .cc-story .csChip.csGood .csV{color:#a5d8ff}
body.cc-hud .cc-story .csChip.csGood .csBar>i{background:#74c0fc}
@media (max-height:600px){body.cc-hud .cc-story .csL{font-size:9px}}

/* ================================= 6.4e W61h THE RING CHIP (book 2 only)
   The in-battle phone (docs/specs/STORY-ENGINE-61.md 9.4): at a mission's ring wave the desk phone rings
   once and this small phone wiggles on the mode strip - its first item, before the rule chips (the
   strip's middle, under the wave pill, belongs to the boss chip and NEXT WAVE on a 360 px phone) - then
   settles to a dim phone with a dot for the rest of the fight. It never interrupts play: no tap
   target (pointer-events:none), no words, no caller (index.html makes it aria-hidden). It is a flow item
   of #ccStrip - above the canvas and above the lineup bar by construction, so it can never cover the
   board or the tray, and its fixed 22 px only narrows the rule chips' free width (they re-measure every
   HUD tick). The wiggle is phone.js's choice (off under Reduce Motion); the two media rules are belts. */
body.cc-hud .cc-phone{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 auto;
  width:22px;height:20px;box-sizing:border-box;border-radius:var(--cc-r-chip);background:var(--cc-glass);
  box-shadow:inset 0 0 0 1.5px #ffd23f;color:#ffd23f;pointer-events:none;transition:opacity .35s ease}
body.cc-hud .cc-phone[hidden]{display:none}
body.cc-hud .cc-phone svg{width:13px;height:13px;display:block;fill:currentColor}
body.cc-hud .cc-phone .cc-phone-dot{position:absolute;top:2px;right:2px;width:5px;height:5px;border-radius:50%;
  background:#ff6b6b;box-shadow:0 0 0 1px rgba(27,20,48,.9);display:none}
body.cc-hud .cc-phone.is-ringing{box-shadow:inset 0 0 0 1.5px #ffd23f,0 0 0 2px rgba(255,210,63,.35)}
body.cc-hud .cc-phone.is-wiggle svg{animation:ccPhoneWiggle .16s ease-in-out infinite alternate}
@keyframes ccPhoneWiggle{from{transform:rotate(-14deg)}to{transform:rotate(14deg)}}
body.cc-hud .cc-phone.is-settled{opacity:.62;box-shadow:inset 0 0 0 1.5px rgba(255,210,63,.55);color:rgba(255,248,231,.85)}
body.cc-hud .cc-phone.is-settled .cc-phone-dot{display:block}
@media (prefers-reduced-motion:reduce){body.cc-hud .cc-phone.is-wiggle svg{animation:none}}
body.cc-rm .cc-phone.is-wiggle svg{animation:none}

/* ==========================================================================================================
   FEEL-96 F3 (lane A, "CRISP"; docs/specs/FEEL-96.md): ONE OCCUPANT IN THE STRIP, TWO FLASHERS AT MOST.
   public/js/hud.js decides. ccStripSlot() lets one message hold the strip's lane at a time (a kind that lost it gets
   .cc-slot-off: calmed - no pulse, no red, dimmed - but never hidden, so the number stays readable); the flasher registry lets two persistent pulses run (it puts
   .cc-fl on the granted ones). A pulse that was NOT granted stands still - its static look is untouched: the ready
   cards keep their ring, the summon button its lift, the boss chip its outline. Additive on purpose: no rule above
   was edited, so nothing here changes with the HUD module absent (body.cc-hud is its mark).
   ========================================================================================================== */
body.cc-hud #ccStrip .cc-slot-off,
body.cc-hud #ccStrip .cc-slot-off::after{animation:none !important}
body.cc-hud #ccStrip .cc-boss.cc-slot-off,
body.cc-hud #ccStrip .cc-nw.cc-slot-off{opacity:.55}
body.cc-hud #ccStrip .cc-clock.cc-slot-off .cc-clock-t{color:var(--paper) !important}
body.cc-hud .cc-hearts.cc-low:not(.cc-fl) .cc-heart-glyph,
body.cc-hud .cc-hearts.cc-low:not(.cc-fl) .cc-segs{animation:none}
body.cc-hud .cc-cd.cc-cd-urgent:not(.cc-fl){animation:none}
body.cc-hud .cc-boss.cc-inbound:not(.cc-fl){animation:none}
body.cc-hud .cc-boss.cc-live:not(.cc-fl)::after{animation:none}
body.cc-hud #summonBtn:not(.no):not(.cc-fl)::after{animation:none}
body.cc-hud #lineupBar:not(.cc-fl) .slot.cc-ready::after{animation:none}
body.cc-hud #ultRow:not(.cc-fl) .ultBtn:not(.cd)::after{animation:none}
/* FEEL-96 F5: the TIME! beat tints the strip once, 240 ms, alpha-capped (a tile-sized, single event: no white, no strobe). */
body.cc-hud #ccStrip.cc-strip-flash{animation:ccStripFlash 240ms linear}
@keyframes ccStripFlash{0%{background:rgba(255,107,107,.30)}100%{background:rgba(255,107,107,0)}}
body.cc-rm #ccStrip.cc-strip-flash{animation:none;background:rgba(255,107,107,.16)}
@media (prefers-reduced-motion:reduce){body.cc-hud #ccStrip.cc-strip-flash{animation:none;background:rgba(255,107,107,.16)}}

/* ================================================== FLASHES OFF (W104 / D23) ====
   SETTINGS -> FLASHES: OFF puts body.cc-nf on the page. Every blink, strobe and white flash on the HUD goes quiet (the heart's shake
   stays unless ANIMATIONS is NONE), and the comic / chest / cut-in wash layers are hidden. The battle canvas's own flashes are
   switched off in the game script. */
body.cc-nf .cc-hearts.cc-heal,body.cc-nf .cc-cd.cc-cd-urgent,body.cc-nf .cciFlash,body.cc-nf .ccsFlash,body.cc-nf .cpFlash{animation:none!important}
body.cc-nf .cciFlash,body.cc-nf .ccsFlash,body.cc-nf .cpFlash{display:none!important}
body.cc-hud.cc-nf:not(.cc-rm) .cc-hearts.cc-hit,body.cc-hud.cc-nf:not(.cc-rm) .cc-pill--foe.cc-hit{animation:ccShake var(--cc-t-shake) ease-in-out!important}
body.cc-hud.cc-nf.cc-rm .cc-hearts.cc-hit,body.cc-hud.cc-nf.cc-rm .cc-pill--foe.cc-hit{animation:none!important}

/* ================================================== ANIMATIONS: SOME (W104 / D23) ====
   SOME keeps the short essentials (the pops, the hit feedback, the callouts) and drops the long and idle loops. body.cc-some is set by the
   game script (applyReducedMotion); NONE is the older body.cc-rm. */
body.cc-hud.cc-some .cc-hearts.cc-low .cc-segs,body.cc-hud.cc-some .cc-boss.cc-inbound,body.cc-hud.cc-some .cc-boss.cc-live::after,
body.cc-hud.cc-some #lineupBar .slot.cc-ready::after,body.cc-hud.cc-some .ultBtn:not(.cd)::after,body.cc-hud.cc-some #summonBtn:not(.no)::after{animation:none}

/* ==========================================================================================================
   FEEL-96 F14 (lane C, "NUMBERS"; docs/specs/FEEL-96.md): THE HEARTS DIGIT ROLLS. hud.js puts .cc-roll on #lives for 300 ms whenever the
   life count changes: the new number drops in from above, dips a touch past its seat and settles (a vault turning one notch).
   ANIMATIONS: NONE (body.cc-rm) and the OS reduce-motion preference: the number simply changes. Additive; no rule above was edited.
   ========================================================================================================== */
body.cc-hud .cc-hearts #lives.cc-roll{display:inline-block;animation:ccLifeRoll 300ms cubic-bezier(.2,.9,.3,1) both}
@keyframes ccLifeRoll{
  0%{transform:translateY(-70%) scale(1.3);opacity:0}
  35%{opacity:1}
  72%{transform:translateY(8%) scale(.94)}
  100%{transform:none;opacity:1}}
body.cc-hud.cc-rm .cc-hearts #lives.cc-roll{animation:none}
@media (prefers-reduced-motion:reduce){body.cc-hud .cc-hearts #lives.cc-roll{animation:none}}

/* ==========================================================================================================
   FEEL-96 F13 (lane C, "NUMBERS"; docs/specs/FEEL-96.md): THE ECONOMY TRAVELS. index.html sends 2-3 gold coin chips from each kill on
   your board to the bolt on the SUMMON button (~400 ms); the pill pops and its number rolls up when a coin LANDS. The chips live in
   #coinLayer96 (a fixed, click-through layer above the canvas: the button and the pill are outside it) and are placed by transform
   only. The saver tier / ANIMATIONS: NONE send no coin: a +N chip (.coinchip96) shows under the pill. Additive; no rule above was edited.
   ========================================================================================================== */
#coinLayer96{position:fixed;left:0;top:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:40}
#coinLayer96.resultCoins132{z-index:80}
#coinLayer96.resultCoins132>.coin96:not(.resultCoin132),#coinLayer96.resultCoins132>.coinchip96{display:none}
.resultCoin132{font:12px/1 Bangers,cursive;color:#1b1430;font-style:normal}
.rwCoin132 .rwCoinText132{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.rwCoinValue132{display:inline-block;font:inherit;vertical-align:baseline;text-align:right;font-variant-numeric:tabular-nums}
.rwCoinValue132.coinGlint132{color:#fff3bf}
.coin96{position:absolute;left:-8.5px;top:-8.5px;width:17px;height:17px;box-sizing:border-box;border-radius:50%;opacity:0;
  background:radial-gradient(circle at 35% 30%,#fff3bf 0,#ffd23f 55%,#e8a317 100%);border:1.5px solid #1b1430;
  display:flex;align-items:center;justify-content:center;will-change:transform,opacity}
.coin96 .ci{width:9px;height:9px;color:#1b1430;display:block}
.coin96 .ci svg{width:9px;height:9px;display:block;fill:currentColor}
.coinchip96{position:absolute;display:none;transform:translateX(-50%);font:19px/1 Bangers,cursive;letter-spacing:.5px;color:#ffd23f;
  text-shadow:-1.5px -1.5px 0 #1b1430,1.5px -1.5px 0 #1b1430,-1.5px 1.5px 0 #1b1430,1.5px 1.5px 0 #1b1430;pointer-events:none;white-space:nowrap}
body.cc-hud #summonBtn.cc-coin-in .ci{display:inline-block;animation:ccCoinBolt 180ms ease-out}
@keyframes ccCoinBolt{0%{transform:scale(1)}35%{transform:scale(1.55) rotate(-8deg)}100%{transform:scale(1)}}
body.cc-hud.cc-rm #summonBtn.cc-coin-in .ci{animation:none}
@media (prefers-reduced-motion:reduce){body.cc-hud #summonBtn.cc-coin-in .ci{animation:none}}

/* ==========================================================================================================
   W327 HUD READABILITY (lane B, docs/notes/W327-hud-readability.md): catalogue items E-031, E-032, E-046, E-051,
   E-052, E-072, E-029, E-038. DOM / CSS only over the canvas; no board, road or canvas box moves. Additive rules.
   ========================================================================================================== */
/* E-032: the boss chip names the cure while its villain winds up (TAP IT / HIT HIM / WAIT ...): his face + two words */
body.cc-hud .cc-boss .cc-cure{display:inline-flex;align-items:center;height:16px;padding:0 5px;border-radius:5px;
  font:800 10px/1 'Nunito',sans-serif;letter-spacing:.3px;white-space:nowrap;color:#1b1430;
  background:var(--cc-cure-col,var(--cc-boss));box-shadow:inset 0 0 0 1.5px rgba(27,20,48,.55)}
body.cc-hud .cc-boss .cc-cure[hidden]{display:none}
body.cc-hud .cc-boss.cc-curing .cc-boss-t{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus .cc-boss .cc-cure{height:15px;font-size:9px;padding:0 4px}

/* E-031 / E-052: the rule card under the 44 px rule icon (a tap opens it, a tap or 4.5 s closes it) */
.cc-rule-card{position:fixed;z-index:64;max-width:min(300px,calc(100vw - 12px));box-sizing:border-box;
  padding:7px 10px 8px;border-radius:12px;background:#fff8e7;color:#1b1430;border:2.5px solid #1b1430;
  box-shadow:0 3px 0 #1b1430,0 8px 18px rgba(0,0,0,.35);cursor:pointer;animation:ccRuleIn 160ms cubic-bezier(.2,1.3,.4,1) both}
.cc-rule-card[hidden]{display:none}
.cc-rule-card .cc-rc-k{font:800 9px/1.2 'Nunito',sans-serif;letter-spacing:1px;color:#7048e8}
.cc-rule-card .cc-rc-n{font:18px/1.05 'Bangers',cursive;letter-spacing:1px;margin:1px 0 2px}
.cc-rule-card .cc-rc-d{font:700 12px/1.25 'Nunito',sans-serif}
.cc-rule-card .cc-rc-d:empty{display:none}
.cc-rule-card .cc-rc-l{list-style:none;margin:6px 0 0;padding:6px 0 0;border-top:1.5px dashed rgba(27,20,48,.35);
  display:grid;gap:3px;font:800 11px/1.2 'Nunito',sans-serif}
.cc-rule-card .cc-rc-l[hidden]{display:none}
.cc-rule-card .cc-rc-l li:first-child{color:#c92a2a}
@keyframes ccRuleIn{from{opacity:0;transform:translateY(-6px) scale(.96)}}
.cc-mut-ghost{position:fixed;left:50%;top:42%;z-index:63;transform:translate(-50%,-50%);pointer-events:none;
  padding:4px 12px;border-radius:999px;background:#fff8e7;color:#1b1430;border:2px solid #1b1430;
  font:20px/1.1 'Bangers',cursive;letter-spacing:1px;white-space:nowrap}
body.cc-hud #ccStrip button.cc-mut.cc-mut-land::after{animation:ccMutLand 420ms var(--cc-pop,ease-out)}
@keyframes ccMutLand{0%{transform:scale(1)}40%{transform:scale(1.45);box-shadow:inset 0 0 0 1.5px var(--cc-mut-color,var(--cc-dim)),0 0 10px 2px #ffd23f}100%{transform:scale(1)}}
body.cc-hud.cc-rm .cc-rule-card,body.cc-hud.cc-rm #ccStrip button.cc-mut.cc-mut-land::after{animation:none}
@media (prefers-reduced-motion:reduce){.cc-rule-card,body.cc-hud #ccStrip button.cc-mut.cc-mut-land::after{animation:none}}

/* E-046: a match sticker crossing the divider row - the row narrows to the clear gap beside it (hud.js sets the two edges) and the boss
   chip shows only his face; the full words come back when the sticker goes. */
body.cc-hud.cc-divider-hud #ccStrip .cc-battle-status.cc-dock-yield{
  left:var(--cc-dock-l,104px);right:var(--cc-dock-r,4px);justify-content:center}
body.cc-hud.cc-divider-hud #ccBattleStatus.cc-dock-yield .cc-boss-t,
body.cc-hud.cc-divider-hud #ccBattleStatus.cc-dock-yield #ccRivals .cc-cd-l{display:none}
body.cc-hud.cc-divider-hud #ccBattleStatus.cc-dock-yield .cc-boss{max-width:none}

/* E-072: the reaction button sits on the right of the leader's ability (the thumb zone); its picker opens just above the bottom bar */
body.cc-hud.cc-emote-low #bottomBar #emoteBtn{flex:0 0 44px;width:44px;min-width:44px;height:auto;align-self:center;min-height:44px;
  color:#e5f4ff}
body.cc-hud.cc-emote-low #bottomBar #emoteBtn.hidden{display:none}
body.cc-hud.cc-emote-low #bottomBar #emoteBtn::before{width:40px;height:40px;background:#173b59;border:2px solid #52789d}
body.cc-hud.cc-emote-low #bottomBar #emoteBtn .ci{position:relative;z-index:1}
body.cc-hud.cc-emote-low #bottomBar:has(#emoteBtn:not(.hidden)) #abilityBtn{flex:0 1 auto;min-width:126px;max-width:150px}
body.cc-hud.cc-emote-low #emotePanel{top:auto;bottom:calc(var(--cc-bottom-h) + 6px)}

/* E-051: the leader's cooldown is a clock ring on the left of the ability button, with the full cooldown printed inside;
   it replaces the left-to-right fill on this one button (the ultimates keep theirs). --cc-cd: 0 cold .. 1 charged. */
body.cc-hud #abilityBtn{padding-left:42px}
body.cc-hud #abilityBtn::before{
  inset:auto;left:5px;top:50%;width:31px;height:31px;margin-top:-15.5px;border-radius:50%;z-index:0;transform:none;
  background:radial-gradient(circle,#2a1f55 0 57%,transparent 58%),
    conic-gradient(#ffd23f calc(var(--cc-cd,1) * 360deg),rgba(255,255,255,.2) 0);
  box-shadow:0 0 0 2px var(--ink,#1b1430);
  content:var(--cc-ab-cost,'');display:flex;align-items:center;justify-content:center;
  font:10px/1 'Bangers',cursive;letter-spacing:0;color:#fff8e7;text-shadow:none;
}
body.cc-hud #abilityBtn.cc-charged::before{background:radial-gradient(circle,#2a1f55 0 57%,transparent 58%),#69db7c;
  box-shadow:0 0 0 2px var(--ink,#1b1430),0 0 8px 1px rgba(105,219,124,.75)}

/* E-029: a held hero WITH effects gets one small line beside its (unchanged, D32) name chip: battle level + each effect and its seconds */
.cc-uc-strip{position:fixed;z-index:66;transform:translate(-50%,-100%);pointer-events:none;display:flex;gap:3px;white-space:nowrap;
  font:800 10px/1.2 'Nunito',sans-serif;letter-spacing:.2px;animation:ccTagIn 140ms cubic-bezier(.2,1.3,.4,1) both}
.cc-uc-strip.below{transform:translate(-50%,0)}
.cc-uc-strip>span{padding:1px 5px;border-radius:5px;border:1.5px solid #1b1430;box-shadow:0 1px 0 #1b1430}
.cc-uc-strip .cc-uc-lv{background:#7048e8;color:#fff8e7}
.cc-uc-strip .cc-uc-fx.bad{background:#ffe3e3;color:#c92a2a}
.cc-uc-strip .cc-uc-fx.good{background:#d3f9d8;color:#2b8a3e}
body.cc-rm .cc-uc-strip{animation:none}
@media (prefers-reduced-motion:reduce){.cc-uc-strip{animation:none}}

/* E-038: at two lives or fewer the heart beats (a double thump, about once a second) instead of breathing */
body.cc-hud .cc-hearts.cc-crit .cc-heart-glyph{animation:ccHeartbeat 1s ease-in-out infinite}
@keyframes ccHeartbeat{0%,100%{transform:scale(1)}12%{transform:scale(1.28)}24%{transform:scale(1)}36%{transform:scale(1.18)}50%{transform:scale(1)}}
body.cc-hud .cc-hearts.cc-crit:not(.cc-fl) .cc-heart-glyph{animation:none}
body.cc-hud.cc-rm .cc-hearts.cc-crit .cc-heart-glyph{animation:none}
@media (prefers-reduced-motion:reduce){body.cc-hud .cc-hearts.cc-crit .cc-heart-glyph{animation:none}}

/* W447: preserve the full ability/current timer/help readout at narrow widths.
   Its existing bar may grow with real text instead of clipping a third line.
   The ring's number is BASE cooldown, never a claim about current time left. */
@media (max-width:380px){
  body.cc-hud #bottomBar{height:auto;min-height:var(--cc-bottom-h)}
  body.cc-hud #abilityBtn::before{content:'BASE\a' var(--cc-ab-cost,'');white-space:pre;text-align:center;line-height:1.1}
}
