/* Общие настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at center, #5d001e 0%, #2c000e 100%); /* Глубокий бордовый */
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Снег */
.snowflake {
    position: fixed;
    top: -10px;
    color: #fff;
    font-size: 1em;
    opacity: 0.8;
    z-index: 999;
    user-select: none;
    pointer-events: none;
    animation: fall linear infinite;
}

@keyframes fall {
    to { transform: translateY(100vh); }
}

/* СЦЕНА 1: Интро */
#intro-screen {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 1s ease;
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 50px;
    max-width: 900px;
    padding: 20px;
}

/* === НОВАЯ 3D ЕЛКА === */
.tree-wrapper {
    position: relative;
    width: 260px;
    height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* Легкое покачивание всей елки */
    animation: sway 4s ease-in-out infinite alternate;
}

/* Конусы (ветки) */
.tree-cone {
    position: absolute;
    width: 0; 
    height: 0; 
    border-radius: 50%; /* Скругляем, чтобы было похоже на конус */
    /* Используем сложный градиент для имитации объема и света слева */
    background: conic-gradient(from 90deg at 50% 50%, 
        #0a3d15 0%, 
        #1e6f2e 35%, 
        #2ecc71 50%, 
        #1e6f2e 65%, 
        #0a3d15 100%);
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.3), /* Глубокая тень внизу */
        inset 0 0 20px rgba(0,0,0,0.4); /* Внутренняя тень */
    z-index: 2;
}

/* Форма конусов через clip-path (делает их треугольными, но с объемной заливкой) */
.tree-cone {
    width: 100%;
    /* Это создает форму конуса с закругленным низом */
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%); 
}

/* Настройка размеров ярусов */
.top {
    width: 140px;
    height: 120px;
    top: 40px;
    z-index: 4;
    background: linear-gradient(135deg, #2ecc71 0%, #0f4d19 100%);
}

.middle {
    width: 200px;
    height: 160px;
    top: 100px;
    z-index: 3;
    background: linear-gradient(135deg, #27ae60 0%, #0a3d15 100%);
}

.bottom {
    width: 260px;
    height: 200px;
    top: 180px;
    z-index: 2;
    background: linear-gradient(135deg, #229954 0%, #06280e 100%);
}

/* Пенек */
.stump {
    width: 50px;
    height: 40px;
    background: linear-gradient(90deg, #3e2723, #5d4037, #3e2723);
    border-radius: 5px;
    position: absolute;
    bottom: 0;
    z-index: 1;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
}

/* Тень на полу */
.shadow-floor {
    position: absolute;
    bottom: -10px;
    width: 180px;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 0;
    animation: shadowScale 4s ease-in-out infinite alternate;
}

/* Звезда */
.star-3d {
    position: absolute;
    top: 0;
    font-size: 50px;
    color: #ffd700;
    z-index: 5;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    animation: starSpin 3s linear infinite;
}

/* Огоньки (гирлянда) */
.lights-group {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.light {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #ff0000);
    box-shadow: 0 0 10px #ff0000;
    animation: blink 1.5s infinite alternate;
}

/* Разброс огоньков (хаотично) */
.top .l1 { top: 60%; left: 30%; background: radial-gradient(circle, #fff, #ffeb3b); box-shadow: 0 0 10px #ffeb3b; }
.top .l2 { top: 70%; left: 60%; background: radial-gradient(circle, #fff, #00cfff); box-shadow: 0 0 10px #00cfff; animation-delay: 0.3s; }

.middle .l1 { top: 50%; left: 40%; background: radial-gradient(circle, #fff, #ff0055); box-shadow: 0 0 10px #ff0055; animation-delay: 0.5s; }
.middle .l2 { top: 75%; left: 20%; background: radial-gradient(circle, #fff, #ff9800); box-shadow: 0 0 10px #ff9800; animation-delay: 0.1s; }
.middle .l3 { top: 70%; left: 70%; background: radial-gradient(circle, #fff, #e040fb); box-shadow: 0 0 10px #e040fb; animation-delay: 0.7s; }

.bottom .l1 { top: 40%; left: 50%; background: radial-gradient(circle, #fff, #00e676); box-shadow: 0 0 10px #00e676; animation-delay: 0.2s; }
.bottom .l2 { top: 60%; left: 25%; background: radial-gradient(circle, #fff, #2979ff); box-shadow: 0 0 10px #2979ff; animation-delay: 0.4s; }
.bottom .l3 { top: 65%; left: 75%; background: radial-gradient(circle, #fff, #ff1744); box-shadow: 0 0 10px #ff1744; animation-delay: 0.6s; }
.bottom .l4 { top: 80%; left: 45%; background: radial-gradient(circle, #fff, #ffd740); box-shadow: 0 0 10px #ffd740; animation-delay: 0.8s; }

/* Анимации */
@keyframes sway {
    0% { transform: rotate(1deg); }
    100% { transform: rotate(-1deg); }
}

@keyframes starSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); } /* Вращение звезды вокруг оси Y - эффект 3D */
}

@keyframes blink {
    0% { opacity: 0.4; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.1); }
}

@keyframes shadowScale {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Текстовый блок */
.message-box {
    text-align: left;
    max-width: 400px;
}

#typing-text {
    /* Новый шрифт: уютный и читаемый рукописный */
    font-family: 'Caveat', cursive; 
    
    /* Чуть увеличим размер, чтобы было хорошо видно */
    font-size: 2.6rem; 
    
    line-height: 1.4;
    min-height: 100px;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    color: #ffecd2;
}

/* Кнопка */
#next-btn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #d4af37, #f2d06b);
    border: none;
    border-radius: 50px;
    color: #2c000e;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    animation: fadeInBtn 2s forwards;
}

#next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.7);
}

.hidden { display: none !important; }

/* СЦЕНА 2: Воспоминания */
#memories-screen {
    padding: 50px 20px;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.gallery-title {
    text-align: center;
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: #d4af37;
    margin-bottom: 60px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.memory-card {
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    opacity: 0; /* Скрыто до скролла */
    transition: all 1s ease-out;
}

.memory-card:nth-child(even) { flex-direction: row-reverse; }

.img-frame {
    flex: 1;
    padding: 10px;
    background: #fff;
    transform: rotate(-2deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

.memory-card:nth-child(even) .img-frame { transform: rotate(2deg); }

.img-frame img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

.text-frame {
    flex: 1;
    padding: 0 40px;
}

.text-frame h3 {
    font-size: 2rem;
    color: #d4af37;
    margin-bottom: 15px;
}

.text-frame p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.footer-note {
    text-align: center;
    margin-top: 50px;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.6);
}

/* Анимации для JS */
.visible { opacity: 1 !important; transform: translateX(0) !important; }

.from-left { transform: translateX(-100px); }
.from-right { transform: translateX(100px); }

@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; transform: translateX(-50%) scale(1.2); } }
@keyframes floatTree { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeInBtn { to { opacity: 1; } }

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .content-wrapper { flex-direction: column; }
    .memory-card, .memory-card:nth-child(even) { flex-direction: column; text-align: center; }
    .text-frame { padding: 20px 0; }
    .img-frame { width: 100%; transform: rotate(0) !important; }
}