body {
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 0;
    color: #4a4a4a;
    text-align: center;
    background-color: #f9f9f9;
}

/* --- Estilos del Sobre (Envelope) --- */
body.locked { overflow: hidden; }

#envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #444 0%, #1a1a1a 100%); /* Fondo con degradado elegante */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}

.envelope-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease;
}

.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background: #D7BDE2; /* Color interior del sobre (Lila Suave) */
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    perspective: 1000px;
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 160px 120px 160px; /* Crea el triángulo inferior */
    border-color: transparent transparent #EBDEF0 transparent; /* Color del frente del sobre (Lila Pálido) */
    z-index: 3;
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 110px 160px 0 160px; /* Crea el triángulo superior (solapa) */
    border-color: #EBDEF0 transparent transparent transparent; /* Color de la solapa */
    transform-origin: top;
    transition: transform 0.6s ease, z-index 0.1s linear 0.3s;
    z-index: 5;
}

.paper {
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 300px;
    height: 200px;
    background: white;
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.6s ease 0.6s;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.paper-content { text-align: center; }
.paper-name { font-family: 'Great Vibes', cursive; font-size: 2rem; color: #8E44AD; margin: 5px 0; }
.paper-text { font-size: 0.9rem; color: #666; margin: 0; }

.seal {
    position: absolute;
    top: 110px; /* Posición en la punta de la solapa */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: #DB9EF4; /* Lila Principal */
    border-radius: 50%;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Great Vibes', cursive;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}
.seal:hover { transform: translate(-50%, -50%) scale(1.1); }

/* Animaciones de apertura */
.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
}
.envelope.open .seal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.envelope.open .paper {
    transform: translateY(-80px); /* Saca la tarjeta hacia arriba */
}

/* Escalar el sobre según el dispositivo */
@media (max-width: 360px) {
    .envelope-wrapper { transform: scale(0.85); }
}
@media (min-width: 768px) {
    .envelope-wrapper { transform: scale(1.3); }
}
@media (min-width: 1200px) {
    .envelope-wrapper { transform: scale(1.6); }
}

/* Botón de entrar */
#action-area { margin-top: 100px; opacity: 0; transition: opacity 0.5s; }
@media (min-width: 768px) {
    #action-area { margin-top: 210px; }
}
#action-area.fade-in { opacity: 1; }
.hidden { display: none; }

.btn-enter {
    background: #DB9EF4;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Raleway', sans-serif;
}

/* Transiciones de página */
.hidden-content { display: none; }
.slide-up-out { transform: translateY(-100%); opacity: 0; }
.fade-in-page { animation: fadeInPage 1.5s forwards; }

@keyframes fadeInPage {
    from { opacity: 0; }
    to { opacity: 1; }
}

h1, h2, h3 {
    font-family: 'Great Vibes', cursive;
    font-weight: 400;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero */
.hero {
    height: 100vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

.nombres {
    font-size: 4rem;
    margin: 10px 0;
}

.fecha-badge {
    border: 2px solid white;
    padding: 10px 20px;
    display: inline-block;
    margin: 20px 0;
}

.fecha-badge span {
    display: block;
    line-height: 1.2;
}

.dia { font-size: 5rem; font-weight: bold; }
.mes { font-size: 2.5rem; text-transform: uppercase; }
.anio { font-size: 2rem; }

/* Invitacion */
.invitacion { padding: 60px 20px; background: white; overflow: hidden; }
.frase { font-style: italic; color: #888; margin: 0; padding: 0 10px; line-height: 1.6; }

/* Slider de Frases */
.slider-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.slider-track {
    display: flex;
    width: 400%; /* 3 frases + 1 clon = 4 slides */
    animation: slideScroll 21s infinite; /* 7s por frase aprox */
}

.slide {
    width: 25%; /* 100% / 4 slides */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideScroll {
    0%, 28% { transform: translateX(0); }
    33.33%, 61.33% { transform: translateX(-25%); }
    66.66%, 94.66% { transform: translateX(-50%); }
    100% { transform: translateX(-75%); }
}

/* Countdown */
.countdown-section {
    background-color: #DB9EF4;
    color: white;
    padding: 40px 20px;
}
#countdown { display: flex; justify-content: center; gap: 20px; }
.time-box { font-size: 1.5rem; }
.time-box span { display: block; font-size: 4.5rem; font-weight: bold; }

/* Itinerario */
.itinerario { padding: 60px 20px; }
.timeline { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.evento { display: flex; align-items: center; gap: 20px; text-align: left; width: 100%; max-width: 400px; }
.icono { 
    width: 50px; height: 50px; 
    background: #DB9EF4; color: white; 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

/* Ubicacion */
.ubicacion { padding: 60px 20px; background: #fff; }
.ubicacion-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}
.ubicacion-item {
    flex: 1 1 300px;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #4a4a4a;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}

/* Detalles */
.detalles { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    padding: 60px 20px; 
    flex-wrap: wrap;
    max-width: 1000px;
}
.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 250px;
}
.card i { font-size: 2rem; color: #DB9EF4; margin-bottom: 15px; }
.card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}
.small { font-size: 0.9rem; color: #666; }

/* Galeria */
.galeria { display: flex; flex-wrap: wrap; }
.galeria img {
    width: 33.33%;
    height: 300px;
    object-fit: cover;
}

footer {
    background: #333;
    color: white;
    padding: 40px 20px;
    font-size: 1.3rem;
}

@media (max-width: 768px) {
    .nombres { font-size: 3rem; }
    .galeria img { width: 50%; }
}
@media (max-width: 480px) {
    .galeria img { width: 100%; }
    .music-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
}

/* Controles de música flotantes */
.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.music-controls button {
    background: #DB9EF4;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s;
}

.music-controls button:hover {
    transform: scale(1.1);
}

.music-controls input[type=range] {
    width: 80px;
    accent-color: #DB9EF4;
    cursor: pointer;
}