/* ============================================================
   copas-inter.css  v2 — Fichas de partido estilo tradicional
   con identidad Libertadores (dorado/negro) y Sudamericana (azul/plata)
   ============================================================ */

:root {
  --lib-gold:        #d4af37;
  --lib-gold-lt:     #f0d060;
  --lib-bg:          #0d0a00;
  --lib-border:      rgba(212,175,55,0.28);
  --lib-glow:        rgba(212,175,55,0.22);

  --sud-blue:        #1565c0;
  --sud-blue-lt:     #90caf9;
  --sud-silver:      #c8c8d8;
  --sud-bg:          #03061a;
  --sud-border:      rgba(144,202,249,0.26);
  --sud-glow:        rgba(66,165,245,0.22);
}

/* ── HERO ── */
.ci-hero {
  position: relative;
  padding: 110px 24px 60px;
  text-align: center;
  overflow: hidden;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(212,175,55,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 50%, rgba(21,101,192,0.10) 0%, transparent 55%);
  pointer-events: none;
}
.ci-hero-stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ci-star {
  position: absolute; width: 2px; height: 2px;
  background: #fff; border-radius: 50%;
  animation: twinkle var(--dur,3s) ease-in-out infinite;
  animation-delay: var(--delay,0s); opacity: 0.3;
}
@keyframes twinkle {
  0%,100% { opacity:.1; transform:scale(1); }
  50%      { opacity:.9; transform:scale(1.8); }
}
.ci-hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.ci-hero-badges {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.ci-badge-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: .04em;
}
.ci-badge-pill img { width: 22px; height: 22px; object-fit: contain; }
.ci-badge-pill.lib { background: rgba(212,175,55,.10); border:1px solid rgba(212,175,55,.35); color:var(--lib-gold-lt); }
.ci-badge-pill.sud { background: rgba(21,101,192,.10); border:1px solid rgba(144,202,249,.35); color:var(--sud-blue-lt); }
.ci-badge-sep { color: var(--text-muted); font-size: 1.2rem; }

.ci-hero-title {
  font-family: 'Playfair Display','Georgia',serif;
  font-size: clamp(2.2rem,6vw,3.8rem);
  font-weight: 900; color: #fff;
  line-height: 1.1; margin-bottom: 12px;
}
.ci-title-gold {
  background: linear-gradient(135deg, var(--lib-gold) 0%, var(--lib-gold-lt) 50%, var(--lib-gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ci-hero-subtitle { font-size: 1rem; color: var(--text-secondary); }

/* ── LAYOUT ── */
.ci-main {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px 80px;
  display: flex; flex-direction: column; gap: 48px;
}

/* ── SECCIÓN ── */
.ci-section { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }

.ci-section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 24px; gap: 12px;
}
.libertadores-header {
  background: linear-gradient(135deg,#110d00,#1c1400);
  border-bottom: 1px solid var(--lib-border);
}
.sudamericana-header {
  background: linear-gradient(135deg,#020612,#070f25);
  border-bottom: 1px solid var(--sud-border);
}
.ci-section-title-wrap { display: flex; align-items: center; gap: 12px; }
.ci-section-logo { width: 36px; height: 36px; object-fit: contain; }
.libertadores-header .ci-section-logo { filter: drop-shadow(0 0 8px var(--lib-glow)); }
.sudamericana-header .ci-section-logo { filter: drop-shadow(0 0 8px var(--sud-glow)); }
.ci-section-title {
  font-size: 1.1rem; font-weight: 800;
  font-style: italic; letter-spacing: .02em;
}
.libertadores-title { color: var(--lib-gold-lt); }
.sudamericana-title { color: var(--sud-blue-lt); }
.ci-section-badge {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 12px; border-radius: 999px; letter-spacing: .06em;
}
.ci-badge-lib { background:rgba(212,175,55,.10); border:1px solid rgba(212,175,55,.3); color:var(--lib-gold); }
.ci-badge-sud { background:rgba(144,202,249,.10); border:1px solid rgba(144,202,249,.3); color:var(--sud-blue-lt); }

/* ── GRID DE EQUIPOS (ahora lista vertical de paneles) ── */
.ci-teams-grid {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

/* ── BLOQUE HORIZONTAL POR EQUIPO ── */
.ctp-block {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ctp-block:last-child { border-bottom: none; }

/* Panel izquierdo: escudo + nombre + posición */
.ctp-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 14px 16px;
  min-width: 130px;
  width: 130px;
  flex-shrink: 0;
  text-align: center;
  border-right: 1px solid var(--border);
}
.ctp-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.ctp-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  word-break: break-word;
}

.ctp-group {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: .8;
  margin-top: auto;
}

/* ── CONTENEDOR DERECHO (TABS) ── */
.ctp-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 14px 10px;
  min-width: 0;
  overflow: hidden;
}

/* Cabeceras interactivas */
.ctp-right-headers {
  display: flex;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.ctp-header-table, .ctp-header-fixture {
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}
.show-table .ctp-header-table { display: flex; }
.show-fixture .ctp-header-fixture { display: flex; }

.ci-dots {
  display: flex;
  gap: 6px;
}
.ci-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
}
.ci-dot.active { background: var(--text-primary); opacity: 1; }

/* Contenedor de paneles */
.ctp-panes {
  position: relative;
  border-radius: 12px;
  padding: 8px;
  min-height: 140px;
}
.ctp-panes.lib {
  background: rgba(40,40,40,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.ctp-panes.sud {
  background: rgba(40,40,40,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.ctp-pane { display: none; }
.show-table .ctp-pane-table { display: block; animation: ciFadeIn .2s ease; }
.show-fixture .ctp-pane-fixture {
  display: flex; flex-direction: column; gap: 4px;
  animation: ciFadeIn .2s ease;
}
@keyframes ciFadeIn { from { opacity:0; transform:translateY(2px); } to { opacity:1; transform:translateY(0); } }

/* ── TABLA DE POSICIONES ── */
.ctp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  color: var(--text-primary);
}
.ctp-table th {
  text-align: center;
  padding: 6px 4px 10px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ctp-table th.ctp-col-club { text-align: left; padding-left: 8px; }
.ctp-table th:last-child { color: var(--text-primary); font-weight: 800; }

.ctp-table td {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.ctp-table tr:last-child td { border-bottom: none; }
.ctp-col-club {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left !important;
}
.ctp-td-pos { width: 14px; text-align: center; color: var(--text-muted); font-weight: 700; }
.ctp-col-club img { width: 20px; height: 20px; object-fit: contain; }
.ctp-td-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.ctp-td-pts { font-weight: 800; color: var(--text-primary); }

.ctp-row-self {
  background: var(--border);
}
.lib .ctp-row-self td:first-child { border-left: 3px solid var(--lib-gold); }
.sud .ctp-row-self td:first-child { border-left: 3px solid var(--sud-blue-lt); }

/* ── FILA COMPACTA DE PARTIDO ── */

.cpr-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .14s ease, transform .14s ease;
  position: relative;
  overflow: hidden;
}
.cpr-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1.5px;
}
.cpr-row.lib {
  background: linear-gradient(160deg,rgba(28,20,0,.7) 0%,rgba(14,9,0,.7) 100%);
  border: 1px solid var(--lib-border);
}
.cpr-row.lib::before { background: linear-gradient(90deg,transparent,var(--lib-gold),transparent); }
.cpr-row.lib:hover { background: rgba(212,175,55,.08); border-color: var(--lib-gold); }

.cpr-row.sud {
  background: linear-gradient(160deg,rgba(6,13,34,.7) 0%,rgba(3,6,20,.7) 100%);
  border: 1px solid var(--sud-border);
}
.cpr-row.sud::before { background: linear-gradient(90deg,transparent,var(--sud-blue-lt),transparent); }
.cpr-row.sud:hover { background: rgba(144,202,249,.07); border-color: var(--sud-blue-lt); }

/* Equipo local */
.cpr-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cpr-team.home { justify-content: flex-end; text-align: right; }
.cpr-team.away { justify-content: flex-start; text-align: left; }
.cpr-team img {
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  object-fit: contain; border-radius: 3px;
  flex-shrink: 0;
}
.cpr-team span {
  font-size: 0.68rem; font-weight: 700;
  color: #f0f0f8; /* Fuerza color claro sobre fondo oscuro del gradiente */
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  width: 85px; /* Fijar ancho para alinear logos en columna vertical */
}
.cpr-team.home span { text-align: right; }
.cpr-team.away span { text-align: left; }

/* Centro: marcador / hora */
.cpr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 80px;
  text-align: center;
}
.cpr-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.lib .cpr-score { color: var(--lib-gold-lt); }
.sud .cpr-score { color: var(--sud-silver); }

.cpr-dash { color: rgba(255,255,255,0.6); font-weight: 400; font-size: .8rem; }
.cpr-win  { opacity: 1; }
.cpr-row .cpr-score span:not(.cpr-dash):not(.cpr-win) { opacity: .6; }

.cpr-date {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.7);
  display: block;
  white-space: nowrap;
  letter-spacing: .03em;
}
.cpr-time {
  font-size: 0.6rem;
  color: #fbbf24;
  display: block;
  font-weight: 700;
  white-space: nowrap;
}
.cpr-live {
  font-size: 0.6rem;
  color: #22c55e;
  font-weight: 800;
  display: block;
  white-space: nowrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .ctp-hide-mobile { display: none; }
  .ctp-left {
    min-width: 90px;
    width: 90px;
    padding: 10px 8px;
  }
  .ctp-logo { width: 36px; height: 36px; }
  .ctp-name { font-size: 0.62rem; }
  .ctp-group { font-size: 0.5rem; }
  .ctp-right { padding: 10px 10px 10px 6px; }
  .ctp-header-table, .ctp-header-fixture { font-size: 0.9rem; gap: 8px; }
  .ci-dot { width: 8px; height: 8px; }
  
  .ctp-table { font-size: 0.65rem; }
  .ctp-td-name { max-width: 70px; font-size: 0.6rem; }
  .ctp-col-club img { width: 16px; height: 16px; }
  .ctp-td-pos { width: 10px; }
  .ctp-table th, .ctp-table td { padding: 6px 2px; }

  .cpr-team span { width: 60px; font-size: 0.6rem; }
  .cpr-team img  { width: 18px; height: 18px; min-width: 18px; min-height: 18px; }
  .cpr-center { min-width: 56px; }
  .cpr-score { font-size: .78rem; }
  .ci-hero { padding: 95px 16px 44px; }
  .ci-main { padding: 0 14px 60px; }
  .ci-section-header { padding: 14px 16px; }
}


/* ── TARJETA DE PARTIDO (estilo ficha tradicional) ── */
.ci-card {
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.ci-card:last-child { margin-bottom: 0; }
.ci-card:hover { transform: translateY(-2px); }

/* Libertadores */
.ci-card.lib {
  background: linear-gradient(160deg, #1c1400 0%, #0e0900 100%);
  border: 1px solid var(--lib-border);
  box-shadow: 0 2px 10px rgba(212,175,55,.07);
}
.ci-card.lib:hover { border-color: var(--lib-gold); box-shadow: 0 4px 18px rgba(212,175,55,.18); }
.ci-card.lib::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--lib-gold), transparent);
}

/* Sudamericana */
.ci-card.sud {
  background: linear-gradient(160deg, #060d22 0%, #030614 100%);
  border: 1px solid var(--sud-border);
  box-shadow: 0 2px 10px rgba(66,165,245,.06);
}
.ci-card.sud:hover { border-color: var(--sud-blue-lt); box-shadow: 0 4px 18px rgba(66,165,245,.18); }
.ci-card.sud::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--sud-blue-lt), transparent);
}
/* Mini estrellas decorativas Sudamericana */
.ci-card.sud::after {
  content: '✦ ✦ ✦';
  position: absolute; top: 7px; right: 11px;
  font-size: .42rem; color: rgba(192,192,220,.25);
  letter-spacing: 3px; pointer-events: none;
}

/* Cabecera de la tarjeta */
.ci-card-top {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 7px 12px 5px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ci-card-stage {
  font-size: .61rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.lib .ci-card-stage { background:rgba(212,175,55,.10); color:var(--lib-gold); border:1px solid rgba(212,175,55,.2); }
.sud .ci-card-stage { background:rgba(144,202,249,.10); color:var(--sud-blue-lt); border:1px solid rgba(144,202,249,.2); }
.ci-card-date { font-size: .65rem; color: var(--text-muted); }
.ci-card-date.upcoming { color: #fbbf24; }

/* Cuerpo de la tarjeta */
.ci-card-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.ci-card-team {
  display: flex; flex-direction: column;
  align-items: center; gap: 5px; text-align: center;
}
.ci-card-team.right { /* misma estructura */ }
.ci-card-team img {
  width: 34px; height: 34px; object-fit: contain;
  border-radius: 5px;
}
.ci-card-team span {
  font-size: .75rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.2;
  max-width: 80px; word-break: break-word;
}

/* Marcador central */
.ci-score-cell {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  min-width: 64px;
}
.ci-score-cell.played {
  flex-direction: row; gap: 4px;
  justify-content: center;
}
.ci-score-num {
  font-size: 1.15rem; font-weight: 900;
  color: var(--text-primary);
}
.lib .ci-score-num { color: var(--lib-gold-lt); }
.sud .ci-score-num { color: var(--sud-silver); }
.ci-score-num.win { opacity: 1; }
.ci-score-dash {
  font-size: 1rem; font-weight: 700;
  color: var(--text-muted); margin: 0 2px;
}
.ci-score-vs {
  font-size: .7rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: .04em;
}
.ci-score-time {
  font-size: .7rem; color: var(--text-muted); font-weight: 500;
}
.ci-live-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: .65rem; font-weight: 700;
  color: #22c55e; padding: 2px 8px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 999px; letter-spacing: .04em;
}
.ci-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.35; transform:scale(.7); }
}

/* Estados vacíos / carga */
.ci-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px;
  color: var(--text-muted); font-size: .85rem;
  text-align: center; grid-column: 1/-1;
}
.ci-empty i { font-size: 2rem; opacity: .3; }
.ci-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 48px 20px;
  color: var(--text-muted); font-size: .85rem;
  grid-column: 1/-1;
}
.ci-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent;
  animation: spin .8s linear infinite;
}
.libertadores-spinner { border-top-color:var(--lib-gold); border-right-color:rgba(212,175,55,.3); }
.sudamericana-spinner { border-top-color:var(--sud-blue-lt); border-right-color:rgba(144,202,249,.3); }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .ci-teams-grid { grid-template-columns: 1fr; }
  .ci-hero { padding: 95px 16px 44px; }
  .ci-main { padding: 0 14px 60px; }
  .ci-section-header { padding: 14px 16px; }
  .ci-team-block { padding: 16px; }
  .ci-card-team img { width: 28px; height: 28px; }
  .ci-card-team span { font-size: .7rem; max-width: 66px; }
}
