/* ============================================================
   smgr · css/pages/viz_ideales.css — DISEÑO DE LA TARJETA capturable
   de "Equipo ideal" (visualizacion_ideales.php). Portado 1:1 del
   smgr/visualizacion_ideales.php clásico, pero:
     · TODO va scopeado bajo #captureArea para no colisionar con el
       chrome "Foco" (rincon.css) ni al revés — patrón reutilizable para
       el resto de visualizaciones.
     · Sin `body { background }` ni reset global `*` (los aporta el chrome).
     · La barra de herramientas y el escalador móvil viven en viz.css.
   El ancho fijo (1024px) lo respeta el escalador (transform:scale).
   ============================================================ */

#captureArea {
  font-family: 'Inter', sans-serif;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  overflow: hidden;
  /* Ancho fijo; alto natural (tarjeta apaisada ~1:1, legible y sin recorte en
     el feed de X). El escalador móvil (viz.css) la reduce en pantallas estrechas. */
  width: 1024px;
}
#captureArea * { box-sizing: border-box; }

/* ---------- Cabecera de la tarjeta ---------- */
#captureArea .header {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
  color: #fff;
  padding: 10px;
  text-align: center;
  position: relative;
}
#captureArea .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>');
}
#captureArea .logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
#captureArea .logo {
  width: 91px;
  height: 69px;
  background: #fff;
  border-radius: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.3);
  overflow: hidden;
}
#captureArea .logo img { width: 100%; height: 100%; object-fit: contain; }
#captureArea .header h1 { font-size: 32px; font-weight: 800; margin: 0; position: relative; z-index: 1; }
#captureArea .header p { font-size: 16px; opacity: 0.9; margin-top: 5px; position: relative; z-index: 1; }

/* ---------- Cabecera de estadísticas ---------- */
#captureArea .stats-header {
  background: #f8f9fa;
  padding: 20px 30px;
  border-bottom: 2px solid #e9ecef;
}
#captureArea .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
#captureArea .stat-item {
  background: #fff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#captureArea .stat-value { font-size: 24px; font-weight: 700; color: #2d3748; display: block; }
#captureArea .stat-label { font-size: 12px; color: #718096; text-transform: uppercase; font-weight: 600; margin-top: 5px; }

/* ---------- Cabecera de tabla ---------- */
#captureArea .table-header {
  background: #2d3748;
  color: #fff;
  padding: 15px 15px;
  display: grid;
  grid-template-columns: 50px auto 120px 120px 80px 120px 80px 80px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  gap: 8px;
  text-align: center;
}

/* ---------- Filas de jugadores ---------- */
#captureArea .players-list { background: #fff; }
#captureArea .player-row {
  display: grid;
  grid-template-columns: 50px auto 120px 120px 80px 120px 80px 80px;
  align-items: center;
  padding: 5px 15px;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
  min-height: 60px;
}
#captureArea .players-list .player-row:last-child { border-bottom: 0; }
#captureArea .player-rank {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
#captureArea .player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
#captureArea .player-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a5568;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
#captureArea .player-avatar img { width: 100%; height: 100%; object-fit: cover; }
#captureArea .player-name-with-flag { position: relative; padding-left: 20px; }
#captureArea .nationality-flag-bg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 12px;
  border-radius: 2px;
}
#captureArea .player-details { min-width: 0; flex: 1; }
#captureArea .player-details h3 {
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#captureArea .player-stats { margin-top: 2px; font-size: 11px; color: #777; line-height: 1.2; }

/* ---------- Celdas de equipo / rival ---------- */
#captureArea .position-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff; }
#captureArea .value-column { font-weight: 600; font-size: 15px; color: #2d3748; text-align: center; }
#captureArea .team-column { display: flex; align-items: center; justify-content: center; }
#captureArea .rival-column { display: flex; align-items: center; justify-content: center; }

/* ---------- Variación de precio (broker) ----------
   Centrado vertical por line-height==height (NO por padding): html2canvas
   desplaza el texto hacia abajo cuando el centrado depende del padding.
   Regla general para pastillas de las visualizaciones. */
#captureArea .price-change {
  display: inline-block; height: 28px; line-height: 28px;
  padding: 0 10px; border-radius: 6px; font-weight: 600; font-size: 14px;
}
#captureArea .price-up { background: #c6f6d5; color: #22543d; }
/* Pastilla de "PRES." — mismo centrado robusto para el screenshot. */
#captureArea .pres-cell { text-align: center; }
#captureArea .pres-badge {
  display: inline-block; height: 26px; line-height: 26px; padding: 0 9px;
  border-radius: 6px; font-weight: 600; font-size: 12px;
  background: #e2e8f0; color: #4a5568;
}
#captureArea .price-down { background: #fed7d7; color: #742a2a; }
#captureArea .price-same { background: #e2e8f0; color: #4a5568; }

/* ---------- Pie de la tarjeta ---------- */
#captureArea .footer {
  background: #2d3748;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
}
#captureArea .social-links { margin-top: 10px; }
#captureArea .social-links span { margin: 0 10px; opacity: 0.8; }

/* ---------- Navegación de jornada (FUERA del captureArea, estilo Foco) ---------- */
.viz-jnav { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: var(--sp-4); }
.viz-jnav form { display: inline-flex; align-items: center; gap: 8px; }
.viz-jnav select {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--surface); color: var(--ink);
}
