/* ═══════════════════════════════════════════════════════════════
   RESULTADOS — Calendario dinámico de partidos
   ═══════════════════════════════════════════════════════════════ */

.resultados-section {
  padding: 14px 12px 20px;
  border-top: 1px solid var(--border);
}

/* ── Header ─────────────────────────────────────────────────── */
.resultados-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.resultados-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.resultados-jornada {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(245,200,66,.07);
  border: 1px solid rgba(245,200,66,.15);
  padding: 2px 8px;
  border-radius: 3px;
}
.resultados-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.res-nav-btn {
  background: none;
  border: 1px solid rgba(245,200,66,.2);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.res-nav-btn:hover:not(:disabled) { color: var(--gold); border-color: rgba(245,200,66,.5); }
.res-nav-btn:disabled { opacity: .3; cursor: default; }
.resultados-refresh {
  margin-left: auto;
  font-size: 17px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
  user-select: none;
}
.resultados-refresh:hover { color: var(--gold); }
.resultados-refresh.spinning { animation: spin360 .6s linear; }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* ── Grid: 2 columnas en móvil, 5 en desktop ────────────────── */
.resultados-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 500px)  { .resultados-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px)  { .resultados-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1100px) { .resultados-grid { grid-template-columns: repeat(5, 1fr); } }

.resultados-loading,
.resultados-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
  letter-spacing: .05em;
}

/* ── Tarjeta — glass negro con toques dorados ───────────────── */
.res-card {
  position: relative;
  background: rgba(5,5,7,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245,200,66,.18);
  border-radius: 8px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
/* Brillo sutil en la esquina superior */
.res-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,200,66,.06) 0%, transparent 55%);
  pointer-events: none;
  border-radius: 8px;
}
.res-card:hover {
  border-color: rgba(245,200,66,.38);
  box-shadow: 0 0 14px rgba(245,200,66,.08);
}
.res-card--live {
  border-color: rgba(52,211,153,.4);
  box-shadow: 0 0 12px rgba(52,211,153,.1);
}
.res-card--live::before {
  background: linear-gradient(135deg, rgba(52,211,153,.06) 0%, transparent 55%);
}
.res-card--done { opacity: .82; }

/* Badge en juego */
.res-live-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52,211,153,.12);
  border: 1px solid rgba(52,211,153,.3);
  border-radius: 3px;
  padding: 1px 5px;
  margin-bottom: 6px;
}

/* ── Layout interno: local | marcador | visitante ───────────── */
.res-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}
.res-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

/* Logos */
.res-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.6));
}
.res-logo-fallback {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: rgba(245,200,66,.6);
  background: rgba(245,200,66,.05);
  border: 1px solid rgba(245,200,66,.15);
  border-radius: 50%;
}

/* Nombre */
.res-name {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(255,255,255,.75);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding: 0 2px;
}

/* Marcador / hora central */
.res-score {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .03em;
  text-align: center;
  flex: 0 0 auto;
  min-width: 46px;
  text-shadow: 0 0 10px rgba(245,200,66,.35);
}
.res-score--pending {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  letter-spacing: .04em;
  min-width: 36px;
  text-shadow: none;
}

/* Hora debajo (solo pendientes) */
.res-time {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  color: rgba(245,200,66,.5);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 6px;
  text-align: center;
}

/* ── Ajustes móvil pequeño ──────────────────────────────────── */
@media (max-width: 380px) {
  .res-logo            { width: 28px; height: 28px; }
  .res-score           { font-size: 16px; min-width: 38px; }
  .res-score--pending  { font-size: 9px; }
  .res-name            { font-size: 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   H2H MODAL
   ═══════════════════════════════════════════════════════════════ */

.h2h-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  z-index: 1100;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 8px 24px;
  overflow-y: auto;
}
.h2h-overlay.h2h-active { display: flex; }

.h2h-modal {
  position: relative;
  background: rgba(6,6,10,.92);
  border: 1px solid rgba(245,200,66,.22);
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  padding: 16px 12px 20px;
  box-shadow: 0 0 40px rgba(245,200,66,.07), 0 20px 60px rgba(0,0,0,.6);
}

/* Cierre */
.h2h-close {
  position: absolute;
  top: 10px; right: 12px;
  background: none; border: none;
  color: var(--muted); font-size: 16px;
  cursor: pointer; line-height: 1; padding: 4px;
  transition: color .15s;
}
.h2h-close:hover { color: var(--gold); }

/* Header equipos */
.h2h-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245,200,66,.12);
}
.h2h-team-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.h2h-team-header--away { }
.h2h-team-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.h2h-team-name {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.h2h-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.h2h-score {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(245,200,66,.3);
}
.h2h-date {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}

/* Campo */
.h2h-field-wrap {
  margin: 0 auto;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Cada mitad de campo con su propio aspect-ratio */
.h2h-field-wrap .h2h-field-half {
  aspect-ratio: 640 / 1000;
  max-width: 100%;
}
.h2h-field-wrap .pp-ali-field-front {
  overflow: visible;
}
.h2h-field-wrap .pp-ali-field-players {
  overflow: visible;
}
/* Nombres: más grandes y legibles */
.h2h-field-wrap .pp-ali-player-name {
  white-space: normal;
  word-break: break-word;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  line-height: 1.2;
  max-width: none;
  width: max-content;
  max-width: 90px;
}
.h2h-field-wrap .ali-info-bar {
  overflow: visible;
  width: max-content;
  max-width: 90px;
}

/* ── Barra de suplentes entre campos ───────────────────────── */
.h2h-bench-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0;
}
.h2h-bench-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,200,66,.07);
  border: 1px solid rgba(245,200,66,.22);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(245,200,66,.8);
  transition: background .15s, border-color .15s;
}
.h2h-bench-btn:hover {
  background: rgba(245,200,66,.14);
  border-color: rgba(245,200,66,.4);
}
.h2h-bench-btn-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ── Popup suplentes ────────────────────────────────────────── */
.h2h-bench-popup {
  background: rgba(6,6,10,.96);
  border: 1px solid rgba(245,200,66,.22);
  border-radius: 8px;
  padding: 10px 10px 12px;
  margin-top: 4px;
}
.h2h-bench-popup[hidden] { display: none; }
.h2h-bench-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.h2h-bench-popup-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245,200,66,.7);
}
.h2h-bench-popup-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  transition: color .15s;
}
.h2h-bench-popup-close:hover { color: var(--gold); }
.h2h-bench-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.h2h-bench-row .lm-bench-card {
  width: 44px;
  cursor: pointer;
}
.h2h-bench-row .lm-bench-name {
  font-size: 7px;
}

@media (max-width: 400px) {
  .h2h-modal { padding: 14px 8px 16px; }
  .h2h-team-name { font-size: 9px; max-width: 80px; }
  .h2h-score { font-size: 18px; }
}
