/* --- Chosen Palette: Monochrome Amber/Green --- */
:root {
    --crt-green: #33ff00;
    --crt-green-dim: #1a8000;
    --crt-bg: #051005;
    --crt-scanline: rgba(0, 20, 0, 0.5);
}

body {
    background-color: #000;
    font-family: 'VT323', monospace;
    color: var(--crt-green);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
}

/* --- CRT Effects --- */
.crt-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--crt-bg);
}

/* Screen curvature and vignette (Static) */
.crt-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 50;
}

/* Fine Scanlines (Texture) */
.scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.3));
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 40;
}

/* Rolling Bar Effect (Shutter Sync Issue) */
.rolling-bar {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 20%; /* Height of the rolling artifact */
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,10,0,0.3) 40%, 
        rgba(0,20,0,0.4) 50%, 
        rgba(0,10,0,0.3) 60%, 
        rgba(0,0,0,0) 100%
    );
    pointer-events: none;
    z-index: 45;
    animation: rollScan 8s linear infinite;
}

/* Text Bloom/Glow */
.text-glow {
    text-shadow: 0 0 2px var(--crt-green-dim), 0 0 8px var(--crt-green);
}

.border-glow {
    box-shadow: 0 0 2px var(--crt-green-dim), 0 0 8px var(--crt-green-dim);
}

@keyframes rollScan {
    0% { top: -20%; }
    100% { top: 120%; }
}

@keyframes turnOn {
    0% { transform: scale(1, 0.002); opacity: 0; filter: brightness(30); }
    30% { transform: scale(1, 0.002); opacity: 1; filter: brightness(10); }
    50% { transform: scale(1, 0.002); opacity: 1; filter: brightness(1); }
    60% { transform: scale(1, 1); opacity: 1; }
    100% { transform: scale(1, 1); opacity: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    background: #000;
    border-left: 1px solid var(--crt-green);
}
::-webkit-scrollbar-thumb {
    background: var(--crt-green);
    border: 1px solid #000;
}

/* Chart Container Logic */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    max-height: 400px;
    margin: 0 auto;
}

.crt-boot {
    animation: turnOn 0.2s ease-out forwards;
}

/* Accessibility Menu */
.accessibility-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.accessibility-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--crt-green);
    color: #000;
    border: 2px solid var(--crt-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(51, 255, 0, 0.5);
    transition: all 0.3s ease;
}

.accessibility-button:hover {
    background: #000;
    color: var(--crt-green);
    box-shadow: 0 0 20px rgba(51, 255, 0, 0.8);
}

.accessibility-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 250px;
    background: #000;
    border: 2px solid var(--crt-green);
    padding: 16px;
    box-shadow: 0 0 20px rgba(51, 255, 0, 0.3);
}

.accessibility-panel.hidden {
    display: none;
}

/* Disabled Effects States */
.effects-disabled .scanlines,
.effects-disabled .rolling-bar,
.effects-disabled .crt-overlay {
    display: none !important;
}

.effects-disabled .text-glow {
    text-shadow: none !important;
}

.effects-disabled .border-glow {
    box-shadow: none !important;
}

.effects-disabled .crt-container {
    background-color: #000 !important;
}

/* Disable phosphor grid on media containers */
.effects-disabled [id^="gallery-container-"] > .absolute {
    display: none !important;
}
