body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: url('https://img.freepik.com/vector-gratis/tema-san-valentin-corazones-cielo-rosa_1308-38030.jpg?t=st=1731717320~exp=1731720920~hmac=4642ed233281a4f8a6b2494d2933d447c4454be386a77fe35f6f8cca2ea62df6&w=1060');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: background-color 0.5s ease;
    animation: fanimado 45s infinite;
}

@keyframes animat {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes fanimado {
    0% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* wings */
.wing {
    background: white;
    border-radius: 12px 20px 60px 20px;
    width: 120px;
    height: 50px;
    margin-top: 80px;
    position: absolute;
}

/* right wing */
.right {
    margin-left: -60px;
    left: 50%;
    animation: flap1 1s infinite;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    border-radius: 12px 20px 60px 20px;
    transform: rotate(-10deg) translate(250px, 0);
}

@keyframes flap1 {
    0% { transform: rotate(-10deg) translate(250px, 0); }
    50% { transform: rotate(-5deg) translate(250px, 0); }
}

.right:before {
    position: absolute;
    content: '';
    background: white;
    width: 70%;
    height: 70%;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    border-radius: 20px 20px 60px 20px;
    transform: rotate(20deg) translate(-1px, 0);
    margin-top: 38px;
}

.right:after {
    position: absolute;
    content: '';
    background: white;
    width: 40%;
    transform: rotate(29deg) translate(-8px, 0);
    height: 30%;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    border-radius: 0px 0px 60px 70px;
    margin-top: 66px;
}

/* left wing */
.left {
    border-radius: 12px 20px 20px 60px;
    margin-left: -60px;
    left: 50%;
    animation: flap2 1s infinite;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    transform: rotate(10deg) translate(-248px, 0);
}

@keyframes flap2 {
    0% { transform: rotate(10deg) translate(-248px, 0); }
    50% { transform: rotate(5deg) translate(-248px, 0); }
}

.left:before {
    position: absolute;
    content: '';
    background: white;
    width: 70%;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    transform: translate(46%, 0) rotate(-20deg);
    height: 60%;
    border-radius: 12px 20px 70px 70px;
    margin-top: 40px;
}

.left:after {
    position: absolute;
    content: '';
    background: white;
    width: 40%;
    border-bottom: 3px solid rgba(0, 0, 0, .08);
    height: 30%;
    transform: translate(164%, 0) rotate(-34deg);
    border-radius: 0px 0px 70px 60px;
    margin-top: 58px;
}

/* heart */
.heart{
    position: absolute;
    width: 120px;
    /* CAMBIA ESTO: */
    z-index: 999; /* Bajamos el z-index para que el modal quede encima */
    height: 100px;
    margin-left:-50px;
    left:50%;
    animation: heart 1s infinite;
    transform:scale(.8);
    transition:.6s;
    margin-top:60px;
}

.heart:before,
.heart:after {
    content: "";
    width: 50px;
    height: 80px;
    position: absolute;
    left: 50px;
    top: 0;
    border-radius: 50px 50px 6px 6px;
    cursor: pointer;
    background: crimson;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

@keyframes heart {
    0% { transform: scale(.8) translate(0, 0); }
    50% { transform: scale(.92) translate(0, 12px); }
    100% { transform: scale(.8); }
}

/* envelope */
#envelope {
    background: white;
    /* CAMBIO (ESCRITORIO): Más margen arriba, 0 abajo */
    margin: 250px auto 0 auto;
    height: 200px;
    position: relative;
    width: 320px;
    border-radius: 8px;
    overflow: hidden;
    animation: floaty 1s infinite;
}

@keyframes floaty {
    0% { transform: translate(0, 0); }
    50% { transform: translate(0, 12px); }
}

/* bottom, left, and right sides */
.sides {
    border-color: transparent #fbfbfb #f7f7f7 #fcfcfc;
    border-style: solid;
    border-width: 90px 170px;
    bottom: 0;
    height: 0;
    left: 0;
    position: absolute;
    width: 0;
}

/* top side */
.top {
    border-color: white transparent transparent;
    border-style: solid;
    border-width: 108px 140px 90px 140px;
    height: 0;
    left: 0;
    position: absolute;
    top: 0;
    transform-origin: 50% 0;
    width: 0;
}

.contact {
    position: absolute;
    cursor: pointer;
    bottom: 1rem;
    right: 1rem;
    display: inline-block;
    background: #fff;
    padding: 1.5rem 1.25rem;
    font-family: "Dank Mono", monospace;
    border-radius: 3rem;
    display: flex;
    text-decoration: none;
    align-items: center;
    transition: all 1.5s ease-in-out;
    height: 20px;
    max-width: 30px;
}

.contact .text-love {
    color: crimson;
    animation-duration: 1s;
    animation-name: heartBeat;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    margin: 0 0.5rem;
}

@keyframes heartBeat {
    from { text-shadow: 0px 0px 15px crimson, 1px 1px 10px rgba(255, 255, 255, 0.1); }
    to { text-shadow: 0; }
}

#countdown {
    font-family: 'Dancing Script', cursive;
    color: crimson;
    font-size: 30px;
    text-align: center;
    /* CAMBIO (ESCRITORIO): De negativo a positivo */
    margin-top: 30px; 
}


/* ================================================= */
/* ============ REGLAS RESPONSIVE = */
/* ================================================= */

@media (max-width: 768px) {
    .wing {
        width: 100px;
        height: 40px;
    }

    .right {
        transform: rotate(-10deg) translate(140px, 0);
    }

    .left {
        transform: rotate(10deg) translate(-140px, 0);
    }

    @keyframes flap1 {
        0% { transform: rotate(-10deg) translate(140px, 0); }
        50% { transform: rotate(-5deg) translate(140px, 0); }
    }
    @keyframes flap2 {
        0% { transform: rotate(10deg) translate(-140px, 0); }
        50% { transform: rotate(5deg) translate(-140px, 0); }
    }

    .heart {
        width: 100px;
        height: 80px;
        margin-left: -40px;
    }

    #envelope {
        width: 260px;
        height: 160px;
        /* CAMBIO (TABLET): Más margen arriba, 0 abajo */
        margin: 200px auto 0 auto;
    }

    .contact {
        padding: 1rem;
        font-size: 0.8rem;
        max-width: 40px;
    }

    #countdown {
        font-size: 24px;
        /* CAMBIO: De negativo a positivo */
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .wing {
        width: 80px;
        height: 30px;
        margin-top: 60px;
    }

    .right {
        transform: rotate(-10deg) translate(110px, 0);
    }

    .left {
        transform: rotate(10deg) translate(-110px, 0);
    }
    
    @keyframes flap1 {
        0% { transform: rotate(-10deg) translate(110px, 0); }
        50% { transform: rotate(-5deg) translate(110px, 0); }
    }
    @keyframes flap2 {
        0% { transform: rotate(10deg) translate(-110px, 0); }
        50% { transform: rotate(5deg) translate(-110px, 0); }
    }

    .heart {
        width: 80px;
        height: 60px;
        margin-left: -30px;
    }

    #envelope {
        width: 200px;
        height: 140px;
        /* CAMBIO (CELULAR): Más margen arriba, 0 abajo */
        margin: 180px auto 0 auto;
    }

    .contact {
        padding: 0.8rem;
        font-size: 0.7rem;
        max-width: 50px;
    }

    #countdown {
        font-size: 20px;
        /* CAMBIO: De negativo a positivo */
        margin-top: 20px;
    }
}

.modal-overlay {
    position: fixed; /* Se queda fijo en la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo negro con 60% opacidad */
    
    /* Centra el contenido */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Oculto por defecto */
    display: none; 

    z-index: 10000; /* Asegura que esté por encima de todo */
}

/* La caja blanca del popup */
.modal-contenido {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    font-family: Arial, sans-serif;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    
    /* Animación de entrada */
    animation: aparecer 0.3s ease-out;

    /* AÑADE ESTAS DOS LÍNEAS: */
    position: relative; /* Importante para que el z-index interno funcione bien */
    overflow: hidden;   /* Oculta cualquier cosa que se salga de la caja */
}

.modal-contenido h2 {
    color: #333;
    margin-top: 0;
}

.modal-contenido p {
    color: #555;
    font-size: 16px;
}

/* El botón de "Cerrar" */
.modal-boton {
    background: crimson; /* Color del corazón */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.2s;
}

.modal-boton:hover {
    background: #a80027; /* Un rojo más oscuro */
}

/* Animación para que aparezca suave */
@keyframes aparecer {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}