:root {
    --bg-top: #020617;
    --bg-bottom: #172554;
    --gold: #fbbf24;
    --gold-glow: #fcd34d;
    --red: #dc2626;
    --red-dark: #991b1b;
    --ribbon: #f59e0b;
    --snow: #f8fafc;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, var(--bg-bottom) 0%, var(--bg-top) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--snow);
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    /* Snow above everything */
}



/* Parallax Wrapper */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through wrappers */
    display: flex;
    /* For centering the card container */
    justify-content: center;
    align-items: center;
}

/* Specific alignments for landscape parts inside parallax wrappers */
.hill-layer {
    /* No special align needed as hills are positioned absolutely inside */
}

.moon {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: #fefce8;
    border-radius: 50%;
    box-shadow: 0 0 50px #fcd34d, 0 0 100px rgba(253, 224, 71, 0.4);
    z-index: 1;
}

.landscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hill {
    position: absolute;
    border-radius: 100% 100% 0 0;
}

.hill-1 {
    width: 120%;
    height: 35%;
    left: -10%;
    bottom: -5%;
    background: #1e293b;
    z-index: 1;
}

.hill-2 {
    width: 120%;
    height: 45%;
    right: -20%;
    bottom: -15%;
    background: #334155;
    z-index: 2;
}

.hill-3 {
    width: 150%;
    height: 30%;
    left: -20%;
    bottom: -10%;
    background: #475569;
    z-index: 3;
    filter: blur(1px);
}

/* Card Container */
.card-container {
    perspective: 1200px;
    z-index: 10;
    pointer-events: none;
    /* Wrapper shouldn't block, children will re-enable */
}

/* Gift Box */
.gift-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease-out;
    /* smooth parallax */
    pointer-events: auto;
    /* Re-enable pointer */
}

.gift-container:hover .click-hint {
    opacity: 1;
    transform: translate(-50%, 10px);
}

/* Removed rotate on hover to avoid conflict with parallax, using scale instead */
.gift-container:hover .gift-box {
    transform: scale(1.05);
}

.glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: -1;
}

.gift-box {
    position: relative;
    width: 160px;
    height: 140px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.box-body {
    position: absolute;
    bottom: 0;
    width: 160px;
    height: 120px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lid {
    position: absolute;
    top: 0;
    left: -5px;
    width: 170px;
    height: 35px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform-origin: top center;
}

.ribbon-v-body {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 100%;
    background: linear-gradient(to right, #fcd34d, #f59e0b, #d97706);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.ribbon-v {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 100%;
    background: linear-gradient(to right, #fcd34d, #f59e0b, #d97706);
}

.ribbon-h {
    display: none;
}

/* Bow */
.bow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    z-index: 3;
}

.bow-left,
.bow-right {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 5px solid #fcd34d;
    border-radius: 50% 50% 0 50%;
    background: radial-gradient(circle at 30% 30%, #fcd34d, #d97706);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bow-left {
    left: -5px;
    transform: rotate(45deg);
    border-radius: 50% 50% 50% 0;
}

.bow-right {
    right: -5px;
    transform: rotate(-45deg);
    border-radius: 50% 50% 0 50%;
}

.bow-center {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    background: #fbbf24;
    border-radius: 4px;
    z-index: 4;
}

.click-hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Mountains of Christmas', cursive;
    color: var(--gold);
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    white-space: nowrap;
}

/* Animations */
.gift-container.shake .gift-box {
    animation: elasticShake 0.6s cubic-bezier(.36, .07, .19, .97) both;
}

.gift-container.open .lid {
    animation: popOff 0.8s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-container.open .gift-box {
    animation: dropDown 0.5s 0.3s forwards ease-in;
}

.gift-container.open .glow-ring,
.gift-container.open .click-hint {
    opacity: 0;
}

/* Message Content */
.message-content {
    position: absolute;
    top: 50%;
    /* Positioned center screen */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 90%;
    max-width: 600px;
    z-index: 20;
}

.message-content.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.message-inner {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}



.christmas-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 5rem;
    margin: 0 0 1rem 0;
    color: var(--gold);
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.2s forwards;
}

.christmas-message {
    font-size: 1.5rem;
    color: #cbd5e1;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.4s forwards;
}

.signature {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.6s forwards;
}

.reset-btn {
    margin-top: 20px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    animation: fadeInUp 0.8s 0.8s forwards;
    position: relative;
    z-index: 100;
    /* Ensure click */
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}


.hidden {
    display: none;
}

/* Keyframes */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

@keyframes elasticShake {
    0% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(5deg) scale(1.1);
    }

    50% {
        transform: rotate(-5deg) scale(1.1);
    }

    75% {
        transform: rotate(5deg) scale(1.1);
    }

    100% {
        transform: rotate(0) scale(1);
    }
}

@keyframes popOff {
    0% {
        transform: translateY(0) rotate(0);
    }

    100% {
        transform: translateY(-300px) rotate(40deg);
        opacity: 0;
    }
}

@keyframes dropDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(100px);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .christmas-title {
        font-size: 3.5rem;
    }

    .christmas-message {
        font-size: 1.2rem;
    }

    .message-inner {
        padding: 2rem 1.5rem;
    }
}