* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #1b1035, #51245f, #a64d79);
    color: white;
}

/* Ánh sáng lấp lánh */
.sparkles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    color: #fff4b8;
    animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.6);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Màn hình mở thiệp */
.intro {
    text-align: center;
    z-index: 5;
    transition: opacity 0.8s, transform 0.8s;
}

.intro-text {
    font-size: 22px;
    margin-bottom: 35px;
    color: #ffe5f2;
    text-shadow: 0 0 15px #ff9bd2;
}

/* Phong bì */
.envelope {
    position: relative;
    width: 250px;
    height: 170px;
    margin: auto;
    cursor: pointer;
    perspective: 800px;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #f7a6cb;
    border-radius: 8px;
}

.letter {
    position: absolute;
    width: 90%;
    height: 135px;
    background: #fff8fc;
    color: #c34d91;
    left: 5%;
    bottom: 5px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 1s;
}

.letter span {
    font-size: 35px;
}

.envelope-flap {
    position: absolute;
    inset: 0;
    background: #ffcae1;
    clip-path: polygon(0 0, 100% 0, 50% 60%);
    transform-origin: top;
    transition: transform 0.8s;
    z-index: 3;
}

.envelope-front {
    position: absolute;
    inset: 0;
    background: #f18ab9;
    clip-path: polygon(0 100%, 0 0, 50% 60%, 100% 0, 100% 100%);
    z-index: 2;
}

.heart {
    position: absolute;
    top: 65px;
    left: 112px;
    color: #fff;
    font-size: 28px;
    z-index: 4;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 0;
}

.envelope.open .letter {
    transform: translateY(-100px);
}

.click-text {
    margin-top: 25px;
    color: #ffe1f0;
}

/* Nút */
button {
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    background: linear-gradient(45deg, #ff82bd, #ffb6d5);
    color: #5c1744;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 12px 5px;
    box-shadow: 0 0 20px #ff91cb;
    transition: 0.3s;
}

button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px #fff;
}

/* Thiệp chính */
.card {
    position: relative;
    width: min(90%, 450px);
    padding: 40px 25px;
    text-align: center;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    box-shadow: 0 0 40px rgba(255, 143, 208, 0.35);
    z-index: 5;
    animation: appear 1s ease;
}

.hidden {
    display: none;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.small-title {
    letter-spacing: 4px;
    color: #ffd5e9;
    font-size: 12px;
}

h1 {
    font-size: clamp(30px, 8vw, 42px);
    margin: 15px 0;
    color: #ffe3f1;
    text-shadow: 0 0 15px #ff9ed0;
}

.cake {
    font-size: 75px;
    margin: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

h2 {
    color: #ffcee5;
    margin-bottom: 15px;
}

.wish {
    line-height: 1.8;
    font-size: 16px;
}

.love {
    color: #ffe0f1;
    margin-top: 20px;
    font-style: italic;
}

/* Bóng bay */
.balloon {
    position: fixed;
    bottom: -120px;
    font-size: 45px;
    animation: flyUp linear forwards;
    z-index: 2;
    pointer-events: none;
}

@keyframes flyUp {
    to {
        transform: translateY(-120vh) rotate(20deg);
        opacity: 0;
    }
}

/* Trái tim và hoa rơi */
.falling {
    position: fixed;
    top: -40px;
    pointer-events: none;
    animation: fall linear forwards;
    z-index: 4;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Pháo hoa */
.firework {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .card {
    width: auto;
    max-width: 95vw;
    text-align: center;
    overflow: visible;
}
}
.german-message {
    font-family: Consolas, monospace;
    font-size: 16px;
    line-height: 1.6;
    text-align: left;
    white-space: nowrap;
    color: white;
    width: max-content;
    max-width: none;
    margin: 20px auto;
}