/* 🔹 Общий стиль экрана */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: black;
    color: white;
    text-align: center;
    overflow-x: hidden;
}

/* 🔹 Общий контейнер для контента */
.container {
    max-width: 800px; /* Ограничение ширины */
    padding: 20px;
    text-align: center;
    z-index: 5;
}

/* 🔹 Базовые стили текста */
#about h2, #story h2, #gameplay h2, #countdown h2 {
    font-size: 60px; /* Увеличенный размер заголовка */
    text-align: center;
    font-weight: bold;
}

#countdown h3 {
    font-size: 90px; /* Увеличенный размер заголовка */
    text-align: center;
    font-weight: bold;
}

#about p, #story p, #gameplay p {
    font-size: 20px; /* Увеличенный текст */
    text-align: center;
    line-height: 1.6;
    margin-bottom: 15px;
}

.screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 🔹 Фоновое видео */
#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 🔹 Затемняющий слой поверх видео */
.dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Сильное затемнение */
    z-index: 1;
}

/* 🔹 Усиленный эффект ряби */
.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    background: linear-gradient(
        transparent 42%, 
        rgba(255, 255, 255, 0.7) 45%, 
        transparent 50%,
        rgba(255, 255, 255, 0.5) 55%, 
        transparent 58%
    );
    background-size: 100% 8px;
    animation: glitchEffect 1.2s infinite;
}

@keyframes glitchEffect {
    0% { opacity: 0; }
    10% { opacity: 0.6; }
    20% { opacity: 0.9; }
    30% { opacity: 0.5; }
    50% { opacity: 1; transform: scaleY(1.08); }
    70% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Помехи поверх видео */
.static-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/assets/static-noise.gif');
    background-size: cover;
    opacity: 0; /* скрыто по умолчанию */ 
    z-index: 4;
    animation: noiseFlicker 10s infinite;
}

/* Анимация появления шума */
@keyframes noiseFlicker {
    0% { opacity: 0; }   /* Нет шума */
    80% { opacity: 0; }  /* Нет шума в течение 8 сек */
    85% { opacity: 0.5; } /* Помехи появляются */
    90% { opacity: 0.7; } /* Максимальная интенсивность */
    95% { opacity: 0.3; } /* Начинают исчезать */
    100% { opacity: 0; }  /* Полностью исчезают */
}

/* 🔹 Заголовок (резкое мерцание раз в 5 секунды) */
h1.glitch-text {
    font-size: 64px;
    font-weight: bold;
    color: white;
    position: relative;
    z-index: 3;
    display: inline-block;
    animation: flicker 5s infinite alternate;
}

/* 🔹 Резкое, но редкое мерцание */
@keyframes flicker {
    0% { opacity: 1; }
    90% { opacity: 1; }
    91% { opacity: 0; }
    100% { opacity: 1; }
}

/* 🔹 Скрытие случайных слов (разные тайминги для разных слов) */
.word:nth-child(1) { animation: wordGlitch 5s infinite alternate; }
.word:nth-child(2) { animation: wordGlitch 6s infinite alternate; }
.word:nth-child(3) { animation: wordGlitch 4.5s infinite alternate; }
.word:nth-child(4) { animation: wordGlitch 5.5s infinite alternate; }
.word:nth-child(5) { animation: wordGlitch 7s infinite alternate; }
.word:nth-child(6) { animation: wordGlitch 4s infinite alternate; }
.word:nth-child(7) { animation: wordGlitch 6.5s infinite alternate; }
.word:nth-child(8) { animation: wordGlitch 5s infinite alternate; }

@keyframes wordGlitch {
    0%, 100% { opacity: 1; }
    20% { opacity: 0; }
    40% { opacity: 1; }
    60% { opacity: 0; }
    80% { opacity: 1; }
}



/* 🔹 Кнопки */
.btn-container {
    display: flex;
    justify-content: center; /* Центрируем кнопки */
    align-items: center; /*НОВЫЕ*/
    gap: 20px;
    margin-top: 30px;
    position: relative; /*НОВЫЕ*/
    z-index: 5; /*НОВЫЕ*//* Убедиться, что кнопки выше эффектов */
}

.cta-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 3;
}

/* 🔴 Основная кнопка */
.primary-btn {
    background: linear-gradient(45deg, #ff3131, #ff6b6b);
    color: white;
}

.primary-btn:hover {
    background: linear-gradient(45deg, #ff6b6b, #ff3131);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 48, 48, 0.7);
}

/* 🔵 Вторая кнопка */
.secondary-btn {
    background: linear-gradient(45deg, #2dbf24, #5adc4a);
    color: white;
}

.secondary-btn:hover {
    background: linear-gradient(45deg, #5adc4a, #57ff31);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(48, 48, 255, 0.7);
}


/* 🔹 Фон второго экрана */
#about {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Чтобы фон не выходил за границы */
}

/* 🔹 Фоновое изображение */
#about .background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/assets/screen_2.jpeg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}


/* 🔹 Затемняющий слой */
#about::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Затемнение */
    z-index: 1;
}

/* 🔹 Легкие помехи поверх второго экрана */
#about::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/assets/static-noise.gif');
    background-size: cover;
    opacity: 0.05;
    z-index: 2; /* Шум остается под контентом */
    animation: noiseFlicker_about 1.5s infinite alternate;
    pointer-events: none; /* Делаем слой шума неактивным для кликов */
}

@keyframes noiseFlicker_about {
    0% { opacity: 0.03; }
    100% { opacity: 0.07; }
}

/* 🔹 Анимация появления */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnimation 1s forwards;
}

/* 🔹 Разные задержки для плавного появления */
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }
.delay-4 { animation-delay: 1.2s; }

@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🔹 Кнопка */
#about .cta-btn {
    margin-top: 20px;
    background: linear-gradient(45deg, #31a1ff, #6bbdff);
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    z-index: 5; /* Теперь кнопка выше шума и всех эффектов */
    transition: all 0.3s ease;
}

#about .cta-btn:hover {
    background: linear-gradient(45deg, #6bbdff, #31a1ff);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(48, 161, 255, 0.7);
}

/* 🔹 Контент поверх затемненного фона */
#about .container {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* 🔹 Когда экран на 50% виден, контент плавно появляется */
#about.visible .container {
    opacity: 1;
    transform: translateY(0);
    animation: electricGlow 1.5s infinite alternate;
}

/* 🔹 Когда экран менее чем на 50% виден - контент исчезает */
#about.hidden .container {
    opacity: 0;
    transform: translateY(50px);
}

/* 🔹 Электрический разряд (синее свечение) */
@keyframes electricGlow {
    0% { text-shadow: 0 0 5px rgba(0, 255, 255, 0.3), 0 0 10px rgba(0, 255, 255, 0.2); }
    100% { text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 0 20px rgba(0, 255, 255, 0.5); }
}

/* 🔹 Вспышки экрана */
.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flashScreen 0.2s ease-in-out forwards;
}

/* 🔹 Анимация вспышек */
@keyframes flashScreen {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}


/* 🔹 Контейнер для третьего экрана */
#story {
    position: relative;
    display: flex;
    align-items: flex-start; /* Центрируем контент */
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding-top: 15vh; /* Смещаем контент вниз */
    overflow: hidden; /* Обрезаем лишние части фона */
}

/* 🔹 Затемняющий слой */
#story::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Затемнение */
    z-index: 1;
}

/* 🔹 Левая половина лица */
#story .background-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: url('/static/assets/maks.jpeg') no-repeat center;
    background-size: cover;
    background-position: right; /* Показываем правую часть фото */
    clip-path: inset(0 0 0 45%); /* Обрезаем правую часть */
    transform: translateX(-46%); /* Сдвигаем изображение левее */
    z-index: -1;
}

/* 🔹 Правая половина лица */
#story .background-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('/static/assets/maks.jpeg') no-repeat center;
    background-size: cover;
    background-position: left; /* Показываем левую часть фото */
    /*clip-path: inset(0 20% 0 0); /* Обрезаем левую часть */
    transform: translateX(39%); /* Сдвигаем изображение левее */
    z-index: -1;
}

/* 🔹 Когда экран на 50% виден, контент плавно появляется */
#story .container {
    position: relative;
    z-index: 2;
    opacity: 1;
    transform: translateY(0);
    animation: electricGlow 1.5s infinite alternate;
}

/* 🔹 Стили для видео */
#story video {
    display: block;
    margin: 20px auto;
    max-width: 80%;
    max-height: 100vh; /* Ограничиваем размер видео (1/6 экрана) */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    animation: electricGlow 1.5s infinite alternate;
}

/* 🔹 Четвертый экран */
#gameplay {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; /* Чтобы фон не выходил за границы */
    background: url('/static/assets/screen_4.jpeg') no-repeat center center/cover;
}

/* 🔹 Затемняющий слой */
#gameplay .background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Затемняем фон */
    z-index: 1;
}

/* 🔹 Контент поверх затемненного фона */
#gameplay .container {
    position: relative;
    z-index: 2;
    animation: electricGlow 1.5s infinite alternate;
}

/* 🔹 Список */
#gameplay ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

#gameplay li {
    font-size: 22px;
    margin-bottom: 10px;
}

/* 🔹 Шестой экран */
#countdown {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; /* Чтобы фон не выходил за границы */
    background: url('/static/assets/screen_6.jpeg') no-repeat center center/cover;
}

/* 🔹 Затемняющий слой */
#countdown .background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Затемняем фон */
    z-index: 1;
}

/* 🔹 Контент поверх затемненного фона */
#countdown .container {
    position: relative;
    z-index: 2;
    animation: electricGlow 1.5s infinite alternate;
}

/* 🔹 Текст "Скоро..." с мигающими точками */
.loading-text {
    font-size: 36px;
    font-weight: bold;
    color: white;
    margin-top: 10px;
}

/* 🔹 Анимация поочередного появления точек */
@keyframes dotAnimation {
    0% { opacity: 0; }
    33% { opacity: 1; }
    66% { opacity: 0; }
    100% { opacity: 0; }
}

/* 🔹 Стиль для точек */
.dot {
    display: inline-block;
    animation: dotAnimation 1.5s infinite;
}

/* 🔹 Задержки для каждой точки, чтобы они мигали поочередно */
.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.3s; }
.dot:nth-child(3) { animation-delay: 0.6s; }

/* 🔹 Форма подписки (по умолчанию скрыта) */
.hidden-form {
    position: fixed;
    top: -100%; /* Начинает за пределами экрана */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #31a1ff;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 15px rgba(48, 161, 255, 0.5);
    transition: top 0.5s ease-in-out;
    z-index: 10;
}

/* 🔹 Активное состояние формы (опускаем вниз) */
.hidden-form.active {
    top: 10%;
}

/* 🔹 Поля ввода */
.form-group {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    flex-shrink: 0;
    font-size: 14px;
    color: #31a1ff;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #31a1ff;
    border-radius: 5px;
    font-size: 16px;
    background: black;
    color: white;
    outline: none;
}

/* 🔹 Кнопка закрытия (убираем фон, оставляем только ❌) */
.close-btn {
    background: none; /* Убираем фон */
    color: white; /* Цвет крестика */
    border: none; /* Убираем рамку */
    padding: 0; /* Убираем отступы */
    cursor: pointer;
    font-size: 18px;
    position: absolute;
    top: 8px;
    right: 10px;
}






/* 🔹 Медиазапросы для адаптации */
@media (max-width: 1024px) { /* Планшеты */
    #about h2, #story h2, #gameplay h2, #countdown h2  {
        font-size: 36px;
    }
    #countdown h3  {
        font-size: 50px;
    }
    #about p, #story p, #gameplay ul {
        font-size: 18px;
    }
    #about .cta-btn {
        font-size: 20px;
        padding: 16px 35px;
    }
    .cta-btn {
        font-size: 20px;
        padding: 16px 35px;
    }
}

@media (max-width: 768px) { /* Мобильные */
    #about h2, #story h2, #gameplay h2, #countdown h2 {
        font-size: 28px;
    }
    #countdown h3  {
        font-size: 44px;
    }
    #about p, #story p, #gameplay ul {
        font-size: 16px;
        padding: 0 20px; /* Добавляем отступы, чтобы текст не прилипал к краям */
    }
    #about .cta-btn {
        font-size: 18px;
        padding: 14px 30px;
        width: 90%; /* Кнопка растягивается, удобнее нажимать */
        max-width: 300px;
    }
    .cta-btn {
        font-size: 14px;
        padding: 14px 30px;
        width: 90%; /* Кнопки растягиваются по ширине */
        max-width: 300px; /* Но не больше 300px */
    }
}

/* 🔹 Адаптация для мобильных: объединяем лицо, но даем возможность двигать */
@media (max-width: 1024px) {
    #story .background-left, 
    #story .background-right {
        width: 100%; /* Теперь изображение на всю ширину */
        clip-path: none; /* Убираем обрезку */
        background-position: center; /* Центрируем */
        transform: translateX(0%); /* Подгоняем вручную, можно менять значение */
    }
}




