/* =========================================================
   MISS YOU — COMPLETE DESIGN
   One-screen / no-scroll / dreamy scrapbook style
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Patrick+Hand&display=swap');


/* =========================================================
   ROOT
   ========================================================= */

:root {
    --pink: #ffb9c8;
    --pink-strong: #ff8eaa;
    --lavender: #cfc7ff;
    --lavender-dark: #765d83;
    --blue: #cce7f8;
    --cream: #fff9f1;

    --text: #493452;
    --soft-text: #806c87;

    --glass: rgba(255,255,255,.58);
    --glass-strong: rgba(255,255,255,.76);

    --shadow:
        0 25px 70px rgba(91, 61, 104, .12);

    --soft-shadow:
        0 12px 35px rgba(91, 61, 104, .10);

    --radius: 28px;
}


/* =========================================================
   RESET
   ========================================================= */

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "DM Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(255, 192, 211, .55),
            transparent 35%
        ),
        radial-gradient(
            circle at 85% 25%,
            rgba(204, 226, 255, .65),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            #fce5ee,
            #e9e7ff 45%,
            #e3f4f8
        );

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* =========================================================
   APP
   ========================================================= */

#app {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    isolation: isolate;
}


/* =========================================================
   SCENE SYSTEM
   ========================================================= */

.scene {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    overflow: hidden;

    transition:
        opacity .55s ease,
        visibility .55s ease;
}

.scene.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scene.exit-left {
    opacity: 0;
    transform: translateX(-35px);
}

.scene-inner {
    position: relative;

    width: min(1100px, calc(100% - 48px));
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 55px 0;
}


/* =========================================================
   BACKGROUND ATMOSPHERE
   ========================================================= */

.scene:not(.final-scene)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 188, 210, .30),
            transparent 35%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(194, 226, 255, .32),
            transparent 38%
        );
}

.scene:not(.final-scene)::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    background:
        radial-gradient(
            circle,
            rgba(255,255,255,.35),
            transparent 70%
        );

    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.script-text {
    font-family: "Patrick Hand", cursive;
    font-size: clamp(22px, 2.2vw, 32px);
    color: var(--soft-text);
    letter-spacing: .5px;

    margin-bottom: 14px;

    animation: gentleFloat 4s ease-in-out infinite;
}

.tiny-top-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(80, 54, 83, .48);
    margin-bottom: 22px;
}

h1,
h2,
h3,
p {
    position: relative;
    z-index: 2;
}


/* =========================================================
   BUTTONS
   ========================================================= */

button {
    font-family: inherit;
}

.main-button {
    position: relative;
    z-index: 20;

    border: 0;
    outline: none;

    padding: 13px 23px;

    border-radius: 999px;

    color: var(--text);

    font-size: 15px;
    font-weight: 600;

    background:
        linear-gradient(
            110deg,
            #ffc4cf,
            #ffd9cb,
            #ddd0ff
        );

    box-shadow:
        0 12px 30px rgba(101, 68, 104, .13);

    cursor: pointer;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        filter .25s ease;
}

.main-button span {
    margin-left: 5px;
}

.main-button:hover {
    transform: translateY(-3px) scale(1.025);

    box-shadow:
        0 17px 38px rgba(101, 68, 104, .19);

    filter: brightness(1.03);
}

.main-button:active {
    transform: translateY(0) scale(.98);
}

.small-button {
    padding: 11px 20px;
}

.text-button {
    border: 0;
    background: none;

    color: var(--lavender-dark);

    font-family: "Patrick Hand", cursive;
    font-size: 21px;

    cursor: pointer;

    transition:
        transform .2s ease,
        color .2s ease;
}

.text-button:hover {
    transform: translateY(-2px);
    color: var(--pink-strong);
}


/* =========================================================
   OPENING
   ========================================================= */

.opening-inner {
    justify-content: center;
}

.opening-title {
    margin-bottom: 24px;
}

.opening-title h1 {
    font-size: clamp(38px, 5vw, 68px);
    line-height: .98;
    letter-spacing: -2px;
    font-weight: 700;
}

.opening-title h1 span {
    background:
        linear-gradient(
            100deg,
            #ff91ae,
            #aa91e8
        );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* =========================================================
   ENVELOPE
   ========================================================= */

.envelope-area {
    position: relative;

    width: 270px;
    height: 185px;

    margin: 12px 0 30px;

    cursor: pointer;
}

.envelope {
    position: absolute;

    width: 240px;
    height: 155px;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    border-radius: 17px;

    filter:
        drop-shadow(
            0 18px 28px rgba(95, 57, 94, .13)
        );

    transition:
        transform .5s cubic-bezier(.22,1,.36,1);
}

.envelope-area:hover .envelope {
    transform:
        translate(-50%, -50%)
        rotate(-2deg)
        translateY(-5px);
}

.envelope-back {
    position: absolute;
    inset: 0;

    border-radius: 17px;

    background:
        linear-gradient(
            135deg,
            #ffc8d3,
            #f4d9f2
        );
}

.envelope-front {
    position: absolute;
    inset: 0;

    clip-path:
        polygon(
            0 38%,
            50% 73%,
            100% 38%,
            100% 100%,
            0 100%
        );

    background:
        linear-gradient(
            135deg,
            #ffd4dc,
            #e7d8fa
        );

    border-radius: 0 0 17px 17px;
}

.envelope-flap {
    position: absolute;

    left: 0;
    top: 0;

    width: 100%;
    height: 70%;

    clip-path:
        polygon(
            0 0,
            100% 0,
            50% 72%
        );

    background:
        linear-gradient(
            135deg,
            #fff0f3,
            #eadcf8
        );

    transform-origin: top;
}

.letter-paper {
    position: absolute;

    left: 50%;
    top: 18px;

    transform: translateX(-50%);

    width: 155px;
    height: 100px;

    border-radius: 13px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #fffdfb,
            #fff5fa
        );

    box-shadow:
        0 10px 25px rgba(86, 56, 89, .12);

    font-family: "Patrick Hand", cursive;
    font-size: 21px;

    color: var(--text);

    z-index: 3;
}

.letter-paper b {
    font-size: 22px;
    margin-top: 3px;
}

.envelope-heart {
    position: absolute;

    left: 50%;
    top: 54%;

    transform: translate(-50%, -50%);

    color: #f15e80;
    font-size: 24px;

    z-index: 8;

    filter:
        drop-shadow(
            0 5px 8px rgba(230, 80, 120, .2)
        );
}

.envelope-shadow {
    position: absolute;

    width: 210px;
    height: 25px;

    left: 50%;
    bottom: 2px;

    transform: translateX(-50%);

    border-radius: 50%;

    background:
        rgba(73, 52, 82, .14);

    filter: blur(12px);
}

.spark {
    position: absolute;

    color: #f7b7c7;

    font-size: 24px;

    animation:
        sparkle 2.8s ease-in-out infinite;
}

.spark-1 {
    right: 5px;
    top: 18px;
}

.spark-2 {
    left: 10px;
    top: 80px;
    animation-delay: .7s;
}

.spark-3 {
    right: 18px;
    bottom: 22px;
    animation-delay: 1.2s;
}


/* =========================================================
   MESSAGE
   ========================================================= */

.message-inner {
    justify-content: center;
}

.message-small {
    font-size: clamp(21px, 2.5vw, 30px);
    font-weight: 600;
    margin-bottom: 25px;
}

.big-miss {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;
}

.big-miss span {
    font-size: clamp(58px, 8vw, 105px);
    line-height: .95;
    font-weight: 700;
    letter-spacing: -5px;

    background:
        linear-gradient(
            100deg,
            #ff9eae,
            #f7c6cb,
            #c8b8ed
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    filter:
        drop-shadow(
            0 15px 28px rgba(143, 93, 122, .12)
        );
}

.big-heart {
    position: absolute;

    right: -45px;
    bottom: -2px;

    color: #ff7396;

    font-size: 32px;

    animation:
        heartBeat 1.7s ease-in-out infinite;
}

.message-description {
    color: var(--soft-text);
    font-size: 16px;
    line-height: 1.65;
}

.message-description strong {
    color: var(--pink-strong);
}

.tiny-note {
    margin-top: 12px;
    margin-bottom: 25px;

    font-family: "Patrick Hand", cursive;

    color: rgba(95, 72, 100, .55);
    font-size: 17px;
}


/* =========================================================
   MEMORY SECTION
   ========================================================= */

.memories-inner {
    justify-content: center;
}

.memories-inner h2 {
    font-size: clamp(34px, 4.3vw, 58px);
    letter-spacing: -1.5px;
    margin-bottom: 5px;
}

.section-subtitle {
    font-family: "Patrick Hand", cursive;
    color: var(--soft-text);
    font-size: 18px;
    margin-bottom: 18px;
}

.memory-grid {
    width: min(760px, 100%);

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 13px;

    margin: 8px auto 20px;
}

.memory-card {
    position: relative;

    min-height: 145px;

    perspective: 900px;

    cursor: pointer;

    transform:
        rotate(var(--rotation));

    transition:
        transform .3s ease;
}

.memory-card:hover {
    transform:
        rotate(0deg)
        translateY(-4px);
}

.memory-front,
.memory-back {
    position: absolute;
    inset: 0;

    border-radius: 25px;

    padding: 18px;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: flex-start;

    text-align: left;

    backface-visibility: hidden;

    background:
        rgba(255,255,255,.68);

    border:
        1px solid rgba(255,255,255,.85);

    box-shadow:
        0 13px 35px rgba(80, 55, 91, .10);

    backdrop-filter: blur(15px);

    transition:
        transform .55s cubic-bezier(.22,1,.36,1);
}

.memory-front {
    transform: rotateY(0deg);
}

.memory-back {
    transform: rotateY(180deg);
}

.memory-card.open .memory-front {
    transform: rotateY(-180deg);
}

.memory-card.open .memory-back {
    transform: rotateY(0deg);
}

.memory-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.memory-front h3,
.memory-back h3 {
    font-size: 15px;
    line-height: 1.25;
}

.memory-front small {
    margin-top: auto;

    font-family: "Patrick Hand", cursive;
    font-size: 15px;

    color: rgba(90, 69, 95, .55);
}

.memory-back p {
    margin-top: 8px;

    font-family: "Patrick Hand", cursive;
    font-size: 16px;

    line-height: 1.35;
    color: var(--soft-text);
}


/* =========================================================
   NICKNAMES
   ========================================================= */

.nickname-inner {
    justify-content: center;
}

.chat-stage {
    position: relative;

    width: min(650px, 100%);
    height: 190px;

    margin: 10px 0;
}

.chat-bubble {
    position: absolute;

    padding: 13px 22px;

    border-radius: 22px;

    font-size: 17px;
    font-weight: 600;

    box-shadow:
        0 13px 30px rgba(81, 55, 90, .10);

    animation:
        bubbleFloat 3.5s ease-in-out infinite;
}

.bubble-her {
    right: 12%;
    top: 15%;

    background:
        linear-gradient(
            110deg,
            #ffc5d1,
            #ead4f7
        );
}

.bubble-me {
    left: 12%;
    bottom: 18%;

    background:
        rgba(255,255,255,.72);

    animation-delay: .8s;
}

.bubble-sticker {
    position: absolute;

    font-size: 19px;
    right: -13px;
    top: -12px;
}

.nickname-title {
    font-size: clamp(27px, 3vw, 40px);

    margin-bottom: 16px;

    color: var(--text);
}

.nickname-text {
    font-family: "Patrick Hand", cursive;

    font-size: clamp(20px, 2.1vw, 27px);

    line-height: 1.35;

    color: var(--soft-text);

    margin-bottom: 24px;
}


/* =========================================================
   THINGS I MISS
   ========================================================= */

.miss-inner {
    justify-content: center;
}

.miss-inner h2 {
    font-size: clamp(30px, 4vw, 50px);
    margin-bottom: 3px;
}

.miss-buttons {
    width: min(780px, 100%);

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    margin: 17px auto;
}

.miss-chip {
    border: 1px solid rgba(255,255,255,.75);

    background:
        rgba(255,255,255,.62);

    color: var(--text);

    border-radius: 999px;

    padding: 11px 17px;

    font-size: 14px;

    cursor: pointer;

    box-shadow:
        0 8px 22px rgba(84, 59, 92, .07);

    transition:
        transform .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.miss-chip:hover {
    transform: translateY(-3px);

    background:
        rgba(255,255,255,.86);
}

.miss-chip.active {
    background:
        linear-gradient(
            110deg,
            #ffc4d1,
            #e5d8ff
        );

    box-shadow:
        0 10px 25px rgba(115, 76, 115, .13);
}

.miss-response {
    width: min(650px, 90%);

    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-family: "Patrick Hand", cursive;

    color: var(--soft-text);

    font-size: 19px;

    margin-top: 3px;
}

.miss-counter {
    font-size: 12px;

    color: rgba(91, 66, 96, .48);

    margin-bottom: 18px;
}


/* =========================================================
   GIFT
   ========================================================= */

.surprise-inner {
    justify-content: center;
}

.gift {
    position: relative;

    width: 145px;
    height: 125px;

    margin: 12px 0 30px;

    cursor: pointer;

    transition:
        transform .4s ease;
}

.gift:hover {
    transform: translateY(-5px) rotate(-1deg);
}

.gift-body {
    position: absolute;

    left: 8px;
    right: 8px;
    bottom: 0;

    height: 85px;

    border-radius: 12px 12px 20px 20px;

    background:
        linear-gradient(
            135deg,
            #ffc5cd,
            #d9cafa
        );

    box-shadow:
        0 18px 30px rgba(88, 58, 92, .13);
}

.gift-lid {
    position: absolute;

    left: 0;
    right: 0;
    top: 18px;

    height: 35px;

    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            #ffd8dc,
            #e8d9f7
        );

    z-index: 4;

    transition:
        transform .6s cubic-bezier(.22,1,.36,1);
}

.gift-bow {
    position: absolute;

    left: 50%;
    top: -21px;

    transform: translateX(-50%);

    font-size: 35px;
}

.gift-ribbon {
    position: absolute;

    width: 18px;
    height: 100%;

    left: 50%;
    transform: translateX(-50%);

    background:
        rgba(255,255,255,.62);
}

.gift-lock {
    position: absolute;

    right: -4px;
    bottom: 3px;

    font-size: 20px;
    z-index: 5;
}

.gift.open .gift-lid {
    transform:
        translateY(-45px)
        rotate(-4deg);
}

.surprise-message {
    width: min(620px, 90%);

    opacity: 0;
    transform: translateY(15px);

    transition:
        opacity .6s ease,
        transform .6s ease;
}

.surprise-message.show {
    opacity: 1;
    transform: translateY(0);
}

.surprise-message p {
    font-size: 17px;
    line-height: 1.55;

    color: var(--soft-text);

    margin-bottom: 10px;
}

.surprise-message strong {
    display: block;

    margin: 14px 0;

    font-size: 28px;

    color: var(--pink-strong);
}


/* =========================================================
   LETTER
   ========================================================= */

.letter-inner {
    justify-content: center;
}

.letter-card {
    position: relative;

    width: min(680px, calc(100% - 20px));
    max-height: min(590px, 70vh);

    overflow: hidden;

    padding: 38px 42px 34px;

    text-align: left;

    background:
        rgba(255,255,255,.82);

    border:
        1px solid rgba(255,255,255,.9);

    border-radius: 25px;

    box-shadow:
        0 25px 60px rgba(75, 52, 82, .12);

    transform:
        rotate(-.5deg);
}

.letter-title {
    font-family: "Patrick Hand", cursive;

    font-size: 30px;

    margin-bottom: 20px;
}

.letter-content {
    font-family: "Patrick Hand", cursive;

    font-size: clamp(17px, 1.6vw, 20px);

    line-height: 1.7;

    color: var(--soft-text);

    white-space: pre-line;
}

.letter-content .highlight {
    display: inline-block;

    color: var(--pink-strong);

    font-size: 1.25em;

    margin: 5px 0;
}

.letter-signature {
    margin-top: 18px;

    text-align: right;

    font-family: "Patrick Hand", cursive;

    font-size: 20px;

    color: var(--soft-text);
}

.tape {
    position: absolute;

    width: 70px;
    height: 18px;

    background:
        rgba(188, 226, 241, .72);

    transform: rotate(-4deg);

    z-index: 5;
}

.tape-left {
    left: 24px;
    top: -4px;
}

.tape-right {
    right: 18px;
    bottom: -5px;

    transform: rotate(3deg);
}


/* =========================================================
   FINAL SCREEN
   THIS FIXES THE BROKEN ALIGNMENT
   ========================================================= */

.final-scene {
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(93, 78, 139, .75),
            transparent 40%
        ),
        linear-gradient(
            135deg,
            #24203f,
            #3b365f 55%,
            #262440
        );

    color: #fff;
}

.final-scene::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(255,190,220,.07),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(177,170,255,.08),
            transparent 30%
        );

    pointer-events: none;
}

.final-inner {
    position: relative;
    z-index: 10;

    width: min(920px, calc(100% - 40px));

    height: 100%;

    margin: 0 auto;

    padding:
        clamp(55px, 9vh, 100px)
        20px
        clamp(35px, 7vh, 70px);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;
}

.final-inner .script-text {
    color: rgba(255,255,255,.72);

    font-size:
        clamp(22px, 2.5vw, 31px);

    margin-bottom: 10px;
}

.final-line {
    color: rgba(255,255,255,.72);

    font-family: "Patrick Hand", cursive;

    font-size:
        clamp(18px, 2vw, 26px);

    line-height: 1.35;

    margin: 3px 0;
}

.final-message {
    width: 100%;

    max-width: 850px;

    margin: 22px auto 16px;

    padding: 0 10px;

    font-size:
        clamp(35px, 5vw, 68px);

    line-height: 1.08;

    letter-spacing: -1.8px;

    font-weight: 700;

    color: #ffe0e7;

    text-align: center;

    overflow-wrap: normal;
}

.final-message span {
    display: inline-block;

    font-size: .72em;

    margin-left: 5px;
}

.final-signature {
    max-width: 700px;

    color: rgba(255,255,255,.82);

    font-family: "Patrick Hand", cursive;

    font-size:
        clamp(19px, 2.2vw, 27px);

    margin-bottom: 20px;
}

.final-signature strong {
    color: #ffc3d0;
}

.final-button {
    color: #f9efff;

    background:
        rgba(255,255,255,.07);

    border:
        1px solid rgba(255,255,255,.22);

    box-shadow:
        0 12px 30px rgba(0,0,0,.12);

    backdrop-filter: blur(10px);
}

.final-button:hover {
    background:
        rgba(255,255,255,.14);
}


/* =========================================================
   STARS
   ========================================================= */

.stars {
    position: absolute;
    inset: 0;

    overflow: hidden;

    pointer-events: none;

    z-index: 1;
}

.star {
    position: absolute;

    border-radius: 50%;

    background: #fff;

    opacity: .55;

    animation:
        twinkle var(--duration)
        ease-in-out infinite alternate;
}

.moon {
    position: absolute;

    right: clamp(25px, 7vw, 90px);
    top: clamp(25px, 7vh, 70px);

    font-size: clamp(48px, 6vw, 78px);

    cursor: pointer;

    z-index: 20;

    filter:
        drop-shadow(
            0 8px 22px rgba(255,184,102,.28)
        );

    animation:
        moonFloat 5s ease-in-out infinite;
}

.final-bear {
    position: absolute;

    left: clamp(22px, 5vw, 70px);
    bottom: clamp(25px, 6vh, 55px);

    font-size: 30px;

    cursor: pointer;

    z-index: 20;

    animation:
        bearFloat 4s ease-in-out infinite;
}


/* =========================================================
   SECRET
   ========================================================= */

.hidden-secret {
    margin-top: 15px;
}

.secret-button {
    border: 0;
    background: transparent;

    color: rgba(255,255,255,.30);

    font-size: 11px;

    cursor: pointer;

    transition:
        color .2s ease;
}

.secret-button:hover {
    color: rgba(255,255,255,.65);
}


/* =========================================================
   MUSIC BUTTON
   ========================================================= */

.music-button {
    position: fixed;

    left: 20px;
    bottom: 18px;

    z-index: 100;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px;

    border-radius: 999px;

    border:
        1px solid rgba(255,255,255,.75);

    background:
        rgba(255,255,255,.58);

    color: var(--text);

    backdrop-filter: blur(15px);

    box-shadow:
        0 10px 30px rgba(69, 50, 77, .12);

    cursor: pointer;

    font-size: 12px;

    transition:
        transform .2s ease,
        background .2s ease;
}

.music-button:hover {
    transform: translateY(-3px);

    background:
        rgba(255,255,255,.78);
}

.music-button.playing {
    background:
        linear-gradient(
            110deg,
            rgba(255,194,207,.82),
            rgba(215,205,255,.82)
        );
}

#musicIcon {
    font-size: 15px;
}

.music-button.playing #musicIcon {
    animation:
        musicBounce .7s ease-in-out infinite alternate;
}


/* =========================================================
   OVERLAYS
   ========================================================= */

.reply-overlay,
.secret-overlay {
    position: fixed;

    inset: 0;

    z-index: 500;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(40, 31, 55, .55);

    backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.reply-overlay.open,
.secret-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.reply-card,
.secret-card {
    width: min(470px, 100%);

    padding: 35px 30px;

    border-radius: 30px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.95),
            rgba(252,242,255,.95)
        );

    box-shadow:
        0 30px 80px rgba(24, 16, 40, .25);

    transform:
        translateY(20px)
        scale(.96);

    transition:
        transform .4s cubic-bezier(.22,1,.36,1);
}

.reply-overlay.open .reply-card,
.secret-overlay.open .secret-card {
    transform:
        translateY(0)
        scale(1);
}

.close-reply {
    position: absolute;

    width: 36px;
    height: 36px;

    margin-left: 375px;

    border: 0;

    border-radius: 50%;

    background:
        rgba(255,255,255,.9);

    font-size: 25px;

    color: var(--text);

    cursor: pointer;
}

.reply-emoji {
    font-size: 42px;
    margin-bottom: 5px;
}

.reply-card h3,
.secret-card h3 {
    font-size: 27px;
    margin-bottom: 8px;
}

.reply-card p,
.secret-card p {
    color: var(--soft-text);

    line-height: 1.5;

    margin-bottom: 20px;
}

.reply-options {
    display: flex;
    flex-wrap: wrap;

    justify-content: center;

    gap: 9px;
}

.reply-options button {
    border: 1px solid rgba(126, 99, 139, .15);

    background:
        #fff;

    color: var(--text);

    padding: 10px 14px;

    border-radius: 999px;

    cursor: pointer;

    transition:
        transform .2s ease,
        background .2s ease;
}

.reply-options button:hover {
    transform: translateY(-2px);

    background:
        #fff0f5;
}

.reply-result {
    min-height: 25px;

    margin-top: 18px;

    font-family: "Patrick Hand", cursive;

    font-size: 19px;

    color: var(--pink-strong);
}

.secret-stars {
    font-size: 25px;

    color: #e3a9c5;

    margin-bottom: 10px;
}

.secret-card strong {
    display: block;

    margin-bottom: 20px;

    color: var(--text);
}


/* =========================================================
   TOAST
   ========================================================= */

.toast {
    position: fixed;

    left: 50%;
    bottom: 80px;

    transform:
        translateX(-50%)
        translateY(15px);

    z-index: 1000;

    padding: 11px 18px;

    border-radius: 999px;

    background:
        rgba(55, 43, 66, .90);

    color: white;

    font-size: 13px;

    box-shadow:
        0 15px 35px rgba(0,0,0,.18);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   FLOATING CONFETTI
   ========================================================= */

.confetti {
    position: fixed;

    z-index: 800;

    pointer-events: none;

    font-size: 18px;

    color: #ff94b2;

    animation:
        confettiFly 2.1s
        cubic-bezier(.16,1,.3,1)
        forwards;
}


/* =========================================================
   AMBIENT
   ========================================================= */

.ambient {
    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 2;

    overflow: hidden;
}

.ambient-item {
    position: absolute;

    color: rgba(255,255,255,.45);

    font-size: 20px;

    animation:
        ambientFloat 7s ease-in-out infinite;
}

.a1 {
    left: 8%;
    top: 18%;
}

.a2 {
    left: 18%;
    bottom: 20%;
    animation-delay: 1s;
}

.a3 {
    right: 15%;
    top: 25%;
    animation-delay: 2s;
}

.a4 {
    right: 8%;
    bottom: 22%;
    animation-delay: 3s;
}

.a5 {
    left: 50%;
    top: 10%;
    animation-delay: 1.5s;
}

.a6 {
    right: 35%;
    bottom: 12%;
    animation-delay: 2.5s;
}

.a7 {
    left: 40%;
    bottom: 25%;
    animation-delay: 4s;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: .45;
        transform: scale(.85) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(12deg);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.22);
    }
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes twinkle {
    from {
        opacity: .15;
        transform: scale(.7);
    }

    to {
        opacity: .9;
        transform: scale(1.25);
    }
}

@keyframes moonFloat {
    0%, 100% {
        transform: translateY(0) rotate(-4deg);
    }

    50% {
        transform: translateY(-8px) rotate(3deg);
    }
}

@keyframes bearFloat {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-7px) rotate(3deg);
    }
}

@keyframes musicBounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-3px);
    }
}

@keyframes ambientFloat {
    0%, 100% {
        transform:
            translateY(0)
            rotate(0deg);
    }

    50% {
        transform:
            translateY(-25px)
            rotate(10deg);
    }
}

@keyframes confettiFly {
    0% {
        opacity: 0;
        transform:
            translate(0, 0)
            scale(.5)
            rotate(0deg);
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 0;

        transform:
            translate(var(--x), var(--y))
            scale(1.15)
            rotate(360deg);
    }
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 850px) {

    .scene-inner {
        width: min(100% - 32px, 720px);
        padding: 35px 0;
    }

    .memory-grid {
        grid-template-columns: repeat(2, 1fr);

        max-width: 620px;
    }

    .memory-card {
        min-height: 125px;
    }

    .final-message {
        max-width: 680px;
    }

}


/* =========================================================
   RESPONSIVE — PHONE
   ========================================================= */

@media (max-width: 600px) {

    html,
    body,
    #app {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .scene-inner {
        width: calc(100% - 28px);
        padding:
            28px 0
            24px;
    }

    .script-text {
        font-size: 20px;
    }

    .tiny-top-text {
        font-size: 9px;
        letter-spacing: 2px;
    }


    /* Opening */

    .opening-title h1 {
        font-size: 43px;
        letter-spacing: -1.8px;
    }

    .envelope-area {
        transform: scale(.82);
        margin-top: 0;
        margin-bottom: 5px;
    }


    /* Message */

    .message-small {
        font-size: 21px;
        margin-bottom: 20px;
    }

    .big-miss span {
        font-size: 58px;
        letter-spacing: -3px;
    }

    .big-heart {
        right: -30px;
        font-size: 24px;
    }

    .message-description {
        font-size: 14px;
    }

    .tiny-note {
        font-size: 15px;
    }


    /* Memories */

    .memories-inner h2 {
        font-size: 34px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .memory-grid {
        grid-template-columns: repeat(2, 1fr);

        gap: 8px;

        width: 100%;

        margin-top: 8px;
        margin-bottom: 12px;
    }

    .memory-card {
        min-height: 112px;
    }

    .memory-front,
    .memory-back {
        padding: 12px;

        border-radius: 18px;
    }

    .memory-front h3,
    .memory-back h3 {
        font-size: 12px;
    }

    .memory-front small {
        font-size: 12px;
    }

    .memory-back p {
        font-size: 13px;
    }

    .memory-icon {
        font-size: 18px;
        margin-bottom: 4px;
    }


    /* Nicknames */

    .chat-stage {
        height: 150px;
    }

    .chat-bubble {
        font-size: 15px;
        padding: 11px 16px;
    }

    .bubble-her {
        right: 3%;
    }

    .bubble-me {
        left: 3%;
    }

    .nickname-title {
        font-size: 27px;
    }

    .nickname-text {
        font-size: 19px;
    }


    /* Miss */

    .miss-inner h2 {
        font-size: 29px;
    }

    .miss-buttons {
        gap: 7px;
        margin: 12px auto;
    }

    .miss-chip {
        padding: 9px 12px;
        font-size: 12px;
    }

    .miss-response {
        font-size: 17px;
        line-height: 1.25;
    }


    /* Gift */

    .gift {
        transform: scale(.88);
        margin-bottom: 20px;
    }

    .gift:hover {
        transform: scale(.88) translateY(-4px);
    }

    .surprise-message p {
        font-size: 15px;
    }

    .surprise-message strong {
        font-size: 24px;
    }


    /* Letter */

    .letter-card {
        width: 100%;

        max-height: 63vh;

        padding:
            28px 22px
            24px;

        border-radius: 21px;
    }

    .letter-title {
        font-size: 26px;
        margin-bottom: 13px;
    }

    .letter-content {
        font-size: 15px;
        line-height: 1.48;
    }

    .letter-signature {
        font-size: 18px;
    }


    /* FINAL SCREEN */

    .final-inner {
        width: calc(100% - 24px);

        padding:
            30px 5px
            25px;
    }

    .final-inner .script-text {
        font-size: 21px;
    }

    .final-line {
        font-size: 18px;
    }

    .final-message {
        width: 100%;

        max-width: 430px;

        margin:
            16px auto
            12px;

        padding: 0;

        font-size: 35px;

        line-height: 1.08;

        letter-spacing: -1px;

        word-break: normal;
        overflow-wrap: normal;
    }

    .final-signature {
        font-size: 19px;

        max-width: 340px;

        line-height: 1.35;

        margin-bottom: 16px;
    }

    .moon {
        right: 17px;
        top: 20px;

        font-size: 45px;
    }

    .final-bear {
        left: 18px;
        bottom: 22px;

        font-size: 25px;
    }

    .hidden-secret {
        margin-top: 10px;
    }

    .secret-button {
        font-size: 10px;
    }


    /* Music */

    .music-button {
        left: 12px;
        bottom: 12px;

        padding: 8px 12px;

        font-size: 11px;
    }


    /* Toast */

    .toast {
        bottom: 65px;

        width: max-content;
        max-width: calc(100% - 30px);

        text-align: center;
    }


    /* Modal */

    .reply-card,
    .secret-card {
        padding: 28px 20px;
        border-radius: 25px;
    }

    .close-reply {
        margin-left: 0;

        right: 18px;
        top: 15px;
    }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-height: 700px) and (max-width: 600px) {

    .scene-inner {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .script-text {
        margin-bottom: 7px;
    }

    .opening-title h1 {
        font-size: 36px;
    }

    .envelope-area {
        transform: scale(.68);
        margin-top: -15px;
        margin-bottom: -15px;
    }

    .memory-card {
        min-height: 98px;
    }

    .memory-front,
    .memory-back {
        padding: 9px;
    }

    .final-message {
        font-size: 31px;
    }

    .final-line {
        font-size: 16px;
    }

    .final-signature {
        font-size: 17px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}