/* ==========================================================================
   SINCRETISMO DE SILICIO - SECUESTRO CIBERNÉTICO
   Estética Cyberpunk / Cámara de Vigilancia CCTV / Glitch Hostil
   ========================================================================== */

:root {
  --bg-dark: #05070a;
  --bg-surface: rgba(10, 15, 22, 0.85);
  --border-cyan: rgba(0, 240, 255, 0.4);
  --border-green: rgba(0, 255, 102, 0.5);
  --border-red: rgba(255, 0, 85, 0.6);
  
  --accent-cyan: #00f0ff;
  --accent-green: #00ff66;
  --accent-neon-green: #39ff14;
  --accent-red: #ff0055;
  --accent-amber: #ffb703;
  --accent-purple: #c084fc;

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-cctv: #67e8f9;

  /* Fondos centralizables desde la pestaña COLORES (aplicados por JS) */
  --bg-hud: rgba(5, 7, 10, 0.9);
  --bg-surface-btn: rgba(10, 20, 30, 0.7);
  --bg-accent-soft: rgba(0, 240, 255, 0.08);
  --bg-accent: rgba(0, 240, 255, 0.12);
  --bg-accent-strong: rgba(0, 240, 255, 0.25);
  --bg-panel: rgba(10, 18, 30, 0.85);
  --bg-panel-deep: rgba(3, 7, 13, 0.9);
  --bg-slot: rgba(8, 14, 22, 0.88);
  --bg-card: rgba(9, 16, 28, 0.92);
  --bg-mutated: rgba(3, 14, 8, 0.9);
  --bg-final: rgba(4, 9, 14, 0.94);
  --bg-modal: rgba(6, 12, 22, 0.96);
  --bg-overlay: rgba(4, 9, 15, 0.98);
  --bg-toast: rgba(8, 14, 24, 0.92);
  --bg-desp: rgba(22, 6, 12, 0.95);
  --bg-input: rgba(4, 8, 14, 0.9);

  --font-organic: 'Share Tech Mono', 'VT323', 'IBM Plex Mono', monospace;
  --font-cyber: 'Share Tech Mono', 'VT323', 'IBM Plex Mono', monospace;
  
  --glow-cyan: 0 0 5px rgba(0, 240, 255, 0.35);
  --glow-green: 0 0 6px rgba(0, 255, 102, 0.4);
  --glow-red: 0 0 7px rgba(255, 0, 85, 0.45);

  /* ---------------------------------------------------------------------
     Tríada de acentos con alfa. Las pisa applyUiColors() desde la paleta
     activa (--accent-1 = c1, --accent-2 = c2, --accent-3 = c3).
     Reemplazan los rgba(...) hardcodeados en cápsulas de palabras, slots y
     tarjetas: así TODO el frente de contenido sigue la paleta elegida.
     --------------------------------------------------------------------- */
  --accent-1-soft: rgba(0, 240, 255, 0.14);
  --accent-1-line: rgba(0, 240, 255, 0.32);
  --accent-1-mid: rgba(0, 240, 255, 0.45);
  --accent-1-strong: rgba(0, 240, 255, 0.8);
  --accent-2-soft: rgba(0, 255, 102, 0.14);
  --accent-2-line: rgba(0, 255, 102, 0.32);
  --accent-2-mid: rgba(0, 255, 102, 0.45);
  --accent-2-strong: rgba(0, 255, 102, 0.8);
  --accent-3-soft: rgba(255, 0, 85, 0.14);
  --accent-3-line: rgba(255, 0, 85, 0.32);
  --accent-3-mid: rgba(255, 0, 85, 0.45);
  --accent-3-strong: rgba(255, 0, 85, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-cyber);
}

/* ==========================================================================
   CONTENEDOR DE LA INSTALACIÓN
   ========================================================================== */
#installation-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   VIDEO WEBCAM Y CAPAS DE FILTRO CCTV
   ========================================================================== */
#webcam-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
  /* Espejado horizontal para que la interacción con la cámara sea natural */
  transform: scaleX(-1);
  /* Cámara limpia y natural sin filtro blanco y negro por defecto */
  filter: none;
  transition: filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Estado de Procesamiento y Secuestro: Mantener cámara limpia y estable sin flashes */
#installation-container.state-processing #webcam-video,
#installation-container.state-hijack #webcam-video,
#installation-container.state-glitching #webcam-video {
  filter: none;
  animation: none;
}

/* Capa de Scanlines Analógicas (desactivada por defecto para cámara limpia) */
.scanline-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--bg-hud);
  background-size: 100% 3px, 6px 100%;
  opacity: 0.85;
  display: none;
}

/* Capa de Viñeta y Distorsión de Lente (desactivada por defecto para cámara limpia) */
.vignette-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  display: none;
}

/* Canvas de Ruido Estático Procedural */
#noise-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: screen;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: opacity 0.5s ease;
}

/* El canvas de ruido respeta la opacidad calibrada por el usuario sin destellos */
#installation-container.state-processing #noise-canvas,
#installation-container.state-hijack #noise-canvas {
  /* Mantener opacidad calibrada sin saltos bruscos */
}

/* ==========================================================================
   HUD CÁMARA DE SEGURIDAD (SUPERIOR)
   ========================================================================== */
#cctv-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-hud);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 12px;
  letter-spacing: 1px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#cctv-hud.hud-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cctv-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-red);
  font-weight: 700;
}

.blinking-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent-red);
  border-radius: 0;
  box-shadow: 0 0 10px var(--accent-red);
  animation: pulseDot 1s infinite;
}

.cctv-node-id {
  color: var(--text-muted);
  font-size: 11px;
  display: none;
}
@media (min-width: 900px) {
  .cctv-node-id { display: block; }
}

.cctv-timestamp {
  color: var(--accent-cyan);
  font-family: var(--font-cyber);
}

.cctv-fps-badge {
  color: var(--accent-green);
  font-family: var(--font-cyber);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-success);
  border: 1px solid rgba(0, 255, 102, 0.35);
  border-radius: 0;
  padding: 1px 7px;
  letter-spacing: 0.5px;
}

.hud-center {
  display: flex;
  align-items: center;
}

.state-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: var(--bg-accent-soft);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.state-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

#installation-container.state-processing .state-pill {
  background: var(--bg-danger);
  border-color: var(--border-red);
  color: var(--accent-red);
}
#installation-container.state-processing .state-dot {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulseDot 0.4s infinite;
}

#installation-container.state-hijack .state-pill {
  background: var(--bg-success);
  border-color: var(--border-green);
  color: var(--accent-green);
}
#installation-container.state-hijack .state-dot {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cctv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface-btn);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  color: var(--accent-cyan);
  font-family: var(--font-cyber);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cctv-btn:hover {
  background: var(--bg-accent-strong);
  box-shadow: var(--glow-cyan);
  color: #fff;
}

.cctv-btn kbd {
  background: var(--bg-accent);
  padding: 1px 5px;
  border-radius: 0;
  font-size: 10px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.btn-icon-only {
  padding: 6px 10px;
}

/* ==========================================================================
   MARCO TELEMÉTRICO Y ESQUINAS CCTV
   ========================================================================== */
.cctv-frame-corners {
  position: fixed;
  inset: 20px;
  z-index: 10;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0, 240, 255, 0.45);
}

.corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* Badge de Telemetría Biometría Flotante */
#telemetry-badge {
  position: fixed;
  top: 70px;
  left: 28px;
  z-index: 15;
  background: var(--bg-hud);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 14px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.badge-row {
  display: flex;
  gap: 8px;
}

.badge-label {
  color: var(--text-muted);
}

.badge-val {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ==========================================================================
   CAPA DE PALABRAS ORGÁNICAS FLOTANTES
   ========================================================================== */
#floating-words-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.organic-word-item {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* SIN CONTENEDOR: la palabra es sólo texto flotando sobre el shader maestro.
     El padding no se ve (fondo transparente) y sólo agranda el área de clic. */
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: var(--word-font-family, var(--font-organic));
  font-size: var(--word-font-size, 19px);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--word-color, #ffffff);
  /* Reborde del texto configurable desde la pestaña PARTÍCULAS */
  -webkit-text-stroke: var(--word-outline, 1px) var(--word-outline-color, rgba(4, 8, 18, 0.85));
  paint-order: stroke fill;
  text-shadow: var(--word-glow, 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 18px rgba(255, 255, 255, 0.45));
  will-change: transform, opacity;
  pointer-events: auto;
  transition: color 0.2s ease, filter 0.2s ease, text-shadow 0.2s ease;
}

/* Sin cápsula: el relleno progresivo ya no existe (la palabra es texto libre) */
.word-pill-fill {
  display: none !important;
}

.word-label {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.word-lock-badge {
  position: relative;
  z-index: 2;
  margin-left: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #00f0ff;
  display: none;
  letter-spacing: 1px;
}

/* Estado de Fijación / Proximidad: Resplandor cyberpunk estático, SIN vibración ni destellos */
.organic-word-item.targeting {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 22px var(--accent-1-strong), 0 0 40px var(--accent-1-mid);
}

/* ==========================================================================
   ESTADOS DEL SISTEMA UNIFICADO DE PALABRAS
   ========================================================================== */
/* Estado 1: Palabra Atrapada y Alojada en Slot */
.organic-word-item.word-slotted {
  position: fixed !important;
  z-index: 30 !important;
  padding: 8px 24px !important;
  font-size: var(--word-font-size, 19px) !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 20px var(--accent-1-strong) !important;
  color: var(--accent-cyan) !important;
  letter-spacing: 2px !important;
  font-family: var(--font-cyber) !important;
  pointer-events: none !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease !important;
}

/* Estado 2: Rotación / Scramble en Escenario Central */
.organic-word-item.word-scrambling {
  position: fixed !important;
  z-index: 32 !important;
  min-width: 280px !important;
  max-width: 85vw !important;
  padding: 14px 36px !important;
  font-size: var(--word-font-size-center, 38px) !important;
  font-family: var(--font-cyber) !important;
  font-weight: 700 !important;
  letter-spacing: 4px !important;
  color: var(--accent-cyan) !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.95), 0 0 30px var(--accent-1-strong) !important;
  pointer-events: none !important;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease !important;
}

/* Estado 3: Resignificada / Mutada a Frío IA */
.organic-word-item.word-transformed {
  position: fixed !important;
  z-index: 32 !important;
  min-width: 280px !important;
  max-width: 85vw !important;
  padding: 14px 36px !important;
  font-size: var(--word-font-size-center, 38px) !important;
  font-family: var(--font-cyber) !important;
  font-weight: 800 !important;
  letter-spacing: 3px !important;
  color: var(--accent-neon-green) !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.95), 0 0 28px var(--accent-2-strong) !important;
  pointer-events: none !important;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease !important;
}

/* Estado 4: Miembro de la Frase Final Integrada */
.organic-word-item.word-phrase-member {
  position: relative !important;
  display: inline-flex !important;
  transform: none !important;
  margin: 3px 6px !important;
  padding: 4px 14px !important;
  font-size: var(--word-font-size-phrase, 26px) !important;
  font-family: var(--font-cyber) !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  color: var(--accent-neon-green) !important;
  border: none !important;
  background: transparent !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 20px var(--accent-2-strong) !important;
  box-shadow: none !important;   /* sin halo rectangular: la palabra es texto limpio */
  text-shadow: 0 0 10px var(--accent-neon-green) !important;
  pointer-events: none !important;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Estado 5: Palabras Auxiliares de la Frase */
.organic-word-item.word-auxiliary {
  position: relative !important;
  display: inline-flex !important;
  transform: none !important;
  margin: 3px 4px !important;
  padding: 4px 10px !important;
  font-size: calc(var(--word-font-size-phrase, 26px) * 0.86) !important;
  font-family: var(--font-cyber) !important;
  font-weight: 500 !important;
  letter-spacing: 1px !important;
  color: #ffffff !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 14px var(--accent-1-mid) !important;
  opacity: 0;
  animation: auxGlitchIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none !important;
}

@keyframes auxGlitchIn {
  0% { opacity: 0; transform: translateY(6px) scale(0.9); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* SISTEMA UNIFICADO: cuando el slot está ocupado, el texto propio se oculta y
   el marco queda sólo como anclaje: la palabra que se ve es el objeto unificado
   (.organic-word-item.word-slotted) que vuela hasta ese centro. */
.slot-box.filled .slot-content,
.slot-box.filled .slot-header,
.slot-box.filled .slot-glow {
  visibility: hidden !important;
}

/* Contenedor flexible para frase compuesta */
.phrase-flow-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 4px;
  line-height: 1.8;
  width: 100%;
  text-align: center;
}

/* ==========================================================================
   CURSOR TÁCTICO / RETÍCULO DE FIJACIÓN
   ========================================================================== */
#cursor-reticle {
  position: fixed;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  z-index: 25;
  pointer-events: none;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.3s ease;
}

#cursor-reticle.hidden {
  opacity: 0;
}

.reticle-ring {
  position: absolute;
  inset: 0;
  border: 1.5px dashed var(--accent-cyan);
  border-radius: 0;
  animation: rotateClockwise 8s linear infinite;
  box-shadow: 0 0 10px var(--accent-1-mid);
}

.reticle-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  background-color: var(--accent-cyan);
  border-radius: 0;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.reticle-crosshair {
  position: absolute;
  background: var(--accent-cyan);
}

.reticle-crosshair.ch-x {
  top: 50%;
  left: -8px;
  right: -8px;
  height: 1px;
  transform: translateY(-50%);
}

.reticle-crosshair.ch-y {
  left: 50%;
  top: -8px;
  bottom: -8px;
  width: 1px;
  transform: translateX(-50%);
}

.reticle-label {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--accent-cyan);
  background: var(--bg-panel-deep);
  padding: 1px 6px;
  border: 1px solid var(--border-cyan);
  white-space: nowrap;
}

#cursor-reticle.locking .reticle-ring {
  border-style: solid;
  border-color: var(--accent-amber);
  box-shadow: 0 0 18px var(--accent-amber);
  animation-duration: 2s;
}
#cursor-reticle.locking .reticle-core {
  background-color: var(--accent-amber);
  box-shadow: 0 0 12px var(--accent-amber);
}
#cursor-reticle.locking .reticle-label {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

/* ==========================================================================
   CONTENEDOR CENTRAL INFERIOR DE PALABRAS ATRAPADAS (3 SLOTS)
   ========================================================================== */
#caught-section {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#installation-container.state-hijack #caught-section {
  opacity: 0;
  transform: translate(-50%, 60px);
  pointer-events: none;
}

  color: var(--text-muted);
}

.slots-container {
  display: flex;
  gap: 16px;
}

.slot-box {
  width: 180px;
  height: 64px;
  background: var(--bg-slot);
  border: 1px solid var(--accent-1-line);
  border-radius: 0;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-box.empty {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.25);
}

.slot-box.filled {
  border-style: solid;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-1-mid), inset 0 0 10px var(--accent-1-soft);
  animation: slotSnapIn 0.4s ease-out;
}

.slot-header {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.slot-box.filled .slot-header {
  color: var(--accent-cyan);
}

.slot-content {
  font-family: var(--font-cyber);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.slot-box.empty .slot-content {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.4);
  font-weight: 400;
}

.slot-glow {
  position: absolute;
  inset: 0;
  background: var(--bg-accent-soft);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.slot-box.filled .slot-glow {
  opacity: 1;
}

/* ==========================================================================
   ESCENARIO DE RESIGNIFICACIÓN Y SÍNTESIS IA (ANIMACIÓN FUNDIDO + GLITCH)
   ========================================================================== */
.mutation-stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.mutation-stage.hidden {
  opacity: 0;
  pointer-events: none;
}

.mutation-backdrop-glitch {
  display: none !important;
}

#corporate-rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.5s ease;
}

/* ==========================================================================
   CARTEL "DESPROCESANDO" (Durante randomizado y cómputo de la IA)
   ========================================================================== */
.desprocesando-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 8px 30px;
  background: var(--bg-desp);
  border: 1.5px solid var(--accent-red);
  box-shadow: 0 0 35px var(--accent-3-mid), inset 0 0 16px var(--accent-3-soft);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  animation: desprocesandoPulse 0.85s infinite alternate;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.desprocesando-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-15px) scale(0.92);
  pointer-events: none;
  display: none !important;
}

.desp-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.desp-pulse-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--accent-red);
  box-shadow: 0 0 12px #ff0055;
  animation: pulseDot 0.45s infinite alternate;
}

.desp-title {
  font-family: var(--font-cyber);
  font-size: clamp(1.3rem, 2.8vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 6px;
  color: #ff2a6d;
  text-shadow: 0 0 20px rgba(255, 0, 85, 0.85), 2px 0 0 rgba(0, 240, 255, 0.6);
  animation: glitchTextMini 0.14s infinite;
}

.desp-sub {
  font-family: var(--font-cyber);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 200, 220, 0.9);
  text-transform: uppercase;
}

@keyframes desprocesandoPulse {
  0% {
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.35), inset 0 0 10px rgba(255, 0, 85, 0.15);
    border-color: rgba(255, 0, 85, 0.6);
  }
  100% {
    box-shadow: 0 0 50px rgba(255, 0, 85, 0.8), inset 0 0 24px rgba(255, 0, 85, 0.4);
    border-color: #ff0055;
  }
}

@keyframes glitchTextMini {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 0.5px); }
  50% { transform: translate(1px, -0.5px); }
  75% { transform: translate(-0.5px, -1px); }
  100% { transform: translate(0, 0); }
}

/* Contenedor de las 3 palabras centrales en grande */
.mutation-words-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  text-align: center;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), gap 0.9s ease;
}

/* Cuando se genera la frase, las 3 palabras se desplazan suavemente hacia arriba */
.mutation-words-container.shifted-up {
  transform: translateY(-28px) scale(0.92);
  gap: 14px;
}

/* Tarjeta individual de palabra en proceso de mutación */
.mutation-word-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  text-align: center !important;
  margin: 0 auto !important;
  padding: 12px 38px;
  min-width: 320px;
  max-width: 90vw;
  box-sizing: border-box;
  border-radius: 0;
  /* Sin destello blanco: fondo oscuro con halo cian sutil */
  background: var(--bg-card);
  border: 1.5px solid var(--accent-1-mid);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 22px var(--accent-1-soft);
  backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, color, border-color, box-shadow;
}

/* Texto de la palabra */
.mutation-word-text {
  font-family: var(--font-organic);
  font-size: clamp(1.5rem, 3.6vw, 3.0rem);
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  text-align: center !important;
  width: 100% !important;
  display: block !important;
  margin: 0 auto !important;
  text-shadow: 0 0 18px var(--accent-1-mid);
  transition: color 0.4s ease, font-family 0.4s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Estado 2: Girando caracteres (Scramble / Decryption) — SIN terremoto ni vibración */
.mutation-word-card.scrambling {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 35px var(--accent-1-mid), inset 0 0 15px var(--accent-1-soft);
  animation: none;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  text-align: center !important;
  margin: 0 auto !important;
}

.mutation-word-card.scrambling .mutation-word-text {
  font-family: var(--font-cyber);
  letter-spacing: 3px;
  color: var(--accent-cyan);
  text-shadow: 0 0 15px var(--accent-cyan), 0 0 30px rgba(0, 240, 255, 0.5);
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Estado 3: Resignificado a frío / IA / Corporativo */
.mutation-word-card.mutated {
  border-radius: 0;
  background: var(--bg-mutated);
  border-color: var(--accent-neon-green);
  box-shadow: 0 0 25px var(--accent-2-mid), inset 0 0 12px var(--accent-2-soft);
  padding: 10px 36px;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  text-align: center !important;
  margin: 0 auto !important;
}

.mutation-word-card.mutated .mutation-word-text {
  font-family: var(--font-cyber);
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--accent-neon-green);
  text-shadow: 0 0 14px var(--accent-neon-green), 0 0 32px rgba(0, 255, 102, 0.5);
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Discurso Final de la IA (Caja inferior con frase inspiracional) */
.final-speech-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  /* Contenedor de la frase ELIMINADO visualmente: sólo anclaje de layout, el
     texto flota directo sobre el shader maestro. */
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 24px 36px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.final-speech-box.hidden {
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
}

.speech-body {
  font-family: var(--font-cyber);
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 500;
  line-height: 1.8;
  color: #f0fdf4;
  letter-spacing: 0.6px;
  min-height: 4.8em;
  text-align: center;
  width: 100%;
  white-space: pre-line !important;
  font-style: italic;
}

.speech-cursor {
  display: inline-block;
  color: var(--accent-neon-green);
  margin-left: 4px;
  animation: blinkBlock 0.7s infinite;
}

/* Efecto de fondo cuando se eligen las 3 palabras (mantener estable) */
#installation-container.state-glitching #webcam-video {
  animation: none;
}

/* ==========================================================================
   PANEL MODAL DE CONFIGURACIÓN (TECLA 'P')
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  /* El fondo ya NO se oscurece ni desenfoca para permitir calibrar con visión total de la escena */
  background: transparent !important;
  backdrop-filter: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  pointer-events: none; /* Permite clicks a través del fondo */
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.modal-overlay.hidden * {
  display: none !important;
  pointer-events: none !important;
}

.modal-card {
  pointer-events: auto; /* Solo la tarjeta captura clicks */
  position: relative;
  width: 100%;
  max-width: 1560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-modal);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9), var(--glow-cyan);
  overflow: hidden;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 12px 18px;
  background: var(--bg-accent);
  border-bottom: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  cursor: grab; /* Permite arrastrar la ventana */
  user-select: none;
}

.modal-header:active {
  cursor: grabbing;
}

/* Cruz grande prominente para cerrar modal */
.modal-close-btn {
  background: var(--bg-danger);
  border: 1px solid rgba(255, 0, 85, 0.5);
  color: #ff0055;
  width: 38px;
  height: 38px;
  border-radius: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--bg-danger);
  border-color: #ff0055;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.6);
  transform: scale(1.08);
}

/* Tabs de navegación en Modal: se acomodan en varias líneas para no superponerse */
.modal-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-overlay);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding: 0 10px;
  gap: 4px;
  flex-shrink: 0;
  overflow: visible;
  scrollbar-width: none;
}

.modal-tabs-nav::-webkit-scrollbar {
  display: none;
}

.modal-tab-btn {
  flex: 0 1 auto;
  min-width: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-cyber);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.modal-tab-btn .tab-text {
  white-space: nowrap;
}

.modal-tab-btn:hover {
  color: #fff;
  background: var(--bg-accent-soft);
}

.modal-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: var(--bg-accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.tab-badge {
  background: var(--bg-accent);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  border-radius: 0;
  padding: 1px 6px;
  font-size: 9.5px;
}

.modal-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-tab-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: tabPaneFade 0.2s ease;
}

.modal-tab-pane.active {
  display: flex;
}

@keyframes tabPaneFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* System Prompt Header con botón Expandir / Reducir */
.system-prompt-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.btn-toggle-expand {
  background: var(--bg-accent);
  border: 1px solid var(--border-cyan);
  color: var(--accent-cyan);
  border-radius: 0;
  padding: 4px 10px;
  font-family: var(--font-cyber);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-toggle-expand:hover {
  background: var(--bg-accent-strong);
  box-shadow: var(--glow-cyan);
  color: #fff;
}

#cfg-system-prompt {
  min-height: 220px;
  height: 250px;
  max-height: 550px;
  resize: vertical;
  line-height: 1.5;
  font-size: 12.5px;
  font-family: var(--font-cyber);
  transition: height 0.25s ease;
}

#cfg-system-prompt.expanded {
  min-height: 420px;
  height: 440px;
}

.ascii-row-stacked {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}

.form-group label small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.input-with-presets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"],
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 0;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: var(--bg-accent);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 0;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-cctv);
  font-family: var(--font-cyber);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: var(--bg-accent-strong);
  color: #fff;
}

.config-status-msg {
  font-size: 12px;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.config-status-msg.success {
  color: var(--accent-green);
}

.config-status-msg.error {
  color: var(--accent-red);
}

.modal-footer {
  padding: 16px 20px;
  background: var(--bg-modal);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-modal {
  padding: 8px 16px;
  border-radius: 0;
  font-family: var(--font-cyber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-default {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  margin-right: auto;
}

.btn-default:hover {
  border-color: #fff;
  color: #fff;
}

.btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-primary {
  background: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  color: #05070a;
}

.btn-primary:hover {
  background: #38bdf8;
  box-shadow: var(--glow-cyan);
}

/* ==========================================================================
   TOASTS DE NOTIFICACIÓN
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  background: var(--bg-toast);
  border: 1px solid var(--border-cyan);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: toastIn 0.3s ease-out forwards;
}

.toast.toast-error {
  border-color: var(--border-red);
  border-left-color: var(--accent-red);
  color: #fecdd3;
}

.toast.toast-success {
  border-color: var(--border-green);
  border-left-color: var(--accent-green);
  color: #d1fae5;
}

/* ==========================================================================
   ANIMACIONES & KEYFRAMES
   ========================================================================== */
@keyframes pulseDot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slotSnapIn {
  0% { transform: scale(0.85); opacity: 0.5; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes textBlinkRed {
  0% { opacity: 1; }
  100% { opacity: 0.45; }
}

@keyframes blinkBlock {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes videoGlitchFlicker {
  0%, 100% {
    transform: scaleX(-1);
    filter: brightness(100%) contrast(100%);
  }
  50% {
    transform: scaleX(-1);
    filter: brightness(112%) contrast(108%);
  }
}

@keyframes glitchSlice1 {
  0% { clip-path: inset(40% 0 61% 0); }
  20% { clip-path: inset(92% 0 1% 0); }
  40% { clip-path: inset(10% 0 85% 0); }
  60% { clip-path: inset(58% 0 33% 0); }
  80% { clip-path: inset(25% 0 58% 0); }
  100% { clip-path: inset(70% 0 20% 0); }
}

@keyframes glitchSlice2 {
  0% { clip-path: inset(25% 0 58% 0); }
  20% { clip-path: inset(70% 0 20% 0); }
  40% { clip-path: inset(40% 0 61% 0); }
  60% { clip-path: inset(92% 0 1% 0); }
  80% { clip-path: inset(10% 0 85% 0); }
  100% { clip-path: inset(58% 0 33% 0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RECORTE DE SILUETA POR DEPTH MAP / SEGMENTACIÓN (CUTOUT)
   ========================================================================== */
#cutout-camera-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
  transform: scaleX(-1); /* Espejado horizontal para coincidir con la cámara */
  pointer-events: none;
  display: none;
}

/* ==========================================================================
   CANVAS DE SHADER MAESTRO DE SALIDA & SHADERS SOBRE LA CÁMARA
   ========================================================================== */
#master-output-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Cuando el SHADER MAESTRO está activo (clase puesta por MasterOutputShader),
   estas capas pasan a ser ENTRADAS del shader: siguen renderizando en su canvas
   (el maestro las muestrea como textura) pero dejan de verse como capa.
   La salida visible queda: #master-output-canvas al fondo y las palabras /
   partículas / HUD por encima. */
html.master-output-active #webcam-video,
html.master-output-active #cutout-camera-canvas,
html.master-output-active #ascii-camera-canvas,
html.master-output-active #framediff-camera-canvas,
html.master-output-active #openpose-overlay-canvas {
  visibility: hidden !important;
}

#ascii-camera-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  opacity: 0.92;
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
}

#framediff-camera-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  opacity: 0.88;
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
}

#openpose-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 15;
  pointer-events: none;
}

#pointers-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 16;
  pointer-events: none;
}

/* Capa de Glitch VHS analógico */
.vhs-glitch-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease;
}

#installation-container.vhs-active .vhs-glitch-layer {
  opacity: 0.75;
  animation: vhsTrackingRoll 8s linear infinite, vhsNoiseFlicker 0.12s infinite;
}

@keyframes vhsTrackingRoll {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes vhsNoiseFlicker {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.85; }
}

/* Lluvia de partículas corporativas en pantalla final */
#corporate-rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   PESTAÑA PARTÍCULAS (CONTROLES DE PALABRAS GENERADAS)
   ========================================================================== */
.particles-controls-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ascii-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.ascii-color-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-accent-soft);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 0;
  padding: 8px 12px;
}

.ascii-color-item label {
  font-family: var(--font-cyber);
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ==========================================================================
   SELECTOR DE COLOR — SOLO la cajita (swatch), sin widgets nativos rotos
   ========================================================================== */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 56px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 0;
}

input[type="color"]:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* Item de color compacto: etiqueta + cajita en una sola línea */
.calib-item.calib-item-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calib-item.calib-item-inline label {
  justify-content: flex-start;
  gap: 8px;
}

/* ==========================================================================
   PALETAS GLOBALES (Pestaña COLORES)
   ========================================================================== */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.palette-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-panel-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: var(--text-muted);
  font-family: var(--font-cyber);
  font-size: 12px;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.palette-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.palette-btn.active {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  background: var(--bg-accent-soft);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.palette-swatches {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.palette-swatches > span {
  display: block;
  width: 16px;
  height: 26px;
}

.palette-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-accent-soft);
  border: 1px solid rgba(0, 240, 255, 0.2);
  font-family: var(--font-cyber);
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.palette-status strong {
  color: var(--accent-cyan);
}

.palette-base-chips {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.palette-chip {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Ajuste fino por elemento: colapsable */
.color-advanced {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 7, 13, 0.4);
}

.color-advanced > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-family: var(--font-cyber);
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
}

.color-advanced > summary::-webkit-details-marker {
  display: none;
}

.color-advanced > summary:hover {
  color: var(--accent-cyan);
}

.color-advanced[open] > summary {
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.color-advanced-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   POPOVER DE COLOR PROPIO (reemplaza el picker nativo roto)
   ========================================================================== */
.word-color-popover {
  position: fixed;
  z-index: 4000;
  width: 262px;
  padding: 10px;
  background: var(--bg-modal);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-family: var(--font-cyber);
}

.word-color-popover.hidden {
  display: none;
}

.wcp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.wcp-close {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.wcp-sv {
  position: relative;
  height: 132px;
  cursor: crosshair;
  touch-action: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  /* El matiz se inyecta por variable CSS (evita el guard anti-degradados global) */
  --wcp-hue-color: #f00;
  background-image:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, var(--wcp-hue-color));
}

.wcp-sv-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.wcp-hue {
  position: relative;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: ew-resize;
  touch-action: none;
  background: linear-gradient(to right,
    #f00 0%, #ff0 16.6%, #0f0 33.3%, #0ff 50%, #00f 66.6%, #f0f 83.3%, #f00 100%);
}

.wcp-hue-cursor {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 22px;
  margin-left: -3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.wcp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wcp-preview {
  width: 34px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.wcp-hex {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text-main);
  font-family: var(--font-cyber);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.wcp-presets {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.wcp-preset {
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
}

.wcp-preset:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.12);
}

/* Los canvases de ASCII y FrameDiff conservan su opacidad calibrada sin forzar cambios */
#installation-container.state-processing #ascii-camera-canvas,
#installation-container.state-processing #framediff-camera-canvas,
#installation-container.state-hijack #ascii-camera-canvas,
#installation-container.state-hijack #framediff-camera-canvas {
  /* Mantener valores de opacidad definidos por el usuario */
}

/* ==========================================================================
   INTERACCIÓN CON EL MOUSE (CLIC DIRECTO)
   ========================================================================== */
.organic-word-item {
  cursor: pointer;
}

.organic-word-item:hover {
  filter: brightness(1.15);
}

/* ==========================================================================
   BANNER DE MODELO ACTIVO & DROPDOWN OLLAMA EN MODAL
   ========================================================================== */
.active-model-banner {
  background: var(--bg-accent-soft);
  border: 1px solid var(--accent-cyan);
  border-left: 5px solid var(--accent-cyan);
  border-radius: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.banner-status-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 0;
  font-weight: 700;
  letter-spacing: 1px;
}

.banner-status-tag.online {
  background: var(--bg-success);
  color: var(--accent-green);
  border: 1px solid var(--border-green);
}

.banner-status-tag.offline {
  background: var(--bg-danger);
  color: var(--accent-red);
  border: 1px solid var(--border-red);
}

.banner-model-val {
  font-family: var(--font-cyber);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-refresh-models {
  background: var(--bg-accent);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  color: var(--accent-cyan);
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-cyber);
  transition: all 0.2s ease;
}

.btn-refresh-models:hover {
  background: var(--bg-accent-strong);
  box-shadow: var(--glow-cyan);
}

.cyber-select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cyber-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.cyber-select option {
  background: var(--bg-panel-deep);
  color: #e2e8f0;
  padding: 8px;
}

.ascii-controls-card {
  background: var(--bg-accent-soft);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: 0;
  padding: 12px 14px;
}

.section-subtitle {
  font-size: 11px;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 700;
}

.ascii-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.ascii-slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.ascii-slider-group input[type="range"] {
  width: 100px;
}

/* ==========================================================================
   BANCO DE PALABRAS EN MODAL DE CONFIGURACIÓN (TECLA P)
   ========================================================================== */
.words-pool-card {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 0;
  padding: 14px;
}

.words-help-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.words-input-group textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 0;
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 12px;
  padding: 10px;
  resize: vertical;
}

.words-input-group textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.words-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.btn-word-action {
  font-family: var(--font-cyber);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-add-words {
  background: var(--bg-accent);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
}
.btn-add-words:hover {
  background: var(--bg-accent-strong);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.btn-replace-words {
  background: rgba(255, 170, 0, 0.15);
  border-color: rgba(255, 170, 0, 0.4);
  color: #ffaa00;
}
.btn-replace-words:hover {
  background: rgba(255, 170, 0, 0.3);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.btn-default-words {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}
.btn-default-words:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #fff;
}

.words-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-panel-deep);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
}

.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-accent);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #e0f2fe;
  padding: 3px 8px;
  border-radius: 0;
  font-family: var(--font-organic);
  font-size: 11px;
}

.word-chip .chip-remove-btn {
  background: none;
  border: none;
  color: rgba(255, 100, 100, 0.7);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
}

.word-chip .chip-remove-btn:hover {
  color: #ff4444;
}

/* ==========================================================================
   SUPERPOSICIÓN OPENPOSE (OVERLAY CANVAS)
   ========================================================================== */
#openpose-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   MONITORES TÁCTICOS PiP (DEPTH MAP & CÁMARA FACIAL)
   ========================================================================== */
.tactical-pip-card {
  position: fixed;
  z-index: 30;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 240, 255, 0.25);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tactical-pip-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.pip-bottom-right {
  bottom: 80px;
  right: 28px;
  width: 250px;
}

.pip-top-left {
  top: 65px;
  left: 24px;
  width: 230px;
}

.pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-accent-soft);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.pip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
}

.pip-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseDot 1.4s infinite;
}

.pip-status-dot.face-dot {
  background: var(--accent-red);
  box-shadow: 0 0 8px #ff0055;
}

.pip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip-tag {
  font-size: 9px;
  background: var(--bg-accent);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 0;
}

.pip-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.pip-close-btn:hover {
  color: #ff4444;
}

.pip-canvas-wrapper {
  position: relative;
  width: 100%;
  background: #020509;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pip-canvas-wrapper canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.pip-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  background-size: 100% 4px;
}

.pip-overlay-meta {
  position: absolute;
  bottom: 4px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.face-target-corners {
  position: absolute;
  inset: 12px;
  pointer-events: none;
}

.face-target-corners .fc {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #ff0055;
  border-style: solid;
}

.fc-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.fc-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.fc-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.fc-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.face-biometric-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.face-biometric-reticle .f-circle {
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(255, 0, 85, 0.7);
  border-radius: 0;
  animation: rotateClockwise 8s linear infinite;
}

.face-biometric-reticle .f-line {
  position: absolute;
  background: var(--bg-danger);
}

.face-biometric-reticle .f-h {
  top: 50%;
  left: -8px;
  right: -8px;
  height: 1px;
}

.face-biometric-reticle .f-v {
  left: 50%;
  top: -8px;
  bottom: -8px;
  width: 1px;
}

.pip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: var(--bg-panel);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ==========================================================================
   PESTAÑA DE TRACKING & CALIBRACIÓN (MODAL P)
   ========================================================================== */
.tracking-card {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tracking-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Switch Toggle Cyberpunk */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.25s ease;
  border-radius: 0;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: 0.25s ease;
  border-radius: 0;
}

input:checked + .slider-round {
  background-color: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Grid de Calibración */
.calibration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.calib-item {
  background: rgba(3, 7, 13, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.calib-item label {
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calib-item .item-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.calib-subslider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-left: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

.calib-subslider input[type="range"] {
  width: 110px;
}

.cyber-select-sm {
  background: var(--bg-input);
  border: 1px solid var(--border-cyan);
  border-radius: 0;
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 11.5px;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
}

.cyber-select-sm:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* Telemetría en Vivo de Sensores */
.calib-telemetry-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(3, 7, 13, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 0;
  padding: 8px 12px;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .calib-telemetry-box {
    grid-template-columns: repeat(2, 1fr);
  }
}

.telemetry-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-stat .stat-lbl {
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.telemetry-stat .stat-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.calib-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-calib-action {
  background: var(--bg-accent);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  border-radius: 0;
  padding: 7px 12px;
  font-family: var(--font-cyber);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-calib-action:hover {
  background: var(--bg-accent-strong);
  box-shadow: var(--glow-cyan);
  color: #fff;
}

/* ==========================================================================
   PESTAÑA DE RENDER & COMPOSICIÓN DE CAPAS (TAB 5)
   ========================================================================== */
.render-layers-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.render-layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.render-layer-item {
  background: var(--bg-input);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.render-layer-item:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}

.render-layer-item .layer-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.render-layer-item .layer-title {
  font-family: var(--font-cyber);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.4px;
}

.render-layer-item .layer-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.render-layer-item .layer-slider-group label {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.render-layer-item .layer-slider-group label span {
  color: var(--accent-cyan);
  font-weight: 700;
}

.render-layer-item .layer-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0;
}

/* ==========================================================================
   ESTÉTICA CONSOLA — OVERRIDES GLOBALES (aplican sobre todo lo anterior)
   Contenedores cuadrados · Cero degradados · Fuente terminal · Brillo reducido
   ========================================================================== */

/* Cero esquinas redondeadas en TODA la app (incluye círculos decorativos) */
*,
*::before,
*::after {
  border-radius: 0 !important;
}

/* Asegura contenedor cuadrado en palabras seleccionables y slots */
.organic-word-item,
.slot-box,
.mutation-word-card {
  border-radius: 0 !important;
}

/* Respaldo anti-degradado: color sólido en cualquier background degradado */
[class*="gradient"],
[style*="gradient"] {
  background-color: rgba(0, 240, 255, 0.06);
  background-image: none !important;
}

/* Tipografía cibernética: monoespaciada de terminal en toda la app */
body,
button,
input,
select,
textarea {
  font-family: 'Share Tech Mono', 'VT323', 'IBM Plex Mono', monospace !important;
}

/* Look consola: paddings y brillos reducidos (sin cápsula).
   OJO: NO fijar font-size acá con !important — mataba los controles de
   tamaño por estado de la pestaña PARTÍCULAS (--word-font-size*). */
.organic-word-item {
  padding: 4px 10px !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.word-pill-fill {
  box-shadow: none !important;
}

.mutation-word-card {
  padding: 8px 22px !important;
  border-width: 1px !important;
  box-shadow: 0 0 6px var(--accent-1-soft) !important;
  backdrop-filter: none !important;
}

.mutation-word-card.mutated {
  box-shadow: 0 0 6px var(--accent-2-soft) !important;
}

.mutation-word-text {
  text-shadow: none !important;
}

.slot-box {
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 4px 8px !important;
  width: 170px !important;
  height: 56px !important;
}

.slot-box.filled {
  box-shadow: 0 0 4px var(--accent-1-soft) !important;
}

.final-speech-box {
  padding: 16px 28px !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  min-height: 130px;
}

.speech-text-output {
  font-family: 'Share Tech Mono', 'VT323', 'IBM Plex Mono', monospace !important;
  white-space: pre-line !important;
  display: inline;
}

.desprocesando-banner {
  padding: 4px 14px !important;
  box-shadow: 0 0 6px var(--accent-3-soft) !important;
}

.desp-title {
  text-shadow: none !important;
  animation: none !important;
}

.modal-card {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 240, 255, 0.12) !important;
}

.modal-header,
.cctv-hud {
  backdrop-filter: none !important;
}

.organic-word-item.targeting {
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
}

.word-chip,
.chip-btn,
.tab-badge,
.banner-status-tag {
  border-radius: 0 !important;
  font-family: 'Share Tech Mono', 'VT323', 'IBM Plex Mono', monospace !important;
}

.state-dot,
.desp-pulse-dot {
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Toasts: contenedores cuadrados y sin blur */
.toast {
  border-radius: 0 !important;
  backdrop-filter: none !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8) !important;
}



/* ==========================================================================
   FRASE FINAL: huecos y aparición de auxiliares (coreografía unificada)
   ========================================================================== */
/* Reserva el lugar de cada palabra transformada con la MISMA métrica que
   .word-phrase-member, pero invisible: las 3 palabras vuelan hasta acá. */
.phrase-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 3px 6px;
  padding: 4px 14px;
  font-family: var(--font-cyber);
  font-weight: 800;
  letter-spacing: 1.5px;
  /* Debe medir EXACTAMENTE igual que la palabra real que va a ocupar el hueco */
  font-size: var(--word-font-size-phrase, 26px);
  visibility: hidden;
  pointer-events: none;
}

/* Auxiliares ya maquetadas pero todavía invisibles: aparecen cuando las 3
   palabras transformadas terminaron de llegar a su lugar en la frase. */
.organic-word-item.word-auxiliary.aux-pending {
  opacity: 0 !important;
  animation: none !important;
}
