* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #faa098 0%, #ff7883 50%, #ffc371 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;

}

.container {
    text-align: center;
    padding: 2rem;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gift-box {
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gift-box:hover {
    transform: scale(1.05);
}

.gift-box.opened {
    animation: none;
}

.gift-box.opened .lid {
    animation: openLid 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-origin: bottom center;
    z-index: 1001;
}

.gift-box.opened .bow {
    animation: shootOffBow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Ribbon body stays in place - no animation */

.gift-box.opened .lid::after {
    animation: shootOffBow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes openLid {
    0% {
        transform: rotateX(0deg) translateY(0) translateX(0) rotateZ(0deg);
        opacity: 1;
    }
    25% {
        transform: rotateX(-45deg) translateY(-40px) translateX(10px) rotateZ(3deg);
        opacity: 1;
    }
    50% {
        transform: rotateX(-80deg) translateY(-100px) translateX(25px) rotateZ(8deg);
        opacity: 0.9;
    }
    75% {
        transform: rotateX(-110deg) translateY(-180px) translateX(45px) rotateZ(12deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateX(-130deg) translateY(-280px) translateX(70px) rotateZ(18deg);
        opacity: 0;
    }
}

@keyframes shootOffBow {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    30% {
        transform: translateX(-50%) translateY(-80px) rotate(180deg) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-250px) rotate(720deg) scale(0.8);
        opacity: 0;
    }
}

@keyframes ripRibbon {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg) scaleY(1);
        transform-origin: top center;
        opacity: 1;
    }
    15% {
        transform: translateX(-50%) translateY(-10px) rotate(-5deg) scaleY(0.95);
        opacity: 1;
    }
    35% {
        transform: translateX(-50%) translateY(-25px) rotate(-15deg) scaleY(0.7);
        opacity: 0.9;
    }
    60% {
        transform: translateX(calc(-50% - 20px)) translateY(-40px) rotate(-30deg) scaleY(0.4);
        opacity: 0.5;
    }
    100% {
        transform: translateX(calc(-50% - 40px)) translateY(-60px) rotate(-45deg) scaleY(0.1);
        opacity: 0;
    }
}

.box {
    width: 200px;
    height: 150px;
    background-color: #d73833;
    margin: 0 auto;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lid {
    width: 200px;
    height: 35px;
    background-color: #d73833;
    position: absolute;
    top: -35px;
    left: 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    will-change: transform;
}

/* Horizontal ribbon on lid */
.lid::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 12px;
    background: #ffd93d;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    box-shadow: 
        inset 0 -2px 3px rgba(0, 0, 0, 0.15),
        inset 0 2px 3px rgba(255, 255, 255, 0.2);
    z-index: 2;
}

.bow {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 40px;
    z-index: 3;
}

/* Left loop of bowtie */
.bow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 25px;
    height: 40px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffca28 100%);
    border-radius: 50% 0 0 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Right loop of bowtie */
.bow::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 40px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffca28 100%);
    border-radius: 0 50% 50% 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Center knot of bowtie */
.lid::after {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: linear-gradient(135deg, #ffdb4d 0%, #ffd93d 100%);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 4;
}

.ribbon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffca28 100%);
    box-shadow: 
        inset -2px 0 3px rgba(0, 0, 0, 0.15),
        inset 2px 0 3px rgba(255, 255, 255, 0.2);
}

.ribbon-lid {
    top: -35px;
    height: 70px;
    z-index: 2;
}

.ribbon-body {
    top: 0;
    height: 150px;
    transform-origin: top center;
    z-index: 1;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.description {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 300;
}

.hint {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 1rem;
    font-weight: 300;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ffd93d;
    pointer-events: none;
    border-radius: 50%;
    z-index: 1000;
}

.confetti.flower {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ff6b9d 0%, #ff8787 100%);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
}

.confetti.star {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #ffd93d;
    background: none;
    border-radius: 0;
    position: relative;
}

.confetti.star::after {
    content: '';
    position: absolute;
    left: -5px;
    top: 2px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--star-color, #ffd93d);
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .box {
        width: 150px;
        height: 112px;
    }
    
    .lid {
        width: 150px;
        height: 30px;
        top: -30px;
    }
    
    .ribbon-body {
        height: 112px;
    }
    
    .ribbon-lid {
        top: -30px;
        height: 60px;
    }
    
    .bow {
        top: -30px;
        width: 55px;
        height: 35px;
    }
    
    .bow::before,
    .bow::after {
        width: 22px;
        height: 35px;
    }
    
    .lid::after {
        top: -25px;
        width: 18px;
        height: 26px;
    }
}