/* ===== CRT / VHS Overlay Effects ===== */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 45; /* under UI panels (50), above game */
  pointer-events: none;
  overflow: hidden;
}

/* Low-quality / mobile: drop scanline fill + flicker animation (GPU compositing) */
.crt-lite .crt-scanlines,
.crt-lite .crt-flicker {
  display: none;
}
.crt-lite .crt-vignette {
  opacity: 0.55;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  opacity: 0.28;
}

.crt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 58%,
    rgba(40, 22, 10, 0.18) 82%,
    rgba(20, 10, 5, 0.38) 100%
  );
}

/* Full-screen flicker removed — it read as a seizure-y flash when idle.
   Keep scanlines + vignette only for CRT mood. */
.crt-flicker {
  display: none;
}

/* CRT screen treatment for media panel */
.crt-screen {
  position: relative;
}

.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 6px
  );
  border-radius: inherit;
}

.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  border-radius: inherit;
}
