/* --- SHARED RETRO AESTHETIC --- */
:root {
    --color-primary: #33ff00;
    /* Green Phosphor */
    --color-bg: #050505;
    /* CRT Black */
    --color-grid: #1a331a;
    /* Dark Green borders */
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --glow: 0 0 10px rgba(51, 255, 0, 0.5);
}

body {
    background-color: #000;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: var(--font-mono);
    color: var(--color-primary);
    overflow: hidden;
    /* Global Phosphor Glow */
    text-shadow: 0 0 2px rgba(51, 255, 0, 0.4);
}

/* The "Monitor" casing */
.main-container {
    position: relative;
    width: 90vw;
    height: 85vh;
    border: 2px solid var(--color-primary);
    background-color: var(--color-bg);
    box-shadow:
        0 0 20px rgba(51, 255, 0, 0.1),
        inset 0 0 40px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* CRT Scanline & Vignette Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    /* Allows clicking buttons underneath */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
    z-index: 100;
}

/* Header / Status Bar */
header {
    padding: 12px 20px;
    border-bottom: 2px solid var(--color-grid);
    background: rgba(0, 20, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    /* Don't shrink */
    z-index: 50;
}

.brand {
    font-size: 18px;
    letter-spacing: 1px;
}

.brand .meta {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 10px;
}

#views {
    position: relative;
    flex-grow: 1;
    width: 100%;
    overflow: hidden;
    background: transparent;
    z-index: 1;
    /* Sit above background */
}

.animation-view {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.animation-view canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Retro Controls --- */
.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
}

/* Custom Checkbox Look */
.checkbox-wrapper {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-wrapper input {
    display: none;
    /* Hide real checkbox */
}

.checkmark {
    font-weight: bold;
}

.checkbox-wrapper input:not(:checked)+.checkmark {
    content: "[ ]";
    opacity: 0.5;
}

.checkbox-wrapper input:checked+.checkmark {
    text-shadow: 0 0 8px var(--color-primary);
}

.button-group {
    display: flex;
    gap: 1px;
    /* Tight fit for blocky look */
    background: var(--color-primary);
    padding: 1px;
}

button {
    background: #000;
    border: none;
    color: var(--color-primary);
    padding: 5px 15px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
}

button:hover {
    background: var(--color-primary);
    color: #000;
}

button:active {
    transform: translateY(1px);
}

/* Metadata overlay inside the view */
.metadata {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 12px;
    text-align: right;
    color: var(--color-primary);
    opacity: 0.7;
    z-index: 10;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px;
    border: 1px solid var(--color-grid);
}


#audioControls {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    background-color: var(--color-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    font-family: var(--font-mono);
    padding: 4px 8px;
    font-size: 12px;
    text-transform: uppercase;
    outline: none;
    cursor: pointer;
    max-width: 150px;
    /* Limit width so it doesn't break layout */
}

select:hover {
    background-color: #0f1f0f;
    box-shadow: 0 0 5px var(--color-primary);
}

select option {
    background-color: #000;
    color: var(--color-primary);
}

/* --- 1. GLOBAL BACKGROUND (Deep Nebula) --- */
.global-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #030305;
    /* Base deep black */
    overflow: hidden;
    z-index: 2;
    opacity: 0.8;
    /* Optional: "Screen" mode makes the colors glow on top of white lines */
    mix-blend-mode: screen;

    /* Ensure we can still click buttons underneath */
    pointer-events: none;
}

.nebula-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Heavy blur for soft gradient look */
    opacity: 0.6;
    animation: nebulaFloat 25s infinite alternate ease-in-out;
}

/* Blob 1: Cyber Purple */
.blob-1 {
    top: -20%;
    left: -10%;
    width: 70vw;
    height: 70vh;
    background: #50208e;
}

/* Blob 2: Deep Teal */
.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 80vw;
    height: 60vh;
    background: #09707a;
    animation-duration: 35s;
    /* Different speed */
    animation-delay: -5s;
}

/* Blob 3: Night Blue */
.blob-3 {
    top: 40%;
    left: 30%;
    width: 50vw;
    height: 50vh;
    background: #152c9d;
    animation-duration: 28s;
    animation-delay: -12s;
}

@keyframes nebulaFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, 50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(10px, -30px) scale(1);
    }
}