/* ------------------------------
   GLOBAL LAYOUT
--------------------------------*/
body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: 'Orbitron', sans-serif;
    color: #0ff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#tv-wrapper {
    width: 95%;
    max-width: 900px;
    display: flex;
    justify-content: center;
}

/* ------------------------------
   TV BODY
--------------------------------*/
/* Layout: screen left, controls right */
#tv-body {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background: #111;
    border: 6px solid #333;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 40px #0ff, inset 0 0 40px #000;
    gap: 30px;
}

/* Larger 4:3 screen */
#tv-screen {
    flex: 1;
    max-width: 700px;
    aspect-ratio: 4 / 3;
    position: relative;
    min-width: 300px;
    background: #000;
    border: 4px solid magenta;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px #0ff, inset 0 0 40px #000;
    align-self: flex-start;

    /* psychedelic effects */
    animation: hueShift 12s linear infinite;
    filter: brightness(1.2) contrast(1.1) saturate(1.4);
}


#tv-screen video,
#tv-screen img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}



/* Control panel on right */
#control-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    background: #000;
    border: 3px solid magenta;
    border-radius: 12px;
    padding: 20px;
    width: 150px;
    box-shadow: 0 0 20px #0ff inset;
}

/* Power button */
.power-knob {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid magenta;
    background: radial-gradient(circle at 30% 30%, #333 0%, #000 70%);
    color: #0ff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 0 20px magenta inset, 0 0 10px magenta;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* Dials */
.dial-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.dial {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #0ff;
    background: radial-gradient(circle at 30% 30%, #444 0%, #000 70%);
    box-shadow: 0 0 15px #0ff inset, 0 0 10px #0ff;
    cursor: grab;
    transition: transform 0.1s linear;
}

.dial-label {
    margin-top: 8px;
    font-size: 14px;
    text-shadow: 0 0 10px #0ff;
}

/* ------------------------------
   CRT EFFECTS
--------------------------------*/

/* Scanlines */
#tv-screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;

    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0) 3px
    );
    mix-blend-mode: multiply;
}

/* Vignette */
#tv-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center,
        rgba(0,0,0,0) 40%,
        rgba(0,0,0,0.6) 100%);
}

@keyframes hueShift {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

@keyframes rgbSplit {
    0%   { filter: drop-shadow(2px 0 red) drop-shadow(-2px 0 cyan); }
    50%  { filter: drop-shadow(-2px 0 red) drop-shadow(2px 0 cyan); }
    100% { filter: drop-shadow(2px 0 red) drop-shadow(-2px 0 cyan); }
}

/* -----------------------------------------
   PSYCHEDELIC EFFECT MODES
----------------------------------------- */

/* MODE 1 — Hue Rotation */
.effect-hue {
    animation: hueShift 12s linear infinite;
    filter: brightness(1.2) contrast(1.1) saturate(1.4);
}

@keyframes hueShift {
    from { filter: hue-rotate(0deg) brightness(1.2) contrast(1.1) saturate(1.4); }
    to   { filter: hue-rotate(360deg) brightness(1.2) contrast(1.1) saturate(1.4); }
}

/* MODE 2 — RGB Split */
.effect-rgb::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: rgbSplit 4s infinite;
}

@keyframes rgbSplit {
    0%   { filter: drop-shadow(2px 0 red) drop-shadow(-2px 0 cyan); }
    50%  { filter: drop-shadow(-2px 0 red) drop-shadow(2px 0 cyan); }
    100% { filter: drop-shadow(2px 0 red) drop-shadow(-2px 0 cyan); }
}

/* MODE 3 — Warp Pulse */
.effect-warp {
    animation: warpPulse 6s ease-in-out infinite;
}

@keyframes warpPulse {
    0%   { transform: scale(1) skew(0deg); }
    50%  { transform: scale(1.03) skew(1deg, -1deg); }
    100% { transform: scale(1) skew(0deg); }
}
