@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Great+Vibes&family=Poppins:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    overflow: hidden;
    color: #fff;
    font-family: "Poppins", sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(196, 42, 96, .28), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(124, 27, 79, .35), transparent 35%),
        linear-gradient(135deg, #13070e, #2a0b1b, #12070f);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 35px 35px;
    opacity: .08;
    pointer-events: none;
}

.app {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    opacity: 0;
    visibility: hidden;
    transform: scale(.97);
    transition: opacity .7s ease, transform .7s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.intro-card,
.unlock-card,
.unlocked-content,
.memory-container,
.envelope-area,
.final-content {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.small-text {
    color: #f0a2bd;
    font-size: 10px;
    letter-spacing: 4px;
    margin-bottom: 14px;
}

.image-glow {
    width: 190px;
    height: 190px;
    margin: 0 auto 25px;
    padding: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4f88, #ffd2df);
    box-shadow: 0 0 50px rgba(255, 73, 134, .3);
    animation: pulseGlow 3s infinite;
}

.image-glow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

h1 {
    font-family: "Great Vibes", cursive;
    font-size: clamp(52px, 10vw, 82px);
    font-weight: 400;
    line-height: 1;
}

h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 34px;
    font-weight: 600;
}

.intro-message,
.unlock-description,
.unlocked-text,
.special-line {
    color: #d7b8c4;
    font-family: "Cormorant Garamond", serif;
    font-size: 22px;
    line-height: 1.5;
    margin-top: 16px;
}

.delay-text {
    color: #f3a4bf;
}

.romantic-btn {
    margin-top: 30px;
    padding: 14px 26px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 40px;
    background: linear-gradient(135deg, #d52d68, #8e1d47);
    color: white;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(213, 45, 104, .25);
    transition: .3s;
}

.romantic-btn:hover {
    transform: translateY(-3px) scale(1.03);
}

.lock-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 1s;
}

.lock-wrapper.wrong {
    animation: shake .5s;
}

.lock-wrapper.unlocked {
    transform: scale(1.35) rotate(12deg);
    filter: drop-shadow(0 0 40px rgba(255, 69, 123, .8));
}

.lock {
    position: relative;
    width: 120px;
    height: 105px;
}

.lock-top {
    position: absolute;
    width: 72px;
    height: 70px;
    border: 12px solid #e95788;
    border-bottom: 0;
    border-radius: 45px 45px 0 0;
    left: 24px;
    top: 0;
}

.lock-body {
    position: absolute;
    width: 120px;
    height: 90px;
    bottom: 0;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f05c8d, #9b234e);
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
    font-size: 42px;
}

.unlock-card input {
    width: 100%;
    margin-top: 25px;
    padding: 15px 20px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 30px;
    outline: none;
    text-align: center;
    color: white;
    background: rgba(255,255,255,.07);
    font-family: inherit;
}

.unlock-card input:focus {
    border-color: #f16f9d;
    box-shadow: 0 0 25px rgba(241,111,157,.15);
}

.error-message {
    min-height: 20px;
    color: #ff9cba;
    font-size: 11px;
    margin-top: 10px;
}

.big-heart,
.final-heart {
    font-size: 100px;
    animation: heartbeat 1.8s infinite;
}

.unlocked-content h1 {
    margin-top: 10px;
}

.special-line {
    color: #ff9dbc;
    font-size: 28px;
}

.memory-card {
    padding: 15px;
    border-radius: 25px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
}

.memory-image {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    height: 330px;
}

.memory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.08);
    transition: .5s;
}

.memory-image img.show {
    opacity: 1;
    transform: scale(1);
}

.memory-number {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 7px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,.35);
    font-size: 10px;
}

.memory-card p {
    min-height: 100px;
    padding: 22px 15px 10px;
    color: #e5c7d1;
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    line-height: 1.4;
    opacity: 0;
    transition: .5s;
}

.memory-card p.show {
    opacity: 1;
}

.memory-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
}

.circle-btn {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: white;
    background: rgba(255,255,255,.08);
    font-size: 20px;
    cursor: pointer;
}

#memoryCounter {
    color: #d9a4b8;
    font-size: 12px;
}

.envelope {
    width: min(330px, 90vw);
    height: 220px;
    margin: 30px auto;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
}

.envelope-back,
.envelope-front,
.envelope-flap {
    position: absolute;
    width: 100%;
    height: 100%;
}

.envelope-back {
    background: #a52a58;
    border-radius: 8px;
}

.envelope-front {
    background: linear-gradient(135deg, #d8497a, #8d1e46);
    clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
    border-radius: 8px;
    z-index: 4;
}

.envelope-flap {
    height: 55%;
    background: linear-gradient(135deg, #e65d8b, #9c234d);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top;
    transition: 1s;
    z-index: 5;
}

.letter-paper {
    position: absolute;
    width: 88%;
    height: 150px;
    left: 6%;
    top: 15px;
    padding: 20px;
    background: #fff7f8;
    color: #6d2540;
    z-index: 2;
    border-radius: 5px;
    transition: 1.2s;
    overflow: hidden;
}

.letter-paper p {
    font-family: "Cormorant Garamond", serif;
    font-size: 15px;
    line-height: 1.4;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .letter-paper {
    transform: translateY(-115px);
    height: 310px;
    z-index: 6;
}

.seal {
    position: absolute;
    width: 46px;
    height: 46px;
    left: calc(50% - 23px);
    top: 85px;
    border-radius: 50%;
    background: #7f183d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8;
    transition: .8s;
}

.envelope.open .seal {
    opacity: 0;
    transform: scale(0);
}

.tap-text {
    color: #bd8398;
    font-size: 11px;
}

.final-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    padding: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6394, #ffd5e0);
    box-shadow: 0 0 45px rgba(255,89,142,.3);
}

.final-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.final-content h1 {
    font-size: clamp(55px, 11vw, 85px);
}

.final-content > p:not(.small-text):not(.signature) {
    margin-top: 20px;
    color: #dfbdca;
    font-family: "Cormorant Garamond", serif;
    font-size: 23px;
    line-height: 1.5;
}

.signature {
    margin-top: 10px;
    color: #ef9db9;
    font-family: "Great Vibes", cursive;
    font-size: 28px;
}

.hearts,
.stars {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.floating-heart {
    position: absolute;
    bottom: -40px;
    animation: floatHeart linear forwards;
}

.burst-heart {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 100;
    font-size: 25px;
    animation: burst 1.5s ease-out forwards;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 35px rgba(255,73,134,.25);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 0 70px rgba(255,73,134,.5);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.12);
    }

    45% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@keyframes floatHeart {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 0;
    }

    10% {
        opacity: .7;
    }

    100% {
        transform: translateY(-115vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 600px) {

    .screen {
        padding: 20px;
    }

    .image-glow {
        width: 155px;
        height: 155px;
    }

    h1 {
        font-size: 58px;
    }

    h2 {
        font-size: 29px;
    }

    .intro-message,
    .unlock-description,
    .unlocked-text {
        font-size: 20px;
    }

    .memory-image {
        height: 280px;
    }

    .memory-card p {
        font-size: 21px;
        min-height: 115px;
    }

    .big-heart {
        font-size: 80px;
    }

    .final-image {
        width: 145px;
        height: 145px;
    }

}