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

body {
    margin: 0;
    font-family: var(--font-family);
    background: #1f1f1f;
    overflow-x: hidden;
    color: white;
    cursor: default;
}

/* ========================================= */
/* --- 1. ВЕРХНЯЯ СЕКЦИЯ (HERO TOP) --- */
/* ========================================= */
.hero-top {
    position: relative;
    width: 100%;
    height: 56.25vw; 
    min-height: auto;
    background: url("assets/hero-top-desktop.webp") no-repeat center bottom;
    background-size: 100% auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero-content {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    top: 0;
    margin-top: 0;
    transform: translateY(-130px); 
}

/* --- ЛОГОТИП (ФИНАЛЬНЫЙ ФИКС) --- */
.titles-link {
    display: block;
    cursor: pointer;
    text-decoration: none !important;
    border: none !important;
    background: transparent;
    font-size: 0;
    line-height: 0;
    
    /* 1. РАЗМЕР: сделал еще меньше (было 850, стало 650) */
    width: 100%;
    max-width: 650px; 
    margin: 0 auto;
    
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    /* 2. ПОДГОТОВКА АНИМАЦИИ */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    
    /* Явно задаем начальное состояние для корректной анимации */
    transform: scale(1) translateZ(0);
    
    /* Время анимации */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.titles {
    display: block; 
    width: 100%;
    height: auto;
    pointer-events: none;
    border: none;
    outline: none;
    vertical-align: bottom;
}

/* ХОВЕРЫ (АНИМАЦИЯ НАВЕДЕНИЯ) */
.titles-link:hover { 
    /* При наведении увеличиваем на 5% */
    transform: scale(1.05) translateZ(0) !important; 
}

.titles-link:active { 
    /* При клике чуть уменьшаем */
    transform: scale(0.98) translateZ(0) !important; 
}


/* ========================================= */
/* --- 2. НИЖНЯЯ СЕКЦИЯ (СТЕНА) --- */
/* ========================================= */
.hero-bottom {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #1a1a1a url("assets/hero-bottom-desktop.webp") no-repeat center top;
    background-size: cover;
    margin-top: -1px;
    padding-top: 10vw; 
    padding-bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.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: 900px;
    position: relative;
    margin-top: 50px;
    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%) scale(1);
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    
    font-family: "Tektur", sans-serif;
    font-variation-settings: "wdth" 75;
    font-stretch: condensed;

    max-width: 90%; 
    overflow: hidden;
    text-overflow: ellipsis; 

    /* ВОТ ЭТО МЕСТО ЗАМЕНИ (примерно 205 строка) */
    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 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                opacity 0.5s ease-in,
                transform 0.3s ease-out;
    will-change: left, top, font-size;
}

/* В style.css */

.magnified-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
    display: none;

    /* Подкладываем ту же стену, что и в фоне секции */
    background-image: url("assets/hero-bottom-desktop.webp");
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-color: #1f1f1f;
    
    /* Важно: фон должен стоять в той же позиции, что и у родителя.
       Мы поправим позицию в JS один раз */
    background-position: center 0px;

    /* Убираем все старые трансформации */
    transform: scale(1);
    will-change: transform, clip-path;
}

/* Слова в лупе теперь просто белые и статичные (зум даст слой) */
.magnified-layer .word {
    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: 100;
    display: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Убедимся, что контейнер облака слов совпадает по позиции с фоном */
.words-container {
    width: 100%;
    height: 900px;
    position: relative;
    /* margin-top должен быть синхронизирован с фоном */
    margin-top: 50px; 
    z-index: 1;
    overflow: hidden;
}

.word-highlight-anim { 
    animation: wordPulse 1.5s forwards; 
    z-index: 1000;
}

.word-highlight-static { 
    color: #ff0019; 
    z-index: 1000;
    text-shadow: 0 0 15px rgba(255,0,0,0.6);
}

@keyframes wordPulse {
    0% { transform: translate(-50%, -50%) scale(1); color: white; }
    30% { transform: translate(-50%, -50%) scale(1.4); color: #ff0019; text-shadow: 0 0 20px rgba(255,0,0,0.8); }
    100% { transform: translate(-50%, -50%) scale(1); color: white; }
}

@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; 
    }

    .hero-content {
        width: 100%;
        display: flex;
        justify-content: center;
        position: relative;
        top: -5vw; 
        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; }