@font-face {
  font-family: 'Special Elite';
  src: url('../assets/specialelite-cyrillic.ttf') format('truetype');
  font-display: swap;
}

:root {
    --bg-color: #000000;
    --text-color: #a0a0a0;
    --title-color: #e5e5e5;
    --accent-color: #ff2c2c; /* Более яркий и чистый красный */
    --accent-glow: rgba(255, 44, 44, 0.7);
    --font-main: 'Special Elite', monospace;
}

html, body {
    height: 100%; margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    cursor: none;
}

/* --- "ЖИВОЙ" ФОН И КУРСОР --- */
#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Puts it behind the UI but in front of the background */
}
#vignette {
    position: fixed; inset: 0;
    box-shadow: inset 0 0 20vw 8vw rgba(0,0,0,1);
    pointer-events: none;
}
#cursor {
    position: fixed;
    width: 6px; height: 6px;
    background-color: var(--title-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 99999; /* Максимальный z-index для гарантии видимости */
    box-shadow: 0 0 8px var(--title-color);
    transition: transform 0.1s ease-out, background-color 0.2s ease, width 0.2s ease, height 0.2s ease;
}
/* Новый, более надежный селектор для ховера, управляемый через JS */
#cursor.hovering {
    width: 18px; /* Увеличиваем размер для эффекта */
    height: 18px;
    background-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- ОСНОВНОЙ ИНТЕРФЕЙС --- */
#ui-container {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    height: 100%; text-align: center;
    padding: 20px; box-sizing: border-box;
    position: relative; z-index: 2;
    animation: text-flicker 20s infinite, chromatic-aberration 15s infinite alternate;
}

/* НОВОЕ: Контейнер для "выжженных" вопросов */
#ghost-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}
.ghost-text {
    position: absolute;
    width: 100%;
    top: 30%; /* Примерно где находится вопрос */
    color: rgba(224, 224, 224, 0.03); /* Очень низкая прозрачность */
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    filter: blur(2px);
}

#content-container {
    font-size: clamp(2.8rem, 6vw, 5rem); /* УВЕЛИЧИЛИ ШРИФТ */
    color: var(--title-color);
    line-height: 1.4;
    text-shadow: 0 0 15px rgba(224, 224, 224, 0.4), 0 0 30px rgba(224, 224, 224, 0.2);
    margin-bottom: 80px;
    min-height: 200px;
    animation: focus-in 1.5s;
}

#options-container {
    display: flex; flex-direction: column; gap: 25px;
    width: 100%; max-width: 800px;
}

.option-btn {
    background: none; border: none;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    padding: 10px; cursor: none;
    transition: all 0.25s ease;
    opacity: 0;
    pointer-events: auto;
    animation: focus-in 0.8s forwards;
    letter-spacing: 1px;
}
.option-btn:hover {
    color: #fff;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow);
}
.option-btn.fading-out {
    opacity: 0 !important;
    filter: blur(5px);
    transition: opacity 0.5s, filter 0.5s;
}

#feedback-container {
    position: absolute; bottom: 5%;
    width: 80%;
    font-size: clamp(1.4rem, 2.2vw, 1.7rem);
    color: var(--accent-color); /* СДЕЛАЛИ КРАСНЫМ */
    text-shadow: 0 0 10px var(--accent-glow);
    min-height: 40px;
}

/* === TIMER STYLES === */
#timer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.1);
}
#timer-bar {
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: countdown 10s linear forwards;
}
@keyframes countdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* --- АНИМАЦИИ И ЭФФЕКТЫ --- */
@keyframes focus-in {
    from { opacity: 0; filter: blur(15px); transform: translateY(10px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes text-flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.99; } }
@keyframes chromatic-aberration {
    0% { text-shadow: 0 0 10px rgba(224,224,224,0.3), 1px 1px 0px #00f, -1px -1px 0px #f00; }
    100% { text-shadow: 0 0 10px rgba(224,224,224,0.3), -1px 1px 0px #00f, 1px -1px 0px #f00; }
}

.typing-cursor::after {
    content: '█';
    display: inline-block;
    transform: scaleX(0.7); /* Делаем блок уже */
    animation: blink 1s infinite;
    margin-left: 8px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ... (стили для вердикта остаются те же) ... */
.final-verdict strong { color: var(--accent-color); font-size: 1.3em; text-shadow: 0 0 20px var(--accent-glow); }
.reward-glyph { max-width: 120px; margin-top: 30px; filter: drop-shadow(0 0 15px var(--accent-glow)); animation: focus-in 1s 0.5s forwards; opacity: 0; }

/* === СТИЛИ СТАРТОВОГО ЭКРАНА === */
#start-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Копируем стили из главного style.css */
.custom-modal-box {
    background: radial-gradient(circle, rgba(20, 22, 25, 0.98), rgba(12, 12, 14, 0.98));
    border: 1px solid rgba(179, 0, 0, 0.5); /* Красная рамка из style.css --accent-color: #b30000; */
    box-shadow: 0 0 25px rgba(179, 0, 0, 0.3); /* Красное свечение */
    padding: 32px 40px;
    text-align: center;
    max-width: 580px;
    width: 90%;
    /* Анимация появления из главного style.css */
    transform: scale(0.95);
    opacity: 0;
    animation: focus-in 1s forwards;
}

.custom-modal-box h3 {
    font-family: 'Special Elite', monospace;
    font-size: 1.5rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #b30000; /* Использован --accent-color из главного css */
    text-shadow: 0 0 10px rgba(179, 0, 0, 0.7);
    margin: 0 0 16px;
}

.custom-modal-box p {
    margin: 0 0 24px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #aaa; /* Использован --text-color из главного css */
    font-family: 'Inter', sans-serif; /* Важно: для читаемости параграфа используется Inter */
}

.custom-modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.custom-modal-actions button {
    background: transparent;
    border: 1px solid #444;
    color: #aaa; /* --text-color */
    font-family: 'Special Elite', monospace;
    font-size: 0.9rem;
    padding: 10px 20px;
    cursor: none; /* Уже есть глобально, но для надежности */
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: all .2s;
    outline: none;
}

.custom-modal-actions button:hover {
    color: #fff;
    border-color: #fff;
}

.custom-modal-actions button.confirm {
    border-color: #b30000; /* --accent-color */
    color: #b30000;
}

.custom-modal-actions button.confirm:hover {
    background: #b30000;
    color: #000;
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.7);
}
/* --- Visual Effects Styles --- */

/* Pre-permission Screen */
#pre-permission-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 110;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pre-permission-screen .custom-modal-box {
    max-width: 600px;
}

#pre-permission-screen .reject {
    background-color: #333;
    color: #ccc;
}
#pre-permission-screen .reject:hover {
    background-color: #444;
}


/* Degradation Overlay */
#degradation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://raw.githubusercontent.com/DamianEhrenburg/site-assets/master/vhs_overlay.png');
    background-size: cover;
    opacity: 0;
    z-index: 1; /* Below UI, above canvas */
    pointer-events: none;
    transition: opacity 5s ease-in-out;
    mix-blend-mode: overlay;
}

/* Hallucinations */
#hallucinations-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90; /* High z-index but below UI */
    pointer-events: none;
    overflow: hidden;
}

.hallucination-symbol {
    position: absolute;
    opacity: 0;
    color: #500; /* Dark red */
    font-size: 15vmin;
    transition: opacity 0.5s ease-in-out;
    text-shadow: 0 0 10px #f00;
}

#hallucination-text {
    font-family: 'Special Elite', 'Courier New', Courier, monospace;
    font-size: 5vmin;
    color: #300;
}


/* Hostile Interface Animations */
@keyframes tremble {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(-1px, 1px) rotate(-0.1deg); }
    50% { transform: translate(1px, -1px) rotate(0.1deg); }
    75% { transform: translate(1px, 1px) rotate(0); }
}

.trembling {
    animation: tremble 0.15s infinite ease-in-out;
}

/* Text Glitch Placeholder */
.glitching-text span {
    display: inline-block;
}

#webcam-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 240px; /* Example fixed width */
    height: auto; /* Maintain aspect ratio */
    border: 2px solid rgba(160, 160, 255, 0.4); /* Subtle glowy blue border */
    box-shadow: 0 0 10px rgba(160, 160, 255, 0.2); /* Subtle glow */
    z-index: 1; /* Below UI container for subtle overlap */
    filter: grayscale(1) contrast(200%) brightness(0.3) blur(1px) sepia(0.6);
    opacity: 0.15; /* More transparent for readability when overlapped */
    transform: scaleX(-1); /* Flip horizontally to act like a mirror */
    display: none; /* Hidden by default, shown by JS */
    pointer-events: none; /* Do not block interaction with elements beneath */
}

#webcam-overlay.stress-effect {
    filter: drop-shadow(0 0 8px var(--accent-color)) contrast(250%) !important;
    opacity: 0.5 !important;
    transition: all 0.1s !important;
}

/* === СТИЛИ ФИНАЛЬНОГО ВЕРДИКТА === */
.verdict-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    animation: focus-in 1.5s;
    padding: 20px;
    box-sizing: border-box;
}

.verdict-diagnosis {
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(224, 224, 224, 0.4);
    margin-bottom: 40px;
}

.verdict-analysis {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--text-color);
    max-width: 900px;
    line-height: 1.6;
    text-shadow: 0 0 10px rgba(224, 224, 224, 0.2);
    margin-bottom: 40px;
}

.verdict-sentence {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 20px var(--accent-glow);
}

.verdict-prognosis-text,
.verdict-verdict-text {
    font-size: clamp(2rem, 4.5vw, 3.5rem); /* Adjust as needed */
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-top: 20px;
    line-height: 1.3;
}



/* === SYSTEM FAILURE EFFECT === */
#failure-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#failure-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.failure-text {
    font-family: 'Courier New', Courier, monospace;
    color: var(--accent-color);
    font-size: 4vw;
    text-transform: uppercase;
    position: absolute;
    opacity: 0;
    text-shadow: 0 0 10px var(--accent-glow);
}
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === АДАПТАЦИЯ ДЛЯ НОУТБУКОВ И СРЕДНИХ ЭКРАНОВ === */
@media (max-width: 1200px) {
    #content-container {
        font-size: clamp(2.2rem, 5vw, 3.5rem); /* Промежуточный размер для вопросов */
    }

    .option-btn {
        font-size: clamp(1.3rem, 2.5vw, 1.8rem); /* Промежуточный размер для кнопок */
    }

    #feedback-container {
        font-size: clamp(1.1rem, 2vw, 1.4rem); /* Промежуточный размер для комментария */
    }
}


/* === АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ === */
@media (max-width: 768px) {
    #content-container {
        font-size: clamp(1.8rem, 7vw, 2.5rem); /* Уменьшаем шрифт для вопросов */
        min-height: 150px; /* Уменьшаем минимальную высоту */
        margin-bottom: 40px; /* Сокращаем отступ */
    }

    .option-btn {
        font-size: clamp(1.2rem, 4vw, 1.5rem); /* Уменьшаем шрифт для кнопок */
        gap: 15px;
    }

    #feedback-container {
        font-size: clamp(1rem, 3vw, 1.2rem); /* Уменьшаем шрифт для комментария */
        bottom: 3%;
    }

    /* Уменьшаем оверлей веб-камеры, если он активен */
    #webcam-overlay {
        width: 150px;
        top: 10px;
        right: 10px;
    }
}

