/* ═══════════════════════════════════════════════════════════════
   iXentBench™ — Hoja de estilos principal
   Arquitectura: Variables CSS duales (dark/light) + layout SPA
   Sin frameworks. Vanilla CSS puro.
   ═══════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────
   TOKENS DE DISEÑO — MODO OSCURO (por defecto)
   Filosofía: laboratorio de precisión, foco total, modo dev.
   Activado con: <html data-theme="dark">
   ────────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  /* Fondos en capas: bg → panels → inputs */
  --bg:          #0a0a0f;
  --bg2:         #111118;
  --bg3:         #16161f;

  /* Bordes translúcidos — no agresivos */
  --border:      rgba(255, 255, 255, 0.07);
  --border-hover:rgba(108, 99, 255, 0.45);

  /* Acento principal: púrpura — IA, tecnología, innovación */
  --accent:      #6c63ff;
  --accent2:     #a78bfa;

  /* Semántica de estado */
  --green:       #22d3a0;   /* éxito, LIVE, ratones rescatados */
  --yellow:      #fbbf24;   /* advertencia, eficiencia, ELO */
  --red:         #f87171;   /* error, timeout, captura */

  /* Escala tipográfica */
  --text:        #f1f0ff;   /* texto principal — blanco cálido */
  --text2:       #9896b8;   /* subtítulos, etiquetas */
  --text3:       #5a5880;   /* placeholders, desactivado */

  /* Sombras */
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.40);
  --shadow-md:   0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px var(--accent), 0 4px 24px rgba(108, 99, 255, 0.15);
}


/* ──────────────────────────────────────────────────────────────
   TOKENS DE DISEÑO — MODO CLARO
   Filosofía: reuniones B2B, presentaciones corporativas, limpio.
   Activado con: <html data-theme="light">
   ────────────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:          #f8f7ff;
  --bg2:         #ffffff;
  --bg3:         #efefff;

  --border:      rgba(0, 0, 0, 0.08);
  --border-hover:rgba(91, 82, 232, 0.40);

  --accent:      #5b52e8;
  --accent2:     #7c6fcd;

  --green:       #0fa87e;
  --yellow:      #d97706;
  --red:         #dc2626;

  --text:        #1a1830;
  --text2:       #4a4870;
  --text3:       #9896b8;

  --shadow-sm:   0 2px 8px rgba(108, 99, 255, 0.08);
  --shadow-md:   0 4px 24px rgba(108, 99, 255, 0.12);
  --shadow-glow: 0 0 0 1px var(--accent), 0 4px 24px rgba(91, 82, 232, 0.12);
}


/* ──────────────────────────────────────────────────────────────
   CONSTANTES DE LAYOUT
   Definidas en :root para ser independientes del tema.
   ────────────────────────────────────────────────────────────── */
:root {
  --sidebar-w:   230px;
  --topbar-h:    56px;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --transition:  0.20s ease;
  --font:        'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}


/* ──────────────────────────────────────────────────────────────
   RESET MÍNIMO
   Solo lo imprescindible para normalizar entre navegadores.
   ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow: hidden;                         /* scroll gestionado por .section */
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent2); }

ul { list-style: none; }

/* Scrollbar minimalista */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   Panel lateral izquierdo fijo. En móvil se oculta fuera de
   pantalla y se muestra con la clase .open via JS.
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition);
}

/* ── Logo ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}

/* Cuadrado de marca púrpura — icono corporativo minimalista */
.logo-mark {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 5px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.logo-text {
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.logo-text strong {
  color: var(--accent);
  font-weight: 700;
}

/* ── Separadores ── */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 18px 10px;
}

/* ── Nav items ── */
.sidebar-nav { padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  color: var(--text2);
  font-size: 0.875rem;
  cursor: pointer;
  position: relative;
  transition: color var(--transition), background var(--transition);
  border-radius: 0;
}
.nav-item:hover {
  color: var(--text);
  background: var(--bg3);
}

/* Estado activo: barra lateral púrpura + fondo sutil */
.nav-item.active {
  color: var(--text);
  background: var(--bg3);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badges de estado en nav (BETA, NEW, PRO) */
.nav-badge {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 5px;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}
.nav-badge.beta {
  background: rgba(251, 191, 36, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.nav-badge.new {
  background: rgba(34, 211, 160, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 211, 160, 0.25);
}
.nav-badge.pro {
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(108, 99, 255, 0.25);
}

/* Línea separadora dentro del nav */
.nav-separator {
  height: 1px;
  background: var(--border);
  margin: 8px 18px;
}

/* ── Espacio flexible ── */
.sidebar-spacer { flex: 1; }

/* ── Footer del sidebar: toggle + versión ── */
.sidebar-footer {
  padding: 14px 18px 10px;
  border-top: 1px solid var(--border);
}

/* Botón toggle de tema — base de Gema, full-width, en footer */
.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.sidebar-version {
  margin-top: 8px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text3);
  letter-spacing: 0.03em;
}

/* ── Bloque de usuario ── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg3); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.user-name {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-plan {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════════
   MAIN — Área de trabajo
   Ocupa el resto del viewport a la derecha del sidebar.
   ═══════════════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left var(--transition);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

/* Botón hamburguesa — solo en móvil */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.sidebar-toggle:hover {
  color: var(--text);
  background: var(--bg3);
}

/* Título dinámico de la sección activa */
.topbar-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Badge de estado del motor ──
   Cambia color y texto dinámicamente según el modo:
   🟢 LIVE | 📼 REPLAY | 🕹️ HUMAN | ⚪ IDLE
   ─────────────────────────────────────────── */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text3);
  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
}

/* Punto pulsante del badge */
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* El JS añade estas clases al badge según el estado */
.status-badge.is-live   { color: var(--green);  border-color: rgba(34,211,160,0.30); background: rgba(34,211,160,0.08); }
.status-badge.is-replay { color: var(--accent2); border-color: rgba(167,139,250,0.30); background: rgba(167,139,250,0.08); }
.status-badge.is-human  { color: var(--yellow);  border-color: rgba(251,191,36,0.30); background: rgba(251,191,36,0.08); }

/* Animación del punto en modo LIVE */
.status-badge.is-live .status-dot {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Botón primario ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform 0.1s, box-shadow var(--transition);
}
.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }


/* ═══════════════════════════════════════════════════════════════
   SECCIONES SPA
   Por defecto ocultas. El JS activa .active en la sección
   correspondiente, que cambia display de none a flex.
   ═══════════════════════════════════════════════════════════════ */
.section {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px;
  flex: 1;
  overflow-y: auto;
}
.section.active { display: flex; }

/* Cabecera de sección genérica */
.section-header { display: flex; flex-direction: column; gap: 4px; }
.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-sub {
  font-size: 0.83rem;
  color: var(--text2);
}

/* Chips de estado en títulos de sección */
.chip {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 99px;
  vertical-align: middle;
}
.chip.beta { background: rgba(251,191,36,0.12); color: var(--yellow); border: 1px solid rgba(251,191,36,0.25); }
.chip.new  { background: rgba(34,211,160,0.12); color: var(--green);  border: 1px solid rgba(34,211,160,0.25); }


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — Componentes específicos
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero card — presentación corporativa (base Gema) ── */
.hero-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background var(--transition), border-color var(--transition);
}

/* Tag "B2B ANALYTICS" — pastilla púrpura */
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
  max-width: 560px;
}

/* Indicador de sistema activo */
.hero-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot-live {
  font-size: 0.55rem;
  color: var(--green);
}

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: default;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}
.kpi-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.kpi-label {
  font-size: 0.7rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}
/* Colores semánticos para los valores KPI */
.kpi-value.accent  { color: var(--accent2); }
.kpi-value.green   { color: var(--green); }
.kpi-value.accent2 { color: var(--accent); }
.kpi-value.yellow  { color: var(--yellow); }

.kpi-limit {
  font-size: 0.7rem;
  color: var(--text3);
}

/* ── Card genérica ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: background var(--transition), border-color var(--transition);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

/* Card de placeholder para secciones en construcción */
.placeholder-card {
  color: var(--text3);
  font-size: 0.87rem;
  font-style: italic;
  min-height: 90px;
  display: flex;
  align-items: center;
  border-style: dashed;
}

/* ── Estado vacío ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 0;
  color: var(--text3);
  font-size: 0.87rem;
  text-align: center;
}
.empty-icon {
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.35;
}


/* ═══════════════════════════════════════════════════════════════
   PLAY / EVALUATE — Componentes del panel de configuración
   ═══════════════════════════════════════════════════════════════ */

/* Fila de configuración: etiqueta + control */
.config-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.config-row:last-child { border-bottom: none; }
.config-row--action {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
}

.config-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
}
.config-label .required { color: var(--red); }

/* Selector de modo (Arcade / Human / Replay) */
.mode-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.active {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.10);
  color: var(--text);
}
.mode-hint {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text3);
}

/* Selector de tamaño de tablero */
.board-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.board-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.board-btn:hover:not(.board-btn--locked) { border-color: var(--accent); color: var(--text); }
.board-btn.active {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.10);
  color: var(--text);
}
/* Tamaño bloqueado por plan — apariencia de candado */
.board-btn--locked {
  opacity: 0.40;
  cursor: not-allowed;
  border-style: dashed;
}
.board-btn--locked::after { content: ' 🔒'; font-size: 0.65rem; }

/* Aviso de plan requerido */
.plan-lock {
  font-size: 0.8rem;
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.20);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 4px;
}
.plan-lock a { color: var(--yellow); font-weight: 600; }

/* Input y textarea de configuración */
.config-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  padding: 9px 12px;
  width: 100%;
  max-width: 420px;
  resize: vertical;
  transition: border-color var(--transition);
}
.config-input:focus {
  outline: none;
  border-color: var(--accent);
}
.config-input::placeholder { color: var(--text3); }

/* Botonera de prompts embotellados (Arcade) */
.arcade-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.arcade-btn {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition),
              background var(--transition), transform 0.1s;
}
.arcade-btn:hover { border-color: var(--accent2); color: var(--text); transform: translateY(-1px); }
.arcade-btn.selected {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent2);
}

/* Aviso de cuota agotada */
.quota-warning {
  font-size: 0.82rem;
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.20);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.quota-warning a { color: var(--red); font-weight: 600; }

/* Contador de cuota junto al botón de inicio */
.quota-info {
  font-size: 0.78rem;
  color: var(--text3);
}

/* Botón de lanzamiento — versión grande */
.btn-launch {
  padding: 10px 24px;
  font-size: 0.9rem;
}
.btn-launch:disabled {
  background: var(--bg3);
  color: var(--text3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   PLAY / EVALUATE — Panel de configuración de sesión
   ═══════════════════════════════════════════════════════════════ */

/* Grid de dos columnas: izquierda (pasos A+B) / derecha (paso C + resultado) */
.play-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.play-card { display: flex; flex-direction: column; gap: 0; }

/* Cada paso del formulario */
.play-step {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.play-step:last-child { border-bottom: none; }
.play-action { padding-top: 20px; display: flex; align-items: center; gap: 14px; }

/* Etiqueta de paso con número */
.step-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Paso A: Radio de participación ── */
.radio-stack { display: flex; flex-direction: column; gap: 8px; }

.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.radio-item:hover { border-color: var(--accent); background: var(--bg3); }
.radio-item input[type="radio"] { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.radio-item input:checked ~ .radio-content strong { color: var(--accent2); }

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.radio-content strong { font-size: 0.85rem; color: var(--text); }
.radio-content small  { font-size: 0.75rem; color: var(--text3); line-height: 1.4; }
.radio-content code   { font-family: monospace; font-size: 0.78rem; color: var(--accent2); }

/* Pastilla PRO para Custom Agent bloqueado */
.plan-pill {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(108, 99, 255, 0.25);
  margin-top: 4px;
  width: fit-content;
}

/* ── Paso B: Selector de modelo ── */
.play-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color var(--transition);
}
.play-select:focus { outline: none; border-color: var(--accent); }

.play-input {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.play-input:focus { outline: none; border-color: var(--accent); }
.play-input::placeholder { color: var(--text3); }

.field-hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text3);
  font-style: italic;
}

/* ── Paso C: Toggle SOLO / ARENA ── */
.format-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}
.format-btn {
  padding: 9px 28px;
  border: none;
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.format-btn:first-child { border-right: 1px solid var(--border); }
.format-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Botones de tablero ── */
.board-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.board-btn {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.board-btn:hover:not(:disabled)  { border-color: var(--accent); color: var(--text); }
.board-btn.active {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
  color: var(--text);
}
.board-btn--locked, .board-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-style: dashed;
}
.board-btn--locked::after { content: ' 🔒'; font-size: 0.6rem; }

/* Aviso de plan insuficiente */
.plan-lock {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.plan-lock a { color: var(--yellow); font-weight: 600; }

/* Aviso de cuota agotada */
.quota-warning {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--red);
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.quota-warning a { color: var(--red); font-weight: 600; }

/* Contador de cuota junto al botón */
.quota-info { font-size: 0.75rem; color: var(--text3); }

/* Botón de lanzamiento */
.btn-launch { padding: 10px 22px; font-size: 0.88rem; }
.btn-launch:disabled {
  background: var(--bg3);
  color: var(--text3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Cajas de resultado (Session ID / Invite Link) ── */
.result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(108, 99, 255, 0.07);
  border: 1px dashed var(--accent);
}
.result-label {
  font-size: 0.78rem;
  color: var(--accent2);
  margin-bottom: 8px;
  font-weight: 600;
}
.result-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  line-height: 1.5;
}
.btn-copy {
  /*margin-top: 10px;*/
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-copy:hover { background: var(--accent); color: #fff; }

.result-hint {
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--text3);
  line-height: 1.5;
}

/* Responsive: apilar columnas en tablet */
@media (max-width: 900px) {
  .play-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet y móvil
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablet: ≤ 900px ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .section { padding: 22px 22px; }
}

/* ── Móvil: ≤ 768px ── */
@media (max-width: 768px) {
  /* El sidebar se oculta fuera de pantalla */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  /* JS añade .open para mostrarlo */
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  /* El main ocupa el 100% sin margin */
  .main { margin-left: 0; }

  /* Mostrar botón hamburguesa */
  .sidebar-toggle { display: block; }

  .topbar { padding: 0 16px; }
  .section { padding: 18px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hero-card { padding: 20px 20px; }
  .hero-title { font-size: 1.3rem; }
}

/* ── Móvil pequeño: ≤ 420px ── */
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn-primary { display: none; } /* evita overflow */
}

/* ═══════════════════════════════════════════════════════════════
   VISUALIZADOR — Capa a pantalla completa sobre el formulario
   Se activa en modo Human y Live. Cierre manual con botón X.
   ═══════════════════════════════════════════════════════════════ */
.visualizer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  flex-direction: column;
}
.visualizer-overlay.active { display: flex; }

/* Barra superior del visualizador */
.visualizer-topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  flex-shrink: 0;
}
.visualizer-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.visualizer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--yellow);
}
.visualizer-status .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.visualizer-close {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.visualizer-close:hover { border-color: var(--red); color: var(--red); }

/* Área central del tablero */
.visualizer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Placeholder hasta que el tablero esté implementado */
.visualizer-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text3);
  font-size: 0.88rem;
}
.visualizer-placeholder small { font-size: 0.78rem; }
.visualizer-placeholder code {
  font-family: monospace;
  color: var(--accent2);
}

/* Botón logout en bloque de usuario del sidebar */
#btnLogoutSPA {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
#btnLogoutSPA:hover {
  color: var(--red);
  background: rgba(248, 113, 113, 0.10);
}

/* ═══════════════════════════════════════════════════════════════
   PLAYROOM — Salas de juego con pago por ticket
   Arquitectura: Grid 4 columnas → 2 en tablet → 1 en móvil
   ═══════════════════════════════════════════════════════════════ */

/* ── Categoría (bloque con cabecera + grid) ── */
.pr-category { display: flex; flex-direction: column; gap: 14px; }

.pr-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
}
.pr-cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pr-cat-sub {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text3);
  font-size: 0.78rem;
}

/* Colores por categoría */
.pr-cat-human  { color: var(--accent2); }
.pr-cat-human  .pr-cat-dot { background: var(--accent2); }
.pr-cat-ai     { color: var(--green); }
.pr-cat-ai     .pr-cat-dot { background: var(--green); }
.pr-cat-showcase { color: var(--yellow); }
.pr-cat-showcase .pr-cat-dot { background: var(--yellow); }

/* ── Grid de tarjetas ── */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ── Tarjeta individual ── */
.pr-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.pr-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.pr-card[data-category="human"]::before   { background: var(--accent2); }
.pr-card[data-category="ai"]::before      { background: var(--green); }
.pr-card[data-category="showcase"]::before { background: var(--yellow); }

.pr-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

/* Tarjeta destacada (salas premium) */
.pr-card-featured {
  border-color: rgba(108, 99, 255, 0.3);
}

/* ── Cabecera de tarjeta ── */
.pr-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Badges de formato ── */
.pr-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 99px;
}
.pr-badge-human   { background: rgba(167,139,250,0.12); color: var(--accent2); border: 1px solid rgba(167,139,250,0.25); }
.pr-badge-ai      { background: rgba(34,211,160,0.12);  color: var(--green);   border: 1px solid rgba(34,211,160,0.25); }
.pr-badge-showcase{ background: rgba(251,191,36,0.12);  color: var(--yellow);  border: 1px solid rgba(251,191,36,0.25); }

/* ── Nivel ── */
.pr-level {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}

/* ── Nombre de la sala ── */
.pr-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* ── Descripción ── */
.pr-desc {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.5;
  flex: 1;
}

/* ── Avatares de participantes ── */
.pr-players {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.pr-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.pr-human  { background: rgba(108,99,255,0.15); color: var(--accent2); border: 1px solid rgba(108,99,255,0.3); }
.pr-ai     { border: 1px solid rgba(34,211,160,0.3); }
.pr-gemini { background: rgba(34,211,160,0.12); color: var(--green); }
.pr-sep {
  font-size: 0.65rem;
  color: var(--text3);
  font-weight: 700;
  padding: 0 2px;
}

/* ── Label de la IA ── */
.pr-ai-label {
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
}

/* ── Prompts embotellados ── */
.pr-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pr-prompt {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(251,191,36,0.08);
  color: var(--yellow);
  border: 1px solid rgba(251,191,36,0.2);
  white-space: nowrap;
}

/* ── Footer: precio + botones ── */
.pr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.pr-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.pr-price small {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text2);
}

/* ── Botones ── */
.pr-btn-group {
  display: flex;
  gap: 5px;
}
.pr-btn-main {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background var(--transition), transform 0.1s;
}
.pr-btn-main:hover   { background: var(--accent2); transform: translateY(-1px); }
.pr-btn-main:active  { transform: translateY(0); }

.pr-btn-secondary {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
}
.pr-btn-secondary:hover { border-color: var(--accent); color: var(--text); }

/* ── Botón Replay (siempre en gris hasta game over) ── */
.pr-btn-replay {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color var(--transition), color var(--transition);
}
.pr-btn-disabled { cursor: not-allowed; opacity: 0.5; }
.pr-btn-replay:not(.pr-btn-disabled) {
  cursor: pointer;
  color: var(--accent2);
  border-color: rgba(108,99,255,0.4);
}
.pr-btn-replay:not(.pr-btn-disabled):hover {
  background: rgba(108,99,255,0.08);
}

.btn-secondary {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .pr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .pr-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   METRICS OVERLAYS — posición absoluta sobre cada panel
   ════════════════════════════════════════════════════════════ */

/* Los dos paneles necesitan position:relative para confinar el overlay */
#metricsLeftPanel,
#metricsRightPanel {
  position: relative;
  overflow: hidden;
}

.metrics-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg2);
  z-index: 10;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border-radius: 14px;
  /* Fuerza su propia capa de composición GPU — bug de Safari iOS donde
     un <canvas> activo en el mismo contenedor (aquí, #benchChart) puede
     renderizarse por encima de overlays position:absolute pese a tener
     z-index inferior. Fijado a nivel de clase, así protege también el
     radar STAR-XAI (mismo patrón canvas + .metrics-overlay), aunque
     ahí no lo hayas reportado. */
  transform: translateZ(0);
}

.metrics-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.metrics-overlay-inner {
  padding: 16px 20px 32px;
}

/* Botón cerrar overlay — esquina superior derecha */
.ov-close-btn {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 12px;
  background: var(--bg2);
  z-index: 1;
}
.ov-close-btn button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 0.8rem;
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.ov-close-btn button:hover {
  background: var(--border);
}

/* Secciones del overlay */
.ov-section       { margin-bottom: 22px; }
.ov-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin: 0 0 8px;
}
.ov-text {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text2);
  margin: 0 0 8px;
}
.ov-formula {
  font-family: monospace;
  font-size: 0.72rem;
  background: var(--bg3, var(--bg));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  color: var(--accent);
  margin: 7px 0;
  word-break: break-all;
  line-height: 1.5;
}

/* Dimensiones */
.ov-dim       { display: flex; gap: 10px; margin-bottom: 16px; }
.ov-dim-num   {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ov-dim-arena { background: var(--accent2, #a855f7); font-size: 0.58rem; }
.ov-dim-name  { font-size: 0.78rem; font-weight: 700; color: var(--text); margin: 0 0 3px; }

.ov-example {
  background: var(--bg3, var(--bg));
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
  margin-top: 5px;
}
.ov-example-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 3px;
}
.ov-example-text {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text2);
  margin: 0;
  font-style: italic;
}

/* Badge ARENA */
.ov-arena-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent2, #a855f7);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
}

/* Link arXiv */
.ov-arxiv       { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.ov-arxiv-link  {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.ov-arxiv-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   GAME RULES / SYSTEM PROMPT OVERLAY — pestañas + contenido denso
   Prefijo .gr- para no colisionar con .ov- (overlays existentes)
   ════════════════════════════════════════════════════════════ */

/* Pestañas internas Rules / System Prompt */
.gr-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 16px;
}
.gr-tab {
  padding: 8px 20px;
  border: none;
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gr-tab:first-child { border-right: 1px solid var(--border); }
.gr-tab.active { background: var(--accent); color: #fff; }
.gr-pane { display: none; }
.gr-pane.active { display: block; }

/* Cabecera de sección numerada (mismo patrón que .s-num de los HTML originales) */
.gr-shead {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.gr-shead .gr-snum {
  background: var(--accent); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.72rem; flex-shrink: 0;
}
.gr-shead h4 { font-size: 0.85rem; color: var(--accent2); margin: 0; }
.gr-shead .gr-tag {
  margin-left: auto; font-size: 0.62rem; color: var(--accent);
  background: rgba(108,99,255,0.1); padding: 2px 8px; border-radius: 8px;
}

/* Bloques de código con resaltado semántico */
.gr-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}
.gr-code .c  { color: var(--text3); }             /* comentarios */
.gr-code .kw { color: var(--accent2); }            /* keywords */
.gr-code .st { color: var(--yellow); }             /* strings */
.gr-code .w  { color: var(--yellow); }              /* warnings */
.gr-code .ok { color: var(--green); }               /* correcto */
.gr-code .er { color: var(--red); }                 /* error */
.gr-code .fn { color: var(--accent2); }             /* funciones */
.gr-code .v  { color: var(--text2); }               /* variables */

/* Alertas */
.gr-alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 0.78rem; line-height: 1.5; }
.gr-alert-w { background: rgba(251,191,36,0.08); border-left: 4px solid var(--yellow); color: var(--yellow); }
.gr-alert-i { background: rgba(108,99,255,0.08); border-left: 4px solid var(--accent); color: var(--accent2); }
.gr-alert-g { background: rgba(34,211,160,0.08); border-left: 4px solid var(--green); color: var(--green); }
.gr-alert-r { background: rgba(248,113,113,0.08); border-left: 4px solid var(--red); color: var(--red); }

/* Prosa y tablas */
.gr-prose { color: var(--text2); line-height: 1.65; font-size: 0.8rem; margin-bottom: 12px; }
.gr-prose strong { color: var(--text); }
.gr-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 0.76rem; }
.gr-table th { background: var(--bg3); color: var(--accent); padding: 8px 10px; text-align: left; border-bottom: 2px solid var(--border); }
.gr-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: top; }
.gr-pn { color: var(--accent2); font-weight: 700; }

/* Diagramas — contenedor sin forzar colores del SVG interno */
.gr-diagrams {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; margin-bottom: 18px;
}
.gr-diag-block { flex: 1; min-width: 160px; }
.gr-diag-block h5 { color: var(--text3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.gr-diag-legend { margin-top: 10px; font-size: 0.7rem; color: var(--text2); }
.gr-diag-legend span { display: block; margin: 2px 0; }

/* Etiqueta de bloque (block-label del System Prompt) */
.gr-block-label {
  font-family: monospace; font-size: 0.68rem; color: var(--accent);
  background: rgba(108,99,255,0.1); border: 1px solid var(--accent);
  border-radius: 4px; padding: 2px 7px; display: inline-block; margin-bottom: 5px;
}
.gr-block-label.arena { color: var(--accent2); background: rgba(167,139,250,0.1); border-color: var(--accent2); }

/* Módulo cards (arquitectura del System Prompt) */
.gr-module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.gr-module-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.gr-module-card h5 { font-size: 0.76rem; font-family: monospace; margin-bottom: 5px; color: var(--accent2); }
.gr-module-card p { font-size: 0.72rem; color: var(--text2); line-height: 1.45; }

/* Flujo de arquitectura (cajas + flechas) */
.gr-arch-flow { display: flex; align-items: center; gap: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; flex-wrap: wrap; row-gap: 8px; }
.gr-arch-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 0.72rem; font-family: monospace; color: var(--text); text-align: center; min-width: 110px; }
.gr-arch-box.core { border-color: var(--accent); color: var(--accent); }
.gr-arch-box.module { border-color: var(--accent2); color: var(--accent2); }
.gr-arch-box.output { border-color: var(--green); color: var(--green); }
.gr-arch-arrow { color: var(--text3); font-size: 1rem; padding: 0 4px; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   ARENA LOBBY — grid de slots + barra social
   Prefijo .al- (Arena Lobby) para no colisionar con .ov-/.gr-
   ════════════════════════════════════════════════════════════ */

.al-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 320px; text-align: center; color: var(--text3); gap: 10px;
}
.al-empty .al-icon { font-size: 2.2rem; opacity: 0.5; }

.al-room-code {
  font-family: monospace; font-size: 1.5rem; font-weight: 800;
  color: var(--accent); letter-spacing: 0.05em; text-align: center;
  padding: 14px; background: var(--bg3); border: 1px dashed var(--accent);
  border-radius: 10px; margin-bottom: 14px;
}

.al-social-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.al-social-btn {
  flex: 1; min-width: 70px; padding: 8px 10px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg3); color: var(--text2); font-size: 0.72rem; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background 0.15s;
}
.al-social-btn:hover { background: var(--bg); border-color: var(--accent); }

.al-slots-grid { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.al-team { display: flex; flex-direction: column; gap: 8px; }
.al-team-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); text-align: center; }
.al-vs { font-weight: 800; color: var(--text3); font-size: 0.9rem; padding: 0 6px; }

.al-slot {
  width: 130px; padding: 12px 10px; border-radius: 10px; text-align: center;
  border: 1px solid var(--border); background: var(--bg3);
}
.al-slot.filled { border-color: var(--green); background: rgba(34,211,160,0.08); }
.al-slot .al-avatar {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); font-size: 1rem;
}
.al-slot.filled .al-avatar { background: var(--green); color: #fff; }
.al-slot .al-slot-name { font-size: 0.72rem; font-weight: 700; color: var(--text); }
.al-slot .al-slot-status { font-size: 0.64rem; color: var(--text3); margin-top: 2px; }
.al-slot.pending .al-slot-status { animation: al-pulse 1.8s ease-in-out infinite; }
@keyframes al-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.al-launch-btn { width: 100%; margin-top: 12px; opacity: 0.5; cursor: not-allowed; }
.al-launch-note { font-size: 0.68rem; color: var(--text3); text-align: center; margin-top: 6px; font-style: italic; }

.al-tabs { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; }
.al-tab { flex: 1; padding: 9px; border: none; background: var(--bg3); color: var(--text2); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.al-tab:first-child { border-right: 1px solid var(--border); }
.al-tab.active { background: var(--accent); color: #fff; }
.al-pane-arena { display: none; }
.al-pane-arena.active { display: block; }

/* Tabla dentro de overlay — reutilizable para cualquier tabla de contenido */
.ov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 10px 0 16px;
}
.ov-table th {
  background: var(--bg3);
  color: var(--text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.ov-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.ov-table tr:last-child td { border-bottom: none; }

/* Blockquote / tip dentro de overlay — reutilizable */
.ov-blockquote {
  border-left: 4px solid var(--accent);
  margin: 12px 0;
  padding: 10px 16px;
  background: var(--bg3);
  border-radius: 0 8px 8px 0;
  color: var(--text2);
  font-size: 0.8rem;
  line-height: 1.6;
}
.ov-blockquote strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   BENCHMARK — Leaderboard y gráfico comparativo
   ═══════════════════════════════════════════════════════════════ */

.bench-row {
  display: grid;
  grid-template-columns: 28px 1fr 70px 70px 80px 24px;
  gap: 0 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.82rem;
}
.bench-row:hover { background: var(--bg3); }

.bench-row-human {
  background: rgba(251, 191, 36, 0.06);
  border-bottom: 2px solid rgba(251, 191, 36, 0.25);
  cursor: default;
  font-weight: 700;
}
.bench-row-human:hover { background: rgba(251, 191, 36, 0.06); }

.bench-header {
  display: grid;
  grid-template-columns: 28px 1fr 70px 70px 80px 24px;
  gap: 0 8px;
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  border-bottom: 2px solid var(--border);
}

.bench-badge-official {
  font-size: 0.65rem;
  color: var(--green);
}

.bench-runs {
  font-size: 0.75rem;
  color: var(--text3);
  font-family: monospace;
}

.bench-pct {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

#section-benchmark {
  position: relative;
}

/* =============================================================================
   BOTONES Información
   ============================================================================= */

/* Unificación del botón de ayuda "i" */
.btn-info-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    
    /* Dimensiones consistentes */
    padding: 2px 8px;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.btn-info-icon:hover {
    background: var(--border);
    border-color: var(--accent);
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   MODO OSCURO FIJO (Para manuales, System Prompt y terminal)
   ═══════════════════════════════════════════════════════════════ */
.force-dark {
  --bg:          #0a0a0f;
  --bg2:         #111118;
  --bg3:         #16161f;
  --border:      rgba(255, 255, 255, 0.07);
  --border-hover:rgba(108, 99, 255, 0.45);
  --accent:      #6c63ff;
  --accent2:     #a78bfa;
  --green:       #22d3a0;
  --yellow:      #fbbf24;
  --red:         #f87171;
  --text:        #f1f0ff;
  --text2:       #9896b8;
  --text3:       #5a5880;
  
  background-color: var(--bg2) !important;
  color: var(--text) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CERTIFICATES — Tabla de evaluaciones certificables + modal
   ═══════════════════════════════════════════════════════════════ */

.data-table {
  width: 100%;
  table-layout: fixed;
  text-align: left;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table thead tr {
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 10px;
  color: var(--text2);
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}
.data-table .sort-arrow {
  color: var(--text3);
  font-size: 0.7rem;
  margin-left: 2px;
}

.text-muted {
  color: var(--text3);
  font-size: 0.85rem;
}

/* ── Modal de confirmación de firma ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.60);
  align-items: center;
  justify-content: center;
  /* display lo controla el JS: 'none' | 'flex' */
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: var(--shadow-md);
}
.modal h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.modal .text-muted {
  line-height: 1.6;
  color: var(--text2);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.modal-actions button {
  padding: 8px 18px;
  font-size: 0.82rem;
}

/* ── Aviso de publicación pública (consentimiento RGPD) ── */
.modal-notice {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
}
.modal-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.modal-notice strong {
  display: block;
  font-size: 0.82rem;
  color: var(--yellow);
  margin-bottom: 5px;
}
.modal-notice p {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text2);
  margin-bottom: 6px;
}
.modal-notice p:last-child { margin-bottom: 0; }
.modal-notice code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: var(--accent2);
}

/* ── Checkbox de consentimiento ── */
.modal-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: border-color var(--transition);
}
.modal-consent:hover { border-color: var(--accent); }
.modal-consent input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.modal-consent span {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text2);
}

/* Botón deshabilitado hasta marcar el consentimiento */
.modal-actions .btn-primary:disabled {
  background: var(--bg3);
  color: var(--text3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}