/* Анимация падения */
@keyframes fall-down {
    0% {
        margin-top: -150vh; /* Начинаем высоко за пределами экрана */
        opacity: 0;
    }
    60% {
        margin-top: 30px; /* Блок ударяется "об пол" и слегка пружинит */
        opacity: 1;
    }
    80% {
        margin-top: -10px; /* Отскакивает назад */
    }
    100% {
        margin-top: 0; /* Встает на свое место */
    }
}



/* style.css */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif; /* Простой жирный шрифт */
    background-color: #fff;
    overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
}

/* Контейнер для всего хаоса */
.chaos-wrapper {
    position: relative;
    width: 100%;
    height: 100vh; /* На всю высоту экрана */
    min-height: 800px; /* Чтобы на маленьких ноутах не сплющилось */
}

/* Общий стиль для всех кнопок-блоков */
.block {
    position: absolute; /* Позволяет двигать блок в любую точку */
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #000; /* Цвет текста черный по умолчанию */
    font-weight: 900;
    font-size: 24px;
    transition: transform 0.2s ease, z-index 0s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    padding: 10px;
    box-sizing: border-box;

 animation: fall-down 1s cubic-bezier(0.25, 1, 0.5, 1) backwards; 
    
    /* Сохраняем переходы для ховера */
    transition: transform 0.2s ease, z-index 0s, margin-top 0s; 
}

/* Эффект при наведении: блок чуть увеличивается и всплывает наверх */
.block:hover {
    transform: scale(1.05) rotate(0deg) !important; /* Выпрямляем при наведении */
    z-index: 100 !important; /* Поверх всех */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* --- Настройка каждого блока (Цвет, Позиция, Поворот) --- */

/* 1. Телега (Большой желтый слева) */
.b-telega {
    background-color: #D6FF00; /* Кислотный желтый */
    width: 25vw;
    height: 35vh;
    top: 20%;
    left: 2%;
    z-index: 1;
}

/* 2. Невышедшее (Темный сверху) */
.b-unreleased {
    background-color: #333;
    color: #fff;
    width: 20vw;
    height: 80px;
    top: 5%;
    left: 10%;
    transform: rotate(-5deg);
}

/* 3. Резюме (Бирюзовый вертикальный) */
.b-cv {
    background-color: #98CDCD;
    width: 250px;
    height: 100px;
    top: 25%;
    left: 28%;
    transform: rotate(-75deg); /* Сильный наклон */
    z-index: 2;
}

/* 4. Кухня на районе (Зеленый длинный) */
.b-kitchen {
    background-color: #4B854B;
    color: #fff;
    width: 30vw;
    height: 100px;
    top: 10%;
    left: 45%;
    transform: rotate(-15deg);
}

/* 5. Рокетбанк (Черный центр) */
.b-rocket {
    background-color: #333;
    color: #fff;
    width: 35vw;
    height: 150px;
    top: 40%;
    left: 40%;
    z-index: 5;
}

/* 6. Кирпич (Розовый) */
.b-brick {
    background-color: #FFC8CB;
    width: 20vw;
    height: 120px;
    top: 60%;
    left: 30%;
}

/* 7. На мемы / Кошка (Оранжевый + Зеленый блок) */
.b-memes {
    background-color: #D95E20; /* Оранжевый */
    width: 15vw;
    height: 350px;
    top: 55%;
    left: 55%;
    z-index: 4;
}

.b-cat {
    background-color: #4B854B;
    width: 12vw;
    height: 120px;
    top: 55%;
    left: 71%;
    z-index: 3;
}

/* 8. Универ (Голубой под кошкой) */
.b-uni {
    background-color: #98CDCD;
    width: 12vw;
    height: 150px;
    top: 70%;
    left: 71%;
}

/* 9. VK (Синий справа) */
.b-vk {
    background-color: #265C99;
    color: #fff;
    width: 10vw;
    height: 10vw;
    top: 40%;
    right: 2%;
}

/* 10. Мемы синие (Повернутый квадрат) */
.b-memes-blue {
    background-color: #6CA6F5;
    color: #fff;
    width: 12vw;
    height: 12vw;
    top: 60%;
    right: 5%;
    transform: rotate(15deg);
}

/* 11. Помогите (Желтый снизу) */
.b-help {
    background-color: #D6FF00;
    width: 15vw;
    height: 15vw;
    bottom: 5%;
    left: 40%;
}

/* 12. Продам гараж (Коричневый слева внизу) */
.b-garage {
    background-color: #C69568;
    width: 35vw;
    height: 200px;
    bottom: 0;
    left: 0;
}

/* 13. Ноушн (Оранжевый справа вверху) */
.b-notion {
    background-color: #D95E20;
    color: #fff;
    width: 150px;
    height: 80px;
    top: 5%;
    right: 5%;
}

/* 14. Школа (Синий внизу) */
.b-school {
    background-color: #6CA6F5;
    width: 20vw;
    height: 100px;
    bottom: 0;
    right: 15%;
}

/* --- АДАПТИВНОСТЬ (МОБИЛЬНАЯ ВЕРСИЯ - ХАОС) --- */
@media (max-width: 768px) {
    
    /* Делаем страницу очень длинной, чтобы блоки влезли */
    .chaos-wrapper {
        height: 2600px; /* Высота холста на телефоне */
        position: relative;
        overflow: hidden;
        background: #fff;
    }

    /* Общие настройки для блоков на мобильном */
    .block {
        position: absolute !important; /* Принудительно абсолютное, никаких столбиков */
        font-size: 18px; /* Чуть меньше шрифт */
        padding: 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        /* Анимация падения остается, но чуть быстрее */
        animation-duration: 0.8s; 
    }

    /* --- ПЕРЕОПРЕДЕЛЯЕМ КООРДИНАТЫ ДЛЯ ТЕЛЕФОНА --- */
    /* Мы расставляем их сверху вниз "зигзагом" */

    /* 1. Телега */
    .b-telega {
        width: 60vw;
        height: 200px;
        top: 2%;
        left: 5%;
        transform: rotate(-5deg);
    }

    /* 2. Ноушн */
    .b-notion {
        width: 120px;
        height: 80px;
        top: 5%;
        right: -10px;
        transform: rotate(10deg);
        z-index: 5;
    }

    /* 3. Невышедшее */
    .b-unreleased {
        width: 70vw;
        height: 80px;
        top: 12%;
        left: 10%;
        transform: rotate(3deg);
        background-color: #333;
    }

    /* 4. Резюме (вертикальная плашка) */
    .b-cv {
        width: 180px;
        height: 80px;
        top: 18%;
        right: 5%;
        transform: rotate(-15deg);
        z-index: 4;
    }

    /* 5. Кухня на районе */
    .b-kitchen {
        width: 80vw;
        height: 100px;
        top: 23%;
        left: -5%;
        transform: rotate(5deg);
    }

    /* 6. VK (квадрат) */
    .b-vk {
        width: 100px;
        height: 100px;
        top: 28%;
        right: 10%;
        transform: rotate(-10deg);
    }

    /* 7. Рокетбанк (темный блок) */
    .b-rocket {
        width: 90vw;
        height: 120px;
        top: 35%;
        left: 5%;
        transform: rotate(-2deg);
        z-index: 2;
    }

    /* 8. На мемы (оранжевый длинный) */
    .b-memes {
        width: 140px;
        height: 250px;
        top: 42%;
        right: 5%;
        transform: rotate(5deg);
    }

    /* 9. Кошка (зеленый) */
    .b-cat {
        width: 150px;
        height: 100px;
        top: 45%;
        left: 5%;
        transform: rotate(-10deg);
        z-index: 5;
    }

    /* 10. Кирпич */
    .b-brick {
        width: 60vw;
        height: 100px;
        top: 53%;
        left: 20%;
        transform: rotate(2deg);
    }

    /* 11. Мемы синие */
    .b-memes-blue {
        width: 120px;
        height: 120px;
        top: 60%;
        left: 5%;
        transform: rotate(-15deg);
    }

    /* 12. Универ */
    .b-uni {
        width: 150px;
        height: 120px;
        top: 62%;
        right: 5%;
        transform: rotate(10deg);
    }

    /* 13. Помогите (Желтый квадрат) */
    .b-help {
        width: 140px;
        height: 140px;
        top: 70%;
        left: 30%;
        transform: rotate(45deg); /* Ромб */
    }

    /* 14. Школа */
    .b-school {
        width: 80vw;
        height: 90px;
        top: 78%;
        right: -5%;
        transform: rotate(-5deg);
    }

    /* 15. Гараж (в самом низу) */
    .b-garage {
        width: 90vw;
        height: 150px;
        top: 85%;
        left: 5%;
        transform: rotate(2deg);
    }
    
    /* 3D (маленький квадратик) */
    .block[style*="3d"] {
         /* Тут мы используем селектор по атрибуту, т.к. у 3D не было класса в html */
         top: 92% !important;
         right: 10% !important;
         width: 80px !important; 
         height: 80px !important;
    }
}

/* Задержки, чтобы блоки падали по очереди, а не все сразу */
.block:nth-child(1) { animation-delay: 0.1s; }
.block:nth-child(2) { animation-delay: 0.3s; }
.block:nth-child(3) { animation-delay: 0.05s; }
.block:nth-child(4) { animation-delay: 0.5s; }
.block:nth-child(5) { animation-delay: 0.2s; }
.block:nth-child(6) { animation-delay: 0.6s; }
.block:nth-child(7) { animation-delay: 0.15s; }
.block:nth-child(8) { animation-delay: 0.4s; }
.block:nth-child(9) { animation-delay: 0.7s; }
.block:nth-child(10) { animation-delay: 0.25s; }
.block:nth-child(11) { animation-delay: 0.55s; }
.block:nth-child(12) { animation-delay: 0.35s; }
.block:nth-child(13) { animation-delay: 0.8s; }
.block:nth-child(14) { animation-delay: 0.45s; }
.block:nth-child(15) { animation-delay: 0.65s; }