:root {
    --primary-color: #ffb7c5; /* Blush Pink */
    --secondary-color: #ffffff;
    --accent-color: #ff8fa3;
    --text-color: #4a4a4a;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #fffafb;
    background-image: radial-gradient(circle at top right, #fff0f3, transparent),
                      radial-gradient(circle at bottom left, #fff0f3, transparent);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-color);
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.heart-loader {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    position: relative;
    transform: rotate(45deg);
    animation: pulse 1s infinite alternate;
}

.heart-loader:before,
.heart-loader:after {
    content: "";
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: absolute;
}

.heart-loader:before {
    top: -30px;
    left: 0;
}

.heart-loader:after {
    top: 0;
    left: -30px;
}

@keyframes pulse {
    0% { transform: rotate(45deg) scale(0.8); }
    100% { transform: rotate(45deg) scale(1.1); }
}

/* Transitions */
section {
    transition: opacity 1s ease, transform 1s ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
    opacity: 0;
}

.active {
    opacity: 1;
}

/* Envelope Act */
.envelope-wrapper {
    cursor: pointer;
    perspective: 1000px;
}

.envelope {
    width: 280px;
    height: 180px;
    background-color: var(--primary-color);
    position: relative;
    border-radius: 0 0 5px 5px;
    transition: transform 0.5s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.envelope:hover {
    transform: translateY(-10px);
}

.flap {
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 5px;
    transform-origin: top;
    transition: transform 0.6s ease;
    z-index: 3;
    clip-path: polygon(0 0, 100% 0, 50% 50%);
}

.pocket {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0 0 5px 5px;
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 50% 45%);
}

.letter {
    width: 260px;
    height: 180px;
    background: #fff;
    position: absolute;
    bottom: 5px;
    left: 10px;
    z-index: 1;
    transition: transform 0.5s ease 0.3s;
    padding: 25px;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 1px solid #eee;
}

.fernanda-name {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin: 10px 0;
    font-family: 'Playfair Display', serif;
    font-style: italic;
}

.btn-mini {
    background: var(--primary-color);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease 0.8s;
}

.envelope.open .btn-mini {
    opacity: 1;
}

/* Open Animation - Increased translation */
.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 0; /* La solapa se va al fondo al abrirse */
}

.envelope.open .letter {
    transform: translateY(-180px); /* Sube un poco más */
    z-index: 5; /* La carta pasa a estar delante de todo */
}

/* Timeline Act */
#timeline-section {
    flex-direction: column;
}

.container {
    max-width: 800px;
    width: 100%;
}

.title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease;
}

.title.show {
    opacity: 1;
    transform: translateY(0);
}

.timeline {
    position: relative;
    padding-bottom: 100px;
}

.timeline-item {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.timeline-item.show {
    opacity: 1;
    transform: translateY(0);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(255, 183, 197, 0.1);
}

.photo-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.photo-placeholder {
    width: 100%;
    height: 450px; /* Aumentado para fotos verticales */
    background: #fdf2f4;
    border-radius: 15px;
    overflow: hidden;
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Rellena el área sin deformar */
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.scroll-indicator {
    text-align: center;
    padding: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* Question Act */
.question-container {
    text-align: center;
    padding: 60px 40px;
    max-width: 500px;
    width: 100%;
    transform: scale(0.9);
    opacity: 0;
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; /* Base para el movimiento del botón */
    min-height: 450px; /* Espacio garantizado para el juego */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.question-container.show {
    transform: scale(1);
    opacity: 1;
}

.main-question {
    font-size: 2.5rem;
    margin-bottom: 40px;
    line-height: 1.3;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    height: 100%;
    position: static;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    font-family: 'Outfit', sans-serif;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Previene comportamientos nativos en móvil como el scroll o el menú contextual */
}

.proposal-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.instruction {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    opacity: 0.8;
}

.progress-container {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-color);
    transition: none;
}

.primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 143, 163, 0.3);
}

.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 143, 163, 0.4);
}

.secondary {
    background-color: #f0f0f0;
    color: #666;
    position: relative;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .main-question { font-size: 1.8rem; }
    .btn { padding: 12px 25px; font-size: 1rem; }
    
    .envelope { width: 220px; height: 140px; }
    
    .letter { 
        width: 200px; 
        height: auto; 
        min-height: 160px; 
        left: 10px; 
        padding: 15px;
    }
    
    .fernanda-name { font-size: 1.4rem; margin: 5px 0; }
    .letter-text p { font-size: 0.9rem; }
    .btn-mini { padding: 6px 12px; font-size: 0.7rem; }

    .envelope.open .letter {
        transform: translateY(-140px);
    }

    .photo-placeholder {
        height: 400px; /* Un poco más bajo en móviles pero sigue siendo vertical */
    }
}
