/* ═══════════════════════════════════════════════════
   EL VELO — Live Monitor TV (1920×1080)
   Una sola pantalla · fondo District Core · fases
   ═══════════════════════════════════════════════════ */

body.live-monitor {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  min-height: 100vh;
  max-height: 1080px;
  max-width: 1920px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.45;
  background: #050505;
}

/* Fondo */
.live-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/assets/district-core.webp") center 55% / cover no-repeat;
  filter: brightness(0.45) contrast(1.12) saturate(0.7);
}
.live-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,5,5,0.88) 0%, rgba(5,5,5,0.55) 35%, rgba(5,5,5,0.72) 70%, rgba(5,5,5,0.92) 100%),
    radial-gradient(ellipse 90% 80% at 50% 45%, transparent 0%, rgba(0,0,0,0.55) 100%);
}

/* Viewport 1080p */
.live-viewport {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-height: 1080px;
  padding: 20px 28px 18px;
  gap: 16px;
}

/* Header compacto */
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.live-header__brand {
  color: var(--cyan);
  font-size: 1rem;
  white-space: nowrap;
  text-shadow: 0 0 14px var(--glow);
}
.live-header__clock {
  color: var(--text-dim);
  font-size: 0.95rem;
  white-space: nowrap;
}

.live-metrics {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.live-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.live-metric__key {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}
.live-metric__val {
  font-size: 1.25rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
}
.live-metric__val.ok { color: var(--green); }

/* Cuerpo: primario + log */
.live-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.live-primary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.live-panel {
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(8px);
  padding: 18px 22px;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.live-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
}
.live-tag {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.live-tag.ok { color: var(--green); }

/* Fase 0 — espera */
.live-panel--await {
  flex: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.live-hero {
  font-size: 2rem;
  color: var(--cyan);
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
}
.live-hero-sub {
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 10px;
}
.live-hero-en {
  font-size: 0.95rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* Recon map — grande para TV */
.live-panel--recon { flex: 1; }
.recon-map--live {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  background: transparent;
}
.recon-map--live .recon-map__grid {
  min-height: 280px;
  gap: 24px 36px;
}
.recon-map--live .recon-node {
  width: 88px;
  height: 88px;
}
.recon-map--live .recon-node--core {
  width: 118px;
  height: 118px;
}
.recon-map--live .recon-node__label {
  font-size: 1.65rem;
  font-weight: bold;
}
.recon-map--live .recon-node--core .recon-node__label {
  font-size: 2rem;
  color: var(--cyan);
}
.live-recon-status {
  font-size: 1.05rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

/* Lore fragment */
.live-panel--lore {
  flex-shrink: 0;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.5s ease, padding 0.5s ease;
}
.live-lore-body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  text-align: justify;
}

/* Síntesis */
.live-panel--synthesis {
  flex: 1;
  border-color: rgba(0, 255, 0, 0.35);
  background: rgba(0, 0, 0, 0.88);
}
.live-synthesis {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--green);
  flex: 1;
}

/* Log lateral */
.live-log {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(8px);
  min-height: 0;
  overflow: hidden;
}
.log-terminal--live {
  flex: 1;
  height: auto;
  max-height: none;
  overflow: hidden;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  background: transparent;
}
.log-terminal--live .log-line {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}
.log-terminal--live .log-line .ts {
  font-size: 0.78rem;
}

/* Footer */
.live-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(6px);
}
.live-footer__progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.live-footer__bar {
  flex: 0 0 200px;
  height: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--border);
}
.live-footer__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--cyan), var(--green));
  transition: width 0.8s ease;
}
.live-footer__label {
  font-size: 0.95rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.live-btn-wire {
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
}
.live-btn-wire:not(:disabled):hover {
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}
.live-btn-wire:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.live-btn-wire:not(.hidden):not(:disabled) {
  animation: wirePulse 2s ease-in-out infinite;
}
@keyframes wirePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.15); }
  50% { box-shadow: 0 0 22px rgba(0, 240, 255, 0.35); }
}

/* ═══ FASES (revelado progresivo) ═══ */

/* Fase 0: solo espera + log */
.live-phase-0 .live-panel--await { display: flex; }
.live-phase-0 .live-footer__bar span { width: 0 !important; }

/* Fase 1+: mapa recon visible */
.live-phase-1 .live-panel--await,
.live-phase-2 .live-panel--await,
.live-phase-3 .live-panel--await,
.live-phase-4 .live-panel--await,
.live-phase-5 .live-panel--await { display: none; }

.live-phase-1 .live-panel--recon,
.live-phase-2 .live-panel--recon,
.live-phase-3 .live-panel--recon,
.live-phase-4 .live-panel--recon,
.live-phase-5 .live-panel--recon { display: flex; flex: 1; }

/* Fase 2+: primer nodo — lore aparece */
.live-phase-2 .live-panel--lore,
.live-phase-3 .live-panel--lore,
.live-phase-4 .live-panel--lore,
.live-phase-5 .live-panel--lore {
  display: flex;
  opacity: 1;
  max-height: 120px;
  padding: 14px 22px;
  border-color: var(--border);
}
.live-phase-3 .live-panel--lore { max-height: 160px; }
.live-phase-4 .live-panel--lore { max-height: 200px; }
.live-phase-5 .live-panel--lore { max-height: 140px; }

/* Fase 5: wire listo — recon más compacto, lore reduce */
.live-phase-5 .live-panel--recon { flex: 0 0 auto; }
.live-phase-5 .recon-map--live .recon-map__grid { min-height: 200px; }
.live-phase-5 .live-btn-wire:not(.hidden) { display: block; }

/* Fase 6: síntesis ocupa todo el primario */
.live-phase-6 .live-panel--await,
.live-phase-6 .live-panel--recon,
.live-phase-6 .live-panel--lore { display: none !important; }
.live-phase-6 .live-panel--synthesis {
  display: flex;
  flex: 1;
}
.live-phase-6 .live-panel--synthesis.hidden { display: flex !important; }

/* Ajuste fino 1920×1080 */
@media (min-width: 1600px) {
  body.live-monitor { font-size: 20px; }
  .live-hero { font-size: 2.25rem; }
  .live-hero-sub { font-size: 1.45rem; }
  .live-metric__val { font-size: 1.35rem; }
  .log-terminal--live .log-line { font-size: 1rem; }
  .recon-map--live .recon-node { width: 96px; height: 96px; }
  .recon-map--live .recon-node--core { width: 128px; height: 128px; }
}
