#crt-screen {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
}

#crt-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.65) 100%);
  z-index: 9998;
  pointer-events: none;
}

#crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

#crt-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 16, 16, 0.05);
  animation: crt-flicker 0.15s infinite;
  opacity: 0;
}

#crt-overlay.no-flicker::after {
  animation-play-state: paused;
}

#crt-overlay.no-scanlines {
  background: none !important;
}

@keyframes crt-flicker {
  0% { opacity: 0.05; }
  5% { opacity: 0.03; }
  10% { opacity: 0.06; }
  15% { opacity: 0.02; }
  20% { opacity: 0.05; }
  25% { opacity: 0.04; }
  30% { opacity: 0.06; }
  35% { opacity: 0.03; }
  40% { opacity: 0.05; }
  50% { opacity: 0.04; }
  60% { opacity: 0.06; }
  70% { opacity: 0.03; }
  80% { opacity: 0.05; }
  90% { opacity: 0.04; }
  100% { opacity: 0.05; }
}

@keyframes crt-glow {
  0%, 100% {
    text-shadow: 0 0 4px #33ff33, 0 0 8px #33ff33, 0 0 16px rgba(51,255,51,0.3);
  }
  50% {
    text-shadow: 0 0 6px #33ff33, 0 0 12px #33ff33, 0 0 20px rgba(51,255,51,0.4);
  }
}

@keyframes crt-scanline-move {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

#boot-screen, #os, #shutdown-screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#boot-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  animation: crt-glow 3s ease-in-out infinite;
}

#boot-text {
  white-space: pre-wrap;
  line-height: 2;
  font-size: 12px;
}

#boot-progress {
  margin-top: 30px;
  width: 400px;
  max-width: 80%;
  height: 16px;
  border: 2px solid #33ff33;
  padding: 2px;
  display: none;
}

#boot-progress-bar {
  width: 0%;
  height: 100%;
  background: #33ff33;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px #33ff33, 0 0 16px rgba(51,255,51,0.5);
}

#shutdown-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 10000;
}

#shutdown-text {
  font-size: 14px;
  animation: crt-glow 2s ease-in-out infinite;
}
