:root {
  --glitch-color: rgba(255, 255, 255, 0.05);
}

.vcr-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

/* Moving Scanlines */
.scanlines {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.1) 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, 3px 100%;
}

/* The Grain/Static Effect */
.noise {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url('https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ3dqajlhdDFzN3YxdzdtMGFoamdxcWNuOGY3MmdocXBpMjcyanAzMyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/5Puwg4f1q4Pm9nfE8w/giphy.gif'); /* Replace with a subtle grain texture */
  opacity: 0.1;
}

/* Rounded CRT edges */
.vignette {
  position: absolute;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 150px rgba(0,0,0,0.6);
  background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.644) 100%);
}

.osd, .osd-timestamp {
  position: absolute;
  font-family: 'Courier New', Courier, monospace; /* Use a VCR font if possible */
  color: #eee;
  text-shadow: 2px 2px #000;
  font-size: 1.5rem;
  padding: 20px;
}

.osd-timestamp { bottom: 0; right: 0; }

.heavy-glitch {
    position: relative;
    animation: tear 0.2s infinite;
    filter: invert(1) contrast(300%) brightness(200%);
}

@keyframes tear {
    0% { clip-path: inset(10% 0 30% 0); transform: translateX(-20px); }
    20% { clip-path: inset(40% 0 10% 0); transform: translateX(20px); }
    40% { clip-path: inset(0% 0 70% 0); transform: translateX(-10px); }
    60% { clip-path: inset(80% 0 0% 0); transform: translateX(30px); }
    100% { clip-path: inset(0); transform: translateX(0); }
}

/* The Horizontal Tear Effect */
.vcr-tear {
    animation: tear 0.3s infinite;
    clip-path: inset(10% 0 10% 0); /* Slices the view */
}

@keyframes tear {
    0% { clip-path: inset(20% 0 50% 0); transform: translateX(-5px); }
    20% { clip-path: inset(80% 0 10% 0); transform: translateX(5px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translateX(-10px); }
    60% { clip-path: inset(10% 0 70% 0); transform: translateX(10px); }
    100% { clip-path: inset(30% 0 20% 0); transform: translateX(0); }
}

/* The Dead State */
/* The deep VCR blue */
.bsod-mode {
    background-color: #0000ab !important; 
    color: white !important;
}

.bsod-mode .vcr-screen {
    opacity: 0.8; /* Keep the scanlines visible over the blue */
}

.no-signal-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
}

.blue-screen-text h1 {
    font-size: 5rem;
    background: white;
    color: #0000ab;
    padding: 10px 40px;
    display: inline-block;
    margin-bottom: 20px;
}

.blue-screen-text p {
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}