/* ============================================================
   smgr · css/pages/viz_calendario_dificultad.css — DISEÑO DE LA TARJETA
   capturable de "Calendario de dificultad" (visualizacion_calendario_dificultad.php).
   Portado 1:1 del clásico, con TODO scopeado bajo #captureArea. Tarjeta blanca
   con heatmap: cada celda = rival + 3 barras (B/A/P) + columna MEDIA.
   Ancho natural 1000px. Sin reset global ni body{background}.
   ============================================================ */

#captureArea {
  font-family: 'Inter', sans-serif;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  overflow: hidden;
  width: 1000px;
}
#captureArea * { box-sizing: border-box; }

/* ---------- Cabecera ---------- */
#captureArea .header {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
  color: #fff;
  padding: 10px 20px;
  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;
  position: relative;
  z-index: 1;
}
#captureArea .header h1 { font-size: 22px; font-weight: 800; margin: 0; position: relative; z-index: 1; }
#captureArea .header p { font-size: 12px; opacity: 0.9; margin-top: 3px; position: relative; z-index: 1; }

/* ---------- Tabla ---------- */
#captureArea table { width: 100%; border-collapse: collapse; font-size: 11px; }
#captureArea thead th {
  background: #2d3748;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  padding: 6px 3px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}
#captureArea thead th:last-child { border-right: none; }
#captureArea thead th.col-team { text-align: left; padding-left: 6px; width: 75px; }
#captureArea thead th.col-media { background: #1a365d; }
#captureArea tbody td {
  padding: 3px 2px;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}
#captureArea tbody td:last-child { border-right: none; }
#captureArea tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }

/* ---------- Rank ---------- */
#captureArea .rank {
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: #718096;
  width: 28px;
  vertical-align: middle;
}

/* ---------- Celda de equipo ---------- */
#captureArea .team-cell { padding-left: 4px !important; vertical-align: middle !important; }
#captureArea .team-info { display: flex; align-items: center; gap: 4px; }
#captureArea .team-shield { width: 18px; height: 22px; object-fit: contain; border-radius: 2px; }
#captureArea .team-abbr { font-weight: 700; font-size: 11px; color: #2d3748; }

/* ---------- Celda de calendario ---------- */
#captureArea .cell-content { min-width: 95px; }
#captureArea .rival-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid #e2e8f0;
}
#captureArea .cell-shield { width: 14px; height: 17px; object-fit: contain; border-radius: 2px; }
#captureArea .rival-code { font-weight: 700; font-size: 10px; color: #2d3748; }
#captureArea .casa-icon { flex-shrink: 0; opacity: 0.8; }

/* ---------- Barras de posición ---------- */
#captureArea .bar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 4px;
  border-radius: 2px;
  margin: 0;
  min-height: 14px;
}
#captureArea .bar-label { font-weight: 800; font-size: 8px; width: 10px; text-align: center; opacity: 0.7; }
#captureArea .bar-value { font-weight: 700; font-size: 9px; font-variant-numeric: tabular-nums; }

/* ---------- Celda de media ---------- */
#captureArea .media-cell .bar-row { border: 1px solid rgba(0,0,0,0.06); }
#captureArea .media-overall {
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid #e2e8f0;
}

/* ---------- Leyenda ---------- */
#captureArea .legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 20px;
  font-size: 10px;
  color: #4a5568;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
}
#captureArea .legend-item { display: flex; align-items: center; gap: 6px; }
#captureArea .legend-gradient {
  width: 120px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(220,80,80,0.45), rgba(220,80,80,0.1) 35%, rgba(0,0,0,0.03) 50%, rgba(5,150,105,0.1) 65%, rgba(5,150,105,0.45));
}
#captureArea .legend-labels {
  display: flex;
  justify-content: space-between;
  width: 120px;
  font-size: 9px;
  font-weight: 600;
}
#captureArea .legend-label-red { color: #991b1b; }
#captureArea .legend-label-green { color: #065f46; }

/* ---------- Pie ---------- */
#captureArea .footer {
  background: #2d3748;
  color: rgba(255,255,255,0.7);
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}
#captureArea .footer span { display: inline-block; }
