.crt-screen__signal-grid,
.crt-screen__static,
.crt-screen__sync,
.crt-screen__scanlines,
.crt-screen__reflection,
.crt-screen__glass { position: absolute; inset: 0; pointer-events: none; }

.crt-screen__signal-grid {
    z-index: 1;
    opacity: 0.2;
    background:
        linear-gradient(90deg, transparent 49.8%, var(--crt-accent) 50%, transparent 50.2%),
        linear-gradient(transparent 49.8%, var(--crt-accent) 50%, transparent 50.2%);
    background-size: 6rem 6rem;
    mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 78%);
}

.crt-screen__static {
    z-index: 2;
    opacity: 0.18;
    background:
        repeating-radial-gradient(circle at 17% 32%, rgb(255 255 255 / 9%) 0 1px, transparent 1px 3px),
        repeating-radial-gradient(circle at 74% 68%, rgb(var(--crt-rgb) / 9%) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(113deg, transparent 0 3px, rgb(255 255 255 / 3%) 3px 4px);
    background-size: 2.7rem 2.1rem, 3.1rem 2.4rem, 0.9rem 0.9rem;
    mix-blend-mode: screen;
}

.crt-screen__sync {
    z-index: 3;
    top: -18%;
    bottom: auto;
    height: 14%;
    opacity: 0;
    background: linear-gradient(transparent, rgb(var(--crt-rgb) / 14%), transparent);
    filter: blur(0.2rem);
}

.crt-screen__scanlines {
    z-index: 6;
    opacity: 0.48;
    background: repeating-linear-gradient(0deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 4px);
    mix-blend-mode: screen;
}

.crt-screen__reflection {
    z-index: 7;
    opacity: 0.7;
    background:
        radial-gradient(ellipse at 18% 4%, rgb(255 255 255 / 15%), transparent 24%),
        linear-gradient(112deg, rgb(255 255 255 / 8%), transparent 24% 70%, rgb(255 255 255 / 4%));
    transform: translateX(-4%);
}

.crt-screen__glass {
    z-index: 8;
    border-radius: inherit;
    box-shadow:
        inset 1.2rem 0 2rem rgb(0 0 0 / 32%),
        inset -1.2rem 0 2rem rgb(0 0 0 / 35%),
        inset 0 1rem 2rem rgb(255 255 255 / 3%),
        inset 0 -1rem 2.4rem rgb(0 0 0 / 42%);
}

.signal-channel.is-active .crt-screen__static { animation: crt-static 320ms steps(2, end) infinite; }
.signal-channel.is-active .crt-screen__sync { animation: crt-vertical-sync 6.8s linear infinite 1.1s; }

@keyframes crt-static {
    0% { background-position: 0 0, 0 0, 0 0; opacity: 0.1; }
    25% { background-position: 0.4rem -0.2rem, -0.35rem 0.2rem, 0.1rem 0; opacity: 0.16; }
    50% { background-position: -0.25rem 0.35rem, 0.3rem -0.1rem, -0.1rem 0.1rem; opacity: 0.08; }
    75% { background-position: 0.15rem 0.1rem, -0.1rem -0.3rem, 0 0.1rem; opacity: 0.13; }
    100% { background-position: 0 0, 0 0, 0 0; opacity: 0.1; }
}

@keyframes crt-vertical-sync {
    0%, 82% { top: -18%; opacity: 0; }
    84% { opacity: 0.5; }
    94% { top: 104%; opacity: 0.18; }
    100% { top: 104%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .signal-channel.is-active .crt-screen__static,
    .signal-channel.is-active .crt-screen__sync { animation: none; }
    .crt-screen__static { opacity: 0.08; }
    .crt-screen__sync { display: none; }
}
