/* ============================================================
   smgr · css/pages/historico_lideres.css — LÍDERES HISTÓRICOS
   Gran tabla ancha sticky (thead + 1.ª columna) con el ranking de
   líderes de toda la historia ACB por estadística (totales/medias),
   ordenable por cabecera (rincon.js). Reutiliza el patrón de tabla del
   ranking/avanzadas con clases propias (.hl-*). Tokens en css/tokens.css;
   componentes base en css/rincon.css.
   ============================================================ */

/* ---------- Cabecera de página ---------- */
.hl-head { margin-top: var(--sp-5); }
.hl-head h1 {
  font-family: var(--score); font-size: 26px; font-weight: 700;
  letter-spacing: .01em; color: var(--ink); margin-top: 2px;
}
.hl-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hl-head .sub strong { color: var(--ink); font-weight: 600; }

/* ---------- Stat-cards: 3 columnas ---------- */
.stat-cards.hl-stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 870px) {
  .stat-cards.hl-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stat-cards.hl-stats { grid-template-columns: 1fr; }
}
/* El protagonista de la primera card es un nombre, no un número */
.hl-stats .stat-card__big .player-cell {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 19px; font-weight: 700; white-space: nowrap;
}
.hl-stats .stat-card__big .player-cell a { color: var(--accent-deep); }
.hl-stats .stat-card__big .player-cell a:hover { text-decoration: underline; }

/* ---------- Barra de filtros ---------- */
.hl-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: var(--sp-4); padding: var(--sp-4); margin-top: var(--sp-4);
}
.hl-filters .fgroup { display: flex; flex-direction: column; gap: 6px; }
.hl-filters .flabel {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
.hl-filters select,
.hl-filters input[type="number"],
.hl-filters input[type="date"] {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  background-color: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-input); padding: 6px 12px;
}
.hl-filters select {
  padding-right: 32px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235B6577' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.hl-filters .hl-min { width: 92px; }
.hl-filters select:focus-visible,
.hl-filters input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hl-filters .btn { padding: 7px 16px; font-size: 13px; }
.hl-filters__reset {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  align-self: center; white-space: nowrap;
}
.hl-filters__reset:hover { color: var(--down); }

/* Segmented de enlaces (mismo look que broker/valoración/avanzadas) */
.hl-filters .seg {
  display: inline-flex; background: var(--ground);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px;
}
.hl-filters .seg a {
  font-size: 12px; font-weight: 600; padding: 5px 12px;
  border-radius: var(--r-pill); color: var(--muted); white-space: nowrap;
}
.hl-filters .seg a:hover { color: var(--ink); }
.hl-filters .seg a.is-active { background: var(--ink); color: #fff; }
.hl-filters .seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Presets (chips que fijan estadística + modo) ---------- */
.hl-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); }
.preset-chip {
  display: inline-flex; align-items: center; padding: 6px 14px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--ground); border: 1px solid var(--line);
  white-space: nowrap;
}
.preset-chip:hover { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.preset-chip.is-active {
  color: var(--ink); background: var(--accent-soft);
  border-color: var(--accent); font-weight: 700;
}
.preset-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Tabla de líderes: thead sticky + 1.ª columna sticky ---------- */
.hl-section { margin-top: var(--sp-5); }
.hl-section .section-head h2 {
  font-family: var(--score); font-size: 19px; font-weight: 700; color: var(--ink);
}
.hl-wrap {
  position: relative; overflow: auto; max-height: 78vh;
  border-radius: var(--r-card);
}
.hl-table { min-width: 820px; }
.hl-table--all { min-width: 1120px; }
.hl-table th { z-index: 3; white-space: nowrap; }

/* La 1.ª columna de datos (Jugador) es la sticky; el # queda antes y NO es sticky */
.hl-table th.stick-1, .hl-table td.stick-1 {
  position: sticky; left: 0; min-width: 190px; max-width: 190px;
  box-shadow: 4px 0 8px -4px rgba(19, 28, 46, .14);
}
.hl-table th.stick-1 { z-index: 4; top: 0; background: var(--ink); }
.hl-table td.stick-1 { background: var(--surface); z-index: 2; }
.hl-table tbody tr:nth-child(even) td.stick-1 { background: var(--zebra); }
.hl-table tbody tr:hover td.stick-1 { background: var(--hover); }
.hl-table td.stick-1 .player-cell a { overflow: hidden; text-overflow: ellipsis; }

/* En la vista ancha "Todas", el nombre completo comería demasiado: usa la
   versión abreviada "N. Apellido" también en escritorio (el completo, en su ficha). */
.hl-table--all td.stick-1 .pname-full { display: none; }
.hl-table--all td.stick-1 .pname-abbr { display: inline; }

/* Columna de posición centrada */
.hl-table th:nth-child(3), .hl-table td.hl-pos { text-align: center; }
.hl-table td.hl-pos .pos-badge { margin: 0 auto; }

/* Fila top-3 resaltada */
.hl-table tbody tr.is-top td { background: var(--up-tint); }
.hl-table tbody tr.is-top:nth-child(even) td.stick-1,
.hl-table tbody tr.is-top td.stick-1 { background: var(--up-tint); }

/* Separador entre bloques de columnas */
.hl-table th.col-sep, .hl-table td.col-sep { border-left: 1px solid var(--line); }

/* Columna principal (Total/Media) con el ámbar del sistema */
.hl-table td.c-sm strong { color: var(--accent-deep); }

/* Equipo(s): enlaces discretos a las fichas */
.hl-teams { font-size: 12.5px; }
.hl-table td .team-tag { color: var(--ink); font-weight: 600; }
.hl-table td .team-tag:hover { color: var(--accent-deep); text-decoration: none; }

/* Columna de ranking (#) */
.rk-num { font-weight: 700; color: var(--muted); font-size: 13px; }
.rk-1 { color: var(--accent-deep); font-size: 15px; }
.rk-2 { color: #7C8797; font-size: 14px; }
.rk-3 { color: #B0733A; font-size: 14px; }

/* Etiqueta "en activo" */
.hl-active {
  display: inline-block; padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--up); color: #fff; font-size: 9.5px; font-weight: 700;
  letter-spacing: .04em; vertical-align: middle; margin-left: 2px;
}

.hl-note { margin-top: var(--sp-3); font-size: 12.5px; line-height: 1.6; }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  .hl-head h1 { font-size: 22px; }
  .hl-filters { gap: var(--sp-3); }
  .hl-hide-sm { display: none; }
  .hl-table, .hl-table--all { min-width: 0; }
  .hl-table { font-size: 12.5px; }
  .hl-table th, .hl-table td { padding: 7px 8px; }
  .hl-table th.stick-1, .hl-table td.stick-1 { min-width: 150px; max-width: 150px; }
  .hl-table td.stick-1 .pname-full { display: none; }
  .hl-table td.stick-1 .pname-abbr { display: inline; }
  td.has-flag .player-cell { padding-right: 18px; }
}
