/* ============================================================
   smgr · css/pages/viz_clasificacion_tl.css — DISEÑO de las DOS tarjetas
   capturables de "Clasificación hipotética: TL al promedio"
   (visualizacion_clasificacion_tl.php). Portado 1:1 del clásico.

   MULTI-CAPTURA: hay dos targets (#captureStandings y #captureFlipped), no
   #captureArea, así que el reset scopeado de viz.css no los cubre → aquí se
   replica ese reset bajo AMBOS ids (margin/padding/box-sizing + normalización
   de img/line-height que el chrome "Foco" impone globalmente). Todo el diseño
   de tarjeta va scopeado bajo esos ids; sólo los helpers de maquetación
   (.viz-capbar / .viz-scroll), fuera de las tarjetas, van sin scope.
   ============================================================ */

/* ---------- Maquetación fuera de las tarjetas (chrome Foco) ---------- */
.viz-capbar { display: flex; justify-content: flex-end; margin-top: var(--sp-5); }
.viz-scroll { margin-top: var(--sp-3); overflow-x: auto; }

/* ---------- Reset scopeado (equivalente al de viz.css para #captureArea) ---------- */
#captureStandings, #captureStandings *,
#captureFlipped, #captureFlipped * { margin: 0; padding: 0; box-sizing: border-box; }
#captureStandings, #captureFlipped { line-height: normal; color: #1a202c; }
#captureStandings img, #captureFlipped img { display: inline; max-width: none; vertical-align: baseline; }
#captureStandings h1, #captureFlipped h1 { letter-spacing: normal; }

/* ---------- Contenedores de tarjeta ---------- */
#captureStandings, #captureFlipped {
  font-family: 'Inter', sans-serif;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.1);
  overflow: hidden;
}
.vc-standings { width: 1024px; }
.vc-flipped   { width: 820px; }

/* ---------- Cabecera (ambas) ---------- */
#captureStandings .header, #captureFlipped .header {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
  color: #fff;
  padding: 10px 18px;
  text-align: center;
  position: relative;
}
#captureStandings .header::before, #captureFlipped .header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><rect width="100" height="100" fill="%23000" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}
#captureStandings .logo-section, #captureFlipped .logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
#captureStandings .header h1, #captureFlipped .header h1 { font-size: 22px; font-weight: 800; margin: 0; position: relative; z-index: 1; line-height: 1.15; }
#captureStandings .header p, #captureFlipped .header p { font-size: 12px; opacity: 0.92; margin-top: 3px; position: relative; z-index: 1; }

/* ---------- Tarjeta A: intro + clasificación ---------- */
#captureStandings .intro {
  padding: 9px 18px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #2d3748;
  line-height: 1.45;
}
#captureStandings .intro b { color: #1a365d; }
#captureStandings .intro-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
#captureStandings .stat-pill {
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 5px;
  padding: 3px 9px;
  font-weight: 600;
  font-size: 12px;
}
#captureStandings .stat-pill .v { color: #2c5282; font-weight: 800; margin-right: 3px; }
#captureStandings .zone-legend {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #4a5568;
  margin-left: auto;
}
#captureStandings .zl-item { display: inline-flex; align-items: center; gap: 5px; }
#captureStandings .zl-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
#captureStandings .zl-top4 { background: #059669; }
#captureStandings .zl-playoff { background: #3b82f6; }
#captureStandings .zl-descenso { background: #ef4444; }

#captureStandings .content { padding: 8px 18px 4px; }

#captureStandings table.cls {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#captureStandings table.cls thead tr.grp th {
  background: #2d3748;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 6px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.12);
}
#captureStandings table.cls thead tr.grp th:last-child { border-right: none; }
#captureStandings table.cls thead tr.grp th.team-col { text-align: left; padding-left: 12px; }
#captureStandings table.cls thead tr.sub th {
  background: #4a5568;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 4px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
}
#captureStandings table.cls thead tr.sub th:last-child { border-right: none; }
#captureStandings table.cls tbody td {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid #edf2f7;
  font-weight: 600;
}
#captureStandings table.cls tbody tr:nth-child(even) { background: #f8fafc; }
#captureStandings table.cls tbody td.team-col { text-align: left; padding-left: 12px; font-weight: 700; }

#captureStandings .team-info { display: flex; align-items: center; gap: 8px; }
#captureStandings .team-shield { width: 24px; height: auto; display: block; }
#captureStandings .team-code { font-weight: 700; font-size: 14px; color: #2d3748; letter-spacing: 0.3px; }

#captureStandings td.sep, #captureStandings th.sep { border-right: 1px dashed #cbd5e0; }

#captureStandings .diff-pos.up, #captureStandings .diff-pg.up {
  background: rgba(5, 150, 105, 0.18);
  color: #065f46;
  border-radius: 5px;
  font-weight: 700;
}
#captureStandings .diff-pos.down, #captureStandings .diff-pg.down {
  background: rgba(220, 80, 80, 0.16);
  color: #991b1b;
  border-radius: 5px;
  font-weight: 700;
}
#captureStandings .diff-pos.zero, #captureStandings .diff-pg.zero { color: #94a3b8; font-weight: 500; }
#captureStandings .pad-cell { padding: 4px 4px; }

#captureStandings table.cls tbody tr.row-top4 td.team-col { box-shadow: inset 4px 0 0 #059669; }
#captureStandings table.cls tbody tr.row-playoff td.team-col { box-shadow: inset 4px 0 0 #3b82f6; }
#captureStandings table.cls tbody tr.row-descenso td.team-col { box-shadow: inset 4px 0 0 #ef4444; }
#captureStandings td.pos-top4 { color: #059669; font-weight: 800; }
#captureStandings td.pos-playoff { color: #1e40af; font-weight: 800; }
#captureStandings td.pos-descenso { color: #b91c1c; font-weight: 800; }

/* ---------- Tarjeta B: partidos que cambian ---------- */
#captureFlipped .flipped-list { padding: 6px 22px 4px; }
#captureFlipped .flipped-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid #edf2f7;
}
#captureFlipped .flipped-row:last-child { border-bottom: none; }
#captureFlipped .flipped-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }
#captureFlipped .flipped-row .jor { color: #4a5568; font-size: 13px; font-weight: 800; min-width: 36px; }
#captureFlipped .flipped-row .matchup {
  color: #2d3748;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
#captureFlipped .flipped-row .small-shield { width: 22px; height: auto; display: block; }
#captureFlipped .flipped-row .real-score { color: #6b7280; font-size: 14px; font-weight: 600; }
#captureFlipped .flipped-row .arrow { color: #94a3b8; margin: 0 3px; font-size: 16px; }
#captureFlipped .flipped-row .hyp-score { color: #1a365d; font-weight: 800; font-size: 16px; }
#captureFlipped .flipped-row .strike { text-decoration: line-through; opacity: 0.6; }
#captureFlipped .flipped-ft {
  margin-left: 44px;
  font-size: 12.5px;
  color: #6b7280;
  font-weight: 600;
}
#captureFlipped .flipped-ft .ft-team { color: #4a5568; font-weight: 700; }
#captureFlipped .flipped-ft .ft-bad { color: #b91c1c; font-weight: 800; }
#captureFlipped .flipped-ft .ft-sep { color: #cbd5e0; margin: 0 8px; }

/* ---------- Pie (ambas) ---------- */
#captureStandings .footer, #captureFlipped .footer {
  background: #2d3748;
  color: #fff;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
}
#captureStandings .social-links, #captureFlipped .social-links { margin-top: 3px; font-size: 11px; opacity: 0.9; }
#captureStandings .social-links span, #captureFlipped .social-links span { margin: 0 8px; }
