/* =========================================================
   Nhà Đậu Đỗ · birthday.css — màn chào mừng sinh nhật
   Bảng màu "party" (Style Guide v2)
   ========================================================= */
.bd {
  --night: #2B2140; --deep: #1E1730; --plum: #43345F;
  --gold: #FFD27A; --pink: #FF9BB3; --pinkL: #FFE1E9; --cream: #FFF4E6;
  --mint: #9ED9C0; --skyP: #A8D4EE; --lav: #C9B6F0;
  position: fixed; inset: 0; z-index: 1000; color: var(--cream);
  font-family: var(--f-body); overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s;
}
.bd:focus { outline: none; }
.bd.is-open { opacity: 1; visibility: visible; transition: opacity .5s; }
body.bd-open { overflow: hidden; }
/* thuộc tính hidden luôn thắng các display: flex/grid bên dưới */
.bd [hidden] { display: none !important; }

.bd__bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, var(--plum) 0%, var(--night) 55%, var(--deep) 100%); transition: background .8s, opacity .8s; }
.bd.is-dim .bd__bg { background: rgba(30, 23, 48, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bd.is-dark .bd__bg { background: #0C0914; }
.bd__stars { position: absolute; inset: 0; pointer-events: none; transition: opacity .8s; }
.bd__stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 2.6s ease-in-out infinite; }
.bd.is-dim .bd__stars, .bd.is-dark .bd__stars { opacity: 0; }
@keyframes twinkle { 50% { opacity: .2; } }
.bd__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.bd__stage { position: absolute; inset: 0; z-index: 2; }

/* thanh trên cùng */
.bd__top { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.bd__brand { font: 700 18px/1 var(--f-head); opacity: .85; white-space: nowrap; }
.bd__dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.bd__dots li { width: 9px; height: 9px; border-radius: 99px; background: rgba(255, 244, 230, .25); transition: width .4s var(--ease-spring), background .3s; }
.bd__dots li.done { background: rgba(255, 210, 122, .6); }
.bd__dots li.on { width: 30px; background: var(--gold); }
.bd__tools { display: flex; gap: 8px; }
.bd__icon { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 244, 230, .12); color: var(--cream); font-size: 17px; transition: background .2s, transform .2s var(--ease-spring); }
.bd__icon:hover { background: rgba(255, 244, 230, .25); transform: scale(1.08); }

.bd__next { position: absolute; right: 24px; bottom: 24px; z-index: 6; border: 0; border-radius: 99px; padding: 15px 26px; background: var(--gold); color: var(--night); font: 800 17px/1 var(--f-body); box-shadow: 0 6px 0 #D9A845, 0 14px 30px rgba(0, 0, 0, .3); animation: next-in .5s var(--ease-spring); transition: transform .2s var(--ease-spring); }
.bd__next:hover { transform: translateY(-3px); }
@keyframes next-in { from { opacity: 0; transform: translateY(20px) scale(.9); } }

/* chữ & nút */
.bd-title { font: 800 clamp(40px, 7vw, 84px)/1.05 var(--f-head); margin: 0 0 12px; text-align: center; }
.bd-title span { color: var(--gold); }
.bd-title--xl { font-size: clamp(48px, 10vw, 128px); }
.bd-h2 { font: 800 clamp(26px, 4.4vw, 46px)/1.1 var(--f-head); margin: 0 0 8px; text-align: center; }
.bd-sub { font-size: clamp(15px, 2vw, 19px); opacity: .85; margin: 0 0 22px; text-align: center; }
.bd-sub b { color: var(--gold); }
.bd .hand { font-family: var(--f-hand); }
.bd-btn { border: 0; border-radius: 99px; padding: 15px 26px; background: var(--gold); color: var(--night); font: 800 17px/1 var(--f-body); box-shadow: 0 6px 0 #D9A845; transition: transform .2s var(--ease-spring); }
.bd-btn:hover { transform: translateY(-3px) scale(1.03); }
.bd-btn:active { transform: scale(.96); }
.bd-btn--big { font-size: 21px; padding: 20px 38px; animation: pulse 1.8s ease-in-out infinite; }
.bd-btn--ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px rgba(255, 244, 230, .5); }
@keyframes pulse { 50% { box-shadow: 0 6px 0 #D9A845, 0 0 0 14px rgba(255, 210, 122, .18); } }

/* cảnh */
.scene { position: absolute; inset: 0; padding: 84px 20px 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: scene-in .6s var(--ease-out) both; }
.scene.is-leaving { animation: scene-out .38s ease-in forwards; }
@keyframes scene-in { from { opacity: 0; transform: scale(.96); } }
@keyframes scene-out { to { opacity: 0; transform: scale(1.04); } }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.scene-head { position: relative; z-index: 3; }
.gone { opacity: 0 !important; transform: translateY(20px); transition: all .5s; pointer-events: none; }

/* 00 · hộp thư */
.bigmail { width: min(260px, 56vw); margin-bottom: 10px; overflow: visible; }
.bigmail * { transform-box: fill-box; }
.bigmail__env { animation: env-peek 1.6s var(--ease-spring) infinite alternate; }
@keyframes env-peek { from { transform: translateY(26px); } to { transform: translateY(-6px) rotate(-4deg); } }
.bigmail__flag { transform-origin: 50% 100%; animation: flag 1.2s ease-in-out infinite; }
@keyframes flag { 50% { transform: rotate(-8deg); } }

/* 01 · tắt đèn */
.mini-house { width: min(220px, 50vw); margin-bottom: 16px; }
.lw { fill: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 210, 122, .9)); transition: fill .3s, filter .3s; }
.lw.off { fill: #2B2140; filter: none; }
.hush { transition: opacity .6s; }
.bd.is-dark .hush { opacity: 0; }
.count { height: clamp(120px, 22vw, 200px); display: grid; place-items: center; }
.count span { font: 800 clamp(110px, 20vw, 190px)/1 var(--f-head); color: var(--gold); text-shadow: 0 0 40px rgba(255, 210, 122, .6); animation: count-pop .9s var(--ease-spring) both; }
@keyframes count-pop { 0% { transform: scale(.2); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.voice-line { font-size: 22px; animation: scene-in .5s both; }

/* 02 · thiệp */
.letter-hint { position: absolute; bottom: 34px; left: 0; right: 0; opacity: 0; transition: opacity .5s; }
.scene--2.lettered:not(.typed) .letter-hint { opacity: .7; }
.envelope { position: absolute; left: 50%; top: 52%; width: min(360px, 80vw); aspect-ratio: 3 / 2; transform: translate(-50%, -50%); perspective: 800px; transition: transform .9s var(--ease-out), opacity .6s; animation: env-in .8s var(--ease-spring) both; }
@keyframes env-in { from { transform: translate(-50%, 40vh) rotate(-10deg); } }
.envelope > div { position: absolute; inset: 0; border-radius: 12px; }
.envelope__back { background: #C8604A; }
.envelope__paper { inset: 10px 18px 20px !important; background: var(--cream); border-radius: 8px; transition: transform .8s var(--ease-out) .4s; }
.envelope__front { background: #E07A5F; clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); }
.envelope__flap { background: #D46B52; clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: top; transition: transform .6s ease-in-out; z-index: 2; }
.envelope__seal { inset: auto !important; left: 50% !important; top: 46% !important; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; background: var(--gold); color: #C8604A; border-radius: 50% !important; font-size: 24px; z-index: 3; transition: opacity .3s; }
.scene--2.opened .envelope__flap { transform: rotateX(180deg); z-index: 0; }
.scene--2.opened .envelope__seal { opacity: 0; }
.scene--2.opened .envelope__paper { transform: translateY(-55%); }
.scene--2.lettered .envelope { transform: translate(-50%, 70vh); opacity: 0; }
.letter {
  position: relative; z-index: 2; width: min(580px, 92vw); max-height: calc(100vh - 210px); overflow: auto;
  background: var(--cream) repeating-linear-gradient(transparent 0 33px, rgba(224, 122, 95, .15) 33px 34px);
  color: #3D405B; font-family: var(--f-hand); font-size: clamp(16px, 2vw, 19px); line-height: 34px;
  padding: 34px 40px 26px; border-radius: 10px; box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.5) rotate(-6deg); transition: opacity .5s, transform .8s var(--ease-spring); outline: none;
}
.scene--2.lettered .letter { opacity: 1; transform: rotate(-1deg); }
.letter p { margin: 0 0 12px; min-height: 34px; }
.letter__hi { font-weight: 600; color: #E07A5F; font-size: 1.15em; }
.letter__sign { white-space: pre-line; text-align: right; font-weight: 600; }
.letter__marks { display: flex; align-items: center; gap: 14px; opacity: 0; transform: scale(.6); transition: all .6s var(--ease-spring); }
.scene--2.typed .letter__marks { opacity: 1; transform: none; }
.letter__marks img { width: 70px; height: 70px; object-fit: cover; border-radius: 50%; transform: rotate(-10deg); }
.paw { font-size: 34px; transform: rotate(14deg); }
.stamp { margin-left: auto; width: 62px; height: 62px; display: grid; place-items: center; border: 3px dashed #E07A5F; border-radius: 50%; color: #E07A5F; font: 800 26px/1 var(--f-head); transform: rotate(12deg); }
.polas { position: absolute; inset: 0; pointer-events: none; }
.pola { position: absolute; width: clamp(130px, 13vw, 190px); margin: 0; background: #fff; padding: 9px 9px 6px; border-radius: 4px; box-shadow: 0 16px 36px rgba(0, 0, 0, .35); opacity: 0; transition: all .9s var(--ease-spring); }
.pola img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pola figcaption { font: 500 14px/1.4 var(--f-hand); color: #3D405B; text-align: center; padding-top: 6px; }
.pola--0 { left: 4vw; top: 20vh; transform: translateX(-40vw) rotate(-30deg); }
.pola--1 { left: 7vw; bottom: 14vh; transform: translateX(-40vw) rotate(20deg); transition-delay: .15s; }
.pola--2 { right: 5vw; top: 30vh; transform: translateX(40vw) rotate(30deg); transition-delay: .3s; }
.scene--2.lettered .pola { opacity: 1; }
.scene--2.lettered .pola--0 { transform: rotate(-8deg); }
.scene--2.lettered .pola--1 { transform: rotate(6deg); }
.scene--2.lettered .pola--2 { transform: rotate(7deg); }

/* 03 · bóng bay */
.scene--3 { justify-content: flex-start; }
.sky { position: absolute; inset: 0; z-index: 2; }
.balloon { --w: clamp(58px, 10vmin, 96px); position: absolute; width: var(--w); padding: 0; border: 0; background: none; cursor: crosshair; touch-action: manipulation; }
.balloon__body { position: relative; display: grid; place-items: center; width: var(--w); height: calc(var(--w) * 1.22); border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85) 0 7%, transparent 8%), radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%); box-shadow: inset -8px -10px 0 rgba(0, 0, 0, .08); transition: transform .2s, opacity .2s; }
.balloon__body::after { content: ""; position: absolute; bottom: -7px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 9px solid var(--c); transform: rotate(180deg); }
.balloon__body b { font: 800 calc(var(--w) * .46)/1 var(--f-head); color: var(--night); }
.balloon__str { display: block; width: 2px; height: calc(var(--w) * .9); margin: 6px auto 0; background: rgba(255, 244, 230, .5); border-radius: 2px; transform-origin: top; animation: str 2s ease-in-out infinite; }
@keyframes str { 50% { transform: rotate(8deg); } }
.balloon.is-pop .balloon__body { transform: scale(1.5); opacity: 0; }
.balloon.is-pop .balloon__str { opacity: 0; }
.balloon--word { top: 30%; margin-left: calc(var(--w) / -2); animation: word-in 1.4s var(--ease-out) both, bob 3s ease-in-out infinite; }
@keyframes word-in { from { transform: translateY(80vh); } }
@keyframes bob { 50% { transform: translateY(-14px) rotate(2deg); } }
.balloon--float { bottom: -200px; transform: scale(var(--s)); animation: rise var(--d) linear forwards; }
.balloon--float .balloon__body { animation: sway 3s ease-in-out infinite; }
@keyframes rise { to { transform: translateY(calc(-100vh - 260px)) scale(var(--s)); } }
@keyframes sway { 50% { transform: translateX(16px) rotate(4deg); } }
.reason { position: absolute; z-index: 4; left: 50%; bottom: 96px; width: min(520px, 88vw); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: var(--cream); color: #3D405B; padding: 16px 22px; border-radius: 22px; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); pointer-events: none; }
.reason.in { animation: reason-in .5s var(--ease-spring); }
@keyframes reason-in { from { transform: translateX(-50%) scale(.6) translateY(30px); opacity: 0; } }
.reason__n { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); font: 800 20px/1 var(--f-head); }
.reason__t { margin: 0; font: 500 clamp(16px, 2.2vw, 20px)/1.4 var(--f-hand); }

/* 04-05 · bánh kem */
.cake-wrap { position: relative; display: flex; flex-direction: column; align-items: center; transition: opacity .5s; }
.cake-wrap--big { transform: scale(1.12); margin: 30px 0 40px; }
.hats { display: flex; gap: clamp(16px, 4vw, 40px); margin-bottom: 20px; }
.hats figure { margin: 0; position: relative; text-align: center; animation: bob 2.4s ease-in-out infinite; }
.hats figure:nth-child(2) { animation-delay: .4s; } .hats figure:nth-child(3) { animation-delay: .8s; }
.hats img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 3px solid var(--cream); }
.hats figcaption { font-weight: 800; font-size: 14px; margin-top: 4px; }
.hat { position: absolute; left: 50%; top: -34px; width: 36px; height: 42px; margin-left: -18px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: repeating-linear-gradient(-45deg, var(--pink) 0 7px, var(--gold) 7px 14px); transform: rotate(-10deg); }
.hat::before { content: ""; position: absolute; }
.hat--2 { background: repeating-linear-gradient(-45deg, var(--mint) 0 7px, var(--cream) 7px 14px); transform: rotate(8deg); }
.hat--3 { background: repeating-linear-gradient(-45deg, var(--lav) 0 7px, var(--skyP) 7px 14px); }
.cake { --lean: 0; position: relative; width: clamp(220px, 30vw, 300px); display: flex; flex-direction: column; align-items: center; }
.cake__candles { display: flex; gap: 8px; margin-bottom: -16px; position: relative; z-index: 2; }
.candle { position: relative; text-align: center; }
.candle b { display: block; font: 800 96px/1 var(--f-head); background: repeating-linear-gradient(-30deg, var(--pinkL) 0 10px, var(--pink) 10px 20px); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 3px #fff; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .15)); }
.candle--2 b { background: repeating-linear-gradient(-30deg, #DFF5EC 0 10px, var(--mint) 10px 20px); -webkit-background-clip: text; background-clip: text; }
.candle::before { content: ""; position: absolute; left: 50%; top: 2px; width: 3px; height: 12px; margin-left: -1.5px; background: #3D405B; border-radius: 2px; }
.flame { position: absolute; left: 50%; top: -40px; width: 22px; height: 38px; margin-left: -11px; transform-origin: 50% 100%; transform: skewX(calc(var(--lean) * -28deg)) scaleY(calc(1 - var(--lean) * .45)) translateX(calc(var(--lean) * 6px)); transition: transform .12s, opacity .4s; }
.flame i { position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 50% 75%, #fff 0 18%, #FFE08A 35%, #FFA94D 70%, rgba(255, 120, 60, 0) 72%); animation: flicker .18s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.flame::after { content: ""; position: absolute; inset: -30px -40px; border-radius: 50%; background: radial-gradient(rgba(255, 210, 122, .45), transparent 65%); filter: blur(6px); }
@keyframes flicker { to { transform: scale(.92, 1.06) rotate(2deg); } }
.tier { position: relative; border-radius: 18px 18px 10px 10px; overflow: hidden; }
.tier--top { width: 70%; height: 70px; background: var(--pink); z-index: 1; }
.tier--bot { width: 100%; height: 104px; background: var(--cream); margin-top: -4px; display: grid; place-items: center; }
.drip { position: absolute; left: 0; right: 0; top: 0; height: 26px; background: radial-gradient(circle at 12px 0, #fff 0 13px, transparent 14px) repeat-x; background-size: 24px 26px; }
.tier--bot .drip { background-image: radial-gradient(circle at 12px 0, var(--pink) 0 13px, transparent 14px); }
.berries { position: absolute; top: 4px; left: 8%; right: 8%; display: flex; justify-content: space-between; }
.berries i { width: 14px; height: 14px; border-radius: 50%; background: #E0465F; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .15); }
.dots { position: absolute; inset: 36px 10px 10px; background: radial-gradient(circle, var(--lav) 0 3px, transparent 4px) 0 0 / 22px 22px; opacity: .6; }
.cake__name { position: relative; margin-top: 18px; font: 600 22px/1 var(--f-hand); color: #E07A5F; }
.plate { width: 124%; height: 20px; margin-top: -4px; border-radius: 50%; background: var(--skyP); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.lyrics { margin-top: 26px; text-align: center; font: 700 clamp(18px, 2.6vw, 26px)/1.5 var(--f-head); transition: opacity .5s; }
.lyrics p { margin: 0; opacity: .35; transition: opacity .3s; }
.lyrics p.on { opacity: 1; }
.lyrics span { display: inline-block; transition: color .2s, transform .2s var(--ease-spring); }
.lyrics span.sung { color: var(--gold); }
.lyrics span.now { color: var(--pink); transform: scale(1.2) translateY(-3px); }
.wish { position: absolute; bottom: 110px; left: 0; right: 0; text-align: center; animation: scene-in .6s both; }
.wish__dots { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
.wish__dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gold); transition: background .3s; }
.wish__dots i.on { background: var(--gold); }
.smokes { position: absolute; top: -40px; left: 50%; display: flex; gap: 56px; transform: translateX(-50%); }
.smokes i { width: 14px; height: 40px; border-radius: 10px; background: rgba(230, 230, 240, .7); filter: blur(5px); opacity: 0; }
.blown .flame { transform: scale(0); opacity: 0; }
.blown .smokes i { animation: smoke-up 2s ease-out forwards; }
.blown .smokes i:nth-child(2) { animation-delay: .2s; } .blown .smokes i:nth-child(3) { animation-delay: .4s; }
@keyframes smoke-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-120px) translateX(20px) scale(1.8); } }
.blow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.meter { width: 200px; height: 14px; border-radius: 99px; background: rgba(255, 244, 230, .15); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--gold), var(--pink)); transform: scaleX(0); transform-origin: left; transition: transform .08s; }
.hold-btn { --p: 0; position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold-ring { position: absolute; inset: 0; background: rgba(255, 210, 122, .45); transform: scaleX(var(--p)); transform-origin: left; z-index: -1; }

/* 06 · pháo hoa */
.bd-title--xl span { display: inline-block; animation: letter-in .7s var(--ease-spring) both, wobble 2.4s ease-in-out 1.2s infinite; }
.bd-title--xl span:nth-child(3n) { color: var(--gold); }
.bd-title--xl span:nth-child(3n+1) { color: var(--pink); }
@keyframes letter-in { from { transform: translateY(-120px) scale(.3); opacity: 0; } }
@keyframes wobble { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* 07 · hộp quà */
.gift { position: relative; width: 230px; height: 250px; border: 0; background: none; padding: 0; margin: 30px 0 26px; outline-offset: 10px; }
.gift__box { position: absolute; left: 15px; right: 15px; bottom: 0; height: 160px; border-radius: 10px; background: linear-gradient(90deg, transparent 43%, var(--gold) 43% 57%, transparent 57%), var(--pink); box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .08); }
.gift__lid { position: absolute; left: 0; right: 0; bottom: 152px; height: 48px; border-radius: 10px; background: linear-gradient(90deg, transparent 43%, var(--gold) 43% 57%, transparent 57%), #FF85A2; z-index: 2; transition: transform .7s var(--ease-out), opacity .7s; }
.gift__bow { position: absolute; left: 50%; bottom: 44px; width: 0; }
.gift__bow i { position: absolute; bottom: 0; width: 54px; height: 38px; border: 10px solid var(--gold); border-radius: 50%; }
.gift__bow i:first-child { right: 0; transform: rotate(20deg); transform-origin: right bottom; }
.gift__bow i:last-child { left: 0; transform: rotate(-20deg); transform-origin: left bottom; }
.gift__tag { position: absolute; right: -96px; top: 120px; background: var(--cream); color: #3D405B; font: 600 13px/1.35 var(--f-hand); padding: 8px 12px; border-radius: 6px; transform: rotate(10deg); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.gift__rays { position: absolute; left: 50%; top: 55%; width: 600px; height: 600px; margin: -300px 0 0 -300px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 210, 122, .35) 0 10deg, transparent 10deg 20deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); opacity: 0; transform: scale(.3); transition: all .8s var(--ease-out); z-index: -1; }
.gift.shake-1 { animation: shake .4s; }
.gift.shake-2 { animation: shake2 .5s; }
.gift.shake-3 { animation: shake3 .5s; }
@keyframes shake { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes shake2 { 20% { transform: rotate(-8deg) scale(1.04); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(6deg); } }
@keyframes shake3 { 10%, 50%, 90% { transform: rotate(-12deg) scale(1.08); } 30%, 70% { transform: rotate(12deg) scale(1.08); } }
.gift.open .gift__lid { transform: translateY(-260px) rotate(-28deg); opacity: 0; }
.gift.open .gift__rays { opacity: 1; transform: scale(1) rotate(30deg); animation: spin 12s linear infinite; }
.taps { display: flex; gap: 10px; }
.taps i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gold); transition: background .2s, transform .3s var(--ease-spring); }
.taps i.on { background: var(--gold); transform: scale(1.2); }

/* 08 · video */
.vbox-bottom { position: absolute; left: 50%; bottom: -60px; width: 320px; height: 100px; margin-left: -160px; border-radius: 14px 14px 0 0; background: linear-gradient(90deg, transparent 43%, var(--gold) 43% 57%, transparent 57%), var(--pink); box-shadow: 0 -40px 80px rgba(255, 210, 122, .45); }
.vframe { position: relative; z-index: 2; width: min(880px, 94vw); display: flex; flex-direction: column; align-items: center; animation: from-box 1.1s var(--ease-spring) both; }
@keyframes from-box { from { transform: translateY(55vh) scale(.15); opacity: 0; } 30% { opacity: 1; } }
.vframe header { margin-bottom: 8px; }
.vframe__screen { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 320px); background: #000; border-radius: 20px; overflow: hidden; border: 6px solid var(--cream); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.vframe__screen video, .vframe__screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.vframe__missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; background: linear-gradient(135deg, var(--plum), var(--night)); }
.vframe__missing span { font-size: 56px; }
.vframe__missing b { font: 800 24px/1.2 var(--f-head); }
.vframe__missing small { opacity: .75; line-height: 1.6; }
.vframe__missing code { background: rgba(255, 255, 255, .12); padding: 2px 6px; border-radius: 6px; }
.heart-btn { margin-top: 18px; }
.float-heart { position: fixed; z-index: 7; font-size: 28px; pointer-events: none; animation: heart-up 2s ease-out forwards; }
@keyframes heart-up { to { transform: translateY(-260px) translateX(30px) scale(1.4); opacity: 0; } }

/* 09 · phiếu quà */
.coupons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 36px; width: min(760px, 94vw); margin-top: 6px; }
.coupon { position: relative; height: 158px; border-radius: 18px; background: var(--cream); color: #3D405B; animation: scene-in .6s var(--ease-spring) both; animation-delay: calc(var(--i) * .12s); }
.coupon::before, .coupon::after { content: ""; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: var(--night); z-index: 2; }
.coupon::before { left: -13px; } .coupon::after { right: -13px; }
.coupon__in { position: absolute; inset: 10px; border: 2px dashed #E07A5F; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 18px; }
.coupon__ico { font-size: 30px; line-height: 1; }
.coupon__in b { font: 800 19px/1.2 var(--f-head); margin-top: 4px; }
.coupon__in small { font-size: 13px; color: #7A7D96; }
.coupon__in em { font: 500 12px/1 var(--f-hand); color: #E07A5F; margin-top: 4px; font-style: normal; }
.coupon__scratch { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 18px; cursor: grab; touch-action: none; transition: opacity .6s; z-index: 1; }
.coupon.open .coupon__scratch { opacity: 0; pointer-events: none; }
.coupon.open .coupon__in { animation: bob .6s var(--ease-spring); }

/* 10 · vào nhà */
.door-scene { display: flex; flex-direction: column; align-items: center; gap: 26px; transition: transform 1.4s ease-in .6s, opacity 1s ease-in .9s; }
.door { position: relative; width: 220px; height: 320px; border-radius: 110px 110px 12px 12px; overflow: hidden; perspective: 900px; background: radial-gradient(circle at 50% 60%, #FFF4C8, var(--gold) 60%, #F2B95A); box-shadow: 0 0 0 10px #A0705A, 0 30px 80px rgba(255, 210, 122, .35); }
.door__light { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; }
.door__l, .door__r { position: absolute; top: 0; bottom: 0; width: 50%; background: #81B29A; transition: transform 1.1s var(--ease-out); }
.door__l { left: 0; transform-origin: left; box-shadow: inset -3px 0 0 rgba(0, 0, 0, .15); }
.door__r { right: 0; transform-origin: right; }
.door__l::after { content: ""; position: absolute; right: 12px; top: 55%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.scene--10.opening .door__l { transform: rotateY(-105deg); }
.scene--10.opening .door__r { transform: rotateY(105deg); }
.scene--10.opening .door-scene { transform: scale(4); opacity: 0; }

/* =========================================================
   TRANG CHỦ · CHẾ ĐỘ TIỆC
   ========================================================= */
.party-banner { position: relative; z-index: 45; text-align: center; padding: 10px 16px; font-weight: 800; font-size: 15px; color: #3D405B; background: linear-gradient(90deg, #FFE1E9, #FCF1DC, #E4F0E8, #EAF4FA, #FFE1E9); background-size: 200% 100%; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 200% 0; } }
.bunting { position: absolute; top: 0; left: 0; width: 100%; height: 90px; z-index: 3; pointer-events: none; }
.bunting path:not(:first-child) { transform-box: fill-box; transform-origin: 50% 0; animation: flag-swing 2.4s ease-in-out infinite; }
@keyframes flag-swing { 50% { transform: rotate(6deg); } }
.party-balloons { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.party-balloons span { position: absolute; bottom: 14%; width: 46px; height: 56px; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .8) 0 8%, transparent 9%), var(--c); animation: bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
.party-balloons span::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1.5px; height: 70px; background: rgba(61, 64, 91, .35); }
.party-balloons span:nth-child(1) { left: 1%; top: 28%; bottom: auto; } .party-balloons span:nth-child(2) { left: 3.5%; top: 40%; bottom: auto; }
.party-balloons span:nth-child(3) { display: none; } .party-balloons span:nth-child(4) { right: 2%; bottom: 34%; }
.party-balloons span:nth-child(5) { right: 5%; bottom: 22%; } .party-balloons span:nth-child(6) { right: 1.5%; bottom: 12%; }
.party .member__photo::before { content: ""; position: absolute; left: 50%; top: -30px; width: 40px; height: 48px; margin-left: -20px; z-index: 2; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: repeating-linear-gradient(-45deg, #E07A5F 0 7px, #F2CC8F 7px 14px); transform: rotate(-12deg); }
.party #thanh-vien-me .member__photo::after { content: "👑"; position: absolute; right: -6px; top: -6px; font-size: 30px; }
.party-replay { position: fixed; left: 20px; bottom: 20px; z-index: 40; border: 0; border-radius: 99px; padding: 13px 20px; background: #2B2140; color: #FFD27A; font: 800 15px/1 var(--f-body); box-shadow: 0 10px 30px rgba(43, 33, 64, .35); animation: next-in .6s var(--ease-spring), pulse-dark 2.4s ease-in-out 1s infinite; }
.party-replay:hover { transform: translateY(-3px); }
@keyframes pulse-dark { 50% { box-shadow: 0 10px 30px rgba(43, 33, 64, .35), 0 0 0 10px rgba(255, 210, 122, .25); } }
.page-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 900px) {
  .polas { display: none; }
}
@media (max-width: 640px) {
  .bd__brand { display: none; }
  .bd__top { padding: 12px; }
  .bd__dots { gap: 4px; }
  .bd__dots li { width: 7px; height: 7px; }
  .bd__dots li.on { width: 20px; }
  .bd__next { right: 50%; transform: translateX(50%); bottom: 18px; white-space: nowrap; }
  .bd__next:hover { transform: translateX(50%) translateY(-3px); }
  .scene { padding: 70px 14px 90px; }
  .letter { padding: 24px 22px 18px; }
  .coupons { grid-template-columns: 1fr; gap: 12px; max-height: calc(100vh - 260px); overflow: auto; padding: 4px 14px; }
  .coupon { height: 130px; flex: none; }
  .gift__tag { right: -40px; top: 210px; }
  .candle b { font-size: 76px; }
  .reason { bottom: 84px; }
  .party-balloons span:nth-child(-n+3), .party-balloons span:nth-child(6) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .balloon--float { animation-duration: 20s !important; animation-iteration-count: 1 !important; }
}
