/* players view styles — Goleadores (scorers) + Perfil de jugador.
   Mobile-first. tabular-nums en números. prefers-reduced-motion respetado. */

/* ===================================================================== */
/*  GOLEADORES (scorers)                                                 */
/* ===================================================================== */
.scorers-view { max-width: 760px; margin: 0 auto; }

.scorers-view__header { margin-bottom: 16px; }
.scorers-view__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--ink);
  letter-spacing: -.01em;
}
.scorers-view__subtitle {
  color: var(--ink-3);
  font-size: .9rem;
  margin-top: 2px;
}

.scorers-body.is-empty { padding-top: 8px; }

/* Encabezado de columnas — en móvil muestra #, Jugador, G, A, Rating (PJ oculto). */
.scorers-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px 30px 48px;
  align-items: center;
  gap: 8px;
  padding: 0 4px 6px;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.scorers-head__col { text-align: center; }
.scorers-head__col--g { color: var(--brand-1); }
.scorers-head__col--pj { display: none; } /* PJ solo en pantallas amplias */

.scorers-list { padding: 4px 12px; overflow: hidden; }

/* Fila de goleador.
   Grid móvil: rank | identidad | goles | asist | rating  (PJ oculto). */
.scorer-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px 30px 48px;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
}
.scorer-row:last-child { border-bottom: 0; }
.scorer-row.is-clickable { cursor: pointer; }
.scorer-row.is-clickable:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
@media (hover: hover) {
  .scorer-row.is-clickable:hover { background: var(--surface-soft); }
}

.scorer-row__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: center;
}
.scorer-row--top .scorer-row__rank { color: var(--brand-1); }
.scorer-row--top-1 .scorer-row__rank { color: var(--brand-2); }

.scorer-row__ident {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.scorer-row__photo {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  flex: none;
}
.scorer-row__idtext { display: flex; flex-direction: column; min-width: 0; }
.scorer-row__name {
  font-weight: 600;
  color: var(--ink);
  font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scorer-row__sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  color: var(--ink-3);
  min-width: 0;
}
.scorer-row__nat {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Escudo de equipo — oculto en móvil, aparece en >=560px. */
.scorer-row__team { display: none; justify-content: center; }
.scorer-row__crest { width: 22px; height: 22px; }

.scorer-row__metric {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
  font-size: .9rem;
}
/* En móvil se muestran Goles (destacado), Asistencias y Rating; solo PJ se oculta
   (por CLASE — el nth-of-type contaba todos los <span> y ocultaba la columna
   equivocada). */
.scorer-row__apps { display: none; }

.scorer-row__goals {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
}

.scorer-row__rating {
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 3px 0;
  min-width: 40px;
}
.scorer-row__rating.is-high { color: var(--win); background: rgba(22,163,74,.10); }
.scorer-row__rating.is-mid  { color: var(--warn); background: rgba(245,158,11,.12); }
.scorer-row__rating.is-low  { color: var(--ink-2); background: var(--surface-sunk); }
.scorer-row__rating.is-empty { color: var(--ink-3); background: transparent; }

.scorer-row--skeleton { display: block; padding: 6px 4px; }

/* Pantallas amplias: mostrar columnas completas + escudo. */
@media (min-width: 560px) {
  .scorers-head {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 28px 44px 44px 44px 56px;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    font-size: .66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-3);
  }
  .scorer-row {
    grid-template-columns: 26px minmax(0, 1fr) 28px 44px 44px 44px 56px;
  }
  .scorer-row__team { display: flex; }
  .scorer-row__assists,
  .scorer-row__apps { display: block; }
  .scorers-head__col--pj { display: block; }
}

/* ===================================================================== */
/*  PERFIL DE JUGADOR                                                     */
/* ===================================================================== */
.player-view { max-width: 760px; margin: 0 auto; }

.player-view__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 12px 6px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  margin-bottom: 16px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
@media (hover: hover) {
  .player-view__back:hover { color: var(--ink); background: var(--surface-sunk); }
}

/* Hero */
.player-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
}
.player-hero__photo {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
  box-shadow: var(--shadow-md);
  flex: none;
}
.player-hero__info { min-width: 0; flex: 1; }
.player-hero__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  color: var(--ink);
  line-height: 1.15;
}
.player-hero__fullname {
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 1px;
}
.player-hero__nat {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.player-hero__flag {
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}
.player-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.player-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
}
.player-chip small {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.player-chip strong {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.player-hero__sk-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Tiles de estadísticas */
.player-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 480px) {
  .player-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 680px) {
  .player-tiles { grid-template-columns: repeat(4, 1fr); }
}

.player-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 10px;
  text-align: center;
}
.player-tile__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.player-tile__value.is-empty { color: var(--ink-3); }
.player-tile__value--rating.is-high { color: var(--win); }
.player-tile__value--rating.is-mid  { color: var(--warn); }
.player-tile__value--rating.is-low  { color: var(--ink-2); }
.player-tile__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-3);
  font-weight: 600;
}
.player-tile--goal .player-tile__value { color: var(--goal); }
.player-tile--assist .player-tile__value { color: var(--brand-1); }
.player-tile--yellow .player-tile__value { color: var(--warn); }
.player-tile--red .player-tile__value { color: var(--card-red); }

.player-tile--skeleton,
.player-hero--skeleton { /* dejar que el skeleton interno haga el shimmer */ }

/* Equipo(s) */
.player-teams { margin-bottom: 20px; }
.player-teams__list { padding: 4px 16px; }
.player-teams__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.player-teams__row:last-child { border-bottom: 0; }
.player-teams__crest { width: 26px; height: 26px; }
.player-teams__name { font-weight: 600; color: var(--ink); font-size: .9rem; }

/* Bandera de nacionalidad inline (reutilizable). */
.nat-flag {
  border-radius: 2px;
  object-fit: cover;
  flex: none;
}

/* ===================================================================== */
/*  Movimiento — respetar prefers-reduced-motion                         */
/* ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .scorer-row.fade-in,
  .player-hero.fade-in,
  .player-tile.fade-in {
    animation: none !important;
  }
}

/* Selector de edición en Goleadores */
.scorers-editions { margin-bottom: 16px; }
.scorers-editions__hint { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 10px; }

/* Chip % campeón en la sublínea del goleador */
.scorer-row__sub .champ-chip--xs { flex: none; }

/* ===================================================================== */
/*  Perfil enriquecido: nacimiento, torneos, club, palmarés, trayectoria */
/* ===================================================================== */
.player-hero__birth { font-size: .82rem; color: var(--ink-3); margin: 8px 0 0; }

.player-section { margin-top: 22px; }
.player-section .section-title { margin-bottom: 10px; }

.player-table { padding: 6px 14px; }
.player-table__row {
  display: grid;
  grid-template-columns: 1fr 44px 48px 48px 52px;
  gap: 6px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
}
.player-table__row:last-child { border-bottom: 0; }
.player-table__row span:first-child { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-table__row span:not(:first-child) { text-align: right; color: var(--ink-2); }
.player-table__row--head span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }

.player-trophies { padding: 8px 14px; }
.player-trophies__row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--hairline);
}
.player-trophies__row:last-child { border-bottom: 0; }
.player-trophies__cup { font-size: 1.1rem; flex: none; }
.player-trophies__cup b { font-size: .78rem; color: var(--ink-2); margin-left: 2px; }
.player-trophies__name { font-size: .88rem; font-weight: 600; min-width: 0; }
.player-trophies__name small { display: block; font-size: .74rem; font-weight: 400; color: var(--ink-3); margin-top: 1px; }

.player-transfers { padding: 8px 14px; }
.player-transfers__row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--hairline);
  font-size: .84rem;
}
.player-transfers__row:last-child { border-bottom: 0; }
.player-transfers__year { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-3); width: 38px; }
.player-transfers__move { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; flex-wrap: wrap; }
.player-transfers__move small { font-size: .82rem; }
.player-transfers__crest { width: 18px; height: 18px; object-fit: contain; flex: none; }
.player-transfers__arrow { color: var(--ink-3); flex: none; }
.player-transfers__fee { flex: none; font-size: .72rem; font-weight: 600; color: var(--ink-2); background: var(--surface-soft); border-radius: var(--r-pill); padding: 3px 8px; }

/* Sección Mundial 2026: totales, en vivo y partido a partido */
.player-wc26__live {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.player-wc26__live--link { cursor: pointer; }
.player-wc26__livebadge {
  flex: none; font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  color: #fff; background: var(--live); border-radius: var(--r-pill);
  padding: 4px 9px; animation: live-pulse 1.4s ease-in-out infinite;
}
.player-wc26__livetxt { font-size: .84rem; color: var(--ink-2); line-height: 1.4; }
.player-wc26__totals { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.player-wc26__score { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.player-table__row--link { text-decoration: none; color: inherit; cursor: pointer; }
.player-table__row--link:hover span:first-child { color: var(--brand-1); }
