/* --- Общие стили и шрифт --- */
body {
    margin: 0;
    font-family: 'Press Start 2P', cursive;
    color: #6d4b4b;
    overflow: hidden; /* Запрещаем прокрутку всей страницы */
    background-color: #fdf5e6;
}

/* --- Контейнеры для фоновых анимаций --- */
#background-text-animation,
#hearts-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Стили для анимированных элементов фона --- */
.floating-text, .floating-heart {
    position: absolute;
    bottom: -100px;
    user-select: none;
    white-space: nowrap;
    animation-name: driftUp;
    animation-timing-function: ease-in-out;
    animation-iteration-count: 1;
}

.floating-text {
    font-family: 'Press Start 2P', cursive;
    color: rgba(221, 160, 221, 0.6);
    text-shadow: 0 0 5px rgba(221, 160, 221, 0.5);
}

.floating-heart {
    color: rgba(255, 105, 180, 0.5);
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

@keyframes driftUp {
    from {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.8;
        transform: translateX(20px);
    }
    100% {
        transform: translateY(-110vh) translateX(-20px);
        opacity: 0;
    }
}

/* --- Основной контент поверх анимаций --- */
.content-overlay {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- Пастельная стилизация карточки --- */
.birthday-card {
    background: rgba(255, 240, 245, 0.4);
    padding: 40px 50px;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(136, 103, 119, 0.25);
    text-align: center;
}

/* --- Анимация появления элементов --- */
.main-title, .recipient-name, .wish-text, .gift-button {
    opacity: 0;
    animation: slide-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.main-title { animation-delay: 0.2s; }
.recipient-name { animation-delay: 0.4s; }
.wish-text { animation-delay: 0.6s; }
.gift-button { animation-delay: 0.8s; }

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Стили текста на карточке --- */
.main-title {
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(2.2em, 13vw, 4.5em);
    margin-bottom: 25px;
    color: #5d3a3a;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    line-height: 1.1;
    margin-top: 0.5em;
}

.recipient-name {
    font-size: 1.2em;
    margin-bottom: 25px;
}

/* === ГЛАВНОЕ ИЗМЕНЕНИЕ ДЛЯ ПРОКРУТКИ ТЕКСТА НА ПК === */
.wish-text {
    font-size: 0.8em;
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto 40px auto;
    text-align: justify;
    /* Ограничиваем высоту блока с текстом */
    max-height: 35vh; /* 35% от высоты экрана */
    /* Добавляем вертикальную прокрутку, если текст не помещается */
    overflow-y: auto;
    /* Отступ для скроллбара, чтобы он не налезал на текст */
    padding-right: 15px;
}

/* --- Стили для кнопки --- */
.gift-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background-color: rgba(255, 192, 203, 0.9);
    color: #5d3a3a;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.8em;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

/* --- Стили для уведомления --- */
#notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translate(-50%, 0);
    width: 30vw;
    max-width: 300px;
    background-color: transparent;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
}

#notification.visible {
    animation: notification-in 0.8s ease-out forwards;
    pointer-events: auto;
}

#notification.hiding {
    animation: notification-out 1.2s ease-in forwards;
    pointer-events: none;
}

@keyframes notification-in {
    from {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes notification-out {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
}

#notification img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

#notification span {
    font-size: 1em;
    color: #333;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
    text-align: center;
}

/* Скрываем перенос строки на больших экранах */
.mobile-break {
    display: none;
}

/* --- АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ --- */
@media (max-width: 600px) {
    .main-title {
        line-height: 1;
        margin-top: 0;
    }
    
    .mobile-break {
        display: block;
    }
    
    .recipient-name {
        font-size: 1em;
    }
    .wish-text,
    .gift-button {
        font-size: 0.7em;
    }
    .birthday-card {
        padding: 20px 15px;
        width: 90%;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    /* Стили прокрутки для мобильных (можно немного изменить высоту) */
    .wish-text {
        max-height: 30vh; /* На мобильных можно сделать чуть меньше */
        padding-right: 10px;
        margin-bottom: 20px;
    }

    #notification {
        width: 60vw;
    }
}