
/* ===== CONFIGURACIÓN GENERAL ===== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;

    font-family: Arial, sans-serif;
    text-align: center;
    color: #c51616;

    background:
        linear-gradient(rgba(35, 0, 15, 0.25),
                        rgba(35, 0, 15, 0.35)),
        url("../IMG/75398-coraz-el_dia_de_san_valentin-rojo-amor-ilustracion-x750.jpg")
        no-repeat center center fixed;

    background-size: cover;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow-x: hidden;
}

/* ===== CONTENEDOR PRINCIPAL ===== */

.container {
    position: relative;
    z-index: 3;

    padding: 24px 18px;
    width: 92%;
    max-width: 520px;

    border-radius: 25px;

    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ===== FOTO Y LATIDOS ===== */

.photo-frame {
    width: min(65vw, 250px);
    aspect-ratio: 1 / 1;

    margin: 10px auto 20px;
    padding: 6px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        white,
        #ff174f,
        #ffb6d5,
        white
    );

    box-shadow:
        0 0 20px #ff4d8d,
        0 0 40px rgba(255, 0, 100, 0.3);

    animation: latido 1.2s infinite;
}

.foto {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;

    border: 3px solid white;

    opacity: 1;
    transition: opacity 0.9s ease-in-out;
}

.foto.desvanecer {
    opacity: 0;
}

@keyframes latido {
    0%, 100% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.06);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.04);
    }

    58% {
        transform: scale(1);
    }
}

/* ===== MENSAJE PRINCIPAL ===== */

.mensaje {
    margin-top: 16px;

    color: #fff;
    font-size: clamp(21px, 5vw, 29px);

    text-shadow:
        0 0 5px #ff174f,
        0 0 12px #ff4d88,
        0 0 22px #e6005c;

    animation: aparecer 2.5s ease-in-out;
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FRASES CENTRALES ===== */

.frase-central {
    min-height: 75px;
    margin: 20px 0 8px;
    padding: 5px;

    color: #fff;
    font-size: clamp(18px, 4.5vw, 23px);
    line-height: 1.5;

    text-shadow:
        0 0 5px #ff174f,
        0 0 12px #ff3385;

    opacity: 1;
    transition: opacity 0.8s ease;
}

.frase-central.desvanecer {
    opacity: 0;
}

.contador {
    color: #fff0f5;
    font-size: 14px;
    text-shadow: 0 0 7px #e6005c;
}

/* ===== BOTÓN ===== */

button {
    padding: 13px 25px;
    margin-top: 14px;

    border: 2px solid white;
    border-radius: 30px;

    background: linear-gradient(135deg, #fff, #ffe1ed);
    color: #aa2652;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 50, 120, 0.4);

    transition:
        transform 0.3s ease,
        background 0.3s ease;
}

button:hover {
    background: #ffc9df;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.97);
}

/* ===== MENSAJE EXTRA ===== */

#mensajeExtra {
    margin-top: 22px;
    padding: 12px;

    color: #fff;
    font-size: clamp(17px, 4.5vw, 22px);
    line-height: 1.7;

    text-shadow:
        0 0 5px #e71d82,
        0 0 10px #f554a5,
        0 0 20px #ff3385;

    animation: aparecer 1.5s ease;
}

#mensajeExtra[hidden] {
    display: none;
}

/* ===== CAPAS DE LLUVIA ===== */

#rainFlores,
#rainFrases {
    position: fixed;
    inset: 0;

    overflow: hidden;
    pointer-events: none;
}

#rainFlores {
    z-index: 2;
}

#rainFrases {
    z-index: 4;
}

/* ===== ROSAS QUE CAEN LENTAMENTE ===== */

.flor-caida {
    position: absolute;
    top: -60px;

    user-select: none;
    will-change: transform, opacity;

    animation: caerFlor linear forwards;
}

@keyframes caerFlor {
    0% {
        transform: translate3d(0, -5vh, 0) rotate(0deg);
        opacity: 0;
    }

    12% {
        opacity: 0.95;
    }

    75% {
        opacity: 0.9;
    }

    100% {
        transform: translate3d(35px, 110vh, 0) rotate(360deg);
        opacity: 0;
    }
}

/* ===== FRASES QUE CAEN POR SEPARADO ===== */

.frase-caida {
    position: absolute;
    top: -100px;

    max-width: min(280px, 75vw);
    padding: 9px 14px;

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px;

    background: rgba(110, 0, 40, 0.55);
    color: white;

    font-size: clamp(13px, 3.5vw, 17px);
    line-height: 1.4;
    text-align: center;

    text-shadow: 0 0 7px #ff2d7a;
    box-shadow: 0 0 12px rgba(255, 70, 140, 0.3);

    overflow-wrap: break-word;
    will-change: transform, opacity;

    animation: caerFrase linear forwards;
}

@keyframes caerFrase {
    0% {
        transform: translate3d(0, -5vh, 0) rotate(-3deg);
        opacity: 0;
    }

    12% {
        opacity: 0.95;
    }

    75% {
        opacity: 0.9;
    }

    100% {
        transform: translate3d(25px, 110vh, 0) rotate(3deg);
        opacity: 0;
    }
}

/* ===== REPRODUCTOR OCULTO ===== */

.youtube-music {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ===== CELULARES ===== */

@media (max-width: 480px) {
    .container {
        width: 94%;
        padding: 18px 12px;
    }

    .photo-frame {
        width: min(65vw, 220px);
    }

    .frase-central {
        min-height: 85px;
    }
}

/* ===== ACCESIBILIDAD: MENOS MOVIMIENTO ===== */

@media (prefers-reduced-motion: reduce) {
    .photo-frame {
        animation-duration: 3s;
    }
}

.foto {
    object-position: center 8%;
}

/*respose movil*/

.photo-frame {
    width: min(65vw, 250px);
    aspect-ratio: 1 / 1;
    margin: 20px auto;
    padding: 5px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, white, #ff174f, #ffb6d5);
    box-shadow: 0 0 20px #ff4d8d;
    animation: latido 1.2s infinite;
}

.foto {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    border-radius: 50%;
    border: 3px solid white;
    transition: opacity 0.8s ease-in-out;
}

.foto.desvanecer {
    opacity: 0;
}

/* Ajustes para celulares */
@media (max-width: 480px) {
    .photo-frame {
        width: min(65vw, 210px);
        padding: 4px;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 360px) {
    .photo-frame {
        width: 175px;
    }
}

/*flawer*/
.flor-lluvia {
    position: fixed;
    top: -60px;
    z-index: 999;
    pointer-events: none;
    animation: caerFlor linear forwards;
}

.imagen-flor {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

@keyframes caerFlor {
    0% {
        transform: translateY(-60px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .imagen-flor {
        width: 38px;
        height: 38px;
    }
}