/* ══════════════════════════════════════════
   NOCHE ELECTORAL — estilos (index.html enlaza este fichero después de simulator.css)
   1) Base heredada de simulator.css   2) Pantalla de aviso previa   3) Diseño de la Noche
   ══════════════════════════════════════════ */

/* ── 1) Base heredada de simulator.css ── */
/* ══════ NOCHE ELECTORAL ══════ */

@keyframes nochePulse{0%{box-shadow:0 0 0 0 rgba(239,68,68,.7);}70%{box-shadow:0 0 0 8px rgba(239,68,68,0);}100%{box-shadow:0 0 0 0 rgba(239,68,68,0);}}
#noche-overlay ::-webkit-scrollbar{width:4px;}
#noche-overlay ::-webkit-scrollbar-thumb{background:rgba(245,158,11,.3);border-radius:2px;}

/* ── NOCHE LIGHT MODE ── */
#noche-overlay.noche-light{ background:#ffffff !important; }
#noche-overlay.noche-light #noche-ticker-track span{ color:#1a1c22 !important; }
#noche-overlay.noche-light #noche-ticker-track b{ color:inherit; }

/* Light mode: table text */
#noche-overlay.noche-light b[style*="#e5e7eb"]{ color:#1a1c22 !important; }
#noche-overlay.noche-light td[style*="#6b7280"]{ color:#5a5f72 !important; }
/* Light mode: seat bars */
#noche-overlay.noche-light [style*="rgba(255,255,255,.06)"]{ background:rgba(0,0,0,.08) !important; }
/* Light: progress bar bg */
#noche-overlay.noche-light [style*="rgba(255,255,255,.05)"]{ background:rgba(0,0,0,.06) !important; }
/* Noche mode: dark tooltip skin */
#noche-overlay ~ #prov-tt, body.noche-active .prov-tt{
  background:#1a1d27 !important;
  border-color:rgba(245,158,11,.35) !important;
  color:#e8eaf0 !important;
}
#noche-overlay ~ #prov-tt .prov-tt-name, body.noche-active .prov-tt .prov-tt-name{ color:#f0f2f8 !important; }
#noche-overlay ~ #prov-tt .prov-tt-row, body.noche-active .prov-tt .prov-tt-row{ border-color:rgba(255,255,255,.08) !important; }

/* ── Pantalla de entrada de la Noche electoral ── */
#noche-aviso-overlay{ background:radial-gradient(900px 520px at 80% 0%, rgba(99,102,241,.22), transparent 60%), rgba(4,7,16,.86); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  overflow-y:auto; }   /* si la tarjeta no cabe, se desplaza en vez de cortarse (la tarjeta se centra con margin:auto) */
#noche-aviso-overlay .na-card{ width:100%; max-width:480px; margin:auto; flex-shrink:0; border-radius:20px; overflow:hidden; background:linear-gradient(180deg,#0f1733 0%,#0a0f22 100%);
  border:1px solid rgba(255,255,255,.10); box-shadow:0 30px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(245,158,11,.08); color:#e5e7eb; font-family:'DM Sans',sans-serif; }
#noche-aviso-overlay .na-hero{ display:flex; align-items:center; gap:14px; padding:18px 22px 16px; border-bottom:1px solid rgba(255,255,255,.07);
  background:radial-gradient(420px 200px at 100% 0%, rgba(245,158,11,.14), transparent 70%); box-shadow:inset 0 -2px 0 rgba(245,158,11,.5); }
#noche-aviso-overlay .na-hero-txt{ flex:1; min-width:0; }
#noche-aviso-overlay .na-live{ display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#ef4444; }
#noche-aviso-overlay .na-dot{ width:8px; height:8px; border-radius:50%; background:#ef4444; box-shadow:0 0 10px rgba(239,68,68,.8); animation:naPulse 1.4s ease-in-out infinite; }
#noche-aviso-overlay .na-title{ font:900 26px/1.05 'Outfit',sans-serif; color:#fff; margin:6px 0 4px; letter-spacing:-.01em; }
#noche-aviso-overlay .na-sub{ font-size:13px; color:rgba(255,255,255,.6); line-height:1.45; }
#noche-aviso-overlay .na-tv{ width:108px; flex-shrink:0; filter:drop-shadow(0 10px 22px rgba(0,0,0,.45)); }
#noche-aviso-overlay .na-blink{ animation:naPulse 1.4s ease-in-out infinite; }
@keyframes naPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.3; } }
#noche-aviso-overlay .na-body{ padding:16px 22px 20px; }
#noche-aviso-overlay .na-aviso{ display:flex; gap:12px; align-items:flex-start; padding:11px 14px; border-radius:14px; background:rgba(239,68,68,.07); border:1px solid rgba(239,68,68,.22);
  font-size:12px; line-height:1.55; color:#d1d5db; margin-bottom:14px; }
#noche-aviso-overlay .na-aviso svg{ flex-shrink:0; margin-top:2px; }
#noche-aviso-overlay .na-aviso-t{ display:block; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:#ef4444; margin-bottom:4px; }
#noche-aviso-overlay .na-margin{ padding:12px 14px; border-radius:14px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.07); margin-bottom:14px; }
#noche-aviso-overlay .na-margin-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
#noche-aviso-overlay .na-margin-row label{ font-size:12px; font-weight:700; color:#cbd5e1; }
#noche-aviso-overlay #noche-margin-val{ font:900 20px 'Outfit',sans-serif; color:#f59e0b; }
#noche-aviso-overlay #noche-margin-slider{ width:100%; accent-color:#f59e0b; cursor:pointer; }
#noche-aviso-overlay .na-margin-ends{ display:flex; justify-content:space-between; margin-top:4px; font-size:10.5px; color:#64748b; }
#noche-aviso-overlay .na-margin-help{ font-size:11px; color:#94a3b8; margin-top:8px; line-height:1.5; }
#noche-aviso-overlay .na-btns{ display:flex; gap:10px; }
#noche-aviso-overlay .na-mode{ display:none; margin:0 0 14px; padding:4px; gap:4px; border-radius:999px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); }
#noche-aviso-overlay.na-elige .na-mode{ display:flex; }
#noche-aviso-overlay .na-mode button{ flex:1; height:36px; border:0; border-radius:999px; background:transparent; color:#cbd5e1; font:700 13px 'DM Sans',sans-serif; cursor:pointer; }
#noche-aviso-overlay .na-mode button[aria-pressed="true"]{ background:#f59e0b; color:#111827; }
#noche-aviso-overlay .na-cancel{ flex:1; height:44px; border-radius:999px; background:transparent; border:1px solid rgba(255,255,255,.16); color:#cbd5e1; font:700 13.5px 'DM Sans',sans-serif; cursor:pointer; transition:background .15s; }
#noche-aviso-overlay .na-cancel:hover{ background:rgba(255,255,255,.06); }
#noche-aviso-overlay .na-go{ flex:2; height:44px; border-radius:999px; border:none; background:linear-gradient(135deg,#fbbf24,#f59e0b); color:#111827; font:900 14.5px 'Outfit',sans-serif;
  display:inline-flex; align-items:center; justify-content:center; gap:9px; cursor:pointer; box-shadow:0 10px 26px rgba(245,158,11,.4); transition:transform .15s, filter .15s; }
#noche-aviso-overlay .na-go:hover{ transform:translateY(-1px); filter:brightness(1.06); }
@media (max-width:560px){
  #noche-aviso-overlay{ padding:12px; }
  #noche-aviso-overlay .na-hero{ padding:16px 16px 14px; }
  #noche-aviso-overlay .na-title{ font-size:22px; }
  #noche-aviso-overlay .na-sub{ font-size:12px; }
  #noche-aviso-overlay .na-tv{ width:80px; }
  #noche-aviso-overlay .na-body{ padding:14px 16px 16px; }
  #noche-aviso-overlay .na-aviso{ font-size:11.5px; padding:10px 12px; }
  #noche-aviso-overlay .na-go{ flex:2.6; font-size:13px; gap:6px; white-space:nowrap; }
  #noche-aviso-overlay .na-cancel{ font-size:12.5px; }
}
/* Pantallas bajas (portátiles pequeños y móviles): fuera lo decorativo; se quedan aviso, margen, modo y botones */
@media (max-height:720px){
  #noche-aviso-overlay .na-tv, #noche-aviso-overlay .na-sub, #noche-aviso-overlay .na-margin-help{ display:none; }
  #noche-aviso-overlay .na-hero{ padding-top:14px; padding-bottom:12px; }
  #noche-aviso-overlay .na-title{ margin-bottom:0; }
}
@media (prefers-reduced-motion: reduce){ #noche-aviso-overlay .na-dot, #noche-aviso-overlay .na-blink{ animation:none; } }

/* ── 3) Diseño de la Noche ── */
/* ── "Conteo en curso": mientras no hay ningún dato escrutado ── */
#noche-overlay .noche-wait{ display:none; align-items:center; gap:14px; padding:16px 18px; border-radius:14px; margin:4px 0 14px; letter-spacing:normal; }
#noche-overlay.noche-empty .noche-wait{ display:flex; }
#noche-overlay.noche-empty #ntab-c-resultados table, #noche-overlay.noche-empty .noche-race{ display:none !important; }
#noche-overlay .noche-wait b{ display:block; font:800 15px 'Outfit',sans-serif; }
#noche-overlay .noche-wait span{ display:block; font-size:12px; margin-top:2px; }
#noche-overlay .nw-eq{ display:flex; align-items:flex-end; gap:3px; height:26px; flex-shrink:0; }
#noche-overlay .nw-eq i{ width:5px; border-radius:2px; background:#f59e0b; animation:nwEq 1s ease-in-out infinite; }
#noche-overlay .nw-eq i:nth-child(2){ animation-delay:.15s; } #noche-overlay .nw-eq i:nth-child(3){ animation-delay:.3s; } #noche-overlay .nw-eq i:nth-child(4){ animation-delay:.45s; }
@keyframes nwEq{ 0%,100%{ height:6px; opacity:.5; } 50%{ height:26px; opacity:1; } }
#noche-overlay #ntab-c-mapa .noche-wait{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:5; margin:0; box-shadow:0 18px 40px rgba(0,0,0,.35); }
#noche-overlay #ntab-c-mapa{ position:relative; padding:26px 4px 12px; }
#noche-overlay #noche-mapa-wrap{ width:100%; max-width:680px; margin:0 auto; position:relative; user-select:none; }
#noche-overlay #noche-mapa-svg{ width:100%; height:auto; display:block; cursor:default; border-radius:6px; }
#noche-overlay #noche-mapa-canarias, #noche-overlay #noche-mapa-ceuta{ position:absolute; bottom:2px; height:auto; border:1px solid rgba(255,255,255,.1); border-radius:10px; }
#noche-overlay #noche-mapa-canarias{ right:2px; width:30%; }
#noche-overlay #noche-mapa-ceuta{ right:calc(30% + 6px); width:13%; }
#noche-overlay.noche-light #noche-mapa-canarias, #noche-overlay.noche-light #noche-mapa-ceuta{ border-color:rgba(0,0,0,.12); }
#noche-overlay .nm-credit{ font-size:9px; color:#4b5563; text-align:right; padding:2px 2px 4px; max-width:680px; margin:0 auto; }
#noche-overlay .nm-credit a{ color:#f59e0b; text-decoration:none; }
#noche-overlay:not(.noche-light) .noche-wait{ background:rgba(245,158,11,.08); border:1px solid rgba(245,158,11,.25); color:#f3f4f6; }
#noche-overlay:not(.noche-light) .noche-wait span{ color:rgba(255,255,255,.55); }
#noche-overlay:not(.noche-light) #ntab-c-mapa .noche-wait{ background:#141b35; }
#noche-overlay.noche-light .noche-wait{ background:#fff7e8; border:1px solid rgba(217,119,6,.3); color:#111827; }
#noche-overlay.noche-light .noche-wait span{ color:#6b7280; }
@media (prefers-reduced-motion: reduce){ #noche-overlay .nw-eq i{ animation:none; height:16px; } }

/* ── Gráfico de columnas: los 5 con más escaños (todas las pantallas) ── */
#noche-overlay .noche-race{ position:relative; letter-spacing:normal; font-size:13px; }
#noche-overlay #noche-race-wrap{ position:relative; margin-bottom:12px; }
#noche-overlay .nc-col{ position:absolute; top:0; bottom:0; left:0; width:20%; padding:0 7px; box-sizing:border-box; display:flex; flex-direction:column; justify-content:flex-end; align-items:stretch;
  transition:transform .6s cubic-bezier(.2,.8,.2,1), opacity .4s ease; will-change:transform; z-index:1; }
#noche-overlay .nc-num{ font:900 20px/1 'Outfit',sans-serif; text-align:center; margin-bottom:6px; font-variant-numeric:tabular-nums; }
#noche-overlay .nc-bar{ height:0; border-radius:8px 8px 3px 3px; transition:height .6s cubic-bezier(.2,.8,.2,1), background .3s; box-shadow:0 8px 20px rgba(0,0,0,.25); }
#noche-overlay .nc-name{ margin-top:10px; font:800 13px 'DM Sans',sans-serif; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#noche-overlay .nc-pct{ font-size:12px; font-weight:700; text-align:center; margin-top:2px; font-variant-numeric:tabular-nums; }
#noche-overlay .nc-maj{ position:absolute; left:0; right:0; height:0; border-top:1.5px dashed; z-index:2; pointer-events:none; transition:bottom .6s cubic-bezier(.2,.8,.2,1); }
#noche-overlay .nc-maj span{ position:absolute; right:0; top:-18px; font-size:10.5px; font-weight:800; letter-spacing:.06em; }
#noche-overlay .nr-hdr{ font-size:11px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; color:#f59e0b; margin-bottom:22px; }
#noche-overlay:not(.noche-light) .nc-name{ color:#f3f4f6; }
#noche-overlay:not(.noche-light) .nc-pct{ color:rgba(255,255,255,.55); }
#noche-overlay:not(.noche-light) .nc-maj{ border-color:rgba(245,158,11,.75); }
#noche-overlay:not(.noche-light) .nc-maj span{ color:#f59e0b; }
#noche-overlay.noche-light .nc-name{ color:#111827; }
#noche-overlay.noche-light .nc-pct{ color:#6b7280; }
#noche-overlay.noche-light .nc-maj{ border-color:rgba(217,119,6,.8); }
#noche-overlay.noche-light .nc-maj span{ color:#b45309; }
#noche-overlay.noche-light .nc-bar{ box-shadow:0 6px 14px rgba(15,23,42,.12); }
/* Cambio de escaños: destello del número y de la columna + indicador ▲/▼ que sube y se desvanece */
#noche-overlay .nc-col{ --flash:rgba(255,255,255,.55); }
#noche-overlay .nc-delta{ position:relative; height:0; overflow:visible; top:-22px; text-align:center; font:900 12px/1 'Outfit',sans-serif; opacity:0; pointer-events:none; }
#noche-overlay .nc-num{ position:relative; }
@keyframes ncFlash{ 0%{ text-shadow:0 0 0 transparent; transform:scale(1); } 25%{ text-shadow:0 0 18px var(--flash); transform:scale(1.18); } 100%{ text-shadow:0 0 0 transparent; transform:scale(1); } }
@keyframes ncBarFlash{ 0%,100%{ filter:none; } 30%{ filter:brightness(1.35) saturate(1.1); } }
@keyframes ncDelta{ 0%{ opacity:0; transform:translateY(8px); } 20%{ opacity:.9; transform:translateY(0); } 75%{ opacity:.9; } 100%{ opacity:0; transform:translateY(-10px); } }
#noche-overlay .nc-col.nc-up .nc-num, #noche-overlay .nc-col.nc-down .nc-num{ animation:ncFlash .8s ease-out; }
#noche-overlay .nc-col.nc-up .nc-bar, #noche-overlay .nc-col.nc-down .nc-bar{ animation:ncBarFlash .8s ease-out; }
#noche-overlay .nc-col.nc-up .nc-delta, #noche-overlay .nc-col.nc-down .nc-delta{ animation:ncDelta 1.4s ease-out forwards; }
#noche-overlay .nc-col{ padding-top:18px; }
#noche-overlay.noche-light .nc-col{ --flash:rgba(245,158,11,.55); }
@media (prefers-reduced-motion: reduce){ #noche-overlay .nc-col, #noche-overlay .nc-bar, #noche-overlay .nc-maj{ transition:none; }
  #noche-overlay .nc-col.nc-up .nc-num, #noche-overlay .nc-col.nc-down .nc-num, #noche-overlay .nc-col.nc-up .nc-bar, #noche-overlay .nc-col.nc-down .nc-bar{ animation:none; } }
/* Conmutador Tabla | Barras (solo móvil) */
#noche-overlay .nr-toggle{ display:inline-flex; border-radius:999px; padding:3px; margin:0 0 12px; }
#noche-overlay .nr-toggle button{ border:0; background:none; padding:6px 16px; border-radius:999px; font:700 12px 'DM Sans',sans-serif; cursor:pointer; color:inherit; opacity:.6; }
#noche-overlay .nr-toggle button[aria-pressed="true"]{ background:#f59e0b; color:#111827; opacity:1; }
#noche-overlay:not(.noche-light) .nr-toggle{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); color:#e5e7eb; }
#noche-overlay.noche-light .nr-toggle{ background:#f3f4f6; border:1px solid rgba(15,23,42,.1); color:#374151; }
#noche-overlay .noche-race-m{ display:none; }
#noche-overlay #ntab-c-resultados.nr-barras .noche-race-m{ display:block; }
#noche-overlay #ntab-c-resultados.nr-barras table{ display:none !important; }

/* ── Pestañas y contenedores del panel principal ── */
#noche-overlay .noche-main{ flex:1; overflow:hidden; display:flex; flex-direction:column; }
#noche-overlay .noche-tabs-row{ display:flex; flex-shrink:0; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
#noche-overlay .noche-tabs-row::-webkit-scrollbar{ display:none; }
#noche-overlay .noche-tab-btn{ display:inline-flex; align-items:center; gap:7px; font:600 11px 'DM Sans',sans-serif; padding:8px 13px; border:none; border-bottom:2px solid transparent;
  background:transparent; color:#4b5563; cursor:pointer; transition:all .13s; white-space:nowrap; }
#noche-overlay .noche-tab-btn.is-on{ color:#f59e0b; border-bottom-color:#f59e0b; }
#noche-overlay .noche-tab-btn:hover{ color:#9ca3af; }
#noche-overlay.noche-light .noche-tab-btn{ color:#6b7280; }
#noche-overlay .noche-tab-btn .ntab-ic{ flex-shrink:0; opacity:.9; }
#noche-overlay #noche-content-wrapper{ flex:1; overflow:hidden; display:flex; }
#noche-overlay #noche-content-area{ flex:1; overflow-y:auto; padding:14px 12px 30px; }
#noche-overlay #noche-pactos-sidebar{ width:min(760px,45%); flex-shrink:0; overflow-y:auto; padding:12px 14px 30px; }
/* Un solo corte para toda la Noche: 900 px (en simulator.js, _nocheDesk()). Por debajo, sin panel lateral */
@media (max-width: 899px){ #noche-overlay #noche-pactos-sidebar{ display:none; } }
#noche-overlay #noche-live-dot[style*="font-size"]{ display:none !important; }
/* ══ Noche electoral · rediseño visual tipo televisión (solo CSS; no toca la lógica) ══
   1) Estilos comunes a ordenador y móvil (forma y colores de cada modo)  2) Distribución de ordenador  3) Ajustes de móvil */
  #noche-overlay  .noche-main{ border-radius:0 0 16px 16px; border-top:none; }
  #noche-overlay .nr-title{ font-size:11px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; margin-bottom:10px; }
  /* Menos densidad: partidos con escaño o ≥1 % y sin la columna de votos absolutos */

  /* ── Resto de pestañas (forma) ── */
  /* títulos de sección de cada pestaña */
  #noche-overlay .nsec-head{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
  #noche-overlay .nsec-title{ font-size:11px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; }
  #noche-overlay .nsec-sub{ font-size:12px; color:#4b5563; margin:5px 0 16px; }
  #noche-overlay .np-modes{ display:flex; gap:5px; }
  #noche-overlay .np-mode{ font:600 12px 'DM Sans',sans-serif; padding:6px 14px; border-radius:999px; cursor:pointer;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.05); color:#6b7280; }
  #noche-overlay .np-mode.is-on{ border-color:rgba(245,158,11,.4); background:rgba(245,158,11,.15); color:#f59e0b; }
  #noche-overlay.noche-light .np-mode:not(.is-on){ background:rgba(0,0,0,.06); }
  /* paneles */
  #noche-overlay .n-panel{ border-radius:16px; padding:18px 20px; box-sizing:border-box; }
  #noche-overlay #ntab-c-mapa::before{ content:"PARTIDO MÁS VOTADO POR PROVINCIA"; position:absolute; left:18px; top:4px; font:700 11px/1 'DM Sans',sans-serif; letter-spacing:.16em; }
  #noche-overlay #noche-mapa-svg{ filter:drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
  /* En juego: a todo el ancho y con más aire (_buildJuegoHTML lee estas variables; el simulador principal usa sus valores por defecto) */
  #noche-overlay #noche-juego-wrap{ --jg-gap:6px; }
  /* Evolución: leyenda en píldoras y cada gráfico en su panel */
  #noche-overlay #noche-evolucion-wrap{ position:relative; }
  #noche-overlay .nev-legend{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
  #noche-overlay .nev-key{ display:flex; align-items:center; gap:4px; padding:5px 12px; border-radius:999px; font-size:12px; font-weight:600; }
  #noche-overlay .nev-key span{ display:inline-block; width:14px; height:3px; border-radius:2px; flex-shrink:0; }
  #noche-overlay .nev-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
  #noche-overlay .nev-title{ font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:#4b5563; margin-bottom:4px; }
  #noche-overlay .nev-grid .nev-title{ font-size:11px; letter-spacing:.14em; }   /* ordenador: título dentro de cada panel */
  #noche-overlay .nev-chart{ position:relative; }
  #noche-overlay #noche-evolucion-wrap > .nev-chart:not(:last-child){ margin-bottom:20px; }   /* móvil: gráficas una debajo de otra */
  /* Por provincia: tabla con cabecera y primera columna fijas */
  #noche-overlay #noche-prov-table{ overflow:auto; padding:0; max-height:calc(100vh - 260px); }
  #noche-overlay .np{ width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
  #noche-overlay .np col{ width:55px; }
  #noche-overlay .np col.np-cp{ width:90px; }
  #noche-overlay .np col.np-ce{ width:40px; }
  #noche-overlay .np th{ position:sticky; top:0; z-index:2; padding:10px 6px; font-size:10.5px; font-weight:600; letter-spacing:.06em; text-align:right;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #noche-overlay .np th.np-prov{ text-align:left; left:0; z-index:3; font-weight:500; }
  #noche-overlay .np th.np-esc{ color:#f59e0b; overflow:visible; }
  #noche-overlay .np td{ padding:6px; text-align:right; font-size:10px; }
  #noche-overlay .np td.np-prov{ position:sticky; left:0; z-index:1; text-align:left; font-size:inherit; font-weight:500; border-left:2px solid; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #noche-overlay .np td.np-esc{ font-size:inherit; font-weight:700; color:#f59e0b; }
  #noche-overlay .np td.np-b{ font-weight:700; }
  /* Toques de directo */
  @keyframes nocheDotPulse{ 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.35; transform:scale(.8); } }
  #noche-overlay #noche-live-dot{ display:inline-block; animation:nocheDotPulse 1.4s ease-in-out infinite; }
  @keyframes nocheShine{ 0%{ transform:translateX(-120%); } 100%{ transform:translateX(320%); } }
  #noche-overlay #noche-progress-bar{ position:relative; overflow:hidden; }
  #noche-overlay #noche-progress-bar::after{ content:""; position:absolute; top:0; bottom:0; width:30%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent); animation:nocheShine 2.4s ease-in-out infinite; }
  @media (prefers-reduced-motion: reduce){ #noche-overlay #noche-live-dot, #noche-overlay #noche-progress-bar::after{ animation:none; } }

  /* ── COLORES · MODO OSCURO ── */
  #noche-overlay:not(.noche-light){ background:radial-gradient(900px 520px at 88% -8%, rgba(99,102,241,.22), transparent 62%),
      radial-gradient(700px 420px at -5% -10%, rgba(245,158,11,.10), transparent 60%),
      linear-gradient(180deg,#0b1430 0%,#080d1c 55%,#070b14 100%) !important; }
  #noche-overlay:not(.noche-light)::before{ content:""; position:fixed; inset:0; pointer-events:none; z-index:3;
      background:radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%), repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }
  #noche-overlay:not(.noche-light) .noche-tabs-row{ background:transparent; border-bottom:1px solid rgba(255,255,255,.06); }
  #noche-overlay:not(.noche-light)  .noche-main{ border:1px solid rgba(255,255,255,.08); border-top:none; background:rgba(8,12,26,.55); box-shadow:0 30px 80px rgba(0,0,0,.55); }
  #noche-overlay:not(.noche-light) .nr-title{ color:rgba(255,255,255,.45); }
  #noche-overlay:not(.noche-light) #noche-pactos-sidebar{ background:rgba(255,255,255,.025); border-left:1px solid rgba(255,255,255,.07); }

  #noche-overlay:not(.noche-light) .nsec-title, #noche-overlay:not(.noche-light) #ntab-c-mapa::before{ color:rgba(255,255,255,.5); }
  #noche-overlay:not(.noche-light) .n-panel{ background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.06); }
  #noche-overlay:not(.noche-light) #ntab-c-mapa{ background:radial-gradient(ellipse 60% 55% at 50% 50%, rgba(99,102,241,.14), transparent 70%); }
  #noche-overlay:not(.noche-light) #noche-mapa-canarias, #noche-overlay:not(.noche-light) #noche-mapa-ceuta{ background:rgba(255,255,255,.03); }
  #noche-overlay:not(.noche-light) .nev-key{ background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08); color:#d1d5db; }
  #noche-overlay:not(.noche-light) .np th{ background:#10172c; border-bottom:1.5px solid rgba(255,255,255,.1); }
  #noche-overlay:not(.noche-light) .np th.np-prov{ color:#6b7280; }
  #noche-overlay:not(.noche-light) .np tr{ border-bottom:1px solid rgba(255,255,255,.04); }
  #noche-overlay:not(.noche-light) .np td.np-prov{ background:#0d1326; color:#e5e7eb; }
  #noche-overlay:not(.noche-light) .np td.np-z{ color:#374151; }
  #noche-overlay:not(.noche-light) .np tbody tr:nth-child(even) td{ background-color:rgba(255,255,255,.02); }
  #noche-overlay:not(.noche-light) .np tbody tr:nth-child(even) td.np-prov{ background-color:#0f162b; }
  #noche-overlay:not(.noche-light) .np tbody tr:hover td{ background-color:rgba(255,255,255,.05); }

  /* ── COLORES · MODO CLARO ── */
  #noche-overlay.noche-light{ background:radial-gradient(900px 520px at 88% -8%, rgba(99,102,241,.10), transparent 62%),
      radial-gradient(700px 420px at -5% -10%, rgba(245,158,11,.10), transparent 60%),
      linear-gradient(180deg,#eef2f8 0%,#e7ecf4 100%) !important; }
  #noche-overlay.noche-light .noche-tabs-row{ background:#ffffff; border-bottom:1px solid rgba(15,23,42,.08); }
  #noche-overlay.noche-light  .noche-main{ border:1px solid rgba(15,23,42,.08); border-top:none; background:#ffffff; box-shadow:0 24px 60px rgba(15,23,42,.12); }
  #noche-overlay.noche-light .nr-title{ color:#6b7280; }
  #noche-overlay.noche-light #noche-pactos-sidebar{ background:#f8fafc; border-left:1px solid rgba(15,23,42,.08); }
  #noche-overlay.noche-light .nsec-title, #noche-overlay.noche-light #ntab-c-mapa::before{ color:#6b7280; }
  #noche-overlay.noche-light .n-panel{ background:#fbfcfe; border:1px solid rgba(15,23,42,.08); }
  #noche-overlay.noche-light #ntab-c-mapa{ background:radial-gradient(ellipse 60% 55% at 50% 50%, rgba(99,102,241,.08), transparent 70%); }
  #noche-overlay.noche-light #noche-mapa-svg{ filter:drop-shadow(0 14px 28px rgba(15,23,42,.15)); }
  #noche-overlay.noche-light .nev-key{ background:#fff; border:1px solid rgba(15,23,42,.10); color:#374151; }
  #noche-overlay.noche-light .np th{ background:#f3f5f9; border-bottom:1.5px solid rgba(0,0,0,.12); }
  #noche-overlay.noche-light .np th.np-prov{ color:#5a5f72; }
  #noche-overlay.noche-light .np tr{ border-bottom:1px solid rgba(0,0,0,.08); }
  #noche-overlay.noche-light .np td.np-prov{ background:#fbfcfe; color:#1a1c22; }
  #noche-overlay.noche-light .np td.np-z{ color:#9298ac; }
  #noche-overlay.noche-light .np tbody tr:nth-child(even) td{ background-color:rgba(15,23,42,.025); }
  #noche-overlay.noche-light .np tbody tr:nth-child(even) td.np-prov{ background-color:#f4f6fa; }
  #noche-overlay.noche-light .np tbody tr:hover td{ background-color:rgba(15,23,42,.05); }

/* ── Ordenador (≥ 900 px): pantalla con márgenes, rótulo arriba y controles en la línea del escrutinio ── */
@media (min-width: 900px) {
  /* Panel derecho: solo las barras. El hemiciclo y la calculadora de pactos van en la pestaña "Hemiciclo" */
  #noche-overlay .nr-toggle, #noche-overlay .noche-race-m{ display:none !important; }
  #noche-overlay #ntab-c-resultados.nr-barras table{ display:table !important; }
  #noche-overlay #ntab-c-pactos{ max-width:760px; margin:0 auto; }
  #noche-overlay #noche-hemi-seats text{ font-size:24px !important; font-family:'Outfit',sans-serif !important; font-weight:900 !important; }
  #noche-overlay #noche-coal-total{ font-size:32px !important; font-weight:900 !important; }
  #noche-overlay #noche-coal-toggle-btn{ border-radius:999px !important; padding:5px 12px !important; }
  #noche-overlay #noche-coal-parties{ display:flex !important; flex-wrap:wrap; gap:6px !important; justify-content:center; }
  #noche-overlay #noche-coal-parties > div{ border-radius:999px !important; padding:5px 11px !important; font-size:12px !important; gap:6px !important; border-width:1.5px !important; }
  #noche-overlay #noche-coal-parties > div > span:nth-child(2){ flex:none !important; font-weight:700; }

  /* ── FORMA ── */
  #noche-overlay:not(.noche-euro){ padding:80px clamp(24px,4vw,64px) 22px !important; }   /* arriba queda el hueco del rótulo ÚLTIMA HORA (el modo Eurovisión no lo usa) */
  #noche-overlay.noche-euro{ padding:22px clamp(24px,4vw,64px) 22px; }
  #noche-overlay .noche-tabs-row{ padding:0 16px; }
  #noche-overlay .noche-tab-btn{ font-size:13px; padding:13px 16px; }   /* el "televisor": pestañas + contenido */
  #noche-overlay #noche-content-area{ padding:26px 30px 40px; }
  #noche-overlay #noche-pactos-sidebar{ width:min(520px,36%); padding:24px 26px 40px; }
  /* Mapa: más grande, con foco de plató y sombra */
  #noche-overlay #ntab-c-mapa{ padding:34px 12px 16px; }
  #noche-overlay #noche-mapa-wrap{ max-width:min(940px, calc((100vh - 440px) * 1.46)); }
  #noche-overlay #noche-juego-wrap{ --jg-lbl:150px; }
  /* Por provincia: tabla legible, cabecera fija y filas alternas */
  #noche-overlay #noche-prov-table{ max-height:calc(100vh - 330px); }
}

/* ── Pantallas bajas (portátiles con escalado 125-150 %): parte superior más compacta ── */
@media (min-width: 900px) and (max-height: 820px) {
  #noche-overlay:not(.noche-euro){ padding-top:60px !important; padding-bottom:12px !important; }
  #noche-overlay.noche-euro{ padding-top:12px; padding-bottom:12px; }
  #noche-overlay .noche-tab-btn{ padding:9px 14px; }
  #noche-overlay #noche-content-area{ padding:16px 24px 24px; }
  #noche-overlay #noche-pactos-sidebar{ padding:16px 24px 20px; }
  #noche-overlay .nr-hdr{ margin-bottom:10px; }
  #noche-overlay #noche-mapa-wrap{ max-width:min(940px, calc((100vh - 300px) * 1.46)); }
}
/* ── Móvil (< 900 px): misma estética, adaptada a pantalla pequeña ── */
@media (max-width: 899px) {
  #noche-overlay .nc-col{ padding:0 4px; }
  #noche-overlay .nc-num{ font-size:16px; }
  #noche-overlay .nc-name{ font-size:11.5px; }
  #noche-overlay .nc-pct{ font-size:11px; }
  #noche-overlay .noche-tab-btn{ font-size:12px; padding:11px 12px; }
  #noche-overlay #noche-mapa-canarias, #noche-overlay #noche-mapa-ceuta{ border-radius:8px; }
  #noche-overlay #ntab-c-mapa::before{ left:8px; font-size:10px; }
  #noche-overlay #noche-juego-wrap{ padding:12px 10px; }
  /* Pestaña de pactos (solo móvil): mismas píldoras y cifras grandes */
  #noche-overlay #noche-hemi-seats text{ font-size:22px !important; font-family:'Outfit',sans-serif !important; font-weight:900 !important; }
  #noche-overlay #noche-coal-total{ font-size:30px !important; font-weight:900 !important; }
  #noche-overlay #noche-coal-badge{ font-size:11.5px !important; padding:5px 11px !important; }
  #noche-overlay #noche-coal-toggle-btn{ border-radius:999px !important; padding:5px 11px !important; }
  #noche-overlay #noche-coal-parties{ display:flex !important; flex-wrap:wrap; gap:6px !important; justify-content:center; }
  #noche-overlay #noche-coal-parties > div{ border-radius:999px !important; padding:5px 11px !important; font-size:12px !important; gap:6px !important; border-width:1.5px !important; }
  #noche-overlay #noche-coal-parties > div > span:nth-child(2){ flex:none !important; font-weight:700; }
}

/* ══ Cabecera, escrutinio y controles de la Noche electoral (estructura propia: sin posiciones calculadas) ══ */
#noche-overlay .nb{ position:relative; flex-shrink:0; padding:14px 26px; border-radius:16px 16px 0 0; }
#noche-overlay .nb-title{ font:800 12px 'Outfit',sans-serif; letter-spacing:.16em; text-transform:uppercase; margin-bottom:4px; }
#noche-overlay .nb-live{ display:flex; align-items:center; gap:6px; min-width:0; }
#noche-overlay #noche-live-label > span{ font-size:20px !important; letter-spacing:.06em !important; }   /* este texto lo escribe el simulador con estilos en línea */
#noche-overlay .ne{ display:flex; align-items:center; gap:24px; padding:16px 26px; flex-shrink:0; }
#noche-overlay .ne-main{ flex:1; min-width:0; }
#noche-overlay .ne-normal{ display:flex; align-items:center; gap:22px; }
#noche-overlay .ne-pct{ display:flex; align-items:baseline; gap:4px; flex:none; }
#noche-overlay #noche-pct-num{ font:900 44px/1 'Outfit',sans-serif; }
#noche-overlay .ne-sym{ font:700 18px 'Outfit',sans-serif; color:#d97706; }
#noche-overlay .ne-lbl{ font-size:12px; margin-left:4px; }
#noche-overlay .ne-track{ flex:1; height:10px; border-radius:999px; overflow:hidden; }
#noche-overlay #noche-progress-bar{ height:100%; border-radius:999px; background:linear-gradient(90deg,#c2410c,#d97706,#f59e0b,#fbbf24); transition:width .9s ease; box-shadow:0 0 18px rgba(245,158,11,.45); }
#noche-overlay #noche-titular{ position:relative; height:46px; overflow:hidden; border-radius:12px; }
#noche-overlay #noche-titular::before{ content:"ÚLTIMA HORA"; position:absolute; left:0; top:0; bottom:0; z-index:2; display:flex; align-items:center;
  padding:0 18px; background:linear-gradient(135deg,#ef4444,#b91c1c); color:#fff; font:900 13px/1 'Outfit',sans-serif; letter-spacing:.12em; border-radius:12px 0 0 12px; }
#noche-overlay #noche-titular::after{ content:"OBJETIVO 176"; position:absolute; right:0; top:0; bottom:0; z-index:2; display:flex; align-items:center;
  padding:0 18px; background:#0b1022; color:#fff; font:900 13px/1 'Outfit',sans-serif; letter-spacing:.1em; border-left:3px solid #f59e0b; border-radius:0 12px 12px 0; }
#noche-overlay #noche-ticker-track{ display:flex; align-items:center; position:absolute; left:0; top:0; height:100%; will-change:transform; font-size:14px; }
#noche-overlay #noche-ticker-track span{ font-size:14px !important; }   /* texto generado por el simulador con estilos en línea */
#noche-overlay .noche-ctrls{ display:flex; align-items:center; gap:8px; flex:none; }
#noche-overlay .noche-speed{ display:flex; align-items:center; gap:6px; height:40px; box-sizing:border-box; padding:0 8px 0 12px; border-radius:999px; }
#noche-overlay .noche-speed .ns-ic{ display:inline-flex; color:#9ca3af; }
#noche-overlay .noche-speed .ns-ic svg{ width:16px; height:16px; }
#noche-overlay .noche-speed button{ width:26px; height:26px; padding:0; border-radius:50%; cursor:pointer; font:700 15px/1 'DM Sans',sans-serif;
  background:rgba(245,158,11,.1); border:1px solid rgba(245,158,11,.25); color:#f59e0b; }
#noche-overlay .nc-btn{ width:42px; height:42px; padding:0; border-radius:50%; cursor:pointer; font-size:15px; line-height:1; transition:transform .15s, filter .15s;
  display:inline-flex; align-items:center; justify-content:center; }
#noche-overlay .nc-btn svg{ width:18px; height:18px; flex-shrink:0; }
#noche-overlay .nc-main svg{ width:20px; height:20px; }
#noche-overlay .nc-theme .ic-sun, #noche-overlay.noche-light .nc-theme .ic-moon{ display:none; }   /* oscuro: luna; claro: sol */
#noche-overlay.noche-light .nc-theme .ic-sun{ display:block; }
#noche-overlay .nc-btn:hover, #noche-overlay .nc-exit:hover{ transform:translateY(-1px); filter:brightness(1.12); }
#noche-overlay .nc-main{ width:48px; height:48px; font-size:17px; border:none; color:#111827; background:linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow:0 6px 18px rgba(245,158,11,.4); }
#noche-overlay .nc-ghost{ background:transparent; border:1.5px solid rgba(245,158,11,.55); color:#f59e0b; }
#noche-overlay .nc-exit{ height:40px; padding:0 18px; border-radius:999px; cursor:pointer; font:800 12.5px 'DM Sans',sans-serif; color:#ef4444;
  background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3); transition:transform .15s, filter .15s; }
/* colores por modo */
#noche-overlay:not(.noche-light) .nb{ background:rgba(9,14,32,.55); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  border:1px solid rgba(255,255,255,.08); border-bottom:none; box-shadow:inset 0 -2px 0 rgba(245,158,11,.55); }
#noche-overlay:not(.noche-light) .nb-title, #noche-overlay:not(.noche-light) .ne-lbl{ color:rgba(255,255,255,.5); }
#noche-overlay:not(.noche-light) .ne{ background:rgba(255,255,255,.025); border-left:1px solid rgba(255,255,255,.08); border-right:1px solid rgba(255,255,255,.08); }
#noche-overlay:not(.noche-light) #noche-pct-num{ color:#fff; text-shadow:0 0 28px rgba(245,158,11,.35); }
#noche-overlay:not(.noche-light) .ne-track{ background:rgba(255,255,255,.07); }
#noche-overlay:not(.noche-light) #noche-titular{ background:linear-gradient(90deg,#0f1733,#141d3d); border:1px solid rgba(255,255,255,.10); }
#noche-overlay:not(.noche-light) .nc-theme{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#e5e7eb; }
#noche-overlay:not(.noche-light) .noche-speed{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); }
#noche-overlay.noche-light .nb{ background:#ffffff; border:1px solid rgba(15,23,42,.08); border-bottom:none; box-shadow:inset 0 -2px 0 rgba(245,158,11,.7); }
#noche-overlay.noche-light .nb-title, #noche-overlay.noche-light .ne-lbl{ color:#6b7280; }
#noche-overlay.noche-light .ne{ background:#ffffff; border-left:1px solid rgba(15,23,42,.08); border-right:1px solid rgba(15,23,42,.08); }
#noche-overlay.noche-light #noche-pct-num{ color:#111827; }
#noche-overlay.noche-light .ne-track{ background:#e5e7eb; }
#noche-overlay.noche-light #noche-titular{ background:#f8fafc; border:1px solid rgba(15,23,42,.10); }
#noche-overlay.noche-light .nc-theme{ background:#f3f4f6; border:1px solid rgba(15,23,42,.12); color:#374151; }
#noche-overlay.noche-light .noche-speed{ background:#f3f4f6; border:1px solid rgba(15,23,42,.10); }
/* ordenador: el rótulo ÚLTIMA HORA va arriba del todo, fuera de la pantalla */
@media (min-width: 900px) {
  #noche-overlay #noche-titular{ position:fixed; top:18px; left:clamp(24px,4vw,64px); right:clamp(24px,4vw,64px); z-index:5; box-shadow:0 10px 30px rgba(0,0,0,.25); }
}
/* portátiles con poca altura */
@media (min-width: 900px) and (max-height: 820px) {
  #noche-overlay .nb{ padding:9px 26px; }
  #noche-overlay .nb-title{ font-size:10.5px; margin-bottom:2px; }
  #noche-overlay #noche-live-label > span{ font-size:16px !important; }
  #noche-overlay .ne{ padding:10px 26px; }
  #noche-overlay #noche-pct-num{ font-size:34px; }
  #noche-overlay .nc-main{ width:40px; height:40px; }
  #noche-overlay .nc-ghost, #noche-overlay .nc-theme{ width:36px; height:36px; }
  #noche-overlay .nc-exit, #noche-overlay .noche-speed{ height:34px; }
  #noche-overlay #noche-titular{ top:12px; height:38px; }
  #noche-overlay #noche-titular::before, #noche-overlay #noche-titular::after{ font-size:12px; padding:0 14px; }
}
/* móvil: estado arriba; debajo, % y controles en una fila, la barra y el rótulo */
@media (max-width: 899px) {
  #noche-overlay .nb{ padding:10px 14px; border-radius:0; }
  #noche-overlay .nb-title{ display:none; }
  #noche-overlay #noche-live-label > span{ font-size:15px !important; }
  #noche-overlay .ne{ display:grid; grid-template-columns:auto 1fr; grid-template-areas:"pct ctrls" "bar bar" "tick tick"; gap:8px 12px; padding:8px 14px 10px; }
  #noche-overlay .ne-main, #noche-overlay .ne-normal{ display:contents; }
  #noche-overlay .ne-pct{ grid-area:pct; }
  #noche-overlay .ne-track{ grid-area:bar; }
  #noche-overlay #noche-titular{ grid-area:tick; height:30px; }
  #noche-overlay #noche-escrutinio-fin{ grid-column:1 / -1; grid-row:2 / 4; }
  #noche-overlay .noche-ctrls{ grid-area:ctrls; justify-self:end; gap:6px; }
  #noche-overlay #noche-pct-num{ font-size:26px; }
  #noche-overlay .noche-speed{ display:none; }
  #noche-overlay .nc-main{ width:38px; height:38px; font-size:14px; }
  #noche-overlay .nc-ghost, #noche-overlay .nc-theme{ width:32px; height:32px; font-size:12px; }
  #noche-overlay .nc-exit{ width:32px; height:32px; padding:0; font-size:0; }
  #noche-overlay .nc-exit::before{ content:"✕"; font-size:14px; font-weight:800; }
  #noche-overlay .nc-btn svg{ width:15px; height:15px; }
  #noche-overlay .nc-main svg{ width:17px; height:17px; }
  #noche-overlay .nf-x{ display:none; }   /* botones finales: "Cargar", "Compartir", "Volver" */
  #noche-overlay .nf-btn{ height:34px; padding:0 12px; font-size:12px; }
  #noche-overlay #noche-titular::before{ padding:0 10px; font-size:10px; }
  #noche-overlay #noche-titular::after{ display:none; }
  #noche-overlay #noche-ticker-track, #noche-overlay #noche-ticker-track span{ font-size:12.5px !important; }
}

/* ══ Tabla de resultados de la Noche electoral (clases .nt-*; los colores de partido vienen en línea desde el simulador) ══ */
#noche-overlay .nt{ width:100%; border-collapse:separate; border-spacing:0; font-size:13px; border-radius:14px; overflow:hidden; }
#noche-overlay .nt th{ padding:11px 10px; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; }
#noche-overlay .nt td{ padding:7px 12px; }
#noche-overlay .nt tr[data-show="0"]{ display:none; }   /* solo partidos con escaño o con al menos el 1 % */
#noche-overlay .nt .nt-party{ text-align:left; }
#noche-overlay .nt-pname{ display:flex; align-items:center; gap:6px; }
#noche-overlay .nt-dot{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
#noche-overlay .nt-party b{ font-size:13px; }
#noche-overlay .nt .nt-votes{ display:none; }   /* votos absolutos: ocultos para reducir densidad */
#noche-overlay .nt .nt-pct, #noche-overlay .nt .nt-seats{ text-align:right; font-variant-numeric:tabular-nums; }
#noche-overlay .nt th.nt-bar{ min-width:70px; }
#noche-overlay .nt-track{ height:8px; border-radius:999px; overflow:hidden; }
#noche-overlay .nt-fill{ height:100%; border-radius:999px; }
#noche-overlay .nt .nt-dpp, #noche-overlay .nt .nt-dseat{ text-align:center; }
#noche-overlay .nt-up, #noche-overlay .nt-down{ font-size:10px; font-weight:700; }
#noche-overlay .nt-up{ color:#22c55e; }
#noche-overlay .nt-down{ color:#ef4444; }
#noche-overlay .nt-zero{ font-size:10px; }
#noche-overlay .nt .nt-sep{ width:1px; padding:0; }
#noche-overlay .nt td.nt-seats{ font:800 16px 'Outfit',sans-serif; }
#noche-overlay:not(.noche-light) .nt{ background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.06); }
#noche-overlay:not(.noche-light) .nt th{ background:rgba(255,255,255,.04); color:rgba(255,255,255,.45); border-bottom:1px solid rgba(255,255,255,.07); }
#noche-overlay:not(.noche-light) .nt tr:not(:last-child) td{ border-bottom:1px solid rgba(255,255,255,.045); }
#noche-overlay:not(.noche-light) .nt tr:hover td{ background:rgba(255,255,255,.035); }
#noche-overlay:not(.noche-light) .nt-party b{ color:#e5e7eb; }
#noche-overlay:not(.noche-light) .nt-pct{ color:#9ca3af; }
#noche-overlay:not(.noche-light) .nt-zero, #noche-overlay:not(.noche-light) .nt td.nt-seats{ color:#4b5563; }
#noche-overlay:not(.noche-light) .nt-track{ background:rgba(255,255,255,.06); }
#noche-overlay:not(.noche-light) .nt .nt-sep{ background:rgba(255,255,255,.06); }
#noche-overlay.noche-light .nt{ background:#fbfcfe; border:1px solid rgba(15,23,42,.08); }
#noche-overlay.noche-light .nt th{ background:#f3f5f9; color:#6b7280; border-bottom:1px solid rgba(15,23,42,.08); }
#noche-overlay.noche-light .nt tr:not(:last-child) td{ border-bottom:1px solid rgba(15,23,42,.05); }
#noche-overlay.noche-light .nt tr:hover td{ background:rgba(15,23,42,.03); }
#noche-overlay.noche-light .nt-party b{ color:#1a1c22; }
#noche-overlay.noche-light .nt-pct{ color:#5a5f72; }
#noche-overlay.noche-light .nt-zero, #noche-overlay.noche-light .nt td.nt-seats{ color:#9298ac; }
#noche-overlay.noche-light .nt-track{ background:rgba(0,0,0,.08); }
#noche-overlay.noche-light .nt .nt-sep{ background:rgba(15,23,42,.06); }
@media (min-width: 900px) and (max-height: 820px) { #noche-overlay .nt td{ padding:5px 12px; } }
@media (max-width: 899px) { #noche-overlay .nt td{ padding:7px 8px; } #noche-overlay .nt td.nt-seats{ font-size:15px; } }

/* ══ Modo Eurovisión (overlay con clase .noche-euro; lo rellena noche.js, funciones _euro…) ══ */
#noche-overlay #euro-stage, #noche-overlay .ne-euro{ display:none; }
#noche-overlay.noche-euro .noche-tabs-row, #noche-overlay.noche-euro #noche-content-wrapper,
#noche-overlay.noche-euro .ne-pct, #noche-overlay.noche-euro #noche-titular{ display:none; }
#noche-overlay.noche-euro .ne-euro{ display:flex; align-items:baseline; gap:4px; flex:none; }
#noche-overlay #euro-count{ font:900 44px/1 'Outfit',sans-serif; font-variant-numeric:tabular-nums; }
#noche-overlay.noche-euro #euro-stage{ display:flex; flex:1; min-height:0; overflow:hidden; }
#noche-overlay .eu-left{ flex:1; min-width:0; overflow-y:auto; padding:22px 26px 30px; }
#noche-overlay .eu-right{ width:min(460px,38%); flex-shrink:0; overflow-y:auto; padding:26px 26px 30px; display:flex; flex-direction:column; align-items:center; text-align:center; }

/* Barra de bloques */
#noche-overlay .eu-bloc{ margin-bottom:22px; }
#noche-overlay .eu-bl-top{ font-size:12px; text-align:center; margin-bottom:8px; }
#noche-overlay .eu-bl-bar{ position:relative; }
#noche-overlay .eu-bl-seg{ display:flex; height:28px; border-radius:999px; overflow:hidden; }
#noche-overlay .eu-bl-seg span{ min-width:0; display:flex; align-items:center; justify-content:center; overflow:hidden; }
#noche-overlay .eu-bl-seg em{ font:800 11.5px 'DM Sans',sans-serif; font-style:normal; color:#fff; white-space:nowrap; padding:0 6px; text-shadow:0 1px 2px rgba(0,0,0,.45); }
#noche-overlay .eu-bl-seg span.is-narrow em{ visibility:hidden; }   /* noche.js lo marca si el nombre no cabe en el tramo */
#noche-overlay .eu-bl-seg .eu-bl-pend{ flex:1; }
#noche-overlay .eu-bl-maj{ position:absolute; left:50%; top:-5px; bottom:-5px; width:0; border-left:2px dashed #f59e0b; }   /* mitad de los diputados asignados */

/* Marcador: filas con posición absoluta; noche.js las mueve con translateY (EURO_ROW = 44 px) */
#noche-overlay .eu-board{ position:relative; transition:height .3s; }
#noche-overlay .eu-row{ position:absolute; left:0; right:0; top:0; height:40px; box-sizing:border-box; padding:0 12px; border-radius:10px;
  display:flex; align-items:center; gap:10px; transition:transform .7s cubic-bezier(.2,.8,.2,1), background .4s; }
#noche-overlay .eu-pos{ width:20px; font:700 12px 'DM Sans',sans-serif; text-align:right; font-variant-numeric:tabular-nums; }
#noche-overlay .eu-chip{ width:5px; height:22px; border-radius:3px; flex-shrink:0; }
#noche-overlay .eu-pn{ flex:0 0 130px; font:800 14px 'DM Sans',sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#noche-overlay .eu-bar{ flex:1; height:8px; border-radius:999px; overflow:hidden; }
#noche-overlay .eu-bar i{ display:block; height:100%; width:0; border-radius:999px; transition:width .7s cubic-bezier(.2,.8,.2,1); }
#noche-overlay .eu-plus{ min-width:36px; text-align:right; font:900 13px 'Outfit',sans-serif; color:#22c55e; opacity:0; }
#noche-overlay .eu-plus.is-new{ animation:euPlus .35s ease-out forwards; }
@keyframes euPlus{ from{ opacity:0; transform:translateX(-8px); } to{ opacity:1; transform:none; } }   /* se queda visible hasta que vota la siguiente comunidad */
#noche-overlay .eu-num{ min-width:46px; padding:4px 0; border-radius:7px; text-align:center; font:900 18px/1 'Outfit',sans-serif; font-variant-numeric:tabular-nums; }
#noche-overlay .eu-row.is-last .eu-num, #noche-overlay .eu-row.is-win .eu-num{ background:#f59e0b; color:#111827; }   /* is-last: el último que ha recibido */
#noche-overlay .eu-win{ width:100%; display:flex; flex-direction:column; align-items:center; animation:euIn .6s ease-out; }

/* Panel derecho: quién reparte */
#noche-overlay .eu-wait{ margin:auto 0; font-size:13px; }
/* Final en autonómicas: sin resumen de mayorías (en móvil el panel se oculta, ver .eu-right.is-empty) */
#noche-overlay .eu-done{ margin:auto 0; display:flex; flex-direction:column; align-items:center; gap:10px; font:800 15px 'Outfit',sans-serif; animation:euIn .5s ease-out; }
#noche-overlay .eu-done svg{ width:34px; height:34px; padding:10px; border-radius:50%; color:#22c55e; background:rgba(34,197,94,.12); box-shadow:inset 0 0 0 1.5px rgba(34,197,94,.45); }
#noche-overlay:not(.noche-light) .eu-done{ color:rgba(255,255,255,.7); }
#noche-overlay.noche-light .eu-done{ color:#4b5563; }
#noche-overlay .eu-id{ display:flex; align-items:center; justify-content:center; gap:18px; margin-bottom:14px; animation:euIn .5s ease-out; }
#noche-overlay .eu-flag{ width:150px; aspect-ratio:3 / 2; object-fit:cover; border-radius:10px; box-shadow:0 10px 26px rgba(0,0,0,.35); }
#noche-overlay .eu-sil{ width:110px; height:100px; }
#noche-overlay .eu-sil path{ fill:rgba(245,158,11,.22); stroke:#f59e0b; stroke-width:1.2; vector-effect:non-scaling-stroke; }
#noche-overlay .eu-name{ font:900 30px/1.1 'Outfit',sans-serif; }
#noche-overlay .eu-sub{ font-size:13px; margin:4px 0 20px; }
/* Resumen final: posibles mayorías de bloques (barras sobre el total de la cámara, línea = mayoría) */
#noche-overlay .eu-sum{ width:100%; max-width:380px; margin-top:4px; text-align:left; display:flex; flex-direction:column; gap:12px; }
#noche-overlay .eu-sum-t{ font:800 15px 'Outfit',sans-serif; }
#noche-overlay .eu-sum-row{ padding:10px 12px; border-radius:10px; }
#noche-overlay .eu-sum-h{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; font-size:13px; font-weight:700; }
#noche-overlay .eu-sum-h b{ font:900 20px 'Outfit',sans-serif; }
#noche-overlay .eu-sum-bar{ position:relative; margin:6px 0 4px; }
#noche-overlay .eu-sum-bar div{ display:flex; height:10px; border-radius:999px; overflow:hidden; }
#noche-overlay .eu-sum-bar i{ position:absolute; top:-3px; bottom:-3px; width:0; border-left:2px dashed #f59e0b; }
#noche-overlay .eu-sum-f{ font-size:11.5px; font-weight:700; }
#noche-overlay .eu-sum-row.is-maj{ box-shadow:inset 0 0 0 1.5px #f59e0b; }
#noche-overlay .eu-sum-row.is-maj .eu-sum-f{ color:#f59e0b; }
/* Bolas de la comunidad que vota: grises hasta que se revelan; noche.js lanza una copia (.eu-fly) hacia el marcador */
#noche-overlay .eu-balls{ display:flex; flex-wrap:wrap; justify-content:center; gap:14px 16px; max-width:380px; }
#noche-overlay .eu-slot{ display:flex; flex-direction:column; align-items:center; gap:6px; width:60px; }
#noche-overlay .eu-ball{ width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font:900 21px/1 'Outfit',sans-serif; font-variant-numeric:tabular-nums; transition:background .35s, opacity .5s, box-shadow .35s; }
#noche-overlay .eu-ball.is-on{ color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.55); }
#noche-overlay .eu-ball.is-top.is-on{ box-shadow:0 0 0 3px #f59e0b, 0 0 26px rgba(245,158,11,.55); }
#noche-overlay .eu-ball.is-gone{ opacity:.8; }
#noche-overlay .eu-fly{ position:fixed; z-index:30; margin:0; pointer-events:none; opacity:1; }
#noche-overlay .eu-slot-p{ min-height:14px; max-width:100%; font-size:11px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@keyframes euIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

/* colores por modo */
#noche-overlay:not(.noche-light) #euro-count{ color:#fff; text-shadow:0 0 28px rgba(245,158,11,.35); }
#noche-overlay:not(.noche-light) .eu-bl-top, #noche-overlay:not(.noche-light) .eu-pos, #noche-overlay:not(.noche-light) .eu-sub, #noche-overlay:not(.noche-light) .eu-wait{ color:rgba(255,255,255,.55); }
#noche-overlay:not(.noche-light) .eu-pn, #noche-overlay:not(.noche-light) .eu-name, #noche-overlay:not(.noche-light) .eu-slot-p{ color:#f3f4f6; }
#noche-overlay:not(.noche-light) .eu-ball:not(.is-on){ background:rgba(255,255,255,.12); color:rgba(255,255,255,.7); }
#noche-overlay:not(.noche-light) .eu-bl-pend, #noche-overlay:not(.noche-light) .eu-bar, #noche-overlay:not(.noche-light) .eu-sum-bar div{ background:rgba(255,255,255,.07); }
#noche-overlay:not(.noche-light) .eu-sum-row{ background:rgba(255,255,255,.05); }
#noche-overlay:not(.noche-light) .eu-sum-t, #noche-overlay:not(.noche-light) .eu-sum-h{ color:#f3f4f6; }
#noche-overlay:not(.noche-light) .eu-sum-f{ color:rgba(255,255,255,.55); }
#noche-overlay:not(.noche-light) .eu-row{ background:rgba(255,255,255,.035); }
#noche-overlay:not(.noche-light) .eu-row.is-hot, #noche-overlay:not(.noche-light) .eu-row.is-win{ background:rgba(245,158,11,.14); }
#noche-overlay:not(.noche-light) .eu-num{ background:rgba(255,255,255,.08); color:#fff; }
#noche-overlay:not(.noche-light) .eu-right{ background:radial-gradient(420px 300px at 50% 0%, rgba(244,114,182,.14), transparent 70%), rgba(255,255,255,.025); border-left:1px solid rgba(255,255,255,.07); }
#noche-overlay.noche-light #euro-count{ color:#111827; }
#noche-overlay.noche-light .eu-bl-top, #noche-overlay.noche-light .eu-pos, #noche-overlay.noche-light .eu-sub, #noche-overlay.noche-light .eu-wait{ color:#6b7280; }
#noche-overlay.noche-light .eu-pn, #noche-overlay.noche-light .eu-name, #noche-overlay.noche-light .eu-slot-p{ color:#111827; }
#noche-overlay.noche-light .eu-ball:not(.is-on){ background:#d1d5db; color:#4b5563; }
#noche-overlay.noche-light .eu-bl-pend, #noche-overlay.noche-light .eu-bar, #noche-overlay.noche-light .eu-sum-bar div{ background:#e5e7eb; }
#noche-overlay.noche-light .eu-sum-row{ background:#ffffff; border:1px solid rgba(15,23,42,.06); }
#noche-overlay.noche-light .eu-sum-t, #noche-overlay.noche-light .eu-sum-h{ color:#111827; }
#noche-overlay.noche-light .eu-sum-f{ color:#6b7280; }
#noche-overlay.noche-light .eu-row{ background:#f8fafc; }
#noche-overlay.noche-light .eu-row.is-hot, #noche-overlay.noche-light .eu-row.is-win{ background:#fff4dd; }
#noche-overlay.noche-light .eu-num{ background:#eef0f4; color:#111827; }
#noche-overlay.noche-light .eu-right{ background:radial-gradient(420px 300px at 50% 0%, rgba(244,114,182,.12), transparent 70%), #f8fafc; border-left:1px solid rgba(15,23,42,.08); }

/* ordenador: marcador en 2 columnas (noche.js desplaza la segunda columna con translate(calc(100% + 14px))) */
@media (min-width: 900px) { #noche-overlay .eu-row{ right:auto; width:calc(50% - 7px); } }
/* móvil: primero quién reparte (compacto), debajo la barra de bloques y el marcador; todo en una sola columna con scroll */
@media (max-width: 899px) {
  #noche-overlay .ne-euro{ grid-area:pct; }
  #noche-overlay #euro-count{ font-size:26px; }
  #noche-overlay.noche-euro #euro-stage{ flex-direction:column; overflow-y:auto; }
  #noche-overlay .eu-left{ overflow:visible; padding:14px 12px 30px; }
  #noche-overlay .eu-right{ order:-1; width:auto; overflow:visible; padding:14px 12px; }
  #noche-overlay .eu-right.is-empty{ display:none; }
  #noche-overlay:not(.noche-light) .eu-right{ border-left:none; border-bottom:1px solid rgba(255,255,255,.07); }
  #noche-overlay.noche-light .eu-right{ border-left:none; border-bottom:1px solid rgba(15,23,42,.08); }
  #noche-overlay .eu-id{ gap:12px; margin-bottom:8px; }
  #noche-overlay .eu-flag{ width:84px; border-radius:7px; }
  #noche-overlay .eu-sil{ width:64px; height:56px; }
  #noche-overlay .eu-name{ font-size:21px; }
  #noche-overlay .eu-balls{ gap:10px; }
  #noche-overlay .eu-slot{ width:48px; }
  #noche-overlay .eu-ball{ width:40px; height:40px; font-size:16px; }
  #noche-overlay .eu-sub{ margin:2px 0 10px; }
  #noche-overlay .eu-pn{ flex-basis:92px; font-size:13px; }
  #noche-overlay .eu-row{ height:32px; gap:7px; padding:0 8px; }   /* EURO_ROW_M = 36 en noche.js */
  #noche-overlay .eu-num{ min-width:40px; padding:3px 0; font-size:15px; }
  #noche-overlay .eu-chip{ height:18px; }
}
@media (prefers-reduced-motion: reduce){
  #noche-overlay .eu-row, #noche-overlay .eu-bar i, #noche-overlay .eu-id, #noche-overlay .eu-ball{ transition:none; animation:none; }
  #noche-overlay .eu-plus.is-new{ animation:none; opacity:1; }
}

/* ══ Botones del final (Cargar al simulador / Compartir resultados / Volver a mis datos) ══ */
#noche-overlay .nf-row{ display:flex; gap:8px; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
#noche-overlay .nf-btn{ display:inline-flex; align-items:center; gap:7px; height:40px; padding:0 16px; border-radius:999px; flex-shrink:0; white-space:nowrap;
  cursor:pointer; font:700 13px 'DM Sans',sans-serif; transition:transform .15s, filter .15s, background .15s; }
#noche-overlay .nf-btn:hover{ transform:translateY(-1px); filter:brightness(1.08); }
#noche-overlay .nf-btn svg{ width:16px; height:16px; flex-shrink:0; }
#noche-overlay .nf-primary{ border:none; color:#111827; background:linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow:0 6px 18px rgba(245,158,11,.35); }
#noche-overlay:not(.noche-light) .nf-sec{ background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.16); color:#f3f4f6; }
#noche-overlay:not(.noche-light) .nf-ghost{ background:transparent; border:1px solid rgba(255,255,255,.14); color:rgba(255,255,255,.7); }
#noche-overlay.noche-light .nf-sec{ background:#111827; border:1px solid #111827; color:#fff; }
#noche-overlay.noche-light .nf-ghost{ background:transparent; border:1px solid rgba(15,23,42,.18); color:#374151; }

/* ══ Aviso de escrutinio finalizado (fuera del overlay: el tema lo marca .is-light, que pone _nocheFinish) ══ */
#noche-fin-popup{ position:fixed; inset:0; z-index:20000; align-items:center; justify-content:center; padding:20px;
  background:rgba(3,6,15,.6); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
#noche-fin-popup .nfp-card{ width:100%; max-width:360px; box-sizing:border-box; padding:30px 28px 24px; border-radius:22px; text-align:center;
  background:linear-gradient(180deg,#131b33,#0c1226); border:1px solid rgba(255,255,255,.1); box-shadow:0 30px 80px rgba(0,0,0,.55);
  animation:nfpIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes nfpIn{ from{ opacity:0; transform:translateY(12px) scale(.97); } to{ opacity:1; transform:none; } }
#noche-fin-popup .nfp-ic{ display:inline-flex; align-items:center; justify-content:center; width:58px; height:58px; margin-bottom:16px; border-radius:50%;
  color:#22c55e; background:rgba(34,197,94,.12); box-shadow:inset 0 0 0 1.5px rgba(34,197,94,.45); }
#noche-fin-popup .nfp-ic svg{ width:28px; height:28px; }
#noche-fin-popup .nfp-t{ font:900 22px/1.2 'Outfit',sans-serif; color:#fff; margin-bottom:8px; }
#noche-fin-popup .nfp-d{ margin:0 0 22px; font-size:13.5px; line-height:1.55; color:rgba(255,255,255,.6); }
#noche-fin-popup .nfp-ok{ width:100%; height:44px; border:none; border-radius:999px; cursor:pointer; font:800 14px 'DM Sans',sans-serif; color:#111827;
  background:linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow:0 8px 22px rgba(245,158,11,.35); transition:transform .15s, filter .15s; }
#noche-fin-popup .nfp-ok:hover{ transform:translateY(-1px); filter:brightness(1.06); }
#noche-fin-popup.is-light{ background:rgba(15,23,42,.35); }
#noche-fin-popup.is-light .nfp-card{ background:#ffffff; border-color:rgba(15,23,42,.08); box-shadow:0 30px 70px rgba(15,23,42,.18); }
#noche-fin-popup.is-light .nfp-t{ color:#111827; }
#noche-fin-popup.is-light .nfp-d{ color:#6b7280; }
@media (prefers-reduced-motion: reduce){ #noche-fin-popup .nfp-card{ animation:none; } }
