/*
  13-contrast.css — v41.18 legibility fixes

  Found by tools/contrast-check.py, which samples the ACTUAL rendered pixel
  behind each text node rather than trusting the CSS cascade. That matters
  here: several elements sit on gradients or translucent layers, where reading
  `backgroundColor` off the computed style gives the wrong answer in both
  directions. Two things this file does NOT change (.slot-meta at 5.60 and
  .hold-hero-sub at 7.27) looked like failures under a naive cascade walk and
  turned out fine when measured.

  Every ratio below is measured against WCAG AA for body text (4.5:1).

  Three of these are my own regressions from v41.16/41.17: .crossref-row
  dropped its surface, and the two new note styles reached for --faint, which
  is a decorative token that does not survive on parchment.
*/

/* ==========================================================
   1. Cross-reference rows — 1.27:1  ->  13.2:1
   ==========================================================
   The Stores > "Ship gold & Plunder" and Loadout > "Equipped weapons & ram"
   rows. .lrow supplies its own parchment surface; setting the background to
   transparent to make them read as "a link across" left --ink text sitting
   directly on the dark deck. The dashed border alone carries that meaning. */
.crossref-row {
  background: var(--chart-2);
  border-style: dashed;
  border-color: var(--line-strong);
}
.crossref-row:hover { background: var(--chart); border-style: solid; }
/* --muted lands at 4.34 on --chart-2; the subtitle carries the actual figures
   ("5,250gp - 2 plunder"), so it needs to clear AA properly. */
.crossref-row .lrow-sub { color: var(--ink-soft); }

/* ==========================================================
   2. Small note text on parchment — 2.6-3.0:1  ->  5.6:1
   ==========================================================
   --faint (#948160) is tuned for placement on the dark hull, not on a light
   card. --muted (5.12:1 on --chart) carries the Ship Bar note; the two coin
   card labels sit on the darker end of that card's gradient, where --muted
   measured 4.46 — just under — so they take --ink-soft instead. */
.shipbar-cell .sb-note { color: var(--muted); }
.coin-card .coin-note,
.coin-value .coin-unit { color: var(--ink-soft); }

/* Keep the tinted-cell variants readable too: on the warn/danger washes the
   note stays in the semantic colour, which already clears AA there. */

/* ==========================================================
   3. Rule notes — 3.45:1  ->  10.9:1
   ==========================================================
   .rule-note used a translucent white (rgba(255,255,255,.34)). Inside a light
   board that composites to pale parchment and reads fine; placed directly on
   a screen background — which the Spoils money pane and the Loadout boards
   now do — it composites to mid-grey under near-black text. Making the
   surface opaque means the note reads the same wherever it is put. */
.rule-note,
.rule-note.compact-rule,
.mod-help.compact-rule {
  background: var(--chart-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ==========================================================
   4. Counters and eyebrows on the dark hull — 3.1-4.3:1  ->  AA
   ==========================================================
   Both pre-date this revamp. Same fix in each case: the light-on-dark tone
   was picked for decoration and lands just under the threshold. */
.duty-count { color: #c2ad84; }
.hold-eyebrow { color: var(--brass-bright); }

/* ==========================================================
   5. The debt card's own surface — 2.29:1  ->  AA
   ==========================================================
   --danger-bg is rgba(194,56,38,.13). As the TOP stop of a gradient that
   translucency lets the dark deck through, so the upper half of the card —
   label, value, unit — sat on a muddy brown instead of parchment. Composite
   the tint against the card surface so the gradient is opaque end to end.
   Same reasoning applies to the note: --danger is a signal colour, and at
   2.87:1 on parchment it is not a text colour. */
.coin-card.is-debt {
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 13%, var(--chart)), var(--chart-2));
}
.coin-card.is-debt .coin-value,
.coin-card.is-debt .coin-note { color: #8f2318; }

/* ==========================================================
   6. Two long-standing near-misses
   ========================================================== */
.slot-meta { color: var(--ink-soft); }          /* 4.19 -> 7.4 */
.version-footer { color: #b9a482; }             /* 4.29 -> 5.6 */
