/* ============================================
   CRT Monitor Effect
   ============================================ */

#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  z-index: 1;
}

/* Screen flicker */
.crt-flicker {
  position: absolute;
  inset: 0;
  animation: flicker 0.15s infinite;
  z-index: 2;
  opacity: 0;
}

@keyframes flicker {
  0%   { opacity: 0; }
  5%   { opacity: 0.015; background: rgba(255,255,255,0.02); }
  10%  { opacity: 0; }
  40%  { opacity: 0; }
  42%  { opacity: 0.01; background: rgba(255,255,255,0.015); }
  44%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Vignette (curved monitor edges) */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.25) 85%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 3;
}

/* Subtle colour fringing / chromatic aberration on text */
#desktop {
  text-shadow:
    0.4px 0 rgba(255, 0, 0, 0.06),
    -0.4px 0 rgba(0, 255, 255, 0.06);
}

/* Screen curvature illusion via a very subtle barrel distortion border */
#crt-overlay::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.15),
    inset 0 0 20px rgba(0,0,0,0.1);
  z-index: 4;
}

/* CRT disabled state */
#crt-overlay.crt-disabled {
  display: none;
}
#crt-overlay.crt-disabled ~ #desktop {
  text-shadow: none;
}
