/* ============================================================
   smgr · css/pages/viz_dificultad_posicion.css — DISEÑO DE LA TARJETA
   capturable de "Calendario de dificultad por posición"
   (visualizacion_dificultad_posicion.php). Portado 1:1 del clásico, con TODO
   scopeado bajo #captureArea. Tarjeta blanca con pestañas internas + heatmap.
   Ancho natural 900px. 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: 900px;
}
#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 .logo {
  width: 70px;
  height: 53px;
  background: #fff;
  border-radius: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  overflow: hidden;
}
#captureArea .logo img { width: 100%; height: 100%; object-fit: contain; }
#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; }

/* ---------- Pestañas de posición ---------- */
#captureArea .pos-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  background: #f7fafc;
  border-bottom: 2px solid #e2e8f0;
}
#captureArea .pos-tab {
  padding: 10px 36px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #718096;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
#captureArea .pos-tab:hover { color: #2d3748; background: rgba(0,0,0,0.03); }
#captureArea .pos-tab.active { color: #2c5282; background: #fff; }
#captureArea .pos-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #2c5282;
  border-radius: 3px 3px 0 0;
}

/* ---------- Paneles ---------- */
#captureArea .pos-panel { display: none; }
#captureArea .pos-panel.active { display: block; }

/* ---------- Tabla ---------- */
#captureArea table { width: 100%; border-collapse: collapse; font-size: 12px; }
#captureArea thead th {
  background: #2d3748;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 8px 6px;
  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: 10px; width: 90px; }
#captureArea thead th.col-media { background: #1a365d; }
#captureArea tbody td {
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
}
#captureArea tbody td:last-child { border-right: none; }
#captureArea tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }

/* ---------- Rank ---------- */
#captureArea .rank { font-weight: 700; font-size: 11px; color: #718096; width: 28px; padding: 8px 4px !important; }

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

/* ---------- Celda de calendario ---------- */
#captureArea .sched-cell { padding: 6px 8px !important; }
#captureArea .sched-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#captureArea .sched-rival { display: flex; align-items: center; gap: 4px; }
#captureArea .sched-shield { width: 16px; height: 19px; object-fit: contain; border-radius: 2px; }
#captureArea .sched-code { font-weight: 700; font-size: 11px; color: #2d3748; }
#captureArea .casa-icon { flex-shrink: 0; opacity: 0.8; }
#captureArea .sched-perm {
  font-weight: 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 55px;
  text-align: center;
}

/* ---------- Celda de media ---------- */
#captureArea .media-val {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* ---------- 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-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; }
