body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #FFB6C1;
    overflow: hidden; /* Prevent scrolling */
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    cursor: pointer;
    z-index: 10; /* Ensure the envelope is above the flowers and hearts */
}

.flap {
    width: 300px;
    height: 100px;
    background-color: #d9534f;
    clip-path: polygon(0% 0%, 100% 0%, 50% 50%);
    position: absolute;
    top: 0;
    transform-origin: top;
    transition: transform 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Dancing Script', cursive;
    font-size: 24px;
    z-index: 2;
}

.flap::before {
    content: "For Cara";
    margin-bottom: 10px;
}

.flap::after {
    content: "❤️";
    font-size: 28px;
}

.body {
    width: 300px;
    height: 200px;
    background-color: #d9534f;
    position: absolute;
    top: 0;
    z-index: 1;
}

.card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 150px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Dancing Script', cursive;
    font-size: 24px;
    color: #d9534f;
    opacity: 0;
    transition: opacity 0.5s ease, top 0.5s ease;
    z-index: 3;
}

.card p {
    margin: 0;
}

.flower, .heart {
    position: absolute;
    font-size: 40px;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
    z-index: 0; /* Ensure flowers and hearts are below the envelope */
}

.envelope.open .flap {
    transform: rotateX(180deg);
}

.envelope.open .card {
    opacity: 1;
    top: 30%;
}

.envelope.open ~ .flower,
.envelope.open ~ .heart {
    opacity: 1;
    transform: scale(1);
}