/* ============================================================
   smgr · css/pages/precedentes_partido.css — PRECEDENTES DE UN PARTIDO
   Cara a cara entre dos EQUIPOS: cabecera de duelo, marcador de balance,
   stat-cards, lista de enfrentamientos y récords de jugadores.
   Tokens en css/tokens.css; componentes base en css/rincon.css.
   ============================================================ */

/* Identidad local / visitante. */
.pp-accent--local { --pp-c: #2563EB; }
.pp-accent--vis   { --pp-c: #C07C1D; }

.pp-head { align-items: center; margin-top: var(--sp-4); }
.pp-head h1 { font-family: var(--score); font-size: 26px; font-weight: 700; }

/* ---------- Estados vacíos ---------- */
.pp-empty { padding: var(--sp-5); text-align: center; }
.pp-empty__title {
  font-family: var(--score); font-size: 18px; font-weight: 700;
  color: var(--ink); margin-bottom: 6px;
}
.pp-empty p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 auto var(--sp-3); max-width: 620px; }
.pp-empty .btn { margin-top: var(--sp-2); }

/* ---------- Cabecera de duelo ---------- */
.pp-heads-sec { position: relative; }
.pp-heads {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pp-head-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); border-top: 3px solid var(--pp-c);
  padding: var(--sp-4); display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); text-align: center;
}
.pp-head-card__link {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink); min-width: 0; width: 100%;
}
.pp-head-card__link:hover { text-decoration: none; }
.pp-head-card__link:hover .pp-head-card__code { color: var(--accent-deep); }
.pp-head-card__shield { display: flex; align-items: center; justify-content: center; height: 64px; }
.pp-head-card__shield .shield { width: 64px; height: 64px; }
.pp-head-card__code {
  font-family: var(--score); font-size: 22px; font-weight: 700; line-height: 1;
}
.pp-head-card__name { font-size: 13px; color: var(--muted); line-height: 1.25; }
.pp-head-card__tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--pp-c);
}

/* Distintivo "VS" centrado sobre las dos tarjetas. */
.pp-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;
}

/* ---------- Marcador de balance ---------- */
.pp-score { text-align: center; padding: var(--sp-4); margin-bottom: var(--sp-4); }
.pp-score__label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.pp-score__line {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-4);
  margin: var(--sp-2) 0 4px;
}
.pp-score__side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pp-score__team {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px; color: var(--muted);
}
.pp-score__n {
  font-family: var(--score); font-size: 46px; font-weight: 700; line-height: 1;
  color: var(--muted); opacity: .55;
}
.pp-score__n--local.is-lead { color: #2563EB; opacity: 1; }
.pp-score__n--vis.is-lead   { color: #C07C1D; opacity: 1; }
.pp-score__sep { font-family: var(--score); font-size: 28px; color: var(--line); align-self: flex-end; padding-bottom: 6px; }
.pp-score__msg { font-size: 13px; color: var(--muted); margin-top: var(--sp-2); }

/* ---------- Stat-cards del balance ---------- */
.pp-stats { margin-top: 0; }
.pp-stats .stat-card__big { font-size: 22px; }
.pp-dash { color: var(--line); font-weight: 600; }

/* ---------- Lista de enfrentamientos ---------- */
.pp-wrap { overflow-x: auto; }
.pp-matches { min-width: 620px; }
.pp-matches th.c, .pp-matches td.c { text-align: center; }
.pp-nowrap { white-space: nowrap; }
.pp-matches .pp-result__n { font-family: var(--score); font-weight: 600; font-variant-numeric: tabular-nums; }
.pp-matches .pp-result__n.is-win { color: var(--accent-deep); font-weight: 700; }
.pp-matches .pp-result__sep { color: var(--muted); margin: 0 3px; }
/* Franja de color según ganador en la primera celda. */
.pp-matches tr.pp-row--local td:first-child { box-shadow: inset 3px 0 0 #2563EB; }
.pp-matches tr.pp-row--vis td:first-child { box-shadow: inset 3px 0 0 #C07C1D; }
.pp-winner {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--ink);
}
.pp-winner:hover { color: var(--accent-deep); }
.pp-note { margin-top: var(--sp-3); font-size: 12.5px; line-height: 1.6; }

/* ---------- Récords de jugadores ---------- */
.pp-records {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pp-record { padding: 0; overflow: hidden; }
.pp-record__head {
  padding: var(--sp-3) var(--sp-4);
  background: var(--zebra); border-bottom: 1px solid var(--line);
}
.pp-record__head h3 { font-family: var(--score); font-size: 15px; font-weight: 700; }
.pp-record__wrap { overflow-x: auto; }
.pp-record__table { font-size: 13px; }
.pp-record__table th { position: static; }
.pp-record__table th.c, .pp-record__table td.c { text-align: center; }
.pp-record__player { max-width: 200px; }
.pp-record__player a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pp-record__eq { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .pp-records { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pp-head h1 { font-size: 22px; }
  .pp-head-card__shield, .pp-head-card__shield .shield { height: 52px; width: 52px; }
  .pp-score__n { font-size: 38px; }
  .pp-score__line { gap: var(--sp-3); }
  .pp-stats .stat-card__big { font-size: 19px; }
}

/* MVP del partido en la lista de enfrentamientos */
.pp-mvp { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pp-mvp a { color: var(--ink); font-weight: 600; }
.pp-mvp a:hover { color: var(--accent-deep); }
.pp-mvp__val {
  font-family: var(--score); font-weight: 700; font-size: 12px;
  color: var(--accent-deep); font-variant-numeric: tabular-nums; margin-left: 2px;
}
