* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --rose: #c82352;
    --rose-2: #d43f67;
    --pink: #ff6b81;
    --red: #ff4757;
    --line: #ffb6c1;
    --soft: #fff5f7;
    --ink: #4a3a40;
}
html, body {
    min-height: 100%;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #feada6 100%);
    background-attachment: fixed;
    font-family: 'Comfortaa', 'Montserrat', sans-serif;
    color: var(--rose-2);
}
body { overflow-x: hidden; }
html { scroll-behavior: smooth; }

/* TRÁI TIM BAY NỀN */
.hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.heart-particle { position: absolute; color: rgba(255, 105, 180, 0.45); font-size: 20px; bottom: -40px; animation: floatUp 7s infinite linear; }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0deg); opacity: 0.8; } 100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; } }

/* Đốm màu chuyển động */
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; filter: blur(60px); opacity: 0.75; }
.blobs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; animation: blob 18s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { background: #ffc3d3; top: -12vmax; left: -10vmax; }
.blobs i:nth-child(2) { background: #ffe1b8; bottom: -16vmax; right: -12vmax; animation-delay: -6s; }
.blobs i:nth-child(3) { background: #f7b6ff; top: 30%; left: 40%; width: 30vmax; height: 30vmax; animation-delay: -12s; opacity: 0.6; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } 100% { transform: translate(-6vw, -4vh) scale(0.95); } }

/* Cánh hoa rơi */
.petal {
    position: absolute; top: -30px; width: var(--size); height: calc(var(--size) * 1.3);
    background: radial-gradient(circle at 30% 30%, #fff0f4, #ffb3c6 60%, #ff8fab);
    border-radius: 150% 0 150% 0; opacity: 0.85; animation: fall linear forwards;
}
@keyframes fall {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(var(--drift), 110vh) rotate(540deg); opacity: 0.3; }
}

.progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; z-index: 60; background: linear-gradient(90deg, #ff8fa3, #ff4757, #ffb347); border-radius: 0 4px 4px 0; box-shadow: 0 0 10px rgba(255, 71, 87, 0.6); }

.music-btn, .lock-again {
    position: fixed; bottom: 16px; z-index: 30;
    background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.9);
    color: var(--rose-2); padding: 8px 14px; border-radius: 20px; cursor: pointer;
    font-size: 12px; font-weight: bold; font-family: inherit; backdrop-filter: blur(6px);
}
.music-btn { right: 16px; }
.lock-again { left: 16px; display: none; }

main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 16px 90px; }

.card {
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    border-radius: 24px; padding: 28px 24px; border: 2px solid var(--line);
    box-shadow: 0 20px 40px rgba(212, 63, 103, 0.2);
}
.btn {
    display: inline-block; margin-top: 18px; background: linear-gradient(45deg, var(--pink), var(--red));
    color: #fff; border: none; padding: 12px 26px; border-radius: 20px; font-weight: 700; cursor: pointer;
    font-family: inherit; font-size: 14px; text-decoration: none; box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
    transition: transform 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* HIỆN DẦN KHI CUỘN */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.show { opacity: 1; transform: none; }

/* TIÊU ĐỀ CHUNG (trang 2, 3) */
.hero { text-align: center; margin-bottom: 32px; animation: cardPop 0.6s ease both; }
.hero h1 { font-family: 'Dancing Script', cursive; font-size: clamp(38px, 8vw, 64px); color: var(--rose); text-shadow: 0 2px 10px rgba(255, 182, 193, 0.8); }
.hero p { margin-top: 10px; font-size: 15px; font-weight: 600; color: #b8305a; line-height: 1.7; max-width: 620px; margin-inline: auto; }

/* ===== TRANG 1 ===== */
.hero-big {
    min-height: calc(100vh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding-bottom: 40px; animation: cardPop 0.8s ease both;
}
.kicker { font-size: 12px; letter-spacing: 4px; font-weight: 700; color: var(--rose-2); background: rgba(255, 255, 255, 0.6); padding: 6px 14px; border-radius: 20px; }
.hero-big h1 {
    font-family: 'Dancing Script', cursive; font-size: clamp(52px, 12vw, 108px); line-height: 1.05;
    color: var(--rose); margin: 18px 0 8px; text-shadow: 0 4px 18px rgba(255, 255, 255, 0.9);
}
.hero-big h1 span { display: block; font-size: 0.55em; color: var(--red); }
.hero-big p { font-size: 16px; font-weight: 600; color: #a52a50; line-height: 1.8; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.chips span { background: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; box-shadow: 0 6px 16px rgba(212, 63, 103, 0.15); }
.scroll-cue { margin-top: 36px; font-size: 13px; font-weight: 700; color: var(--rose); text-decoration: none; animation: bob 2s ease-in-out infinite; display: inline-block; }

.section { margin-top: 72px; }
.section-head { text-align: center; margin-bottom: 26px; }
.section-head small { font-size: 11px; letter-spacing: 3px; font-weight: 700; color: var(--pink); }
.section-head h2 { font-family: 'Dancing Script', cursive; font-size: clamp(34px, 6vw, 46px); color: var(--rose); margin-top: 4px; }
.section-head::after { content: '— ✿ ❀ ✿ —'; display: block; margin-top: 6px; font-size: 13px; letter-spacing: 4px; color: #ff8fa3; }

/* Ảnh chân dung đầu trang 1 */
.portrait { position: relative; width: 190px; height: 190px; margin: 22px auto 4px; }
.portrait::before {
    content: ''; position: absolute; inset: -10px; border-radius: 50%;
    background: conic-gradient(#ff4757, #ffb347, #ff8fa3, #f7b6ff, #ff4757); animation: spin 6s linear infinite;
}
.portrait img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 14px 34px rgba(200, 35, 82, 0.35); }
.portrait .emoji { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 6px solid #fff; background: linear-gradient(135deg, #fff5f7, #ffe1ea); display: flex; align-items: center; justify-content: center; font-size: 84px; box-shadow: 0 14px 34px rgba(200, 35, 82, 0.35); }
.portrait .badge { position: absolute; right: -6px; bottom: 8px; font-size: 34px; animation: bob 2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Thư gửi má */
.letter {
    max-width: 680px; margin: 0 auto; position: relative;
    background: repeating-linear-gradient(#fffdfd, #fffdfd 35px, #ffd9e2 36px);
    border-radius: 18px; padding: 40px 36px 34px 56px; border: 2px solid var(--line);
    box-shadow: 0 20px 40px rgba(212, 63, 103, 0.2); transform: rotate(-0.6deg);
}
.letter::before { content: ''; position: absolute; top: 0; bottom: 0; left: 36px; width: 2px; background: #ffb3c1; }
.letter .stamp { position: absolute; top: -18px; right: 22px; font-size: 40px; transform: rotate(12deg); }
.letter p { font-family: 'Dancing Script', cursive; font-size: 24px; line-height: 36px; color: #6b2a3c; }
.letter .sign { text-align: right; margin-top: 12px; color: var(--rose); }

/* Câu chuyện */
.story { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: start; }
.story .card { text-align: center; padding: 20px; }
.story h3 { font-family: 'Dancing Script', cursive; font-size: 30px; color: var(--rose); }
.story p { font-size: 13px; color: #666; font-weight: 600; margin: 6px 0 14px; line-height: 1.6; }
.story img { width: 100%; max-height: 520px; object-fit: contain; border-radius: 14px; background: #1b1030; cursor: zoom-in; }

/* Video */
.player { max-width: 820px; margin: 0 auto; padding: 16px; }
.player video { width: 100%; max-height: 70vh; border-radius: 16px; background: #000; display: block; }
.clips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.clips button {
    font-family: inherit; font-weight: 700; font-size: 13px; color: var(--rose-2);
    background: var(--soft); border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 16px; cursor: pointer;
}
.clips button.active { background: linear-gradient(45deg, var(--pink), var(--red)); color: #fff; border-color: transparent; }

/* TikTok */
.tiktok { max-width: 380px; margin: 0 auto; padding: 12px; }
.tiktok iframe { width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: 16px; display: block; background: #000; }

/* Album polaroid */
.gallery { columns: 3 260px; column-gap: 20px; }
.photo {
    break-inside: avoid; margin-bottom: 22px; cursor: zoom-in;
    background: #fff; border-radius: 6px; padding: 10px 10px 14px;
    box-shadow: 0 12px 28px rgba(150, 30, 70, 0.2);
    opacity: 0; transform: translateY(24px) rotate(var(--tilt, 0deg));
    transition: transform 0.6s ease, opacity 0.6s ease, box-shadow 0.2s;
}
.photo.show { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
.photo:hover { transform: rotate(0deg) scale(1.03); box-shadow: 0 18px 40px rgba(150, 30, 70, 0.3); z-index: 2; position: relative; }
.photo img { width: 100%; display: block; border-radius: 3px; }
.photo figcaption { margin-top: 10px; text-align: center; font-family: 'Dancing Script', cursive; font-size: 21px; color: var(--rose); }

.family-photo { max-width: 520px; margin: 0 auto; padding: 14px; text-align: center; }
.family-photo img { width: 100%; border-radius: 16px; display: block; cursor: zoom-in; }
.family-photo figcaption { margin-top: 12px; font-family: 'Dancing Script', cursive; font-size: 24px; color: var(--rose); line-height: 1.4; }
.kids-note { text-align: center; font-size: 15px; font-weight: 700; color: #a52a50; max-width: 560px; margin: -8px auto 24px; line-height: 1.7; }

/* Sổ lưu bút */
.guestbook { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 760px) { .guestbook { grid-template-columns: 1fr; } }
.gb-form h3 { font-family: 'Dancing Script', cursive; font-size: 30px; color: var(--rose); margin-bottom: 10px; }
.gb-form input, .gb-form textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; outline: none;
    font-family: inherit; font-size: 14px; color: var(--rose-2); background: var(--soft); margin-bottom: 10px; resize: vertical;
}
.gb-form input:focus, .gb-form textarea:focus { border-color: var(--pink); }
.gb-form .btn { width: 100%; margin-top: 4px; }
.gb-note { font-size: 12px; color: #999; margin-top: 10px; line-height: 1.5; min-height: 18px; }
.gb-note.ok { color: #2a9d5c; font-weight: 700; }
.gb-note.err { color: var(--red); font-weight: 700; }
.gb-list { display: grid; gap: 14px; max-height: 620px; overflow-y: auto; padding: 4px; }
.gb-item { background: #fff; border-radius: 18px; padding: 16px 18px; border-left: 5px solid var(--pink); box-shadow: 0 8px 20px rgba(212, 63, 103, 0.12); animation: cardPop 0.4s ease both; }
.gb-item .who { font-weight: 700; color: var(--rose); font-size: 14px; }
.gb-item .when { font-size: 11px; color: #aaa; margin-left: 6px; font-weight: 600; }
.gb-item .msg { margin-top: 6px; color: var(--ink); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.gb-empty { text-align: center; color: #888; font-weight: 600; font-size: 14px; padding: 30px 10px; background: rgba(255, 255, 255, 0.7); border-radius: 18px; }

.gb-slot .gb-form { max-width: 520px; margin: 0 auto; }

/* Hộp thư bí mật (trang 4) */
.inbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; margin-bottom: 20px; }
.inbox-bar .btn { margin-top: 0; }
.inbox-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.inbox-tabs button {
    font-family: inherit; font-weight: 700; font-size: 13px; color: var(--rose-2); cursor: pointer;
    background: var(--soft); border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 14px;
}
.inbox-tabs button b { margin-left: 4px; background: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; }
.inbox-tabs button.active { background: linear-gradient(45deg, var(--pink), var(--red)); color: #fff; border-color: transparent; }
.inbox-tabs button.active b { color: var(--red); }
.inbox-list { display: grid; gap: 14px; max-width: 820px; margin: 0 auto; }
.gb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gb-head .tag { font-size: 11px; font-weight: 700; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; }
.gb-head .when { margin-left: 0; }
.gb-head .del { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.55; }
.gb-head .del:hover { opacity: 1; }

/* Lời chúc cuối */
.final { text-align: center; margin-top: 72px; }
.final h2 { font-family: 'Dancing Script', cursive; font-size: 40px; color: var(--rose); margin-bottom: 10px; }
.final p { font-size: 14px; color: #444; line-height: 1.8; font-weight: 600; }

/* XEM ẢNH LỚN */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(60, 10, 30, 0.88); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 16px; border: 3px solid var(--line); animation: cardPop 0.3s ease; }
.lightbox .cap { color: #fff; margin-top: 14px; font-weight: 700; text-align: center; }
.lb-btn { position: absolute; background: rgba(255, 255, 255, 0.9); color: var(--rose); border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; font-weight: 700; cursor: pointer; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* TRANG CHỜ */
.coming { max-width: 460px; margin: 40px auto 0; text-align: center; }
.coming .big { font-size: 56px; animation: bob 2s ease-in-out infinite; }
.coming h2 { font-family: 'Dancing Script', cursive; font-size: 38px; color: var(--rose); margin: 8px 0; }
.coming p { font-size: 14px; color: #555; line-height: 1.7; font-weight: 600; }

/* MÀN HÌNH CHÀO */
#welcome-screen { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; cursor: pointer; transition: opacity 0.5s ease, transform 0.5s ease; outline: none; }
#welcome-screen.leave { opacity: 0; transform: scale(1.08); }
.welcome { max-width: 640px; animation: cardPop 0.8s ease both; }
.welcome h1 { font-family: 'Dancing Script', cursive; font-size: clamp(38px, 8.5vw, 72px); line-height: 1.15; color: var(--rose); text-shadow: 0 4px 18px rgba(255, 255, 255, 0.9); }
.welcome p { font-size: 15px; font-weight: 700; color: #a52a50; min-height: 50px; line-height: 1.6; margin: 10px 0 26px; }
.tap-hint { margin-top: 26px; font-size: 14px; font-weight: 700; color: var(--rose); animation: pulseText 1.6s ease-in-out infinite; }
@keyframes pulseText { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

/* Phong thư */
.envelope { position: relative; width: 260px; height: 170px; margin: 0 auto; animation: wiggle 2.6s ease-in-out infinite; }
.env-back, .env-front, .env-flap { position: absolute; left: 0; width: 100%; }
.env-back { inset: 0; background: #ff8fa3; border-radius: 10px; box-shadow: 0 18px 40px rgba(200, 35, 82, 0.35); }
.env-front {
    bottom: 0; height: 100%; border-radius: 10px; z-index: 3;
    background:
        linear-gradient(to top right, #ff6b81 50%, transparent 50.5%) left / 50% 100% no-repeat,
        linear-gradient(to top left, #ff6b81 50%, transparent 50.5%) right / 50% 100% no-repeat;
}
.env-flap {
    top: 0; height: 60%; z-index: 4; transform-origin: top; transition: transform 0.6s ease, z-index 0s 0.3s;
    background: linear-gradient(to bottom, #ff4d6d, #ff7a90); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env-seal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; font-size: 34px; transition: opacity 0.3s; }
.env-letter {
    position: absolute; left: 14px; right: 14px; top: 14px; height: 140px; z-index: 2;
    background: #fffdfd; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transition: transform 0.7s ease 0.35s;
}
.env-letter span { font-size: 34px; }
.env-letter b { font-family: 'Dancing Script', cursive; font-size: 28px; color: var(--rose); }
.opening .envelope { animation: none; }
.opening .env-flap { transform: rotateX(180deg); z-index: 1; }
.opening .env-seal { opacity: 0; }
.env-letter > * { opacity: 0; transition: opacity 0.3s ease 0.5s; }
.opening .env-letter > * { opacity: 1; }
.opening .env-letter { transform: translateY(-70px); }
.opening .tap-hint { visibility: hidden; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); } 85% { transform: rotate(-3deg); } 90% { transform: rotate(2deg); } }

/* THIỆP LẬT (trang 2, 3) */
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.flip { perspective: 900px; height: 200px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform 0.7s cubic-bezier(0.3, 1.4, 0.5, 1); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; box-shadow: 0 12px 26px rgba(212, 63, 103, 0.2); }
.flip-front { background: linear-gradient(135deg, #ff8fa3, #ff6b81); color: #fff; border: 3px solid rgba(255, 255, 255, 0.7); }
.flip-front .em { font-size: 42px; }
.flip-front b { margin-top: 8px; font-size: 14px; }
.flip-front small { margin-top: 6px; font-size: 11px; opacity: 0.85; }
.flip-back { background: #fff; border: 2px solid var(--line); transform: rotateY(180deg); color: #6b2a3c; font-size: 14px; font-weight: 700; line-height: 1.6; }
.flip:hover .flip-inner { box-shadow: none; }
.flip:not(.flipped):hover .flip-front { transform: translateY(-3px); transition: transform 0.2s; }
.open-all { text-align: center; margin-bottom: 18px; }
.open-all .btn { margin-top: 0; background: #fff; color: var(--rose); border: 1.5px solid var(--line); box-shadow: none; }

/* TRÁI TIM + BÓ HOA */
.art-slot { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; max-width: 760px; margin: 0 auto; }
.art-item {
    background: rgba(255, 255, 255, 0.55); border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 28px;
    padding: 18px 16px 14px; text-align: center; cursor: pointer; backdrop-filter: blur(6px);
    box-shadow: 0 16px 34px rgba(212, 63, 103, 0.18); transition: transform 0.25s;
}
.art-item:hover { transform: translateY(-6px) rotate(-1deg); }
.art-item:active { transform: scale(0.97); }
.art-item svg { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.art-item p { margin-top: 8px; font-family: 'Dancing Script', cursive; font-size: 24px; color: var(--rose); }
.big-heart .beat { transform-origin: 150px 150px; animation: heartbeat 1.4s ease-in-out infinite; }
.heart-text { font-family: 'Dancing Script', cursive; font-size: 46px; font-weight: 700; fill: #fff; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.08); } 30% { transform: scale(0.98); } 45% { transform: scale(1.05); } }
.bouquet .sway { transform-origin: 160px 300px; animation: sway 4s ease-in-out infinite; }
.bouquet .bloom { transform-box: fill-box; transform-origin: center; animation: bloom 3s ease-in-out infinite; }
.bouquet .note, .bouquet .bottle, .bouquet .item { animation: bob-small 3s ease-in-out infinite; }
.bouquet .plane { animation: fly 3s ease-in-out infinite; }
@keyframes bob-small { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes fly { 0%, 100% { translate: 0 0; } 50% { translate: 6px -6px; } }
.bouquet .sparkles path { animation: twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bouquet .sparkles path:nth-child(2n) { animation-delay: 0.9s; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes bloom { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.2); } }

/* Dây treo trái tim */
.garland-slot { max-width: 900px; margin: 56px auto -20px; }
.garland { width: 100%; height: 90px; display: block; overflow: visible; }
.garland .swing { animation: swing 2.4s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

/* Trái tim bay khi bấm */
.burst-heart { position: fixed; z-index: 70; pointer-events: none; transform: translate(-50%, -50%); animation: burst 1.2s ease-out forwards; }
@keyframes burst {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(25deg); opacity: 0; }
}

/* BỐC THĂM (trang 3) */
.draw-box { text-align: center; max-width: 560px; margin: 0 auto; }
.draw-box .big { font-size: 54px; }
.draw-box .result { font-size: 18px; font-weight: 700; color: #6b2a3c; line-height: 1.7; min-height: 62px; margin-top: 10px; }
.draw-box .result.pop { animation: cardPop 0.45s ease; }

/* MÀN HÌNH MẬT KHẨU */
#lock-screen { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.love-card { max-width: 420px; width: 100%; text-align: center; animation: cardPop 0.5s ease both; }
.love-card .big { font-size: 48px; animation: bob 2s ease-in-out infinite; }
.love-card h3 { font-size: 22px; color: var(--rose); margin: 8px 0; }
.love-card .sub { font-size: 13px; color: #888; margin-bottom: 16px; line-height: 1.6; }
.love-card .hint { display: inline-block; font-size: 12px; font-weight: 700; color: var(--rose); background: var(--soft); border: 1.5px dashed var(--line); border-radius: 14px; padding: 6px 12px; margin: -4px 0 14px; }
.pass-input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 20px; outline: none; text-align: center; color: var(--rose-2); background: var(--soft); margin-bottom: 14px; font-family: inherit; font-size: 16px; }
.love-card .btn { width: 100%; margin-top: 0; }
.error-msg { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; font-weight: 700; }
.shake { animation: shake 0.4s; }

.page { display: none; }
.page.open { display: block; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cardPop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

@media (max-width: 520px) {
    .letter { padding: 30px 18px 26px 40px; }
    .letter::before { left: 24px; }
    .letter p { font-size: 21px; line-height: 36px; }
}
