/* ============================================================
   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-divider { stroke: var(--line); 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-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); }
.chart-zone-label { font-family: var(--font-serif); font-style: italic; font-size: 11px; fill: var(--ink-3); }

/* 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 ---------- */
.champ-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.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; }
