:root {
  --wine: #511419;
  --wine-2: #6e1a20;
  --wine-3: #380a0e;
  --wine-ink: #590310;
  --cream: #ece4d8;
  --cream-soft: rgba(236, 228, 216, .7);
  --page: #fff7eb;
  --card: rgba(255, 250, 243, .96);
  --gold: #c9a24a;
  --f-name: "Viaoda Libre", "Times New Roman", serif;
  --f-lora: "Lora", Georgia, serif;
  --f-std: "Cormorant Garamond", "Times New Roman", serif;
  --f-script: "The Nautigal", "Ms Madi", cursive;
  --f-amp: "Ms Madi", "The Nautigal", cursive;
  --f-role: "Uchen", "Times New Roman", serif;
  --f-bask: Baskerville, "Baskerville Old Face", "Times New Roman", serif;
  --f-times: "Times New Roman", Times, serif;
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .58 0 0 0 0 .5 0 0 0 0 .4 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .6 0 0 0 0 .52 0 0 0 0 .42 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #1c1917; }
body { margin: 0; color: var(--wine); font-family: var(--f-bask); font-weight: 300; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
p, h2, figure { margin: 0; }
button { font: inherit; color: inherit; }

/* ================= Trang ================= */
.page {
  position: relative; max-width: 440px; margin: 0 auto; overflow: hidden;
  background: var(--page); padding: 0 0 56px; min-height: 100vh;
}
.page-paper { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: var(--paper); opacity: .5; pointer-events: none; }
.page > * { position: relative; }
.wrap { position: relative; margin: 0 22px; }

.h {
  font-family: var(--f-times); font-weight: 700; font-size: 20px; line-height: 30px;
  letter-spacing: .024em; text-transform: uppercase; color: var(--cream); text-align: center;
}
.h.dark { color: var(--wine); letter-spacing: .03em; }
.h.sm { font-size: 16px; line-height: 24px; }

/* Hoa trang trí */
.floral { position: absolute; pointer-events: none; z-index: 3; }
.float { animation: drFloat 6s ease-in-out infinite; }
.side-fl { width: 132px; }
.side-fl-r { right: -66px; top: 300px; transform: scaleX(-1); animation-delay: .3s; }
.side-fl-l { left: -44px; top: 90px; width: 86px; animation-delay: .6s; }
.side-fl-r2 { right: -46px; top: -24px; width: 104px; transform: scaleX(-1); animation-delay: .9s; }
.side-fl-r.float, .side-fl-r2.float { animation-name: drFloatFlip; }

/* ================= Panel đỏ đô ================= */
.panel {
  position: relative; background: var(--wine); color: var(--cream); border-radius: 13px;
  padding: 40px 20px 36px; text-align: center; overflow: hidden;
  box-shadow: 0 18px 36px -14px rgba(56, 10, 14, .55);
}
.panel-paper { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: var(--paper); opacity: .4; mix-blend-mode: soft-light; pointer-events: none; }
.panel > :not(.panel-paper) { position: relative; }

/* ================= Hero ================= */
.hero { padding: 60px 0 40px; text-align: center; }
.std { font-family: var(--f-std); font-weight: 600; font-size: 15px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--wine-ink); }
.env { position: relative; width: 248px; height: 286px; margin: 104px auto 0; }
.env-back { position: absolute; top: 0; left: 0; width: 248px; height: 286px; }
.env-photo {
  position: absolute; left: 40px; top: -20px; width: 172px; height: 214px;
  background: #fff; border: 7px solid #fff; box-shadow: 0 10px 22px rgba(56, 10, 14, .22);
  transform: rotate(4deg); z-index: 1;
}
.env-photo img { width: 100%; height: 100%; object-fit: cover; }
.env-front { position: absolute; left: 0; bottom: 0; width: 248px; height: 163px; z-index: 2; filter: drop-shadow(0 -2px 4px rgba(80, 50, 30, .12)); }
.hero-fl { left: -52px; top: -60px; width: 150px; transform: rotate(-6deg); z-index: 3; }
.hero-names { position: relative; margin-top: 64px; }
.hero-names p { font-family: var(--f-name); font-weight: 300; font-size: 41.25px; line-height: 1; color: var(--wine); position: relative; }
.hero-names p + p { margin-top: 22px; }
.hero-amp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%);
  font-family: var(--f-script); font-size: 92px; line-height: 1; color: rgba(81, 20, 25, .15);
}

/* ================= Lễ cưới ================= */
.fam { display: flex; justify-content: center; margin: 22px 0 26px; }
.fam > div { flex: 1; }
.fam-bar { width: 1px; background: rgba(236, 228, 216, .3); margin: 2px 6px; }
.fam-label { font-size: 12px; line-height: 18px; color: var(--cream-soft); margin-bottom: 3px; }
.fam-name { font-size: 12px; line-height: 21px; font-weight: 600; }
.fam-addr { font-size: 10px; line-height: 12.5px; color: var(--cream-soft); margin-top: 4px; }
.announce { font-size: 16px; line-height: 24px; }
.cp-name { font-family: var(--f-name); font-size: 31px; line-height: 52px; margin-top: 34px; }
.cp-amp + .cp-name { margin-top: 0; }
.cp-role { font-family: var(--f-role); font-size: 10px; line-height: 15px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--cream-soft); margin-top: 8px; }
.cp-amp { font-family: var(--f-amp); font-size: 35px; line-height: 52.5px; margin-top: 8px; }
.held { font-size: 16px; line-height: 24px; color: var(--cream-soft); margin: 30px 0 26px; }

.dt-row { display: flex; justify-content: center; gap: 30px; font-size: 13px; line-height: 19.5px; text-transform: uppercase; color: var(--cream-soft); }
.dt-main { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 16px 0 14px; }
.dt-day { font-family: var(--f-times); font-size: 40px; line-height: 40px; }
.dt-bar { width: 1px; height: 46px; background: rgba(236, 228, 216, .5); }
.dt-my { display: flex; flex-direction: column; text-align: left; font-family: var(--f-times); font-size: 14px; line-height: 21px; text-transform: uppercase; }
.dt-my.alt span:first-child { font-size: 12px; line-height: 18px; }
.dt-my.alt span:last-child { font-size: 18px; line-height: 27px; }
.dt-lunar { font-size: 12px; line-height: 16px; letter-spacing: 1.44px; text-transform: uppercase; color: var(--cream-soft); }

/* ================= Album (coverflow) ================= */
.album { padding: 44px 0 28px; text-align: center; }
.album .h { margin-bottom: 30px; }
.cf { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 22% 10px; scrollbar-width: none; outline: none; }
.cf::-webkit-scrollbar { display: none; }
.cf-item { flex: 0 0 205px; height: 309px; border-radius: 16px; overflow: hidden; scroll-snap-align: center; background: #e8ddd0; box-shadow: 0 14px 28px -10px rgba(56, 10, 14, .35); }
.cf-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.js .cf { display: block; position: relative; height: 320px; overflow: visible; padding: 0; perspective: 1000px; touch-action: pan-y; cursor: grab; }
.js .cf-item { position: absolute; left: 50%; top: 0; width: 205px; margin-left: -102.5px; transition: transform .55s cubic-bezier(.22, .8, .3, 1), opacity .55s ease; cursor: pointer; }
.cf-dots { display: none; }
.js .cf-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.cf-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(81, 20, 25, .2); transition: width .3s ease, background .3s ease; cursor: pointer; }
.cf-dots button.on { width: 24px; background: rgba(81, 20, 25, .7); }

/* ================= Tiệc cưới ================= */
.panel .h + .sub { margin-top: 18px; }
.sub { font-size: 16px; line-height: 24px; text-transform: uppercase; margin-bottom: 14px; }
.tt { display: flex; justify-content: center; gap: 46px; margin: 26px 0 30px; }
.tt-l { font-size: 12px; line-height: 16px; letter-spacing: .6px; text-transform: uppercase; color: var(--cream-soft); }
.tt-v { font-size: 18px; line-height: 28px; font-weight: 500; margin-top: 4px; }

.cal { background: var(--cream); color: var(--wine); border-radius: 10px; padding: 22px 16px 18px; margin: 0 -11px; }
.cal-title { font-family: var(--f-script); font-size: 25px; line-height: 37.5px; letter-spacing: .625px; margin-bottom: 14px; }
.cal-head, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head { border-top: 1px solid rgba(81, 20, 25, .25); border-bottom: 2px solid var(--wine); padding: 6px 0; font-size: 10px; line-height: 15px; font-weight: 500; color: rgba(81, 20, 25, .7); }
.cal-days { row-gap: 14px; padding-top: 16px; font-size: 12px; line-height: 18px; }
.cal-days span { position: relative; display: flex; align-items: center; justify-content: center; height: 18px; }
.cal-days .is-day svg { position: absolute; width: 26px; height: 26px; fill: var(--wine); animation: beat 1.6s ease-in-out infinite; }
.cal-days .is-day b { position: relative; color: #fff; font-size: 11px; font-weight: 700; }

.add-cal { display: inline-block; margin-top: 30px; font-family: var(--f-times); font-size: 14px; line-height: 20px; color: var(--cream); text-decoration: underline; text-underline-offset: 5px; }
.btn-cream {
  display: block; width: 202px; height: 36px; margin: 26px auto 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--cream); color: var(--wine); font-family: var(--f-bask); font-size: 14px; line-height: 36px; letter-spacing: .35px; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-cream:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 0, 0, .25); background: #f5efe6; }
.btn-cream:active { transform: scale(.97); }

/* ================= Địa điểm ================= */
.venue { padding: 52px 24px 0; text-align: center; }
.venue-addr { font-size: 12px; line-height: 19.5px; color: rgba(81, 20, 25, .8); margin: 8px 12px 18px; }
.venue-addr b { font-weight: 600; }
.map { border-radius: 15px; overflow: hidden; background: #fff; box-shadow: 0 10px 26px -10px rgba(56, 10, 14, .3); }
.map iframe { display: block; width: 100%; height: 268px; border: 0; }
.dir { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; line-height: 20px; font-weight: 600; color: rgba(81, 20, 25, .8); text-decoration: none; }
.dir svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* ================= Dress code ================= */
.dress { padding: 64px 0 56px; text-align: center; }
.dress-note { font-family: var(--f-times); font-size: 14px; line-height: 20px; color: rgba(81, 20, 25, .8); margin-top: 2px; }
.sw { display: flex; justify-content: center; gap: 16px; margin-top: 18px; }
.sw span { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 4px 10px rgba(56, 10, 14, .18); transition: transform .25s ease; }
.sw span:last-child { border: 1.5px solid rgba(81, 20, 25, .19); }
.sw span:hover { transform: translateY(-3px) scale(1.06); }

/* ================= Lịch trình ================= */
.tl-panel { border-radius: 10px; padding: 40px 14px 34px; }
.tl { list-style: none; margin: 24px 0 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 164px; top: 12px; bottom: 12px; width: 1px; background: rgba(236, 228, 216, .5); }
.tl li { display: grid; grid-template-columns: 40px 1fr 18px 1fr; align-items: center; column-gap: 12px; min-height: 58px; }
.tl-ic img { width: 40px; height: 40px; }
.tl-t { font-family: var(--f-times); font-size: 16px; line-height: 22px; letter-spacing: .4px; text-align: right; }
.tl-d { width: 11px; height: 11px; border-radius: 50%; background: var(--cream); justify-self: center; box-shadow: 0 0 0 3px rgba(236, 228, 216, .18); }
.tl-l { font-family: var(--f-times); font-size: 13px; line-height: 19.5px; color: var(--cream-soft); text-align: left; }

/* ================= Lưu bút ================= */
.guest { padding: 60px 24px 0; }
.note {
  position: relative; padding: 46px 22px 28px; text-align: center;
  background: #f6ecdc; border-radius: 4px;
  box-shadow: 0 14px 30px -14px rgba(56, 10, 14, .35), inset 0 0 40px rgba(170, 130, 90, .18);
}
.note::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: var(--paper); opacity: .6; pointer-events: none; border-radius: inherit; }
.note::after { content: ""; position: absolute; top: -10px; left: 50%; width: 92px; height: 22px; margin-left: -46px; background: rgba(201, 162, 74, .35); transform: rotate(-2deg); }
.note > * { position: relative; }
.wish-form { margin-top: 18px; display: grid; gap: 10px; text-align: left; }
.wish-form input, .wish-form textarea {
  width: 100%; font-family: var(--f-times); font-size: 15px; color: var(--wine);
  background: rgba(255, 255, 255, .6); border: 1px solid rgba(81, 20, 25, .25); border-radius: 8px; padding: 10px 12px; resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.wish-form input:focus, .wish-form textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(81, 20, 25, .12); }
.wish-form ::placeholder { color: rgba(81, 20, 25, .45); }
.wish-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.wand { width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(81, 20, 25, .1); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s ease, transform .2s ease; }
.wand svg { width: 18px; height: 18px; fill: none; stroke: var(--wine); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wand:hover { background: rgba(81, 20, 25, .18); transform: rotate(-10deg); }
.btn-wine {
  height: 36px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--wine); color: #ded9d7; font-family: var(--f-times); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 14px rgba(81, 20, 25, .3); transition: transform .2s ease, box-shadow .2s ease;
}
.btn-wine:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(81, 20, 25, .35); }
.btn-wine:active { transform: scale(.97); }

.wishes { list-style: none; margin: 22px 0 0; padding: 0 2px 4px; display: grid; gap: 13px; max-height: 380px; overflow-y: auto; }
.wishes li { background: rgba(255, 255, 255, .55); border: 1px solid rgba(81, 20, 25, .33); border-radius: 8px; padding: 14px 16px; }
.wishes li.new { animation: fade-in .5s ease both; }
.w-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.w-top b { font-family: var(--f-times); font-size: 14px; line-height: 20px; font-weight: 600; }
.w-top time { font-family: var(--f-times); font-size: 12px; line-height: 16px; opacity: .8; }
.wishes p { font-family: var(--f-times); font-size: 14px; line-height: 22.75px; margin-top: 6px; }

/* ================= Quà mừng (phong bì bay) ================= */
.gift { padding: 64px 0 24px; text-align: center; }
.ienv { position: relative; display: inline-block; width: 154px; height: 250px; border: 0; background: none; padding: 0; cursor: pointer; }
.ienv-shadow { position: absolute; left: 50%; top: 214px; width: 102px; height: 11px; margin-left: -51px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(4px); animation: ienvShadowPulse 3s ease-in-out infinite; }
.ienv-back, .ienv-card { position: absolute; left: 0; width: 154px; }
.ienv-back { top: 10px; height: 178px; transform: translateX(22%) translateY(-6%) scale(-.78, .78) rotate(-15deg); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18)); animation: ienvFloat 5.2s ease-in-out .5s infinite; }
.ienv-card { top: 96px; height: 101px; translate: -15%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .22)); animation: ienvFloatMain 3s ease-in-out infinite; }
.ienv:hover .ienv-card { animation: ienvFloatMain 3s ease-in-out infinite, ienvWave .9s ease-in-out; }
.sp { position: absolute; color: var(--gold); font-style: normal; font-size: 14px; pointer-events: none; animation: ienvSparkleAnim 2s ease-in-out infinite; }
.sp1 { left: 8px; top: 60px; }
.sp2 { right: 4px; top: 40px; animation-delay: .6s; font-size: 11px; }
.sp3 { left: 24px; top: 170px; animation-delay: 1.2s; font-size: 10px; }
.sp4 { right: 18px; top: 150px; animation-delay: 1.7s; }
.ienv-title { position: absolute; left: -40px; right: -40px; top: 226px; font-family: var(--f-times); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; color: var(--wine); }
.ienv-hint { position: absolute; left: -20px; right: -20px; top: 254px; font-size: 12px; color: rgba(81, 20, 25, .8); animation: ienvHintPulse 2s ease-in-out infinite; }
.gift { padding-bottom: 60px; }

.closing { text-align: center; padding: 30px 32px 0; }
.closing p { font-family: var(--f-times); font-size: 15px; line-height: 24px; color: rgba(81, 20, 25, .85); }
.closing-sign { margin-top: 14px; font-family: var(--f-name) !important; font-size: 24px !important; color: var(--wine) !important; }
.closing-sign span { font-family: var(--f-amp); }

/* ================= Bảng quà mừng ================= */
.sheet { max-width: 440px; margin: 0 auto; background: var(--page); }
.sheet-backdrop, .x { display: none; }
.sheet-head { background: var(--wine); height: 70px; display: flex; align-items: center; justify-content: center; position: relative; }
.sheet-head h2 { font-family: var(--f-times); font-size: 20px; font-weight: 700; text-transform: uppercase; color: #fff; letter-spacing: .03em; }
.sheet-body { display: grid; gap: 22px; padding: 22px 24px 32px; }
.qr-card { text-align: center; }
.qr-who { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-size: 12px; line-height: 16px; font-weight: 500; margin-bottom: 10px; }
.qr-box { width: 128px; height: 128px; margin: 0 auto; padding: 8px; background: #fff; border: 2px solid rgba(81, 20, 25, .125); border-radius: 12px; }
.qr-box img { width: 108px; height: 108px; }
.qr-bank, .qr-num, .qr-holder { font-family: system-ui, -apple-system, sans-serif; font-size: 11px; line-height: 17px; }
.qr-bank { margin-top: 8px; }
.qr-num { font-family: ui-monospace, Menlo, monospace; }
.qr-holder { font-weight: 600; }
.qr-save { display: inline-block; margin-top: 6px; padding: 3px 14px; border-radius: 99px; background: rgba(81, 20, 25, .08); color: var(--wine); font-family: system-ui, -apple-system, sans-serif; font-size: 11px; font-weight: 500; text-decoration: none; }

.js .sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 80; max-width: none; background: none; visibility: hidden; }
.js .sheet.open { visibility: visible; }
.js .sheet-backdrop { display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .3s ease; }
.js .sheet.open .sheet-backdrop { opacity: 1; }
.js .sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 440px; margin: 0 auto; max-height: 86vh; overflow-y: auto;
  background: var(--page); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 50px -12px rgba(0, 0, 0, .35);
  transform: translateY(100%); transition: transform .45s cubic-bezier(.22, .9, .3, 1);
}
.js .sheet.open .sheet-panel { transform: none; }
.js .sheet-head { position: sticky; top: 0; z-index: 1; }
.js .x { display: flex; position: absolute; right: 12px; top: 19px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; align-items: center; justify-content: center; cursor: pointer; }
.js .sheet-body { grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* ================= Lightbox ================= */
.lb { display: none; }
.js .lb { display: flex; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; background: rgba(0, 0, 0, .85); align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.js .lb.open { opacity: 1; visibility: visible; }
.lb-img { max-width: calc(100% - 80px); max-height: 66vh; border-radius: 12px; object-fit: contain; transition: opacity .25s ease; }
.lb-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.lb-count { background: rgba(0, 0, 0, .4); padding: 3px 10px; border-radius: 99px; font-family: system-ui, sans-serif; font-size: 14px; }
.lb-x, .lb-nav { border: 0; background: none; color: #fff; cursor: pointer; font-family: system-ui, sans-serif; }
.lb-x { font-size: 20px; width: 32px; height: 32px; }
.lb-nav { position: absolute; top: 50%; font-size: 30px; width: 36px; height: 48px; margin-top: -24px; }
.lb-nav.prev { left: 8px; }
.lb-nav.next { right: 8px; }
.lb-thumbs { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: rgba(0, 0, 0, .3); border-radius: 8px; max-width: calc(100% - 32px); overflow-x: auto; }
.lb-thumbs button { flex: 0 0 46px; width: 46px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; opacity: .55; cursor: pointer; transition: opacity .2s, border-color .2s; }
.lb-thumbs button.on { opacity: 1; border-color: #fff; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ================= Bìa thiệp ================= */
.cover { display: none; }
.js .cover {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(to right bottom, var(--wine-2), var(--wine), var(--wine-3));
}
.js.cover-on body { overflow: hidden; }
.cover-wrap { position: relative; width: 310px; }
.cover-card { position: relative; border-radius: 8px; box-shadow: 0 25px 60px -12px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .2), 0 0 40px rgba(81, 20, 25, .15); animation: envelope-float 6s ease-in-out infinite; }
.cover-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 8px; background: var(--card); overflow: hidden; }
.cover-bg::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: var(--paper); opacity: .35; }
.cover-fl { width: 115px; opacity: .8; z-index: 1; }
.cover-fl-tl { left: -7px; top: -27px; transform: rotate(-4deg); animation: drFloat 5s ease-in-out infinite; }
.cover-fl-br { right: -10px; bottom: -14px; transform: rotate(176deg); animation: drFloatRot 5.5s ease-in-out .6s infinite; }
.cover-body { position: relative; z-index: 2; text-align: center; padding: 42px 24px 56px; }
.seal {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #7a2430, var(--wine) 60%, #3a0b10);
  box-shadow: 0 8px 18px rgba(81, 20, 25, .45), inset 0 -3px 6px rgba(0, 0, 0, .35), inset 0 2px 4px rgba(255, 255, 255, .15);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 30px;
  animation: seal-pulse 2.6s ease-in-out infinite;
}
.seal svg { width: 24px; height: 24px; fill: #fff7ee; }
.seal-ring { position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; border-radius: 50%; border: 1.5px solid rgba(81, 20, 25, .35); opacity: 0; }
.cover-name { font-family: var(--f-name); font-weight: 300; font-size: 41.25px; line-height: 1.1; color: var(--wine); }
.cover-amp { font-family: var(--f-script); font-size: 22px; line-height: 1; color: var(--wine); margin: 2px 0 4px; }
.orn { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 10px; }
.orn i { width: 40px; height: 1px; background: linear-gradient(to right, transparent, var(--wine)); }
.orn i:last-child { background: linear-gradient(to left, transparent, var(--wine)); }
.orn span { font-size: 14px; color: var(--wine); opacity: .7; }
.cover-date, .cover-invite { font-family: var(--f-lora); font-weight: 300; font-size: 18px; line-height: 27px; color: rgba(81, 20, 25, .72); }
.cover-invite { margin: 20px 0 24px; }
.btn-open {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 32px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--wine); color: #f3e8de; font-family: var(--f-lora); font-size: 18px; line-height: 28px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(81, 20, 25, .35); transition: transform .25s ease, box-shadow .25s ease;
}
.btn-open:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 24px rgba(81, 20, 25, .45); }
.btn-open:active { transform: scale(.96); }
.shine { position: absolute; top: 0; left: -100%; width: 32px; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent); animation: shine 3s ease-in-out infinite; pointer-events: none; }

/* Hiệu ứng mở thiệp */
.cover.opening .seal { animation: seal-break .6s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.cover.opening .seal-ring { animation: seal-ring .7s ease-out forwards; }
.cover.opening .cover-card { animation: envelope-away .9s cubic-bezier(.6, 0, .4, 1) .45s forwards; }
.cover.opening { animation: cover-fade .6s ease 1s forwards; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; animation: particle-burst 1.1s cubic-bezier(.15, .7, .3, 1) forwards; }
.burst svg { width: 100%; height: 100%; }

/* ================= Tim rơi ================= */
.ambient { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 75; pointer-events: none; overflow: hidden; }
.ambient div { position: absolute; top: -30px; opacity: 0; }
.ambient svg { display: block; width: 1em; height: 1em; fill: currentColor; }

/* ================= Nút nhạc ================= */
.cd { position: fixed; right: 14px; bottom: 18px; z-index: 60; width: 60px; height: 60px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.cd-disc { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: conic-gradient(from 0deg, #3d0c11, #6e1a20, #511419, #8c3a3f, #3d0c11); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.cd-disc::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: linear-gradient(to right top, rgba(255, 255, 255, .3), transparent 55%); }
.cd[aria-pressed="true"] .cd-disc { animation: spin-cd 4s linear infinite; }
.cd-eq { position: absolute; left: 50%; top: 50%; display: flex; align-items: flex-end; gap: 3px; height: 18px; transform: translate(-50%, -50%); }
.cd-eq i { width: 4px; height: 6px; background: #fff; border-radius: 2px; }
.cd[aria-pressed="true"] .cd-eq i { animation: eq .9s ease-in-out infinite alternate; }
.cd-eq i:nth-child(2) { height: 14px; animation-delay: .2s !important; }
.cd-eq i:nth-child(3) { height: 10px; animation-delay: .4s !important; }

/* ================= Toast ================= */
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 95; transform: translate(-50%, 20px); background: rgba(40, 10, 13, .92); color: #fff; padding: 10px 18px; border-radius: 99px; font-family: system-ui, sans-serif; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= Hiện dần khi cuộn ================= */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.22, .8, .3, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ================= Keyframes ================= */
@keyframes drFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes drFloatFlip { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes drFloatRot { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }
@keyframes shine { 0% { left: -100%; } 50%, 100% { left: 100%; } }
@keyframes envelope-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes seal-pulse { 0%, 100% { box-shadow: 0 8px 18px rgba(81, 20, 25, .45), 0 0 0 0 rgba(81, 20, 25, .25), inset 0 -3px 6px rgba(0, 0, 0, .35); } 50% { box-shadow: 0 8px 18px rgba(81, 20, 25, .45), 0 0 0 10px rgba(81, 20, 25, 0), inset 0 -3px 6px rgba(0, 0, 0, .35); } }
@keyframes seal-break { 0% { transform: scale(1); } 35% { transform: scale(1.25) rotate(-8deg); } 100% { transform: scale(0); opacity: 0; } }
@keyframes seal-ring { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes envelope-away { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-40px) scale(.92); opacity: 0; } }
@keyframes cover-fade { to { opacity: 0; visibility: hidden; } }
@keyframes particle-burst { 0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(var(--s)) rotate(var(--r)); opacity: 0; } }
@keyframes ambient-fall { 0% { transform: translateY(-8vh) translateX(0) rotate(0); opacity: 0; } 10% { opacity: .5; } 50% { transform: translateY(48vh) translateX(var(--sway, 20px)) rotate(180deg); opacity: .6; } 92% { opacity: .45; } 100% { transform: translateY(105vh) translateX(0) rotate(360deg); opacity: 0; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ienvFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes ienvFloatMain { 0%, 100% { translate: -15% 0; } 50% { translate: -15% -7px; } }
@keyframes ienvShadowPulse { 0%, 100% { transform: scaleX(1); opacity: .28; } 50% { transform: scaleX(.9); opacity: .16; } }
@keyframes ienvSparkleAnim { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes ienvHintPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes ienvWave { 0% { transform: scale(1.12) rotate(0); } 20% { transform: scale(1.12) rotate(-6deg); } 40% { transform: scale(1.12) rotate(4.5deg); } 60% { transform: scale(1.12) rotate(-3deg); } 80% { transform: scale(1.12) rotate(1.5deg); } 100% { transform: scale(1.12) rotate(0); } }
@keyframes spin-cd { to { transform: rotate(360deg); } }
@keyframes eq { from { transform: scaleY(.4); } to { transform: scaleY(1.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ambient { display: none; }
}

@media (min-width: 480px) {
  .page { margin: 0 auto; box-shadow: 0 0 80px rgba(0, 0, 0, .5); }
}
