
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Poppins:wght@400;600&display=swap');

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: #333;
    width: 100%;
    height: 100%;
    overflow: hidden; 
}

.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #f3e7e9 0%, #e3eeff 100%);
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.step {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2.5rem 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: 600px;
    text-align: center;
    
    display: none;
    
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px); 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, visibility 0.6s;
    
    position: relative; 

    max-height: 90vh; 
    overflow-y: auto; 

    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
.step::-webkit-scrollbar {
    display: none;
}

.step.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    position: relative; 
}

.step:not(.active) {
    position: absolute;
}

.step.slide-in-up {
    transform: translateY(100px); 
}
.step.slide-in-up.active {
    transform: translateY(0);
}

.step.fade-out {
    opacity: 0;
    transform: translateY(-30px); 
    visibility: hidden;
    position: absolute; 
}

h1, h2, h3 {
    font-family: 'Dancing Script', cursive; 
    color: #c94b4b; 
    margin-bottom: 1rem;
    font-size: 2.8rem;
}
h2 { font-size: 2.4rem; }
p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #555;
}

#step-5 h2, #step-5 p {
    position: relative; 
    z-index: 6; 
}

.title-bounce {
    animation: bounceIn 1s ease;
}
@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
    20% { transform: scale3d(1.1, 1.1, 1.1); }
    40% { transform: scale3d(0.9, 0.9, 0.9); }
    60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); }
    80% { transform: scale3d(0.97, 0.97, 0.97); }
    100% { opacity: 1; transform: scale3d(1, 1, 1); }
}


.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(45deg, #dd5e89, #f7bb97);
    color: white;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(221, 94, 137, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(221, 94, 137, 0.6);
}
.btn.hidden { display: none; }

.slideshow-container {
    width: 100%;
    max-width: 500px;
    height: 300px; 
    margin: 0 auto 1.5rem auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slideshow-track {
    display: flex;
    width: calc(250px * 8); 
    animation: slideShow 30s linear infinite;
}

.slide-item {
    width: 250px; 
    height: 300px;
    flex-shrink: 0;
    padding: 15px;
    box-sizing: border-box;
    background: #fff;
    border-right: 2px solid #f0f0f0;
    text-align: center;
}

.slide-item img {
    width: 100%;
    height: 220px; 
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
    border-radius: 5px;
}

.slide-item figcaption {
    font-family: 'Dancing Script', cursive; 
    font-size: 1.3rem;
    color: #555;
    text-align: center;
}

@keyframes slideShow {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-250px * 4)); 
    }
}

.cake-container-css {
    position: relative;
    width: 200px;
    height: 250px; 
    margin: 2rem auto;
    cursor: pointer;
}

.cake-tier-1 { 
    width: 100%;
    height: 100px;
    background: #f7a072; 
    position: absolute;
    bottom: 0;
    border-radius: 10px 10px 50% 50% / 10px 10px 30% 30%;
}
.cake-tier-2 { 
    width: 70%; 
    height: 80px;
    background: #f7a072;
    position: absolute;
    bottom: 100px; 
    left: 15%;
    border-radius: 10px 10px 50% 50% / 10px 10px 30% 30%;
}

.icing {
    width: 100%;
    height: 30px;
    background: #ffffff; 
    position: absolute;
    top: -15px; 
    border-radius: 50% / 20px;
    box-shadow: 0 5px 0 rgba(0,0,0,0.05);
}
.icing::before, .icing::after { 
    content: '';
    position: absolute;
    background: #fff;
    width: 20px;
    height: 30px;
    border-radius: 50%;
    top: 10px;
}
.icing::before { left: 20%; }
.icing::after { right: 20%; }

.sprinkles {
    position: absolute;
    top: 20px;
    left: 10%;
    width: 80%;
    height: 80%;
    background-image:
        radial-gradient(#ffc0cb 2px, transparent 2px),
        radial-gradient(#87ceeb 2px, transparent 2px),
        radial-gradient(#98fb98 2px, transparent 2px);
    background-size: 20px 20px, 20px 20px, 20px 20px;
    background-position: 0 0, 5px 5px, 10px 10px;
}

.candle {
    width: 10px;
    height: 50px;
    background: #fdfd96;
    position: absolute;
    bottom: 180px; 
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px 5px 0 0;
    z-index: 10;
}
.flame {
    width: 10px;
    height: 20px;
    background: #ffc40c;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px #ffc40c, 0 0 20px #ffc40c;
    animation: flicker 1s infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}
@keyframes flicker {
    0%, 100% { transform: translateX(-50%) scaleY(1) scaleX(1); opacity: 1; }
    50% { transform: translateX(-50%) scaleY(0.95) scaleX(1.05); opacity: 0.8; }
}
.smoke {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 10px;
    height: 15px;
    background: #b0b0b0;
    border-radius: 50%;
    opacity: 0;
    z-index: 20;
}
.cake-container-css.blown .flame { opacity: 0; }
.cake-container-css.blown .smoke { animation: smoke-rise-css 2s forwards; }

@keyframes smoke-rise-css {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: translateX(-40%) translateY(-50px) scale(1.5); opacity: 0; }
}

#gift-explosion-origin { 
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
}
.gift-container-css {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    cursor: pointer;
    animation: giftWiggle 2s infinite ease-in-out;
    z-index: 5;
}
.gift-container-css:hover {
    animation-play-state: paused;
}
@keyframes giftWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
}
.gift-box {
    width: 100%;
    height: 100%;
    background: #d63384;
    border-radius: 5px;
    position: absolute;
    bottom: 0;
}
.gift-lid {
    width: 110%;
    height: 30px;
    background: #c22572;
    position: absolute;
    top: -15px;
    left: -5%;
    border-radius: 5px;
    z-index: 10;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}
.ribbon-v, .ribbon-h {
    background: #f7bb97;
    position: absolute;
    z-index: 11;
}
.ribbon-v {
    width: 20px;
    height: 105%;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}
.ribbon-h {
    width: 110%;
    height: 20px;
    top: -10px;
    left: -5%;
}
.gift-container-css.open .gift-lid {
    transform: translateY(-80px) rotate(15deg);
    opacity: 0;
}
.gift-container-css.open .ribbon-h {
    transform: translateY(-80px) rotate(15deg);
    opacity: 0;
}
.gift-container-css.open .ribbon-v {
    height: 100%;
    top: 0;
    transition: height 0.3s ease;
}

.balloon-container {
    position: absolute;
    top: 50%;
    transform: translateY(-60%); 
    width: 100px;
    height: 200px;
    z-index: 4;
}
.balloon-container.left { left: 20%; }
.balloon-container.right { right: 20%; }

.balloon {
    width: 50px;
    height: 65px;
    background: #ccc;
    border-radius: 50%;
    position: absolute;
    animation: float 4s ease-in-out infinite;
    transition: transform 2s ease-in, opacity 2s ease-in; 
}
.balloon::after { 
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    width: 1px;
    height: 30px;
    background: #999;
    transform: translateX(-50%);
}

.balloon.red { background: #ff5e5e; top: 0; left: 0; }
.balloon.yellow { background: #fdfd96; top: 50px; left: 20px; animation-delay: -2s; }
.balloon.blue { background: #87ceeb; top: 0; right: 0; animation-delay: -1s; }
.balloon.green { background: #98fb98; top: 50px; right: 20px; animation-delay: -3s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.step.balloons-released .balloon {
    transform: translateY(-100vh); 
    opacity: 0;
    animation: none; 
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}
.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover { color: #333; }

.voucher {
    background: #fffaf0;
    border: 3px dashed #dd5e89;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
}
.voucher-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #c94b4b;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f7bb97;
}
.voucher-body {
    padding: 1rem 0;
}
.voucher-body p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}
.voucher-footer {
    font-size: 0.8rem;
    color: #999;
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}

.message-box {
    background: #fff8f9;
    border-left: 5px solid #dd5e89;
    padding: 1.5rem;
    border-radius: 5px;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
    min-height: 100px;
}
#step-6 .btn {
    margin-top: 1.5rem;
}

.typed-cursor {
    font-size: 1.2rem;
    color: #dd5e89;
    opacity: 1;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.btn-pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(221, 94, 137, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(221, 94, 137, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(221, 94, 137, 0.4);
    }
}

#step-final {
    text-align: center;
}
#btn-restart {
    margin-top: 2rem;
}