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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden; 
    overflow-y: auto;
    background-color: #00bcd4; 
}

/* CONTENEDOR PRINCIPAL */
.bg-cyan-solid {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ESTO FORZA EL CENTRADO DEL SOBRE Y EL TEXTO */
.container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    padding: 0 20px;
}

/* SOBRE (Tamaño de referencia) */
.envelope-wrapper {
    position: relative;
    width: 90vw;
    max-width: 500px;
    aspect-ratio: 500 / 350; 
    perspective: 1000px;
}

/* Si quieres que baje un poco al abrirse para compensar la carta que sube */
.envelope-wrapper.open {
    transform: translateY(60px);
}

.envelope-back {
    position: absolute;
    inset: 0;
    background-color: #fde047;
    border: 4px solid black;
    pointer-events: none;
}

/* CARTA */
.card {
    position: absolute;
    left: 5%;
    top: 35%;
    width: 90%;
    height: 90%;
    background-color: white;
    border: 4px solid black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: all 0.6s ease-in-out;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10%);
}

.card-text {
    font-family: 'Itim', cursive;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: bold;
    color: black;
}

/* BOTÓN DE REGALO */
.gift-button {
    background-color: #ef4444;
    color: white;
    border: 2px solid black;
    border-radius: 8px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: bold;
    animation: shake 6s infinite;
    z-index: 60;
    pointer-events: auto !important;
}

@keyframes shake {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(-5px) rotate(-5deg); }
    94% { transform: translateX(5px) rotate(5deg); }
    96% { transform: translateX(-5px) rotate(-5deg); }
    98% { transform: translateX(5px) rotate(5deg); }
}

/* SVGs */
.envelope-shapes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    transform-origin: top;
    transition: all 0.6s ease-in-out;
    z-index: 30;
}

.star-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
}

/* ESTADOS ABIERTO */
.envelope-wrapper.open .card {
    z-index: 100;
    transform: translateY(-90%);
    opacity: 1;
    pointer-events: auto;
}

.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 5;
}

/* PANTALLA DE VIDEOLLAMADA */
#video-call-overlay {
    position: fixed;
    inset: 0;
    background-color: #1a1a1a;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: sans-serif;
}

.hidden { display: none !important; }

.call-content { text-align: center; }
.avatar-pulse {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.call-icons { margin-top: 30px; font-size: 40px; display: flex; gap: 40px; justify-content: center; }

.instruction {
    color: #333;
    font-style: italic;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        gap: 20px;
    }

    .envelope-wrapper {
        width: 85vw;
        max-width: 400px;
    }

    .card {
        top: 16%;
        height: 54%;
        gap: 14px;
    }

    .gift-button {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .card-text {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .instruction {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        gap: 15px;
    }

    .envelope-wrapper {
        width: 90vw;
        max-width: 320px;
    }

    .card {
        top: 15%;
        height: 56%;
        gap: 12px;
        left: 3%;
        width: 94%;
    }

    .gift-button {
        padding: 9px 15px;
        font-size: 0.8rem;
        gap: 8px;
    }

    .gift-button svg {
        width: 18px;
        height: 18px;
    }

    .card-text {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
        line-height: 1.3;
    }

    .instruction {
        font-size: 14px;
    }

    .envelope-back {
        border: 3px solid black;
    }
}