/* Fondo y configuración base */
body {
    background: linear-gradient(to right top, #ffecd2 0%, #fcb69f 100%);
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    color: #333;
}

/* Efecto de luz suave */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%),
                radial-gradient(circle at bottom right, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    animation: background-move 15s infinite alternate;
    z-index: 1;
    pointer-events: none;
}

@keyframes background-move {
    from { background-position: 0% 0%; }
    to { background-position: 100% 100%; }
}

/* Contenedor principal */
.contenedor {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    animation: fadeInScale 2s ease-in-out;
    max-width: 90%;
    position: relative;
    z-index: 2;
}

.titulo {
    color: #FF69B4;
    font-size: 2.5em;
    margin-bottom: 25px;
    animation: bounceIn 2s;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.titulo .corazon {
    color: #FF69B4;
    animation: pulse 1.5s infinite;
}

.imagen-flor img {
    width: 220px;
    height: auto;
    margin: 25px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: float 4s ease-in-out infinite;
}

.mensaje {
    color: #555;
    font-size: 1.3em;
    line-height: 1.8;
    margin-top: 25px;
    animation: slideInUp 2.5s;
}

/* Animaciones base */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes slideInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Botón de carta (si lo usas) */
#botonCarta {
    background-color: #FF69B4;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#botonCarta:hover {
    background-color: #f054a0;
    transform: translateY(-3px);
}

/* Carta secreta */
.contenedor-carta {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: 20;
    animation: fadeIn 1s forwards;
}

.carta-papel {
    background-color: #fffaf0;
    border: 1px solid #ddd;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 80%;
    max-width: 500px;
    border-radius: 15px;
    text-align: left;
    transform: scale(0.5) rotateY(90deg);
    opacity: 0;
    transition: transform 1.5s ease-in-out, opacity 1s ease-in-out;
    will-change: transform, opacity;
}

.carta-papel.abierta {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
}

.encabezado-carta {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5em;
    color: #FF69B4;
    margin-bottom: 20px;
}

.contenido-carta {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #555;
    font-size: 1.1em;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Lluvia de corazones */
.heart-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #FF69B4;
    transform: rotate(-45deg);
    animation: fall 10s linear infinite;
    will-change: transform, opacity;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #FF69B4;
}

.heart::before { top: -10px; left: 0; }
.heart::after { top: 0; left: 10px; }

@keyframes fall {
    0% { transform: translateY(-10vh) rotate(-45deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(105vh) rotate(-45deg); opacity: 0; }
}

/* Corazones al tocar */
.corazon-tap {
    position: absolute;
    font-size: 3em;
    z-index: 999;
    pointer-events: none;
    animation: aparecerYDesvanecer 1s forwards;
    user-select: none;
    will-change: transform, opacity;
}

@keyframes aparecerYDesvanecer {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

/* Personaje animado */
.personaje-contenedor {
    position: absolute;
    bottom: 50px;
    right: 50px;
    text-align: center;
    cursor: pointer;
    z-index: 30;
    animation: flotar 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease-in;
}

.personaje {
    font-size: 5em;
    display: block;
    animation: pulsar 1.4s infinite;
}

.personaje-texto {
    font-size: 1.2em;
    color: #FF69B4;
    font-weight: bold;
    margin-top: 10px;
    animation: parpadear 2s infinite;
}

@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulsar {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes parpadear {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.personaje-movimiento {
    transition: all 1.5s ease-in-out;
    transform: translate(-30vw, 30vh) scale(0.5);
    opacity: 0;
}

/* ✈ Animación estilo avión con cartel TE AMO */
.volando {
    animation: volarConCartel 3s forwards;
    position: relative;
}

@keyframes volarConCartel {
    0% { transform: scale(1) rotate(0deg) translate(0, 0); opacity: 1; }
    50% { transform: translate(30vw, -20vh) rotate(10deg); opacity: 1; }
    100% { transform: translate(80vw, -100vh) rotate(25deg); opacity: 0; }
}

/* Cartel detrás de la carta */
.volando::after {
    content: "💖 TE AMO 💖";
    position: absolute;
    top: 50%;
    left: 120%;
    transform: translateY(-50%);
    font-size: 2em;
    font-weight: bold;
    color: #FF69B4;
    white-space: nowrap;
    animation: aparecerCartel 2s ease-in-out forwards;
}

@keyframes aparecerCartel {
    0% { opacity: 0; transform: translateY(-50%) scale(0.5); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Corazones explosión */
.corazon-destello {
    position: absolute;
    font-size: 1.5em;
    z-index: 100;
    pointer-events: none;
    animation: desaparecer 1s forwards;
}

@keyframes desaparecer {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0); }
}

/* Fuegos artificiales */
.fuego-artificial {
    position: fixed;
    font-size: 2em;
    pointer-events: none;
    z-index: 1000;
    animation: estallar 2s forwards;
}

@keyframes estallar {
    from { opacity: 1; transform: translate(0, 0) scale(0.5) rotate(0deg); }
    to {
        transform: translate(calc(var(--random-x) * 100vw), calc(var(--random-y) * 100vh)) scale(1) rotate(720deg);
        opacity: 0;
    }
}

/* Flor del jardín */
.flor {
    position: absolute;
    bottom: 10px; /* Movida para no tapar texto */
    right: 10px;  /* En la esquina */
    width: 80px;  /* Más pequeña */
    height: 80px;
    z-index: 1; /* Debajo del contenido */
    animation: grow 2s ease-out forwards;
    opacity: 0.8;
}

.petalo {
    position: absolute;
    background: #FFD700;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.petalo-1 { top: 0; left: 50%; transform: translateX(-50%) rotate(0deg); }
.petalo-2 { top: 15%; left: 85%; transform: translateX(-50%) rotate(72deg); }
.petalo-3 { top: 55%; left: 85%; transform: translateX(-50%) rotate(144deg); }
.petalo-4 { top: 55%; left: 15%; transform: translateX(-50%) rotate(216deg); }
.petalo-5 { top: 15%; left: 15%; transform: translateX(-50%) rotate(288deg); }

.centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #FFA500;
    border-radius: 50%;
}

@keyframes grow {
    from { transform: scale(0); }
    to { transform: scale(1); }
}
