/* ── TEAM PAGE — ficha pública de un equipo (/equipos/:id) ─────────── */

.team-page > .head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.team-page > .head > .badge-wrap {
  width: 72px; height: 72px; flex: 0 0 72px;
  display: flex; align-items: center; justify-content: center;
}
.team-page > .head > .meta { min-width: 0; }
.team-page > .head > .meta > .name {
  margin: 0;
  font-size: 24px; font-weight: 700; line-height: 1.15;
  color: var(--fg);
}
.team-page > .head > .meta > .line {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.team-page > .head > .meta > .venue {
  margin: 6px 0 0;
  display: flex; align-items: center; gap: 5px;
  font-size: 12px;
  color: var(--fg-2);
}
.team-page > .head > .meta > .venue > svg { color: var(--fg-3); flex-shrink: 0; }
.team-page .dot-sep { color: var(--fg-3); }

@media (max-width: 540px) {
  .team-page > .head { padding: 12px; gap: 12px; }
  .team-page > .head > .badge-wrap { width: 56px; height: 56px; flex-basis: 56px; }
  .team-page > .head > .meta > .name { font-size: 18px; }
}

/* Plantel — layout "mini-stats": nombre+club en dos líneas, PJ/goles como
   módulos con etiqueta a la derecha (mismo recurso que los módulos del
   perfil). */
.team-squad > .section-label > .count {
  font-family: var(--mono);
  color: var(--fg-3);
  font-weight: 400;
}
/* Leyenda al final de la línea del título (después del dash). order:1
   la manda detrás del ::after del primitive, que tiene order 0. */
.team-squad > .section-label > .legend {
  order: 1;
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}
@media (max-width: 540px) {
  /* En mobile el título + leyenda no entran en una línea: la leyenda baja
     a su propia fila, alineada a la derecha. */
  .team-squad > .section-label { flex-wrap: wrap; row-gap: 2px; }
  .team-squad > .section-label > .legend { flex-basis: 100%; text-align: right; }
}
.team-squad .position-group { margin-top: 12px; }
.team-squad .position-group > .pos-label {
  margin: 0 0 4px;
  font-size: 11px; font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.team-squad .position-group > .players {
  list-style: none;
  margin: 0; padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.team-squad .position-group > .players > .player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  border-top: 1px solid var(--line);
}
.team-squad .position-group > .players > .player:first-child { border-top: 0; }
.team-squad .position-group > .players > .player > .avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.team-squad .position-group > .players > .player > .avatar > img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
}
.team-squad .position-group > .players > .player > .who {
  min-width: 0;
  flex: 1;
  display: flex; flex-direction: column; gap: 1px;
}
.team-squad .position-group > .players > .player > .who > .name {
  font-size: 13.5px; font-weight: 600;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Dorsal sobrio al lado del nombre. Clase propia: `.jersey` ya existe
   global (camiseta del pitch en match-detail-v2) y pinta un círculo. */
.team-squad .position-group > .players > .player > .who > .name > .dorsal {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  color: var(--fg-3);
  margin-left: 4px;
}
.team-squad .position-group > .players > .player > .who > .club {
  font-size: 11.5px;
  color: var(--fg-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-squad .position-group > .players > .player > .stats {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.team-squad .position-group > .players > .player > .stats > .stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 36px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px 6px 2px;
}
.team-squad .position-group > .players > .player > .stats > .stat > .v {
  font-family: var(--mono);
  font-size: 13px; font-weight: 600;
  color: var(--fg);
  line-height: 1.1;
}
.team-squad .position-group > .players > .player > .stats > .stat.-gol > .v { color: var(--accent); }
.team-squad .position-group > .players > .player > .stats > .stat > .l {
  font-size: 8.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-squad > .squad-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 24px;
  color: var(--fg-3);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 13px;
}
.team-squad > .squad-loading > .spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: team-squad-spin 0.8s linear infinite;
}
@keyframes team-squad-spin { to { transform: rotate(360deg); } }

/* Chip de lista preliminar (convocados sin lista final anunciada) */
.team-squad > .section-label > .status-chip {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.3px;
  color: var(--amarilla-ink);
  background: var(--amarilla);
  border-radius: 10px;
  padding: 1px 8px;
}
/* Links a la página del equipo desde tablas y header del partido:
   heredan el color del contexto, subrayan al hover, y el chevron "›"
   señala que la celda es tapeable también sin hover (mobile). */
.team-cell-link,
.team-cell-link:visited { color: inherit; text-decoration: none; }
.team-cell-link:hover > span:not(.team-link-chev) { text-decoration: underline; }
.team-link-chev {
  color: var(--fg-3);
  font-weight: 400;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
a:hover > .team-link-chev { color: var(--accent); transform: translateX(2px); }

.match-v2-header .team > .team-meta > .name > a,
.match-v2-header .team > .team-meta > .name > a:visited { color: inherit; text-decoration: none; }
.match-v2-header .team > .team-meta > .name > a:hover { text-decoration: underline; }
.match-v2-header .team > .badge-wrap > a { display: contents; }
