/* ==========================================================================
   NetStats redesign — design tokens + component styles.
   Source of truth: docs/redesign/PLAN.md §3-4, docs/redesign/mockups/*.dc.html
   ========================================================================== */

:root {
  --ground: #0F1012;
  --panel:  #17181B;
  --line:   #26282C;
  --line-2: #34373D;
  --ink:    #EDEBE6;
  --ink-2:  #A6A39C;
  --ink-3:  #8A877F;
  --na:     #4A4C52;

  /* scoring type, rim -> arc (the only data hues) */
  --s-rim:   #E4572E;
  --s-paint: #EE8A3C;
  --s-mid:   #E9C46A;
  --s-skip:  #5FBF9F;
  --s-3lv:   #5B9BE6;
  --s-per:   #A48BF0;

  --display: 'Archivo', sans-serif;
  --sans:    'IBM Plex Sans', sans-serif;
  --mono:    'IBM Plex Mono', monospace;

  --rd-max: 1440px;
  --rd-pad: 80px;
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                           */
/* ---------------------------------------------------------------------- */

.rd-root [hidden] { display: none !important; }
.rd-root, .rd-root * { box-sizing: border-box; }
.rd-root {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans), system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.rd-root a { color: var(--ink); text-decoration: none; }
.rd-root a:hover { color: #fff; }
.rd-root button { font-family: inherit; cursor: pointer; }
.rd-root table { border-collapse: collapse; }
.rd-root img { max-width: 100%; display: block; }

.rd-mono { font-family: var(--mono); }
.rd-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Type scale: 72 / 56 / 48 / 22 / 18 / 15 / 13 / 12 */
.rd-h1 { margin: 0; font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 56px; line-height: 1; letter-spacing: -0.02em; }
.rd-h1--xl { font-size: 72px; }
.rd-h2 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 22px; }
.rd-display-48 { font-family: var(--display); font-stretch: 116%; font-weight: 800; font-size: 48px; letter-spacing: -0.02em; }

/* ---------------------------------------------------------------------- */
/* Shell / layout                                                         */
/* ---------------------------------------------------------------------- */

.rd-shell { width: 100%; max-width: var(--rd-max); margin: 0 auto; padding: 0 var(--rd-pad); }
.rd-main { flex: 1 0 auto; }

.rd-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 48px;
}
.rd-col-3 { grid-column: span 3; }
.rd-col-4 { grid-column: span 4; }
.rd-col-5 { grid-column: span 5; }
.rd-col-6 { grid-column: span 6; }
.rd-col-7 { grid-column: span 7; }
.rd-col-8 { grid-column: span 8; }
.rd-col-12 { grid-column: span 12; }

@media (max-width: 1000px) {
  :root { --rd-pad: 32px; }
  .rd-col-3, .rd-col-4, .rd-col-5, .rd-col-6, .rd-col-7, .rd-col-8 { grid-column: span 12; }
}
@media (max-width: 520px) {
  :root { --rd-pad: 20px; }
  .rd-h1 { font-size: 40px; }
}

/* ---------------------------------------------------------------------- */
/* Header / footer                                                        */
/* ---------------------------------------------------------------------- */

.rd-header {
  height: 64px;
  flex-shrink: 0;
  padding: 0 var(--rd-pad);
  display: flex;
  align-items: center;
  gap: 40px;
  border-bottom: 1px solid var(--line);
}
.rd-logo {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rd-logo-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--s-paint); display: inline-block; }
.rd-nav { display: flex; gap: 28px; font-size: 15px; }
.rd-nav-link { color: var(--ink-2); }
.rd-nav-link.active { color: var(--ink); font-weight: 600; }
.rd-header-spacer { flex-grow: 1; }
.rd-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  max-width: 40vw;
  height: 40px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.rd-search input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
}
.rd-search input::placeholder { color: var(--ink-3); }

.rd-search-wrap { position: relative; width: 340px; max-width: 40vw; }
.rd-search-wrap .rd-search { width: 100%; max-width: none; }
.rd-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--line-2);
  max-height: 340px; overflow-y: auto; z-index: 40;
}
.rd-search-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.rd-search-row:hover, .rd-search-row.active { background: var(--ground); }
.rd-search-row-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); flex-shrink: 0; }

@media (max-width: 700px) {
  .rd-nav { display: none; }
  .rd-search-wrap { width: auto; max-width: none; flex-grow: 1; }
}

.rd-footer { border-top: 1px solid var(--line); flex-shrink: 0; }
.rd-footer-inner {
  max-width: var(--rd-max);
  margin: 0 auto;
  padding: 24px var(--rd-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.rd-footer-nav { display: flex; gap: 20px; }
.rd-footer-nav a { color: var(--ink-2); }

/* ---------------------------------------------------------------------- */
/* Component: archetype line                                              */
/* ---------------------------------------------------------------------- */

.archetype-line { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.archetype-line .al-scoring { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.archetype-line .al-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.archetype-line .al-sep { color: var(--ink-3); }
.archetype-line .al-usage, .archetype-line .al-passing { color: var(--ink); }

/* ---------------------------------------------------------------------- */
/* Component: stat                                                        */
/* ---------------------------------------------------------------------- */

.stat { display: flex; flex-direction: column; gap: 10px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat-label { font-size: 14px; font-weight: 600; }
.stat-value { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.stat-value .stat-ordinal { font-size: 13px; color: var(--ink-2); }
.stat-bar { position: relative; height: 6px; background: var(--line); }
.stat-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.stat-bar-tick { position: absolute; left: 50%; top: -4px; width: 1px; height: 14px; background: var(--ink-3); }
.stat-note { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------------- */
/* Component: lens switch                                                 */
/* ---------------------------------------------------------------------- */

.lens-switch { display: inline-flex; border: 1px solid var(--line-2); width: fit-content; }
.lens-switch-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  padding: 0 18px;
  min-height: 44px;
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--ink-2);
  border: none;
  border-left: 1px solid var(--line-2);
}
.lens-switch-btn:first-child { border-left: none; }
.lens-switch-btn.active { background: var(--ink); color: var(--ground); font-weight: 600; }
.lens-switch-btn.active:hover { color: var(--ground); }
.lens-switch-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Component: delta bar                                                   */
/* ---------------------------------------------------------------------- */

.delta-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.delta-bar-name { width: 92px; flex-shrink: 0; }
.delta-bar-track { flex-grow: 1; display: flex; height: 10px; }
.delta-bar-spacer { height: 10px; }
.delta-bar-fill { height: 10px; }
.delta-bar-fill.gain { background: var(--ink); }
.delta-bar-fill.loss { background-image: repeating-linear-gradient(135deg, var(--ink-3) 0 3px, transparent 3px 6px); }
.delta-bar-value { font-family: var(--mono); width: 56px; text-align: right; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* Component: season scrubber                                             */
/* ---------------------------------------------------------------------- */

.season-scrubber { display: flex; align-items: end; gap: 0; }
.season-scrubber-cells { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; flex-grow: 1; }
.season-scrubber-cell { display: flex; flex-direction: column; gap: 6px; }
.season-scrubber-bar { height: 20px; background: var(--line); }
.season-scrubber-bar.ss-archetypes { background: var(--na); }
.season-scrubber-bar.ss-active { background: var(--ink); }
.season-scrubber-label { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.season-scrubber-label.ss-label-mid { color: var(--ink-2); }
.season-scrubber-label.ss-label-active { color: var(--ink); font-weight: 600; }
.season-scrubber-legend { width: 240px; flex-shrink: 0; padding-left: 32px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-2); }
.season-scrubber-legend span.ss-item { display: flex; align-items: center; gap: 8px; }
.season-scrubber-legend .ss-swatch { width: 12px; height: 12px; display: inline-block; }
.season-scrubber-legend .ss-swatch.ss-networks { background: var(--line); }
.season-scrubber-legend .ss-swatch.ss-archetypes { background: var(--na); }

@media (max-width: 900px) {
  .season-scrubber { flex-direction: column; align-items: stretch; gap: 16px; }
  .season-scrubber-legend { width: auto; padding-left: 0; flex-direction: row; gap: 20px; }
}

/* ---------------------------------------------------------------------- */
/* Component: network canvas / shot map (image-backed placeholders;       */
/* real pages render these live via D3 in static/team.js)                 */
/* ---------------------------------------------------------------------- */

.network-canvas, .shot-map {
  position: relative;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.network-canvas-img, .shot-map-img { max-width: 100%; max-height: 100%; }

/* ---------------------------------------------------------------------- */
/* Component: data table                                                  */
/* ---------------------------------------------------------------------- */

.data-table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; font-size: 14px; }
.data-table thead th {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-weight: 500;
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.data-table thead th.rd-right { text-align: right; padding-left: 16px; }
.data-table thead th.dt-sortable { cursor: pointer; user-select: none; }
.data-table thead th.dt-sortable:hover { color: var(--ink-2); }
.data-table thead th.dt-sortable.dt-sort-asc::after { content: " \2191"; }
.data-table thead th.dt-sortable.dt-sort-desc::after { content: " \2193"; }
.data-table tbody td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.data-table tbody td.rd-right { text-align: right; font-family: var(--mono); padding-left: 16px; }
.data-table tbody td.rd-name { font-weight: 600; }
.dt-player-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.dt-player-link:hover { color: #fff; }
.data-table tbody tr.dim-row { opacity: 0.55; }
.data-table .gp-tag { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.data-table .dt-archetype { display: inline-flex; align-items: center; gap: 6px; }
.data-table .dt-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.data-table .dt-sep { color: var(--ink-3); }

.data-table .dt-bars {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 32px;
}
.data-table .dt-bar-num { width: 40px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.data-table .dt-bar-num.rd-right { text-align: right; }
.data-table .dt-bar-track { width: 180px; height: 10px; display: flex; }
.data-table .dt-bar-track.rd-out { justify-content: flex-end; }
.data-table .dt-bar-fill { height: 10px; }
.data-table .dt-bar-fill.rd-out { background: var(--ink); }
.data-table .dt-bar-fill.rd-in { background: var(--ink-3); }
.data-table .dt-bar-divider { width: 1px; height: 18px; background: var(--ink-3); flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* Team page                                                              */
/* ---------------------------------------------------------------------- */

.team-header {
  padding-top: 40px;
  display: flex;
  align-items: end;
  gap: 32px;
  flex-wrap: wrap;
}
.team-header-bar { width: 4px; height: 92px; flex-shrink: 0; }
.team-header-title { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; min-width: 240px; }
.team-header-controls { display: flex; flex-direction: column; align-items: end; gap: 12px; }
.team-header-selects { display: flex; gap: 8px; }

.rd-select-btn {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.rd-select-btn.rd-muted { color: var(--ink-2); font-family: var(--sans); }

@media (max-width: 900px) {
  .team-header { padding-top: 28px; gap: 20px; }
  .team-header-controls { align-items: start; width: 100%; }
}

.team-body { padding-top: 32px; }

.team-canvas-col { display: flex; flex-direction: column; gap: 12px; }
.team-canvas-panel {
  position: relative;
  height: 600px;
  background: var(--panel);
  overflow: hidden;
}
.team-canvas-panel svg { width: 100%; height: 100%; display: block; }
.team-canvas-count {
  position: absolute; left: 20px; top: 16px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  pointer-events: none;
}
.team-canvas-zoom { position: absolute; right: 16px; top: 12px; display: flex; gap: 6px; }
.team-canvas-zoom button {
  width: 36px; height: 36px; background: var(--ground);
  border: 1px solid var(--line-2); color: var(--ink); font-size: 16px;
}
.team-canvas-legend { display: flex; gap: 28px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.team-canvas-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 14px; text-align: center; padding: 0 40px;
}

.team-node { cursor: pointer; }
.team-node-initials { font-family: var(--mono); font-weight: 600; fill: var(--ground); pointer-events: none; user-select: none; }
.team-node-name { font-size: 13px; fill: var(--ink); pointer-events: none; user-select: none; }
.team-node-gp-tag { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }

.team-sidebar { display: flex; flex-direction: column; gap: 28px; }
.team-summary-list { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.team-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.team-summary-row .ts-label { color: var(--ink-2); flex-shrink: 0; }
.team-summary-row .ts-name { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 22px; }
.team-summary-row .ts-detail { font-family: var(--mono); color: var(--ink-2); font-size: 13px; }

.team-stats-list { display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line); padding-top: 20px; }
.team-stats-list .stat { gap: 8px; }
.team-stats-list .stat-value { font-size: 20px; }
.team-stats-caption { font-size: 12px; color: var(--ink-3); }

.team-player-card { display: flex; flex-direction: column; gap: 12px; background: var(--panel); padding: 18px 20px; }
.team-player-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.team-player-card-head .tpc-name { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 18px; }
.team-player-card-head a { font-size: 13px; color: var(--ink-2); }
.tpc-avatar-link { display: flex; align-items: center; gap: 10px; flex-shrink: 1; min-width: 0; }
.tpc-avatar-link .tpc-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpc-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tpc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-player-card-passes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-size: 13px; }
.team-player-card-passes .tpc-col-label { color: var(--ink-3); }
.team-player-card-passes .tpc-col { display: flex; flex-direction: column; gap: 6px; }
.team-player-card-passes .tpc-pass-row { display: flex; justify-content: space-between; }
.team-player-card-passes .tpc-pass-row span:last-child { font-family: var(--mono); }
.team-player-card-out {
  font-size: 13px; color: var(--ink-3);
  border-top: 1px solid var(--line); padding-top: 12px;
}

.team-rotation { padding-top: 48px; display: flex; flex-direction: column; gap: 14px; }
.team-rotation-head { display: flex; justify-content: space-between; align-items: baseline; }
.team-rotation-head span { font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------------- */
/* Team page — Lineups lens                                               */
/* ---------------------------------------------------------------------- */

.rd-grid-12.lineups-mode #team-sidebar { order: 1; }
.rd-grid-12.lineups-mode #team-canvas-col { order: 2; }

#lineup-shotmap-section { margin-top: 20px; }

.lineup-list { display: flex; flex-direction: column; gap: 0; }
.lineup-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.lineup-row:hover { background: var(--panel); }
.lineup-row.active { background: var(--panel); box-shadow: inset 2px 0 0 var(--ink); }
.lineup-row-chips { display: flex; gap: 4px; flex-wrap: wrap; flex-grow: 1; }
.lineup-row-chip {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ground);
  flex-shrink: 0;
}
.lineup-row-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.lineup-row-net { font-family: var(--mono); font-size: 14px; }
.lineup-row-net.rd-pos { color: var(--ink); }
.lineup-row-net.rd-neg { color: var(--ink-3); }
.lineup-row-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---------------------------------------------------------------------- */
/* Team page — What-if lens                                               */
/* ---------------------------------------------------------------------- */

.whatif-toolbar {
  padding-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  flex-wrap: wrap;
  row-gap: 12px;
}
.whatif-submode-group { display: flex; gap: 10px; flex-wrap: wrap; }
.whatif-submode-btn {
  min-height: 40px;
  padding: 0 16px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}
.whatif-submode-btn.active { background: var(--panel); color: var(--ink); border-color: var(--ink); font-weight: 600; }
.whatif-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: 8px; }
.whatif-controls .wi-label { color: var(--ink-3); margin-left: 8px; }
.whatif-controls select { min-width: 140px; }

.wi-run-btn {
  min-height: 40px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--ground);
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.wi-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.whatif-submode-footer { padding-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.wsf-col { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.wsf-title { font-size: 14px; font-weight: 600; }
.wsf-caption { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.wi-candidate-list { display: flex; flex-direction: column; }
.wi-candidate-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
  font-size: 14px; cursor: pointer;
}
.wi-candidate-row:hover { background: var(--panel); }
.wi-candidate-row.active { background: var(--panel); box-shadow: inset 2px 0 0 var(--ink); }
.wi-candidate-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.wi-candidate-name { flex-grow: 1; }
.wi-candidate-team { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.wi-candidate-score { width: 32px; text-align: right; }

@media (max-width: 900px) {
  .whatif-toolbar { padding-top: 16px; }
  .whatif-controls { margin-left: 0; }
  .whatif-submode-footer { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* Player page                                                            */
/* ---------------------------------------------------------------------- */

.player-header { padding-top: 40px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.player-monogram {
  position: relative;
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: 28px; color: var(--ground);
  overflow: hidden;
}
.player-monogram img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-meta { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; min-width: 240px; }
.player-meta-line { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.player-meta-line a { color: var(--ink-2); }
.player-header-controls { display: flex; gap: 8px; align-self: start; flex-shrink: 0; }

.player-stats-row { padding-top: 32px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; row-gap: 24px; }
.player-top-stats { grid-column: span 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.player-top-stat { display: flex; flex-direction: column; gap: 4px; }
.player-top-stat .pts-label { font-size: 12px; color: var(--ink-3); }
.player-top-stat .pts-value { font-family: var(--mono); font-size: 30px; font-weight: 500; }
.player-top-stat .pts-value .pts-ordinal { font-size: 15px; color: var(--ink-2); }

.player-pct-stats { grid-column: span 6; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.player-pct-stat { display: flex; flex-direction: column; gap: 6px; }
.player-pct-stat .pps-label { font-size: 12px; color: var(--ink-3); }
.player-pct-stat .pps-value { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.player-pct-stat .pps-bar { height: 4px; background: var(--line); }
.player-pct-stat .pps-bar-fill { height: 4px; background: var(--ink); }
.player-pct-stat .pps-ordinal { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

@media (max-width: 900px) {
  .player-top-stats, .player-pct-stats { grid-column: span 12; }
  .player-pct-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
}

.player-columns { padding-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .player-columns { grid-template-columns: 1fr; } }
.player-col { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.player-col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.player-col-head .pc-title { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 18px; }

.usage-row { display: flex; flex-direction: column; gap: 6px; }
.usage-row-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.usage-row-top .ur-pct { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.usage-row-bar { position: relative; height: 6px; background: var(--line); }
.usage-row-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.usage-row-bar-tick { position: absolute; left: 50%; top: -4px; width: 1px; height: 14px; background: var(--ink-3); }
.player-col-caption { font-size: 12px; color: var(--ink-3); }

.pp-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pp-val { width: 34px; text-align: right; font-family: var(--mono); font-size: 13px; color: var(--ink-2); flex-shrink: 0; }
.pp-bar-track { width: 90px; height: 10px; display: flex; flex-shrink: 0; }
.pp-bar-track.pp-made { justify-content: flex-end; }
.pp-bar-fill { height: 10px; }
.pp-bar-fill.pp-made { background: var(--ink); }
.pp-bar-fill.pp-rcv { background: var(--ink-3); }
.pp-name { flex-grow: 1; text-align: center; }
.pp-name-link { display: flex; align-items: center; gap: 6px; flex-grow: 1; justify-content: center; color: var(--ink); }
.pp-name-link:hover { color: #fff; }
.pp-totals { display: flex; justify-content: space-between; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.pp-totals .rd-mono { font-family: var(--mono); }
.player-col-link { font-size: 13px; color: var(--ink-2); }

.player-career { padding: 44px 80px 0 80px; display: flex; flex-direction: column; gap: 12px; }
.player-career-head { display: flex; justify-content: space-between; align-items: baseline; }
.player-career-head span { font-size: 13px; color: var(--ink-3); }
.career-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; overflow-x: auto; }
.career-col { display: flex; flex-direction: column; gap: 6px; min-width: 64px; }
.career-bar-track { height: 90px; display: flex; align-items: flex-end; background: var(--panel); }
.career-bar-fill { width: 100%; }
.career-season { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.career-metric { font-family: var(--mono); font-size: 13px; }
.career-metric .cm-unit { color: var(--ink-3); }
.career-arch { font-size: 12px; line-height: 1.35; }

@media (max-width: 900px) {
  .career-strip { grid-template-columns: repeat(10, minmax(74px, 1fr)); }
}

/* ---------------------------------------------------------------------- */
/* Home page                                                              */
/* ---------------------------------------------------------------------- */

.home-title-row { padding-top: 56px; display: flex; justify-content: space-between; align-items: end; gap: 48px; flex-wrap: wrap; }
.home-title-col { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.home-title-side { display: flex; flex-direction: column; align-items: end; gap: 16px; flex-shrink: 0; }
.home-scoring-legend { display: flex; flex-direction: column; gap: 10px; align-items: end; }
.home-scoring-legend-row { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.home-scoring-legend-row span { display: flex; align-items: center; gap: 6px; }
.home-scoring-legend-row .hsl-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.home-sort-row { padding: 32px 80px 16px 80px; display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
#home-sort-group { display: flex; gap: 8px; flex-wrap: wrap; }
.home-sort-btn {
  min-height: 36px; padding: 0 14px; background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-2); font-family: var(--sans); font-size: 14px; cursor: pointer;
}
.home-sort-btn.active { background: var(--ink); color: var(--ground); font-weight: 600; border-color: var(--ink); }

.home-teams-grid { padding: 0 80px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .home-teams-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .home-teams-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.home-team-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 10px 14px 10px; background: var(--panel); border: 1px solid var(--panel);
}
.home-team-card:hover { border-color: var(--line-2); }
.home-team-card .htc-net { width: 100%; aspect-ratio: 1 / 1; }
.home-team-card .htc-net svg { width: 100%; height: 100%; display: block; }
.home-team-card .htc-meta { width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.home-team-card .htc-abbr { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 16px; }
.home-team-card .htc-share { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

.home-footer-row { padding: 28px 80px 60px 80px; display: flex; gap: 40px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.home-footer-row a { color: var(--ink); }

/* ---------------------------------------------------------------------- */
/* League page                                                            */
/* ---------------------------------------------------------------------- */

.league-legend-row { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.league-legend-row span { display: flex; align-items: center; gap: 6px; }
.league-legend-row .ll-swatch { width: 10px; height: 10px; display: inline-block; }

.league-mix-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.league-mix-row .lmr-label { width: 60px; flex-shrink: 0; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.league-mix-row .lmr-bars { flex-grow: 1; display: flex; height: 34px; gap: 2px; }
.league-mix-row .lmr-bars > div { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; color: var(--ground); }
.league-mix-row .lmr-n { width: 44px; flex-shrink: 0; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.league-mix-bar { display: flex; height: 26px; gap: 2px; font-family: var(--mono); font-size: 12px; }
.league-mix-bar > div { display: flex; align-items: center; padding-left: 8px; }
.league-mix-labels { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }

.league-pairing-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.league-pairing-row .lpr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.league-pairing-row .lpr-names { flex-grow: 1; }
.league-pairing-row .lpr-score { font-family: var(--mono); color: var(--ink-2); }
.league-team-row:hover { background: var(--panel); }
.league-team-row td.rd-name a { color: var(--ink); }

.sm-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-right: 7px; }

.synergy-matrix { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.synergy-matrix th, .synergy-matrix td { padding: 8px 10px; text-align: center; }
.synergy-matrix .sm-col-head {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.04em; white-space: nowrap; font-weight: 500;
}
.synergy-matrix .sm-row-head {
  text-align: left; white-space: nowrap; font-size: 13px; color: var(--ink); font-weight: 500;
}
.synergy-matrix .sm-cell { font-family: var(--mono); cursor: default; }
.synergy-matrix .sm-cell.sm-self { color: var(--ink-3); background: var(--panel); }

.trios-layout { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.trios-list { flex: 1 1 380px; display: flex; flex-direction: column; }
.trio-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 10px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.trio-row:hover { background: var(--panel); }
.trio-row.active { background: var(--panel); }
.trio-row-dots { display: flex; flex-shrink: 0; }
.trio-row-names { flex-grow: 1; color: var(--ink-2); }
.trio-row.active .trio-row-names { color: var(--ink); }
.trio-row-score { color: var(--ink-2); }

.trio-detail { flex: 1 1 320px; background: var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.trio-detail-archs { display: flex; flex-direction: column; gap: 8px; }
.trio-detail-arch { display: flex; align-items: center; font-size: 15px; font-weight: 600; }
.trio-detail-composite { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 12px 0; }
.trio-detail-rows { display: flex; flex-direction: column; gap: 14px; }

/* ---------------------------------------------------------------------- */
/* Styleguide-only scaffolding                                            */
/* ---------------------------------------------------------------------- */

.rd-swatch-grid { display: grid; gap: 8px; }
.rd-swatch { display: flex; flex-direction: column; gap: 8px; }
.rd-swatch-fill { height: 72px; }
.rd-swatch-label { font-size: 14px; font-weight: 600; }
.rd-swatch-chip { height: 48px; border: 1px solid var(--line-2); }
.rd-swatch-chip-label { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

.rd-type-specimen { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.rd-type-row { display: flex; align-items: baseline; gap: 16px; }
.rd-type-tag { width: 96px; flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.rd-panel { background: var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.rd-panel-label { font-size: 12px; color: var(--ink-3); }
