/* card-face.css — the card component's look. Pairs with card.js and card-face-vars.css.
 *
 * RULES OF THIS FILE
 *  - No raw px numbers anywhere. Geometry, type sizes, letter-spacing, opacities and colours are
 *    the generated custom properties in card-face-vars.css (source: design/penpot/make_cards.py,
 *    exported by scripts/export_card_geometry.py). `node web/next/geometry-gate.mjs` enforces this.
 *  - The 7-size type scale lives in make_cards.py `TYPE` -> --face-type-{display,value,name,body,
 *    caption,label,rail}. There is no second copy here.
 *  - T2 reproduces the locked face (BASE-CARD-FACE v1.1). T1/T0 reuse the same scale multiplied
 *    by one per-tier boost (--pc-boost), so the size *ratios* of the face survive at small sizes.
 *    The boost and the em spacings are the only renderer-owned numbers; they are unitless/em.
 *  - A container cannot resolve its own cqw: the root only gets aspect-ratio (T2) and the
 *    children carry every var-based length.
 */

@font-face { font-family: "Comic Neue"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/comic-neue-400.woff2") format("woff2"); }
@font-face { font-family: "Comic Neue"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/comic-neue-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/FiraMono-Bold.ttf") format("truetype"); }

.pc-card {
  --pc-ink: var(--face-c-ink);
  --pc-sans: "Comic Neue", sans-serif;
  --pc-mono: "Fira Mono", ui-monospace, monospace;
  --pc-cond: "IBM Plex Sans Condensed", "Liberation Sans Narrow", sans-serif;
  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;   /* status tags sit half outside the silhouette; everything else is inside the canvas */
  background: var(--face-c-rim);
  color: var(--pc-ink);
  font-family: var(--pc-sans);
  line-height: 1.2;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.pc-card *, .pc-card *::before, .pc-card *::after { box-sizing: border-box; }
/* ART IS NEVER CROPPED OR STRETCHED (any tier): the image is shown whole at its own ratio inside
   the slot (contain, centred); the mat colour shows in the remainder. */
.pc-card .pc-art { background: var(--face-c-mat); overflow: hidden; }
.pc-card .pc-art-img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }

/* shared atoms: a box that centres its single line */
.pc-card .pc-word, .pc-card .pc-number, .pc-card .pc-hp-l, .pc-card .pc-hp-v,
.pc-card .pc-trait-l, .pc-card .pc-trait-v, .pc-card .pc-move-name, .pc-card .pc-move-text,
.pc-card .pc-dmg-v, .pc-card .pc-dmg-l, .pc-card .pc-ab-label, .pc-card .pc-ab-name,
.pc-card .pc-ab-text, .pc-card .pc-stat-l, .pc-card .pc-stat-v {
  display: flex; align-items: center; white-space: nowrap;
}
.pc-card .pc-pips { display: flex; gap: calc(var(--face-attack-pip-step) - var(--face-attack-pip-w)); }
.pc-card .pc-pip {
  display: block; width: var(--face-attack-pip-w); height: var(--face-attack-pip-h);
  background: var(--face-c-el); border: var(--face-pip-stroke) solid var(--face-c-el);
}
.pc-card .pc-diamond { display: block; background: var(--face-c-el); transform: rotate(45deg); }

/* ======================================================================================
   VERB MARKERS — a static row role from card.js (`data-role`, `.pc-verb` + the dot element).
   The marker is only lit when the SCREEN enables the row in the current context (`.is-enabled`):
   a bench pup's attack row is a verb by type but stays dark while it is benched. Info rows
   (passive, a trap that is not yours to spring) never get a marker.
   ====================================================================================== */
.pc-card .pc-verb-mark {
  display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: calc(var(--face-attack-pip-w) * 0.9);
  height: calc(var(--face-attack-pip-w) * 1.1);
  background: currentColor; pointer-events: none;
  clip-path: polygon(0 0, 55% 50%, 0 100%, 28% 50%);   /* chevron, not a pip/dot */
}
.pc-card .pc-verb.is-enabled .pc-verb-mark { display: block; }
/* rows that are in flow need their own containing block; the card's direct children are already
   absolutely positioned by the face geometry and must keep it. */
.pc-card .pc-line.pc-verb { position: relative; }
.pc-card[data-tier="t1"] .pc-attack.pc-verb { position: relative; }
/* T2 move rows start at the cost pips: the chevron sits in the attack panel's inset, with a
   full pip-width of clear space before the pips — never reads as another cost pip. */
.pc-card[data-tier="t2"] .pc-move.pc-verb > .pc-verb-mark {
  left: calc(var(--face-attack-pip-w) * -1.1);
  width: calc(var(--face-attack-pip-w) * 0.8); height: calc(var(--face-attack-pip-w) * 1);
}
/* T2 ability rows position every direct child on the printed row line; the chevron opens the row */
.pc-card[data-tier="t2"] .pc-ability > .pc-verb-mark {
  left: calc(var(--face-attack-pip-w) * 0.2); top: calc(var(--ab-top) + var(--ab-h) / 2);
  width: calc(var(--face-attack-pip-w) * 0.8); height: calc(var(--face-attack-pip-w) * 1);
}
/* the armed-trap tab is a flex tab: the chevron is a normal first item, with real separation */
.pc-card .pc-armed > .pc-verb-mark {
  position: static; transform: none; align-self: center; margin-right: 0.35em;
  /* hard legibility floor: a marker never drops under 6px, however small the tier */
  width: max(calc(var(--face-attack-pip-w) * 0.7), var(--pc-mark-floor, 6px));
  height: max(calc(var(--face-attack-pip-w) * 0.9), var(--pc-mark-floor, 6px));
}

/* ======================================================================================
   T2 · the locked face — fixed 1152 canvas expressed in --u, so it scales as one piece
   ====================================================================================== */
.pc-card { aspect-ratio: var(--face-canvas-ratio); }   /* every tier keeps the card's shape */
.pc-card > * { position: absolute; }

.pc-card > .pc-plate {
  inset: var(--face-canvas-rimw); background: var(--face-c-plate);
}

/* header: children use root coordinates, so the wrapper starts at the card's origin */
.pc-card[data-tier="t2"] > .pc-header {
  left: 0; top: 0; width: 100%;
  height: calc(var(--face-header-hp-value-y) + var(--face-header-hp-value-h));
}
.pc-card[data-tier="t2"] .pc-header > * { position: absolute; }
.pc-card[data-tier="t2"] .pc-diamond {
  left: var(--face-header-icon-x); top: var(--face-header-icon-y);
  width: var(--face-header-icon-w); height: var(--face-header-icon-h);
}
.pc-card[data-tier="t2"] .pc-word {
  left: var(--face-header-word-x); top: var(--face-header-word-y);
  width: var(--face-header-word-w); height: var(--face-header-word-h);
  font: 700 var(--face-type-caption)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-word);
  color: var(--face-c-el-txt);
}
.pc-card[data-tier="t2"] .pc-number {
  left: var(--face-header-number-x); top: var(--face-header-number-y);
  width: var(--face-header-number-w); height: var(--face-header-number-h);
  justify-content: center; font: 700 var(--face-type-display)/1.2 var(--pc-mono);
  letter-spacing: var(--face-ls-number); opacity: var(--face-op-number);
}
/* NAMING (owner-approved proof, web/next/nameproof.html): the name is the header hero at the
   face's own name size (27u, full ink), centred on the number's centre; the number stays in its
   zone and slot but demotes to the caption size (18u, 62%). Plain digits — the ◆ number mark is
   gone (owner ruling); the element-corner diamond above is untouched. No truncation: the 30ch
   worst case fits the free header span at 27u. */
/* play-test revision (owner, 2026-10-25): with T1's name at 39u the T2 hero read SMALLER than
   its bench tier — hierarchy inverted. Name 27u→39u (slot recentred 62..106u so it clears the
   number), number 18u→24u (still demoted under the name, still 62%). */
.pc-card[data-tier="t2"] .pc-name {
  position: absolute; left: var(--face-header-number-x); top: calc(var(--u) * 62);
  width: var(--face-header-number-w); height: calc(var(--u) * 44);
  display: flex; align-items: center; justify-content: center;
  font: 700 calc(var(--u) * 39)/1.2 var(--pc-sans);
  color: var(--face-c-ink); white-space: nowrap;
}
.pc-card[data-tier="t2"][data-name] .pc-number {
  top: calc(var(--u) * 108); height: calc(var(--u) * 24);
  font: 700 calc(var(--u) * 24)/1.2 var(--pc-mono);
}
.pc-card[data-tier="t2"] .pc-hp-l {
  left: var(--face-header-hp-label-x); top: var(--face-header-hp-label-y);
  width: var(--face-header-hp-label-w); height: var(--face-header-hp-label-h);
  justify-content: flex-end; font: 700 var(--face-type-caption)/1.2 var(--pc-mono);
  letter-spacing: var(--face-ls-hp); color: var(--face-c-dim-txt);
}
.pc-card[data-tier="t2"] .pc-hp-v {
  left: var(--face-header-hp-value-x); top: var(--face-header-hp-value-y);
  width: var(--face-header-hp-value-w); height: var(--face-header-hp-value-h);
  justify-content: flex-end; font: 700 var(--face-type-value)/1.2 var(--pc-mono);
}

/* art mat + art window */
.pc-card > .pc-mat {
  left: var(--face-bezel-x); top: var(--face-bezel-y);
  width: var(--face-bezel-w); height: var(--face-bezel-h); background: var(--face-c-mat);
}
.pc-card > .pc-art {                         /* same slot in all three tiers */
  left: var(--face-art-x); top: var(--face-art-y);
  width: var(--face-art-w); height: var(--face-art-h);
  border-radius: var(--face-art-radius); overflow: hidden;
}

/* trait rail: 4 columns x 2 rows inside the mat */
.pc-card[data-tier="t2"] > .pc-rail {
  left: var(--face-rail-x); top: var(--face-rail-top); width: var(--face-rail-w);
  height: calc(var(--face-rail-row) * 2);
}
.pc-card[data-tier="t2"] .pc-trait {
  position: absolute; width: var(--face-rail-cols-1);
  top: calc(var(--face-rail-row) * var(--r, 0) + var(--face-rail-cell-dy));
  height: var(--face-rail-cell-h);
}
.pc-card[data-tier="t2"] .pc-r0 { --r: 0; } .pc-card[data-tier="t2"] .pc-r1 { --r: 1; }
.pc-card[data-tier="t2"] .pc-c0 { left: var(--face-rail-cols-0); }
.pc-card[data-tier="t2"] .pc-c1 { left: var(--face-rail-cols-1); }
.pc-card[data-tier="t2"] .pc-c2 { left: var(--face-rail-cols-2); }
.pc-card[data-tier="t2"] .pc-c3 { left: var(--face-rail-cols-3); }
.pc-card[data-tier="t2"] .pc-trait-l, .pc-card[data-tier="t2"] .pc-trait-v {
  position: absolute; top: 0; height: 100%;
}
.pc-card[data-tier="t2"] .pc-trait-l {
  left: var(--face-rail-cell-label-dx); width: var(--face-rail-cell-label-w);
  font: 700 var(--face-type-rail)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-rail);
  opacity: var(--face-op-rail-label);
}
.pc-card[data-tier="t2"] .pc-trait-v {
  left: var(--face-rail-cell-val-dx); width: var(--face-rail-cell-val-w);
  font: 400 var(--face-type-label)/1.2 var(--pc-cond); opacity: var(--face-op-rail-val);
}

/* attack panel — white 94%, square */
.pc-card[data-tier="t2"] > .pc-attack {
  left: var(--face-attack-box-x); top: var(--face-attack-box-y);
  width: var(--face-attack-box-w); height: var(--face-attack-box-h);
  background: rgb(255 255 255 / var(--face-op-atk-box));
}
.pc-card[data-tier="t2"] .pc-attack > * { position: absolute; }
.pc-card[data-tier="t2"] .pc-move-name {
  left: calc(var(--face-attack-name-x) - var(--face-attack-box-x));
  top: calc(var(--face-attack-name-y) - var(--face-attack-box-y));
  width: var(--face-attack-name-w); height: var(--face-attack-name-h);
  font: 700 var(--face-type-display)/1 var(--pc-sans);
}
.pc-card[data-tier="t2"] .pc-move {
  left: calc(var(--face-columns-lx) - var(--face-attack-box-x));
  width: calc(var(--face-columns-nx) - var(--face-columns-lx) + var(--face-attack-text-w));
  height: var(--face-attack-text-h);
}
.pc-card[data-tier="t2"] .pc-m1 { top: calc(var(--face-attack-row1) - var(--face-attack-box-y)); }
.pc-card[data-tier="t2"] .pc-m2 { top: calc(var(--face-attack-row2) - var(--face-attack-box-y)); }
.pc-card[data-tier="t2"] .pc-move > .pc-pips { position: absolute; left: 0; top: var(--face-pip-dy); }
.pc-card[data-tier="t2"] .pc-move-text {
  position: absolute; top: 0; height: 100%;
  left: calc(var(--face-columns-nx) - var(--face-columns-lx)); width: var(--face-attack-text-w);
  font: 400 var(--face-type-body)/1.2 var(--pc-sans);
}
.pc-card[data-tier="t2"] .pc-dmg {
  left: calc(var(--face-damage-zone-x) - var(--face-attack-box-x));
  top: calc(var(--face-damage-zone-y) - var(--face-attack-box-y));
  width: var(--face-damage-zone-w); height: var(--face-damage-zone-h);
}
.pc-card[data-tier="t2"] .pc-dmg::before {
  content: ""; position: absolute; inset: 0; background: var(--face-c-el); opacity: var(--face-op-dmg-zone);
}
.pc-card[data-tier="t2"] .pc-dmg > * { position: absolute; left: 0; width: 100%; justify-content: center; }
.pc-card[data-tier="t2"] .pc-dmg-v {
  top: calc(var(--face-damage-value-y) - var(--face-damage-zone-y)); height: var(--face-damage-value-h);
  font: 700 var(--face-type-value)/1.2 var(--pc-mono);
}
.pc-card[data-tier="t2"] .pc-dmg-l {
  top: calc(var(--face-damage-label-y) - var(--face-damage-zone-y)); height: var(--face-damage-label-h);
  font: 700 var(--face-type-label)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-label);
  color: var(--face-c-dim-tile);
}

/* ability ground: INK 3% — defines the section; no rules anywhere */
.pc-card[data-tier="t2"] > .pc-ground {
  left: var(--face-ground-x); top: var(--face-ground-y);
  width: var(--face-ground-w); height: var(--face-ground-h); background: var(--face-c-ground);
}
.pc-card[data-tier="t2"] > .pc-ability {
  --ab-top: 0; --ab-h: var(--face-rows-h);
  left: var(--face-ground-x); width: var(--face-ground-w); height: var(--face-rows-h);
}
.pc-card[data-tier="t2"] > .pc-trick { top: var(--face-rows-trick-y); }
.pc-card[data-tier="t2"] > .pc-passive { top: var(--face-rows-passive-y); }
.pc-card[data-tier="t2"] > .pc-trap {
  /* the strip (element @10%, precomposed) is the box; the row text sits 4 units inside it */
  top: var(--face-trap-strip-y); height: var(--face-trap-strip-h); background: var(--face-c-trap);
  --ab-top: calc(var(--face-rows-trap-y) - var(--face-trap-strip-y)); --ab-h: var(--face-rows-trap-h);
}
.pc-card[data-tier="t2"] .pc-ability > * { position: absolute; top: var(--ab-top); height: var(--ab-h); }
.pc-card[data-tier="t2"] .pc-ab-label {
  left: calc(var(--face-columns-lx) - var(--face-ground-x)); width: var(--face-rows-label-w);
  font: 700 var(--face-type-label)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-label);
  color: var(--face-c-dim-rows);
}
.pc-card[data-tier="t2"] .pc-trap .pc-ab-label { color: var(--face-c-el-trap); }
.pc-card[data-tier="t2"] .pc-ab-name {
  left: calc(var(--face-columns-nx) - var(--face-ground-x)); width: var(--face-rows-name-w);
  font: 700 var(--face-type-name)/1.2 var(--pc-sans);
}
.pc-card[data-tier="t2"] .pc-ab-text {
  left: calc(var(--face-columns-tx) - var(--face-ground-x)); width: var(--face-rows-text-w);
  font: 400 var(--face-type-body)/1.2 var(--pc-sans); opacity: var(--face-op-text);
}

/* flavour: bottom-anchored above the band, right-aligned, spans the art width */
.pc-card[data-tier="t2"] > .pc-flavour {
  left: var(--face-flavour-x); top: var(--face-flavour-y);
  width: var(--face-flavour-w); height: var(--face-flavour-h);
  justify-content: flex-end; text-align: right; white-space: normal;
  font: 400 var(--face-type-caption)/1.2 var(--pc-sans); color: var(--face-c-dim-rows);
}

/* stats band: element tint 14% over the plate; the only lines are the 2 dividers */
.pc-card > .pc-band {
  left: var(--face-band-x); top: var(--face-band-y);
  width: var(--face-band-w); height: var(--face-band-h); background: var(--face-c-band);
}
.pc-card[data-tier="t2"] > .pc-stats {
  left: var(--face-stats-x); top: var(--face-stats-div-y);
  width: var(--face-stats-w); height: var(--face-stats-div-h);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.pc-card[data-tier="t2"] .pc-stat { position: relative; }
.pc-card[data-tier="t2"] .pc-stat + .pc-stat::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: var(--face-stats-div-w);
  background: var(--face-c-ink); opacity: var(--face-op-divider);
}
.pc-card[data-tier="t2"] .pc-stat > * { position: absolute; left: var(--face-stats-pad); }
.pc-card[data-tier="t2"] .pc-stat-l {
  top: calc(var(--face-stats-label-y) - var(--face-stats-div-y));
  width: var(--face-stats-label-w); height: var(--face-stats-label-h);
  font: 700 var(--face-type-label)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-label);
  color: var(--face-c-dim-band);
}
.pc-card[data-tier="t2"] .pc-stat-v {
  top: calc(var(--face-stats-val-y) - var(--face-stats-div-y));
  width: var(--face-stats-val-w); height: var(--face-stats-val-h);
  font: 700 var(--face-type-value)/1.2 var(--pc-mono);
}
.pc-card[data-tier="t2"] .pc-gauge { top: calc(var(--face-stats-gauge-y) - var(--face-stats-div-y)); }

/* gauge — five steps, length carries magnitude (shared by T2; T1 shows numbers only) */
.pc-gauge { display: flex; gap: calc(var(--face-stats-seg-pitch) - var(--face-stats-seg-w)); }
.pc-seg {
  display: block; width: var(--face-stats-seg-w); height: var(--face-stats-seg-h);
  background: var(--face-c-ink); opacity: var(--face-op-gauge-off);
}
.pc-seg.is-on { background: var(--face-c-el-txt); opacity: 1; }

/* ======================================================================================
   BATTLE STATE GLYPHS (all tiers) — glyph-only, one chip per active status. The row exists only
   when at least one status is active (card.js renders nothing otherwise), so there is never an
   empty row or a gap. Buffs = light chip, debuffs = ink chip: shape/polarity, not hue, carries it.
   ====================================================================================== */
/* tags: absolutely positioned on the card's left edge, ~55% outside, stacked from just under the header */
.pc-card > .pc-tags {
  left: calc(var(--pc-glyph) * -0.55); top: calc(var(--face-bezel-y) + var(--pc-glyph) * 0.25);
  display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--pc-glyph) * 0.2);
  z-index: 2; pointer-events: auto;
}
.pc-card[data-tier="t2"] { --pc-glyph: calc(var(--face-type-display) * 1.15); }
.pc-card[data-tier="t1"] { --pc-glyph: calc(var(--face-type-display) * 1.5); }
.pc-card[data-tier="t0"] { --pc-glyph: calc(var(--face-type-value) * 2.2); }
.pc-st-more .pc-st-t { font: 700 calc(var(--pc-glyph) * 0.62)/1 var(--pc-mono, monospace); }
.pc-st {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: var(--pc-glyph); height: var(--pc-glyph);
  border: var(--face-pip-stroke) solid var(--face-c-ink);
  background: var(--face-c-plate-base); color: var(--face-c-ink);
}
.pc-st.is-debuff { background: var(--face-c-ink); color: var(--face-c-plate-base); }
.pc-st svg { width: 72%; height: 72%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pc-st svg .fill { fill: currentColor; }
.pc-st-n {
  position: absolute; right: -0.12em; bottom: -0.16em; min-width: 1.15em; padding: 0 0.15em;
  font: 700 calc(var(--pc-glyph) * 0.42)/1.25 var(--pc-mono); text-align: center;
  background: var(--face-c-el-txt); color: var(--face-c-plate-base);
}

/* ======================================================================================
   T1 / T0 · same box as T2 (1152:1600), same art slot, same bezel. Roles are *removed* and the
   survivors re-distributed inside the box. Type = the face's scale x a per-role boost (the only
   renderer-owned numbers; unitless).
   ====================================================================================== */
.pc-card[data-tier="t1"] {
  --pc-fs-value: calc(var(--face-type-value) * 1.5);
  --pc-fs-name: calc(var(--face-type-name) * 2.5);
  --pc-fs-text: calc(var(--face-type-caption) * 2.7);
  --pc-fs-label: calc(var(--face-type-label) * 3);
}
.pc-card[data-tier="t0"] {
  --pc-fs-number: calc(var(--face-type-display) * 1.9);
  --pc-fs-hp: calc(var(--face-type-value) * 3.4);
  --pc-fs-label: calc(var(--face-type-label) * 4);
}
.pc-card[data-tier="t1"] > .pc-mat, .pc-card[data-tier="t0"] > .pc-mat, .pc-card[data-tier="t2"][data-rail="0"] > .pc-mat {
  /* no rail strip: the mat closes symmetrically round the art (bezel margin on all four sides) */
  height: calc(var(--face-art-h) + (var(--face-art-y) - var(--face-bezel-y)) * 2);
}

/* header: padded to the T2 header's own margins, centred on the T2 header line */
.pc-card[data-tier="t1"] > .pc-header, .pc-card[data-tier="t0"] > .pc-header {
  left: 0; top: 0; width: 100%; height: var(--face-bezel-y);
  padding: var(--face-canvas-rimw) var(--face-bezel-x) 0 var(--face-header-icon-x);
  display: flex; flex-direction: column; justify-content: center; gap: calc(var(--face-stats-seg-h) * 0.7);
}
.pc-card .pc-hrow { display: flex; align-items: center; gap: 0.55em; min-width: 0; }
.pc-card[data-tier="t1"] .pc-hrow { font-size: var(--pc-fs-text); }
.pc-card[data-tier="t0"] .pc-hrow { font-size: var(--pc-fs-number); }
.pc-card[data-tier="t1"] .pc-diamond, .pc-card[data-tier="t0"] .pc-diamond {
  position: static; flex: none; width: var(--face-header-icon-w); height: var(--face-header-icon-h);
  margin-right: calc(var(--face-header-icon-w) * 0.3);
}
.pc-card[data-tier="t1"] .pc-number { font: 700 var(--pc-fs-text)/1 var(--pc-mono); letter-spacing: var(--face-ls-number); opacity: var(--face-op-number); }
/* NAMING (adapted to T1's flow header): the same balance as the approved T2 proof — name hero at
   27u full ink, number demoted beneath it at 18u/62%. The number keeps its place (after the
   element diamond) and the HP block keeps its own; only the name+number pair is stacked. */
.pc-card[data-tier="t1"] .pc-namebox { display: flex; flex-direction: column; justify-content: center; flex: none; min-width: 0; }
.pc-card[data-tier="t1"] .pc-name {
  /* flex, not text-align: flex centres an overflowing line instead of falling back to start */
  display: flex; align-items: center; justify-content: center;
  font: 700 var(--face-type-name)/1.05 var(--pc-sans);
  /* item 3: the T1 name reads too small — the scale's name size x1.45 (39u ≈ 10.7px on the
     lab's 265px T1, 17.8px on the 525px seat card), still inside the seven-size scale as a
     computed multiple; the phone T1 fallback gets a 10px legibility floor. The lab shrinks a
     long name back down only when it would otherwise collide with the diamond / HP block. */
  font-size: max(calc(var(--u) * 39), 10px);
  color: var(--face-c-ink); white-space: nowrap;
}
.pc-card[data-tier="t1"][data-name] .pc-number { font: 700 var(--face-type-caption)/1 var(--pc-mono); font-size: max(calc(var(--u) * 18), 6px); }
/* the active/opponent unit uses the proof's slot: name centred on the number's centre (576u),
   number demoted beneath it. The element diamond and the HP block stay in the flow row. */
.pc-card[data-tier="t1"]:not([data-bench]) .pc-namebox {
  position: absolute; left: var(--face-header-number-x); top: calc(var(--u) * 56);
  width: var(--face-header-number-w); height: calc(var(--u) * 62);
  text-align: center;
}
.pc-card[data-tier="t1"]:not([data-bench]) .pc-namebox .pc-name,
.pc-card[data-tier="t1"]:not([data-bench]) .pc-namebox .pc-number { justify-content: center; text-align: center; }
/* item 5 — BENCH T1 (the grown open tile): the name stays centred in every bench state (owner
   ruling; BASE-CARD-FACE v1.2 pins "centred over the number slot" for the display name and does
   not pin a left alignment for the T1 flow header). The bench T1 namebox takes the settled
   centred slot; the number, when shown, is demoted and centred beneath it. */
/* centred means on the CARD, not in the flow row: the namebox leaves the row (the element
   diamond and the HP block keep the flow ends) and centres itself absolutely in the header —
   the same treatment the settled T0 name gets. justify-content on the column flex was only
   ever vertical; that is why the first pass read left-aligned. */
.pc-card[data-tier="t1"][data-bench] > .pc-header { position: relative; }
.pc-card[data-tier="t1"][data-bench] .pc-namebox { position: absolute; left: 0; width: 100%; top: 0; bottom: 0; align-items: center; justify-content: center; }
.pc-card[data-tier="t1"][data-bench] .pc-name,
.pc-card[data-tier="t1"][data-bench] .pc-number { justify-content: center; text-align: center; }
.pc-card[data-tier="t1"][data-bench] .pc-number { font: 700 var(--face-type-caption)/1 var(--pc-mono); font-size: max(calc(var(--u) * 18), 6px); }
/* narrow T1 header (see feel.js narrowHeader): the name and number share one line when they fit; otherwise the stack is tightened */
.pc-card[data-tier="t1"].hdr-row .pc-namebox { flex-direction: row; align-items: center; justify-content: center; gap: 0.5em; }
.pc-card[data-tier="t1"].hdr-row .pc-name, .pc-card[data-tier="t1"].hdr-row .pc-number { width: auto; flex: none; }
.pc-card[data-tier="t1"].hdr-narrow:not(.hdr-row) .pc-name { line-height: 1; }
.pc-card[data-tier="t0"] .pc-number { font: 700 var(--pc-fs-number)/1 var(--pc-mono); letter-spacing: var(--face-ls-number); opacity: var(--face-op-number); }
.pc-card .pc-spacer { flex: 1; }
.pc-card[data-tier="t1"] .pc-hp { display: flex; align-items: baseline; gap: 0.4em; }
.pc-card[data-tier="t1"] .pc-hp-l { font: 700 var(--pc-fs-label)/1 var(--pc-mono); letter-spacing: var(--face-ls-hp); color: var(--face-c-dim-txt); }
.pc-card[data-tier="t1"] .pc-hp-v { font: 700 var(--pc-fs-value)/1 var(--pc-mono); }
.pc-card[data-tier="t1"] .pc-energy { display: flex; align-items: baseline; gap: calc(var(--face-stats-seg-h) * 0.35); flex: none; }
.pc-card[data-tier="t1"] .pc-en-num { font: 700 var(--pc-fs-value)/1 var(--pc-mono); }
.pc-card[data-tier="t1"] .pc-en-label { font: 700 var(--pc-fs-label)/1 var(--pc-mono); letter-spacing: var(--face-ls-label); color: var(--face-c-dim-txt); }

.pc-hpbar { height: calc(var(--face-stats-seg-h) * 1.5); background: rgb(20 18 16 / var(--face-op-gauge-off)); }
.pc-hpfill { display: block; height: 100%; width: calc(var(--pc-hp-frac, 1) * 100%); background: var(--face-c-el); }

/* lower region: from the mat's bottom edge to the stats band — survivors spread evenly */
.pc-card[data-tier="t1"] > .pc-lower {
  left: var(--face-ground-x); width: var(--face-ground-w);
  top: calc(var(--face-bezel-y) + var(--face-art-h) + (var(--face-art-y) - var(--face-bezel-y)) * 2);
  height: calc(var(--face-band-y) - var(--face-bezel-y) - var(--face-art-h) - (var(--face-art-y) - var(--face-bezel-y)) * 2);
  display: flex; flex-direction: column; justify-content: space-evenly;
}
.pc-card[data-tier="t1"] .pc-attack {
  display: flex; align-items: stretch; justify-content: space-between; gap: 0.5em;
  background: rgb(255 255 255 / var(--face-op-atk-box)); padding: calc(var(--face-stats-seg-h) * 1) calc(var(--face-header-icon-w) * 0.5);
  padding-left: calc(var(--face-header-icon-w) * 2.6);
  font-size: var(--pc-fs-text);
}
/* T1 verb rows own a real leading gutter. The chevron is sized in --u (>= 6px at the 172px T1
   floor) and sits with clear space on both sides: never against the cost pips or the name. */
.pc-card[data-tier="t1"] .pc-verb-mark {
  left: calc(var(--face-header-icon-w) * 0.4);
  /* scaled to the card, with a hard 6px floor (the growth on a phone gets small) */
  width: max(calc(var(--u) * 48), var(--pc-mark-floor, 6px));
  height: max(calc(var(--u) * 60), var(--pc-mark-floor, 6px));
}
.pc-card[data-tier="t1"] .pc-move { display: flex; flex-direction: column; justify-content: center; gap: 0.35em; min-width: 0; }
.pc-card[data-tier="t1"] .pc-move-name { font: 700 var(--pc-fs-name)/1.05 var(--pc-sans); }
.pc-card[data-tier="t1"] .pc-pips { gap: 0.18em; }
.pc-card[data-tier="t1"] .pc-pip { width: 0.62em; height: 0.72em; border-width: 0; }
.pc-card[data-tier="t1"] .pc-dmg {
  position: relative; flex: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0.15em 0.9em;
}
.pc-card[data-tier="t1"] .pc-dmg::before { content: ""; position: absolute; inset: 0; background: var(--face-c-el); opacity: var(--face-op-dmg-zone); }
.pc-card[data-tier="t1"] .pc-dmg > * { position: relative; }
.pc-card[data-tier="t1"] .pc-dmg-v { font: 700 var(--pc-fs-value)/1.05 var(--pc-mono); }
.pc-card[data-tier="t1"] .pc-dmg-l { font: 700 var(--pc-fs-label)/1.1 var(--pc-mono); letter-spacing: var(--face-ls-label); color: var(--face-c-dim-tile); }

.pc-card[data-tier="t1"] .pc-line {
  position: relative;
  display: flex; align-items: center; gap: 0.6em; background: var(--face-c-ground);
  padding: calc(var(--face-stats-seg-h) * 0.8) calc(var(--face-header-icon-w) * 0.5);
  padding-left: calc(var(--face-header-icon-w) * 2.6); font-size: var(--pc-fs-text);
}
.pc-card[data-tier="t1"] .pc-ab-label { font: 700 var(--pc-fs-label)/1.2 var(--pc-mono); letter-spacing: var(--face-ls-label); color: var(--face-c-dim-rows); flex: none; min-width: 3.4em; }
.pc-card[data-tier="t1"] .pc-ab-name { font: 700 var(--pc-fs-text)/1.2 var(--pc-sans); flex: 1; min-width: 0; white-space: normal; }
.pc-card[data-tier="t1"] .pc-line.is-spent { opacity: var(--face-op-number); }
.pc-card[data-tier="t1"] .pc-line.is-spent .pc-ab-name { text-decoration: line-through; }
.pc-card[data-tier="t1"] .pc-marker {
  flex: none; padding: 0.05em 0.45em; font: 700 var(--pc-fs-label)/1.3 var(--pc-mono);
  letter-spacing: var(--face-ls-label); border: var(--face-pip-stroke) solid currentColor;
}
/* armed-trap tab: straddles the mat's lower edge (not a row, takes no layout space) */
.pc-card[data-tier="t1"] > .pc-armed {
  right: var(--face-bezel-x);
  top: calc(var(--face-art-y) + var(--face-art-h) + var(--face-art-y) - var(--face-bezel-y));
  transform: translateY(-50%);
  display: flex; align-items: stretch; gap: 0.9em; font-size: var(--pc-fs-text);
  background: var(--face-c-el-trap); color: var(--face-c-plate-base);
  border: var(--face-pip-stroke) solid var(--face-c-plate-base);
}
.pc-card[data-tier="t1"] .pc-armed .pc-marker { background: var(--face-c-plate-base); color: var(--face-c-el-trap); border: 0; padding: 0.1em 0.5em; }
.pc-card[data-tier="t1"] .pc-armed-name { padding: 0.1em 0.55em; font: 700 var(--pc-fs-text)/1.2 var(--pc-sans); white-space: nowrap; display: flex; align-items: center; }

/* stats band: numbers only (gauge removed) */
.pc-card[data-tier="t1"] > .pc-stats {
  left: var(--face-stats-x); top: var(--face-stats-div-y); width: var(--face-stats-w); height: var(--face-stats-div-h);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.pc-card[data-tier="t1"] .pc-stat { position: relative; display: flex; align-items: center; justify-content: center; gap: 0.5em; }
.pc-card[data-tier="t1"] .pc-stat + .pc-stat::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: var(--face-stats-div-w);
  background: var(--face-c-ink); opacity: var(--face-op-divider);
}
.pc-card[data-tier="t1"] .pc-stat-l { font: 700 var(--pc-fs-label)/1 var(--pc-mono); letter-spacing: var(--face-ls-label); color: var(--face-c-dim-band); }
.pc-card[data-tier="t1"] .pc-stat-v { font: 700 var(--pc-fs-value)/1 var(--pc-mono); }

/* T0: header = diamond + number; art; the pupil's TRICK (its bench verb); band carries the HP bar */
.pc-card[data-tier="t0"] > .pc-lower {
  left: var(--face-ground-x); width: var(--face-ground-w);
  top: calc(var(--face-bezel-y) + var(--face-art-h) + (var(--face-art-y) - var(--face-bezel-y)) * 2);
  height: calc(var(--face-band-y) - var(--face-bezel-y) - var(--face-art-h) - (var(--face-art-y) - var(--face-bezel-y)) * 2);
  display: flex; align-items: center; justify-content: center;
}
/* NAMING (approved bench proof): the given name only, centred on the card and vertically in the
   border→art header strip (110u ≈ 8.0px on the 83.5px bench tile). The number demotes to a 40u
   mark at the row's right end; the element diamond and the trick caption keep their places. */
.pc-card[data-tier="t0"] .pc-t0name {
  position: absolute; left: 0; width: 100%;
  top: var(--face-canvas-rimw); bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--u) * 110);
  /* optical v-centre: the proof measured glyph gaps 25u/26u in the strip */
  transform: translateY(calc(var(--u) * 3.5));
}
.pc-card[data-tier="t0"][data-name] .pc-number {
  font: 700 calc(var(--u) * 40)/1.2 var(--pc-mono);
  letter-spacing: var(--face-ls-number); opacity: var(--face-op-number); flex: none;
}
.pc-card[data-tier="t0"] .pc-t0-trick {
  display: block;
  font: 700 calc(var(--face-type-value) * 3.8)/1.05 var(--pc-sans);
  letter-spacing: calc(var(--face-ls-label) * 0.6);
  color: var(--face-c-el-txt); text-align: center; white-space: nowrap;
}
/* elision, not truncation: below the legibility floor the caption drops the name entirely */
@container (max-width: 4em) {
  .pc-card[data-tier="t0"] .pc-t0-trick { display: none; }
}
.pc-card[data-tier="t0"] > .pc-band {
  display: flex; align-items: center; padding: 0 var(--face-stats-pad);
}
.pc-card[data-tier="t0"] > .pc-band .pc-hpbar { flex: 1; height: calc(var(--face-stats-seg-h) * 3.5); background: rgb(20 18 16 / calc(var(--face-op-gauge-off) * 1.5)); }
