/* ============================================================
   PLAYOFFS DE ASCENSO — SF1 izquierda · SF2 derecha · Final centro
   ============================================================ */

/* ── Cabecera ── */
.po-header {
  text-align: center;
  padding: var(--space-10) var(--space-4) var(--space-6);
}
.po-header__title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 1rem + 4vw, 3.2rem);
  color: var(--color-primary);
  line-height: 1.1;
}

/* ── Hero de playoffs (fondo campo) ── */
.po-hero {
  min-height: 100dvh;
  align-items: flex-start !important;
  padding-bottom: var(--space-20) !important;
}
.po-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ── Wrapper con scroll horizontal en móvil ── */
.po-bracket-wrap {
  padding: 0 var(--space-4) var(--space-10);
  overflow-x: auto;
}

/* ── Bracket: columna de filas ── */
.po-bracket {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 560px;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Fila 1: las dos semis ── */
.po-row-semis {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-6);
  padding-bottom: var(--space-10);
}

/* ── Fila 2: final centrado ── */
.po-row-final {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: var(--space-8);
}

/* ── Fila 3: ganador centrado ── */
.po-row-winner {
  display: flex;
  justify-content: center;
}

/* ── Tarjeta de eliminatoria ── */
.po-tie {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  width: 260px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.po-tie--final { width: 280px; }

.po-tie__round {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-3);
}

/* ── Equipos: escudo grande + nombre abajo (Champions style) ── */
.po-tie__teams {
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
}
.po-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex: 1;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition), transform var(--transition);
}
a.po-team:hover { background: var(--color-surface-offset); transform: scale(1.05); }

.po-team__crest     { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.po-team__crest--ph { width: 52px; height: 52px; border-radius: 50%; background: var(--color-surface-offset); }
.po-team__name      { font-size: var(--text-xs); font-weight: 600; color: var(--color-text); text-align: center; line-height: 1.3; }
.po-team--winner .po-team__name { color: var(--color-primary); font-weight: 800; }
.po-team--tbd       { opacity: 0.45; }
.po-team--tbd .po-team__name { font-style: italic; }

/* Separador central entre los dos equipos */
.po-tie__vs {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding-top: var(--space-3);
  flex-shrink: 0; gap: var(--space-1); width: 36px;
}
.po-tie__agg      { font-family: var(--font-heading); font-weight: 900; font-size: var(--text-xl); color: var(--color-text); line-height: 1; }
.po-tie__vs-label { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); }

/* ── Resultados ida/vuelta ── */
.po-tie__legs {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.po-leg         { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-xs); gap: var(--space-2); }
.po-leg__label  { color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; width: 3.2rem; }
.po-leg__score  { font-family: var(--font-heading); font-weight: 800; color: var(--color-text); font-size: var(--text-sm); }
.po-leg__date   { color: var(--color-primary); font-weight: 600; text-align: right; white-space: nowrap; }
.po-leg--live .po-leg__label { color: var(--color-error); }
.po-leg--live   { animation: po-pulse 1.5s ease-in-out infinite; }
@keyframes po-pulse { 50% { opacity: 0.6; } }

/* ── Ganador ── */
.po-winner {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-5) var(--space-8);
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(60,165,92,0.15);
  text-align: center;
}
.po-winner__label  { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary); }
.po-winner__team   { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-decoration: none; transition: transform 0.2s; }
a.po-winner__team:hover { transform: scale(1.06); }
.po-winner__crest  { width: 64px; height: 64px; object-fit: contain; }
.po-winner__name   { font-weight: 700; color: var(--color-text); font-size: var(--text-sm); }
.po-winner__ph     { width: 64px; height: 64px; border-radius: 50%; background: var(--color-surface-offset); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; opacity: 0.5; }

/* ── SVG de líneas ── */
.po-lines {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}

/* ── Estados ── */
.po-loading, .po-error {
  text-align: center; color: var(--color-text-muted); padding: var(--space-16) var(--space-4);
}

/* ── Responsive: columna única ── */
@media (max-width: 620px) {
  .po-bracket      { min-width: unset; }
  .po-row-semis    { flex-direction: column; align-items: center; gap: var(--space-5); padding-bottom: var(--space-6); }
  .po-tie          { width: 100%; max-width: 340px; }
  .po-tie--final   { width: 100%; max-width: 340px; }
  .po-lines        { display: none; }
}
