/* ============================================================
   historicas.css — CSS específico de la ficha HISTÓRICA de jugador.
   Solo lo que no vive en rincon.css (hero reutiliza .player-hero,
   tarjetas .stat-card, tablas .table). Cero style inline salvo
   valores dinámicos.
   ============================================================ */

/* ---------- Hero: acciones y chip de histórico ---------- */
.player-hero__actions {
  margin-left: auto; text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-3);
}
.player-hero__actions .btn { white-space: nowrap; }
.chip-dark--hist {
  background: var(--ink); border-color: var(--ink); color: #fff;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px;
}

/* ---------- Conmutador Medias/Máximas/Mínimas/Totales ---------- */
.hist-tabs { margin-top: var(--sp-4); }
.hist-hint { margin-top: var(--sp-2); }

/* ---------- Tabla histórica: 1ª columna pegajosa + scroll-x ---------- */
.hist-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hist-table { min-width: 820px; }
.hist-table th.hist-stick,
.hist-table td.hist-stick {
  position: sticky; left: 0; z-index: 2;
  text-align: left; min-width: 120px;
}
.hist-table thead th.hist-stick { z-index: 4; }
.hist-table thead th { position: sticky; top: 0; z-index: 3; }
.hist-table tbody td.hist-stick { background: var(--surface); box-shadow: 4px 0 8px -4px rgba(19,28,46,.14); }
.hist-table tbody tr:nth-child(even) td.hist-stick { background: var(--zebra); }
.hist-table tbody tr:hover td.hist-stick { background: var(--hover); }
.hist-table .team-tag { font-weight: 600; }

/* Enlace de temporada (a la ficha de esa temporada) */
.hist-slink { color: var(--accent-deep); font-weight: 600; border-bottom: 1px dashed var(--line); }
.hist-slink:hover { color: var(--ink); border-bottom-color: var(--accent-deep); text-decoration: none; }

/* Fila-resumen (tfoot): destacada, no zebra, 1ª columna también pegajosa */
.hist-table tfoot td { border-top: 2px solid var(--line); background: var(--ground); font-weight: 700; }
.hist-table tfoot td.hist-stick { background: var(--ground); z-index: 2; }
.tag-total {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: #fff; background: var(--accent-deep);
  border-radius: var(--r-pill); padding: 2px 10px;
}

/* ---------- Jugadores relacionados: raíles horizontales ---------- */
.related-rails .rail { margin-top: var(--sp-4); }
.related-rails .rail h3 {
  font-family: var(--score); font-size: 16px; font-weight: 700; margin-bottom: var(--sp-2);
}
.rail-track {
  display: flex; gap: var(--sp-3); overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px var(--sp-3); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.rail-track.loading, .rail-empty { color: var(--muted); font-size: 13px; padding: var(--sp-3); }
.related-card {
  flex: 0 0 auto; width: 138px; scroll-snap-align: start; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 10px; color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.related-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-card);
  border-color: var(--accent); text-decoration: none; color: var(--ink);
}
.related-photo {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  outline: 2px solid var(--accent); outline-offset: 2px; background: var(--zebra);
  display: flex; align-items: center; justify-content: center;
}
.related-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-ini { font-family: var(--score); font-weight: 700; font-size: 22px; color: var(--muted); }
.related-name {
  font-weight: 600; font-size: 13px; line-height: 1.2; min-height: 32px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .player-hero__actions { margin-left: 0; align-items: stretch; width: 100%; }
  .player-hero__actions .btn { text-align: center; }
}
