/* ============================================================
   CRT SCREEN EFFECTS
   Authentic Minitel CRT: cyan phosphor, scanlines, curvature
   ============================================================ */

/* Screen base - deep CRT recess with cyan ambient glow */
.minitel-screen {
  border-radius: 10px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.4),
    inset 0 0 8px rgba(0, 0, 0, 0.5),
    /* Phosphor ambient glow leaking from screen */
    0 0 30px rgba(48, 255, 255, 0.06),
    0 0 80px rgba(48, 255, 255, 0.03),
    0 0 120px rgba(48, 255, 255, 0.015);
}

/* Scanlines */
.crt-scanlines {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
}

/* Scanning bar */
.crt-scanline-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 11;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(48, 255, 255, 0.02) 30%,
    rgba(48, 255, 255, 0.035) 50%,
    rgba(48, 255, 255, 0.02) 70%,
    transparent 100%);
  animation: scanbar 7s linear infinite;
}

@keyframes scanbar {
  0%   { top: -6px; }
  100% { top: 100%; }
}

/* Vignette - very subtle CRT edge darkening */
.crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 90% 85% at 50% 50%,
    transparent 65%,
    rgba(0, 10, 10, 0.18) 100%
  );
}

/* Glass reflection - disabled (caused visual artifact) */

/* Subtle flicker */
.minitel-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  border-radius: inherit;
  animation: flicker 0.12s infinite;
  opacity: 0;
}

@keyframes flicker {
  0%   { opacity: 0; background: rgba(48, 255, 255, 0.005); }
  50%  { opacity: 1; background: rgba(48, 255, 255, 0.01); }
  100% { opacity: 0; background: rgba(48, 255, 255, 0.005); }
}

/* Screen warm-up */
.minitel-screen.warming-up {
  animation: screen-warmup 1.2s ease-out forwards;
}

@keyframes screen-warmup {
  0%   { filter: brightness(0) saturate(0); }
  20%  { filter: brightness(0.2) saturate(0.3); }
  60%  { filter: brightness(0.7) saturate(0.8); }
  100% { filter: brightness(1) saturate(1); }
}

/* Turn-on flash */
.minitel-screen.flash-on .crt-vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(48, 255, 255, 0.08);
  animation: flash-fade 0.3s ease-out forwards;
  pointer-events: none;
  border-radius: inherit;
}

@keyframes flash-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  .crt-scanline-bar { animation: none; display: none; }
  .minitel-screen::before { animation: none; display: none; }
  .minitel-screen.warming-up { animation: none; filter: brightness(1); }
  .minitel-screen.flash-on .crt-vignette::after { animation: none; display: none; }
  .crt-scanlines { opacity: 0.3; }
}
