/* ============================================================
   compara.css — CSS específico del comparador de jugadores.
   Solo lo que no vive en rincon.css. La paleta de jugador (4
   colores) debe ir sincronizada con $PALETA de compara.php.
   ============================================================ */

/* Paleta por jugador (índice 0-3) — misma que $PALETA en PHP. */
.cmp-accent--0 { --cmp-c: #131C2E; }
.cmp-accent--1 { --cmp-c: #2563EB; }
.cmp-accent--2 { --cmp-c: #C07C1D; }
.cmp-accent--3 { --cmp-c: #7C3AED; }

.cmp-head { align-items: center; }
.cmp-head h1 { font-family: var(--score); font-size: 26px; font-weight: 700; }
.cmp-intro { max-width: 60ch; margin-bottom: var(--sp-4); }

/* ---------- Cabecera de comparados ---------- */
.cmp-heads {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(var(--cmp-n, 4), minmax(0, 1fr));
}
.cmp-heads[data-count="2"] { --cmp-n: 2; }
.cmp-heads[data-count="3"] { --cmp-n: 3; }
.cmp-heads[data-count="4"] { --cmp-n: 4; }

.cmp-head-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); border-top: 3px solid var(--cmp-c);
  padding: var(--sp-4); display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); text-align: center;
}
.cmp-head-card__link {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  color: var(--ink); min-width: 0; width: 100%;
}
.cmp-head-card__link:hover { text-decoration: none; }
.cmp-head-card__link:hover .cmp-head-card__name { color: var(--accent-deep); }
.cmp-head-card__photo {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--cmp-c); background: var(--zebra);
}
.cmp-head-card__photo--fb {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--score); font-size: 26px; font-weight: 700;
  color: var(--cmp-c);
}
.cmp-head-card__name {
  font-family: var(--score); font-size: 16px; font-weight: 700;
  line-height: 1.2; max-width: 100%;
}
.cmp-head-card__meta {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 6px;
}
.cmp-baja {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--down-tint); color: var(--down);
}

/* ---------- Tabla comparativa ---------- */
.cmp-table { min-width: 480px; }
.cmp-table th.cmp-metric,
.cmp-table td.cmp-metric {
  text-align: left; font-weight: 600; color: var(--muted);
  position: sticky; left: 0; background: var(--surface); z-index: 1;
}
.cmp-table th.cmp-metric { z-index: 3; } /* corner por encima de las cabeceras que hacen scroll */
.cmp-table tbody tr:nth-child(even) td.cmp-metric { background: var(--zebra); }
.cmp-table th.cmp-col { color: #fff; }
.cmp-table td.is-best {
  background: var(--accent-soft) !important;
  color: var(--accent-deep); font-weight: 700;
}
.cmp-note { margin-top: var(--sp-2); }

/* ---------- Gráficas ---------- */
.cmp-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmp-legend { justify-content: center; }
.cmp-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.cmp-swatch--0 { background: #131C2E; }
.cmp-swatch--1 { background: #2563EB; }
.cmp-swatch--2 { background: #C07C1D; }
.cmp-swatch--3 { background: #7C3AED; }

@media (max-width: 720px) {
  .cmp-charts { grid-template-columns: 1fr; }
  .cmp-head-card__photo { width: 60px; height: 60px; }
  .cmp-head-card__name { font-size: 14px; }
}
