/* ==========================================================================
   DELETED TIME™ — FAST FORWARD 99 YEARS: BROADCAST COMPOSITOR CSS
   Visual DNA: Bloomberg Density × Early MTV Graphic Collisions ×
               Max Headroom Interruptions × Eurotrash Irreverence ×
               Wipeout Velocity × Blade Runner 2049 × Cyberpunk 2077 Scale
   ========================================================================== */

:root {
  --bc-black: #050508;
  --bc-near-black: #090a0f;
  --bc-glass: rgba(12, 14, 20, 0.78);
  --bc-glass-border: rgba(255, 255, 255, 0.12);
  --bc-white: #f5f5f7;
  --bc-accent-red: #ff1836;
  --bc-accent-yellow: #e6ff00;
  --bc-accent-cyan: #00f0ff;
  --bc-accent-magenta: #ff0077;
  --bc-accent-gold: #f5c542;
  --bc-font-display: 'Oswald', -apple-system, BlinkMacSystemFont, sans-serif;
  --bc-font-mono: 'SF Mono', 'Courier New', monospace;
  --bc-font-serif: 'Times New Roman', serif;
}

/* Base Viewport Reset: The Monumental First Viewport */
#broadcast-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
  background-color: var(--bc-black);
  color: var(--bc-white);
  font-family: var(--bc-font-mono);
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Master Glass Stage (Hosts 3D, Video Billboards, Canvas) */
.broadcast-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, #0d111a 0%, #050508 85%);
  overflow: hidden;
}

#compositor-canvas-3d,
#compositor-canvas-splat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#compositor-canvas-3d {
  z-index: 2;
}

#compositor-canvas-splat {
  z-index: 6;
  pointer-events: auto;
  cursor: crosshair;
}

/* Video Texture Hidden Feeds */
.compositor-video-feeds {
  display: none;
}

/* Scanline and CRT Raster Overlay */
.broadcast-raster-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  opacity: 0.75;
}

/* Broadcast Compositor Master HUD Header */
.broadcast-hud-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(5,5,8,0.95) 0%, rgba(5,5,8,0.4) 80%, transparent 100%);
  border-bottom: 1px solid var(--bc-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.broadcast-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.broadcast-brand-pill {
  background: var(--bc-accent-red);
  color: #fff;
  font-family: var(--bc-font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse-live 1.5s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(255,24,54,0.8)); }
  50% { opacity: 0.6; filter: drop-shadow(0 0 2px rgba(255,24,54,0.3)); }
}

.broadcast-brand-title {
  font-family: var(--bc-font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  text-transform: uppercase;
}

.broadcast-brand-sub {
  font-family: var(--bc-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bc-accent-yellow);
  text-transform: uppercase;
  margin-left: 6px;
}

/* Channel Mode Selector */
.broadcast-channels {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--bc-glass-border);
}

.channel-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--bc-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.channel-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.channel-btn.is-active {
  background: #fff;
  color: #000;
  box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

/* Master Navigation Links */
.broadcast-hud-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.broadcast-nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.broadcast-nav-link:hover {
  color: var(--bc-accent-cyan);
}

.broadcast-nav-link small {
  color: var(--bc-accent-yellow);
  font-size: 9px;
}

/* Broadcast Regions Grid */
.broadcast-regions-grid {
  position: relative;
  z-index: 10;
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 340px;
  grid-template-rows: 1fr 140px;
  gap: 12px;
  padding: 16px 24px;
  pointer-events: none; /* Allows pointer pass-through to 3D and Splat where panels don't occupy */
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.broadcast-panel {
  pointer-events: auto;
  background: var(--bc-glass);
  border: 1px solid var(--bc-glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.broadcast-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--bc-accent-cyan);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.panel-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bc-accent-yellow);
}

.panel-id {
  font-size: 9px;
  opacity: 0.5;
}

/* NEWSROOM MODE: Telemetry & News Wire */
.newsroom-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.newsroom-feed::-webkit-scrollbar { display: none; }

.news-item {
  padding: 8px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--bc-accent-red);
  transition: background 0.2s;
  cursor: pointer;
}
.news-item:hover {
  background: rgba(255,255,255,0.06);
}
.news-time {
  font-size: 9px;
  color: var(--bc-accent-cyan);
  margin-bottom: 3px;
}
.news-headline {
  font-family: var(--bc-font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  letter-spacing: 0.02em;
}
.news-source {
  font-size: 8px;
  opacity: 0.5;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Center Dominant Viewport Header */
.center-broadcast-hero {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.center-hero-content {
  pointer-events: auto;
  margin-top: auto;
  margin-bottom: 20px;
  max-width: 680px;
}

.giant-broadcast-headline {
  font-family: var(--bc-font-display);
  font-size: clamp(48px, 6.5vw, 92px);
  font-weight: 900;
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
  text-shadow: 0 4px 30px rgba(0,0,0,0.9);
  color: #fff;
}

.giant-broadcast-headline em {
  font-style: normal;
  color: var(--bc-accent-yellow);
}

.giant-broadcast-headline .accent-red {
  color: var(--bc-accent-red);
}

.broadcast-kicker-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.broadcast-kicker-pill {
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.broadcast-kicker-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.08em;
}

.broadcast-action-buttons {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.bc-btn {
  font-family: var(--bc-font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bc-btn-primary {
  background: var(--bc-accent-yellow);
  color: #000;
}
.bc-btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 25px rgba(230,255,0,0.7);
  transform: translateY(-2px);
}

.bc-btn-glass {
  background: rgba(12, 14, 20, 0.7);
  color: #fff;
  border-color: var(--bc-glass-border);
  backdrop-filter: blur(10px);
}
.bc-btn-glass:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  transform: translateY(-2px);
}

/* SYNTHETIC PRESENTER & TIMMY PANEL */
.presenter-panel {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
}

.presenter-stage {
  height: 220px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#presenter-ascii-face {
  font-family: var(--bc-font-mono);
  font-size: 8px;
  line-height: 8px;
  color: var(--bc-accent-gold);
  white-space: pre;
  text-align: center;
  text-shadow: 0 0 8px rgba(245, 197, 66, 0.8);
  user-select: none;
}

.presenter-commentary-box {
  flex: 1;
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-left: 2px solid var(--bc-accent-yellow);
}

.timmy-touch-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 2px;
  font-size: 9px;
  color: var(--bc-accent-cyan);
}

/* BOTTOM TICKER & COMPOSITOR CONTROLS */
.broadcast-bottom-strip {
  grid-column: 1 / 4;
  grid-row: 2 / 3;
  display: flex;
  gap: 12px;
}

.ticker-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ticker-tape-wrap {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-tape {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-slide 35s linear infinite;
  font-family: var(--bc-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  margin-right: 32px;
}

.ticker-item span.up { color: var(--bc-accent-cyan); }
.ticker-item span.down { color: var(--bc-accent-red); }
.ticker-item span.label { color: rgba(255, 255, 255, 0.5); margin-right: 6px; }

@keyframes ticker-slide {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Director Controls Panel */
.director-controls-panel {
  width: 380px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.control-btn-group {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bc-glass-border);
  color: #fff;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}

.icon-btn.is-active {
  background: var(--bc-accent-red);
  border-color: var(--bc-accent-red);
  color: #fff;
}

/* Intensity Selector */
.intensity-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intensity-label {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.intensity-pills {
  display: flex;
  gap: 3px;
}

.intensity-pill {
  width: 14px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.2s;
}

.intensity-pill.active-ambient { background: #00f0ff; }
.intensity-pill.active-active { background: #e6ff00; }
.intensity-pill.active-broadcast { background: #ffaa00; }
.intensity-pill.active-chaos { background: #ff1836; }
.intensity-pill.active-nuclear { background: #ff0077; animation: nuclear-pulse 0.4s infinite alternate; }

@keyframes nuclear-pulse {
  from { filter: drop-shadow(0 0 8px #ff0077); }
  to { filter: drop-shadow(0 0 20px #ff0077); }
}

/* ==========================================================================
   MODE MODIFIERS (NEWSROOM, BROADCAST, CINEMA, CHAOS, AUTO DIRECTOR)
   ========================================================================== */

/* CINEMA MODE: Maximizes 3D Viewport, pulls back HUD */
.mode-cinema .broadcast-panel:not(.center-broadcast-hero):not(.director-controls-panel) {
  opacity: 0.15;
  transform: scale(0.95);
  pointer-events: none;
}
.mode-cinema .center-broadcast-hero {
  opacity: 1;
}
.mode-cinema .broadcast-stage {
  filter: contrast(1.15) saturate(1.1);
}

/* BROADCAST MODE: MTV Style Graphic Ruptures */
.mode-broadcast .giant-broadcast-headline {
  letter-spacing: -0.05em;
  color: var(--bc-accent-yellow);
  text-shadow: 6px 6px 0px var(--bc-accent-red);
}

/* CHAOS MODE: Violent Graphic Tears and Screen Distortions */
.mode-chaos .broadcast-viewport {
  animation: screen-shake 0.3s infinite ease-in-out;
}
.mode-chaos .broadcast-raster-fx {
  opacity: 0.95;
  mix-blend-mode: color-dodge;
}

@keyframes screen-shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
  100% { transform: translate(0, 0); }
}

/* RESPONSIVE DESIGN (Tablets & Mobile) */
@media (max-width: 1024px) {
  .broadcast-regions-grid {
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr 120px;
  }
  .presenter-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  #broadcast-viewport {
    height: 100svh;
  }
  .broadcast-hud-header {
    padding: 8px 14px;
  }
  .broadcast-hud-nav {
    display: none;
  }
  .broadcast-regions-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 10px 14px;
    gap: 8px;
  }
  .newsroom-panel {
    display: none; /* Accessible via mode toggle on mobile */
  }
  .giant-broadcast-headline {
    font-size: 38px;
  }
  .broadcast-bottom-strip {
    flex-direction: column;
    gap: 6px;
  }
  .director-controls-panel {
    width: 100%;
  }
}
