:root {
    --bg-dark: #0a0e17;
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --text-light: #f8f9fa;
    --accent: #e94560;
    --card-bg: #fdfbf7;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, #1a233a 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Scenes */
.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out, visibility 1s;
    transform: scale(0.95);
}

.scene.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 10;
}

/* Typography */
.elegant-text {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 4rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: pulseText 2s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(243, 229, 171, 0.5); }
}

/* Gift Box */
.gift-container {
    text-align: center;
    perspective: 1000px;
}

.gift-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.3s;
}

.gift-wrapper:hover {
    transform: scale(1.05) translateY(-5px);
}

.gift-box {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.box-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 75%;
    background: linear-gradient(135deg, #16222A 0%, #3A6073 100%);
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.5);
    border: 2px solid var(--gold);
}

.box-lid {
    position: absolute;
    top: 5%;
    left: -5%;
    width: 110%;
    height: 25%;
    background: linear-gradient(135deg, #3A6073 0%, #16222A 100%);
    border-radius: 5px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    border: 2px solid var(--gold);
    z-index: 2;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.8s;
    transform-origin: top center;
}

.gift-wrapper.open .box-lid {
    transform: translateY(-80px) rotateX(70deg) scale(1.1);
    opacity: 0;
}

.gift-wrapper.open .box-body {
    animation: boxShake 0.5s ease-in-out;
}

@keyframes boxShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    50% { transform: translateX(5px) rotate(2deg); }
    75% { transform: translateX(-5px) rotate(-2deg); }
}

.ribbon-vertical {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    height: 100%;
    background: linear-gradient(to right, #b48a25, var(--gold), #b48a25);
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.ribbon-horizontal {
    position: absolute;
    top: 40%;
    width: 100%;
    height: 15%;
    background: linear-gradient(to bottom, #b48a25, var(--gold), #b48a25);
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.bow {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 35px;
    background: radial-gradient(ellipse at center, var(--gold-light) 0%, var(--gold) 70%, #b48a25 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    z-index: 4;
}

.bow::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.3;
}

/* Card Scene */
.card-container {
    perspective: 1500px;
    width: 320px;
    height: 450px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.card.open {
    transform: rotateY(-180deg) scale(1.1);
}

.card-front, .card-inside {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.card-front {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid var(--gold);
    background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.03) 0px, rgba(212, 175, 55, 0.03) 2px, transparent 2px, transparent 4px);
}

.card-front h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.seal {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent), #b83246);
    border-radius: 50%;
    border: 2px dashed #ffb3c1;
    position: relative;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.seal::after {
    content: 'L';
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.hint {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #94a3b8;
    animation: pulseText 2s infinite;
}

.card-inside {
    background: var(--card-bg);
    color: #1e293b;
    transform: rotateY(180deg);
    border: 2px solid var(--gold);
    background-image: radial-gradient(circle at top right, rgba(212, 175, 55, 0.1), transparent 50%);
}

.card-inside h3 {
    font-family: 'Playfair Display', serif;
    color: #0f172a;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

.card-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.card-inside p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #334155;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
}

.elegant-btn {
    background: linear-gradient(45deg, var(--gold), #e5c158, var(--gold));
    background-size: 200% auto;
    color: #0a0e17;
    border: none;
    padding: 12px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    margin-top: 1rem;
}

.elegant-btn:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.6);
}

/* Main Scene */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    width: 100%;
}

.celebration-title {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    color: transparent;
    background: linear-gradient(to right, var(--gold), #fff, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 200% auto;
    text-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    margin-bottom: 2.5rem;
    animation: shine 3s linear infinite, titleFloat 4s ease-in-out infinite;
    text-align: center;
}

@keyframes shine {
    to { background-position: 200% center; }
}

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

.photo-container {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(45deg, var(--gold), #e5c158, var(--accent), var(--gold));
    background-size: 300% 300%;
    animation: borderGlow 4s ease infinite;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 40px rgba(212, 175, 55, 0.4);
    margin-bottom: 2rem;
    z-index: 2;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.luis-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-dark);
    animation: photoZoom 8s alternate infinite ease-in-out;
}

@keyframes photoZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.luis-name {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: white;
    letter-spacing: 8px;
    margin-top: 1.5rem;
    text-shadow: 0 0 20px rgba(255,255,255,0.6), 0 5px 15px rgba(0,0,0,0.8);
    position: relative;
}

/* Animated Cake */
.cake-container {
    position: relative;
    margin-top: 1rem;
    transform: scale(1.2);
}

.cake {
    position: relative;
    width: 160px;
    height: 110px;
    animation: bounce 2s infinite ease-in-out;
}

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

.layer {
    position: absolute;
    width: 100%;
    border-radius: 12px;
    box-shadow: inset 0 -8px 15px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.4);
}

.bottom { 
    height: 45px; 
    bottom: 0; 
    background: linear-gradient(to bottom, #4a192c, #2d0f1b); 
}
.middle { 
    height: 40px; 
    bottom: 45px; 
    width: 85%; 
    left: 7.5%; 
    background: linear-gradient(to bottom, #d4af37, #b8860b); 
}
.top { 
    height: 35px; 
    bottom: 85px; 
    width: 70%; 
    left: 15%; 
    background: linear-gradient(to bottom, #fdfbf7, #e2e8f0); 
}

.icing {
    position: absolute;
    bottom: 110px;
    left: 10%;
    width: 80%;
    height: 15px;
    background: #fff;
    border-radius: 10px 10px 0 0;
}

.drip {
    position: absolute;
    background: #fff;
    width: 15px;
    border-radius: 0 0 10px 10px;
}

.drip-1 { height: 25px; left: 20%; bottom: 85px; }
.drip-2 { height: 35px; left: 50%; bottom: 75px; }
.drip-3 { height: 20px; left: 75%; bottom: 90px; }


.candles {
    position: absolute;
    bottom: 120px;
    left: 20%;
    width: 60%;
    display: flex;
    justify-content: space-evenly;
    z-index: 5;
}

.candle {
    width: 8px;
    height: 35px;
    background: repeating-linear-gradient(45deg, #fff, #fff 4px, var(--accent) 4px, var(--accent) 8px);
    position: relative;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.flame {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 22px;
    background: #ff9d00;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 15px #ff9d00, 0 0 30px #ff9d00, 0 0 45px #ffb700;
    animation: flicker 0.6s infinite alternate;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(0.9); opacity: 0.8; }
    50% { transform: translateX(-45%) scale(1.1); opacity: 1; }
    100% { transform: translateX(-55%) scale(1); opacity: 0.9; box-shadow: 0 0 20px #ff9d00, 0 0 40px #ff9d00, 0 0 60px #ffb700; }
}

/* Confetti Container */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 12px;
    opacity: 0;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-5vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(720deg);
        opacity: 0.8;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .elegant-text {
        font-size: 2rem;
        text-align: center;
        padding: 0 10px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .gift-wrapper {
        width: 160px;
        height: 160px;
    }
    
    .card-container {
        width: 85%;
        height: 400px;
    }
    
    .card-front {
        padding: 1.5rem;
    }
    
    .card-front h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .card-inside {
        padding: 1.5rem;
    }
    
    .card-inside h3 {
        font-size: 1.5rem;
    }
    
    .card-inside p {
        font-size: 1rem;
    }
    
    .celebration-title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }
    
    .photo-container {
        width: 180px;
        height: 180px;
        margin-bottom: 1rem;
    }
    
    .cake-container {
        transform: scale(0.85);
        margin-top: 0;
    }
    
    .luis-name {
        font-size: 2rem;
        letter-spacing: 3px;
        margin-top: 1rem;
        text-align: center;
        padding: 0 10px;
        line-height: 1.2;
    }
}
