*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,body{
     width:100%;
    min-height:100vh;
    overflow-x:hidden;
    overflow-y:auto;
    font-family:'Poppins',sans-serif;
    background:radial-gradient(circle at top,#25164b,#080b1d 70%);
    color:#fff;
}

.hide{
    display:none;
}

section{
   width:100%;
    min-height:100vh;
    display:flex;
    justify-content:flex-start;
    align-items:center;
    flex-direction:column;
    padding:40px 15px;
}

#loading{
    flex-direction:column;
    animation:fadeOut 3s forwards;
}

#loading h1{
    font-family:"Great Vibes",cursive;
    font-size:70px;
    color:#ff7eb7;
    text-shadow:0 0 20px #ff7eb7;
}

#loading h2{
    font-weight:300;
}

#loading p{
    margin-top:20px;
    opacity:.7;
}

@keyframes fadeOut{
    0%{opacity:1;}
    80%{opacity:1;}
    100%{
        opacity:0;
        visibility:hidden;
    }
}

/* ===================== */
/* Gift */
/* ===================== */

.gift-container{
    text-align:center;
}

.tap{
    margin-top:35px;
    animation:blink 1.2s infinite;
}

@keyframes blink{
    50%{
        opacity:.3;
    }
}

#gift{
    width:180px;
    height:180px;
    margin:40px auto;
    position:relative;
    cursor:pointer;
    animation:giftFloat 2s ease-in-out infinite;
}

@keyframes giftFloat{
    50%{
        transform:translateY(-12px);
    }
}

.gift-box{
    position:absolute;
    bottom:0;
    width:180px;
    height:120px;
    background:#ff4d88;
    border-radius:10px;
    box-shadow:0 0 25px rgba(255,90,150,.5);
}

.gift-lid{
    position:absolute;
    width:190px;
    height:40px;
    left:-5px;
    top:25px;
    background:#ff73aa;
    border-radius:10px;
    transition:.8s;
}

.gift-ribbon-v{
    position:absolute;
    width:20px;
    height:180px;
    left:80px;
    background:#ffe36b;
}

.gift-ribbon-h{
    position:absolute;
    width:180px;
    height:20px;
    top:75px;
    background:#ffe36b;
}

.openGift .gift-lid{
    transform:rotate(-28deg) translateY(-80px);
}

/* ===================== */
/* Card */
/* ===================== */

.card{
    width:min(92vw,700px);
    background:rgba(255,255,255,.08);
    backdrop-filter:blur(14px);
    border-radius:25px;
    padding:30px;
    border:1px solid rgba(255,255,255,.15);
    text-align:center;
    box-shadow:0 0 40px rgba(255,120,180,.25);
    margin:40px auto;
}

.card h1{
    font-family:"Great Vibes",cursive;
    font-size:65px;
    color:#ff9bc8;
}

.card h2{
    margin-bottom:30px;
}

/* ===================== */
/* Envelope */
/* ===================== */

#envelope{
    width:220px;
    height:150px;
    margin:auto;
    position:relative;
    cursor:pointer;
}

.envelope-body{
    position:absolute;
    inset:0;
    background:#ffd5e5;
    border-radius:8px;
}

.envelope-top{
    position:absolute;
    width:100%;
    height:70px;
    background:#f6a9ca;
    clip-path:polygon(0 0,100% 0,50% 100%);
    transform-origin:top;
    transition:1s;
}

.letter{
     position:absolute;
    left:50%;
    bottom:10px;
    transform:translateX(-50%);
    width:200px;
    height:100px;
    background:#fff;
    color:#444;
    border-radius:12px;
    padding:18px;
    overflow:hidden;
    transition:all .8s ease;
    z-index:2;
}

.openEnvelope .envelope-top{
    transform:rotateX(180deg);
}

.openEnvelope::before{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    backdrop-filter:blur(5px);
    z-index:9998;
}    
.openEnvelope .letter{
    
     position: fixed;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: min(90vw, 420px);
    height: min(70vh, 500px);

    overflow-y: auto;
    z-index: 9999;
}
#letterText{

  width:100%;
    white-space:pre-line;
    line-height:2;
    font-size:17px;
    color:#444;
    text-align:justify;
    text-justify:inter-word;
}

/* ===================== */
/* Stars */
/* ===================== */

#stars,
#hearts,
#confetti{
    position:fixed;
    inset:0;
    pointer-events:none;
}

.star{
    width:2px;
    height:2px;
    background:white;
    position:absolute;
    border-radius:50%;
    animation:twinkle 2.5s infinite;
}

@keyframes twinkle{
    50%{
        opacity:.2;
        transform:scale(.5);
    }
}

/* ===================== */
/* Mobile */
/* ===================== */

@media(max-width:600px){

.card{
    padding:20px;
}

.card h1{
    font-size:48px;
}

.card h2{
    font-size:22px;
}

#loading h1{
    font-size:50px;
}

#gift{
    transform:scale(.85);
}

#envelope{
    transform:scale(.9);
}

#letterText{
    font-size:14px;
}

}