/* ============ #closing — màn kết ngà & vàng ============ */
#closing {
  --cl-ivory: #FFFDF8; --cl-cream: #FBF7F0; --cl-champ: #EFE3CC;
  --cl-gold: #B8893B; --cl-gold-l: #D9B66E; --cl-gold-d: #8A6224; --cl-ink: #3B332B;
  padding: 0 0 calc(100px + env(safe-area-inset-bottom, 0px)); /* chừa chỗ thanh điều hướng nổi */
  text-align: center;
  color: var(--cl-ink);
  background:
    radial-gradient(90% 40% at 50% 62%, rgba(239,227,204,.55), transparent 70%),
    linear-gradient(180deg, var(--cl-ivory) 0%, var(--cl-cream) 55%, #F6EEDF 100%);
}

/* ---------- sân khấu cổng vòm ---------- */
#closing .cl-stage {
  position: relative; width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden; isolation: isolate;
}
@supports not (aspect-ratio: 1) { #closing .cl-stage { height: 0; padding-bottom: 177.78%; } }

#closing .cl-wash {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(48% 30% at 50% 40%, rgba(255,253,248,1), rgba(255,253,248,0) 72%),
    radial-gradient(70% 45% at 50% 42%, rgba(239,227,204,.7), transparent 72%),
    linear-gradient(180deg, #FFFDF8 0%, #FBF7F0 60%, #F4EBDB 100%);
}
#closing .cl-layer { position: absolute; inset: 0; pointer-events: none; }
#closing .cl-l-rays { z-index: 1; display: grid; place-items: center; }
#closing .cl-rays {
  width: 150%; aspect-ratio: 1; margin-top: -18%;
  background: repeating-conic-gradient(from 0deg, rgba(217,182,110,.16) 0deg 3deg, rgba(217,182,110,0) 3deg 15deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, rgba(0,0,0,.5) 45%, transparent 72%);
          mask: radial-gradient(closest-side, #000 18%, rgba(0,0,0,.5) 45%, transparent 72%);
  animation: cl-spin 90s linear infinite; animation-play-state: paused;
}
#closing.is-live .cl-rays { animation-play-state: running; }
@keyframes cl-spin { to { transform: rotate(360deg); } }

#closing .cl-l-frame { z-index: 2; inset: -3%; }
#closing .cl-frame { width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* khung dự phòng nếu SVG không tải được */
#closing .cl-stage.no-frame::before,
#closing .cl-stage.no-frame::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  left: 9%; right: 9%; top: 9%; bottom: 6%;
  border: 1.5px solid var(--cl-gold-l);
  border-radius: 50% 50% 6px 6px / 28% 28% 6px 6px;
}
#closing .cl-stage.no-frame::after { left: 11.5%; right: 11.5%; top: 11%; bottom: 7.5%; border-width: 1px; border-color: rgba(184,137,59,.45); }

/* ---------- chữ trong vòm ---------- */
#closing .cl-content {
  position: absolute; z-index: 3;
  left: 17%; right: 17%; top: 20%; bottom: 27%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* huy hiệu tròn chibi (khung vàng 2 viền) */
#closing .cl-medal {
  position: relative; display: block; flex: none;
  width: clamp(50px, 14.5vw, 72px); height: clamp(50px, 14.5vw, 72px);
  margin: 0 auto 6px; padding: 3px; border-radius: 50%;
  background: linear-gradient(135deg, #8A6224 0%, #D9B66E 38%, #F3DEA4 52%, #C99A4B 72%, #8A6224 100%);
  box-shadow: 0 6px 16px -8px rgba(138,98,36,.55);
}
#closing .cl-medal::after { /* viền chỉ trong */
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(217,182,110,.75); pointer-events: none;
}
#closing .cl-medal img {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; background: radial-gradient(circle at 50% 35%, #FFFDF8, #F3EADB);
  box-shadow: inset 0 0 0 2px #FFFDF8;
  border: 2px solid #FFFDF8;
}
#closing .cl-kicker {
  margin: 0 0 6px;
  font-family: var(--font-sans); font-weight: 500; font-size: 10.5px;
  letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; color: var(--cl-gold-d);
}
#closing .cl-title {
  margin: 0; padding: .06em .2em .12em;
  font-size: clamp(40px, 12.4vw, 60px); line-height: 1.12;
  filter: drop-shadow(0 2px 5px rgba(255,253,248,.9)) drop-shadow(0 1px 0 rgba(138,98,36,.12));
}
#closing .cl-title.script-fb,
#closing .script-fb { font-family: "Dancing Script", cursive; font-weight: 500; }
#closing .cl-divider { width: min(170px, 70%); height: auto; margin: 6px auto 8px; }
#closing .cl-names {
  margin: 0; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 .32em;
  font-family: var(--font-display); font-size: clamp(17px, 5vw, 23px); line-height: 1.3; letter-spacing: .02em; color: var(--cl-ink);
}
#closing .cl-amp { font-size: 1.5em; line-height: 1; padding: 0 .08em; }
#closing .cl-date {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  margin-top: 12px; padding: 7px 16px 8px;
  border-top: 1px solid rgba(184,137,59,.55); border-bottom: 1px solid rgba(184,137,59,.55);
}
#closing .cl-date-wd { font-family: var(--font-sans); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--cl-gold-d); }
#closing .cl-date-num { font-family: var(--font-display); font-size: clamp(20px, 6vw, 25px); letter-spacing: .08em; color: var(--cl-ink); }
#closing .cl-date-num i { font-style: normal; color: var(--cl-gold); padding: 0 .28em; }
#closing .cl-date-lunar { font-family: var(--font-serif); font-style: italic; font-size: 13px; color: #6E6253; }

/* ---------- chim công ---------- */
#closing .cl-l-peacock { z-index: 4; inset: auto; bottom: 6%; width: 31%; }
#closing .cl-l-peacock--l { left: 0; }
#closing .cl-l-peacock--r { right: 0; }
#closing .cl-peacock { width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(138,98,36,.16)); }
#closing .cl-l-peacock--r .cl-peacock { transform: scaleX(-1); }

/* ---------- dải hoa chuyển tiếp ---------- */
#closing .cl-garland {
  position: relative; z-index: 4;
  width: 112%; margin: -13% -6% 0; pointer-events: none;
}
#closing .cl-garland img { width: 100%; height: auto; }

/* ---------- thẻ địa điểm (nghiêng 3D) ---------- */
#closing .cl-venue-wrap { position: relative; z-index: 3; padding: 6px var(--gutter) 0; }
#closing .cl-venue {
  position: relative; max-width: 360px; margin: 0 auto;
  padding: 26px 24px 22px; border-radius: 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,253,248,1), rgba(251,247,240,1) 60%, rgba(244,235,219,1));
  border: 1px solid rgba(184,137,59,.5);
  box-shadow: inset 0 0 0 5px #FFFDF8, inset 0 0 0 6px rgba(217,182,110,.55), 0 10px 30px -18px rgba(138,98,36,.35);
}
#closing .cl-venue-corner {
  position: absolute; width: 28px; height: 28px; pointer-events: none;
  border: 1.5px solid var(--cl-gold-l);
}
#closing .cl-venue-corner--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
#closing .cl-venue-corner--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
#closing .cl-venue-kicker {
  margin: 0 0 6px; font-family: var(--font-sans); font-weight: 500; font-size: 10.5px;
  letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--cl-gold-d);
}
#closing .cl-venue-place {
  margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(19px, 5.6vw, 23px); line-height: 1.3; color: var(--cl-ink);
  text-wrap: balance;
}
#closing .cl-venue-addr { margin: 6px 0 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.45; color: #6E6253; text-wrap: balance; max-width: 26ch; margin-left: auto; margin-right: auto; }
#closing .cl-venue-map {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 18px;
  border-radius: 999px; border: 1px solid rgba(184,137,59,.6);
  font-family: var(--font-sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  color: var(--cl-gold-d); background: rgba(255,253,248,.8);
  position: relative; z-index: 7; /* trên vệt sáng */
}
#closing .cl-hashtag {
  margin: 14px 0 0; font-family: var(--font-sans); font-size: 13px; letter-spacing: .12em; color: var(--cl-gold);
}

/* ---------- cảm ơn ---------- */
#closing .cl-thanks { position: relative; z-index: 3; padding: 42px var(--gutter) 0; }
#closing .cl-lotus { width: 64px; height: auto; margin: 0 auto 4px; }
#closing .cl-thanks-title {
  margin: 0; padding: .04em .2em .1em;
  font-size: clamp(38px, 11.6vw, 54px); line-height: 1.2;
}
#closing .cl-thanks-note {
  margin: 4px auto 0; max-width: 26ch;
  font-family: var(--font-serif); font-style: italic; font-size: 17px; line-height: 1.45; color: #6E6253;
}
/* dấu sáp đỏ son in monogram */
#closing .cl-mono { width: 92px; margin: 22px auto 0; transform: rotate(-6deg); }
#closing .cl-mono svg { display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(110,18,15,.28)) drop-shadow(0 1px 1px rgba(60,10,8,.35)); }
#closing .cl-foot { position: relative; z-index: 3; padding: 26px var(--gutter) 0; }
#closing .cl-love {
  margin: 0; padding-top: 16px; border-top: 1px solid rgba(184,137,59,.3);
  max-width: 300px; margin-inline: auto;
  font-family: var(--font-sans); font-size: 12px; letter-spacing: .06em; color: #6E6253;
}
#closing .cl-love span { color: var(--cl-gold); }

/* ---------- trái tim vàng + chút confetti lá vàng rơi ---------- */
#closing .cl-confetti { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
#closing .cl-cf {
  position: absolute; top: -30px;
  width: var(--s, 10px); height: calc(var(--s, 10px) * .78);
  opacity: 0;
  animation: cl-fall-heart var(--t, 14s) var(--d, 0s) linear infinite;
  animation-play-state: paused;
  will-change: transform, opacity;
}
#closing.is-live .cl-cf { animation-play-state: running; }
#closing .cl-cf--heart {
  height: calc(var(--s, 10px) * .9);
  background: var(--fx-heart-foil) center / contain no-repeat;
  animation-name: cl-fall-heart;
}
#closing .cl-cf--line { background-image: var(--fx-heart-line); }
#closing .cl-cf--foil {
  width: calc(var(--s, 10px) * .5); height: var(--s, 10px); border-radius: 1px;
  background: linear-gradient(90deg, #8A6224, #F3DEA4 50%, #B8893B);
  animation-name: cl-fall-flip;
}
/* trái tim: rơi chậm, đung đưa nhẹ (không lộn vòng) */
@keyframes cl-fall-heart {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg)); }
  8%   { opacity: .85; }
  25%  { transform: translate3d(calc(var(--x, 30px) * .7), calc(var(--cl-fall, 1600px) * .25), 0) rotate(calc(var(--r0, 0deg) * -1)); }
  50%  { transform: translate3d(var(--x, 30px), calc(var(--cl-fall, 1600px) * .5), 0) rotate(var(--r0, 0deg)); }
  75%  { transform: translate3d(calc(var(--x, 30px) * .3), calc(var(--cl-fall, 1600px) * .75), 0) rotate(calc(var(--r0, 0deg) * -1)); }
  92%  { opacity: .7; }
  100% { opacity: 0; transform: translate3d(0, var(--cl-fall, 1600px), 0) rotate(var(--r0, 0deg)); }
}
@keyframes cl-fall-flip {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) rotateX(0deg); }
  8%   { opacity: .95; }
  50%  { transform: translate3d(var(--x, 30px), calc(var(--cl-fall, 1600px) * .5), 0) rotate(160deg) rotateX(540deg); }
  92%  { opacity: .8; }
  100% { opacity: 0; transform: translate3d(0, var(--cl-fall, 1600px), 0) rotate(320deg) rotateX(1080deg); }
}

@media (prefers-reduced-motion: reduce) {
  #closing .cl-confetti { display: none; }
  #closing .cl-rays { animation: none; }
}
