/*
  MYTHSTRIKE combat HUD stylesheet (plan 02-01, UI-SPEC Phase 2 components
  #2 Hitmarker + #10 DummyHPBar DOM variant + the #world-hud layer; plan
  02-02 weapon zone; plan 02-03 feedback suite — kill feed #4, killstreak
  banner #5, damage-direction ring #3 + vignette, damage numbers #9, death
  recap #11, training/audio chips #12/#16).

  Layer contract (UI-SPEC): #world-hud is a fixed, click-through sibling of
  #ui-root above the canvas (z-hud); world-anchored feedback lives there,
  screen-anchored feedback (hitmarker) in #ui-root. All geometry/motion
  VALUES live in client/src/fx/hud-constants.js (JS applies them at pool
  init) — this file carries layout, color tokens and the variant theming.
*/

/* ------------------------------------------------------------------ */
/* #world-hud layer — world-anchored feedback (HP bars, later numbers)  */
/* ------------------------------------------------------------------ */

#world-hud {
  position: fixed;
  inset: 0;
  pointer-events: none; /* the canvas always receives gameplay input */
  z-index: var(--z-hud);
  overflow: hidden;
}

/* DummyHPBar (component #10, DOM variant): track + scaleX fill. JS writes
   translate3d per frame (compositor-only) with margins pre-centering the
   bar on the projected anchor. */
.ms-hpbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px; /* mirrors HUD_CONSTANTS.dummyHp.widthPx */
  height: 8px; /* mirrors HUD_CONSTANTS.dummyHp.heightPx */
  margin: -4px 0 0 -32px; /* pre-center on the projected point */
  background: var(--navy-raised);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-comic);
  visibility: hidden; /* until the first per-frame position write */
  pointer-events: none;
}

.ms-hpbar__fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--danger);
  transform: scaleX(1);
  transform-origin: left center; /* drains toward the left as HP drops */
}

/* ------------------------------------------------------------------ */
/* Hitmarker (component #2) — 4 diagonal ticks at 45°, center-anchored  */
/* ------------------------------------------------------------------ */

.ms-hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-hitmarker__ticks {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0; /* flashes are animation-driven (Web Animations API) */
}

/* Tick geometry (size + 45° offset) is written by JS from hud-constants at
   init/trigger; this carries the resting shape. */
.ms-hitmarker__tick {
  position: absolute;
  background: var(--paper);
  border-radius: 1px;
}

/* Kill burst ring: sized/scaled by JS (Ø 16 → 40 px), colored here. */
.ms-hitmarker__ring {
  position: absolute;
  left: 0;
  top: 0;
  border: 2px solid var(--danger);
  border-radius: 50%;
  opacity: 0;
}

/* Variant theming — headshot is gold + thicker (tier 7), kill is danger. */
.ms-hitmarker--headshot .ms-hitmarker__tick {
  background: var(--gold);
}

.ms-hitmarker--kill .ms-hitmarker__tick {
  background: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Crosshair per-weapon variants (component #1, plan 02-02)            */
/* ------------------------------------------------------------------ */

/* 02-02: the crosshair becomes a 0×0 anchor at the projected aim point;
   children carry the per-variant visuals. These rules override the Phase 1
   dot styling in ui.css (hud.css is linked after it). */
.ms-crosshair {
  width: 0;
  height: 0;
  margin: 0;
  background: none;
  border: none;
  border-radius: 0;
  opacity: 1; /* JS writes the equip-lock dim (40%) as an inline opacity */
}

/* Every variant child is absolutely positioned around the anchor and hidden
   until its data-mode selects it. */
.ms-crosshair__dot,
.ms-crosshair__tick,
.ms-crosshair__ring,
.ms-crosshair__hair,
.ms-crosshair__sniper-dot,
.ms-crosshair__warning {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  pointer-events: none;
}

/* The Phase 1 look, kept as the no-weapon default: 4px paper dot, 1px ink
   outline, resting at 70% opacity. */
.ms-crosshair__dot {
  width: var(--sp-xs);
  height: var(--sp-xs);
  margin: calc(var(--sp-xs) / -2) 0 0 calc(var(--sp-xs) / -2);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0.7;
}
.ms-crosshair[data-mode="dot"] .ms-crosshair__dot {
  display: block;
}

/* Pistol/Rifle: 2×10px paper ticks with a 1px ink outline; JS drives the
   live gap from the sim cone. */
.ms-crosshair__tick {
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
  border-radius: 1px;
}
.ms-crosshair[data-mode="ticks"] .ms-crosshair__tick {
  display: block;
}

/* Shotgun: 3px paper ring with inner+outer ink outline; JS drives the
   diameter from the sim cone. */
.ms-crosshair__ring {
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px var(--ink),
    inset 0 0 0 1px var(--ink);
}
.ms-crosshair[data-mode="shotgun"] .ms-crosshair__ring {
  display: block;
}

/* Sniper: static 2px hairs (24px arms) + 3px paper center dot. */
.ms-crosshair__hair {
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}
.ms-crosshair__hair--v {
  width: 2px;
  height: 24px;
  margin: -12px 0 0 -1px;
}
.ms-crosshair__hair--h {
  width: 24px;
  height: 2px;
  margin: -1px 0 0 -12px;
}
.ms-crosshair__sniper-dot {
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  background: var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--ink);
}
.ms-crosshair[data-mode="sniper"] .ms-crosshair__hair,
.ms-crosshair[data-mode="sniper"] .ms-crosshair__sniper-dot {
  display: block;
}

/* Accuracy warning ring: current cone exceeds the threshold (readability
   over generosity — dual-coded by shape, never color alone). */
.ms-crosshair__warning {
  border: 2px solid var(--danger);
  border-radius: 50%;
}
.ms-crosshair[data-mode="sniper"][data-warn="1"] .ms-crosshair__warning {
  display: block;
}

/* ------------------------------------------------------------------ */
/* Weapon zone (components #6/#7): slots above the card, bottom-right   */
/* ------------------------------------------------------------------ */

.ms-weapon-zone {
  position: absolute;
  right: var(--sp-xl); /* bottom-right region inset (screen-region contract) */
  bottom: var(--sp-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-sm);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* WeaponSlots (component #7) — four 32×32 chips, fixed order. */
.ms-weapon-slots {
  display: flex;
  gap: var(--sp-xs);
  pointer-events: none;
}

.ms-weapon-slot {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}

.ms-weapon-slot__glyph {
  width: var(--icon-size);
  height: var(--icon-size);
}

.ms-weapon-slot__digit {
  color: var(--muted);
}

/* Equipped chip: gold left marker + gold digit (use 9) on navy fill. */
.ms-weapon-slot--active {
  background: var(--navy-raised);
  border-color: var(--navy-line);
  box-shadow: var(--shadow-comic);
}

.ms-weapon-slot--active .ms-weapon-slot__digit {
  color: var(--gold);
}

.ms-weapon-slot__marker {
  display: none;
}

.ms-weapon-slot--active .ms-weapon-slot__marker {
  display: block;
  position: absolute;
  left: -2px; /* sit on the chip's left edge */
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
}

/* 04-05 grenade chip: THROWN, never equipped — the dashed border separates
   the consumable from the four equippable slots; the empty hand stays dim
   (base chip: transparent fill, muted glyph + digit). */
.ms-weapon-slot--grenade {
  border-style: dashed;
}

/* A grenade in hand: lit fill + gold glyph + digit (the equipped chip's
   palette minus the marker — the chip is never "selected"). */
.ms-weapon-slot--grenade-lit {
  background: var(--navy-raised);
  box-shadow: var(--shadow-comic);
}

.ms-weapon-slot--grenade-lit .ms-weapon-slot__glyph,
.ms-weapon-slot--grenade-lit .ms-weapon-slot__digit {
  color: var(--gold);
}

/* WeaponCard (component #6). */
.ms-weapon-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--navy-raised);
  border: var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
  pointer-events: none;
  transition: opacity var(--dur-panel) var(--ease-out);
}

.ms-weapon-card--dead {
  opacity: 0.5;
}

.ms-weapon-card__name {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

.ms-weapon-card__ammo {
  display: flex;
  align-items: baseline;
  gap: var(--sp-xs);
}

/* Mag digits: Display Titan One 40, min-width 2ch, center-anchored so
   proportional digit widths never jitter the layout. */
.ms-weapon-card__mag {
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--paper);
  min-width: 2ch;
  text-align: center;
}

.ms-weapon-card__mag--low {
  color: var(--danger);
}

.ms-weapon-card__reserve {
  color: var(--muted);
}

/* Context state line: RELOAD [R] pulse / Reloading… / OUT. */
.ms-weapon-card__state {
  margin: 0;
  min-height: 1.2em; /* reserve the line — the card never reflows */
  color: var(--danger);
}

.ms-weapon-card__state--pulse {
  animation: ms-reload-pulse 500ms ease-in-out infinite;
}

@keyframes ms-reload-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Reload mirror bar: navy track, gold fill (reserved use 10). */
.ms-weapon-card__bar {
  width: 120px;
  height: var(--sp-xs);
  background: var(--ink);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.ms-weapon-card__bar-fill {
  height: 100%;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ------------------------------------------------------------------ */
/* ReloadRing (component #8) — Ø36px ring on the crosshair center      */
/* ------------------------------------------------------------------ */

.ms-reload-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-reload-ring__svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px; /* mirrors HUD_CONSTANTS.reloadRing.diameterPx */
  height: 36px;
  margin: -18px 0 0 -18px; /* pre-center on the projected aim point */
}

.ms-reload-ring__track {
  stroke: var(--navy-line);
}

.ms-reload-ring__arc {
  stroke: var(--gold); /* reload progress fill (reserved use 10) */
}

/* Reduced motion: the reload pulse collapses to steady text. */
@media (prefers-reduced-motion: reduce) {
  .ms-weapon-card__state--pulse {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* KillFeed (component #4, plan 02-03) — top-right combat log          */
/* ------------------------------------------------------------------ */

/* Screen-region contract: 32px inset top-right, grows DOWN, hard-capped at
   5 rows by the pool (never scrolls). Hidden entirely when empty — presence
   IS the data. */
.ms-feed {
  position: absolute;
  top: var(--sp-xl);
  right: var(--sp-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-xs);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* One kill: comic chip (killer → weapon glyph → victim → distance). */
.ms-feed__chip {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic);
}

/* Actor names: Display Titan One 20, paper base; single line with ellipsis
   (generated names ≤ 16 chars, foreign ids clamp). 06-05: the actor is a
   SLOT — race sigil (identity shape) before the name, tinted per mode. */
.ms-feed__actor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  color: var(--feed-accent, var(--paper));
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The race sigil before the label — the same identity-coded shapes the
   scoreboard rows use; pooled per slot, JS toggles display. */
.ms-feed__sigil {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--feed-accent, var(--muted));
}

.ms-feed__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Team tints (TDM — the local player included): the SAME --team-a/--team-b
   properties the wiring injects for the strip/board/dots, paper fallback. */
.ms-feed__actor--team-a {
  color: var(--team-a, var(--paper));
}

.ms-feed__actor--team-b {
  color: var(--team-b, var(--paper));
}

/* YOU tokens: gold as the killer (reserved use 11) when no team tint owns
   the slot (FFA + range), danger as the victim in every mode. */
.ms-feed__actor--you {
  color: var(--gold);
}

.ms-feed__actor--victim-you {
  color: var(--danger);
}

/* Weapon glyph slot: 16px icons, muted; per-kill JS toggles display. */
.ms-feed__weapon {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
}

.ms-feed__glyph {
  width: var(--icon-size);
  height: var(--icon-size);
}

.ms-feed__glyph--headshot {
  color: var(--gold);
}

/* ------------------------------------------------------------------ */
/* KillstreakBanner (component #5, plan 02-03) — upper-center wordmark  */
/* ------------------------------------------------------------------ */

/* Single slot at ~28vh; JS owns the inline top (hud-constants topVh) and the
   WAAPI lifecycle. The resting transform keeps the pre-WAAPI fallback and
   the fill-forwards end state horizontally centered. */
.ms-banner {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* The wordmark treatment: Display Titan One 40, gold fill (reserved use 8),
   3px ink stroke, comic hard shadow. */
.ms-banner__word {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--gold);
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* DamageDirectionRing (component #3, plan 02-03) — incoming-fire       */
/* compass at the crosshair center + the screen-edge danger vignette   */
/* ------------------------------------------------------------------ */

/* 0×0 anchor: JS writes translate3d per frame (follows the projected aim
   point like the reload ring). */
.ms-direction {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

/* Ø192 SVG pre-centered on the anchor; arc strokes colored here, geometry
   (span/thickness/outline) set as attributes from hud-constants. */
.ms-direction__svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 192px; /* mirrors HUD_CONSTANTS.damageDirection.ringDiameterPx */
  height: 192px;
  margin: -96px 0 0 -96px;
}

.ms-direction__ink {
  stroke: var(--ink);
}

.ms-direction__arc {
  stroke: var(--danger);
}

/* Danger vignette: fixed full-screen edge glow, opacity animation-driven
   (WAAPI pulse on every incoming hit). */
.ms-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-hud);
  box-shadow: inset 0 0 120px 24px var(--danger);
}

/* ------------------------------------------------------------------ */
/* DamageNumber (component #9, plan 02-03) — #world-hud readouts        */
/* ------------------------------------------------------------------ */

/* World-anchored Titan One 40 with ink stroke + hard shadow; JS centers it
   on the projected anchor via translate(-50%,-50%) inside the frame
   transform and drives pop/float/fade by bucket age. */
.ms-dmgnum {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--paper);
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
  visibility: hidden; /* until the first per-frame position write */
  pointer-events: none;
  will-change: transform, opacity;
}

/* Headshot tier: gold (reserved use 7). */
.ms-dmgnum--head {
  color: var(--gold);
}

/* ------------------------------------------------------------------ */
/* DeathRecap (component #11, plan 02-03) — pause-grade death surface   */
/* ------------------------------------------------------------------ */

/* Full-screen ink dim (70%) + centered card above the HUD (z-panel = 20 per
   UI-SPEC). Never blocks input — click-through like every HUD tenant. */
.ms-recap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: var(--z-panel);
}

.ms-recap__dim {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0.7;
}

/* The card's glass chrome, heading, byline and stat grid live in
   screens.css (07.3-17, UI-SPEC S11 — the results/pause glass recipe). */
.ms-recap__card {
  position: relative; /* above the dim */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Respawn countdown: Display Titan One 40, gold (reserved use 12). */
.ms-recap__respawn {
  margin: var(--sp-xs) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--gold);
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
}

/* ------------------------------------------------------------------ */
/* Persistent chips (components #12/#16, plan 02-03) — training mode   */
/* bottom-left, audio-unavailable bottom-center                        */
/* ------------------------------------------------------------------ */

.ms-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-comic);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* Audio-unavailable degradation: muted copy, bottom-center. */
.ms-audio-chip {
  left: 50%;
  bottom: var(--sp-xl);
  transform: translateX(-50%);
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Component #15 — ToastPill (plan 02-05): top-center transient system  */
/* pill (spread-wall reset now, reusable later). Sticker chrome like    */
/* the chips; gold border — a positive system notice (reserved use 2).  */
/* Motion is WAAPI (pop-in / fade-out in toastPill.js).                */
/* 06-05: the pill is TRANSIENT MEMBER 2 of the top-center zone stack   */
/* (.ms-zone-top, match-loop section) — it renders BELOW the strip and  */
/* the zone owns both anchor and centering, so this rule is a static    */
/* zone member (no position of its own).                               */
/* ------------------------------------------------------------------ */

/* 07.2 proc screen tint (ultFeedback.js): a full-viewport edge vignette in
   the flash color, faded by WAAPI; never interactive. */
.ms-proctint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  background: radial-gradient(ellipse at center, transparent 55%, var(--tint, transparent) 100%);
}

.ms-toast {
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--gold);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-comic);
  pointer-events: none;
}

/* 07.2: the ultimate feedback pill — its OWN slot beside the cooldown ring
   (search / not ready / blocked), never the top-center system toast and
   never the onboarding tip bubble. */
.ms-toast--ult {
  position: absolute;
  left: calc(100% + var(--sp-sm));
  bottom: 0;
  white-space: nowrap;
  z-index: var(--z-hud);
}

/* Reduced motion (02-03): every WAAPI-driven element above also collapses —
   JS feature-detects el.animate, so only the CSS keyframe pulse exists here
   and it is already covered above; feed/banner/numbers fade without travel
   because their motion is entirely animation-driven (no CSS to reduce). */

/* ------------------------------------------------------------------ */
/* UltimateChargeRing (component #7, plan 03-01) — bottom-left region  */
/* ------------------------------------------------------------------ */

/* Column: ring (+ centered keycap) above the ultimate name label. Interim
   anchor (03-01): the Phase 2 training chip KEEPS its bottom-left spot and
   the ring stacks beneath the region at the chip's x — the full
   RaceHUDCluster (03-06) re-stacks both into the spec's 16px-inset column.
   --race-accent is written by JS from the race config (fallback covers the
   pre-first-update frame). */
.ms-chargering {
  position: absolute;
  left: var(--sp-xl); /* aligned with the training chip's column */
  bottom: calc(var(--sp-xl) + 44px); /* clears the chip + gap */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-chargering__ring {
  position: relative;
  width: 36px; /* mirrors HUD_CONSTANTS.chargeRing.diameterPx */
  height: 36px;
}

.ms-chargering__svg {
  display: block;
  width: 36px;
  height: 36px;
}

.ms-chargering__track {
  stroke: var(--navy-line);
}

.ms-chargering__arc {
  stroke: var(--race-accent, var(--paper));
  transition: none; /* the arc is per-frame data-driven, never eased */
}

/* Center Q keycap chip: navy-raised + muted while charging. */
.ms-chargering__keycap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

/* Ready: accent fill + ink Q + the 500 ms pulse (opacity — hue never
   carries the state alone; the fill + text color flip do). */
.ms-chargering--ready .ms-chargering__keycap {
  background: var(--race-accent, var(--paper));
  border-color: var(--ink);
  color: var(--ink);
  animation: ms-chargering-ready-pulse 500ms ease-in-out infinite;
}

@keyframes ms-chargering-ready-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* Ultimate name below the ring: muted while charging, paper when ready. */
.ms-chargering__label {
  color: var(--muted);
  text-align: center;
}

.ms-chargering--ready .ms-chargering__label {
  color: var(--paper);
}

/* Cast flash: a brief brightness pop over the 150 ms drain. */
.ms-chargering--flash .ms-chargering__arc {
  filter: brightness(1.8);
}

/* 07.2 cooldown economy: not learned yet (level 6) reads dim; the aim
   search pulses the whole ring in the race accent. */
.ms-chargering--locked .ms-chargering__ring {
  opacity: 0.45;
}
.ms-chargering--search .ms-chargering__arc {
  stroke: var(--paper);
  animation: ms-chargering-search 1000ms linear infinite;
}
.ms-chargering--search .ms-chargering__label {
  color: var(--race-accent, var(--paper));
}
@keyframes ms-chargering-search {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ms-skillrow__gate {
  align-self: center;
  padding: 2px 6px;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
  .ms-chargering--ready .ms-chargering__keycap {
    animation: none; /* steady accent chip — state stays color+text coded */
  }
  .ms-chargering--flash .ms-chargering__arc {
    filter: none; /* the drain itself remains (it is state, not decoration) */
  }
}

/* ------------------------------------------------------------------ */
/* SkillScreen (plan 03-06, UI-SPEC #1..#5) — the K Skills & Races     */
/* fullscreen overlay: choice, spend and switch on the 03-04 API       */
/* ------------------------------------------------------------------ */

/* Fullscreen 70% --ink dim (pause/death family), z-panel per the spec's
   z-index extension. The ONE new pointer-interactive surface. */
.ms-skillscreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: var(--z-panel);
}

.ms-skillscreen__dim {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0.7;
}

/* Centered column, max-width 720px, lg padding; scrolls on short viewports
   (spec overflow consideration: column max-height = viewport − insets). */
.ms-skillscreen__panel {
  position: relative; /* above the dim */
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  width: min(720px, calc(100vw - 2 * var(--sp-xl)));
  max-height: calc(100vh - 2 * var(--sp-lg));
  max-height: calc(100dvh - 2 * var(--sp-lg)); /* visible viewport on mobile (vh fallback above) */
  overflow-y: auto;
  padding: var(--sp-lg);
  background: var(--navy-raised);
  border: var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
}

/* Open motion: fade + translateY(8px → 0), 150ms ease-out (spec table). */
.ms-skillscreen:not(.ms-hidden) .ms-skillscreen__panel {
  animation: ms-skillscreen-in 150ms var(--ease-out);
}

@keyframes ms-skillscreen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header: identity (sigil 32px accent + Display-40 race name in the race
   accent + tagline) beside the stats block (LVL, XP mini-bar, points). */
.ms-skillscreen__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-lg);
}

.ms-skillscreen__ident {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.ms-skillscreen__sigil {
  color: var(--race-accent, var(--paper));
}

.ms-skillscreen__sigil .ms-icon {
  width: 32px; /* 32px on the SkillScreen header (spec #18) */
  height: 32px;
}

/* The identity moment: Display Titan One 40, race-accent fill, 3px ink
   stroke, comic hard shadow (accent use 1 — identity, never state). */
.ms-skillscreen__racename {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--race-accent, var(--paper));
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
}

.ms-skillscreen__tagline {
  margin: 0;
  color: var(--muted);
}

.ms-skillscreen__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-xs);
}

/* "LVL {n}": Titan One 20, paper (same treatment class as feed actors). */
.ms-skillscreen__level {
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  color: var(--paper);
}

/* XP mini-bar: gold fill (use 16 family), 120px track. */
.ms-skillscreen__xptrack {
  width: 120px;
  height: var(--sp-xs);
  background: var(--ink);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.ms-skillscreen__xpfill {
  height: 100%;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
}

/* "340 / 500 XP" under the bar (MAX at the top level). */
.ms-skillscreen__xptext {
  font-family: var(--font-mono);
  font-size: var(--text-label-size);
  color: var(--muted);
  white-space: nowrap;
}

/* Points badge: gold pill (use 15 — the standing CTA), pulses while > 0. */
.ms-skillscreen__points {
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--ink);
}

.ms-skillscreen__points--pulse {
  animation: ms-soft-pulse 500ms ease-in-out infinite;
}

@keyframes ms-soft-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.ms-skillscreen__zerohint {
  color: var(--muted);
}

/* Race cards: 4-up grid (2×2 at 720px; cards ~200px, md padding). */
.ms-skillscreen__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-xl);
}

.ms-racecard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-md);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
}

/* Active card: race-accent 2px border + accent left marker (accent use 4). */
.ms-racecard--active {
  border-color: var(--race-accent, var(--paper));
  position: relative;
}

.ms-racecard--active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: var(--sp-sm);
  bottom: var(--sp-sm);
  width: 3px;
  border-radius: 2px;
  background: var(--race-accent, var(--paper));
}

/* Queued card: accent border too (the queue state is identity-adjacent). */
.ms-racecard--queued {
  border-color: var(--race-accent, var(--paper));
}

.ms-racecard__identity {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

/* Card sigil 48px, accent fill — the shape IS the identity (spec #2). The
   card's --race-accent is injected from CONFIG at render time (raceCard.js)
   — race accents are data, never hardcoded here (binding spec rule). */
.ms-racecard__sigil {
  color: var(--race-accent, var(--paper));
}

.ms-racecard__sigil .ms-icon {
  width: 48px;
  height: 48px;
}

.ms-racecard__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

/* Race name: Titan One 20, paper (spec typography extension). */
.ms-racecard__name {
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  color: var(--paper);
}

.ms-racecard__tagline {
  color: var(--muted);
}

.ms-racecard__level {
  color: var(--paper);
}

/* The race's XP inside its level ("340 / 500 XP", MAX at the top). */
.ms-racecard__xp {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

.ms-racecard__xp:empty {
  display: none;
}

.ms-racecard__meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

/* QUEUED state chip: accent border (accent use 4). */
.ms-racecard__queued {
  padding: var(--sp-xs) var(--sp-sm);
  border: 2px solid var(--race-accent, var(--paper));
  border-radius: var(--radius-pill);
  color: var(--paper);
}

.ms-racecard__build {
  color: var(--muted);
}

/* Tree panel: 3 SkillRows + UltimateRow on a raised panel. */
.ms-skillscreen__tree {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--ink);
  border: var(--border-line);
  border-radius: var(--radius-lg);
}

/* SkillRow: name + counter head, description, pips + "+" body. */
.ms-skillrow {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-sm) 0;
}

.ms-skillrow + .ms-skillrow {
  border-top: 1px solid var(--navy-line);
}

.ms-skillrow__head {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

/* Skill name: Heading 20 Rubik 600, paper. */
.ms-skillrow__name {
  font-family: var(--font-ui);
  font-size: var(--text-heading-size);
  font-weight: var(--weight-semibold);
  line-height: var(--text-heading-lh);
  color: var(--paper);
}

.ms-skillrow__counter {
  margin-left: auto;
  color: var(--muted);
}

.ms-skillrow__lock {
  width: var(--icon-size);
  height: var(--icon-size);
  color: var(--muted);
}

.ms-skillrow__desc {
  margin: 0;
  color: var(--muted);
}

.ms-skillrow__body {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.ms-skillrow__pips {
  display: flex;
  gap: var(--sp-sm);
}

/* TierPips (spec #5): 12px visual dot on a ≥44px hit area (padding-expanded
   button, --hit-target). State styling on the dot ::after — fill + border +
   the "3/6" counter text keep pip state never color-only. */
.ms-pip {
  position: relative;
  width: var(--hit-target);
  height: var(--hit-target);
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.ms-pip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid var(--navy-line);
  background: transparent;
  transition: transform 80ms var(--ease-out);
}

/* Filled: race accent (accent use 2 — the build state). */
.ms-pip--filled::after {
  border-color: var(--race-accent, var(--paper));
  background: var(--race-accent, var(--paper));
}

/* Next-affordable: paper outline + soft pulse while points > 0. */
.ms-pip--next::after {
  border-color: var(--paper);
}

.ms-pip--pulse::after {
  animation: ms-soft-pulse 500ms ease-in-out infinite;
}

/* Capstone pip: 16px dot (spec #4). */
.ms-pip--capstone::after {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
}

/* Spend pop: dot pops scale 1.2 → 1.0 (80ms — spec motion table). */
.ms-pip:active::after {
  transform: scale(1.2);
}

.ms-pip:disabled {
  cursor: default;
}

.ms-skillrow--stub .ms-pip::after {
  border-color: var(--navy-line);
  opacity: 0.5; /* muted — visible-locked, honest about payload */
}

/* The row "+" spend button: compact ghost (44px hit target from ui.css). */
.ms-skillrow__plus {
  min-width: var(--hit-target);
  margin-left: auto;
}

/* UltimateRow additions. */
.ms-ultrow__sigil {
  display: flex;
  color: var(--race-accent, var(--paper));
}

/* OWNED chip after the capstone buy. */
.ms-ultrow__owned {
  margin-left: auto;
  padding: var(--sp-xs) var(--sp-sm);
  border: 2px solid var(--race-accent, var(--paper));
  border-radius: var(--radius-pill);
  color: var(--paper);
}

.ms-ultrow__pipgroup {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.ms-ultrow__value {
  color: var(--muted);
}

/* Footer: respec (danger — the phase's only destructive action) + reason
   line + the "K — skills" close hint. */
.ms-skillscreen__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.ms-skillscreen__respec {
  min-width: var(--hit-target);
}

.ms-skillscreen__respecreason {
  color: var(--muted);
}

.ms-skillscreen__closehint {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

@media (prefers-reduced-motion: reduce) {
  .ms-skillscreen:not(.ms-hidden) .ms-skillscreen__panel {
    animation: none;
  }
  .ms-skillscreen__points--pulse,
  .ms-pip--pulse::after {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* RaceHUDCluster (plan 03-06, UI-SPEC #6) — bottom-left column        */
/* ------------------------------------------------------------------ */

/* 16px inset column, sm gaps, indicator-only (nothing clickable). The
   inherited training chip + charge ring are MOVED IN by main.js; their own
   absolute anchors are neutralized below so they flow in the column. */
.ms-cluster {
  position: absolute;
  left: 16px; /* the region inset (hud-constants chargeRing.insetPx) */
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-sm);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* Moved-in tenants: in-flow members of the column (their standalone
   absolute anchors applied only while they lived directly in #ui-root). */
.ms-cluster > .ms-chip,
.ms-cluster > .ms-chargering {
  position: relative; /* 07.2: the ultimate toast anchors to the ring */
  left: auto;
  bottom: auto;
}

/* RaceChip: sigil 16px (accent) + name (Label uppercase paper) + LVL
   (muted) + the points badge (gold pill, pulses while > 0). */
.ms-cluster__race {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-comic);
}

.ms-cluster__sigil {
  display: flex;
  color: var(--race-accent, var(--paper));
}

.ms-cluster__sigil .ms-icon {
  width: 16px; /* 16px on the HUD race chip (spec #6) */
  height: 16px;
}

.ms-cluster__racetext {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ms-cluster__name {
  color: var(--paper);
  text-transform: uppercase;
}

.ms-cluster__level {
  color: var(--muted);
}

.ms-cluster__racebadge {
  display: flex;
}

.ms-cluster__points {
  padding: 1px var(--sp-sm);
  border-radius: var(--radius-pill);
  background: var(--gold); /* the standing CTA (reserved use 15) */
  color: var(--ink);
}

.ms-cluster__points--pulse {
  animation: ms-soft-pulse 500ms ease-in-out infinite;
}

/* Skill mini-rows: Label name (muted) + 6 mini-pips 6px (accent filled /
   navy-line empty); stub rows carry the lock glyph instead of pips. */
.ms-cluster__skills {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.ms-cluster__row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.ms-cluster__rowname {
  min-width: 9ch; /* pips align across rows (names are proper, bounded) */
  color: var(--muted);
}

.ms-cluster__rowpips {
  display: flex;
  gap: 4px;
}

.ms-cluster__pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
}

.ms-cluster__pip--filled {
  border-color: var(--race-accent, var(--paper));
  background: var(--race-accent, var(--paper));
}

.ms-cluster__rowlock {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* XPBarHUD (plan 03-06, UI-SPEC #8) — bottom-center, beside AudioChip  */
/* ------------------------------------------------------------------ */

/* Anchors independently to bottom-center, offset LEFT of dead-center so
   the degradation chip (dead-center) never collides (spec #8 note). */
.ms-xpbar {
  position: absolute;
  bottom: var(--sp-xl);
  left: 50%;
  transform: translateX(calc(-50% - 260px));
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-xpbar__left {
  display: flex;
  align-items: baseline;
  gap: var(--sp-xs);
}

.ms-xpbar__eyebrow {
  color: var(--muted);
  text-transform: uppercase;
}

.ms-xpbar__level {
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  color: var(--paper);
}

/* Track: --navy-raised, 2px line border, pill; gold fill (use 16). */
.ms-xpbar__track {
  width: 280px; /* max per spec #8 */
  height: 8px;
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.ms-xpbar__fill {
  height: 100%;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
}

.ms-xpbar__max {
  padding: 1px var(--sp-sm);
  border: 2px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--gold);
}

/* ------------------------------------------------------------------ */
/* XPFloater (plan 03-06, UI-SPEC #10) — rises from the XP bar          */
/* ------------------------------------------------------------------ */

/* Anchor sits above the bar's track center; items are pooled spans whose
   transform (slot spread + rise + pop) is written per frame. */
.ms-xpfloater {
  position: absolute;
  bottom: calc(var(--sp-xl) + 26px);
  left: calc(50% - 260px);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-xpfloater__item {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  white-space: nowrap;
  visibility: hidden;
  will-change: transform, opacity;
}

/* ------------------------------------------------------------------ */
/* SelfStatusChips (plan 03-06, UI-SPEC #13) — above the cluster        */
/* ------------------------------------------------------------------ */

.ms-statuschips {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.ms-statuschip {
  position: relative; /* the timer line anchors to the chip edge */
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-comic);
}

/* Danger-tinted glyphs (the word carries the state dual-coded). */
.ms-statuschip__glyph {
  display: flex;
  color: var(--danger);
}

.ms-statuschip__glyph .ms-icon {
  width: 16px;
  height: 16px;
}

.ms-statuschip__word {
  color: var(--paper);
}

.ms-statuschip__pips {
  display: flex;
  gap: 3px;
}

.ms-statuschip__pip {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
}

.ms-statuschip__pip--on {
  border-color: var(--danger);
  background: var(--danger);
}

/* Timer line: remaining-tick fraction on the chip's lower edge. */
.ms-statuschip__timer {
  position: absolute;
  left: var(--sp-sm);
  right: var(--sp-sm);
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--danger);
  transform-origin: left center;
  transform: scaleX(1);
}

/* ------------------------------------------------------------------ */
/* ProcFeedback (plan 03-06, UI-SPEC #12) — DODGED word + markers       */
/* ------------------------------------------------------------------ */

/* The victim-side DODGED word pops ABOVE the cluster (in-flow, top slot). */
.ms-procword {
  color: var(--paper);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

/* 04-05 WARDED word: the charm block's twin — gold (the ward shimmer's
   color family) so the two truths never read as the same beat. */
.ms-procword--ward {
  color: var(--gold);
}

/* The attacker-side dimmed marker: world-anchored in #world-hud (muted —
   information, not celebration). JS writes translate3d per frame. */
.ms-procmarker {
  position: absolute;
  left: 0;
  top: 0;
  /* Shown in place of a damage number on a dodged hit: the damage-number
     face (white, ink outline) a little smaller, so it reads at a glance. */
  font-family: var(--font-display);
  font-size: calc(var(--text-display-size) * 0.8);
  line-height: 1;
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
  pointer-events: none;
  color: var(--paper);
  white-space: nowrap;
  visibility: hidden;
  will-change: transform, opacity;
}

/* HealNumber (spec #11): "+{n}" in the caster's race accent, Titan One 40
   with ink stroke + comic shadow — damage-number motion. The accent is
   injected from race config at spawn (never hardcoded here). */
.ms-healnum {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--race-accent, var(--paper));
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Crit tier (03-06 Killing Blow): gold at ×1.15 scale (scale in JS via
   HUD_CONSTANTS.damageNumber.critScale). */
.ms-dmgnum--crit {
  color: var(--gold);
}

/* Crit hitmark variant: base geometry, gold ticks (the ×1.15 gold damage
   number dual-codes the tier). */
.ms-hitmarker--crit .ms-hitmarker__tick {
  background: var(--gold);
}

/* ------------------------------------------------------------------ */
/* DeathRecap Next line (plan 03-06, UI-SPEC #14)                       */
/* ------------------------------------------------------------------ */

.ms-recap__next {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin: 0;
  color: var(--muted);
}

/* The queued-race line: the incoming race's accent + its 16px sigil. */
.ms-recap__next--race {
  color: var(--race-accent, var(--paper));
}

.ms-recap__nextsigil {
  display: flex;
}

.ms-recap__nextsigil .ms-icon {
  width: 16px;
  height: 16px;
}

/* 04-05 amulet line (under the Next line): the Keepsake Amulet glyph + the
   "Items kept — amulet spent" copy — the economy heartbeat on the recap
   card, gold (the purchase/accent family). */
.ms-recap__amulet {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin: 0;
  color: var(--gold);
}

.ms-recap__amulet-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ------------------------------------------------------------------ */
/* BlockedMarker (component #18, plan 03-07, CBT-06) — danger-X + word  */
/* flash at the crosshair on a blocked ultimate cast                   */
/* ------------------------------------------------------------------ */

/* 0×0 anchor: JS writes translate3d per frame (follows the projected aim
   point like the reload ring); the WAAPI pop runs on the body below so the
   position write and the animation never fight over `transform`. */
.ms-blocked-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

/* Icon + word column, pre-centered on the anchor via negative margins
   (fixed 160px width mirrors HUD_CONSTANTS.blockedMarker). */
.ms-blocked-marker__body {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  margin-left: -80px;
  margin-top: -26px; /* half the block: centered at the offset anchor */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  opacity: 0; /* WAAPI owns visibility (fill: forwards) */
  will-change: transform, opacity;
}

/* Danger-X: larger than chip glyphs — this is an alert, not a label. */
.ms-blocked-marker__icon {
  width: 28px;
  height: 28px;
  color: var(--danger);
}

/* The word: dual-codes the icon (shape + language, UI-SPEC tier rule). */
.ms-blocked-marker__word {
  color: var(--danger);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

/* Screen-edge nudge: the damageDirection vignette's shorter, softer twin —
   fixed inset danger glow, opacity pulse only (never a shake). */
.ms-blocked-marker__nudge {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-hud);
  box-shadow: inset 0 0 90px 18px var(--danger);
}

@media (prefers-reduced-motion: reduce) {
  .ms-cluster__points--pulse {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Economy HUD (plan 04-01, 04-UI-SPEC #2/#3/#4) — money chip, money    */
/* floater and the owned-item strip in the bottom-right weapon zone    */
/* ------------------------------------------------------------------ */

/* MoneyChip (#2): coin glyph + "$1,234" — the top in-flow cell of the
   weapon zone. Passive indicator (pointer-events none like every HUD
   tenant); the sim's running balance is the only writer. */
.ms-money-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-comic);
  color: var(--gold); /* money is gold — reserved use 4 family extension */
  pointer-events: none;
}

.ms-money-chip .ms-icon {
  width: 16px;
  height: 16px;
}

/* Titan One 20 numerals, right-aligned in a 5ch container (mirrors
   HUD_CONSTANTS.moneyChip.minWidthCh) so every balance width is identical
   and digits grow leftward — the zone's right edge never moves. */
.ms-money-chip__value {
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  min-width: 5ch; /* mirrors HUD_CONSTANTS.moneyChip.minWidthCh */
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Mortality dim (mirrors HUD_CONSTANTS.moneyChip.deadOpacity) — money
   itself persists through death. */
.ms-money-chip--dead {
  opacity: 0.5; /* mirrors HUD_CONSTANTS.moneyChip.deadOpacity */
}

/* MoneyFloater (#3): 0×0 anchor just above the weapon zone (the money
   chip's ceiling); pooled items are transform-driven per frame — this
   carries only the anchor and the item's resting treatment. */
.ms-moneyfloater {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--sp-xs)); /* just above the money chip */
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-moneyfloater__item {
  position: absolute;
  /* Right-aligned (#267): the anchor sits at the screen's right edge, so a
     left-anchored item ran off-screen ("+$" only on phones). */
  right: 0;
  left: auto;
  top: 0;
  font-family: var(--font-ui);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  font-weight: var(--weight-semibold);
  color: var(--gold);
  white-space: nowrap;
  visibility: hidden;
  transform-origin: right center; /* the scale pop keeps the right edge */
  will-change: transform, opacity;
}

/* OwnedItemStrip (#4): right-aligned chip row under the money chip.
   HIDDEN at zero owned (the kill-feed presence pattern) — visibility is
   owned by the JS ms-hidden toggle. */
.ms-owned-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px; /* mirrors HUD_CONSTANTS.ownedStrip.gapPx */
  pointer-events: none;
}

/* One 24px chip per owned row (mirrors chipPx); the 16px catalog glyph
   (iconPx) rides gold. */
.ms-owned-strip__chip {
  width: 24px; /* mirrors HUD_CONSTANTS.ownedStrip.chipPx */
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic);
  color: var(--gold);
}

.ms-owned-strip__chip .ms-icon {
  width: 16px; /* mirrors HUD_CONSTANTS.ownedStrip.iconPx */
  height: 16px;
}

/* Pop-in on purchase (150ms — popMs): scale 0.5 → 1.12 → 1. */
.ms-owned-strip__chip--pop {
  animation: ms-owned-pop 80ms var(--ease-out); /* mirrors popMs (04-06 motion table) */
}

@keyframes ms-owned-pop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ------------------------------------------------------------------ */
/* ShopOverlay (plan 04-01, 04-UI-SPEC #1) — the B-toggled vendor stall */
/* ------------------------------------------------------------------ */

/* Fixed, NO dim layer (the HUD regions stay visible — the defining shop
   choice), z-panel family, pointer-interactive while open. The container
   also SHIELDS the canvas: while the overlay owns the pointer, a stray
   canvas click must not re-request pointer lock.

   Safe-band centering (04-06): the padding reserves keep the centered
   panel clear of the kill-feed anchor (top) and the bottom-right economy/
   weapon stack (bottom). The custom properties come from the overlay
   factory (panelGeometry / HUD_CONSTANTS.hudRegions); the fallbacks mirror
   the same data (89 = 32 inset + 53 feed anchor + 4 shadow; 268 = 32 inset
   + 232 stack + 4 shadow). */
.ms-shop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--shop-top-reserve, 89px);
  padding-bottom: var(--shop-bottom-reserve, 268px);
  pointer-events: auto;
  z-index: var(--z-panel);
}

/* Panel ≤ 740px × 62vh (mirrors HUD_CONSTANTS.shop.maxPanelWidthPx /
   maxPanelHeightVh), ALSO capped by the safe band so the stack stays
   uncovered; overflow hidden so the awning clips to the radius.
   position: relative anchors the hanging sign's overlap. */
.ms-shop__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(740px, calc(100vw - 2 * var(--sp-xl)));
  max-height: min(
    62vh,
    calc(100vh - var(--shop-top-reserve, 89px) - var(--shop-bottom-reserve, 268px))
  );
  overflow: hidden;
  background: var(--navy-raised);
  border: var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
}

/* 07.2 replace prompt: two item slots — a third slot buy asks which owned
   item goes. A centered sticker over the grid (the panel clips overflow, so
   the prompt overlays instead of flowing). */
.ms-shop__replace {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-sm);
  min-width: 300px;
  max-width: calc(100% - 2 * var(--sp-md));
  padding: var(--sp-md);
  background: var(--ink);
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
}
.ms-shop__replace.ms-hidden {
  display: none;
}
.ms-shop__replace-title {
  color: var(--paper);
  text-align: center;
}
.ms-shop__replace-choices {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
}
.ms-shop__replace-choice,
.ms-shop__replace-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--paper);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}
.ms-shop__replace-choice:hover,
.ms-shop__replace-choice:focus-visible {
  border-color: var(--gold);
}
.ms-shop__replace-cancel {
  align-self: center;
  opacity: 0.85;
}

/* Open motion: fade + translateY(8px → 0), 150ms ease-out (spec table). */
.ms-shop:not(.ms-hidden) .ms-shop__panel {
  animation: ms-shop-in 150ms var(--ease-out);
}

@keyframes ms-shop-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Awning (04-06, UI-SPEC #1): the canvas market canopy — paper/navy
   stripes (awningStripePx = 24px per color) with a 2px ink hem and a
   scallop edge stamped below the band. ZERO gold: gold is purchase-only
   (price, marker, focus rings), the stall chrome stays canvas and ink. */
.ms-shop__awning {
  position: relative;
  height: 40px; /* the canopy band; the sign's top anchors here */
  background: repeating-linear-gradient(
    90deg,
    var(--paper) 0 24px,
    var(--navy-raised) 24px 48px
  );
  border-bottom: 2px solid var(--ink);
}

/* The scallop hem: two 12px discs per 48px period, each under its own
   stripe's center, each with a 1px ink rim (a slightly larger ink disc
   painted beneath) — a stamped canvas edge hanging into the header. */
.ms-shop__awning::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  background:
    radial-gradient(circle 13px at 12px 0, var(--ink) 99%, transparent),
    radial-gradient(circle 13px at 36px 0, var(--ink) 99%, transparent),
    radial-gradient(circle 12px at 12px 0, var(--paper) 99%, transparent),
    radial-gradient(circle 12px at 36px 0, var(--navy-raised) 99%, transparent);
  background-size: 48px 14px;
  background-repeat: repeat-x;
}

/* The hanging "SHOP" sign (04-06): a paper plate with the ink Titan One
   40 wordmark in an ink comic frame, tilted −2° (signRotateDeg) so it
   hangs slightly crooked — market-stall character, not corporate chrome.
   It overlaps the awning's bottom edge (translateY(-58%)). */
.ms-shop__sign {
  position: absolute;
  top: 40px; /* the awning band's height */
  left: 50%;
  z-index: 1;
  padding: var(--sp-xs) var(--sp-md);
  background: var(--paper);
  border: var(--border-comic);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic);
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: 1;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--ink);
  white-space: nowrap;
  transform: translate(-50%, -58%) rotate(-2deg);
}

/* Header: money mirror (left) + the B close keycap (right). The top pad
   clears the hanging sign's lower lip as it overlaps the header band. */
.ms-shop__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: var(--sp-lg) var(--sp-md) var(--sp-sm);
}

/* The mirror of the HUD money chip (04-UI-SPEC #1): the 16px gold coin +
   the Titan One 20 numeral, tabular so the panel header never jitters
   mid-purchase. */
.ms-shop__money {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ms-shop__money .ms-icon {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

/* 5ch value floor (moneyChip.minWidthCh parity): "$1,600" fits without
   reflow, "$0" sits right-aligned against the coin. */
.ms-shop__money-value {
  min-width: 5ch;
  text-align: right;
}

.ms-shop__close {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

/* The 12-row catalog: 3 columns (gridColumns), scrolls inside 62vh. */
.ms-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* mirrors HUD_CONSTANTS.shop.gridColumns */
  grid-auto-rows: auto;
  align-content: start;
  gap: var(--sp-sm);
  padding: 0 var(--sp-md) var(--sp-sm);
  overflow-y: auto;
}

/* One sticker card (04-06, UI-SPEC #2): navy-raised sticker on the navy
   panel, 2px navy-line frame, comic shadow, a 44px hit-target floor — a
   real button (Tab/Enter/arrows free, gold :focus-visible inherited).
   Grid areas: icon + name left, keycap (or its chip replacement)
   top-right, desc spanning, price foot. position anchors the owned
   marker. */
.ms-shopcard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "icon keycap"
    "name keycap"
    "desc desc"
    "price price";
  align-items: center;
  gap: var(--sp-xs);
  min-height: 44px;
  padding: var(--sp-sm);
  text-align: left;
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic);
  cursor: pointer;
  transition:
    border-color var(--dur-press) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

@media (hover: hover) {
  .ms-shopcard:not(:disabled):hover {
    border-color: var(--gold);
    transform: translateY(var(--lift-hover));
  }
}

.ms-shopcard:not(:disabled):active {
  transform: translateY(var(--lift-press));
}

.ms-shopcard:disabled {
  cursor: default;
}

/* Unaffordable (and the dead treatment): 60% opacity — dimmed like every
   disabled chip, muted rather than alarm-red (04-UI-SPEC #2: a price you
   cannot pay is information, not an error). */
.ms-shopcard--unaffordable {
  opacity: 0.6;
}

/* The unaffordable/dead interior goes muted (the whole anatomy reads as
   "not yet", never as danger). */
.ms-shopcard--unaffordable .ms-shopcard__name,
.ms-shopcard--unaffordable .ms-shopcard__price,
.ms-shopcard--unaffordable .ms-shopcard__price-amount,
.ms-shopcard--unaffordable > .ms-icon {
  color: var(--muted);
}

/* The OWNED marker: the 3px gold left bar, hidden until the owned family
   — dual-coded with the chip word, so the state never rides color alone. */
.ms-shopcard__marker {
  display: none;
  position: absolute;
  left: -2px; /* sits on the card frame's outer edge */
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
}

/* Owned (and grenade-capped): the marker + chip carry the state (the
   sticker chrome itself stays untouched). */
.ms-shopcard--owned .ms-shopcard__marker {
  display: block;
  animation: ms-shopcard-marker-in 120ms var(--ease-out);
}

@keyframes ms-shopcard-marker-in {
  from {
    transform: translateX(-4px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Keycap chip (UI-SPEC #3, generalized): 20px navy-raised plate, 2px
   navy-line frame, Label digit in paper — keycap literals never localize. */
.ms-shopcard__keycap {
  grid-area: keycap;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--sp-xs);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  color: var(--paper);
}

/* The catalog glyph rides the grid directly (createIcon appends the
   ms-icon svg without a wrapper). */
.ms-shopcard > .ms-icon {
  grid-area: icon;
  width: 24px;
  height: 24px;
  color: var(--paper);
}

/* Item name (04-06): Titan One 20 in paper — the sticker's title line,
   clamped to 2 lines (the DE 20-char name bound keeps it to one). */
.ms-shopcard__name {
  grid-area: name;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: var(--text-heading-size);
  font-weight: var(--weight-regular);
  line-height: var(--text-heading-lh);
  color: var(--paper);
}

/* Effect line: Label muted, clamped to 2 lines (the layout tests' derived
   DE desc budget is computed against exactly these two lines). */
.ms-shopcard__desc {
  grid-area: desc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  color: var(--muted);
}

/* Price (04-06): the 12px coin + the Rubik-600 body-size amount in paper —
   the BUYABLE price is readable chrome; gold stays on the coin glyph. */
.ms-shopcard__price {
  grid-area: price;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-family: var(--font-ui);
  font-size: var(--text-body-size);
  font-weight: var(--weight-semibold);
  line-height: var(--text-body-lh);
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.ms-shopcard__price .ms-icon {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

/* OWNED / MAX state chip (04-06): REPLACES the keycap in its grid area —
   a navy-raised pill with the paper word (never color-only; the marker is
   the second code). */
.ms-shopcard__state {
  grid-area: keycap;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  padding: 1px var(--sp-sm);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  color: var(--paper);
}

/* Footer: pinned legends — keys, nav, lifetime (the dead hint swaps in,
   gold — it is an alert, not a label). */
.ms-shop__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-sm) var(--sp-lg);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--navy-line);
}

.ms-shop__footer .ms-label {
  color: var(--muted);
}

.ms-shop__footer .ms-label.ms-is-alert {
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .ms-shop:not(.ms-hidden) .ms-shop__panel {
    animation: none; /* the panel appears without travel */
  }
  .ms-owned-strip__chip--pop {
    animation: none; /* chips appear at full scale, opacity only */
    opacity: 1;
  }
  .ms-shopcard--owned .ms-shopcard__marker {
    animation: none; /* the marker appears in place, opacity only */
    opacity: 1;
  }
}

/* ==========================================================================
   Skirmish (plan 05-05, NETW-08) — the debug-panel BOT-TRAINING section
   mount (the centered F8 dialog left with the 2026-10-05 one-key decision)
   and the FFA scoreboard. All tokens, all hand-rolled: navy-raised panels,
   navy-line chrome, gold reserved for the kill-limit bar + the YOU row (the
   match's two signals).
   ========================================================================== */

/* Control cells stack: label above control, one row per setting. */
.ms-skirmish__controls {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.ms-skirmish__cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ms-skirmish__label {
  color: var(--muted);
}

.ms-skirmish__count-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.ms-skirmish__step {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-size);
  line-height: 1;
  color: var(--paper);
  background: var(--navy-line);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (hover: hover) {
  .ms-skirmish__step:not(:disabled):hover {
    background: var(--gold);
    color: var(--ink);
  }
}

.ms-skirmish__step:disabled {
  opacity: 0.4;
  cursor: default;
}

.ms-skirmish__count {
  min-width: 3ch;
  text-align: center;
  font-size: var(--text-body-size);
  color: var(--paper);
}

.ms-skirmish__select {
  width: 100%;
  padding: 4px var(--sp-sm);
  font-family: var(--font-ui);
  font-size: var(--text-body-size);
  color: var(--paper);
  background: var(--navy-raised);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ms-skirmish__select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* The debug-panel mount (F1): a compact column that fits the 280px panel.
   Start/Stop ride the kit's ms-btn variants, stacked full-width. */
.ms-skirmish__section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.ms-skirmish__section .ms-btn {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Spectate chip (05-05) — the mode indicator under the upper-center banner
   zone: current mode (+ followed bot name) and the cycling hint. Visible in
   follow/free only; indicator-only (no pointer).
   -------------------------------------------------------------------------- */
.ms-spectate {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-hud);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-xs) var(--sp-md);
  background: rgba(22, 27, 49, 0.92);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.ms-spectate__mode {
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  color: var(--paper);
  white-space: nowrap;
}

.ms-spectate__hint {
  color: var(--muted);
  white-space: nowrap;
}

/* ROUNDS spectate chip: same pill, low-center (clear of the banner word
   and the top strip); tappable — a tap cycles the watched fighter. */
.ms-spectate--round {
  top: auto;
  bottom: 18vh;
  pointer-events: auto;
  cursor: pointer;
  max-width: calc(100vw - 32px);
}

.ms-spectate--round .ms-spectate__mode {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* (The centered-dialog rules — scrim, panel, header/heading, dialog
   controls, reduced-motion — left with the F8 dialog itself: 2026-10-05
   one-key decision. The F1 section mount's rules stay.) */

/* ==========================================================================
   Match loop HUD (plans 06-01 + 06-05) — the TOP-CENTER ZONE (a fixed
   column anchored 16px from the viewport top, centered: the status strip
   is PERSISTENT MEMBER 1, the toast pill TRANSIENT MEMBER 2 below it;
   hidden members collapse entirely, so with no strip outside a match the
   toast reclaims the full zone at the same anchor), the countdown/win
   words (banner zone), the mode status line (bottom-center, above the XP
   bar), the spawn protection ring (crosshair anchor) and the Tab
   matchboard. Team tints flow through the --team-a / --team-b custom
   properties the match wiring injects on #ui-root — NEVER a hex literal
   here.
   ========================================================================== */

/* The zone stack (06-05 zone contract). Members append in order: strip,
   then toast (TOP_ZONE_MEMBERS — backstop-tested). */
.ms-zone-top {
  position: fixed;
  top: var(--sp-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  pointer-events: none;
  z-index: var(--z-hud);
}

/* A hidden member collapses entirely — visibility:hidden would keep the
   strip's layout box and hold the toast below an invisible strip. */
.ms-zone-top > .ms-hidden {
  display: none;
}

/* The strip: TDM scores · timer · score, or FFA crown BEST · timer · YOU.
   A static zone member — the zone owns anchor + centering. The grid
   layout (timer exactly centred) lives in hud-system.css (07.3-17, F24). */
.ms-strip {
  padding: var(--sp-xs) var(--sp-lg);
  background: rgba(22, 27, 49, 0.92);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  pointer-events: none; /* indicator only — the canvas keeps gameplay input */
}

.ms-strip__score {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  color: var(--paper);
  white-space: nowrap;
}

.ms-strip__score--a {
  color: var(--team-a, var(--paper));
}

.ms-strip__score--b {
  color: var(--team-b, var(--paper));
}

.ms-strip__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Titan One 20, min-width 4ch: tabular digits — the countdown/timer text
   never jitter-widens as seconds fall. The VALUE is sim ticks (06-01). */
.ms-strip__timer {
  min-width: 4ch;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  color: var(--paper);
}

/* Final-minute alarm (06-05, danger use 7): the timer digits turn danger
   and pulse at 500 ms while live with ≤ 60 sim seconds left. */
.ms-strip__timer--danger {
  color: var(--danger);
  animation: ms-strip-alarm 500ms var(--ease-out) infinite;
}

@keyframes ms-strip-alarm {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.ms-strip__sub {
  font-family: var(--font-ui);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Match-moment words (06-05, UI-SPEC #9/#10) — the countdown digits and */
/* the FIGHT!/verdict wordmarks in the BANNER zone (28vh, the race       */
/* banner's anchor; countdown and end states cannot collide with race    */
/* announcements in practice, and the moments are 1.9 s by design).      */
/* The wordmark treatment: Display Titan One 40 + ink stroke + comic    */
/* shadow; paper by default, gold ONLY for FIGHT! and VICTORY (use 23), */
/* muted for DRAW. Motion is WAAPI in the modules (100/1600/200).       */
/* ------------------------------------------------------------------ */

.ms-word {
  position: absolute;
  left: 50%;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-word__text {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  color: var(--paper);
  -webkit-text-stroke: var(--stroke-display) var(--ink);
  text-shadow: var(--shadow-comic);
  white-space: nowrap;
}

/* FIGHT! + VICTORY — the celebration gold (reserved use 23). */
.ms-word__text--gold {
  color: var(--gold);
}

/* DRAW — muted paper; a tie is information, not drama. */
.ms-word__text--draw {
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Mode status line (06-05, UI-SPEC #13) — the transient bottom-center   */
/* line ABOVE the XP-bar cluster: the countdown objective, or the        */
/* final-minute danger line. Never both; hidden otherwise.              */
/* ------------------------------------------------------------------ */

.ms-modeline {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sp-xl) + var(--sp-3xl)); /* clears the XP bar cluster */
  transform: translateX(-50%);
  padding: var(--sp-xs) var(--sp-md);
  background: rgba(22, 27, 49, 0.92);
  border: 2px solid var(--navy-line);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--paper);
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--z-hud);
}

/* Final minute (danger use 7 — the same treatment as the timer digits). */
.ms-modeline--danger {
  color: var(--danger);
  border-color: var(--danger);
  animation: ms-modeline-pulse 500ms var(--ease-out) infinite;
}

@keyframes ms-modeline-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ------------------------------------------------------------------ */
/* Spawn protection ring (06-05, UI-SPEC #15) — Ø44px concentric OUTSIDE */
/* the Ø36 reload ring on the crosshair center. A 0×0 anchor translated  */
/* by JS (translate3d), the SVG pre-centered on the aim point. The arc   */
/* is gold (reserved use 25 — the protection signal); the track is the   */
/* shared navy hairline.                                                */
/* ------------------------------------------------------------------ */

.ms-protring {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}

.ms-protring__svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px; /* mirrors HUD_CONSTANTS.protectionRing.diameterPx */
  height: 44px;
  margin: -22px 0 0 -22px; /* pre-center on the projected aim point */
}

.ms-protring__track {
  stroke: var(--navy-line);
}

.ms-protring__arc {
  stroke: var(--gold); /* reserved use 25: spawn protection */
}

/* ------------------------------------------------------------------ */
/* Match-end dim (06-05) --ink 70% over the arena between the win word's */
/* exit and the results card (the card's own backdrop is the same mix,   */
/* so the handoff is seamless).                                        */
/* ------------------------------------------------------------------ */

.ms-enddim {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-panel);
  transition: opacity var(--dur-panel) var(--ease-out); /* 150 ms fade */
}

.ms-enddim--on {
  opacity: 1;
}

/* Tab matchboard — a held-Tab overlay at panel z (menus' layer), centered,
   click-through (presence is the data; no row is interactive). */
.ms-matchboard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-panel);
  display: flex;
  gap: var(--sp-lg);
  padding: var(--sp-md);
  background: rgba(13, 16, 32, 0.86);
  border: var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
  pointer-events: none;
}

/* Practice DOCK (06-05 — the retired P5 stub's slot): the shared board
   pinned top-right below the kill feed's five-row worst case, tables
   stacked, hud z (it coexists with play, not with menus). */
.ms-matchboard--dock {
  top: 305px;
  left: auto;
  right: 32px;
  transform: none;
  z-index: var(--z-hud);
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-sm);
  background: rgba(22, 27, 49, 0.92);
  border: 2px solid var(--navy-line);
}

.ms-matchboard--dock .ms-matchboard__teams {
  flex-direction: column;
  gap: var(--sp-sm);
}

.ms-matchboard--dock .ms-matchboard__table,
.ms-matchboard--dock .ms-matchboard__table--ffa {
  min-width: 0;
}

.ms-matchboard__teams {
  display: flex;
  flex: 1 1 auto;
  gap: var(--sp-xl, 32px);
}

/* The mode's other block (teams in FFA, the FFA list in TDM) takes no
   space: the display rules above would otherwise beat .ms-hidden. */
.ms-matchboard > .ms-hidden {
  display: none;
}

/* The two team tables share the board evenly (the board can be wider than
   its content — never leave the right half empty). */
.ms-matchboard__teams > .ms-matchboard__table {
  flex: 1 1 0;
}

.ms-matchboard__table {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  min-width: 300px;
}

.ms-matchboard__table--ffa {
  min-width: 360px;
}

.ms-matchboard__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-md);
}

.ms-matchboard__head-name {
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  color: var(--paper);
}

.ms-matchboard__head-name--a {
  color: var(--team-a, var(--paper));
}

.ms-matchboard__head-name--b {
  color: var(--team-b, var(--paper));
}

.ms-matchboard__head-score {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  color: var(--paper);
}

/* The shared board grid (header + rows on ONE template, --board-cols)
   lives in hud-system.css (07.3-17, F2). */
.ms-matchboard__labels {
  color: var(--muted);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
}

.ms-matchboard__row {
  color: var(--paper);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
}

.ms-matchboard__sigil {
  display: inline-flex;
  color: var(--muted);
}

/* The FFA leader's gold crown rides the sigil slot (06-05) — pooled, JS
   toggles display; the race icon sits beside it inside the same slot. */
.ms-matchboard__crown {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.ms-matchboard__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The own row's gold name — the scoreboard's own-row marker (the same
   signal the skirmish board's YOU row used). */
.ms-matchboard__row--own .ms-matchboard__name {
  color: var(--gold);
  font-weight: var(--weight-semibold);
}

/* The winning side's rows (06-05 results): the gold left marker the
   selected cards use — dual-coded with the row's placement, never the
   only signal (the results heading already carries the verdict). */
.ms-matchboard__row--winner {
  box-shadow: inset 3px 0 0 var(--gold);
}


/* ROUNDS spectate: the followed fighter is the focus — hide the dead
   player's own vitals, kit and economy readouts until the next round. */
.ms-round-watching .ms-vitals,
.ms-round-watching .ms-xpbar,
.ms-round-watching .ms-cluster,
.ms-round-watching .ms-money-chip,
.ms-round-watching .ms-weapon-card,
.ms-round-watching .ms-weapon-slots,
.ms-round-watching .ms-owned-strip,
.ms-round-watching .ms-statuschips,
.ms-round-watching .ms-reload-ring {
  visibility: hidden;
}
