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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ============ CONFETTI ============ */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ============ BALLOONS ============ */
.balloons {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -150px;
    width: 60px;
    height: 75px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: floatUp 12s infinite ease-in;
    opacity: 0.8;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 2px;
    height: 15px;
    background: rgba(255,255,255,0.6);
    transform: translateX(-50%);
}

.balloon:nth-child(1) { background: #ff6b9d; left: 10%; animation-delay: 0s; }
.balloon:nth-child(2) { background: #feca57; left: 30%; animation-delay: 2s; }
.balloon:nth-child(3) { background: #48dbfb; left: 50%; animation-delay: 4s; }
.balloon:nth-child(4) { background: #ff9ff3; left: 70%; animation-delay: 1s; }
.balloon:nth-child(5) { background: #54a0ff; left: 88%; animation-delay: 3s; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(-5deg); opacity: 0; }
    10% { opacity: 0.9; }
    100% { transform: translateY(-110vh) rotate(5deg); opacity: 0; }
}

/* ============ GIFT OVERLAY ============ */
.gift-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.8s ease, visibility 0.8s;
    cursor: pointer;
}

.gift-overlay.opened {
    opacity: 0;
    visibility: hidden;
}

.gift-box {
    text-align: center;
    animation: bounce 1.5s infinite;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s;
}

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

.gift-body {
    width: 140px;
    height: 120px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.gift-lid {
    width: 160px;
    height: 40px;
    background: linear-gradient(135deg, #ff9ff3, #ff6b9d);
    border-radius: 8px;
    margin: 0 auto -5px;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.gift-lid::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 25px;
    background: #feca57;
    border-radius: 50% 50% 0 0;
    box-shadow: 25px 0 0 -5px #feca57, -25px 0 0 -5px #feca57;
}

.gift-ribbon {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 120px;
    background: #feca57;
    z-index: 3;
    border-radius: 4px;
}

.gift-text {
    color: white;
    margin-top: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============ MAIN CARD ============ */
main {
    position: relative;
    z-index: 10;
    padding: 20px;
    width: 100%;
    max-width: 700px;
    transition: opacity 1s ease, transform 1s ease;
}

main.hidden {
    opacity: 0;
    pointer-events: none;
}

main.visible {
    opacity: 1;
}

.card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

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

.photo-frame {
    width: 160px;
    height: 160px;
    margin: 0 auto 25px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, #feca57, #ff6b9d, #48dbfb);
    animation: rotateBorder 6s linear infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@keyframes rotateBorder {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

.photo-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.8), 
                 0 0 40px rgba(254, 202, 87, 0.5);
    margin-bottom: 5px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255,107,157,0.8); }
    to { text-shadow: 0 0 30px rgba(255,107,157,1), 0 0 60px rgba(254,202,87,0.8); }
}

.name {
    font-size: 1.8rem;
    color: #feca57;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.message {
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 30px;
    font-weight: 300;
}

.cake {
    font-size: 4rem;
    margin: 20px 0;
    display: inline-block;
    animation: cakeWiggle 1.5s ease-in-out infinite;
}

@keyframes cakeWiggle {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.1); }
}

.btn-wish {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.5);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-wish:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.7);
}

.wish-box {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-left: 4px solid #feca57;
    border-radius: 15px;
    color: white;
    font-style: italic;
    animation: fadeInUp 0.6s ease;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin-top: 30px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .card { padding: 35px 25px; }
    .title { font-size: 2.5rem; }
    .name { font-size: 1.4rem; }
    .message { font-size: 0.95rem; }
    .photo-frame { width: 130px; height: 130px; }
    .cake { font-size: 3rem; }
}
