html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
}

html {
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    user-select: none;
    background: transparent;
}

img {
    -webkit-user-drag: none;
}

.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snow-container::before,
.snow-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(4px 4px at 20% 30%, #fff, transparent),
        radial-gradient(6px 6px at 40% 70%, #fff, transparent),
        radial-gradient(5px 5px at 60% 20%, #fff, transparent),
        radial-gradient(4px 4px at 80% 50%, #fff, transparent),
        radial-gradient(6px 6px at 10% 90%, #fff, transparent),
        radial-gradient(5px 5px at 90% 10%, #fff, transparent),
        radial-gradient(4px 4px at 30% 50%, #fff, transparent),
        radial-gradient(6px 6px at 70% 80%, #fff, transparent);
    background-size: 200px 200px;
    animation: snow-fall 20s linear infinite;
}

.snow-container::after {
    margin-left: -100px;
    opacity: 0.5;
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes snow-fall {
    0% { background-position: 0 0; }
    100% { background-position: 0 1000px; }
}

.tree-container {
    position: relative;
    display: inline-block;
}


.tree {
    position: relative;
    z-index: 1;
    max-height: 80dvh;
    max-width: 90vw;
    width: auto;
    height: auto;
    display: block;
}


.star {
    position: absolute;
    top: -8%;
    left: 48%;
    transform: translateX(-50%);
    width: 15%;
    z-index: 30;
}

.ornament {
    position: absolute;
    width: 16%;
    aspect-ratio: 1 / 1;
    z-index: 30;
    cursor: pointer;
    transition: transform 0.2s ease;
}


.ornament:hover {
    transform: scale(1.1);
}

.ornament.falling {
    animation: fall-down 0.8s forwards ease-in;
    pointer-events: none;
}

.present-wrapper {
    position: absolute;
    bottom: -8%;
    left: 35%;
    width: 30%;
    z-index: 30;
}

.present {
    width: 75%;
    cursor: pointer;
    transition: width 0.3s ease, transform 0.3s ease;
}

.present.is-open {
    width: 100%;
}

.present:hover {
    transform: scale(1.05);
}

.locket {
    position: absolute;
    top: 0%;
    left: 100%;
    width: 60%;
    height: auto;
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 10;
    object-fit: contain;
}

.locket.revealed {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(20px);
}

.locket.expanded {
    position: fixed;
    top: 85%;
    left: auto;
    right: 10%;
    width: clamp(150px, 18vw, 280px);
    height: clamp(150px, 18vw, 280px);
    transform: translateY(-50%);
    z-index: 100;
    object-fit: contain;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease-in-out;
}

.locket.flipping {
    transform: translateY(-50%) rotateY(90deg);
}

@keyframes fall-down {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    90% {
        transform: translateY(var(--fall-distance, 400px)) rotate(180deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(var(--fall-distance, 400px)) rotate(180deg) scale(1.5, 0.2);
        opacity: 0;
        filter: brightness(2) blur(2px);
    }
}

.peach {
    top: 45%;
    left: 30%;
}

.pink {
    top: 55%;
    left: 65%;
}

.red {
    top: 35%;
    left: 55%;
    width: 22%;
}

.silver {
    top: 65%;
    left: 35%;
    width: 22%;
}

.hanged-picture {
    position: fixed;
    top: 20%;
    width: clamp(120px, 18vw, 300px);
    height: auto;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    z-index: 20;
    pointer-events: none;
}

.hanged-picture img {
    width: 100%;
    border: 8px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

#chuubear-container {
    left: 5%;
    transform: rotate(-10deg) translateY(-50px);
}

#vivibear-container {
    right: 5%;
    transform: rotate(10deg) translateY(-50px);
}

#kimlipbear-container {
    left: 15%;
    top: 50%;
    transform: rotate(5deg) translateY(-50px);
}

#hyejubear-container {
    right: 15%;
    top: 50%;
    transform: rotate(-5deg) translateY(-50px);
}

.hanged-picture.visible {
    opacity: 1;
    transform: rotate(var(--rotation, 0deg)) translateY(0);
}

#chuubear-container.visible {
    --rotation: -10deg;
}

#vivibear-container.visible {
    --rotation: 10deg;
}

#kimlipbear-container.visible {
    --rotation: 5deg;
}

#hyejubear-container.visible {
    --rotation: -5deg;
}

.star {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.star:hover {
    transform: translateX(-50%) scale(1.1);
}

.star.falling-star {
    animation: star-fall-down 1s forwards ease-in-out;
}

@keyframes star-fall-down {
    0% { top: -8%; transform: translateX(-50%) rotate(0deg); }
    100% { top: 40%; transform: translateX(-50%) rotate(360deg) scale(0); opacity: 0; }
}

.reveal-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vw;
    width: 95vw;
    z-index: 20;
    pointer-events: none;
}

.center-picture {
    width: clamp(120px, 18vw, 220px);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-picture img {
    width: 100%;
    border: 10px solid white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.heart {
    width: clamp(60px, 10vw, 110px);
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.6));
    animation: heartbeat 1.5s infinite;
    border: none !important;
    box-shadow: none !important;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.center-picture.visible {
    opacity: 1;
    transform: scale(1);
}


.snow-picture {
    position: fixed;
    bottom: 5%;
    left: 5%;
    width: clamp(150px, 18vw, 300px);
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
    z-index: 20;
    pointer-events: none;
}

.snow-picture img {
    width: 100%;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.snow-picture.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    #chuubear-container { left: 2%; }
    #vivibear-container { right: 2%; }
    #kimlipbear-container { left: 5%; top: 45%; }
    #hyejubear-container { right: 5%; top: 45%; }
    
    .hanged-picture {
        width: 30vw;
    }

    .center-picture {
        width: 30vw;
    }

    .heart {
        width: 15vw;
    }
}




