/* ============================================================
   caraacara.css — CSS específico del Cara a cara (duelo 2 jugadores).
   Solo lo que no vive en rincon.css. Colores de identidad sincronizados
   con $COLOR_J1 / $COLOR_J2 de caraacara.php.
   ============================================================ */

/* Identidad por jugador (slot 1 / 2). */
.caa-accent--1 { --caa-c: #2563EB; }
.caa-accent--2 { --caa-c: #C07C1D; }
.caa-v--1 { color: #2563EB; }
.caa-v--2 { color: #C07C1D; }

.caa-head { align-items: center; }
.caa-head h1 { font-family: var(--score); font-size: 26px; font-weight: 700; }
.caa-intro { max-width: 60ch; margin-bottom: var(--sp-4); }
.caa-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Cabecera de duelo ---------- */
.caa-heads-sec { position: relative; }
.caa-heads {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.caa-head-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); border-top: 3px solid var(--caa-c);
  padding: var(--sp-4); display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); text-align: center;
}
.caa-head-card__link {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  color: var(--ink); min-width: 0; width: 100%;
}
.caa-head-card__link:hover { text-decoration: none; }
.caa-head-card__link:hover .caa-head-card__name { color: var(--accent-deep); }
.caa-head-card__photo {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--caa-c); background: var(--zebra);
}
.caa-head-card__photo--fb {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--score); font-size: 28px; font-weight: 700; color: var(--caa-c);
}
.caa-head-card__name {
  font-family: var(--score); font-size: 17px; font-weight: 700;
  line-height: 1.2; max-width: 100%;
}
.caa-head-card__meta {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 6px;
}
/* Distintivo "VS" centrado sobre las dos tarjetas. */
.caa-vs {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--score); font-weight: 700; font-size: 18px; color: var(--muted);
  background: var(--ground); border: 1px solid var(--line);
  border-radius: 999px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}

/* ---------- Balance de enfrentamientos ---------- */
.caa-score { text-align: center; padding: var(--sp-4); }
.caa-score__label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.caa-score__line {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  margin: var(--sp-1) 0;
}
.caa-score__n {
  font-family: var(--score); font-size: 44px; font-weight: 700; line-height: 1;
  color: var(--muted); opacity: .55;
}
.caa-score__n--1.is-lead { color: #2563EB; opacity: 1; }
.caa-score__n--2.is-lead { color: #C07C1D; opacity: 1; }
.caa-score__sep { font-family: var(--score); font-size: 28px; color: var(--line); }
.caa-score__names {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-4);
  font-size: 13px; font-weight: 600; margin-top: 2px;
}
.caa-score__msg { font-size: 13px; color: var(--muted); margin-top: var(--sp-2); }

/* ---------- Tres bloques comparativos ---------- */
.caa-blocks {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.caa-block { padding: 0; overflow: hidden; }
.caa-block__head {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--zebra); border-bottom: 1px solid var(--line);
}
.caa-block__head h3 { font-family: var(--score); font-size: 15px; font-weight: 700; line-height: 1.1; }
.caa-block__sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.caa-block__ico { width: 22px; height: 22px; fill: none; stroke: var(--accent-deep); stroke-width: 1.6; flex: none; }

.caa-cmp { table-layout: fixed; }
.caa-cmp td { border-bottom: 1px solid var(--line); padding: 7px 10px; }
.caa-cmp tbody tr:last-child td { border-bottom: none; }
.caa-cmp .caa-v {
  width: 38%; font-family: var(--score); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.caa-cmp .caa-v:first-child { text-align: right; }
.caa-cmp .caa-v:last-child { text-align: left; }
.caa-cmp .caa-lbl {
  width: 24%; text-align: center; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  white-space: normal;
}
.caa-avg { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 500; }
.caa-cmp .is-win { color: var(--up); font-weight: 700; }
.caa-cmp .is-win .caa-avg { color: var(--up); }
.caa-cmp .is-lose { color: var(--muted); opacity: .7; }
.caa-cmp .is-tie.caa-v--1 { color: #2563EB; }
.caa-cmp .is-tie.caa-v--2 { color: #C07C1D; }
.caa-note { margin-top: var(--sp-2); }

/* ---------- Radar ---------- */
.caa-legend { justify-content: center; }
.caa-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.caa-swatch--1 { background: #2563EB; }
.caa-swatch--2 { background: #C07C1D; }

/* ---------- Detalle de enfrentamientos ---------- */
.caa-h2h { min-width: 560px; }
.caa-h2h .sticky-col {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
}
.caa-h2h thead .sticky-col { z-index: 4; background: var(--ink); }
.caa-h2h tbody tr:nth-child(even) td.sticky-col { background: var(--zebra); }
.caa-h2h tbody tr:hover td.sticky-col { background: var(--hover); }
.caa-h2h th.c, .caa-h2h td.c { text-align: center; }
.caa-h2h .caa-date { font-weight: 600; }
.caa-h2h .is-win { color: var(--up); font-weight: 700; }
.caa-team { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.caa-court { color: var(--muted); margin: 0 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .caa-blocks { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .caa-head-card__photo { width: 68px; height: 68px; }
  .caa-head-card__name { font-size: 15px; }
  .caa-score__n { font-size: 36px; }
  .caa-inputs { grid-template-columns: 1fr; }
}
