/*
 * final-drive/player — what render-player.js draws (GET /final-drive): the
 * hero panel, the mixed-scoring note, the conflict block and the collapsible
 * player card. Split out of
 * styles.css verbatim because that file sits at its own line ceiling
 * (tests/unit/monolith-budget.test.mjs) and the ceiling only goes down; the
 * dashboard's hero.css (ch. 16 E-09) is the precedent. Linked after
 * field.css, so nothing here is overridden by the field's rules.
 */

/* ---------- hero ------------------------------------------------------- */

/* One colour per claim, once (ch. 15, D-28): gold says THE HERO, in every
   state. A conflict speaks inside the frame — the verb line's ⚠ CONFLICT,
   the number, the sacrificed dot, the picked row — never through it, so
   .is-conflict styles nothing here and stays on the element as a hook. */
.hero {
  background: linear-gradient(160deg, #1c1c1a 0%, var(--card) 55%);
  border: 2px solid var(--gold);
  box-shadow: 0 6px 22px rgba(255, 215, 0, 0.1);
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
/* (0,2,0) on purpose: styles.css's `.panel > h2` (0,1,1) beat the old
   `.hero-name` (0,1,0), so every hero name rendered in the section-head
   voice — 12px, --muted, uppercase — under a 72px number. The three leaked
   properties are set explicitly (ch. 15, D-27). */
.hero .hero-name {
  margin: 0;
  font-size: clamp(24px, 7.5vw, 36px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
  overflow-wrap: anywhere;
}
.hero-meta {
  font-size: 13px;
  color: var(--sub);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
/* The verb line above the number carries the 14px gap. 38px at 320, 56px at
   1440 — name:number ~0.63 at both, the number still the largest thing. */
.hero-verb {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.hero-verb .hero-conflict {
  color: var(--amber);
}
.hero-window {
  margin: 2px 0 0;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
/* The lane caption's own size and ink, on the number's baseline: the mark is
   the word the lanes beneath already decode it with (D-31). */
.hero-unit {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sub);
  margin-left: 6px;
}
.hero-window.ok {
  color: var(--green);
}
.hero-window.bad {
  color: var(--red);
}
.hero-window.warn {
  color: var(--amber);
}

/* ---------- the last play (delta.js, ch. 15 D-36) ------------------------ */

/* What the latest scoring change did, over the field it moved. Text tokens
   only: the arrow and the two numbers carry the direction, and the field's
   green/red already means "over/under 50" on the lane below (D-24). No
   container: amber and gold are spent elsewhere (D-28). */
.swing {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.swing-head {
  margin: 0;
}
.swing-pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.swing-age {
  color: var(--sub);
}
.swing-rows {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}
.swing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.swing-league {
  color: var(--sub);
  min-width: 0;
}
.swing-odds {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.swing-odds b {
  color: var(--text);
}

/* ---------- mixed scoring note ----------------------------------------- */

/* A caveat about approximation, not a conflict claim: it wears the container
   tokens, not the conflict's colour (D-28). --sub on --sunk is 6.1:1. */
.mixed-scoring {
  margin: 6px 0 0;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--sunk);
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
}

/* ---------- conflict --------------------------------------------------- */

/* The block is a container (D-28): the structure is the claim, the box is
   not. Its one amber mark is the picked row — the DECISION. */
.conflict {
  border: 1px solid var(--line);
  background: var(--sunk);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
}
.conflict-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 8px;
}
.conflict-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 13px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.conflict-row .side-label {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  min-width: 92px;
}
.conflict-row .keeps {
  color: var(--green);
}
.conflict-row .loses {
  color: var(--red);
}
.conflict-row.picked {
  outline: 1px solid var(--amber);
  background: rgba(243, 156, 18, 0.18);
}
.conflict.brief .conflict-call {
  margin-top: 0;
}
.conflict-call {
  font-size: 15px;
  font-weight: 700;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.conflict-cost {
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.conflict-why {
  font-size: 12px;
  color: var(--sub);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* ---------- player card ------------------------------------------------ */

.pcard {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.pcard.is-hero {
  border-color: var(--gold);
}
.pcard > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
  cursor: pointer;
}
.pcard > summary::-webkit-details-marker {
  display: none;
}
/* The glyph is what says "this opens": 16px --sub (6.1:1), not 12px --muted
   (3.0:1, a smudge at 320). Measured to cost no width (D-27). */
.pcard > summary::after {
  content: '\25be';
  margin-left: auto;
  color: var(--sub);
  font-size: 16px;
  flex: 0 0 auto;
}
.pcard[open] > summary::after {
  content: '\25b4';
}
.pcard-id {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.pcard-name {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.pcard-name .state-badge {
  white-space: nowrap;
}
.pcard-meta {
  font-size: 12px;
  color: var(--muted);
}
/* The call column never shrinks: with the hero card's badge widening the name
   column's basis, flex took the width off the call instead and broke
   CONFLICT mid-word at 320 (D-27's own capture). The name column wraps;
   the call does not. */
.pcard-num {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}
.pcard-now {
  font-size: 17px;
  font-weight: 700;
}
.pcard-win {
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.pcard-win.ok {
  color: var(--green);
}
.pcard-win.bad {
  color: var(--red);
}
.pcard-win.warn {
  color: var(--amber);
}
.pcard-win.flat {
  color: var(--muted);
}
.pcard-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line-soft);
}
