:root {
    --phosphor: #39ff14;
    --phosphor-dim: #1a5e0b;
    --font-term: 'Courier New', Courier, monospace;

    /* ==============================================================
       🟢 FLICKER SETTINGS 🟢
       To make the flicker more noticeable, lower the "low" and "mid" 
       opacity values (e.g., to 0.7 or 0.5). 
       To change the speed, adjust --flicker-speed.
       ============================================================== */
    --flicker-opacity-high: 1;
    --flicker-opacity-mid: 0.90;
    --flicker-opacity-low: 0.85; 
    --flicker-speed: .33s;
}

body {
    margin: 0;
    background-color: #000;
    background-image: url('background.png');
    background-size: contain;
    background-position: center;
    background-attachment: fixed;
    
    color: var(--phosphor);
    font-family: var(--font-term);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

/* --- MONITOR FRAME SETUP --- */
.monitor-container {
    position: relative;
    width: 90vw;
    max-width: 1000px;
    aspect-ratio: 4 / 3;
    filter: drop-shadow(0px 20px 50px rgba(0,0,0,0.8));
}

/* --- THE SOLID BLACK BACKDROP --- */
/* This sits perfectly behind the flickering screen so stars don't bleed through */
.monitor-container::before {
    content: "";
    position: absolute;
    top: 9%; left: 8%;
    width: 84%; height: 80%;
    background-color: #050505;
    z-index: 0; /* Keeps it behind the screen content (z-index: 1) */
}

.monitor-frame {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* STATE: Monitor is ON */
body.monitor-on .monitor-frame {
    background-image: url('crt_on.png'); 
}

/* STATE: Monitor is OFF */
body.monitor-off .monitor-frame {
    background-image: url('crt_off.png'); 
}

/* Invisible Hitbox over the monitor's power button */
.power-btn-hitbox {
    position: absolute;
    bottom: 0%;
    right: 10%;
    width: 8%;
    height: 7%;
    cursor: pointer;
    z-index: 100;
}

/* --- THE ACTUAL SCREEN CONTENT --- */
.screen-content {
    position: absolute;
    top: 9%; left: 8%;
    width: 84%; height: 80%;
    z-index: 1;
    
    background-color: #050505; 
    padding: 3%;
    box-sizing: border-box;
    overflow-y: auto;
    
    text-shadow: 0 0 5px var(--phosphor), 0 0 10px var(--phosphor-dim);
    /* Flicker animation is now powered by the variables above */
    animation: textFlicker var(--flicker-speed) infinite;
}

.screen-content::-webkit-scrollbar { width: 8px; }
.screen-content::-webkit-scrollbar-thumb { background: var(--phosphor-dim); border-radius: 4px; }

/* --- CRT EFFECTS --- */
.crt-scanlines {
    position: absolute;
    top: 9%; left: 8%; 
    width: 84%; height: 80%;
    z-index: 5;
    pointer-events: none;
    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%;
}

@keyframes textFlicker {
    0% { opacity: var(--flicker-opacity-low); }
    50% { opacity: var(--flicker-opacity-high); }
    100% { opacity: var(--flicker-opacity-mid); }
}

/* --- UI ELEMENTS --- */
a { color: var(--phosphor); text-decoration: none; }
a:hover, a.active {
    background-color: var(--phosphor);
    color: #000;
    text-shadow: none;
}
.nav-menu {
    border-bottom: 1px dashed var(--phosphor);
    padding-bottom: 0.5rem; margin-bottom: 1.5rem; font-size: 0.9rem;
}
.nav-menu span { margin-right: 1rem; }
h1, h2 { font-weight: normal; font-size: 1.5rem; margin: 0 0 0.5rem 0; }
p { font-size: 0.9rem; line-height: 1.4; margin-top: 0; }
ul.tree { list-style-type: none; padding-left: 1rem; border-left: 1px dashed var(--phosphor); font-size: 0.9rem; }
ul.tree li::before { content: "|-- "; }
.blink { animation: blinker 1s step-start infinite; }
@keyframes blinker { 50% { opacity: 0; } }