:root {
    --bg: #fef6f0;
    --bg-deep: #fdf0e8;
    --text-primary: #4a3f55;
    --text-secondary: #7a6e85;
    --text-light: #a89bb5;
    --pink: #f4a6b8;
    --pink-deep: #e8879e;
    --pink-soft: #f8d0db;
    --yellow: #f7c948;
    --green: #7ecba1;
    --blue: #8bb8e8;
    --lavender: #b8a9d4;
    --peach: #f5c4a1;
    --serif: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Serif SC', system-ui, serif;
}

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

html {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100%;
    background: var(--bg);
    font-family: var(--serif);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
}

.bg-deco {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .12;
}

.bg-blob-1 { width: 300px; height: 300px; background: var(--pink); top: -5%; left: -10%; animation: blob-drift 18s ease-in-out infinite alternate; }
.bg-blob-2 { width: 250px; height: 250px; background: var(--yellow); top: 30%; right: -8%; animation: blob-drift 22s ease-in-out infinite alternate-reverse; }
.bg-blob-3 { width: 280px; height: 280px; background: var(--green); bottom: -5%; left: 20%; animation: blob-drift 20s ease-in-out infinite alternate; }
.bg-blob-4 { width: 200px; height: 200px; background: var(--blue); top: 50%; left: -5%; animation: blob-drift 25s ease-in-out infinite alternate-reverse; }
.bg-blob-5 { width: 220px; height: 220px; background: var(--lavender); bottom: 20%; right: -5%; animation: blob-drift 19s ease-in-out infinite alternate; }

@keyframes blob-drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
    100% { transform: translate(10px, -10px) scale(1.02); }
}

.bg-star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--yellow);
    opacity: 0;
    animation: bg-twinkle var(--tw-dur, 3s) ease-in-out var(--tw-del, 0s) infinite;
}

.bg-star:nth-child(6) { top: 8%; left: 15%; --tw-dur: 2.5s; --tw-del: 0s; width: 3px; height: 3px; background: var(--pink); }
.bg-star:nth-child(7) { top: 15%; right: 20%; --tw-dur: 3.2s; --tw-del: 0.5s; }
.bg-star:nth-child(8) { top: 45%; left: 8%; --tw-dur: 2.8s; --tw-del: 1s; background: var(--lavender); }
.bg-star:nth-child(9) { top: 60%; right: 12%; --tw-dur: 3.5s; --tw-del: 0.3s; background: var(--green); }
.bg-star:nth-child(10) { top: 80%; left: 25%; --tw-dur: 2.2s; --tw-del: 0.8s; width: 3px; height: 3px; background: var(--blue); }
.bg-star:nth-child(11) { top: 25%; left: 45%; --tw-dur: 4s; --tw-del: 1.2s; width: 5px; height: 5px; }
.bg-star:nth-child(12) { top: 70%; right: 30%; --tw-dur: 3s; --tw-del: 0.6s; background: var(--peach); }
.bg-star:nth-child(13) { top: 90%; left: 60%; --tw-dur: 2.6s; --tw-del: 0.9s; width: 3px; height: 3px; background: var(--pink); }

@keyframes bg-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: .5; transform: scale(1.2); }
}

#fx-canvas {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

#loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s cubic-bezier(.4,0,.2,1), transform 1s cubic-bezier(.4,0,.2,1);
}

#loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(244,166,184,.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(247,201,72,.06) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(126,203,161,.06) 0%, transparent 45%);
    pointer-events: none;
}

#loading.done {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.load-aura {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,166,184,.12) 0%, transparent 70%);
    animation: load-aura-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes load-aura-pulse {
    0%, 100% { transform: scale(1); opacity: .5; }
    50% { transform: scale(1.3); opacity: 1; }
}

.load-balloon {
    position: relative;
    z-index: 2;
    animation: load-float 2s ease-in-out infinite;
}

.load-balloon-body {
    width: 52px;
    height: 64px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    position: relative;
    box-shadow:
        inset -4px -6px 10px rgba(0,0,0,.06),
        inset 6px 8px 14px rgba(255,255,255,.2),
        0 4px 16px rgba(0,0,0,.06);
}

.load-balloon-body::before {
    content: '';
    position: absolute;
    top: 14%;
    left: 18%;
    width: 28%;
    height: 18%;
    background: rgba(255,255,255,.5);
    border-radius: 50%;
    transform: rotate(-30deg);
    filter: blur(1px);
}

.load-balloon-body::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 9px solid var(--lb-color, #FF6B8A);
    filter: brightness(.9);
}

.load-balloon-str {
    display: block;
    width: 1.5px;
    height: 40px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(180,170,160,.35), rgba(180,170,160,.1));
    animation: str-sway 2.5s ease-in-out infinite;
}

@keyframes load-float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-14px) rotate(5deg); }
}

.load-text {
    margin-top: 20px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 6px;
    position: relative;
    z-index: 2;
}

.load-sub {
    margin-top: 8px;
    font-size: .82rem;
    color: var(--text-light);
    letter-spacing: 3px;
    position: relative;
    z-index: 2;
}

.load-btn {
    margin-top: 36px;
    padding: 12px 36px;
    border: 1.5px solid var(--pink);
    border-radius: 28px;
    color: var(--pink-deep);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: 4px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    background: transparent;
    transition: all .35s cubic-bezier(.34,1.56,.64,1);
    animation: btn-breathe 2s ease-in-out infinite;
}

.load-btn:active {
    transform: scale(.92);
    background: var(--pink-soft);
}

@keyframes btn-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244,166,184,.25); }
    50% { box-shadow: 0 0 0 10px rgba(244,166,184,0); }
}

#main {
    opacity: 0;
    transition: opacity 1s ease .3s;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#main::-webkit-scrollbar {
    display: none;
}

#main.show { opacity: 1; }

.page {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.greeting {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(12px);
    transition: all .6s cubic-bezier(.23,1,.32,1);
}
.greeting.show { opacity: 1; transform: translateY(0); }

.greeting-label { font-size: .85rem; color: var(--text-light); letter-spacing: 2px; }
.greeting-name { font-size: 1.15rem; font-weight: 600; color: var(--pink); letter-spacing: 3px; }

.title {
    text-align: center;
    margin-bottom: 4px;
    line-height: 1.25;
    opacity: 0;
    transform: translateY(16px);
    transition: all .7s cubic-bezier(.23,1,.32,1) .15s;
}
.title.show { opacity: 1; transform: translateY(0); }

.title-line { display: block; font-size: 3.2rem; font-weight: 800; letter-spacing: 6px; color: var(--text-primary); }

.title-accent { color: var(--pink); position: relative; }
.title-accent::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 0; right: 0;
    height: 8px;
    background: var(--pink-soft);
    border-radius: 4px;
    z-index: -1;
}

.subtitle {
    font-size: .95rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(12px);
    transition: all .6s cubic-bezier(.23,1,.32,1) .3s;
}
.subtitle.show { opacity: 1; transform: translateY(0); }

.divider {
    width: 40px; height: 2px;
    background: var(--peach);
    border-radius: 2px;
    margin-bottom: 20px;
    opacity: 0;
    transition: all .6s ease .45s;
}
.divider.show { opacity: .7; }

.letter-wrap {
    max-width: 340px;
    width: 100%;
    margin-bottom: 20px;
    min-height: 120px;
    opacity: 0;
    transform: translateY(12px);
    transition: all .6s cubic-bezier(.23,1,.32,1) .55s;
}
.letter-wrap.show { opacity: 1; transform: translateY(0); }

.letter-body { font-size: .88rem; line-height: 2.1; color: var(--text-secondary); word-break: break-word; }
.letter-body .ch { opacity: 0; transition: opacity .12s; }
.letter-body .ch.on { opacity: 1; }

.letter-cursor {
    display: inline-block;
    width: 2px; height: 1em;
    background: var(--pink);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink .7s step-end infinite;
    box-shadow: 0 0 5px rgba(244,166,184,.5);
    opacity: 0;
    transition: opacity .3s;
}
.letter-cursor.show { opacity: 1; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.footer {
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    transition: all .8s cubic-bezier(.23,1,.32,1);
}
.footer.show { opacity: 1; transform: translateY(0); }

.footer-main { font-size: .88rem; font-weight: 600; color: var(--text-primary); line-height: 1.8; letter-spacing: 1px; }
.footer-note { font-size: .78rem; color: var(--text-light); margin-top: 8px; letter-spacing: 1px; }

#surprise-layer {
    position: fixed;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    overflow: hidden;
}

#img2-wrap {
    position: absolute;
    display: flex;
    justify-content: center;
    opacity: 0;
}

#img2-wrap img {
    display: block;
    max-width: 75vw;
    max-height: 45vh;
    object-fit: contain;
    border-radius: 8px;
}

.img2-balloon {
    position: absolute;
    top: -80px;
    opacity: .85;
}

.img2-balloon-l { left: 5%; }
.img2-balloon-r { right: 5%; }

.img2-balloon .balloon-body {
    width: 36px;
    height: 44px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    position: relative;
    box-shadow:
        inset -4px -6px 10px rgba(0,0,0,.06),
        inset 6px 8px 14px rgba(255,255,255,.2),
        0 4px 16px rgba(0,0,0,.06);
}

.img2-balloon .balloon-body::before {
    content: '';
    position: absolute;
    top: 14%; left: 18%;
    width: 28%; height: 18%;
    background: rgba(255,255,255,.5);
    border-radius: 50%;
    transform: rotate(-30deg);
    filter: blur(1px);
}

.img2-balloon .balloon-body::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 9px solid var(--bcolor, #FF6B8A);
    filter: brightness(.9);
}

.img2-balloon .balloon-str {
    display: block;
    width: 1px;
    height: 40px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(180,170,160,.35), rgba(180,170,160,.1));
}

#img1-wrap {
    position: absolute;
    opacity: 0;
}

#img1-wrap img {
    display: block;
    max-width: 85vw;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 8px;
}

#surprise-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 4px;
    opacity: 0;
    white-space: nowrap;
    z-index: 20;
    padding: 12px 28px;
    border-radius: 32px;
    background: rgba(244,166,184,.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px rgba(244,166,184,.35), 0 0 0 3px rgba(255,255,255,.3) inset;
    animation: surprise-pulse 1.2s ease-in-out infinite;
}

@keyframes surprise-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 4px 24px rgba(244,166,184,.35), 0 0 0 3px rgba(255,255,255,.3) inset; }
    50% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 8px 32px rgba(244,166,184,.5), 0 0 0 3px rgba(255,255,255,.5) inset; }
}

.music-btn {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
    z-index: 100;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(244,166,184,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--pink-deep);
    transition: all .3s cubic-bezier(.23,1,.32,1);
    box-shadow: 0 2px 12px rgba(244,166,184,.15);
    opacity: 0;
    pointer-events: none;
}
.music-btn.show { opacity: 1; pointer-events: auto; }
.music-btn:active { transform: scale(.88); }
.music-btn.playing { animation: music-rotate 3s linear infinite; }

@keyframes music-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-icon { width: 18px; height: 18px; }
.music-icon-off { display: block; }
.music-icon-on { display: none; }
.music-btn.playing .music-icon-on { display: block; }
.music-btn.playing .music-icon-off { display: none; }

.balloons-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.balloon-float {
    position: absolute;
    bottom: -160px;
    will-change: transform;
    opacity: var(--bopacity, .85);
}

.balloon-body {
    width: var(--bw, 38px);
    height: calc(var(--bw, 38px) * 1.22);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: radial-gradient(ellipse at 35% 30%, var(--bhighlight, rgba(255,255,255,.4)), var(--bcolor) 60%);
    position: relative;
    box-shadow:
        inset -4px -6px 10px rgba(0,0,0,.06),
        inset 6px 8px 14px rgba(255,255,255,.2),
        0 4px 16px rgba(0,0,0,.06);
}

.balloon-body::before {
    content: '';
    position: absolute;
    top: 14%; left: 18%;
    width: 28%; height: 18%;
    background: rgba(255,255,255,.5);
    border-radius: 50%;
    transform: rotate(-30deg);
    filter: blur(1px);
}

.balloon-body::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 9px solid var(--bcolor);
    filter: brightness(.9);
}

.balloon-str {
    display: block;
    width: 1.5px;
    height: var(--sh, 55px);
    margin: 0 auto;
    transform-origin: top center;
    animation: str-sway 2.5s ease-in-out infinite;
    position: relative;
}

.balloon-str::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(180,170,160,.35), rgba(180,170,160,.1));
}

@keyframes str-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}
