* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    color: rgb(119, 31, 200);
    font-family: "jetbrains mono", monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Fondo con partículas/corazones */
body::before {
    content: "💕";
    position: absolute;
    font-size: 20px;
    animation: flotar 15s infinite linear;
    opacity: 0.3;
}

.contenedor-principal {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    padding: 20px;
}

/* Tarjeta principal */
.tarjeta {
    background: linear-gradient(145deg, #fff5f5, #ffe4e8);
    max-width: 400px;
    width: 90%;
    border-radius: 20px;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 20px 60px rgba(255, 100, 130, 0.3),
        0 0 40px rgba(255, 150, 180, 0.2);
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulso-suave 4s ease-in-out infinite;
}

.tarjeta.expandida {
    transform: scale(1.02);
    box-shadow: 
        0 25px 80px rgba(255, 100, 130, 0.4),
        0 0 60px rgba(255, 150, 180, 0.3);
}

/* Título */
#titulo {
    color: #e91e63;
    font-size: clamp(1rem, 4vw, 1.4rem);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(233, 30, 99, 0.2);
    animation: brillo-texto 3s ease-in-out infinite;
}

/* Contenedor de imagen */
.imagen-contenedor {
    position: relative;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(45deg, #ff6b9d, #ff8fab, #ffb3c6, #ff6b9d);
    background-size: 400% 400%;
    animation: gradiente-borde 3s ease infinite;
    margin-bottom: 20px;
}

.imagen-principal {
    width: clamp(150px, 40vw, 220px);
    height: clamp(150px, 40vw, 220px);
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.imagen-principal:hover {
    transform: scale(1.05) rotate(2deg);
}

.imagen-principal.cambiando {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
}

/* Mensaje */
.mensaje {
    color: #5a2d3d;
    font-size: clamp(0.85rem, 3vw, 1rem);
    text-align: center;
    margin: 15px 0;
    line-height: 1.6;
    max-width: 100%;
    padding: 0 10px;
}

/* Botón */
#mi-boton {
    background: linear-gradient(45deg, #ff6b9d, #ff8fab);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 15px;
    font-family: inherit;
    font-size: clamp(0.9rem, 3vw, 1rem);
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
    position: relative;
    overflow: hidden;
}

#mi-boton::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

#mi-boton:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.5);
}

#mi-boton:hover::before {
    left: 100%;
}

#mi-boton:active {
    transform: translateY(0) scale(0.98);
}

/* Fotos flotantes */
.fotos-flotantes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.foto-flotante {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(50px, 12vw, 80px);
    height: clamp(50px, 12vw, 80px);
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.fotos-flotantes.visible .foto-flotante {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
    animation: flotar-suave 4s ease-in-out infinite;
    animation-delay: var(--delay);
}

.foto-flotante:hover {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.3) !important;
    z-index: 20;
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.6);
}

/* Animaciones */
@keyframes pulso-suave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes flotar-suave {
    0%, 100% { 
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1); 
    }
    50% { 
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) - 10px)) scale(1.05); 
    }
}

@keyframes gradiente-borde {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes brillo-texto {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; text-shadow: 0 0 20px rgba(233, 30, 99, 0.5); }
}

@keyframes flotar {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .tarjeta {
        padding: 25px 20px;
        max-width: 350px;
    }
    
    .foto-flotante {
        width: 50px;
        height: 50px;
    }
    
    .fotos-flotantes.visible .foto-flotante:nth-child(odd) {
        --x: calc(var(--x) * 0.6);
        --y: calc(var(--y) * 0.6);
    }
    
    .fotos-flotantes.visible .foto-flotante:nth-child(even) {
        --x: calc(var(--x) * 0.7);
        --y: calc(var(--y) * 0.7);
    }
}

@media (max-width: 480px) {
    .tarjeta {
        padding: 20px 15px;
        max-width: 300px;
    }
    
    .foto-flotante {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    #mi-boton {
        padding: 12px 25px;
    }
}

/* Selección de texto */
::selection {
    background: #ff4d6d;
    color: white;
}
