/* Thiệp cưới Quang Thắng & Ngọc Ánh — giấy ngọc trai, nhũ vàng, hoa khô ép */

:root {
  --giay: #EEF0F3;
  --giay-sang: #F8F9FA;
  --bia: #E2DBD0;
  --ban: #CFC5B6;
  --muc: #3B3536;
  --muc-nhat: #675E60;
  --but: #2C3A5E;
  --nhu: #A9844E;
  --nhu-dam: #7E5F33;
  --tim: #B8433C;
  --canh: #8C7B5A;

  --chu-tha: 'Ephesis', 'Segoe Script', cursive;
  --chu-in: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --dai-nhu: linear-gradient(100deg, #7A5A2E 0%, #A9844E 11%, #E6CE96 21%, #B8935A 31%, #7E5F33 43%, #9E7A45 55%, #F2E2B5 65%, #C29C62 76%, #8A6A3B 88%, #7A5A2E 100%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .27 0 0 0 0 .22 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ban) var(--noise);
  color: var(--muc);
  font: 400 19px/1.6 var(--chu-in);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.dong { overflow: hidden; height: 100svh; }
body.dong:not(.dang-mo) .thiep { visibility: hidden; }

.an-di {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--but); outline-offset: 3px; }

#hat { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 25; pointer-events: none; }
#man-dem {
  position: fixed; inset: 0; z-index: 24; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(34, 25, 20, .84), rgba(10, 8, 7, .94));
  transition: opacity 1.1s ease;
}
body.phao-hoa #man-dem { opacity: 1; }
#loe {
  position: fixed; inset: 0; z-index: 23; pointer-events: none; opacity: 0;
  background: radial-gradient(55% 45% at 50% 50%, rgba(255, 251, 238, .98), rgba(255, 238, 200, .65) 42%, rgba(255, 238, 200, 0) 78%);
}
body.loe-sang #loe { animation: loe 1.5s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes loe { 0% { opacity: 0; } 22% { opacity: .92; } 100% { opacity: 0; } }

/* ---------- Chữ nhũ vàng và hiệu ứng viết tay ---------- */
.chu-nhu {
  display: inline-block;
  padding: .14em .34em .22em;
  background: var(--dai-nhu);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 .5px 0 rgba(255, 255, 255, .6)) drop-shadow(0 1px 1px rgba(90, 60, 25, .22));
  animation: anh-nhu 9s linear infinite;
}
.chu-nhu-in {
  background: var(--dai-nhu);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: anh-nhu 9s linear infinite;
}
@keyframes anh-nhu { to { background-position: 200% 0; } }

[data-viet], .ten-viet {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 52%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 52%);
  -webkit-mask-size: 240% 100%;
  mask-size: 240% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}
.viet { animation: viet var(--tv, 1.5s) cubic-bezier(.5, .1, .45, 1) forwards; }
.chu-nhu.viet { animation: viet var(--tv, 1.5s) cubic-bezier(.5, .1, .45, 1) forwards, anh-nhu 9s linear infinite; }
.viet-xong { -webkit-mask-position: 0 0; mask-position: 0 0; }
@keyframes viet { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* ---------- Hoa khô mọc ---------- */
.hoa-kho { display: block; width: 100%; height: 100%; overflow: visible; }
.hoa-kho .canh, .hoa-kho .day { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hoa-kho .la, .hoa-kho .bong { transform: scale(0); opacity: 0; }
.moc-hoa .hoa-kho .canh { animation: ve-net var(--dt, 1.2s) var(--dl, 0s) cubic-bezier(.45, .05, .3, 1) forwards; }
.moc-hoa .hoa-kho .day { animation: ve-net 1s var(--dl, 0s) ease-out forwards; }
.moc-hoa .hoa-kho .la { animation: no-la .8s var(--dl, 0s) cubic-bezier(.2, .9, .3, 1.25) forwards; }
.moc-hoa .hoa-kho .bong { animation: no-bong 1s var(--dl, 0s) cubic-bezier(.2, .9, .25, 1.35) forwards; }
@keyframes ve-net { to { stroke-dashoffset: 0; } }
@keyframes no-la { from { transform: scale(0) rotate(-25deg); opacity: 0; } 40% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes no-bong { from { transform: scale(0) rotate(-50deg); opacity: 0; } 50% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes lay-gio { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.8deg); } }

/* ---------- Bìa: hai cánh cửa ---------- */
.bia {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  perspective: 1700px;
}
.bia-ban {
  position: absolute; inset: 0;
  background: radial-gradient(130% 100% at 50% 32%, #ECE6DD 0%, #D4CABC 55%, #B5A998 100%);
  transition: opacity .9s ease .25s;
}
.bia-ban::after { content: ""; position: absolute; inset: 0; background: var(--noise); }
.bia-the {
  position: relative;
  width: min(90vw, 440px);
  height: min(88svh, 760px);
  transform-style: preserve-3d;
}
.bia-the::before {
  content: ""; position: absolute; inset: 0; border-radius: 3px;
  box-shadow: 0 2px 3px rgba(60, 45, 30, .18), 0 34px 70px -24px rgba(60, 45, 30, .55);
  transition: opacity .6s;
}
.bia-the::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; z-index: 3;
  background: linear-gradient(90deg, rgba(90, 70, 50, .2), rgba(255, 255, 255, .6));
  transition: opacity .3s;
}
.anh-trong {
  position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(30% 70% at 50% 50%, #FFFBEF 0%, rgba(255, 246, 222, .85) 40%, rgba(255, 246, 222, 0) 100%);
}
.cua {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1;
  transform-style: preserve-3d;
  transition: transform 1.8s cubic-bezier(.6, .02, .2, 1) .28s;
}
.cua-trai { left: 0; transform-origin: 0 50%; }
.cua-phai { right: 0; transform-origin: 100% 50%; }
.mat-ngoai, .mat-trong {
  position: absolute; inset: 0; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--bia) var(--noise);
}
.mat-ngoai::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(40, 30, 20, .0), rgba(40, 30, 20, .35));
  transition: opacity 1.2s .4s;
}
.cua-phai .mat-ngoai::after { background: linear-gradient(270deg, rgba(40, 30, 20, .0), rgba(40, 30, 20, .35)); }
.cua-trai .mat-ngoai { border-radius: 3px 0 0 3px; }
.cua-phai .mat-ngoai { border-radius: 0 3px 3px 0; }
.mat-trong {
  transform: rotateY(180deg);
  background-color: #E9E3D9;
}
.cua-trai .mat-trong { box-shadow: inset 18px 0 30px -18px rgba(70, 55, 40, .3); }
.cua-phai .mat-trong { box-shadow: inset -18px 0 30px -18px rgba(70, 55, 40, .3); }

.ruot {
  position: absolute; top: 0; bottom: 0; width: 200%;
  display: flex; flex-direction: column; align-items: center;
  padding: 7% 7% 188px;
  text-align: center;
}
.cua-trai .ruot { left: 0; }
.cua-phai .ruot { left: -100%; }
.lop-chinh { left: 0; width: 100%; z-index: 2; }
.lop-chinh .bia-hoa { visibility: hidden; }
.lop-chinh .bia-tieu, .lop-chinh .bia-kinh-moi { color: transparent; }
.lop-chinh .dong-cham { border-bottom-color: transparent; }
.cua .ten-viet { visibility: hidden; }

/* Ánh ngọc trai lướt qua bìa */
.lop-chinh::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .5) 47%, rgba(214, 224, 242, .35) 51%, rgba(255, 232, 214, .3) 55%, transparent 64%);
  background-size: 300% 100%;
  background-position: 120% 0;
  mix-blend-mode: soft-light;
  animation: ngoc-trai 7s ease-in-out 1.5s infinite;
}
@keyframes ngoc-trai { 0% { background-position: 120% 0; } 45%, 100% { background-position: -20% 0; } }

.bia-hoa { flex: 1 1 0; min-height: 110px; width: 94%; max-width: 380px; }
.bia-hoa .hoa-kho { width: 100%; height: 100%; }
.bia-tieu {
  margin: 2% 0 0;
  font: 400 clamp(58px, 17vw, 84px)/1.15 var(--chu-tha);
  color: var(--muc);
}
.bia-kinh-moi {
  margin: 5% 0 0;
  font: 500 14px/1.2 var(--chu-in);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muc-nhat);
}
.dong-cham {
  position: relative;
  width: 92%;
  height: 70px;
  margin-top: 4px;
  display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1.5px dotted rgba(59, 53, 54, .55);
}
.ten-viet {
  display: inline-block;
  padding: 0 .3em;
  font: 400 40px/1.35 var(--chu-tha);
  color: var(--but);
  white-space: nowrap;
}
.o-nhap { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.o-nhap input {
  width: 100%;
  border: 0; border-radius: 0; background: transparent;
  font: 400 30px/1.4 var(--chu-tha);
  color: var(--but);
  text-align: center;
  padding: 0 4px 2px;
  outline: none;
}
.o-nhap input::placeholder { font: italic 400 17px/1.4 var(--chu-in); color: #8A8082; }
.o-nhap input:focus-visible { box-shadow: 0 1.5px 0 var(--but); }
.goi-y {
  position: absolute; left: 0; right: 0; top: 100%; margin: 6px 0 0;
  font: italic 15px/1.3 var(--chu-in); color: var(--muc-nhat);
}
.loi-chao { font-size: 16.5px; color: var(--muc); }

/* Dấu niêm nhũ vàng */
.dau-niem {
  position: absolute; left: 50%; bottom: 46px; z-index: 4;
  width: 104px; height: 104px; margin-left: -52px;
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  animation: tho 2.8s ease-in-out infinite;
}
.dau-niem::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 190, .75), rgba(255, 236, 190, 0));
  animation: hao-quang 2.8s ease-in-out infinite;
}
.niem { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; transition: transform .8s cubic-bezier(.3, 0, .55, 1), opacity .8s; }
.niem-trai { left: 0; }
.niem-phai { right: 0; }
.niem-mat { position: absolute; top: 0; width: 200%; height: 100%; }
.niem-trai .niem-mat { left: 0; }
.niem-phai .niem-mat { left: -100%; }
.niem-mat svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(70, 45, 15, .35)); }
.niem-chu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 8px; white-space: nowrap;
  font: italic 500 16px/1.2 var(--chu-in); color: var(--muc-nhat);
  transition: opacity .3s;
}
.niem-sang { animation: niem-sang 3.6s ease-in-out 1s infinite; }
@keyframes niem-sang { 0% { transform: translateX(0) rotate(18deg); } 55%, 100% { transform: translateX(210px) rotate(18deg); } }
@keyframes tho { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes hao-quang { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: .9; transform: scale(1.08); } }
.dau-niem:active { transform: scale(.94); }
.dau-niem:focus-visible { outline-offset: 6px; }
.lac-the { animation: lac-the .42s ease; }
@keyframes lac-the { 20% { transform: rotate(-1.2deg); } 45% { transform: rotate(1deg); } 70% { transform: rotate(-.5deg); } }

/* Mở thiệp */
body.dang-mo .cua { opacity: 0; transition: transform 1.8s cubic-bezier(.6, .02, .2, 1) .28s, opacity .5s ease 1.3s; }
body.dang-mo .cua-trai { transform: rotateY(-168deg); }
body.dang-mo .cua-phai { transform: rotateY(168deg); }
body.dang-mo .mat-ngoai::after { opacity: 1; }
body.dang-mo .lop-chinh { opacity: 0; transition: opacity .2s; }
body.dang-mo .cua .ten-viet { visibility: visible; -webkit-mask-position: 0 0; mask-position: 0 0; }
body.dang-mo .bia-ban { opacity: 0; }
body.dang-mo .bia-the::before, body.dang-mo .bia-the::after { opacity: 0; }
body.dang-mo .anh-trong { animation: anh-trong 1.6s ease-out .2s forwards; }
body.dang-mo .dau-niem { animation: none; pointer-events: none; }
body.dang-mo .dau-niem::before { animation: none; opacity: 0; transition: opacity .3s; }
body.dang-mo .niem-trai { transform: translate(-46px, 70px) rotate(-38deg); opacity: 0; }
body.dang-mo .niem-phai { transform: translate(46px, 70px) rotate(38deg); opacity: 0; }
body.dang-mo .niem-chu { opacity: 0; }
@keyframes anh-trong { 0% { opacity: 0; transform: scaleX(.05); } 30% { opacity: 1; transform: scaleX(.5); } 100% { opacity: 0; transform: scaleX(1.6); } }
body.mo .bia { visibility: hidden; pointer-events: none; }
/* Gập thiệp lại sau khi xác nhận (trình duyệt không cho đóng trang) */
body.dang-dong .cua { transition: transform 1.5s cubic-bezier(.45, 0, .25, 1), opacity .3s; }
body.dang-dong .cua .ten-viet { visibility: visible; -webkit-mask-position: 0 0; mask-position: 0 0; }
body.dang-dong .lop-chinh { opacity: 0; }
body.dang-dong .niem { transition-delay: 1.1s; }
body.dang-dong .niem-chu { opacity: 0; }
.lop-chinh { transition: opacity .6s; }

/* ---------- Thân thiệp ---------- */
.thiep {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  background: var(--giay) var(--noise);
  overflow: hidden;
}
@media (min-width: 640px) {
  .thiep { margin: 28px auto; box-shadow: 0 2px 4px rgba(60, 45, 30, .12), 0 40px 80px -30px rgba(60, 45, 30, .45); }
}
.thiep section, .thiep footer { position: relative; }

.tieu-de {
  margin: 0 0 18px;
  font: 400 clamp(46px, 13vw, 62px)/1.2 var(--chu-tha);
  color: var(--nhu-dam);
  text-align: center;
}

/* Mở đầu */
.mo-dau {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 18px 64px;
}
.hoa-dau {
  position: relative; flex: none; align-self: flex-end;
  margin: -18px -64px -24px 0;
  width: min(122%, 680px, 60svh); aspect-ratio: 620 / 470;
  will-change: transform;
}
.hoa-dau .hoa-kho { transform-origin: 100% 100%; animation: lay-gio 9s ease-in-out infinite; }
.cap-doi { position: relative; width: 100%; max-width: 540px; margin-top: auto; }

/* Ảnh cưới mở đầu: tan dần vào giấy, phóng chậm như cảnh phim */
.anh-dau {
  position: absolute; left: 0; right: 0; top: 0; height: 78%; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 50%, rgba(0, 0, 0, .6) 72%, transparent 100%);
  mask-image: linear-gradient(#000 50%, rgba(0, 0, 0, .6) 72%, transparent 100%);
  background: center 12% / cover no-repeat;
}
.anh-dau img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 12%;
  opacity: 0; transform: scale(1.16);
  transition: opacity 1.8s ease, transform 18s cubic-bezier(.15, .6, .25, 1);
}
.chay-anh .anh-dau img.da-tai { opacity: 1; transform: scale(1.02); }
/* Màn thấp (máy tính): kéo phần mở đầu cao hơn để tên nằm dưới thân người trong ảnh */
body.co-anh .mo-dau { min-height: max(100svh, 840px); }
/* Cột rộng: ảnh bị giãn theo chiều ngang nên người trong ảnh dài xuống, cho ảnh tan sớm hơn để tên dễ đọc */
@media (min-width: 560px) {
  .anh-dau {
    -webkit-mask-image: linear-gradient(#000 34%, rgba(0, 0, 0, .5) 54%, transparent 74%);
    mask-image: linear-gradient(#000 34%, rgba(0, 0, 0, .5) 54%, transparent 74%);
  }
}
body.co-anh .hoa-dau { width: min(66%, 380px, 36svh); margin: -16px -48px 0 0; }
body.co-anh .mo-dau > :not(.anh-dau) { position: relative; z-index: 1; }
body.co-anh .ten-doi { filter: drop-shadow(0 0 14px rgba(238, 240, 243, .85)); }
body:not(.co-anh) .anh-dau, body:not(.co-anh) .vom-anh, body:not(.co-anh) .anh-in { display: none; }
.ten-doi { margin: 0; font: 400 clamp(54px, 16vw, 86px)/1.12 var(--chu-tha); white-space: nowrap; }
.ten-re { text-align: left; }
.ten-dau { text-align: right; }
.truong {
  margin: -.1em 0 0;
  display: flex; align-items: center; justify-content: center; gap: .6em;
  font: italic 400 17px/1 var(--chu-in); color: var(--muc-nhat);
  opacity: 0; transform: translateY(6px);
  transition: opacity .8s, transform .8s;
}
.truong.hien { opacity: 1; transform: none; }
.hai-tim { width: 36px; height: 22px; overflow: visible; }
.hai-tim path { fill: var(--tim); transform-box: fill-box; transform-origin: 50% 60%; }
.hai-tim path + path { fill: #D47A70; }
.truong.hien .hai-tim path { animation: dap 1.6s ease-in-out .3s infinite; }
.truong.hien .hai-tim path + path { animation-delay: .5s; }
@keyframes dap { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.22); } 24% { transform: scale(.96); } 36% { transform: scale(1.12); } 50% { transform: scale(1); } }

.ngay-lon {
  margin: 34px 0 0;
  display: flex; align-items: center; justify-content: center;
  font: 500 clamp(22px, 6.4vw, 28px)/1.2 var(--chu-in);
  letter-spacing: .05em;
  opacity: 0; filter: blur(8px);
  transition: opacity 1.2s, filter 1.2s;
}
.ngay-lon.hien { opacity: 1; filter: none; }
.vach { display: inline-block; width: 1.5px; height: 1.2em; margin: 0 .75em; background: var(--nhu); }
.vuot {
  margin: 44px 0 0; font: italic 15px/1 var(--chu-in); color: var(--muc-nhat);
  opacity: 0; transition: opacity 1s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.vuot::after {
  content: ""; width: 1.5px; height: 34px;
  background: linear-gradient(var(--nhu) 0 40%, transparent 40%) 0 0 / 100% 200%;
  animation: vuot 1.8s ease-in-out infinite;
}
.vuot.hien { opacity: 1; }
@keyframes vuot { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

/* Hiện dần như mực thấm giấy */
.hien-dan { opacity: 0; filter: blur(7px); transform: scale(.985); transition: opacity 1s ease, filter 1s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 110ms); }
.hien .hien-dan { opacity: 1; filter: none; transform: none; }

/* Lời mời */
.loi-moi { padding: 64px 24px 60px; text-align: center; }
.hai-ho { display: grid; gap: 30px; margin-bottom: 46px; }
@media (min-width: 560px) { .hai-ho { grid-template-columns: 1fr 1fr; gap: 22px; } }
.ho h2 { margin: 0 0 6px; font: italic 500 19px/1.3 var(--chu-in); color: var(--nhu-dam); }
.ong-ba { margin: 0; font: 600 16px/1.65 var(--chu-in); text-transform: uppercase; letter-spacing: .04em; }
.dia-chi { text-wrap: balance; margin: .35em auto 0; max-width: 22em; font: italic 400 16.5px/1.5 var(--chu-in); color: var(--muc-nhat); }
.moi p { margin: 0; }
.moi-kinh { font: 600 16px/1.4 var(--chu-in); letter-spacing: .14em; text-transform: uppercase; }
.ten-khach { min-height: 1.4em; margin: 6px 0 4px !important; }
.ten-khach .ten-viet { font-size: clamp(40px, 11.5vw, 56px); white-space: normal; }
.moi-dong { font-size: 18.5px; }
.moi-gio { margin-top: 2px !important; font: 600 23px/1.4 var(--chu-in); letter-spacing: .03em; }
.moi-ngay {
  margin-top: 10px !important;
  display: flex; align-items: center; justify-content: center;
  font: 600 clamp(22px, 6.6vw, 31px)/1.25 var(--chu-in); letter-spacing: .03em;
  white-space: nowrap;
}
.moi-am { font: italic 16.5px/1.5 var(--chu-in); color: var(--muc-nhat); }
.moi-noi { margin-top: 16px !important; font: 600 20px/1.4 var(--chu-in); letter-spacing: .02em; }
.moi-dc { text-wrap: balance; font: italic 17px/1.5 var(--chu-in); color: var(--muc-nhat); margin-bottom: 14px !important; }
.moi-han-hanh { margin-top: 12px !important; font: 400 34px/1.3 var(--chu-tha); color: var(--nhu-dam); }

/* Save the date */
.giu-ngay { padding: 26px 16px 70px; }
.vom {
  position: relative;
  max-width: 430px; margin: 0 auto;
  padding: 26px 18px 34px;
  text-align: center;
  background: var(--giay-sang) var(--noise);
  border-radius: 50% 50% 14px 14px / 190px 190px 14px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 3px rgba(70, 55, 40, .08), 0 30px 54px -24px rgba(70, 55, 40, .38);
  opacity: 0;
  transform: perspective(900px) rotateX(16deg) translateY(46px);
  transform-origin: 50% 100%;
  transition: opacity 1s ease, transform 1.3s cubic-bezier(.2, .8, .2, 1);
}
.giu-ngay.hien .vom { opacity: 1; transform: none; }
/* Ô cửa vòm có ảnh, viền chỉ nhũ vàng chạy theo vòm */
body.co-anh .vom { padding-top: 12px; }
.vom-anh {
  position: relative; margin: 0 -6px 14px;
  height: clamp(320px, 96vw, 440px);
  border-radius: 50% 50% 8px 8px / 182px 182px 8px 8px;
  overflow: hidden;
  background: #E7E4DF center 30% / cover no-repeat;
}
.vom-anh::after {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(240, 222, 178, .9);
  border-radius: 50% 50% 4px 4px / 174px 174px 4px 4px;
}
.vom-anh img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  opacity: 0; transform: scale(1.12);
  transition: opacity 1.2s ease, transform 2.6s cubic-bezier(.2, .7, .2, 1);
}
.giu-ngay.hien .vom-anh img.da-tai { opacity: 1; transform: none; }
.save { margin: 4px 0 0; font: 400 clamp(46px, 13vw, 58px)/1.15 var(--chu-tha); color: var(--muc); }
.thang { margin: 0; font: italic 500 19px/1.4 var(--chu-in); color: var(--muc-nhat); }

.lich {
  display: grid; grid-template-columns: repeat(7, 1fr);
  max-width: 340px; margin: 16px auto 8px; row-gap: 4px;
  font: 500 17.5px/1 var(--chu-in);
  font-variant-numeric: lining-nums tabular-nums;
}
.lich .thu { padding-bottom: 10px; font: 600 13.5px/1 var(--chu-in); letter-spacing: .04em; color: var(--muc-nhat); }
.lich .thu.cn { color: var(--tim); }
.lich .ngay { position: relative; height: 40px; display: grid; place-items: center; opacity: 0; transform: scale(.5); }
.lich .ngay.cn { color: var(--tim); }
.giu-ngay.hien .lich .ngay { animation: hien-ngay .55s calc(var(--i) * 20ms + .7s) cubic-bezier(.2, .9, .3, 1.4) forwards; }
@keyframes hien-ngay { to { opacity: 1; transform: none; } }
.lich .cuoi { color: var(--tim); font-weight: 600; z-index: 1; }
.tim-ve { position: absolute; left: 50%; top: 50%; width: 54px; height: 50px; margin: -27px 0 0 -27px; overflow: visible; pointer-events: none; }
.tim-ve path { fill: none; stroke: var(--tim); stroke-width: 1.7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.giu-ngay.hien .tim-ve path { animation: ve-net 1.2s 1.8s cubic-bezier(.5, 0, .3, 1) forwards; }
.cuoi.dap .so-cuoi { animation: dap 1.8s ease-in-out infinite; display: inline-block; }

.hoa-van { display: block; width: 150px; height: 28px; margin: 6px auto 4px; overflow: visible; }
.hoa-van path { fill: none; stroke: var(--nhu-dam); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.giu-ngay.hien .hoa-van path { animation: ve-net 2s 2.4s ease forwards; }

.dem { display: flex; justify-content: center; gap: clamp(8px, 4vw, 22px); margin-top: 12px; }
.dem-o { display: flex; flex-direction: column; align-items: center; min-width: 58px; perspective: 300px; }
.dem-so {
  display: inline-block;
  font: 500 36px/1.1 var(--chu-in);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--muc);
}
.dem-so.lat { animation: lat .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes lat { from { transform: translateY(-40%) rotateX(85deg); opacity: 0; } to { transform: none; opacity: 1; } }
.dem-chu { font: italic 15.5px/1.3 var(--chu-in); color: var(--muc-nhat); }
.dem-xong { margin: 12px 0 0; font: 400 30px/1.3 var(--chu-tha); color: var(--tim); }

/* Lịch trình */
.lich-trinh { padding: 60px 22px 30px; }
.than-cay { position: absolute; left: 22px; top: 150px; width: 40px; height: calc(100% - 210px); overflow: visible; }
.than-cay path { fill: none; stroke: var(--canh); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); vector-effect: non-scaling-stroke; }
.moc { list-style: none; margin: 18px 0 0; padding: 0 0 0 62px; }
.moc > li { position: relative; padding-bottom: 46px; }
.moc > li::before {
  content: ""; position: absolute; left: -48px; top: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle, #C09552 0 30%, transparent 31%), radial-gradient(circle, #EFE6D8 0 62%, transparent 63%);
  box-shadow: 0 0 0 1px rgba(176, 154, 124, .7);
  transform: scale(0) rotate(-90deg);
  transition: transform .8s cubic-bezier(.2, .9, .3, 1.5);
}
.moc > li.toi::before { transform: none; }
.moc > li > * { opacity: 0; transform: translateX(-10px); transition: opacity .8s, transform .8s; }
.moc > li.toi > * { opacity: 1; transform: none; }
.moc > li.toi > :nth-child(2) { transition-delay: .1s; }
.moc > li.toi > :nth-child(3) { transition-delay: .2s; }
.moc > li.toi > :nth-child(4) { transition-delay: .3s; }
.moc > li.toi > :nth-child(5) { transition-delay: .4s; }
.moc-gio { margin: 0; font: 500 30px/1.1 var(--chu-in); color: var(--nhu-dam); font-variant-numeric: lining-nums; }
.moc h3 { margin: 6px 0 4px; font: 600 21px/1.3 var(--chu-in); }
.moc-noi { text-wrap: balance; margin: 0 0 14px; font: italic 17.5px/1.5 var(--chu-in); color: var(--muc-nhat); }
.nghi-thuc { list-style: none; display: flex; gap: 20px; margin: 12px 0 14px; padding: 0; }
.nghi-thuc li { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 16px/1.2 var(--chu-in); color: var(--muc-nhat); }
.nghi-thuc svg { width: 46px; height: 46px; fill: none; stroke: var(--nhu-dam); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.nghi-thuc svg [pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.nghi-thuc svg circle:not([pathLength]) { fill: #C48C70; stroke: none; opacity: 0; transition: opacity .6s 1.4s; }
.nghi-thuc svg .to { fill: var(--tim); stroke: none; opacity: 0; transition: opacity .6s 1.4s; }
.toi .nghi-thuc svg [pathLength] { animation: ve-net 1.4s .4s ease forwards; }
.toi .nghi-thuc li:nth-child(2) svg [pathLength] { animation-delay: .7s; }
.toi .nghi-thuc li:nth-child(3) svg [pathLength] { animation-delay: 1s; }
.toi .nghi-thuc svg circle:not([pathLength]), .toi .nghi-thuc svg .to { opacity: 1; }

.nut-duong {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 18px 0 14px;
  border: 1px solid var(--nhu); border-radius: 4px;
  font: 500 17px/1 var(--chu-in); color: var(--nhu-dam); text-decoration: none;
  background: rgba(255, 255, 255, .35);
  transition: background .2s, color .2s;
}
.nut-duong::before {
  content: ""; width: 16px; height: 20px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M8 0a8 8 0 0 0-8 8c0 6 8 12 8 12s8-6 8-12a8 8 0 0 0-8-8zm0 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M8 0a8 8 0 0 0-8 8c0 6 8 12 8 12s8-6 8-12a8 8 0 0 0-8-8zm0 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nut-duong:hover { background: var(--nhu-dam); color: #FFF9EE; }

/* Xác nhận tham dự */
.xac-nhan { padding: 60px 18px 50px; }
.dan { text-wrap: balance; max-width: 26em; margin: 0 auto 28px; text-align: center; font: italic 18.5px/1.5 var(--chu-in); color: var(--muc-nhat); }
.phieu, .da-gui { max-width: 450px; margin: 0 auto; }
.phieu {
  position: relative;
  padding: 34px 22px 26px;
  background: var(--bia) var(--noise);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 4px rgba(70, 55, 40, .1), 0 24px 44px -22px rgba(70, 55, 40, .42);
}
.phieu::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 12px; height: 2px;
  background: radial-gradient(circle, rgba(103, 94, 96, .5) 0 1px, transparent 1.3px) 0 0 / 9px 2px repeat-x;
}
.o { display: block; margin-bottom: 24px; }
.o-ten { display: block; margin-bottom: 6px; font: 500 17.5px/1.4 var(--chu-in); color: var(--muc); }
.o-ten em { font-weight: 400; color: var(--muc-nhat); }
.o input, .o textarea {
  width: 100%;
  font: 400 21px/1.4 var(--chu-in); color: var(--but);
  background: transparent;
  border: 0; border-radius: 0;
  border-bottom: 1.5px dotted var(--muc-nhat);
  padding: 6px 2px;
}
.o textarea { border: 1px solid rgba(103, 94, 96, .45); border-radius: 3px; padding: 10px 12px; resize: vertical; background: rgba(255, 255, 255, .35); font-size: 19px; }
.o input:focus-visible, .o textarea:focus-visible { outline: 2px solid var(--but); outline-offset: 2px; }

.chon { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.chon legend { padding: 0; float: left; width: 100%; }
.chon legend + * { clear: both; }
.o-tick {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; margin-right: 22px;
  font: 400 19.5px/1.3 var(--chu-in); cursor: pointer;
}
.o-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hop {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1.5px solid var(--muc-nhat); border-radius: 3px;
  background: rgba(255, 255, 255, .45);
}
.hop svg { width: 24px; height: 24px; fill: none; stroke: var(--but); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.hop path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s ease; }
.o-tick input:checked + .hop path { stroke-dashoffset: 0; }
.o-tick input:focus-visible + .hop { outline: 2px solid var(--but); outline-offset: 3px; }

.neu-den { overflow: hidden; transition: opacity .4s; }
.neu-den.an { display: none; }
.so-nguoi { margin-bottom: 22px; }
.buoc { display: inline-flex; align-items: center; gap: 4px; }
.nut-buoc {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--muc-nhat); background: rgba(255, 255, 255, .45);
  font: 400 26px/1 var(--chu-in); color: var(--muc); cursor: pointer;
  display: grid; place-items: center; padding: 0 0 3px;
}
.nut-buoc:active { transform: scale(.92); }
#xn-so { min-width: 2.4em; text-align: center; font: 500 30px/1 var(--chu-in); color: var(--but); }
.bay { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.nut-gui {
  position: relative; overflow: hidden;
  display: block; width: 100%; min-height: 54px; margin-top: 4px;
  border: 0; border-radius: 3px; cursor: pointer;
  font: 600 20px/1 var(--chu-in); letter-spacing: .02em; color: #FFF9EE;
  background: linear-gradient(180deg, #9C7845, #77582C);
  box-shadow: inset 0 1px 0 rgba(255, 238, 205, .55), 0 8px 18px -8px rgba(90, 65, 30, .6);
}
.nut-gui::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 244, 214, .45), transparent);
  animation: luot 4.5s ease-in-out 2s infinite;
}
@keyframes luot { 0% { left: -60%; } 35%, 100% { left: 130%; } }
.nut-gui:disabled { cursor: progress; filter: saturate(.7) brightness(.95); }
.bao { min-height: 1.5em; margin: 12px 0 0; text-align: center; font: italic 17px/1.4 var(--chu-in); color: var(--tim); }
.bao.dang-gui { color: var(--muc-nhat); }

.da-gui { text-align: center; padding-top: 6px; }
.con-dau { width: 196px; height: 196px; color: var(--tim); opacity: 0; transform: scale(2.6) rotate(-34deg); }
.con-dau text { font-family: var(--chu-in); font-weight: 600; }
.da-gui.dap .con-dau { animation: dong-dau .5s cubic-bezier(.55, 0, .75, .4) forwards; }
.da-gui.da-dap .con-dau { opacity: .9; transform: rotate(-12deg); }
@keyframes dong-dau {
  0% { opacity: 0; transform: scale(2.6) rotate(-34deg); }
  78% { opacity: .95; transform: scale(.92) rotate(-12deg); }
  100% { opacity: .9; transform: scale(1) rotate(-12deg); }
}
.da-gui-chu { margin: 4px auto 14px; max-width: 24em; font: italic 19px/1.5 var(--chu-in); }
.tu-dong { margin: 0 0 14px; font: italic 16.5px/1.4 var(--chu-in); color: var(--muc-nhat); }
.hang-nut-xn { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.da-gui-chu, .tu-dong, .da-gui .nut-phu { transition: color 1s, border-color 1s; }
body.phao-hoa .da-gui { position: relative; z-index: 26; }
body.phao-hoa .da-gui-chu { color: #F1E6CC; }
body.phao-hoa .tu-dong { color: #D8C9AC; }
body.phao-hoa .da-gui .nut-phu { color: #F1E6CC; border-color: rgba(241, 230, 204, .6); }
.nut-phu {
  min-height: 46px; padding: 0 18px;
  border: 1px solid var(--muc-nhat); border-radius: 4px; background: transparent;
  font: 500 17px/1 var(--chu-in); color: var(--muc); cursor: pointer;
}
.thiep.rung { animation: rung .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes rung {
  10%, 90% { transform: translate(-1px, 1px); }
  20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-5px, 2px); }
  40%, 60% { transform: translate(5px, -1px); }
}

/* Lời cảm ơn */
.cam-on { padding: 50px 24px 120px; text-align: center; }
.dan-bang { position: relative; width: 170px; height: 230px; margin: 0 auto 6px; }
.dan-hoa { position: absolute; inset: 0; }
.bang-keo {
  position: absolute; left: 50%; top: 66%; width: 136px; height: 34px;
  transform: translate(-50%, -50%) rotate(-4deg);
  background: linear-gradient(180deg, rgba(186, 195, 207, .72), rgba(172, 182, 196, .66));
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 20% 9%, 26% 1%, 33% 8%, 40% 0, 47% 9%, 55% 2%, 62% 10%, 70% 1%, 77% 8%, 85% 0, 92% 9%, 97% 1%, 100% 7%, 100% 92%, 96% 100%, 90% 91%, 84% 99%, 77% 92%, 70% 100%, 62% 90%, 55% 98%, 47% 91%, 40% 100%, 33% 92%, 26% 99%, 19% 90%, 12% 98%, 6% 91%, 0 98%);
  opacity: 0; transition: opacity .6s 1.6s;
}
.cam-on.hien .bang-keo { opacity: 1; }
/* Có ảnh: ảnh in dán băng keo, cành hoa khô giắt phía sau */
body.co-anh .dan-bang { width: 260px; height: 340px; margin-bottom: 22px; }
body.co-anh .dan-hoa { inset: auto auto -14px -46px; width: 150px; height: 200px; transform: rotate(-16deg); }
body.co-anh .bang-keo { top: 5%; left: 54%; width: 128px; transform: translate(-50%, -50%) rotate(4deg); }
.anh-in {
  position: absolute; left: 24px; top: 8px; width: 214px; margin: 0;
  padding: 10px 10px 38px;
  background: #FBFBF9;
  box-shadow: 0 1px 2px rgba(60, 45, 30, .16), 0 20px 36px -18px rgba(60, 45, 30, .55);
  transform: rotate(-2.4deg);
  opacity: 0; translate: 0 18px;
  transition: opacity 1s ease .3s, translate 1.2s cubic-bezier(.2, .8, .2, 1) .3s;
}
.cam-on.hien .anh-in { opacity: 1; translate: 0 0; }
.anh-in img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 28%; background: #E7E4DF center 28% / cover no-repeat; }

/* Album ảnh cưới: xấp ba ảnh in, cuộn tới thì xoè ra */
.album { padding: 54px 16px 30px; }
.cat-anh { position: relative; max-width: 420px; height: clamp(340px, 96vw, 460px); margin: -6px auto 0; }
.in {
  position: absolute; left: 50%; top: 50%; width: min(60%, 250px); margin: 0;
  padding: 8px; background: #FBFBF9;
  box-shadow: 0 1px 2px rgba(60, 45, 30, .14), 0 18px 34px -18px rgba(60, 45, 30, .55);
  translate: -50% -50%;
  transition: transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
.in:nth-child(1) { z-index: 3; transform: rotate(-1deg); }
.in:nth-child(2) { z-index: 2; transform: rotate(-3deg); }
.in:nth-child(3) { z-index: 1; transform: rotate(2deg); }
.cat-anh.xoe .in:nth-child(1) { transform: rotate(-2deg); }
.cat-anh.xoe .in:nth-child(2) { transform: translate(-28%, 3%) rotate(-8deg); transition-delay: .15s; }
.cat-anh.xoe .in:nth-child(3) { transform: translate(28%, 1%) rotate(7deg); transition-delay: .3s; }
.in .khung {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #E7E4DF center 30% / cover no-repeat;
}
.in img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  opacity: 0; filter: blur(16px) saturate(.15) brightness(1.25); transform: scale(1.08);
  transition: opacity 1.1s ease, filter 1.8s ease, transform 2.2s cubic-bezier(.2, .7, .2, 1);
}
.in.hien-anh img.da-tai { opacity: 1; filter: none; transform: none; }
.in .khung:active img { transform: scale(.985); transition-duration: .15s; }
.album-nut { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.nut-phim {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 0 30px 0 24px;
  border: 0; border-radius: 3px; cursor: pointer;
  font: 600 19px/1 var(--chu-in); color: #FFF9EE;
  background: linear-gradient(180deg, #9C7845, #77582C);
  box-shadow: inset 0 1px 0 rgba(255, 238, 205, .55), 0 8px 18px -8px rgba(90, 65, 30, .6);
}
.nut-phim::before {
  content: ""; width: 0; height: 0;
  border-left: 12px solid currentColor; border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent;
}

/* Xem album */
body.dang-xem { overflow: hidden; }
.xem-anh { position: fixed; inset: 0; z-index: 40; display: flex; background: #1B1716; animation: hien-xem .35s ease; }
@keyframes hien-xem { from { opacity: 0; } }
.xa-khung {
  flex: 1; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none;
}
.xa-khung::-webkit-scrollbar { display: none; }
.xa-anh { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; padding: 64px 0 84px; }
.xa-anh img { max-width: 100%; max-height: 100%; width: auto; height: auto; background: center / cover no-repeat; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7); }
.xa-tren {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 12px 0 20px;
  font: 500 17px/1 var(--chu-in); color: #EADFC8; font-variant-numeric: lining-nums;
}
.xa-nut {
  width: 48px; height: 48px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(234, 223, 200, .35); background: rgba(30, 26, 24, .45); color: #EADFC8;
  display: grid; place-items: center;
}
.xa-nut svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xa-lui, .xa-toi { position: absolute; top: 50%; margin-top: -24px; }
.xa-lui { left: 14px; }
.xa-toi { right: 14px; }
@media (hover: none) { .xa-lui, .xa-toi { display: none; } }
.xa-phim {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  min-height: 46px; padding: 0 22px; border-radius: 3px; cursor: pointer;
  border: 1px solid rgba(233, 210, 160, .7); background: rgba(30, 26, 24, .5);
  font: 500 17px/1 var(--chu-in); color: #F1E2BC;
}
.xem-anh :focus-visible, .phim :focus-visible { outline-color: #F1E2BC; }

/* Xem như phim */
.phim { position: fixed; inset: 0; z-index: 41; overflow: hidden; background: #171312; animation: hien-xem .6s ease; cursor: none; }
.phim-o { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease; }
.phim-o.hien { opacity: 1; }
.phim-nen { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.4) saturate(.9); }
.phim-chinh { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.phim-o.kb1 .phim-chinh { animation: kb1 7s linear forwards; }
.phim-o.kb2 .phim-chinh { animation: kb2 7s linear forwards; }
.phim-o.kb3 .phim-chinh { animation: kb3 7s linear forwards; }
@keyframes kb1 { from { transform: scale(1); } to { transform: scale(1.07) translate(-1%, -1%); } }
@keyframes kb2 { from { transform: scale(1.07) translate(1%, .5%); } to { transform: scale(1); } }
@keyframes kb3 { from { transform: scale(1.01) translate(1%, 0); } to { transform: scale(1.07) translate(-.5%, -1.5%); } }
.phim-ten {
  position: absolute; left: 0; right: 0; bottom: max(8%, 56px); margin: 0; text-align: center;
  font: 400 clamp(32px, 9vw, 60px)/1.2 var(--chu-tha); color: #F6E6C2; white-space: nowrap;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .6);
  animation: ten-phim 2.4s ease .6s backwards;
}
.phim-ten span { font-size: .7em; }
@keyframes ten-phim { from { opacity: 0; letter-spacing: .08em; } }
.phim-chay { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .14); }
.phim-chay span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #A9844E, #F2E2B5); }
.phim-chay span.chay { animation: phim-chay var(--thoi, 5s) linear forwards; }
@keyframes phim-chay { to { width: 100%; } }
.phim-dong { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; cursor: pointer; }
.thank { margin: 6px 0 0; font: 400 clamp(52px, 15vw, 70px)/1.2 var(--chu-tha); color: var(--muc); }
.loi-cam-on { text-wrap: balance; margin: 8px 0 0; font: italic 19.5px/1.6 var(--chu-in); color: var(--muc-nhat); }
.ky { margin: 26px 0 0; font: 400 34px/1.3 var(--chu-tha); color: var(--nhu-dam); }
/* Đêm pháo hoa: lời cảm ơn nổi lên trên màn tối */
.cam-on .thank, .loi-cam-on, .ky { transition: color 1.1s ease, text-shadow 1.1s ease; }
body.phao-hoa .cam-on { z-index: 26; }
body.phao-hoa .cam-on .thank { color: #F6E9CC; text-shadow: 0 0 18px rgba(240, 200, 120, .55); }
body.phao-hoa .loi-cam-on { color: #DCCDB2; }
body.phao-hoa .ky { color: #EBCB8B; text-shadow: 0 0 14px rgba(235, 195, 120, .5); }

/* Nút nhạc */
.nut-nhac {
  position: fixed; z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid rgba(126, 95, 51, .45);
  background: rgba(248, 246, 241, .88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(70, 55, 40, .45);
  animation: hien-nut .6s ease;
}
.nut-nhac svg { width: 24px; height: 24px; fill: none; stroke: var(--nhu-dam); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nut-nhac::before, .nut-nhac::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--nhu); opacity: 0;
}
.nut-nhac[aria-pressed="true"]::before { animation: song-nhac 2.4s ease-out infinite; }
.nut-nhac[aria-pressed="true"]::after { animation: song-nhac 2.4s ease-out 1.2s infinite; }
.nut-nhac[aria-pressed="false"] svg { opacity: .5; }
.nut-nhac[aria-pressed="false"]::after { opacity: 1; inset: 50% 10px auto; height: 1.6px; border: 0; border-radius: 0; background: var(--nhu-dam); transform: rotate(-45deg); }
@keyframes song-nhac { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
@keyframes hien-nut { from { opacity: 0; transform: scale(.6); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  [data-viet], .ten-viet { -webkit-mask: none; mask: none; }
  .hien-dan { filter: none; }
  html { scroll-behavior: auto; }
}
