/* style.css */

:root {
    --font-family: "Tektur", sans-serif;
    --second-family: "Inter", sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-family);
    /* Единый длинный фон */
    background: #1a1a1a url("assets/desktop-full-bg.webp") no-repeat top center;
    background-size: 100% auto;
    background-attachment: scroll; /* Важно для синхронизации */
    overflow-x: hidden;
    color: white;
    cursor: default;
}

.hero-top {
    position: relative;
    width: 100%;
    height: 48vw; /* Немного уменьшили высоту секции */
    background: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero-content {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    /* Убираем подъем, который выталкивал лого за экран */
    transform: none; 
    /* Задаем отступ сверху. На больших мониторах это будет выглядеть так же, 
       а на маленьких логотип просто опустится чуть ниже, но не обрежется */
    margin-top: 5vh; 
    padding: 0 20px;
    box-sizing: border-box;
}

.titles-link {
    display: block;
    /* Логотип будет гибким: минимум 300px, максимум 580px */
    width: clamp(300px, 45vw, 580px); 
    margin: 0 auto;
    /* Убираем лишние сдвиги */
    transform: none; 
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.4s ease;
    will-change: transform;
}

.titles-link:hover {
    /* При наведении только увеличиваем, не двигая вверх-вниз */
    transform: scale(1.03);
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.2));
}

.titles {
    display: block;
    width: 100%;
    height: auto;
}

/* ========================================= */
/* --- 2. НИЖНЯЯ СЕКЦИЯ (ГДЕ ВВОД СЛОВ) --- */
/* ========================================= */
.hero-bottom {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: none !important; /* Убрали фон секции, теперь светит фон body */
    margin-top: -1px;
    padding-top: 18vw; 
    padding-bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Дальше идет .container, .header и так далее — их не трогаем */

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    position: relative;
}

/* ЗАГОЛОВОК */
.header { text-align: center; margin-bottom: 40px; }

.header-title { 
    font-family: var(--font-family); 
    font-size: clamp(40px, 7vw, 90px); 
    font-weight: 900; 
    text-transform: uppercase;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;
    color: white; 
    margin: 0;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.header-subtitle {
    font-family: var(--font-family);
    font-size: clamp(18px, 2.5vw, 32px);
    font-weight: 700;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;
    color: #1f1f1f;
    margin-top: 15px;
}
.red { color: #ff0019; }


/* ========================================= */
/* --- 3. ФОРМА ВВОДА (INPUT) --- */
/* ========================================= */
.input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 12px;
    height: 70px;
    width: 100%;
    max-width: 700px;
    position: relative;
    margin-bottom: 30px;
    z-index: 200; 
}

/* Внешняя светлая плашка */
.search-box {
    flex: 1;
    background: rgba(180, 180, 180, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center; 
    padding: 0 15px; 
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

/* Надпись "Сила в" */
.search-label {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 30px; 
    color: #1f1f1f; 
    white-space: nowrap;
    line-height: 1;
    padding-top: 4px;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;
}

.divider { display: none; }

/* Само поле ввода */
.search-input {
    flex: 1;
    background: #737373; 
    height: 44px; 
    border-radius: 8px;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 22px;
    color: white;
    font-weight: 600;
    padding: 0 15px;
    min-width: 0;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.search-input.error { color: #ff0019; border: 1px solid #ff0019; } 

/* КНОПКА "i" */
.info-btn {
    width: 70px;
    height: 70px;
    background: rgba(180, 180, 180, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: white; 
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 32px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent; 
}

.info-btn:hover, .info-btn.active { 
    background: rgba(200, 200, 200, 0.9); 
    transform: scale(1.05); 
}

/* ========================================= */
/* --- 4. ПОПАП С ПРАВИЛАМИ --- */
/* ========================================= */
.rules-box {
    display: none;
    position: absolute;
    top: 115%;
    right: 0;
    background: rgba(180, 180, 180, 0.95); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 340px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    z-index: 1000; 
    transform-origin: top right;
}

.rules-box.show { display: block; animation: popIn 0.3s; }

.rules-title { 
    margin: 0 0 15px; 
    color: #1a1a1a; 
    font-family: var(--font-family); 
    font-size: 26px; 
    font-weight: 800; 
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;
}

.rules-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.rules-list li { 
    color: #1f1f1f; 
    font-family: var(--second-family); 
    font-weight: 600; 
    font-size: 19px; 
    margin-bottom: 8px; 
}

/* --- ОБЛАКО СЛОВ (ОСНОВНОЙ БЛОК) --- */

.words-container {
    width: 100%;
    height: 1050px; 
    position: relative;
    /* Контейнер поднят выше к форме ввода для корректной работы лупы */
    margin-top: -70px; 
    z-index: 1;
    overflow: hidden; /* Обрезает лупу по бокам и снизу */
    cursor: default;
}

.words-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
}

.word { 
    position: absolute; 
    color: white; 
    font-weight: 900; 
    white-space: nowrap;
    text-transform: uppercase;
    transform-origin: center center;
    /* Центрирование */
    transform: translate(-50%, -50%);
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    
    font-family: "Tektur", sans-serif;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;

    /* ПЛАВНОСТЬ: отвечает за то, чтобы слова не прыгали, 
       а плавно возвращались к своему размеру после ввода */
    transition: left 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                top 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                font-size 1.2s ease-in-out, 
                opacity 0.5s ease-in;
    will-change: left, top, font-size;
}


.word-highlight-anim {
    /* Увеличим длительность до 2.5 сек для плавности: 
       сначала вспышка, удержание, возврат в белый */
    animation: wordPulse 2.5s ease-in-out forwards !important; 
    z-index: 1000;
    transition: none !important; 
    /* color: #ff0019 !important;  <-- ЭТУ СТРОКУ УДАЛЯЕМ, цвет теперь в анимации */
}

@keyframes wordPulse {
    0% { transform: translate(-50%, -50%) scale(1); color: #fff; }
    15% { transform: translate(-50%, -50%) scale(1.2); color: #ff0019; }
    85% { transform: translate(-50%, -50%) scale(1.2); color: #ff0019; }
    100% { transform: translate(-50%, -50%) scale(1); color: #fff; }
}

/* --- ЛУПА (МАГНИФАЕР) --- */

.magnified-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Высокий z-index, чтобы перекрывать анимированные слова и они не двоились */
    z-index: 2000; 
    pointer-events: none;
    display: none;

    /* Фон лупы (стенка) */
    background-image: url("assets/desktop-full-bg.webp");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
    background-attachment: scroll;
    background-color: transparent; 
    
    will-change: transform, clip-path;
}

/* Слова внутри лупы */
.magnified-layer .word {
    /* Оставляем scale(1), так как слой лупы увеличивается целиком через JS */
    transform: translate(-50%, -50%) scale(1) !important;
    color: #fff;
}

/* Кольцо лупы */
.magnifier-ring {
    position: absolute;
    width: 260px; /* Радиус 130 * 2 */
    height: 260px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    /* Выше всех элементов */
    z-index: 2001; 
    display: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}


.words-container {
    width: 100%;
    height: 1050px; /* Увеличили высоту, так как подняли верх */
    position: relative;
    /* Поднимаем границу контейнера почти к форме ввода */
    margin-top: -70px; 
    z-index: 1;
    overflow: hidden;
    cursor: default;
}

.word-highlight-anim {
    animation: wordPulse 1.5s ease-in-out 1 !important;
    z-index: 1000;
    /* Добавляем это, чтобы плавный сдвиг облака не конфликтовал с пульсацией */
    transition: none !important; 
}

.word-highlight-static {
    color: #ff0019 !important;
    z-index: 1000;
    text-shadow: 0 0 15px rgba(255,0,0,0.6);
    /* Обязательно сохраняем центрирование */
    transform: translate(-50%, -50%) scale(1);
}

@keyframes wordPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); color: #ff0019; }
    100% { transform: translate(-50%, -50%) scale(1); color: #ff0019; } /* Оставляем красный в конце */
}

@keyframes wordWallPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.4); color: #ff0019; opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); color: white; opacity: 1; }
}

@keyframes shake { 0%,100% {transform:translateX(0);} 20%,60% {transform:translateX(-5px);} 40%,80% {transform:translateX(5px);} }
.shake-element { animation: shake 0.4s ease-in-out; }

/* СООБЩЕНИЯ */
.error-message { color: #ff0019; font-weight: 800; font-size: 20px; text-align: center; margin-bottom: 20px; display: none; }
.thank-you { text-align: center; margin-bottom: 20px; display: none; }
.thank-you-text { color: white; font-size: 20px; font-weight: 600; }
.promo-code { display: block; font-size: 36px; font-weight: 800; margin-top: 10px; text-decoration: underline; color: #ff0019; cursor: pointer; }


/* ========================================= */
/* --- 6. МОБИЛЬНАЯ ВЕРСИЯ (АДАПТИВ) --- */
/* ========================================= */
@media (max-width: 768px) {
    .hero-top {
        height: 120vw; 
        background-image: url("assets/hero-top-mobile.webp");
        background-position: center bottom;
        background-size: 100% auto; 
    }

    /* Внутри @media (max-width: 768px) в твоем CSS */

.hero-content {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    /* Измени top с -5vw на положительное значение, чтобы опустить */
    top: 10vw; 
    margin-top: 0;
    z-index: 10;
    transform: none !important;
}

    .titles-link {
        display: block;
        cursor: pointer;
        background: transparent;
        border: none;
        width: 70vw; 
        max-width: 1100px; 
        height: auto; 
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .titles { display: block; width: 100%; height: auto; }

    .hero-bottom {
        background-image: url("assets/hero-bottom-mobile.webp");
        background-size: cover; 
        background-position: center top;
        margin-top: -1px; 
        padding-top: 100px; 
        min-height: 100vh; 
    }
    
    .container {
        padding: 0 25px !important; 
    }
    
    /* 1. УВЕЛИЧИВАЕМ ЗАГОЛОВОК */
    .header-title { 
        font-size: 48px !important; /* Было 32px */
    } 
    .header-subtitle { 
        font-size: 21px !important; /* Было 14px */
        margin-top: 10px; 
    }

    /* 2. УМЕНЬШАЕМ И СДВИГАЕМ ПОЛЕ ВВОДА */
    .input-wrapper { 
        height: 50px; /* Было 55px */
        gap: 8px; 
        margin-bottom: 20px; 
        
        width: 85%;         /* Делаем уже (было 100%) */
        margin-right: 30px; /* СДВИГАЕМ ВЛЕВО (добавляем отступ справа) */
    }

    .search-box { 
        padding: 0 10px; 
        border-radius: 12px; 
    }
    .search-label { 
        font-size: 20px; /* Чуть уменьшили под новый размер */
        padding-top: 2px; 
    } 
    .search-input { 
        font-size: 16px; 
        height: 32px;
        border-radius: 6px;
    }
    
    .info-btn { 
        width: 50px; 
        height: 50px; 
        font-size: 18px; 
        border-radius: 12px; 
    }
    
    .rules-box {
        width: 280px; 
        right: 0;
        left: auto;
        transform: none;
        top: 110%;
    }
    
    .words-container {
        height: 400px;
        margin-top: 10px;
    }
    
    .magnifier-ring { display: none !important; }
    .magnified-layer { display: none !important; }
}

html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }