/* CRT monitor widget — styles for the cyberpunk video screen.
   Markup lives in index.html (the .crt-monitor-wrap block).
   Behavior lives in crt-widget.js. */

.crt-monitor-wrap {
    margin: 18px 0 0;
    border-top: 1px solid var(--border-dim);
    padding-top: 14px;
}

.crt-monitor-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.crt-widget {
    width: 100%;
    margin: 0 auto;
}

.crt-tv {
    background: #09091a;
    border: 1px solid rgba(0, 245, 212, 0.28);
    box-shadow:
        0 0 28px rgba(0, 245, 212, 0.1),
        0 0 90px rgba(0, 245, 212, 0.03),
        inset 0 0 40px rgba(0, 0, 0, 0.75);
    padding: 18px 18px 12px;
}

.tv-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tv-brand {
    font-family: 'VT323', monospace;
    font-size: 17px;
    color: rgba(0, 245, 212, 0.35);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.tv-signal {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.tv-signal.live {
    color: var(--pink);
    text-shadow: 0 0 6px rgba(255, 45, 122, 0.5);
}

.tv-signal.live::before {
    content: '● ';
    animation: signal-pulse 1.4s ease-in-out infinite;
}

@keyframes signal-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

/* 16:9 aspect ratio container */
.screen-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
    animation: screen-flicker 7s linear infinite;
}

@keyframes screen-flicker {
    0%, 94%  { opacity: 1; }
    94.5%    { opacity: 0.91; }
    95%      { opacity: 1; }
    97.5%    { opacity: 0.96; }
    100%     { opacity: 1; }
}

#noise-canvas,
#screen-video,
#screen-iframe,
.aperture-grille,
.crt-scanlines,
.crt-vignette,
.screen-edge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#screen-video {
    object-fit: cover;
    display: none;
}

#screen-iframe {
    border: none;
    display: none;
}

.aperture-grille {
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 50, 50,  0.05) 0px,
        rgba(255, 50, 50,  0.05) 1px,
        rgba(50,  255, 50, 0.05) 1px,
        rgba(50,  255, 50, 0.05) 2px,
        rgba(50,  50,  255,0.05) 2px,
        rgba(50,  50,  255,0.05) 3px
    );
    pointer-events: none;
    z-index: 3;
}

.crt-scanlines {
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.18) 0px,
        rgba(0, 0, 0, 0.18) 2px,
        rgba(0, 0, 0, 0.02) 2px,
        rgba(0, 0, 0, 0.02) 4px
    );
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: multiply;
}

.crt-vignette {
    background: radial-gradient(
        ellipse at 38% 32%,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.01) 28%,
        rgba(0,   0,   0,   0.55) 82%,
        rgba(0,   0,   0,   0.90) 100%
    );
    pointer-events: none;
    z-index: 5;
}

.screen-edge {
    box-shadow: inset 0 0 16px rgba(0, 245, 212, 0.06);
    pointer-events: none;
    z-index: 6;
}

.crt-beam {
    position: absolute;
    left: 0;
    top: -130px;
    width: 100%;
    height: 130px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 245, 212, 0.025) 35%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(0, 245, 212, 0.025) 65%,
        transparent 100%
    );
    filter: blur(5px);
    pointer-events: none;
    z-index: 7;
    animation: beam-sweep 9s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

@keyframes beam-sweep {
    0%   { top: -130px; opacity: 0;   }
    8%   {              opacity: 0.7; }
    48%  { top: 45%;    opacity: 0.4; }
    62%  { top: 45%;    opacity: 0.9; }
    78%  { top: 105%;   opacity: 0;   }
    100% { top: 105%;   opacity: 0;   }
}

.tv-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(0, 245, 212, 0.07);
}

.tv-dots {
    display: flex;
    gap: 5px;
}

.tv-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 245, 212, 0.15);
    border: 1px solid rgba(0, 245, 212, 0.12);
}

.tv-channel {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: rgba(0, 245, 212, 0.3);
    letter-spacing: 3px;
}

.tv-knobs {
    display: flex;
    gap: 6px;
}

.tv-knob {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255, 45, 122, 0.25);
    background: rgba(255, 45, 122, 0.06);
}

.crt-controls {
    margin-top: 10px;
    border: 1px solid var(--border-dim);
    padding: 12px 14px;
    background: rgba(7, 7, 15, 0.9);
}

.ctrl-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.ctrl-row {
    display: flex;
    gap: 6px;
}

.ctrl-input {
    flex: 1;
    background: rgba(0, 245, 212, 0.03);
    border: 1px solid rgba(0, 245, 212, 0.18);
    color: var(--cyan);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    padding: 6px 10px;
    outline: none;
    letter-spacing: 1px;
    min-width: 0;
}

.ctrl-input::placeholder { color: rgba(0, 245, 212, 0.18); }

.ctrl-input:focus {
    border-color: rgba(0, 245, 212, 0.45);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.08);
}

.ctrl-btn {
    background: rgba(255, 45, 122, 0.08);
    border: 1px solid rgba(255, 45, 122, 0.38);
    color: var(--pink);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.ctrl-btn:hover {
    background: rgba(255, 45, 122, 0.18);
    box-shadow: 0 0 10px rgba(255, 45, 122, 0.18);
}

.ctrl-btn.dim {
    color: rgba(255, 45, 122, 0.35);
    border-color: rgba(255, 45, 122, 0.18);
}

.ctrl-hint {
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-type-badge {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 1px 6px;
    border: 1px solid transparent;
    display: none;
}

.url-type-badge.youtube,
.url-type-badge.direct {
    display: inline-block;
    color: var(--cyan);
    border-color: rgba(0, 245, 212, 0.3);
    background: rgba(0, 245, 212, 0.05);
}

.url-type-badge.unknown {
    display: inline-block;
    color: var(--text-dim);
    border-color: rgba(184, 184, 208, 0.15);
}
