/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a2e, #000); /* Fondo oscuro elegante */
    perspective: 1000px; /* Para el efecto 3D */
}

/* --- CLASES DE UTILIDAD --- */
.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* --- FONDO ANIMADO DE ROSAS --- */
#background-flowers {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-flower {
    position: absolute;
    top: -10%;
    color: #d63447; /* Rojo intenso */
    user-select: none;
    will-change: transform;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* --- ROSA PRINCIPAL FLOTANTE (Reemplaza al castillo) --- */
.main-flower-container {
    position: absolute;
    top: 50%;
    right: 15%; /* Ubicada a la derecha */
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: none;
}

.levitating-rose {
    font-size: 180px; /* Tamaño grande */
    animation: levitate 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(228, 58, 90, 0.4));
}

@keyframes levitate {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@media (max-width: 900px) {
    .main-flower-container {
        right: 50%;
        left: 50%;
        top: 20%;
        transform: translate(-50%, -50%);
        opacity: 0.5; /* Más sutil en móviles */
    }
}

/* --- BOTÓN PLAY SUPERIOR --- */
.play-btn-top {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 25px;
    border-radius: 5px;
    color: #fff;
    font-family: 'Special Elite', cursive;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.play-btn-top:hover {
    background: #fff;
    color: #000;
}

/* --- CARTA ESTILO PAPEL ANTIGUO --- */
.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    justify-content: flex-start; /* Alineado a la izquierda */
    align-items: center;
    padding-left: 10%; /* Espacio desde la izquierda */
    transition: opacity 0.5s ease;
}

@media (max-width: 768px) {
    .card-overlay { justify-content: center; padding-left: 0; }
}

.card {
    position: relative;
    width: 90%;
    max-width: 500px;
    background-color: #f4e4bc;
    background-image: url("https://www.transparenttextures.com/patterns/aged-paper.png");
    padding: 50px 40px;
    box-shadow: inset 0 0 40px rgba(138, 77, 15, 0.2), 15px 25px 50px rgba(0,0,0,0.8);
    border-radius: 5px;
    transform: rotate(-2deg);
    transition: transform 0.5s ease;
}

.card-title {
    font-family: 'Great Vibes', cursive;
    color: #5a3a29;
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}

.paper-content { min-height: 200px; }

#typewriter-text {
    font-family: 'Special Elite', monospace;
    color: #2c1e16;
    font-size: 1.15rem;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
}

#typewriter-text::after {
    content: '|';
    animation: blink 1s infinite;
    color: #5a3a29;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.decoration { text-align: center; font-size: 2rem; color: #8a4d0f; margin: 20px 0; opacity: 0.7; }

.question {
    font-family: 'Special Elite', cursive; font-size: 1.4rem; color: #462b1e; margin: 15px 0 25px 0; text-align: center; font-weight: bold;
}

.buttons { display: flex; justify-content: center; gap: 30px; opacity: 0; transition: opacity 1s ease; }

button {
    padding: 10px 30px; border: 2px solid #5a3a29; background: transparent; font-family: 'Special Elite', cursive; font-size: 1.1rem; color: #5a3a29; cursor: pointer; transition: all 0.2s; border-radius: 3px; text-transform: uppercase;
}

#btn-yes { background-color: #5a3a29; color: #f4e4bc; }
#btn-yes:hover { transform: scale(1.1); background-color: #754c35; }
#btn-no:hover { background-color: rgba(0,0,0,0.1); transform: scale(0.95); }

/* Animación de romper carta */
@keyframes crumbleAndFall {
    0% { transform: rotate(-2deg) scale(1); } 
    20% { transform: rotate(5deg) scale(0.9); }
    100% { transform: rotate(720deg) scale(0) translateY(800px); opacity: 0; }
}
.crumble { animation: crumbleAndFall 1.5s forwards ease-in; pointer-events: none; }


/* --- CELEBRACIÓN (Overlay) --- */
#celebration-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white;
    animation: fadeIn 0.8s forwards;
    backdrop-filter: blur(8px);
}

.close-celebration {
    position: absolute; top: 30px; right: 30px; font-size: 2rem; color: rgba(255,255,255,0.6); cursor: pointer; transition: color 0.3s; font-family: sans-serif; z-index: 2010;
}
.close-celebration:hover { color: white; }

.celebration-content { text-align: center; margin-bottom: 50px; z-index: 2005; }
.celebration-content h1 { font-family: 'Great Vibes', cursive; font-size: 3.5rem; color: #ff6b81; margin-bottom: 10px; }
.celebration-content p { font-family: 'Special Elite', cursive; font-size: 1.5rem; }

.heart-fall { position: fixed; top: -10vh; font-size: 2rem; z-index: 2001; animation: fallHeart linear forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fallHeart { to { transform: translateY(110vh) rotate(360deg); } }

/* --- BOTONES GRANDES FINAL --- */
.post-actions {
    display: flex; flex-direction: column; gap: 20px; z-index: 2005; animation: fadeIn 1s forwards 1s; opacity: 0;
}

.big-action-btn {
    text-decoration: none; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.5); padding: 15px 40px; border-radius: 8px; color: #fff; font-family: 'Special Elite', cursive; font-size: 1.5rem; letter-spacing: 2px; transition: all 0.3s ease; text-align: center; min-width: 250px;
}
.big-action-btn:hover { background: #fff; color: #000; transform: scale(1.05); box-shadow: 0 0 20px rgba(255,255,255,0.3); }

/* Animación de caída para el fondo */
@keyframes fallBackground {
    0% { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(110vh) translateX(20px) rotate(360deg); opacity: 0.3; }
}