:root {
    --p-neon: #bc13fe; --g-neon: #39ff14; --b-neon: #00f3ff;
    --danger: #ff003c; --toxic: #ccff00;
    --glass: rgba(10, 10, 10, 0.85);
}

* { box-sizing: border-box; }

body {
    background: #050505; color: #fff; margin: 0; padding: 0;
    font-family: 'Rajdhani', sans-serif; height: 100vh; width: 100vw;
    display: flex; flex-direction: column; 
    overflow: hidden; user-select: none; position: fixed;
}

/* --- МОНИТОР ИССЛЕДОВАНИЙ (НОВОЕ) --- */
.research-monitor {
    position: absolute;
    top: calc(50% - 300px);
    left: calc(5% - 10px); /* Центрирование над вентилятором шириной 200px, монитор 220px */
    width: 220px;
    height: 160px;
    background: #000;
    border: 2px solid #333;
    border-radius: 6px;
    z-index: 15;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.monitor-header {
    background: #111;
    color: #555;
    font-size: 10px;
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    display: flex; align-items: center; gap: 5px;
    font-family: 'Orbitron';
}

.rec-dot { width: 6px; height: 6px; background: red; border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.monitor-screen {
    flex-grow: 1;
    background: radial-gradient(circle, #0a1a0a 0%, #000 90%);
    padding: 8px;
    color: var(--g-neon);
    font-family: 'VT323', monospace; /* Пиксельный шрифт */
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    white-space: pre-wrap;
    text-shadow: 0 0 2px var(--g-neon);
    opacity: 0.9;
}

/* Сканирующая линия монитора */
.monitor-glare {
    position: absolute; inset: 0;
    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% 2px, 3px 100%;
    pointer-events: none;
}

/* --- ВЕНТИЛЯТОРЫ (СДВИНУТЫ) --- */
.fan-wrapper { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.fan { 
    position: absolute; 
    width: 200px; 
    opacity: 0.5; mix-blend-mode: screen; 
}
/* Сдвинули ближе к центру (было 10px, стало 8%) */
.fan-left { top: 50%; left: 5%; transform: translateY(-50%); }
.fan-right { top: 50%; right: 5%; transform: translateY(-50%); }
.fan-mobile { display: none; }

/* --- ЛАМПЫ --- */
.uv-lamps {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%);
    width: 320px; height: 50px; background: #111; border-radius: 0 0 25px 25px;
    z-index: 100; border: 1px solid #333; transition: 0.3s;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
}
.uv-active .uv-lamps { border-color: var(--p-neon); box-shadow: 0 0 40px var(--p-neon), inset 0 0 20px var(--p-neon); }
.uv-lamps.overheat { border-color: var(--danger); box-shadow: 0 0 60px var(--danger), inset 0 0 30px var(--danger); animation: shake 0.5s infinite; }
.timer-integrated { font-family: 'Orbitron'; font-size: 11px; color: #555; display: flex; gap: 8px; margin-top: 2px; }
.timer-digits { color: #888; letter-spacing: 1px; }
.uv-active .timer-digits { color: #fff; text-shadow: 0 0 5px #fff; }
.uv-lamps.overheat .timer-digits { color: var(--danger); }

/* --- ОВЕРЛЕИ --- */
.uv-overlay { position: fixed; inset: 0; z-index: 5; opacity: 0; pointer-events: none; background: radial-gradient(circle at top, rgba(188, 19, 254, 0.4), transparent 70%); transition: opacity 0.2s; }
.uv-active .uv-overlay { opacity: 1; }
.heat-overlay { position: fixed; inset: 0; z-index: 6; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, transparent 90%); transition: opacity 1s ease; }
body.heat-active .heat-overlay { opacity: 1; animation: alarmPulse 1s infinite; }
.toxic-overlay { position: fixed; inset: 0; z-index: 7; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(204, 255, 0, 0.3) 0%, transparent 90%); box-shadow: inset 0 0 150px var(--toxic); transition: opacity 0.5s ease; }
body.toxic-active .toxic-overlay { opacity: 1; animation: toxicPulse 0.4s infinite alternate; }

@keyframes shake { 0% { transform: translateX(-51%); } 50% { transform: translateX(-49%); } 100% { transform: translateX(-50%); } }
@keyframes alarmPulse { 0% { opacity: 0.3; background-color: rgba(255,0,0,0.1); } 50% { opacity: 0.8; background-color: rgba(255,0,0,0.3); } 100% { opacity: 0.3; background-color: rgba(255,0,0,0.1); } }
@keyframes toxicPulse { from { filter: hue-rotate(0deg); opacity: 0.8; } to { filter: hue-rotate(20deg); opacity: 1; } }

/* --- HUD & SCENE --- */
.hud-top { display: flex; justify-content: center; gap: 15px; margin-top: 70px; z-index: 10; position: relative;}
.sensor { padding: 10px 20px; border-radius: 8px; text-align: center; border: 1px solid #333; background: var(--glass); backdrop-filter: blur(5px); }
.sensor .label { display: block; font-size: 10px; color: #888; margin-bottom: 5px; }
.sensor .val { font-family: 'Orbitron'; font-size: 16px; text-shadow: 0 0 5px currentColor; }
.neon-g { color: var(--g-neon); } .neon-b { color: var(--b-neon); }
.scene { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 10; overflow: hidden; }
.sloth-container { position: relative; width: 350px; max-width: 90%; }
#main-character { width: 100%; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(0,0,0,0.8)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.animation-gif { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 5; pointer-events: none; }

/* --- РАДИО --- */
.radio-dock {
    position: absolute; right: calc(5% + 10px); top: calc(50% - 300px); 
    width: 180px; padding: 15px; border-radius: 12px; border: 1px solid var(--b-neon);
    z-index: 20; background: rgba(0,0,0,0.95);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}
.visualizer { display: flex; justify-content: space-between; align-items: flex-end; height: 40px; margin-bottom: 12px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.v-bar { width: 12px; background: #333; border-radius: 2px 2px 0 0; height: 2px; transition: height 0.05s ease; }
.radio-on .v-bar:nth-child(odd) { background: var(--p-neon); box-shadow: 0 0 5px var(--p-neon); }
.radio-on .v-bar:nth-child(even) { background: var(--b-neon); box-shadow: 0 0 5px var(--b-neon); }
.tuner-info { text-align: center; margin-bottom: 10px; background: #111; padding: 8px; border-radius: 4px; border: 1px solid #333;}
.freq { font-family: 'Orbitron'; font-size: 20px; }
.track-name { font-size: 9px; color: #666; white-space: nowrap; overflow: hidden; text-transform: uppercase; margin-top: 2px;}
.tuner-ctrl { display: flex; justify-content: space-between; gap: 5px; }
.tuner-ctrl button { background: #222; border: 1px solid #444; color: #fff; cursor: pointer; padding: 8px; flex-grow: 1; font-family: 'Orbitron'; transition: 0.2s; }
.tuner-ctrl button:hover { background: #333; border-color: #666; }
.pwr-btn { color: #ff003c !important; border-color: #500 !important; font-size: 10px; }
.radio-on .pwr-btn { text-shadow: 0 0 5px #ff003c; border-color: #ff003c !important; }

/* --- FOOTER --- */
.footer-ui { background: rgba(0,0,0,0.95); padding: 20px; border-top: 1px solid #222; position: relative; z-index: 50;}
.action-bar { display: flex; justify-content: center; gap: 15px; margin-bottom: 15px; }
.btn-main { padding: 18px 30px; border: 2px solid; background: rgba(0,0,0,0.5); color: #fff; font-family: 'Orbitron'; cursor: pointer; transition: 0.2s; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.water { border-color: var(--b-neon); box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.2); }
.water:active { background: var(--b-neon); color: #000; }
.uv { border-color: var(--p-neon); box-shadow: inset 0 0 10px rgba(188, 19, 254, 0.2); }
.uv:active { background: var(--p-neon); color: #000; }
.fert { border-color: var(--g-neon); box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2); }
.fert:active { background: var(--g-neon); color: #000; }
.mint { border-color: var(--p-neon); box-shadow: inset 0 0 10px rgba(188, 19, 254, 0.2); text-decoration: none; }
.mint:active { background: var(--p-neon); color: #000; }
.market { border-color: var(--g-neon); box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2); text-decoration: none; }
.market:active { background: var(--g-neon); color: #000; }
.select { border-color: #555; box-shadow: none; opacity: 0.5; }
.btn-main:disabled { opacity: 0.3; cursor: not-allowed; border-color: #555; box-shadow: none; }
.links-grid { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.links-grid a { color: #555; text-decoration: none; font-size: 10px; border: 1px solid #222; padding: 5px 10px; transition: 0.2s; }
.links-grid a:hover { color: var(--g-neon); border-color: var(--g-neon); background: rgba(57, 255, 20, 0.1); }

/* --- АДАПТИВ --- */
@media (max-width: 800px) {
    .research-monitor { display: none; } /* Скрываем монитор на мобилках чтоб не мешал */
    .fan-left, .fan-right { display: none; }
    .fan-mobile { display: block; width: 90vw; max-width: 300px; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 0; opacity: 0.15; }
    .radio-dock { position: relative; right: auto; top: auto; width: 85%; margin: 10px auto; order: -1; }
    .hud-top { margin-top: 60px; padding: 10px; flex-wrap: wrap; gap: 10px; justify-content: center; }
    .sensor { padding: 5px 10px; min-width: 60px; }
    .sensor .val { font-size: 14px; }
    .action-bar { flex-direction: column; width: 85%; margin: 0 auto 15px auto; }
    .btn-main { width: 100%; padding: 15px; }
    .uv-lamps { width: 90%; }
    .sloth-container { width: 100%; max-width: none; }
    .links-grid { gap: 5px; }
    .scene { justify-content: flex-start; overflow-y: auto; }
    #main-character { height: auto; width: 100%; object-fit: contain; }
}