/* ============================================================
   MERCER WORLDWIDE WAR ROOM — CRT EFFECTS
   ============================================================ */

/* ===== CRT SCAN LINES ===== */
.crt-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.4;
}

/* ===== CRT FLICKER ===== */
.crt-scanlines::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: crt-flicker 0.1s infinite;
  opacity: 0;
}

@keyframes crt-flicker {
  0% {
    opacity: 0.02;
  }
  5% {
    opacity: 0.03;
  }
  10% {
    opacity: 0;
  }
  15% {
    opacity: 0.02;
  }
  20% {
    opacity: 0;
  }
  50% {
    opacity: 0.01;
  }
  80% {
    opacity: 0.03;
  }
  95% {
    opacity: 0;
  }
  100% {
    opacity: 0.02;
  }
}

/* ===== SCREEN GLOW ===== */
body {
  box-shadow:
    inset 0 0 80px rgba(0, 255, 65, 0.03),
    inset 0 0 160px rgba(0, 229, 255, 0.02);
}

#dashboard {
  text-shadow: 0 0 1px rgba(0, 255, 65, 0.15);
}

/* ===== GREEN PHOSPHOR TEXT GLOW ===== */
.header-title,
.clock-value,
.panel-title,
.hormuz-status-value,
.hormuz-stat-value,
.operation-name {
  text-shadow:
    0 0 4px currentColor,
    0 0 8px currentColor,
    0 0 16px rgba(0, 255, 65, 0.2);
}

.alert-level {
  text-shadow: 0 0 4px currentColor;
}

.mkt-col-price {
  text-shadow: 0 0 3px rgba(224, 224, 224, 0.3);
}

.price-up {
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.4);
}

.price-down {
  text-shadow: 0 0 4px rgba(255, 0, 64, 0.4);
}

/* ===== STATIC / NOISE OVERLAY (toggle with class) ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  transition: opacity 0.3s ease;
}

body.show-static::before {
  opacity: 1;
  animation: static-noise 0.15s steps(5) infinite;
}

@keyframes static-noise {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}

/* ===== VIGNETTE EFFECT ===== */
.crt-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.25) 80%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* ===== SCREEN CURVATURE ILLUSION ===== */
#dashboard {
  position: relative;
}

#dashboard::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9996;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 80%,
    rgba(0, 0, 0, 0.15) 100%
  );
  border-radius: 12px;
}

/* ===== SUBTLE HORIZONTAL SCAN BAR ===== */
.crt-scanlines::before {
  content: '';
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 255, 65, 0.04),
    transparent
  );
  pointer-events: none;
  animation: scan-bar 8s linear infinite;
  z-index: 9999;
}

@keyframes scan-bar {
  0% {
    top: -2%;
  }
  100% {
    top: 102%;
  }
}

/* ===== PANEL SCREEN GLOW ===== */
.panel {
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 3px rgba(0, 255, 65, 0.08),
    0 0 8px rgba(0, 255, 65, 0.04);
}

.panel:hover {
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 5px rgba(0, 255, 65, 0.12),
    0 0 15px rgba(0, 255, 65, 0.06);
}

/* ===== RGB SUBPIXEL EFFECT ON KEY ELEMENTS ===== */
.classification-text {
  text-shadow:
    -0.5px 0 rgba(255, 0, 0, 0.3),
    0.5px 0 rgba(0, 0, 255, 0.3),
    0 0 4px currentColor;
}

/* ===== BOOT SCREEN CRT EFFECTS ===== */
#boot-screen {
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.boot-text {
  text-shadow:
    0 0 3px rgba(0, 255, 65, 0.5),
    0 0 6px rgba(0, 255, 65, 0.2);
}
