/* ============================================================
   EVERFIELD — charts.css
   SVG chart chrome for js/ui/charts.js. Tokens only (style.css).
   Marks are loud; everything else is recessive.
   ============================================================ */

:root {
  /* the color of the surface charts sit on — used for gaps & marker rings */
  --chart-surface: var(--surface-2);
}

/* ---------- layout ---------- */
.chart-stack { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.chart-figure { margin: 0; }
.chart-figure figcaption { margin-bottom: 8px; }
.chart-body { position: relative; min-width: 0; }
.chart-body + .chart-body { margin-top: 6px; }
.chart-svg { display: block; max-width: 100%; }
.chart-svg text { user-select: none; pointer-events: none; }

/* ---------- chart furniture (recessive) ---------- */
.chart-grid { stroke: var(--line); stroke-opacity: 0.5; stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid-faint { stroke-opacity: 0.28; }
.chart-divider { stroke: var(--ink-3); stroke-opacity: 0.55; stroke-width: 1.5; shape-rendering: crispEdges; }
.chart-tick {
  font-family: var(--font-mono); font-size: 10px; fill: var(--ink-3);
  letter-spacing: 0.04em;
}
.chart-tick-sm { font-size: 8.5px; opacity: 0.65; }
.chart-end-label { font-family: var(--font-body); font-size: 11px; font-weight: 500; fill: var(--ink-2); }
.chart-anno { font-family: var(--font-mono); font-size: 10px; fill: var(--ink-2); }
.chart-band-label {
  font-family: var(--font-body); font-size: 11px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--chart-surface); stroke-width: 2.5px; stroke-linejoin: round;
}
.chart-star { font-size: 11px; fill: var(--gold); }
/* the division names live INSIDE the plot, so they are haloed against the panel:
   a 300-season line will cross them, and they must stay readable when it does */
.chart-zone-label {
  font-family: var(--font-serif); font-style: italic; font-size: 12px; fill: var(--ink-3);
  paint-order: stroke; stroke: var(--chart-surface); stroke-width: 3.5px; stroke-linejoin: round;
}
.chart-end-sub { font-family: var(--font-body); font-size: 9.5px; font-weight: 500; }

/* ---------- the pyramid: four tier bands on the club trajectory ----------
   One hue per tier, matching the tier dots/chips in views.css: gold, volt, sky,
   ink. Kept far back — the line is the mark, the bands are the world it moves
   through. A club sliding from the gold band to the grey one needs no caption. */
.chart-band-t1 { fill: var(--gold); fill-opacity: 0.075; }
.chart-band-t2 { fill: var(--volt); fill-opacity: 0.05; }
.chart-band-t3 { fill: var(--sky); fill-opacity: 0.045; }
.chart-band-t4 { fill: var(--ink-3); fill-opacity: 0.05; }
.chart-zone-t1 { fill: var(--gold); opacity: 0.75; }
.chart-zone-t2 { fill: var(--volt); opacity: 0.7; }
.chart-zone-t3 { fill: var(--sky); opacity: 0.7; }
.chart-zone-t4 { fill: var(--ink-2); opacity: 0.75; }
.chart-note {
  font-family: var(--font-serif); font-style: italic; font-size: 13px; color: var(--ink-2);
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft);
}
.chart-note-sm { font-size: 12px; color: var(--ink-3); }

/* ---------- century scale (SPEC3 §4) ----------
   Past ~90 seasons the bold line is a rolling mean and the true season-by-season
   series sits behind it as weather. Faint enough to be texture, present enough
   that the reader can see the sim never lied to them. */
.chart-line-raw { opacity: 0.22; stroke-linejoin: round; stroke-linecap: round; }

.chart-more { margin-top: 10px; }
.chart-expander {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; gap: 6px;
}
.chart-expander:hover { color: var(--volt); border-color: rgba(215, 249, 92, 0.45); }
.chart-more-dim { color: var(--ink-3); font-size: 10.5px; }

/* era bands on the axes chart */
.chart-era-band { fill: var(--ink); opacity: 0.035; }
.chart-era-line { stroke: var(--line); stroke-opacity: 0.85; stroke-width: 1; shape-rendering: crispEdges; }
.chart-era-label { font-family: var(--font-serif); font-style: italic; font-size: 11.5px; fill: var(--ink-3); }

/* ---------- hover layer ---------- */
.chart-crosshair {
  stroke: var(--ink-3); stroke-width: 1; opacity: 0;
  transition: opacity 0.12s ease; shape-rendering: crispEdges; pointer-events: none;
}
.chart-hdot { transition: opacity 0.1s ease; pointer-events: none; }
.chart-hit { cursor: crosshair; outline: none; }
.chart-hit:focus-visible { stroke: var(--volt); stroke-opacity: 0.5; stroke-width: 1; }

/* ---------- shared tooltip (one div, fixed) ---------- */
.chart-tip {
  position: fixed; z-index: 200; pointer-events: none;
  background: rgba(9, 14, 10, 0.95); border: 1px solid var(--line); border-radius: var(--rad-sm);
  padding: 8px 11px 9px; max-width: 240px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  font-size: 12px; line-height: 1.45; color: var(--ink);
}
.chart-tip-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 4px;
}
.chart-tip-sub {
  font-family: var(--font-serif); font-style: italic; font-size: 11.5px; color: var(--ink-2);
  margin: -3px 0 5px;
}
.chart-tip-row { display: flex; align-items: center; gap: 7px; }
.chart-tip-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.chart-tip-key-none { background: transparent; }
.chart-tip-val {
  font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink); min-width: 3ch;
}
.chart-tip-lbl { color: var(--ink-2); font-size: 11.5px; }

/* ---------- legend (static — identity, no cycling) ---------- */
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* ---------- champion style strip ---------- */
/* newest first, capped at 40 with an expander; when fully open, three centuries
   of chips scroll inside the figure rather than pushing the page to the moon */
.champ-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.champ-strip-all { max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.champ-chip {
  appearance: none; -webkit-appearance: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--cc, var(--line));
  border-radius: var(--rad-sm); padding: 5px 10px 6px 8px;
  font-family: var(--font-body); text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.champ-chip:hover { border-color: var(--ink-3); border-left-color: var(--cc, var(--ink-3)); transform: translateY(-1px); }
.cc-top { display: flex; align-items: baseline; gap: 7px; }
.cc-season {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--ink-3);
}
.cc-name { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; }
.cc-style {
  font-family: var(--font-serif); font-style: italic; font-size: 11px; color: var(--ink-2);
  max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- mini charts (player curve) ---------- */
.chart-mini-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 2px; }
.chart-mini-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- empty state ---------- */
.chart-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 130px; padding: 18px 8px;
  font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--ink-3);
}
.chart-empty::before, .chart-empty::after {
  content: ''; height: 1px; flex: 0 1 84px; background: var(--line); opacity: 0.7;
}
.chart-empty span { padding: 0 16px; }

/* a mount that has nothing to show (e.g. HoF-pruned player) collapses away */
.chart-mount-empty { display: none; }

/* the reigning fashion — the meta, finally on screen */
.chart-fashion { padding-bottom: 14px; }
.chart-fashion-name {
  font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--volt);
  margin: 4px 0 2px; letter-spacing: 0.01em;
}
.chart-fashion-sub { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.chart-fashion-note {
  font-family: var(--font-serif); font-style: italic; font-size: 12.5px; color: var(--ink-3);
  border-top: 1px solid var(--line-soft); padding-top: 8px; line-height: 1.45;
}
