#finale-2d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    display: none;
    transition: background-color 8s ease;
    overflow: hidden;
}

#heart-photos-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.falling-photo {
    position: absolute;
    /* Fotos más pequeñas en móvil */
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    top: -200px;
    left: 50%;
    transform: scale(0.5);
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1.5s ease, top 1.5s cubic-bezier(0.2, 0.8, 0.2, 1), left 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.falling-photo.dropped {
    opacity: 1;
    transform: scale(1) rotate(var(--rot));
}

@keyframes floatSway {
    0%, 100% { transform: scale(1) rotate(var(--rot)) translate(0px, 0px); }
    33% { transform: scale(1) rotate(var(--rot)) translate(8px, -6px); }
    66% { transform: scale(1) rotate(var(--rot)) translate(-8px, 6px); }
}

.falling-photo.dropped.swaying {
    animation: floatSway 6s ease-in-out infinite;
}

#typewriter-container {
    position: absolute;
    /* Un poco más arriba para dejar espacio al botón abajo */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 78vw;
    max-width: 520px;
    height: auto;
    max-height: 55vh;
    overflow-y: hidden;
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30px, rgba(0,0,0,1) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30px, rgba(0,0,0,1) 100%);
    transition: mask-image 1.5s ease, -webkit-mask-image 1.5s ease;
}

#typewriter-container::-webkit-scrollbar {
    display: none;
}

.text-wrapper {
    display: inline-block;
    width: 100%;
}

#typewriter-text {
    font-family: 'Courier Prime', 'Courier New', monospace;
    /* Tamaño más pequeño + borde blanco para leer sobre imágenes */
    font-size: 16px;
    color: #1a1a1a;
    line-height: 1.65;
    margin: 0;
    white-space: pre-wrap;
    /* Borde blanco fino para que se lea sobre cualquier fondo */
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0    0   4px rgba(255,255,255,0.9);
}

#typewriter-cursor {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
    animation: blink 0.8s infinite;
    vertical-align: bottom;
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#one-more-thing-btn {
    position: absolute;
    /* Siempre pegado al fondo, nunca encima del texto */
    bottom: 28px;
    left: 50%;
    transform: translate(-50%, 20px);
    padding: 10px 22px;
    font-size: 1rem;
    font-family: 'Courier Prime', monospace;
    background-color: rgba(255,255,255,0.85);
    color: #333;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease, transform 1s ease, background-color 0.3s, color 0.3s;
    z-index: 1010;
    /* Evita que texto flotante quede encima */
    isolation: isolate;
    white-space: nowrap;
}
#one-more-thing-btn:hover {
    background-color: #333;
    color: white;
}
#one-more-thing-btn.visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* Clases para animación inversa */
.photos-reverse .falling-photo {
    top: -300px !important;
    opacity: 0 !important;
    transition: top 2s cubic-bezier(0.8, 0, 0.2, 1), opacity 1.5s ease 0.5s !important;
}

.text-fade-out {
    opacity: 0 !important;
    transition: opacity 2s ease !important;
}

#finale-2d-container.bg-black {
    background-color: black !important;
    transition: background-color 2s ease !important;
}
