/* ===================== */
/*   Corruption Effects  */
/* ===================== */

/* Scanlines overlay */
.scanlines::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.1) 2px,
    rgba(0,0,0,0.1) 4px
  );
  pointer-events: none;
  z-index: 9990;
}

/* Chromatic aberration - mild */
.chromatic-mild {
  text-shadow: -1px 0 rgba(255,0,0,0.08), 1px 0 rgba(0,0,255,0.08);
}

/* Chromatic aberration - heavy */
.chromatic-heavy {
  text-shadow: -2px 0 rgba(255,0,0,0.15), 2px 0 rgba(0,0,255,0.15);
}

/* Chromatic aberration - intense */
.chromatic-intense {
  text-shadow: -3px 0 rgba(255,0,0,0.25), 3px 0 rgba(0,0,255,0.25);
}

/* Color shift - subtle hue rotation */
.color-shift {
  animation: colorShift 10s ease-in-out infinite;
}

@keyframes colorShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(5deg); }
}

/* Screen tear effect */
.screen-tear {
  animation: screenTear 4s steps(1) infinite;
}

@keyframes screenTear {
  0%, 93%, 100% { clip-path: none; transform: none; }
  94% { clip-path: polygon(0 38%, 100% 38%, 100% 42%, 0 42%); transform: translateX(8px); }
  95% { clip-path: polygon(0 63%, 100% 63%, 100% 66%, 0 66%); transform: translateX(-5px); }
  96% { clip-path: none; transform: none; }
}

/* Text jitter */
.text-jitter {
  animation: textJitter 0.15s steps(2) infinite;
}

@keyframes textJitter {
  0% { transform: translate(0, 0); }
  50% { transform: translate(0.5px, -0.5px); }
  100% { transform: translate(-0.5px, 0.5px); }
}

/* Window drift - subtle random movement */
.window-drift {
  animation: windowDrift 8s ease-in-out infinite;
}

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

/* Cursor trail effect (applied via JS) */
.cursor-trail {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(200,200,212,0.15);
  pointer-events: none;
  z-index: 99999;
  animation: cursorFade 0.5s forwards;
}

@keyframes cursorFade {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.3); }
}

/* Black flash */
.black-flash {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 99990;
  pointer-events: none;
  animation: blackFlash 0.1s forwards;
}

@keyframes blackFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Invert pulse */
.invert-pulse {
  animation: invertPulse 5s steps(1) infinite;
}

@keyframes invertPulse {
  0%, 98%, 100% { filter: none; }
  99% { filter: invert(1); }
}

/* Glitch block effect */
.glitch-block {
  position: fixed;
  pointer-events: none;
  z-index: 9989;
  mix-blend-mode: screen;
}

/* Static noise overlay */
.static-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9988;
  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.4'/%3E%3C/svg%3E");
  animation: staticFlicker 0.1s steps(2) infinite;
}

@keyframes staticFlicker {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
  100% { transform: translate(1px, -1px); }
}

/* Window breathing effect for taskbar */
.window-breathing {
  animation: windowBreathing 3s ease-in-out infinite;
}

@keyframes windowBreathing {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Peripheral text - barely visible */
.peripheral-text {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 11px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  color: var(--os-text);
}

/* Face flash (ASCII art) */
.face-flash {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 99991;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.face-flash pre {
  font-family: var(--font-mono);
  font-size: 16px;
  color: rgba(200,200,200,0.6);
  line-height: 1.2;
}

/* Corruption color overrides by horror level */
.corruption-3 { --os-bg: #181828; }
.corruption-4 { --os-bg: #151520; --os-text: #c0c8c4; }
.corruption-5 { --os-bg: #121218; --os-text: #b8c8b8; }
.corruption-6 { --os-bg: #101015; --os-text: #b0d0b0; --os-border: #302030; }
.corruption-7 { --os-bg: #0e0e12; --os-text: #a8d8a8; --os-accent: #7a4040; --os-border: #3a1a2a; }
.corruption-8 { --os-bg: #0c0c10; --os-text: #a0e0a0; --os-accent: #8a3030; --os-border: #4a1a1a; }
.corruption-9 { --os-bg: #0a0a0e; --os-text: #98e898; --os-accent: #9a2a2a; --os-border: #501515; }
.corruption-10 { --os-bg: #050508; --os-text: #90f090; --os-accent: #aa2020; --os-border: #601010; }
