/* The combat view's stage (combat-view.js; arcana docs/combat-view.md §3):
   the group bar and, in combat, the foes' lane above it. Gold you, green
   your group, red foes, red health bars, holy gold heals. The base rules
   come first; the dark stage, the cards and the effects are further down
   and override them. */
#combat-view {
  --cv-bg: var(--targets-bg, #110f1a);
  /* the card: the ground nudged toward the text colour, so it stands out on light and dark themes */
  --cv-card: color-mix(in srgb, var(--targets-bg, #110f1a) 85%, var(--targets-name, #efe7d6));
  --cv-card-line: color-mix(in srgb, var(--targets-bg, #110f1a) 62%, var(--targets-name, #efe7d6));
  --cv-line: var(--targets-border, #272437);
  --cv-track: var(--vitals-track, #2c2533);
  --cv-hp: var(--vitals-health, #c4513f);
  --cv-hp-low: #ff6a55;
  --cv-mana: var(--vitals-mana, #5b86d0);
  --cv-vit: var(--vitals-vitality, #7aa85c);
  --cv-trail: #e3c072;
  --cv-text: var(--targets-name, #dad0be);
  --cv-muted: var(--targets-label, #8f8678);
  --cv-num: var(--vitals-number, #a89f90);
  flex: none;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  background: var(--cv-bg);
  border-top: 1px solid var(--cv-line);
  font-family: Figtree, "Segoe UI", system-ui, sans-serif;
  overflow: visible;
  contain: layout style;
}
#combat-view[hidden] { display: none; }
/* the Targets area's job is the foes' lane's while the view is on */
body.combat-view-on #targets { display: none !important; }

.cv-card {
  position: absolute;
  box-sizing: border-box;
  padding: 4px 7px;
  border: 1px solid var(--cv-card-line);
  border-radius: 2px;
  background: var(--cv-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  color: var(--cv-text);
  transition: opacity 0.4s;
}
/* each card wears its side: gold you, green your group, red foes */
.cv-card.cv-me { border-color: var(--targets-mark, #c7a24b); opacity: 1; }
.cv-card.cv-member { border-color: rgba(127, 160, 106, 0.75); }
.cv-card.cv-foe { border-color: rgba(224, 108, 91, 0.7); }
/* a hit or a heal still shows on the border, over the side colour */
.cv-card.cv-me.hit, .cv-card.cv-member.hit, .cv-card.cv-foe.hit { border-color: #ff6a55; }
.cv-card.cv-me.healed, .cv-card.cv-member.healed { border-color: #ffe08a; }
.cv-card.hit { border-color: #ff6a55; background-image: linear-gradient(rgba(255, 90, 70, 0.16), rgba(255, 90, 70, 0.16)); }
.cv-card.hit.big { background-image: linear-gradient(rgba(255, 90, 70, 0.26), rgba(255, 90, 70, 0.26)); }
.cv-card.healed { border-color: #ffe08a; background: rgba(255, 214, 110, var(--cv-heal, 0.2)); }
.cv-card.dead { opacity: 0.5; }
.cv-card.fled { opacity: 0.4; }
.cv-card.away { opacity: 0.6; background: var(--cv-bg); }

.cv-head { display: flex; align-items: center; gap: 5px; height: 15px; white-space: nowrap; overflow: hidden; min-width: 0; }
.cv-me .cv-head, .cv-member .cv-head { gap: 4px; height: 14px; }

.cv-name { font-family: "Marcellus", Georgia, serif; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cv-me .cv-name { font-size: 12px; color: #c7a24b; }
.cv-member .cv-name { font-size: 12px; color: #7fa06a; }
.cv-foe .cv-name { font-size: 13px; color: #e06c5b; flex: 0 1 auto; }
.cv-foe.yours .cv-name { color: #ff8a76; }
.cv-sub { font-size: 10.5px; color: var(--cv-muted); flex: none; }
.cv-sub:empty { display: none; }
.cv-fight { font-size: 10.5px; color: var(--cv-muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cv-me .cv-fight, .cv-member .cv-fight { font-size: 9.5px; }
.cv-hptext { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; font-size: 10.5px; color: var(--cv-num); margin-left: 2px; }
.cv-me .cv-hptext, .cv-member .cv-hptext { margin-left: auto; font-size: 10px; }

.cv-meter { display: flex; align-items: center; gap: 6px; height: 10px; }
.cv-meter.cv-h { height: 11px; }
.cv-letter { font-family: "Marcellus", Georgia, serif; font-size: 10px; color: var(--vitals-letter, #efe7d6); width: 9px; flex: none; }
.cv-num { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; font-size: 10px; color: var(--cv-num); width: 66px; text-align: right; flex: none; white-space: nowrap; }
.cv-h .cv-num { font-size: 10.5px; color: var(--cv-text); }
.cv-track { position: relative; display: block; flex: 1; height: 6px; border-radius: 2px; background: var(--cv-track); overflow: hidden; }
.cv-h .cv-track { height: 9px; }
.cv-track.cv-hbar { flex: none; height: 6px; }
.cv-foe .cv-track.cv-hbar { height: 7px; }
.cv-track.cv-mline { flex: none; height: 3px; border-radius: 1px; }
.cv-track.cv-mline[hidden] { display: block; visibility: hidden; }
.cv-ghost, .cv-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.cv-ghost { background: var(--cv-trail); opacity: 0.55; transition: width 0.9s ease-in 0.25s; }
.cv-fill { transition: width 0.15s; }
.cv-h .cv-fill, .cv-hbar .cv-fill { background: var(--cv-hp); }
.cv-fill.low { background: var(--cv-hp-low) !important; }
.cv-m .cv-fill, .cv-mline .cv-fill { background: var(--cv-mana); }
.cv-v .cv-fill { background: var(--cv-vit); }
.cv-fifth { position: absolute; left: 20%; top: 0; bottom: 0; width: 1px; background: var(--cv-card); }
.cv-notch { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--cv-card); }

.cv-slain { position: absolute; right: 8px; top: 6px; padding: 0 6px; border: 2px solid #e3c072; color: #e3c072; font-family: "Marcellus", Georgia, serif; font-size: 14px; line-height: 18px; transform: rotate(-8deg); pointer-events: none; background: rgba(21, 19, 31, 0.6); }
.cv-slain[hidden] { display: none; }

/* ---- The story (combat-story.js): the game window's rows in Story ----
   Every row keeps a hanging left margin while the view is on, so text never
   moves; only fight rows put an icon in it. */
body.story-on :is(#lines, #tail-lines) > .rows > div, body.story-on #live { padding-left: 34px; }
.st-row { position: relative; }
/* fight rows read in the proportional face (owner: "more of the fonts should
   be non-fixed width"); plain rows (room text, chat, ASCII art, commands)
   keep the game's fixed-width font, so art keeps its columns */
.st-row, .st-row .st-total { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.st-icon { position: absolute; left: 12px; top: calc((var(--row, 20px) - 16px) / 2); width: 16px; height: 16px; display: block; line-height: 0; }
.st-dim { opacity: 0.7; }
.st-heal, .st-heal *:not(.st-caster):not(.st-utters) { color: #ffe08a !important; }
.st-runes { display: inline-flex; align-items: center; margin-right: 8px; vertical-align: -3px; color: var(--rune, var(--magic, #c495c9)); }
.st-runes svg { flex: none; overflow: visible; }

/* a fold of weapon blows: who → whom, the verb, a pip a blow, the total */
/* the total never wraps: its column fits "-99,999"; the pips give way first */
.st-blow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content) max-content; gap: 7px; align-items: center; }
.st-blow-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-who { font-weight: 500; }
.st-arrow { color: var(--cv-muted); }
.st-verb.t-top { color: var(--targets-name, #efe7d6); font-weight: 700; }
.st-verb.t-high { color: var(--targets-name, #efe7d6); font-weight: 600; }
.st-verb.t-mid { color: var(--cv-text); }
.st-verb.t-low { color: var(--cv-num); }
.st-verb.t-miss { color: var(--cv-muted); }
.st-more { color: var(--cv-num); font-size: 0.92em; }
.st-sub { color: #e7a08f; font-size: 0.92em; }
.st-pips { display: flex; align-items: flex-end; gap: 2px; height: 18px; max-width: 132px; overflow: hidden; justify-content: flex-end; }
.st-pip { display: block; flex: none; width: 4px; border-radius: 1px; }
.st-pip-miss { height: 3px; background: var(--cv-muted); }
.st-total { text-align: right; color: var(--cv-num, #a89f90); white-space: nowrap; min-width: 7ch; }
.st-total.mid { color: #c7a24b; font-weight: 600; }
.st-total.big { color: #e3c072; font-weight: 700; }
.st-total.on-you { color: #e06c5b; font-weight: 600; }

/* a foe you fought, dead: the game's words, a glowing R.I.P. that pulses as
   it lands and then glows steadily, and the skull */
.st-banner { padding-block: 3px; }
.st-ban { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border: 1px solid rgba(199, 162, 75, 0.5); border-radius: 2px; background: var(--cv-card); white-space: nowrap; overflow: hidden; animation: st-ban-land 0.9s step-end; }
.st-ban svg { flex: none; }
.st-ban-title { font-family: "Marcellus", Georgia, serif; font-size: 16px; color: #e3c072; }
.st-rip { font-family: "Marcellus", Georgia, serif; font-size: 14px; line-height: 1; letter-spacing: 0.2em; color: #ffe08a; margin: 0 4px 0 2px; text-shadow: 0 0 10px rgba(255, 214, 110, 0.85), 0 0 2px rgba(255, 240, 200, 0.9); animation: st-rip 1.1s infinite; }
.st-ban-extra { font-size: 12px; color: #a89f90; overflow: hidden; text-overflow: ellipsis; }
@keyframes st-ban-land { from { border-color: #c7a24b; background-image: linear-gradient(rgba(199, 162, 75, 0.22), rgba(199, 162, 75, 0.22)); } }
/* R.I.P. flashes like the old terminal blink (owner): hard on and off, for
   as long as the banner is on screen */
@keyframes st-rip {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.12; }
}
@media (prefers-reduced-motion: reduce) { .st-rip, .st-ban { animation: none; } }
/* who uttered the runes riding on a row (owner 2026-11-14): "Maelis utters", then the glyphs */
.st-cast { display: inline-flex; align-items: baseline; gap: 5px; margin-right: 8px; vertical-align: baseline; }
/* the glyphs sit on the line's baseline, dropped a little like descenders so
   they centre on the text beside them (owner: one line, all lined up) */
.st-cast .st-runes { margin-right: 0; vertical-align: 0; align-self: baseline; position: relative; top: 3px; }
.st-utters { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 11.5px; color: #8f8678; margin: 0 2px; white-space: nowrap; }
.st-caster { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 11.5px; font-weight: 600; color: var(--parchment, #dad0be); white-space: nowrap; }

/* =====================================================================
   The dark stage, the cards and the effects (docs/combat-view.md §3.2–3.5).
   These rules come after the base ones above and override them.
   ===================================================================== */

/* the number slot. One counting number, a big hit's own number and
   a heal's count-up share a reserved place at the head's right, left of the
   health %, so they never cover a name or a %. */
.cv-slot { position: absolute; right: 8px; top: 1px; height: 17px; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; white-space: nowrap; z-index: 3; }
.cv-foe .cv-slot { right: 44px; }
.cv-me .cv-slot, .cv-member .cv-slot { right: 40px; }
.cv-strip .cv-slot { right: 40px; top: 0; height: 16px; }
.cv-n { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; line-height: 1.15; opacity: 0; transform-origin: 100% 100%; text-shadow: 0 1px 2px #000, 0 0 5px var(--cv-card), 0 0 5px var(--cv-card); }
.cv-n:empty { display: none; }
.cv-n-heal { color: #ffe08a; }
.cv-n-star { font-size: 21px; line-height: 0.95; font-weight: 800; }
.cv-foe .cv-hptext { margin-left: auto; padding-left: 40px; }
.cv-me .cv-hptext, .cv-member:not(.cv-strip) .cv-hptext { padding-left: 34px; }
.cv-foe .cv-fight { flex: 0 1 auto; }

/* hit-stop. The struck card holds still under a light wash, then
   today's red wash as the chunk falls. An ordinary hit only marks the edge. */
.cv-card.stop { border-color: #fff2c4 !important; background-image: linear-gradient(rgba(255, 244, 214, 0.2), rgba(255, 244, 214, 0.2)); }
.cv-card.tap { border-color: var(--cv-hitcol, #ff6a55) !important; }

/* the kill */
.cv-slain { transform-origin: 50% 50%; }
#combat-view.cv-won { border-top-color: #e3c072; background-image: linear-gradient(rgba(227, 192, 114, 0.14), rgba(227, 192, 114, 0) 55%); }

/* the spell's NAME over its caster during the cast (the
   runes stay in the story); no cast bar */
.cv-castrunes { position: absolute; left: 8px; top: -11px; height: 18px; padding: 0 8px; display: inline-flex; align-items: center; background: var(--cv-bg); border: 1px solid currentColor; border-radius: 3px; z-index: 4; pointer-events: none; transform-origin: 0 100%;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; text-shadow: 0 0 8px currentColor; box-shadow: 0 0 10px -2px currentColor; }
.cv-castrunes[hidden] { display: none; }
/* the effects canvas (combat-fx.js), over the cards, clicks pass through */
.cv-canvas { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }

/* strips for a big group (name and health only) */
.cv-card.cv-strip { padding: 0 6px; justify-content: center; }
.cv-strip .cv-head { height: 18px; gap: 6px; overflow: visible; }
.cv-strip .cv-name { flex: 0 0 36%; font-size: 12px; }
.cv-strip .cv-track.cv-hbar { flex: 1 1 auto; height: 6px; }
.cv-strip .cv-hptext { margin-left: 0; width: 28px; text-align: right; flex: none; }
.cv-strip .cv-n { background: var(--cv-card); padding: 0 3px; border-radius: 2px; }
.cv-card.cv-strip.hot { border-color: #ff6a55; box-shadow: 0 0 0 1px rgba(255, 106, 85, 0.45); }
.cv-card.cv-foldchip { flex-direction: row; align-items: center; justify-content: center; border-style: dashed; border-color: var(--cv-card-line); color: var(--cv-muted); font-size: 11.5px; cursor: pointer; background: transparent; }
.cv-card.cv-foldchip:hover { color: var(--cv-text); }

/* a heal's part of the bar is holy gold first, then red */
.cv-healfill { position: absolute; top: 0; bottom: 0; width: 0; background: #ffe08a; opacity: 0; box-shadow: 0 0 6px #ffe08a; }

/* a member who fled or is elsewhere stays readable */
.cv-card.cv-member.fled, .cv-card.cv-member.away { opacity: 1; border-style: dashed; background: var(--cv-card); }
.cv-member.fled .cv-fill, .cv-member.away .cv-fill { opacity: 0.45; }

/* the story row as the star */
.st-row.st-star { animation: st-wash 0.8s ease-out both; }
@keyframes st-wash { from { background-color: color-mix(in srgb, var(--st-wash, #ff6a55) 34%, transparent); } to { background-color: transparent; } }
.st-heavy { font-weight: 800; font-size: 1.2em; line-height: 1; }
.st-heavy.huge { font-size: 1.4em; }
.st-pip-new { animation: st-pip-pop 0.3s ease-out; transform-origin: 50% 100%; }
@keyframes st-pip-pop { from { transform: scaleY(1.9); filter: brightness(1.9); } }
.st-pip-max { filter: brightness(1.35); box-shadow: 0 0 5px currentColor; }
@media (prefers-reduced-motion: reduce) { .st-row.st-star, .st-pip-new { animation: none; } }

.cv-stateword { position: absolute; left: 0; right: 0; top: 50%; text-align: center; opacity: 0; z-index: 5; pointer-events: none; white-space: nowrap;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 16px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  text-shadow: 0 0 6px var(--cv-bg), 0 0 6px var(--cv-bg), 0 0 10px var(--cv-bg), 0 1px 2px #000; }
.cv-stateword.off { text-decoration: line-through; font-size: 12px; }
.cv-strip .cv-stateword { font-size: 11px; letter-spacing: 0.1em; }
/* a fighter who cannot act (stunned, paralyzed, asleep, knocked down) reads
   at a glance: its bars and name drop back, its state stays bright */
.cv-card.cv-out .cv-head > *, .cv-card.cv-out .cv-track { opacity: 0.5; }

/* =====================================================================
   The stage (owner 2026-11-15): no portraits; a fixed dark stage; rich card fills;
   rounded cards. Everything below is tuned once, against this stage, and does not
   follow the colour theme.
   ===================================================================== */

/* ---- the stage: a fixed dark band on every theme. The story text and the
   window round it still follow the theme; the stage borrows one accent from
   it, its top border line. ---- */
#combat-view {
  --cv-bg: #0a0910; --cv-card: #17141f; --cv-card-line: #3a3448; --cv-track: #231b26;
  --cv-hp: #d8432f; --cv-hp-low: #ff6a55; --cv-mana: #5b86d0; --cv-vit: #7aa85c; --cv-trail: #f0c26a;
  --cv-text: #f1e9d8; --cv-muted: #948a7c; --cv-num: #d9cfbd;
  --cv-you: #e2b655; --cv-ally: #86b86c; --cv-foe: #ef6a55; --cv-buff: #8fb3c4;
  color: var(--cv-text);
  background: radial-gradient(120% 150% at 50% 0%, #17131f 0%, #0a0910 62%);
  border-top: 1px solid color-mix(in srgb, var(--targets-mark, #c7a24b) 75%, transparent);
  box-shadow: inset 0 10px 18px -12px rgba(0, 0, 0, 0.9);
}
.cv-me { --side: var(--cv-you); }
.cv-member { --side: var(--cv-ally); }
.cv-foe { --side: var(--cv-foe); }
.cv-me .cv-name { color: var(--cv-you); }
.cv-member .cv-name { color: var(--cv-ally); }
.cv-foe .cv-name { color: var(--cv-foe); }
.cv-foe.yours .cv-name { color: #ff8f7c; }
.cv-letter { color: var(--cv-text); }
.cv-hptext, .cv-num { color: var(--cv-num); }
.cv-h .cv-num { color: var(--cv-text); }

/* ---- a card: a shaped edge in its side's colour, a rich fill inside ---- */
.cv-card:not(.cv-foldchip) { border: 0 !important; background: none !important; outline: 0; border-radius: 10px; padding-top: 4px; padding-bottom: 4px; gap: 3px; opacity: 1; }
.cv-shape { position: absolute; inset: 0; z-index: 0; background: var(--edge, var(--side)); pointer-events: none; }
.cv-fillin { position: absolute; inset: 0; }
.cv-card > .cv-head, .cv-card > .cv-meter, .cv-card > .cv-track, .cv-card > .cv-status { position: relative; z-index: 1; }
/* the fills: deep darks that lean to the side's colour, a soft light from one
   corner, a faint weave and a vignette; never flat grey */
.cv-fillin { background:
  radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.38) 100%),
  repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 6px),
  var(--fill); }
.cv-me .cv-fillin { --fill: radial-gradient(130% 130% at 0% 0%, #46320f 0%, transparent 62%), linear-gradient(180deg, #2a1e10, #161019 75%); }
.cv-member .cv-fillin { --fill: radial-gradient(130% 130% at 0% 0%, #1f3a26 0%, transparent 62%), linear-gradient(180deg, #14221a, #0e1217 75%); }
.cv-foe .cv-fillin { --fill: radial-gradient(130% 130% at 100% 0%, #561a1c 0%, transparent 62%), linear-gradient(180deg, #2d1218, #150c13 75%); }
.cv-me .cv-shape { background: linear-gradient(180deg, #f2cf7a, var(--edge, var(--side)) 45%); }
/* a boss: a gold-to-red edge, heavier */
.cv-boss .cv-shape { background: linear-gradient(180deg, #f6d27a, var(--edge, var(--side)) 60%); }
.cv-boss .cv-name { font-size: 15px; letter-spacing: 0.02em; }

.cv-foe.onyou .cv-fillin { box-shadow: inset 5px 0 0 -1px #ff4f3d, inset 14px 0 12px -10px rgba(255, 79, 61, 0.55); }
/* your target: gold corners, outside the shape */
.cv-card.cv-foe.yours::after { inset: -4px; border-color: var(--cv-you); z-index: 2; }

/* the edge reacts to a hit: its colour jumps and it glows; the fill takes the wash */
.cv-card.stop { --edge: #fff2c4; filter: drop-shadow(0 0 5px #fff2c4); }
.cv-card.stop .cv-fillin { filter: brightness(1.7); }
.cv-card.hit { --edge: #ff6a55; filter: drop-shadow(0 0 6px rgba(255, 90, 70, 0.9)); }
.cv-card.hit .cv-fillin { box-shadow: inset 0 0 0 200px rgba(255, 90, 70, 0.18); }
.cv-card.hit.big .cv-fillin { box-shadow: inset 0 0 0 200px rgba(255, 90, 70, 0.3); }
.cv-card.tap { --edge: var(--cv-hitcol, #ff6a55); filter: drop-shadow(0 0 3px var(--cv-hitcol, #ff6a55)); }
.cv-card.healed { --edge: #ffe08a; filter: drop-shadow(0 0 5px rgba(255, 224, 138, 0.8)); }
.cv-card.healed .cv-fillin { box-shadow: inset 0 0 0 200px rgba(255, 214, 110, var(--cv-heal, 0.2)); }
.cv-card.dead { opacity: 0.5; }
.cv-card.cv-member.fled, .cv-card.cv-member.away { opacity: 1; border-style: none; }
/* a member who fled or is elsewhere: a dashed edge and a hollow bar, the text at full strength */
.cv-member.fled .cv-shape, .cv-member.away .cv-shape { background: repeating-linear-gradient(45deg, var(--side) 0 5px, transparent 5px 9px); opacity: 0.85; }
.cv-member.fled .cv-fillin, .cv-member.away .cv-fillin { filter: saturate(0.35) brightness(0.75); }
.cv-member.fled .cv-fill, .cv-member.away .cv-fill { opacity: 0.45; }
/* a fighter who cannot act: its bars drop back; its name stays */
.cv-card.cv-out .cv-head > *, .cv-card.cv-out .cv-track { opacity: 1; }
.cv-card.cv-out .cv-track { opacity: 0.4; }
.cv-card.cv-out .cv-fillin { filter: saturate(0.4) brightness(0.8); }

/* ---- the name gets the room: full names, role words after them ---- */
.cv-head { overflow: visible; }
.cv-foe .cv-head, .cv-me .cv-head, .cv-member:not(.cv-strip) .cv-head { height: 17px; gap: 6px; }
.cv-name { flex: 1 1 auto !important; max-width: none !important; }
.cv-foe .cv-name { font-size: 14px; min-width: 0; }
.cv-me .cv-name, .cv-member .cv-name { font-size: 13.5px; }
.cv-foe .cv-hptext, .cv-me .cv-hptext, .cv-member:not(.cv-strip) .cv-hptext { margin-left: 0; padding-left: 0; flex: none; }
.cv-foe .cv-track.cv-hbar, .cv-me .cv-track.cv-hbar, .cv-member:not(.cv-strip) .cv-track.cv-hbar { height: 8px; }
.cv-track { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.cv-h .cv-fill, .cv-hbar .cv-fill { background: linear-gradient(180deg, #ee5a44, var(--cv-hp) 55%, #a82f20); }
/* numbers: over the bar's right end, never over the name */
.cv-foe .cv-slot, .cv-me .cv-slot, .cv-member:not(.cv-strip) .cv-slot { right: 10px; top: 17px; height: 14px; }
.cv-strip .cv-slot { right: 34px; }
.cv-castrunes { left: 12px; background: #0a0910; }

/* role words: YOU, LEADER, BOSS */
.cv-marks { display: inline-flex; gap: 3px; flex: none; }
.cv-marks:empty { display: none; }
.cv-mark { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 8.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; line-height: 12px; padding: 0 4px; border: 1px solid currentColor; border-radius: 2px; color: var(--cv-muted); }
.cv-mark.short { padding: 0 3px; }
.cv-mark-you { color: #15101a; background: var(--cv-you); border-color: var(--cv-you); }
.cv-mark-leader { color: var(--cv-you); }
.cv-mark-boss, .cv-mark-elite { color: #15101a; background: #f0c26a; border-color: #f0c26a; }

/* ---- the status row, INSIDE the card: debuffs left, buffs right ---- */
.cv-status { display: flex; align-items: center; gap: 4px; height: 13px; min-width: 0; overflow: hidden; pointer-events: none; }
.cv-std, .cv-stb { display: flex; gap: 3px; flex: none; }
.cv-stb { margin-left: auto; }
.cv-fight { flex: 0 1 auto; font-size: 10.5px; color: var(--cv-muted); white-space: nowrap; overflow: hidden; min-width: 0; }
.cv-fight:empty { display: none; }
.cv-st { height: 13px; padding: 0 5px; display: inline-flex; align-items: center; gap: 4px; box-sizing: border-box; background: rgba(8, 7, 13, 0.82); border: 1px solid currentColor; border-radius: 2px; white-space: nowrap;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.cv-st b { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; color: var(--cv-text); }
.cv-st.more { border-style: dashed; color: var(--cv-muted); }
.cv-st.off { text-decoration: line-through; opacity: 0.45; }
.cv-st.b { color: var(--cv-buff); border-color: color-mix(in srgb, var(--cv-buff) 30%, transparent); background: rgba(8, 7, 13, 0.5); font-size: 8.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: none; }
.cv-strip .cv-status { flex: none; height: 13px; }
.cv-strip .cv-status:has(.cv-std:empty) { display: none; }

/* a debuff's name as it lands or lifts, and for as long as a fighter cannot
   act: a band UNDER the name row, so the name stays readable */
.cv-stateword { left: 0; right: 0; top: 21px; height: 15px; line-height: 15px; transform-origin: 50% 50%; font-size: 11.5px; letter-spacing: 0.22em; text-shadow: 0 1px 2px #000;
  background: linear-gradient(90deg, transparent, rgba(6, 5, 10, 0.86) 18%, rgba(6, 5, 10, 0.86) 82%, transparent); }
.cv-strip .cv-stateword { top: 3px; left: 45%; right: 4px; font-size: 9.5px; letter-spacing: 0.12em; height: 14px; line-height: 14px; }
.cv-stateword.off { font-size: 10.5px; }

/* ---- strips for a big group ---- */
.cv-card.cv-strip { padding-top: 0; padding-bottom: 0; }
.cv-strip .cv-head { height: 20px; gap: 6px; }
.cv-strip .cv-name { flex: 0 1 auto !important; font-size: 12px; overflow: visible; }
.cv-strip .cv-track.cv-hbar { flex: 1 1 30px; min-width: 24px; height: 6px; }
.cv-card.cv-strip.hot { filter: drop-shadow(0 0 3px #ff6a55); --edge: #ff6a55; box-shadow: none; }
.cv-card.cv-foldchip { border-color: #3a3448; color: var(--cv-muted); }

/* tighter rows so the status row fits inside the card */
.cv-card:not(.cv-foldchip):not(.cv-strip) { gap: 2px; }
.cv-foe .cv-head, .cv-me .cv-head, .cv-member:not(.cv-strip) .cv-head { height: 16px; }
.cv-me .cv-mline, .cv-member:not(.cv-strip) .cv-mline { height: 3px; }
.cv-status { flex: none; }
/* a spell's name sits ABOVE its caster's card, clear of the name */
.cv-castrunes { top: -20px; }

/* "Calm combat effects" (Settings › Combat): the story's washes and pops too */
body.combat-calm .st-row.st-star, body.combat-calm .st-pip-new { animation: none; }

/* the wrapper's own corner matches the card's shape, so a glow round it is rounded too */
.cv-card.cv-strip { border-radius: 5px; }
/* "slain" stamps over the middle of the card, clear of the number slot */
.cv-slain { right: auto; left: 50%; top: 50%; margin: -11px 0 0 -30px; z-index: 5; background: rgba(8, 7, 13, 0.75); }

/* who is on whom (owner 2026-11-16): how many foes are on a fighter, in words
   on the card's top edge where their lines land; a fighter who is not the
   tank and has a foe on them stands out: that is who needs rescuing */
.cv-onbadge { position: absolute; right: 12px; top: -14px; height: 14px; padding: 0 6px; display: inline-flex; align-items: center; z-index: 4; pointer-events: none; white-space: nowrap; border-radius: 2px;
  background: #0a0910; border: 1px solid #ef6a55; color: #ff9c8c; font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.cv-onbadge[hidden] { display: none; }
.cv-strip .cv-onbadge { right: -5px; top: -7px; height: 12px; padding: 0 4px; font-size: 8.5px; }
.cv-exposed .cv-onbadge { background: #ef4f3d; border-color: #ef4f3d; color: #15101a; }
.cv-card.cv-exposed { --edge: #ff5a46; animation: cv-exposed 1.1s ease-in-out infinite; }
@keyframes cv-exposed { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 80, 60, 0.5)); } 50% { filter: drop-shadow(0 0 7px rgba(255, 80, 60, 0.95)); } }
@media (prefers-reduced-motion: reduce) { .cv-card.cv-exposed { animation: none; filter: drop-shadow(0 0 4px rgba(255, 80, 60, 0.8)); } }
body.combat-calm .cv-card.cv-exposed { animation: none; filter: drop-shadow(0 0 4px rgba(255, 80, 60, 0.8)); }

/* =====================================================================
   The Purgatory beta (?beta=1) only: formation and icons (docs/combat-view.md
   §3.5, §3.8). Every rule below matches only what the beta adds, so live is
   unchanged.
   ===================================================================== */

/* the walls: straight grey stone under the cards and the lines (combat-formation.js) */
.cv-walls { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
.cv-wall-text { font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 10.5px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  fill: #948a7c; stroke: #0a0910; stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.cv-wall-text.bad { fill: #ff6a55; }
/* a wall of force: stave runes pulsing in turn */
.cv-rune { animation: cv-rune 2.4s ease-in-out infinite; }
@keyframes cv-rune { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .cv-rune { animation: none; } }
body.combat-calm .cv-rune { animation: none; }
/* inside a breached wall (or one with no tactics): a red edge, they can be hit */
.cv-card.cv-open { --edge: #ff5a46; filter: drop-shadow(0 0 3px rgba(255, 90, 70, 0.55)); }

/* posture: a badge after the name */
.cv-posture { display: inline-flex; align-items: center; gap: 2px; flex: none; height: 12px; padding: 0 3px; border-radius: 3px;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; line-height: 12px; }
.cv-posture[hidden] { display: none; }
.cv-posture svg { flex: none; stroke: currentColor !important; }
.cv-posture-offensive { color: #ffb08f; background: rgba(224, 108, 91, 0.2); }
.cv-posture-defensive { color: #a9c6e8; background: rgba(91, 134, 208, 0.2); }
.cv-posture-evasive { color: #cfe3a6; background: rgba(127, 160, 106, 0.22); }
/* placement: the signed number at the status row's end, red when negative */
.cv-place { flex: none; margin-left: 4px; font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 9.5px; font-variant-numeric: tabular-nums; color: var(--cv-num); line-height: 13px; }
.cv-place[hidden] { display: none; }
.cv-place.bad { color: #ff8a76; }
.cv-icons .cv-stb:empty + .cv-place { margin-left: auto; }

/* the status row in icons: debuffs on a faint chip of their colour with the
   time, buffs as icons in one cool colour; named on hover */
.cv-icons .cv-std, .cv-icons .cv-stb { gap: 2px; align-items: center; }
.cv-st.cv-sti { height: 13px; padding: 0 2px 0 1px; gap: 2px; border: 0; border-radius: 3px; background: color-mix(in srgb, currentColor 17%, transparent);
  font-size: 8.5px; font-weight: 600; letter-spacing: 0; text-transform: none; pointer-events: auto; cursor: default; }
.cv-sti svg { flex: none; display: block; }
.cv-sti .cv-stt { color: var(--cv-text); font-variant-numeric: tabular-nums; }
.cv-st.cv-sti.b { background: none; padding: 0; opacity: 0.92; border: 0; }
.cv-st.cv-sti.more { background: none; border: 0; color: var(--cv-muted); font-size: 9px; padding: 0 1px; }
.cv-st.cv-sti.off { text-decoration: none; opacity: 0.4; }
.cv-ring text { font-family: Figtree, "Segoe UI", system-ui, sans-serif; stroke: none; }
.cv-posture-compact { padding: 0 2px; }
.cv-posture-compact .cv-posture-ab { display: none; }
