/* Подключаем шрифты */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* Базовые настройки и жесткая блокировка ширины */
:root {
    --bg-color: #FDF6F5; 
    --text-color: #333333; 
    --accent-color: #D4A3A3; 
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100%;
    overflow-x: hidden; /* Жестко запрещаем вылезать за края */
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
}

/* ========================================= */
/* --- 1. ПЕРВЫЙ ЭКРАН (HERO) --- */
/* ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
}

h1 {
    font-size: 2.2rem; /* Сделали крупнее */
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 30px;
}

.script-font {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem; /* Очень крупный акцент */
    color: var(--accent-color);
    display: block;
    margin-top: -5px;
    line-height: 1.1;
    word-wrap: break-word; /* Чтобы длинные слова переносились */
}

.image-wrapper {
    position: relative;
    width: 90%; 
    max-width: 320px; 
    margin: 0 auto;
}

.main-photo {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.foreground-flowers {
    position: absolute;
    bottom: -53px; 
    right: 0px;  
    width: 110%; /* Цветы станут покрупнее */
    z-index: 2;    
    pointer-events: none; 
}

.subtitle {
    font-size: 1.3rem; /* Читаемый текст под фото */
    font-style: italic;
    line-height: 1.5;
    margin-top: 40px;
    color: #555;
}

/* ========================================= */
/* --- 2. ВТОРОЙ ЭКРАН (КОЛЛАЖ) --- */
/* ========================================= */
.wishes-collage {
    padding: 80px 20px;
    background-color: #FCEBEB; 
    width: 100%;
}

.collage-container {
    display: flex;
    flex-direction: column;
    gap: 70px; /* Отступы между блоками */
}

.collage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

/* Рамки-полароиды для телефона */
.collage-item .img-wrapper {
    background: #ffffff;
    padding: 12px 12px 40px 12px; /* Толстый низ */
    border-radius: 4px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    width: 90%; /* Широкие карточки */
    max-width: 350px;
}

.item-her .img-wrapper {
    padding-bottom: 50px; /* Для её фото низ еще толще */
}

.collage-item .img-wrapper img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

.collage-item .text-wrapper p {
    font-size: 1.4rem; /* Крупный текст */
    color: #444;
    line-height: 1.4;
    padding: 0 10px;
}

.small-script {
    font-size: 3.5rem; /* Огромные красивые надписи */
    color: var(--accent-color);
    margin-bottom: 0;
    display: block;
}

/* ========================================= */
/* --- 3. ТРЕТИЙ ЭКРАН (КАРТЫ) --- */
/* ========================================= */
.scattered-cards {
    padding: 80px 20px 100px; 
    text-align: center;
}

.scattered-cards h2 {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 60px;
}

.scattered-cards h2 .script-font {
    font-size: 3rem; /* Немного уменьшили, чтобы влезло в экран */
}

/* Стол для карт */
.cards-table {
    position: relative; 
    width: 100%;
    max-width: 380px;
    height: 550px; /* Высота стола, чтобы карты поместились */
    margin: 0 auto;
}

/* Сами карты */
.card {
    position: absolute; 
    width: 45%; /* Каждая карта занимает почти половину ширины */
    background: #ffffff;
    padding: 10px 10px 35px 10px; 
    border-radius: 4px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.card img {
    width: 100%;
    display: block;
}

/* Точные координаты для телефона */
.card-1 { top: 0; left: 2%; transform: rotate(-10deg); z-index: 1; }
.card-2 { top: 50px; right: 2%; transform: rotate(14deg); z-index: 2; }
.card-3 { top: 250px; left: 5%; transform: rotate(-6deg); z-index: 3; }
.card-4 { top: 300px; right: 5%; transform: rotate(10deg); z-index: 4; }

/* ========================================= */
/* --- 4. НОВАЯ ЧАСТЬ: ФИНАЛЬНАЯ КНОПКА И ОКНО --- */
/* ========================================= */
.final-action { text-align: center; padding: 20px 20px 100px; }
.main-btn, .next-btn {
    background-color: #F3B0C3; /* Мягко-розовый цвет */
    color: #fff; border: none; padding: 16px 24px; font-size: 1.2rem;
    font-family: 'Playfair Display', serif; border-radius: 40px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(243, 176, 195, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    width: 90%; max-width: 350px; display: inline-block;
}
.main-btn:active, .next-btn:active { transform: scale(0.95); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; padding: 20px; box-sizing: border-box; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: #FDF6F5; padding: 50px 20px 40px; border-radius: 12px; width: 100%; max-width: 400px; text-align: center; position: relative; transform: translateY(30px) scale(0.95); transition: transform 0.3s ease; box-shadow: 0 25px 50px rgba(0,0,0,0.3); box-sizing: border-box; }
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }
.close-btn { position: absolute; top: 5px; right: 15px; font-size: 2.5rem; line-height: 1; background: none; border: none; color: #999; cursor: pointer; padding: 5px; transition: color 0.2s; }
.reason-text { font-size: 1.3rem; color: var(--text-color); margin-bottom: 30px; min-height: 100px; display: flex; align-items: center; justify-content: center; line-height: 1.4; }
.reason-text.final-style { font-family: 'Dancing Script', cursive; font-size: 2.5rem; color: var(--accent-color); line-height: 1.3; }

/* ========================================= */
/* --- АНИМАЦИИ --- */
/* ========================================= */
.animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.delay-1 { transition-delay: 0.3s; }
.delay-2 { transition-delay: 0.6s; }
.animate.visible { opacity: 1; transform: translateY(0); }

/* ========================================= */
/* --- ПК ВЕРСИЯ (Адаптация) --- */
/* ========================================= */
@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    .script-font { font-size: 5rem; }
    .image-wrapper { max-width: 500px; }
    
    /* Исправляем цветы для большого экрана */
    .foreground-flowers {
        width: 110%; 
        bottom: -86px; 
        right: 0px;  
    }
    
    .collage-container { max-width: 1000px; margin: 0 auto; }
    .collage-item { flex-direction: row; text-align: left; gap: 50px; justify-content: center; }
    .item-sushi { justify-content: flex-start; }
    .item-bun { flex-direction: row-reverse; text-align: right; justify-content: flex-end; }
    .item-weeknd { flex-direction: column; text-align: center; }
    .item-her { margin: 40px 0; }
    
    .collage-item .img-wrapper { max-width: 320px; }
    .item-sushi .img-wrapper { transform: rotate(-4deg); }
    .item-bun .img-wrapper { transform: rotate(5deg); }
    .item-her .img-wrapper { transform: rotate(-2deg); max-width: 400px; }
    .item-weeknd .img-wrapper { transform: rotate(3deg); }

    .cards-table { max-width: 800px; height: 800px; } /* Увеличили высоту стола, чтобы карты поместились */
    .final-action { padding-top: 50px; } /* Добавили отступ сверху, чтобы отодвинуть кнопку от карт */
    .card { width: 260px; padding-bottom: 50px; }
    .card-1 { top: 20px; left: 5%; transform: rotate(-15deg); }
    .card-2 { top: 60px; right: 5%; transform: rotate(18deg); }
    .card-3 { top: 300px; left: 15%; transform: rotate(-7deg); }
    .card-4 { top: 340px; right: 15%; transform: rotate(12deg); }

    /* Адаптация новой кнопки для ПК */
    .main-btn, .next-btn { font-size: 1.4rem; padding: 20px 40px; width: auto; max-width: none; }
    .main-btn:hover, .next-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(243, 176, 195, 0.6); background-color: #ebb0c0; }
    .modal-content { max-width: 550px; padding: 60px 40px 50px; }
    .close-btn:hover { color: var(--text-color); }
    .reason-text { font-size: 1.8rem; min-height: 120px; }
    .reason-text.final-style { font-size: 4rem; }
}