body {
    color: #ffffff;
    background: linear-gradient(-45deg, #1a1a1a, #2c064d, #1a1a1a, #4a0e8f);
    background-size: 400% 400%;
    animation: fadeIn 1.5s ease-out, gradientBG 15s ease infinite;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.overlay-contenido img{
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid #9309f6;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(147, 9, 246, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
}

img:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(147, 9, 246, 0.8);
}

.arriba {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.encabezado {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 50px;
    margin-top: 40px;
}

.encabezado p {
    font-family: 'Dancing Script', cursive;
    font-size: 36px;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    flex: 1;
}

.nombre-izq { text-align: right; }
.nombre-der { text-align: left; }

.foto-perfil-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 4px solid #9309f6;
    box-shadow: 0 0 30px rgba(147, 9, 246, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floating 4s ease-in-out infinite;
    z-index: 5;
}

.foto-perfil-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.foto-perfil-wrapper img.visible {
    opacity: 1;
}

.foto-perfil-wrapper::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    border: 2px dashed #9309f6;
    animation: rotate 15s linear infinite;
    z-index: -1;
    pointer-events: none;
}

.contador-tiempo {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.tiempo-unidad {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 10px;
    background: rgba(147, 9, 246, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(147, 9, 246, 0.3);
    backdrop-filter: blur(5px);
}

.tiempo-unidad span {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(147, 9, 246, 0.5);
    line-height: 1;
}

.tiempo-unidad p {
    font-family: 'Dancing Script', cursive;
    font-size: 1.2rem;
    color: #fff;
    margin: 5px 0 0 0;
    opacity: 0.8;
}

.foto-perfil-wrapper::after {
    display: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 25px rgba(147, 9, 246, 0.6); }
    50% { box-shadow: 0 0 40px rgba(147, 9, 246, 0.9); }
    100% { box-shadow: 0 0 25px rgba(147, 9, 246, 0.6); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 30px;
}

.nombre-izq { text-align: right; padding-right: 20px; }
.nombre-der { text-align: left; padding-left: 20px; }

.album-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 10px auto 0 auto;
    gap: 30px;
}

.album-columna {
    flex: 0 1 30%;
    background: transparent;
    border: none;
    padding: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.texto-historia {
    flex: 0 1 35%;
}

.fotos-wrapper {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid #9309f6;
    box-shadow: 0 0 20px rgba(147, 9, 246, 0.6);
    animation: floating 4s ease-in-out infinite;
}

.fotos-wrapper::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 1px dashed rgba(147, 9, 246, 0.5);
    animation: rotate 10s linear infinite reverse;
    z-index: -1;
}

.lista-amor {
    margin-top: 20px;
    text-align: left;
    padding: 10px;
}

.lista-amor h4 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: #9309f6;
    margin-bottom: 10px;
    text-align: center;
}

.lista-amor ul {
    list-style: none;
    padding: 0;
    font-size: 0.9rem;
}

.lista-amor li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.lista-amor li::before {
    content: '❤';
    position: absolute;
    left: 0;
    color: #9309f6;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    z-index: 2000;
    pointer-events: none;
}

.album-columna, .texto-historia {
    animation: slideUp 1s ease-out forwards;
}

.album-columna:nth-child(1) { animation-delay: 0.2s; }
.texto-historia { animation-delay: 0.4s; }
.album-columna:nth-child(3) { animation-delay: 0.6s; }

.album-columna h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.texto-historia {
    flex: 0 1 35%;
}

.foto-album {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.foto-album.visible {
    opacity: 1;
}

.carrusel-btn.prev {
    left: 10px;
}

.carrusel-btn.next {
    right: 10px;
}

.btn-sorpresa, .control-musica button {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(147, 9, 246, 0.7) !important;
    border: 2px solid #fff !important;
    color: white !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(147, 9, 246, 0.5);
    transition: all 0.3s ease;
}

.control-musica button {
    top: 15px;
    left: 15px;
}

.btn-sorpresa {
    top: 15px;
    right: 15px;
    animation: shake 5s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(147, 9, 246, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(147, 9, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(147, 9, 246, 0); }
}

@keyframes shake {
    0%, 90%, 100% { transform: rotate(0); }
    92% { transform: rotate(10deg); }
    94% { transform: rotate(-10deg); }
    96% { transform: rotate(10deg); }
    98% { transform: rotate(-10deg); }
}

.btn-sorpresa:hover {
    transform: scale(1.2);
    background-color: #9309f6;
}

.control-musica {
position : fixed ;
top : 15px ;
left : 15px ;
z-index : 1000 ;
}

@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.overlay-contenido {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    border: 1px solid rgba(147, 9, 246, 0.3);
    animation: fadeIn 1s ease-out;
}

.overlay h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    margin-bottom: 20px;
    color: #9309f6;
}

.btn-accion {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.2rem;
    background: #9309f6;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.btn-accion:hover {
    background: #b046ff;
    transform: scale(1.05);
}

.content-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.content-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVIDAD PARA MÓVILES --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }

    .overlay-contenido {
        padding: 20px;
        width: 85%;
        max-width: 320px;
    }

    .overlay h1 {
        font-size: 2.2rem;
    }

    .overlay-contenido img {
        width: 130px;
        height: 130px;
    }

    .arriba {
        padding: 0 10px;
        width: 100%;
    }

    .encabezado {
        flex-direction: column !important;
        gap: 15px;
        margin-top: 20px;
    }

    .nombre-izq, .nombre-der {
        text-align: center !important;
        padding: 0 !important;
        font-size: 28px !important;
        flex: none !important;
        width: 100% !important;
        white-space: normal !important;
    }

    .foto-perfil-wrapper {
        width: 220px !important;
        height: 220px !important;
        order: -1; /* Foto arriba de los nombres */
        flex-shrink: 0;
    }

    .contador-tiempo {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tiempo-unidad {
        min-width: 70px;
        padding: 8px;
        flex: 1 1 40%; 
        max-width: 100px;
    }

    .tiempo-unidad span {
        font-size: 1.6rem;
    }

    .album-container {
        flex-direction: column !important;
        gap: 20px;
        margin-top: 20px;
    }

    .album-columna, .texto-historia {
        flex: none !important;
        width: 100% !important;
        padding: 15px;
        box-sizing: border-box;
    }

    .fotos-wrapper {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .texto-historia {
        order: 2; /* Historia entre los dos álbumes */
    }

    .album-columna:nth-child(1) { order: 1; }
    .album-columna:nth-child(3) { order: 3; }

    .texto-historia h2 {
        font-size: 1.8rem;
    }

    .btn-sorpresa, .control-musica button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

