/* ============================================================
   smgr · css/pages/dificultad_calendario.css — DIFICULTAD DEL CALENDARIO
   Heatmap de permisividad por posición (próximas 5 jornadas). Skin "Foco":
   tabla base .table (cabecera --ink, zebra), chips de color por celda (el
   color de fondo/texto llega inline como valor DINÁMICO desde permColor()),
   e iconos casa/fuera en SVG. Captura con html2canvas (.capturing).
   Tokens en css/tokens.css; base en css/rincon.css.
   ============================================================ */

/* ---------- Cabecera de página ---------- */
.dc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-top: var(--sp-5); flex-wrap: wrap;
}
.dc-head h1 {
  font-family: var(--score); font-size: 26px; font-weight: 700;
  letter-spacing: .01em; color: var(--ink);
}
.dc-head .sub { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .dc-head h1 { font-size: 22px; } }

.dc-empty { margin-top: var(--sp-4); padding: var(--sp-5); text-align: center; color: var(--muted); }

/* ---------- Tabs de posición (usa .tabs de rincon.css) ---------- */
.tabs { margin-top: var(--sp-4); }

/* ---------- Área capturable ---------- */
.dc-capture { margin-top: var(--sp-3); overflow: hidden; }

/* Barra oscura superior con título + botón de captura */
.dc-bar { gap: var(--sp-3); }
.dc-bar h3 { flex: 1; }
.btn-screenshot {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 12px; padding: 4px 11px; border-radius: var(--r-pill);
  cursor: pointer; font-weight: 600; transition: background .2s;
}
.btn-screenshot:hover { background: rgba(255,255,255,.28); }
.btn-screenshot:disabled { cursor: default; opacity: .8; }

/* ---------- Tabla del heatmap ---------- */
.dc-table-wrap { overflow-x: auto; scrollbar-width: thin; }
.dc-table { min-width: 720px; }
.dc-table th { text-align: center; }
.dc-table th.r { text-align: center; }        /* cabeceras de jornada centradas */
.dc-table th.dc-team { text-align: left; }
.dc-table th.dc-media-th { background: var(--court-b); }

.dc-table td { padding: 0; vertical-align: middle; text-align: center; border-bottom: 1px solid var(--line); }
.dc-table tbody tr:nth-child(even) td { background: transparent; } /* el color lo dan las celdas */
.dc-table tbody tr:hover td { background: rgba(19,28,46,.03); }

/* Rank + equipo */
.dc-rank { width: 30px; font-weight: 700; color: var(--muted); font-size: 12px; padding: 6px 4px !important; }
.dc-team { text-align: left !important; padding: 6px 10px !important; min-width: 92px; }
.dc-team .team-tag { color: var(--ink); gap: 6px; }
.dc-team .team-tag:hover { color: var(--accent-deep); text-decoration: none; }
.dc-team .team-abbr { font-weight: 700; font-size: 13px; }

/* Celda de partido: rival (escudo + código + icono sede) y chip de permisividad */
.dc-cell { padding: 5px 8px !important; }
.dc-sched { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dc-rival { display: inline-flex; align-items: center; gap: 4px; }
.dc-rival .shield, .dc-rival .shield--sm { width: 16px; height: 16px; }
.dc-code { font-weight: 700; font-size: 11px; color: var(--ink); }
.dc-ha { flex-shrink: 0; }
.dc-ha--home { fill: var(--pos-b); }
.dc-ha--away { fill: var(--accent-deep); }
.dc-none { color: var(--line); }

/* Chip de porcentaje (fondo/color inline dinámico desde permColor) */
.dc-perm {
  font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 2px 6px; border-radius: 5px; min-width: 54px; text-align: center;
}

/* Columna MEDIA */
.dc-media { border-left: 1px dotted var(--line); }
.dc-media .dc-perm { min-width: 58px; font-size: 13px; }

@media (max-width: 640px) {
  .dc-table { font-size: 12px; }
  .dc-rival .shield, .dc-rival .shield--sm { display: none; }
  .dc-perm { min-width: 48px; padding: 2px 4px; }
}

/* ---------- Leyenda ---------- */
.dc-legend {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line); background: var(--ground);
}
.dc-legend__scale { display: flex; align-items: center; gap: 8px; }
.dc-legend__bar {
  display: inline-block; width: 140px; height: 12px; border-radius: 3px;
  background: linear-gradient(90deg,
    rgba(220,80,80,.53), rgba(220,80,80,.12) 35%,
    rgba(0,0,0,.03) 50%,
    rgba(5,150,105,.12) 65%, rgba(5,150,105,.53));
}
.dc-legend__lbl { font-size: 11px; font-weight: 700; }
.dc-legend__lbl--red { color: #991b1b; }
.dc-legend__lbl--green { color: #065f46; }
.dc-legend__note { margin: 0; font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .dc-legend__note { font-size: 10px; } }

/* ---------- Marca de agua (oculta salvo durante la captura) ---------- */
.dc-watermark {
  display: none; padding: 8px var(--sp-3);
  background: var(--ink); color: var(--muted-dark);
  font-size: 10px; text-align: center; border-top: 1px solid var(--line-dark);
}
.dc-watermark .wm-site { color: #fff; font-weight: 600; }
.dc-capture.capturing .dc-watermark { display: block; }
.dc-capture.capturing .btn-screenshot { display: none; }
