:root {
    --gold: #ffd700;
    --red: #ff4d4d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
    overflow: hidden; /* Глобально убираем скролл */
    color: white;
}

/* Фон */
.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #3a1c71 0%, #d76d77 50%, #ffaf7b 100%);
    z-index: -2;
}

/* --- ГИРЛЯНДА --- */
.garland {
    position: absolute; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-around; list-style: none;
    z-index: 10; padding: 0 10px; pointer-events: none;
}
.garland li {
    width: 15px; height: 15px; border-radius: 50%;
    background: white; margin-top: 10px; position: relative;
    animation: glow 1.5s infinite alternate;
}
.garland li::before {
    content: ''; position: absolute; top: -10px; left: -20px;
    width: 60px; height: 20px; border-bottom: 2px solid rgba(0,0,0,0.5);
    border-radius: 50%; z-index: -1;
}
.garland li:nth-child(3n+1) { background: #ff4d4d; box-shadow: 0 2px 15px #ff4d4d; animation-duration: 1s; }
.garland li:nth-child(3n+2) { background: #ffd700; box-shadow: 0 2px 15px #ffd700; animation-duration: 1.5s; }
.garland li:nth-child(3n+3) { background: #00e5ff; box-shadow: 0 2px 15px #00e5ff; animation-duration: 1.2s; }
@keyframes glow { from { opacity: 0.6; } to { opacity: 1; transform: scale(1.1); } }

/* --- ИНТРО --- */
.intro {
    height: 100vh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    transition: opacity 0.8s ease;
    padding: 20px;
}

.glow-title {
    font-weight: 900;
    font-size: 4rem;
    text-transform: uppercase;
    line-height: 1.1;
    letter-spacing: 2px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 40px var(--gold);
}

.pulse-btn {
    font-family: 'Montserrat', sans-serif;
    padding: 18px 50px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    border-radius: 50px;
    background: white;
    color: #3a1c71;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse { 
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* --- КАРТОЧКА (Desktop настройки) --- */
.card-container {
    height: 100vh;
    display: flex; justify-content: center; align-items: center;
    padding: 20px;
}
.hidden { display: none; opacity: 0; }

.glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    
    /* ДЕСКТОП: Широкая карточка */
    padding: 50px;
    max-width: 1200px; /* Увеличили ширину */
    width: 95%;
    
    display: flex; 
    gap: 50px; 
    align-items: center;
    
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: zoomIn 0.8s ease forwards;
}

.circle-1 { position: absolute; width: 300px; height: 300px; background: #ff4d4d; filter: blur(100px); top: -100px; left: -100px; opacity: 0.4; z-index: -1;}
.circle-2 { position: absolute; width: 300px; height: 300px; background: #ffd700; filter: blur(100px); bottom: -100px; right: -100px; opacity: 0.4; z-index: -1;}

.photo-wrapper img {
    width: 350px; /* Чуть крупнее фото на ПК */
    height: 480px; 
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ТЕКСТ (Исправление переполнения) */
.text-content { 
    color: white;
    /* Эти два свойства не дают тексту уехать за экран: */
    flex: 1; 
    min-width: 0; 
}

.text-content h2 {
    font-weight: 800;
    font-size: 2.5rem; 
    
    /* Разрешаем перенос на ПК, если экран не огромный */
    white-space: normal; 
    
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.line {
    width: 60px; height: 4px; background: white;
    margin-bottom: 25px; border-radius: 2px;
}

.letter-text {
    font-weight: 400; font-size: 1.15rem; line-height: 1.6; margin-bottom: 30px;
}

.signature {
    font-weight: 700; font-size: 1rem; letter-spacing: 2px;
    text-transform: uppercase; text-align: right; opacity: 0.8;
}

/* Анимации */
.snowflake { position: fixed; top: -20px; color: white; z-index: -1; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh); } }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* ================================================== */
/* МОБИЛЬНАЯ ВЕРСИЯ (iPhone Fix + No Scroll) */
/* ================================================== */
@media (max-width: 768px) {
    
    html, body {
        /* Фикс для Safari */
        height: -webkit-fill-available;
        width: 100%;
        overflow: hidden; 
        position: fixed;
    }

    .card-container {
        height: 100dvh; 
        height: -webkit-fill-available;
        padding: 0;
        display: flex;
        align-items: flex-start;
    }

    .glass-card {
        flex-direction: column;
        width: 100%;
        height: 100%;
        
        /* ОТСТУПЫ МОБИЛЬНЫЕ */
        padding-top: 75px; /* Отступ от гирлянды */
        padding-bottom: calc(20px + env(safe-area-inset-bottom)); /* Отступ от черной полоски iPhone */
        padding-left: 15px;
        padding-right: 15px;
        
        gap: 15px;
        justify-content: flex-start;
        border-radius: 0;
        border: none;
    }

    /* ФОТО */
    .photo-wrapper {
        height: 32vh; /* ~30% высоты экрана */
        width: 100%; 
        display: flex;
        justify-content: center;
        flex-shrink: 0;
    }

    .photo-wrapper img {
        height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: cover;
        border: 3px solid white;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        border-radius: 12px;
    }

    /* ТЕКСТ МОБИЛЬНЫЙ */
    .text-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        overflow: hidden;
    }

    .text-content h2 {
        white-space: normal;
        text-align: center;
        font-size: 1.6rem;
        margin-bottom: 5px;
        margin-top: 5px;
        line-height: 1.1;
        flex-shrink: 0;
    }

    .line {
        margin-bottom: 10px; width: 40px; flex-shrink: 0;
    }

    .letter-text {
        font-size: 0.9rem;
        line-height: 1.35;
        margin-bottom: 5px;
        text-align: center;
        width: 100%;
        
        /* Внутренний скролл */
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch;
        padding: 0 5px;
    }

    .signature {
        flex-shrink: 0;
        font-size: 0.7rem;
        margin-top: auto; 
        padding-top: 8px;
        opacity: 0.8;
    }
    
    .circle-1, .circle-2 { display: none; }
    .glow-title { font-size: 2.5rem; }
}

/* Фикс для маленьких экранов (iPhone SE/Mini) */
@media (max-width: 768px) and (max-height: 670px) {
    .photo-wrapper { height: 28vh; }
    .glass-card { padding-top: 65px; }
    .text-content h2 { font-size: 1.4rem; }
}

/* --- Эффект снега ПОВЕРХ карточки --- */

/* Класс, который мы добавим через JS при клике */
.snow-container.snow-on-top {
    z-index: 9999; /* Самый высокий слой */
}

/* Убедимся, что снежинки внутри тоже наверху и прозрачны для кликов */
.snow-container.snow-on-top .snowflake {
    z-index: 9999;
    /* Чтобы сквозь снег можно было нажимать и выделять текст */
    pointer-events: none; 
}