body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    background: #ffe0ec;
    margin: 0;
    overflow: hidden;
}

.heart-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    pointer-events: none;
}

.heart {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #ff69b4;
    left: 50%;
    top: 100%;
    opacity: 0.7;
    transform: translateX(-50%) scale(1);
    animation: floatHeart 8s linear infinite;
}
.heart:before, .heart:after {
    content: "";
    position: absolute;
    width: 32px;
    height: 32px;
    background: #ff69b4;
    border-radius: 50%;
}
.heart:before {
    top: -16px;
    left: 0;
}
.heart:after {
    left: 16px;
    top: 0;
}

@keyframes floatHeart {
    0% {
        top: 100%;
        opacity: 0.7;
        transform: translateX(-50%) scale(1) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1) rotate(10deg);
    }
    100% {
        top: -10%;
        opacity: 0;
        transform: translateX(-50%) scale(0.9) rotate(-10deg);
    }
}

.contenedor {
    position: relative;
}

.superior {
    position: absolute;
    border-left: 220px solid transparent;
    border-right: 220px solid transparent;
    border-top: 140px solid #f08080;
    border-bottom: 140px solid transparent;

    transition: transform 0.75s;
    transform-origin: top;
}

.mensaje {
    position: absolute;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    background: #eae2b7;
    width: 440px;
    height: 280px;
    z-index: -1;
    transition: transform 0.75s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.mensaje p{
    position: relative;
    top: -3px;
    font-size: 1.1rem;
}

.carta {
    border-left: 220px solid #f8ad9d;
    border-right: 220px solid #fa978e;
    border-top: 140px solid transparent;
    border-bottom: 140px solid #f8ad9d;
}

.bxr {
    position: absolute;
    color: #f6406a;
    top: 110px;
    right: 195px;
    font-size: 50px;
    animation: palpitar 0.6s linear infinite;
}

.psorpresa {
    margin-top: -10px;
}

.botones {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.boton {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff66b2, #ff4081);
    background-size: 200% 200%;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.boton:hover {
    background-position: 100%, 100%;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.abrir-superior {
    transform: rotateX(180deg);
}

.abrir-mensaje {
    transform: translateY(-190px);
}

.bxr-rotada{
    color: #f6406a;
    animation: none;
}

@keyframes palpitar {
    0% { transform: scale(1.07); }
    80% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

@media (max-width: 1080px) {
    .mensaje p{
        position: relative;
        top: -8px;
        font-size: 0.98rem;
    }
}