/* =====================================================================
   MÀU SẮC & PHÔNG CHỮ — đổi tông thiệp chỉ cần sửa khối :root này
   ===================================================================== */
:root {
  --wine: #511419;      /* đỏ rượu chủ đạo */
  --wine-2: #6b1c24;    /* đỏ rượu sáng hơn (hover, chữ phụ) */
  --wine-deep: #360b10; /* đỏ rượu đậm (cuối trang) */
  --cream: #f4ece0;     /* kem */
  --cream-2: #ece4d8;   /* kem đậm (nền lịch, ô ảnh) */
  --paper: #fbf6ee;     /* nền giấy */
  --gold: #b58b2f;      /* vàng đồng */
  --gold-soft: #d8bd7e; /* vàng nhạt (chữ trên nền đỏ) */
  --ink: #3a1518;       /* chữ */
  --muted: #8a6a66;     /* chữ mờ */

  --f-display: "Viaoda Libre", "Cormorant Garamond", serif;
  --f-head: "Cormorant Garamond", "Times New Roman", serif;
  --f-body: "Lora", "Times New Roman", serif;
  --f-script: "Ms Madi", cursive;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(54, 11, 16, .45);
  color-scheme: light;
}

*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html.locked { overflow: hidden; }
body {
  margin: 0; font-family: var(--f-body); color: var(--ink); line-height: 1.55; min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #6e1f28 0%, transparent 60%), linear-gradient(#3d0d12, #2a080c);
  -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; font-feature-settings: "lnum";
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 600; }
.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Trang chính: cột giấy rộng tối đa 460px giữa nền đỏ */
.page {
  position: relative; max-width: 460px; margin: 0 auto; overflow: hidden;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(600px 400px at 0% 0%, rgba(181, 139, 47, .08), transparent 70%),
    radial-gradient(600px 400px at 100% 60%, rgba(81, 20, 25, .06), transparent 70%);
  box-shadow: 0 0 80px rgba(0, 0, 0, .35);
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 28px;
  border-radius: 999px; border: 0; font-family: var(--f-head); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; }
.btn-wine { background: var(--wine); color: var(--cream); box-shadow: 0 10px 22px -10px rgba(81, 20, 25, .8); }
.btn-wine:hover { background: var(--wine-2); }
.btn-cream { background: var(--cream); color: var(--wine); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .6); }
.btn.wide { width: 100%; }
.link-btn { background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 4px; font-family: var(--f-body); font-size: .95rem; padding: 6px 4px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--wine); margin: 14px auto; }
.ornament span { height: 1px; width: 64px; background: linear-gradient(90deg, transparent, currentColor); opacity: .55; }
.ornament span:last-child { transform: scaleX(-1); }
.ornament svg { fill: currentColor; }
.ornament.light { color: var(--gold-soft); }

/* ---------- Màn mở thiệp ---------- */
.cover {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 30% 20%, #7a222c, #511419 45%, #2c080c);
  transition: opacity .9s .35s, visibility 0s linear 1.3s;
}
.cover.opening { opacity: 0; visibility: hidden; }
.cover-hearts { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cover-hearts i {
  position: absolute; top: -40px; width: var(--s); height: var(--s); opacity: .5; background: rgba(255, 210, 210, .55);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -20 40 36'><path d='M0 14C-6 9-18 1-18-7C-18-13.5-13-18-7.5-18C-3.8-18-1.2-16 0-13C1.2-16 3.8-18 7.5-18C13-18 18-13.5 18-7C18 1 6 9 0 14Z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -20 40 36'><path d='M0 14C-6 9-18 1-18-7C-18-13.5-13-18-7.5-18C-3.8-18-1.2-16 0-13C1.2-16 3.8-18 7.5-18C13-18 18-13.5 18-7C18 1 6 9 0 14Z'/></svg>") center / contain no-repeat;
  animation: fall var(--d) linear var(--delay) infinite;
}
@keyframes fall { 0% { transform: translate3d(0, -40px, 0) rotate(0); } 100% { transform: translate3d(var(--x), 110vh, 0) rotate(240deg); } }
.cover-card {
  position: relative; width: min(100%, 340px); padding: 56px 28px 40px; text-align: center;
  background: linear-gradient(#fbf5ec, #f2e8da); border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  transition: transform 1s cubic-bezier(.6, -.2, .3, 1), opacity .8s;
}
.cover.opening .cover-card { transform: translateY(-40px) scale(.92); opacity: 0; }
.cover-flower { position: absolute; width: 96px; height: 134px; pointer-events: none; }
.cover-flower.tl { top: -22px; left: -26px; transform: rotate(-24deg); }
.cover-flower.br { bottom: -26px; right: -24px; transform: rotate(160deg); }
.cover-badge {
  width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #7c2530, #3e0c12); box-shadow: 0 10px 22px -8px rgba(81, 20, 25, .7);
}
.cover-badge svg { width: 26px; height: 24px; fill: var(--cream); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
.cover-names { font-family: var(--f-display); color: var(--wine); font-size: 2.3rem; line-height: 1.15; display: flex; flex-direction: column; }
.cover-names .amp { font-size: 1.2rem; margin: 2px 0; }
.cover-date { font-family: var(--f-head); font-size: 1.2rem; color: var(--muted); margin-top: 4px; }
.cover-invite { font-family: var(--f-body); font-style: italic; color: var(--wine-2); margin: 14px 0 26px; }
.cover-guest { display: block; font-family: var(--f-display); font-style: normal; font-weight: 400; font-size: 1.5rem; color: var(--wine); margin-top: 4px; }
.cover-open { min-width: 160px; animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 10px 22px -10px rgba(81, 20, 25, .8); } 50% { box-shadow: 0 10px 30px -6px rgba(81, 20, 25, .95); } }

/* ---------- Đầu trang ---------- */
.hero { position: relative; padding: 40px 20px 34px; text-align: center; }
.eyebrow { font-family: var(--f-head); font-weight: 700; letter-spacing: .35em; text-transform: uppercase; font-size: .82rem; color: var(--wine); }
.envelope { position: relative; width: min(80%, 330px); aspect-ratio: 300 / 210; margin: 168px auto 0; }
.env-back, .env-front { position: absolute; inset: 0; width: 100%; height: 100%; }
.env-back { filter: drop-shadow(0 24px 30px rgba(54, 11, 16, .35)); }
.env-photo {
  position: absolute; left: 11%; width: 78%; bottom: 10%; margin: 0; aspect-ratio: 3 / 4; padding: 7px;
  background: #fffdf8; border-radius: 3px; box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
  transform: translateY(18%) rotate(0); transition: transform 1.4s cubic-bezier(.2, .8, .2, 1) .2s;
}
.env-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; background: var(--cream-2); }
.envelope.in .env-photo { transform: translateY(-4%) rotate(-3deg); }
.env-seal { position: absolute; left: 50%; top: 71.5%; width: 23%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-8deg); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.env-flower { position: absolute; width: 34%; height: 62%; left: -13%; bottom: -18%; transform: rotate(-30deg); pointer-events: none; }
.couple { position: relative; margin-top: 40px; display: flex; flex-direction: column; align-items: center; font-family: var(--f-display); font-weight: 400; color: var(--wine); line-height: 1.05; }
.couple .name { position: relative; z-index: 1; font-size: clamp(2.9rem, 13vw, 3.6rem); }
.couple .amp { position: absolute; top: 50%; left: 50%; transform: translate(-40%, -54%); font-family: var(--f-script); font-size: 5.6rem; color: var(--gold); opacity: .35; }
.hero-date { margin-top: 18px; font-family: var(--f-head); font-size: 1.3rem; letter-spacing: .18em; color: var(--wine-2); }
.scroll-hint { margin-top: 26px; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--muted), transparent); animation: drop 1.8s ease-in-out infinite; }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Khung đỏ ---------- */
.panel {
  position: relative; margin: 26px 16px; padding: 36px 18px 34px; text-align: center; color: var(--cream);
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .06), transparent 60%), linear-gradient(#5a161d, #4a1117);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(216, 189, 126, .35); border-radius: 12px; pointer-events: none; }
.panel-flower { position: absolute; width: 110px; height: 154px; pointer-events: none; z-index: 2; }
.panel-flower.right { right: -58px; top: 40%; transform: rotate(-12deg); }
.panel-flower.left { left: -62px; top: 34%; transform: scaleX(-1) rotate(-12deg); }
.panel-title { font-family: var(--f-head); font-weight: 700; font-size: clamp(1.15rem, 5.4vw, 1.4rem); letter-spacing: .02em; white-space: nowrap; text-transform: uppercase; }
.families { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 14px; margin: 24px 0 26px; }
.families::before { content: ""; grid-area: 1 / 2; background: rgba(236, 228, 216, .35); }
.family:first-child { grid-area: 1 / 1; }
.family:last-child { grid-area: 1 / 3; }
.family-label { font-family: var(--f-head); font-size: .85rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 6px; }
.family-name { font-weight: 600; font-size: .86rem; line-height: 1.6; }
.family-addr { margin-top: 6px; font-size: .74rem; line-height: 1.45; opacity: .75; }
.announce { font-family: var(--f-head); font-weight: 600; font-size: 1.04rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1.5; }
.spouse { margin: 18px 0 6px; }
.spouse-name { font-family: var(--f-display); font-size: clamp(2.1rem, 9.5vw, 2.5rem); line-height: 1.2; }
.spouse-order { font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; opacity: .75; margin-top: 4px; }
.spouse-amp { font-family: var(--f-script); font-size: 2.6rem; line-height: 1; margin: 6px 0 4px; color: var(--gold-soft); }
.event-heading { font-family: var(--f-head); font-weight: 600; font-size: 1.04rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1.45; margin-top: 14px; }
.event-date { margin-top: 12px; }
.event-block + .event-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(216, 189, 126, .25); }
.event-time { font-family: var(--f-head); font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; display: flex; justify-content: center; align-items: center; gap: 10px; }
.event-time .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.event-day { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 10px 0; }
.event-day .day { font-family: var(--f-head); font-weight: 600; font-size: 3.6rem; line-height: 1; }
.event-day .bar { width: 1px; align-self: stretch; background: rgba(236, 228, 216, .5); }
.event-day .mon { display: flex; flex-direction: column; align-items: flex-start; font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1.5; }
.lunar { font-family: var(--f-head); font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }

/* ---------- Tiêu đề mục ---------- */
.section-title { font-family: var(--f-head); font-weight: 700; font-size: clamp(1.2rem, 5.6vw, 1.45rem); letter-spacing: .04em; text-wrap: balance; text-transform: uppercase; color: var(--wine); text-align: center; }
.section-sub { text-align: center; color: var(--muted); font-style: italic; font-size: .95rem; margin-top: 6px; }

/* ---------- Album ---------- */
.album { padding: 40px 0 20px; }
.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 22px 9% 18px; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 82%; scroll-snap-align: center; aspect-ratio: 4 / 5; border: 0; padding: 0; border-radius: 16px; overflow: hidden;
  background: var(--cream-2); box-shadow: 0 16px 30px -16px rgba(54, 11, 16, .6); transition: transform .4s, opacity .4s;
}
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide:not(.active) { transform: scale(.93); opacity: .75; }
.dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 0 30px; }
.dots span { width: 6px; height: 6px; border-radius: 99px; background: rgba(81, 20, 25, .25); transition: width .3s, background .3s; }
.dots span.on { width: 20px; background: var(--wine); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 22px 18px 0; }
.thumb { position: relative; border: 0; padding: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--cream-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.thumb:hover img { transform: scale(1.06); }
.thumb.more span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(54, 11, 16, .6); color: var(--cream); font-family: var(--f-head); font-weight: 700; font-size: 1.5rem; }

/* ---------- Đếm ngược + lịch ---------- */
.countdown { margin-top: 24px; }
.countdown-label { font-style: italic; opacity: .9; }
.countdown-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.countdown-boxes div { padding: 10px 0 8px; border-radius: 12px; background: rgba(244, 236, 224, .1); border: 1px solid rgba(216, 189, 126, .3); }
.countdown-boxes span { display: block; font-family: var(--f-head); font-weight: 700; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown-boxes small { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.calendar { margin: 24px 4px 0; padding: 18px 14px 16px; background: var(--cream-2); color: var(--wine); border-radius: 14px; }
.calendar-title { font-family: var(--f-script); font-size: 2.2rem; line-height: 1.1; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; margin-top: 10px; font-size: .92rem; }
.calendar-grid .dow { font-size: .72rem; letter-spacing: .05em; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--wine); margin-bottom: 6px; }
.calendar-grid > span { display: grid; place-items: center; height: 32px; position: relative; }
.calendar-grid .mark svg { position: absolute; width: 34px; height: 31px; fill: var(--wine); animation: beat 2s ease-in-out infinite; }
.calendar-grid .mark b { position: relative; color: var(--cream); font-size: .85rem; }
.calendar-legend { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.calendar-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wine); margin-right: 6px; vertical-align: 1px; }
.addcal { position: relative; margin: 18px 0 20px; }
.addcal-menu { display: grid; gap: 6px; margin-top: 8px; }
.addcal-menu a, .addcal-menu button { display: block; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: rgba(244, 236, 224, .12); color: var(--cream); text-decoration: none; font-size: .92rem; font-family: var(--f-body); }
.addcal-menu a:hover, .addcal-menu button:hover { background: rgba(244, 236, 224, .2); }

/* ---------- Địa điểm ---------- */
.venue { padding: 44px 18px 10px; text-align: center; }
.venue-addr { margin-top: 8px; color: var(--muted); }
.map { margin: 20px 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 6px solid #fff; aspect-ratio: 4 / 3; background: var(--cream-2); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.venue > .btn { margin-top: 20px; }
.venue .map + .btn { margin-top: 0; }

/* ---------- Sổ lưu bút ---------- */
.guestbook { padding: 44px 18px 10px; }
.paper-card { position: relative; padding: 32px 22px 26px; background: rgba(255, 255, 255, .7); border-radius: var(--radius); box-shadow: 0 18px 40px -22px rgba(54, 11, 16, .45); border: 1px solid rgba(181, 139, 47, .25); }
.paper-flower { position: absolute; width: 86px; height: 120px; right: -34px; top: -46px; transform: rotate(18deg); pointer-events: none; }
.form { display: grid; gap: 12px; margin-top: 18px; }
.form input:not([type=radio]):not([type=checkbox]), .form textarea, .form select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(81, 20, 25, .35); background: #fffdf9;
  font: inherit; font-size: 1rem; color: var(--ink); resize: vertical;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(81, 20, 25, .12); }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.icon-btn { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(81, 20, 25, .25); background: #fffdf9; color: var(--wine); }
.form-msg { min-height: 1.2em; font-size: .9rem; text-align: center; color: var(--wine-2); }
.form-msg.error { color: #b3261e; }
.wishes { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.wishes li { padding: 14px 16px; background: rgba(255, 255, 255, .65); border: 1px solid rgba(81, 20, 25, .15); border-radius: 14px; animation: rise .5s ease both; }
.wishes .w-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.wishes .w-name { font-weight: 600; color: var(--wine); }
.wishes .w-time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.wishes .w-msg { margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.wishes .empty { text-align: center; color: var(--muted); font-style: italic; background: none; border: 0; }
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: none; } }

/* ---------- Ảnh khách ---------- */
.moments { padding: 40px 18px 6px; text-align: center; }
.moments-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.moments-actions .btn-cream { border: 1px solid rgba(81, 20, 25, .3); box-shadow: none; }

/* ---------- Hộp quà ---------- */
.gift { padding: 50px 18px 40px; text-align: center; }
.gift-envelope { position: relative; display: block; width: min(78%, 300px); margin: 24px auto 0; border: 0; padding: 0; background: none; animation: float 3.2s ease-in-out infinite; }
.gift-envelope > svg:first-child { width: 100%; height: auto; filter: drop-shadow(0 18px 24px rgba(54, 11, 16, .4)); }
.gift-seal { position: absolute; left: 50%; top: 56%; width: 24%; transform: translate(-50%, -50%); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.gift-hint { display: block; margin-top: 18px; font-style: italic; color: var(--muted); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Cuối trang ---------- */
.thanks { position: relative; margin-top: 0; color: var(--cream); text-align: center; background: var(--wine-deep); }
.thanks-photo { position: relative; }
.thanks-photo img { display: block; margin-bottom: -1px; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 70%; }
.thanks-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#fbf6ee, rgba(251, 246, 238, .7) 3%, rgba(251, 246, 238, .3) 6%, rgba(251, 246, 238, 0) 9%, rgba(54, 11, 16, 0) 55%, rgba(54, 11, 16, .2) 66%, rgba(54, 11, 16, .45) 78%, rgba(54, 11, 16, .75) 90%, #360b10); }
.thanks-text { position: relative; margin-top: -2px; padding: 6px 28px 64px; background: var(--wine-deep); }
.thanks-line { font-style: italic; font-size: 1.02rem; }
.thanks-names { font-family: var(--f-display); font-size: clamp(2rem, 9vw, 2.5rem); margin-top: 10px; white-space: nowrap; }
.thanks-date { font-family: var(--f-head); letter-spacing: .25em; margin-top: 4px; opacity: .85; }

/* ---------- Nút nhạc ---------- */
.music-btn {
  position: fixed; z-index: 40; right: max(16px, 50% - 214px); bottom: calc(18px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(244, 236, 224, .7);
  background: radial-gradient(circle at 35% 30%, #7c2530, #3e0c12);
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 15px; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .5);
}
.music-btn span { width: 3px; height: 6px; border-radius: 2px; background: var(--cream); }
.music-btn.playing span { animation: eq .9s ease-in-out infinite; }
.music-btn.playing span:nth-child(2) { animation-delay: .2s; }
.music-btn.playing span:nth-child(3) { animation-delay: .4s; }
.music-btn.playing span:nth-child(4) { animation-delay: .1s; }
.music-btn:not(.playing)::after { content: ""; position: absolute; width: 30px; height: 2px; background: var(--cream); transform: rotate(-45deg); top: 50%; left: 50%; margin: -1px 0 0 -15px; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

/* ---------- Hộp thoại ---------- */
.sheet {
  width: min(100% - 24px, 440px); max-height: min(92vh, 860px); padding: 30px 22px 24px; border: 0; border-radius: 20px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow-y: auto;
}
.sheet::backdrop { background: rgba(30, 6, 9, .6); backdrop-filter: blur(3px); }
.sheet[open] { animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { 0% { opacity: 0; transform: translateY(20px) scale(.97); } 100% { opacity: 1; transform: none; } }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(81, 20, 25, .08); font-size: 1.5rem; line-height: 1; color: var(--wine); }
.sheet-title { font-family: var(--f-head); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .05em; color: var(--wine); text-align: center; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: .9rem; font-weight: 600; color: var(--wine); padding: 0; margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.col { flex-direction: column; }
.choices label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(81, 20, 25, .25); background: #fffdf9; font-size: .95rem; cursor: pointer; }
.choices label:has(input:checked) { border-color: var(--wine); background: rgba(81, 20, 25, .06); }
.choices input { accent-color: var(--wine); width: 18px; height: 18px; margin: 0; }
.attend-only { display: grid; gap: 12px; }
.sheet-done { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 20px 0 6px; }
.sheet-done svg { fill: var(--wine); }
.gift-tabs { display: flex; gap: 6px; padding: 4px; margin: 18px auto 0; width: fit-content; border-radius: 999px; background: rgba(81, 20, 25, .08); }
.gift-tabs button { border: 0; background: none; padding: 8px 20px; border-radius: 999px; font-family: var(--f-head); font-weight: 700; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; color: var(--wine); }
.gift-tabs button.on { background: var(--wine); color: var(--cream); box-shadow: 0 6px 14px -8px rgba(81, 20, 25, .9); }
.gift-cards { display: grid; gap: 16px; margin-top: 16px; }
.gift-card { position: relative; padding: 22px 18px 20px; border-radius: 16px; background: linear-gradient(#fff, #fffaf3); border: 1px solid rgba(181, 139, 47, .35); text-align: center; box-shadow: 0 14px 30px -20px rgba(54, 11, 16, .5); animation: rise .35s ease both; }
.gift-who { font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wine); }
.qr-frame { position: relative; width: 224px; margin: 14px auto 12px; padding: 12px; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(81, 20, 25, .12), 0 10px 24px -14px rgba(54, 11, 16, .45); }
.qr-frame img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--cream-2); border-radius: 6px; }
.qr-frame i { position: absolute; width: 22px; height: 22px; border: 3px solid var(--gold); }
.qr-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.qr-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.qr-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.qr-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.gift-owner { font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; }
.gift-bank { color: var(--muted); font-size: .92rem; }
.gift-number { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; font-family: var(--f-head); font-weight: 700; font-size: 1.3rem; letter-spacing: .08em; color: var(--wine); }
.gift-save { margin-top: 16px; width: 100%; }
.gift-steps { margin: 16px 0 0; padding: 12px 14px 12px 32px; background: rgba(181, 139, 47, .1); border-radius: 12px; font-size: .85rem; color: var(--ink); text-align: left; line-height: 1.6; }
.copy-btn { border: 1px solid var(--wine); background: none; color: var(--wine); border-radius: 999px; padding: 5px 12px; font-family: var(--f-body); font-size: .8rem; letter-spacing: 0; }

/* ---------- Xem ảnh ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(18, 4, 6, .95); touch-action: pan-y; }
.lb-img { max-width: 100vw; max-height: 86vh; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .25s; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 50%; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-count { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); color: rgba(255, 255, 255, .8); font-size: .9rem; letter-spacing: .1em; }

.toast { position: fixed; left: 50%; bottom: 90px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 999px; background: var(--wine-deep); color: var(--cream); font-size: .9rem; transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s, transform .9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Trang phụ: gửi ảnh, album khách, quản lý ---------- */
.subpage { padding: 34px 18px 60px; text-align: center; min-height: 100vh; }
.subpage .back { display: inline-block; margin-bottom: 18px; color: var(--wine); font-family: var(--f-head); font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.drop { display: block; border: 2px dashed rgba(81, 20, 25, .35); border-radius: 16px; padding: 28px 16px; background: rgba(255, 255, 255, .7); cursor: pointer; color: var(--wine); }
.drop input { display: none; }
.preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preview img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.grid-album { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 20px; }
.grid-album figure { margin: 0; }
.grid-album img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; cursor: zoom-in; background: var(--cream-2); }
.grid-album figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.page.wide { max-width: 1000px; }
.table-wrap { overflow-x: auto; text-align: left; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; background: #fff; }
th, td { border: 1px solid rgba(81, 20, 25, .15); padding: .45rem .6rem; vertical-align: top; }
th { background: var(--wine); color: var(--cream); font-weight: 600; }
.stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 18px 0 6px; }
.stats div { background: #fff; border-radius: 12px; padding: 8px 14px; border: 1px solid rgba(181, 139, 47, .3); font-size: .85rem; color: var(--muted); }
.stats b { display: block; font: 700 1.6rem var(--f-head); color: var(--wine); }
