@import url('https://fonts.googleapis.com/css2?family=Coiny&family=Titan+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nerko+One&family=Sriracha&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
:root{
    --color-pink: #feecea;
    --color-white: #fff;
    --color-black: #333;
    --color-text-pink: #FF7882;
    --color-heart: #FF7882;
    --color-bg-letter: #fff8e4;
    --color-border: #DACCBF;
    --passcode-bg: rgba(255, 255, 255, 0.88);
    --passcode-border: rgba(255, 255, 255, 0.94);
    --passcode-key: rgba(255, 255, 255, 0.78);
    --passcode-key-hover: rgba(255, 255, 255, 0.98);
    --passcode-shadow: 0 40px 90px rgba(118, 70, 145, 0.16);
    --passcode-text: #4f2e67;
    --passcode-muted: #8e7295;
}
html{
    height: 100%;
}
body {
    position: relative;
    font-size: 16px;
    margin: 0;
    padding: 0;
    height: 100%;
    background-image:linear-gradient(var(--color-pink), var(--color-pink));
}
#passcodeLock {
    position: fixed;
    inset: 0;
    z-index: 999;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #fff5f9 0%, #f9e8f6 50%, #f5d9f0 100%);
    overflow: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#passcodeLock.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, #fff0f5 0%, #ffe6ec 50%, #ffd5e6 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-card {
    width: min(100%, 420px);
    padding: 2rem 2.2rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 30px 80px rgba(175, 25, 90, 0.12);
    backdrop-filter: blur(16px);
    text-align: center;
}

.welcome-card h1 {
    margin-bottom: 0.75rem;
    font-size: 2rem;
    color: #8f2b5d;
    font-family: 'Dancing Script', 'Georgia', serif;
}

.welcome-card p {
    margin-bottom: 1.6rem;
    color: #6b3f61;
    line-height: 1.7;
    font-size: 1rem;
}

.welcome-btn {
    width: 100%;
    max-width: 320px;
    min-height: 56px;
    border: none;
    border-radius: 999px;
    padding: 0 1.2rem;
    background: linear-gradient(135deg, #f779a1, #ffb6d7);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(255, 102, 159, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(255, 102, 159, 0.32);
}

.welcome-btn:active {
    transform: translateY(0) scale(0.98);
}

.passcode-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.passcode-card {
    width: min(100%, 480px);
    padding: 2.4rem 2.6rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.passcode-badge {
    display: block;
    letter-spacing: 0.18em;
    font-size: 0.85rem;
    color: #e89cb8;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.passcode-title {
    margin: 0 0 0.6rem;
    font-size: 1.75rem;
    color: #2d1b47;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: 'Dancing Script', 'Georgia', serif;
}

.passcode-subtitle {
    margin: 0 0 1.6rem;
    color: #5d4a6d;
    line-height: 1.6;
    font-size: 0.95rem;
}

.passcode-input-track {
    margin: 0 auto 1.8rem;
    padding: 0.95rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.passcode-display {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.passcode-display.invalid {
    animation: passcode-shake 0.35s cubic-bezier(0.36, 0, 0.66, -0.56);
}

@keyframes passcode-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.passcode-segment {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 auto;
    border-radius: 999px;
    background: rgba(232, 156, 184, 0.2);
    border: 1px solid rgba(232, 156, 184, 0.3);
    display: grid;
    place-items: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.passcode-segment.filled {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ffc9e3);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 16px rgba(232, 156, 184, 0.4), inset 0 1px 4px rgba(255, 255, 255, 0.6);
    transform: scale(1.15);
}

.passcode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-bottom: 0.6rem;
}

.pin-button {
    min-height: 60px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 240, 248, 0.25));
    backdrop-filter: blur(8px);
    color: #2d1b47;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.pin-button:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 240, 248, 0.4));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.pin-button:active {
    transform: translateY(-1px) scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pin-button:focus-visible {
    outline: 2px solid #e89cb8;
    outline-offset: 2px;
}

.pin-button.secondary {
    color: #5d4a6d;
    font-size: 1.2rem;
}

.pin-button.submit-btn {
    grid-column: 3 / 4;
    background: linear-gradient(135deg, #e89cb8, #d97fa8);
    color: #fff;
    font-size: 1.4rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-button.submit-btn:hover {
    background: linear-gradient(135deg, #f0b5cc, #e08fb8);
    box-shadow: 0 12px 35px rgba(232, 156, 184, 0.3);
}

.pin-button.submit-btn:active {
    transform: translateY(-1px) scale(0.96);
}

.passcode-hint {
    margin: 0;
    color: #5d4a6d;
    font-size: 0.9rem;
    font-style: italic;
}

@media (max-width: 540px) {
    .passcode-card {
        width: min(100%, 360px);
        padding: 1.8rem 1.6rem;
    }
    .passcode-title {
        font-size: 1.5rem;
    }
    .passcode-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.4rem;
    }
    .pin-button {
        min-height: 54px;
        font-size: 1.2rem;
    }
    .passcode-grid {
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    #wrapper {
        overflow-x: hidden;
        background-size: 64px 64px;
    }
    .flag__birthday {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        transform: translateY(-20px);
    }
    .flag__birthday .flag__left,
    .flag__birthday .flag__right {
        max-width: 45vw;
        transform: none;
    }
    .content {
        flex-direction: column;
        align-items: center;
        gap: 1.6rem;
        padding-top: 1.8rem;
    }
    .content .left,
    .content .right {
        width: 100%;
        max-width: 100%;
    }
    .title {
        font-size: 2.2rem;
        padding: 0 1rem;
    }
    .title .happy,
    .title .birthday {
        font-size: clamp(2.2rem, 8vw, 3rem);
    }
    .title .hat {
        right: 12px;
        top: -140px;
    }
    .date__of__birth {
        transform: translateY(-70px);
    }
    #btn__letter {
        width: min(100%, 320px);
        padding: 14px 22px;
        font-size: 1rem;
    }
    .boxMail {
        padding: 0.9rem;
    }
    .boxMail .boxMail-container {
        max-width: 92vw;
        width: min(92vw, 520px);
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 1rem;
    }
    .boxMail.envelope-opened .boxMail-container {
        transform: translate(-50%, -45%) scale(0.95);
    }
    .envelope-wrapper {
        grid-template-columns: 1fr;
        max-width: 90vw;
        padding: 0.8rem;
    }
    .envelope-wrapper.opened {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .envelope-wrapper.opened .envelope-container {
        transform: translate(0, 0) scale(0.96);
    }
    .envelope-svg {
        width: min(72vw, 280px);
    }
    .gift-letter-section {
        max-width: 90vw;
        max-height: 55vh;
        transform: translateY(24px) scale(0.98);
        overflow: auto;
        padding-bottom: 0.5rem;
    }
    .gift-letter-section.visible {
        transform: translateY(0) scale(1);
    }
    .gift-letter-section.visible .letter-card {
        min-height: auto;
    }
    .letter-card {
        padding: 1.5rem;
    }
    .letter-header {
        flex-direction: column;
        gap: 1rem;
        padding-right: 0;
    }
}

#wrapper{
    display: none;
    position: relative;
    background-color: transparent;
    background-image: linear-gradient(0deg, transparent 24%, rgba(255, 255, 255, 1) 25%, rgba(255, 255, 255, 1) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, 1) 75%, rgba(255, 255, 255, 1) 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, rgba(255, 255, 255, 1) 25%, rgba(255, 255, 255,1) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, 1) 75%, rgba(255, 255, 255, 1) 76%, transparent 77%, transparent);
    height:100%;
    background-size:80px 80px;
    overflow: hidden;
    z-index: 1;
}
.flag__birthday{
    display: flex;
    justify-content: space-between;
    transform: translateY(-200px);
    animation: translateYFlag 1.5s 2s forwards;
}
@keyframes translateYFlag{
    to{
        transform: translateY(-10px);
    }
}
.flag__birthday .flag__left{
    transform: rotate(-10deg) translate(-20px,30px);
}
.flag__birthday .flag__right{
    transform: rotate(10deg) translate(20px,30px) scaleX(-1);
}
.content{
    width: 100%;
    position: relative;
    display: flex;
    padding-top: 3rem;
}
.content .left, .content .right{
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.content .left{
    width: 40%;
}
.content .right{
    width: 60%;
}
.left .btn{
    transform: scale(0);
    animation: scaleCricle 2s 16s forwards ease-in-out;
}
#btn__letter{
    position: relative;
    margin-top: 30px;
    background-color: var(--color-text-pink);
    outline: none;
    padding: 5px 15px;
    font-size: 1rem;
    border-radius: 50px;
    border: 3px solid var(--color-black);
    font-family: "Sriracha", cursive;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transform: scale(1);
    transition: all .5s ease-in-out;
}
#btn__letter:active{
    transform: scale(0.7);
}
#btn__letter i{
    margin-left: 5px;
}
#btn__letter:hover{
    border-color: var(--color-heart);
    background-color: var(--color-heart);
    color: #fff;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

#btn__letter:hover i{
    animation: rotateHeart 1s infinite linear;
}
@keyframes rotateHeart{
    0%,50%, 100%{
        transform: rotate(0deg);
    }
    25%{
        transform: rotate(12deg);
    }
    75%{
        transform: rotate(-12deg);
    }
}
.title{
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    font-family: "Titan One", sans-serif;
    font-size: 3rem;
    flex-direction: column;
    perspective: 1000px;
}
.title .happy, .title .birthday{
    position: relative;
    text-shadow: 4px 4px var(--color-black), 
                -4px 4px var(--color-black), 
                4px -4px var(--color-black), 
                -4px -4px var(--color-black), 
                4px 8px 0 var(--color-black);
    font-weight: bold;
    display: flex;
    justify-content: center;
}
.title .happy{
    color: var(--color-white);
}
.title .happy span, .title .birthday span{
    transform: translateY(50px);
    opacity: 0;
    visibility: hidden;
    animation: txtTranslateY .5s var(--t) forwards;
}
@keyframes txtTranslateY{
    100%{
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}
.title .birthday{
    color: var(--color-text-pink);
}

.title .hat{
    display: none;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    right: 45px;
    top: -350px;
    transform: rotate(-40deg);
    z-index: -1;
    pointer-events: none;
    animation: topHat 4s 7s forwards ease;
}
#main-content.unlocked .title .hat,
#wrapper.unlocked .title .hat,
body.unlocked .title .hat {
    display: block;
    visibility: visible;
    opacity: 1;
}
@keyframes topHat{
    20%, 30%{
        top: -30px;
        transform-origin: left;
        transform: rotate(-40deg);
    }
    35%, 100%{
        top: -30px;
        transform: rotate(0deg);
    }
}
.date__of__birth, .name{
    display: flex;
    justify-content:space-around;
    align-items: center;
    background-color: var(--color-text-pink);
    border-radius: 50px;
    margin-top: 20px;
    font-family: "Sriracha", cursive;
    
}
.date__of__birth{
    border: 3px solid var(--color-black);
    position: relative;
    transform: translateY(-100px);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    width: 0px;
    animation: dateOfBirth 5s 9s forwards;
}
@keyframes dateOfBirth{
    20%,40%{
        width: 0px;
        height: 0;
        transform: translateY(0px);
        opacity: 1;
        visibility: visible;
    }
    45%{
        transform: translateY(0px);
        opacity: 1;
        visibility: visible;
        width: 300px;
        height: 0px;
    }
    50%,100%{
        transform: translateY(0px);
        opacity: 1;
        visibility: visible;
        width: 300px;
        height: 50px;
    }
}
.name{
    position: absolute;
    padding: 0px 20px;
    bottom: -20px;
    border: 3px solid var(--color-black);
    font-family: 'Dancing Script', cursive;
}
.date__of__birth span, .name span{
    font-weight: bold;
    margin: 0px 40px;
}
.date__of__birth span{
    font-size: 1.2rem;
}
.name span{
    font-size: 1.7rem;
}
.right .box__account{
    position: relative;
    transform: translateY(700px);
    animation: topBoxImage 8s 7s forwards ease-in;
}
@keyframes topBoxImage{
    to{
        transform: translateY(0);
    }
}
.content .right .image{
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    border: 6px solid var(--color-black);
}
.content .right .image img{
    width: 100%;
    object-fit: cover;

}
.cricle{
    position: absolute;
    top: 20px;
    right: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    animation: scaleCricle 3s 15s forwards ease-in-out;
}
@keyframes scaleCricle {
    0%{
        transform: scale(0);
    }
    10%{
        transform: scale(1.3);
    }
    20%{
        transform: scale(0.7);
    }
    30%,100%{
        transform: scale(1);
    }

}
.text__cricle{
    width: 100px;
    height: 100px;
    background-color: var(--color-text-pink);
    border-radius: 50%;
    border: 5px solid var(--color-black);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: rotateCricle 5s linear infinite;
}
@keyframes rotateCricle{
    to{
        transform: rotate(360deg);
    }
}
.text__cricle span{
    top: 0%;
    left: 50%;
    position: absolute;
    color: var(--color-black);
    transform: rotate(calc(var(--i) * 24deg));
    transform-origin: 0 45px;
    font-family: "Sriracha", cursive;
    text-transform: uppercase;
    font-size: 0.7rem;
}
.fa-heart{
    color: var(--color-heart);
    filter: drop-shadow(0 0 3px var(--color-heart));
    animation: scaleHeart 1s infinite linear;
}
.cricle .fa-heart{
    position: absolute;
    transform: scale(0.85);
}
@keyframes scaleHeart{
    50%{
        transform: scale(1.2);
    }
}
.right .balloon_one{
    position: absolute;
    top: -70px;
    left: -70px;
    animation: balloon1 2s infinite linear;
}
@keyframes balloon1{
    0%, 50%,100%{
        transform-origin: bottom right;
        transform: rotate(0deg);
    }
    25%{
        transform-origin: bottom right;
        transform: rotate(3deg);
    }
    75%{
        transform-origin: bottom right;
        transform: rotate(-3deg);
    }
}
.right .balloon_two{
    position: absolute;
    top: 170px;
    right: -65px;
    z-index: -1;
    transform: rotate(10deg);
    animation: balloon2 2s infinite linear;
}
@keyframes balloon2 {
    0%,50%,100%{
        transform-origin: bottom left;
        transform: rotate(10deg);
    }
    25%{
        transform-origin: bottom left;
        transform: rotate(7deg);
    }
    75%{
        transform-origin: bottom left;
        transform: rotate(13deg);
    }
}

.decorate_star{
    position: absolute;
    transform: scale(0);
    background-color: var(--color-black);
    clip-path: polygon(0 50%, 35% 35%, 50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%);
    animation: scaleCricle 3s var(--t) forwards, 
            scaleStar 2s 16s infinite ease-in-out;
}
.decorate_star.star1{
    width: 20px;
    height: 20px;
    top: 75px;
    left: 300px;
}
.decorate_star.star2{
    width: 15px;
    height: 20px;
    top: 35px;
    right: 360px;
}
.decorate_star.star3{
    width: 14px;
    height: 14px;
    top: 290px;
    left: 630px;
}
.decorate_star.star4{
    width: 18px;
    height: 18px;
    bottom: 60px;
    left: 35px;
}
.decorate_star.star5{
    width: 16px;
    height: 18px;
    bottom: 140px;
    left: 500px;
}
@keyframes scaleStar {
    25%{
        transform: scale(0.8);
    }
    50%{
        transform: scale(1.1);
    }
}
.decorate_bottom{
    position: absolute;
    right: 0;
    bottom: -10px;
}
.decorate_flower--one{
    position: absolute;
    top: 250px;
    left: 50px;
    transform: scale(0);
    animation: scaleCricle 3s var(--t) forwards ease-in-out;
}
.decorate_flower--two{
    position: absolute;
    top: 225px;
    left: 540px;
    transform: scale(0);
    animation: scaleCricle 3s var(--t) forwards ease-in-out;
}
.decorate_flower--three{
    position: absolute;
    top: 150px;
    right: 235px;
    transform: scale(0);
    animation: scaleCricle 3s var(--t) forwards ease-in-out;
}
.smiley__icon{
    position: absolute;
    bottom: 180px;
    left: 600px;
    transform: scale(0);
    animation: scaleCricle 3s 15s forwards ease-in-out;
}


.box__letter{
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,.5);
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
}
.box__letter .letter__border{
    position: absolute;
    width: 55vw;
    height: 450px;
    background-color: var(--color-white);
    border-radius: 27px;
    padding: 17px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    display: none;
}
.letter__border .close{
    position: absolute;
    right: -10px;
    top: -10px;
    width: 30px;
    height: 30px;
    background-color: var(--color-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
    cursor: pointer;
}
.letter__border .letter{
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-letter);
    border-radius: 10px;
    padding-top: 15px;
}
.letter__border .letter .title__letter{
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-weight: bold;
    font-size: 2.4rem;
}
.title__letter .fa-solid{
    margin-left: 5px;
    font-size: 1.3rem;
}
.letter__border .letter .content__letter{
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    padding-top: 1.5rem;
    padding-bottom: 70px;
}
.letter__border .letter .content__letter .left{
    position: relative;
    width: 50%;
    height: 100%;
    padding: 1.7rem;
    border-right: 3px solid var(--color-border);
}
.content__letter .left #heart__letter{
    opacity: 0;
    width: 100%;
}
#heart__letter.animationOp{
    animation: opacityHeart 1s 1s forwards;
}
@keyframes opacityHeart{
    to{
        opacity: 1;
    }
}
.content__letter .left .heart{
    position: absolute;
    opacity: 0;
}
.content__letter .left .heart.animation{
    animation: scaleHeartLetter 1s var(--t) infinite ease-in-out;
}
@keyframes scaleHeartLetter{
    0%{
        opacity: 1;
        transform: scale(0);
    }
    10%{
        opacity: 1;
        transform: scale(1.3);
    }
    20%{
        opacity: 1;
        transform: scale(0.7);
    }
    30%,100%{
        opacity: 1;
        transform: scale(1);
    }
    
}
.content__letter .left .heart_1{
    top: 90px;
    left: 30px;
}
.content__letter .left .heart_2{
    top: 20px;
    right: 70px;
}
.content__letter .left .heart_3{
    bottom: 50px;
    left: 145px;
}
.content__letter .left .heart_4{
    top: 140px;
    right: 35px;
}
.content__letter .right{
    position: relative;
    width: 50%;
}
.content__letter .right .love__img{
    opacity: 0;
    position: absolute;
    right: 20px;
    top: -100px;
}
.love__img.animationOp{
    animation: opacityHeart 1s 1s forwards;
}
.content__letter .right .text__letter{
    margin-top: 60px;
    padding: 20px 15px 10px 15px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
}
.content__letter .right #mewmew{
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0;
}
#mewmew.animationOp{
    animation: opacityHeart 1s 1s forwards;
}


#copy {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
}

#copy a {
    text-decoration: none;
    color: #191919d7;
}

#copy p {
    color: #4275ff;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
}



@media screen and (max-width: 658px)   {

    .flag__birthday .flag__left {
        transform: rotate(-10deg) translate(-119px,3px);
    }

    .flag__birthday .flag__right {
        transform: rotate(10deg) translate(-106px,39px) scaleX(-1);
    }

    .content {
        width: 100%;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 25px;
        align-items: center;
        padding-top: 2rem;
    }

    .title {
        position: relative;
        width: 100%;
        display: flex;
        justify-content: center;
        font-family: "Titan One", sans-serif;
        font-size: 1.5rem;
        letter-spacing: 8px;
        flex-direction: column;
        perspective: 1000px;
    }

    #btn__letter {
        position: relative;
        margin-top: 17px;
        width: 209px;
        background-color: var(--color-text-pink);
        outline: none;
        padding: 6px 4px;
        font-size: 1rem;
        border-radius: 50px;
        border: 3px solid var(--color-black);
        font-family: "Sriracha", cursive;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 2;
        /* transform: scale(1); */
        transition: all .5s ease-in-out;
    }

    .cricle {
        position: absolute;
        top: 10px;
        right: -54px;
        display: flex;
        justify-content: center;
        align-items: center;
        transform: scale(0);
        animation: scaleCricle 3s 15s forwards ease-in-out;
    }

    .title .hat {
        position: absolute;
        right: -98px;
        top: -51px !important;
        transform: rotate(-40deg);
        z-index: -1;
        animation: topHat 4s 7s forwards ease;
    }

    .box__letter .letter__border {
        position: absolute;
        width: 90vw;
        height: 315px;
        background-color: var(--color-white);
        border-radius: 27px;
        padding: 17px;
        box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        display: none;
    }

    .letter__border .letter {
        width: 100%;
        height: 100%;
        background-color: var(--color-bg-letter);
        border-radius: 10px;
        padding-top: 15px;
    }

    .letter__border .letter .title__letter {
        text-align: center;
        font-family: 'Dancing Script', cursive;
        font-weight: bold;
        font-size: 1.4rem;
    }

    .letter__border .letter .content__letter {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        padding-top: .7rem;
        padding-bottom: 70px;
    }

    .content__letter .right .text__letter {
        margin-top: -14px;
        padding: 20px 15px 10px 15px;
        font-family: 'Dancing Script', cursive;
        font-size: .8rem;
    }

    .content__letter .right .love__img {
        opacity: 0;
        position: absolute;
        right: 126px;
        top: 167px;
    }

    .love__img img {
 
            width: 84px;

    }

    .content .right .image {
        position: relative;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        overflow: hidden;
        display: flex;
        align-items: center;
        border: 6px solid var(--color-black);
    }

    .name {
        position: absolute;
        padding: 0px 3px;
        bottom: -6px;
        border: 3px solid var(--color-black);
    }

    .name span {
        font-size: 1rem;
    }

    .right .balloon_one {
        position: absolute;
        top: 10px;
        left: -77px;
        animation: balloon1 2s infinite linear;
    }

    .right .balloon_one img{
        width: 76px !important;
    }


}







.boxMail{
    position: fixed;
    background: rgb(0, 0, 0, 0.8);
    width: 100%;
    height: 100%;
    opacity: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.3);
    visibility: hidden;
    transition: all 0.5s;
    z-index: 100000000;
}
.boxMail.active{
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}
.boxMail .boxMail-container{
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: min(1080px, 90vw);
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.95);
    -webkit-perspective: 2000px;
    perspective: 2000px;
    transition: all 0.5s;
    overflow: hidden;
}
.boxMail .boxMail-container:hover{
    transform: translate(-50%, -50%) rotate(-5deg) scale(0.95);
    filter: drop-shadow(0 0 10px #FF7882);
}
.boxMail .boxMail-container:hover .card1{
    transform: translate(-187px, -250px) rotateY(-140deg);
}
.boxMail .boxMail-container{
    position: absolute;
    /* nudge the modal slightly down to prevent top clipping on small viewports */
    top: calc(50% + 5vh);
    left: 50%;
    width: 90%;
    max-width: min(1080px, 90vw);
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.95);
    -webkit-perspective: 2000px;
    perspective: 2000px;
    /* transition ONLY transform so movement is smooth and predictable */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: visible;
}

.boxMail .boxMail-container .card1{
    position: relative;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transform-origin: left;
    transition: all 1s ease-in-out;
}
.boxMail .boxMail-container:hover{
    transform: translate(-50%, -50%) rotate(-3deg) scale(0.96);
    filter: drop-shadow(0 0 10px #FF7882);
}
.boxMail .boxMail-container:hover .card1{
    transform: translate(-187px, -250px) rotateY(-140deg);
}

/* When the modal gets the envelope-opened state, slide the whole container left smoothly */
.boxMail.envelope-opened .boxMail-container{
    /* soften the left shift so the modal doesn't move off-screen */
    transform: translate(-60%, -50%) scale(0.95);
}
.boxMail .boxMail-container .card1 .userImg{
    position: relative;
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    cursor: pointer;
    margin-bottom: 20px;
}
.boxMail .boxMail-container .card1 .userImg img{
    position: absolute;
    object-fit: cover;
    width: calc(100%);
    height: calc(100%);
}
.boxMail .boxMail-container .card1 h3{
    font-family: 'Dancing Script', cursive;
    font-size: 40px;
    text-transform: uppercase;
    width: 80%;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 5px;
    transform: rotate(-5deg);
    text-shadow: 0 0 5px white,
                0 0 10px white;
}
.boxMail .boxMail-container .card2{
    position: relative;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, #e0e0e0, #ffffff 30%);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transform-origin: left;
    transition: all 1s;
}
.boxMail .boxMail-container .card2 .card2-content {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #FF7882;
    transition: all 1s;
    overflow: hidden;
    font-family: "Inter", serif;
    color: #fff;
}
.boxMail .boxMail-container:hover .card2-content{
    transform: translate(20px, 20px);
    box-shadow: -1px -1px 5px rgb(0, 0, 0, 0.4);
}
.boxMail .boxMail-container .card2 h3{
    font-family: 'Dancing Script', cursive;
    padding: 20px 0px 10px 60px;
    opacity: 0;
    visibility: hidden;
    font-size: 25px;
    text-shadow: 0 0 8px #FF7882;
}
.boxMail .boxMail-container .card2:hover h3{
    animation: texth3 3s forwards;
    animation-delay: 2s;
    transition: 1s;
}
@keyframes texth3{
    0%{
        opacity: 1;
        visibility: visible;
        padding: 20px 0px 10px 60px;
    }
    100%{
        opacity: 1;
        visibility: visible;
        padding: 20px 0px 10px 152px; 
    }
}
.boxMail .boxMail-container .card2 h2{
    font-family: 'Dancing Script', cursive;
    padding: 0px 20px;
    text-indent: 20px;
    font-size: 22px;
    opacity: 0;
}
.boxMail .boxMail-container .card2:hover h2{
    animation: texth2 2s forwards;
    animation-delay: 4s;
    transition: 1s;
}
@keyframes texth2{
    0%{
        opacity: 0;
    }
    100%{
        opacity: 1;
    }
}
.boxMail .boxMail-container .card2 .card2-content .imageCute2{
    position: absolute;
    top: 5px;
    left: 20px;
    opacity: 0;
    transition: 1s;
}
.boxMail .boxMail-container .card2 .card2-content:hover .imageCute2{
    animation: cute3 1s linear infinite,
                cute4 3s 2s forwards;
    animation-delay: 2s;
    transition: 1s;
}
@keyframes cute3{
    0%{
        opacity: 1;
        transform: rotate(0deg);
    }
    25%{
        opacity: 1;
        transform: rotate(5deg);
    }
    50%{
        opacity: 1;
        transform: rotate(0deg);
    }
    75%{
        opacity: 1;
        transform: rotate(-5deg);
    }
    100%{
        opacity: 1;
        transform: rotate(0deg);
    }
}
@keyframes cute4{
    0%{
        left: 20px;
    }
    100%{
        left: 100px;
    }
}
.boxMail .boxMail-container .card2 .card2-content .imageCute2 img{
    width: 40px;
}
.boxMail .fa-xmark{
    position: fixed;
    top: 0;
    right: 0;
    font-size: 30px;
    padding: 10px 25px;
    cursor: pointer;
    color: white;
    z-index: 10000000000000000;
}

.envelope-wrapper {
    position: relative;
    width: 100%;
    max-width: min(980px, 90vw);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
    justify-items: center;
    align-items: center;
    padding: 1rem;
    transition: grid-template-columns 0.8s cubic-bezier(0.25, 1, 0.5, 1), max-width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: visible;
}

.envelope-wrapper.opened {
    grid-template-columns: minmax(240px, 360px) minmax(320px, 1fr);
    gap: 1.2rem;
    justify-items: stretch;
    align-items: center;
}

.envelope-container {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
    perspective: 600px;
    animation: envelopeEmerge 1.4s cubic-bezier(.22,.61,.36,1) 1.8s both, envelopeFloat 3s ease-in-out 3.4s infinite;
    /* single transform transition to keep movement smooth */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
    justify-self: center;
}

.envelope-container:hover {
    filter: drop-shadow(0 0 12px rgba(212,160,42,.3));
}

.envelope-container:focus-visible {
    outline: 2px solid rgba(255, 244, 204, .9);
    outline-offset: 4px;
    border-radius: 16px;
}

.envelope-wrapper.opened .envelope-container {
    /* safer horizontal translation so the envelope remains visible */
    transform: translate(-15%, -50%) scale(0.92);
}

.envelope-svg {
    position: relative;
    width: min(65vw, 320px);
    max-width: 100%;
}

.envelope-artwork {
    width: 100%;
    display: block;
    border-radius: 26px;
}

.envelope-seal-group {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.envelope-seal {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: radial-gradient(circle, #fbc5d9 0%, #d86a9b 100%);
    box-shadow: 0 12px 24px rgba(212, 160, 42, .28);
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
}

.envelope-container.open .envelope-seal {
    animation: sealFade .3s ease forwards;
}

.envelope-container.open::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(240,208,96,.2) 0%, transparent 60%);
    animation: openBurst .8s ease-out forwards;
    pointer-events: none;
}

.gift-letter-section {
    width: 100%;
    max-width: min(520px, 90vw);
    opacity: 0;
    transform: translateX(80px) scale(0.94);
    /* single transform transition for smoother concurrent movement */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease, visibility 0.6s ease;
    visibility: hidden;
    justify-self: center;
    align-self: center;
    max-height: 82vh;
    overflow: auto;
}

.gift-letter-section.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    visibility: visible;
}

@media (max-width: 768px) {
    .envelope-wrapper {
        grid-template-columns: 1fr;
        max-width: 90vw;
        padding: 1rem 0.75rem;
    }
    .envelope-wrapper.opened {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .envelope-wrapper.opened .envelope-container {
        transform: translate(0, 0) scale(0.96);
    }
    .boxMail.envelope-opened .boxMail-container {
        transform: translate(-50%, -45%) scale(0.95);
    }
    .gift-letter-section {
        max-width: 85vw;
        max-height: 45vh;
        transform: translateY(24px) scale(0.98);
        overflow: auto;
    }
    .gift-letter-section.visible {
        transform: translateY(0) scale(1);
    }
    .gift-letter-section.visible .letter-card {
        min-height: auto;
    }
    .envelope-container {
        margin: 0 auto;
    }
}

.section-title-inline {
    font-family: "Source Serif 4", serif;
    font-size: 1.35rem;
    font-weight: 300;
    font-style: italic;
    color: #885062;
    text-align: center;
    margin-bottom: 1.25rem;
}

.letter-card {
    position: relative;
    background: linear-gradient(180deg, #fff8ec 0%, #fff3d9 45%, #fffcf7 100%);
    border-radius: 30px;
    padding: 2rem;
    box-shadow: 0 26px 90px rgba(154, 80, 108, 0.12);
    border: 1px solid rgba(255,255,255,.85);
}

.letter-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.letter-addressing {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.letter-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #ac6b72;
    margin: 0;
}

.letter-name {
    margin: 0;
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #8e3f5c;
}

.letter-stamps {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.letter-stamp {
    width: 58px;
    aspect-ratio: 0.8;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

.letter-content {
    display: grid;
    gap: 1.25rem;
}

.title__letter {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: #8c3b5f;
    margin: 0;
    min-height: 3rem;
}

.text__letter {
    margin: 0;
    color: #5c3a49;
    line-height: 1.8;
    white-space: pre-wrap;
    min-height: 10rem;
}

.letter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffb3c2 0%, #ff6a94 100%);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 16px 28px rgba(255, 86, 147, .18);
}

.love__img {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    overflow: hidden;
    background: #fff0f5;
    box-shadow: 0 16px 34px rgba(0,0,0,.08);
}

.love__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#heart__letter.animationOp,
.love__img.animationOp,
#mewmew.animationOp {
    transform: scale(1.05);
}

@keyframes envelopeEmerge {
    0%{opacity:0;transform:translateY(0) scaleX(.3) scaleY(.1)}
    8%{opacity:1;transform:translateY(0) scaleX(.5) scaleY(.2)}
    40%{opacity:1;transform:translateY(min(18vw,75px)) scaleX(.85) scaleY(.8)}
    to{opacity:1;transform:translateY(min(34vw,140px)) scaleX(1) scaleY(1)}
}

@keyframes envelopeFloat {
    0%,to{transform:translateY(min(34vw,140px)) rotate(0)}
    50%{transform:translateY(calc(min(34vw,140px) - 4px)) rotate(.5deg)}
}

@keyframes sealPulse {
    0%,to{transform:scale(1)}
    50%{transform:scale(1.06)}
}

@keyframes flapFade {
    0%{opacity:1}
    to{opacity:0}
}

@keyframes sealFade {
    to{opacity:0;transform:scale(.7)}
}

@keyframes openBurst {
    0%{opacity:1;transform:translate(-50%,-50%) scale(.3)}
    to{opacity:0;transform:translate(-50%,-50%) scale(1.5)}
}
