/* =========================================================
   Đếm ngược Giao thừa Xuân Đinh Mùi 2027
   ========================================================= */
:root {
  --son: #B5121B;
  --vang-ruou: #720E16;
  --kim: #F5C451;
  --champ: #FFE5A0;
  --kem: #FFF4DE;
  --den: #250609;

  --ink: var(--kem);
  --ink-soft: rgba(255, 244, 222, .74);
  --ink-mute: rgba(255, 244, 222, .55);
  --line: rgba(245, 196, 81, .28);
  --line-strong: rgba(245, 196, 81, .6);
  --glass: rgba(60, 8, 14, .38);
  --glass-strong: rgba(48, 6, 11, .72);

  --f-display: "Playfair Display", "Times New Roman", serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-lg: 22px;
  --r-md: 14px;
  --gutter: 16px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --toolbar-h: 64px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--den);
  background-image:
    radial-gradient(120% 60% at 50% 0%, #3b0810 0%, transparent 60%),
    linear-gradient(180deg, #160205 0%, var(--den) 30%, #2c070c 70%, #1a0306 100%);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--champ); }
:focus-visible { outline: 2px solid var(--kim); outline-offset: 3px; border-radius: 8px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: 12px; transform: translateY(-200%); z-index: 100; background: var(--kim); color: var(--den); padding: 8px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: transform .2s; }
.skip:focus { transform: none; }
.noscript { position: fixed; inset: auto 0 0 0; padding: 12px; text-align: center; background: var(--son); margin: 0; z-index: 99; }

/* Canvas nền + pháo hoa */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
main, .footer { position: relative; z-index: 1; }

.brand {
  position: absolute; z-index: 5; top: max(14px, env(safe-area-inset-top)); left: var(--gutter);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-display); font-weight: 700; letter-spacing: .02em; color: var(--champ); font-size: 15px;
}
.brand-mark { width: 26px; height: 26px; filter: drop-shadow(0 0 8px rgba(245, 196, 81, .5)); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; text-align: center;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s;
}
.btn:active { transform: scale(.97); }
.btn-gold {
  color: #3a0a0e;
  background: linear-gradient(180deg, #FFE9AE 0%, var(--kim) 55%, #d9a23a 100%);
  box-shadow: 0 6px 22px -6px rgba(245, 196, 81, .6), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn-gold:hover { box-shadow: 0 10px 30px -6px rgba(245, 196, 81, .8), inset 0 1px 0 rgba(255, 255, 255, .6); transform: translateY(-1px); }
.btn-ghost { color: var(--champ); background: rgba(245, 196, 81, .06); border-color: var(--line-strong); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(245, 196, 81, .14); }
.btn-lg { min-height: 54px; padding: 14px 30px; font-size: 16px; }
.btn[aria-pressed="true"] .when-off, .btn[aria-pressed="false"] .when-on { display: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--kim); text-decoration: underline; font-weight: 600; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(72px + env(safe-area-inset-top)) var(--gutter) max(calc(var(--toolbar-h) + 44px), 16vh);
  overflow: hidden; isolation: isolate;
}
.hero-sky {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(40% 30% at 50% 8%, rgba(255, 229, 160, .16), transparent 70%),
    radial-gradient(70% 45% at 50% 100%, rgba(181, 18, 27, .45), transparent 70%),
    linear-gradient(180deg, rgba(10, 1, 3, .55) 0%, rgba(37, 6, 9, .1) 55%, rgba(114, 14, 22, .35) 100%);
}
.branch { position: absolute; top: 0; width: min(36vw, 420px); opacity: .95; height: auto; z-index: -1; pointer-events: none; will-change: transform; }
.branch-left { left: 0; transform-origin: top left; }
.branch-right { right: 0; transform-origin: top right; }
.wood { stroke: #6b3a22; }
.branch .wood { stroke: #43190f; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.blooms use { transform-box: fill-box; transform-origin: center; }
.branch .blooms use.sway { animation: bloom-sway 6s ease-in-out infinite alternate; }
@keyframes bloom-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(96px, 15vh, 170px); z-index: -1; pointer-events: none; }
.skyline .windows rect { opacity: .7; animation: window 5s ease-in-out infinite alternate; }
.skyline .windows rect:nth-child(3n) { animation-delay: -2s; }
.skyline .windows rect:nth-child(4n) { animation-delay: -3.5s; }
@keyframes window { from { opacity: .45; } to { opacity: .95; } }
.skyline .lanterns g { animation: lamp 3.4s ease-in-out infinite alternate; }
@keyframes lamp { from { opacity: .75; } to { opacity: 1; } }

.hero-inner { width: 100%; max-width: 980px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-inner[hidden] { display: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(37, 6, 9, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--champ); font-weight: 600;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--kim); box-shadow: 0 0 10px var(--kim); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.hero-title { margin: 0; font-family: var(--f-display); line-height: 1.02; letter-spacing: -.01em; }
.hero-title .t-small { display: block; font-size: clamp(20px, 4.4vw, 34px); font-weight: 600; font-style: italic; color: var(--champ); letter-spacing: .02em; margin-bottom: 6px; }
.hero-title .t-big { display: block; font-size: clamp(44px, 11vw, 112px); font-weight: 800; text-transform: uppercase; }
.glow {
  background: linear-gradient(180deg, #FFF6D8 0%, var(--champ) 30%, var(--kim) 62%, #c78a2a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(245, 196, 81, .35)) drop-shadow(0 2px 0 rgba(80, 10, 14, .6));
}
.tagline { margin: 14px 0 0; font-size: clamp(15px, 2.2vw, 19px); color: var(--ink-soft); max-width: 60ch; text-wrap: balance; }
.tagline i { font-style: normal; color: var(--kim); padding: 0 .2em; }

/* ---------------- Flip clock ---------------- */
.clock {
  --h: clamp(70px, min(15vw, 16vh), 150px);
  --w: clamp(74px, 17vw, 170px);
  --num: clamp(38px, min(9vw, 10vh), 96px);
  display: flex; align-items: flex-start; justify-content: center; gap: clamp(6px, 1.4vw, 14px);
  margin: clamp(26px, 5vh, 44px) 0 0; width: 100%;
}
.unit {
  flex: 0 1 var(--w); min-width: 0;
  padding: clamp(6px, 1vw, 10px);
  border-radius: calc(var(--r-lg) + 2px);
  background: linear-gradient(160deg, rgba(255, 229, 160, .16), rgba(255, 229, 160, .03) 40%, rgba(181, 18, 27, .12));
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 20px 50px -20px rgba(0, 0, 0, .8), 0 0 40px -10px rgba(245, 196, 81, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.flip { position: relative; height: var(--h); perspective: 700px; border-radius: var(--r-md); }
.flip .half, .flip .flap { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .top, .flip .flap-top {
  top: 0; border-radius: var(--r-md) var(--r-md) 0 0; transform-origin: 50% 100%;
  background: linear-gradient(180deg, rgba(150, 18, 28, .92), rgba(110, 12, 20, .94));
}
.flip .bottom, .flip .flap-bottom {
  bottom: 0; border-radius: 0 0 var(--r-md) var(--r-md); transform-origin: 50% 0%;
  background: linear-gradient(180deg, rgba(92, 10, 17, .95), rgba(70, 7, 13, .96));
}
.flip .bottom::before, .flip .flap-bottom::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: rgba(0, 0, 0, .55); z-index: 1; }
.flip span {
  display: block; height: var(--h); line-height: var(--h); text-align: center;
  font-family: var(--f-body); font-weight: 800; font-size: var(--num); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  color: var(--champ);
  background: linear-gradient(180deg, #FFF3CC 10%, var(--kim) 55%, #d6992f 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.flip .bottom span, .flip .flap-bottom span { transform: translateY(-50%); }
.flip .flap { display: none; z-index: 2; }
.flip.flipping .flap { display: block; }
.flip.flipping .flap-top { animation: flap-top .32s cubic-bezier(.55, 0, .9, .6) both; }
.flip.flipping .flap-bottom { animation: flap-bottom .34s cubic-bezier(.1, .5, .3, 1) .3s both; }
.flip.flipping .flap-top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .35)); }
@keyframes flap-top { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes flap-bottom { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
.unit .label {
  margin-top: clamp(6px, 1vw, 10px);
  font-size: clamp(11px, 1.6vw, 14px); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--champ);
}
.colon {
  align-self: center; margin-top: calc(var(--h) * -.18);
  font-family: var(--f-display); font-weight: 800; font-size: calc(var(--num) * .7); color: var(--kim);
  text-shadow: 0 0 18px rgba(245, 196, 81, .6); animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 599px) {
  .branch { width: 40vw; opacity: .7; }
  .colon { display: none; }
  .clock { gap: 8px; }
  .unit { flex: 1 1 0; }
  .unit .label { letter-spacing: .14em; }
}
.clock.urgent .unit { animation: urgent 1s ease-in-out infinite; }
@keyframes urgent { 50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 60px -6px rgba(245, 196, 81, .75), inset 0 1px 0 rgba(255, 255, 255, .25); } }

.reunion { margin: clamp(22px, 4vh, 34px) 0 0; font-family: var(--f-display); font-style: italic; font-size: clamp(18px, 2.8vw, 26px); color: var(--champ); }
.reunion .dots b { font-weight: inherit; animation: dot 1.5s infinite; }
.reunion .dots b:nth-child(2) { animation-delay: .2s; }
.reunion .dots b:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }

.moment { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.moment p { margin: 0; }
.moment-time { font-size: 14px; color: var(--ink-soft); }
.moment-time strong { color: var(--kem); font-weight: 600; }
.moment-time span { color: var(--ink-mute); white-space: nowrap; }
.moment-local { font-size: 13px; color: var(--ink-mute); }
.year-progress { margin-top: 10px; width: min(100%, 360px); }
.yp-bar { height: 6px; border-radius: 99px; background: rgba(255, 244, 222, .1); overflow: hidden; border: 1px solid rgba(245, 196, 81, .18); }
.yp-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--son), var(--kim)); box-shadow: 0 0 12px rgba(245, 196, 81, .6); transition: width 1s var(--ease); }
.yp-text { margin-top: 6px !important; font-size: 12.5px; color: var(--ink-mute); }

.scroll-cue { position: absolute; left: 50%; bottom: calc(var(--toolbar-h) + 18px); transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line-strong); border-radius: 16px; display: none; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--kim); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (min-width: 900px) and (min-height: 760px) { .scroll-cue { display: block; bottom: 26px; } }

/* Celebration */
.cele-title { margin: 0; font-family: var(--f-display); font-weight: 800; line-height: 1.12; text-transform: uppercase; font-size: clamp(34px, 9vw, 80px); }
.cele-title .split { display: block; text-wrap: balance; }
.cele-title .year { font-size: 1.7em; line-height: 1.05; }
.cele-title { filter: drop-shadow(0 0 22px rgba(245, 196, 81, .35)) drop-shadow(0 2px 0 rgba(80, 10, 14, .6)); }
.cele-title .ch {
  background: linear-gradient(180deg, #FFF6D8 0%, var(--champ) 30%, var(--kim) 62%, #c78a2a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cele-title .ch { display: inline-block; padding: .3em .02em .12em; margin: -.3em -.02em -.12em; opacity: 0; transform: translateY(.4em) scale(.6); filter: blur(6px); animation: ch-in .9s var(--ease) forwards; }
.cele-title .w { display: inline-block; white-space: nowrap; }
@keyframes ch-in { to { opacity: 1; transform: none; filter: blur(0); } }
.cele-sub { margin: 18px 0 0; font-family: var(--f-display); font-style: italic; font-size: clamp(22px, 4vw, 38px); color: var(--champ); font-weight: 600; opacity: 0; animation: fade-up 1s var(--ease) 1.4s forwards; }
.cele-sub i { font-style: normal; color: var(--kim); }
.cele-wish { margin: 16px auto 0; max-width: 40ch; font-size: clamp(15px, 2.2vw, 19px); color: var(--ink-soft); min-height: 3.2em; opacity: 0; animation: fade-up 1s var(--ease) 2s forwards; transition: opacity .5s; }
.cele-wish.swap { opacity: 0 !important; }
.cele-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; opacity: 0; animation: fade-up 1s var(--ease) 2.4s forwards; }
.cele-since { margin: 18px 0 0; font-size: 13px; color: var(--ink-mute); }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body.celebrate .hero-sky::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 45%, rgba(255, 229, 160, .22), transparent 70%);
  animation: bloom-light 4s ease-in-out infinite alternate;
}
@keyframes bloom-light { from { opacity: .5; transform: scale(.95); } to { opacity: 1; transform: scale(1.05); } }

/* Đếm 10 giây cuối */
.final-count { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .4s; }
.final-count.on { opacity: 1; background: radial-gradient(circle at 50% 50%, rgba(37, 6, 9, .55), rgba(37, 6, 9, .2) 60%, transparent); }
.final-count span { font-family: var(--f-display); font-weight: 800; font-size: clamp(140px, 38vw, 360px); line-height: 1; color: var(--champ); text-shadow: 0 0 60px rgba(245, 196, 81, .8), 0 0 120px rgba(181, 18, 27, .9); }
.final-count span.pop { animation: pop 1s var(--ease) both; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 25% { opacity: 1; } to { transform: scale(.92); opacity: .4; } }

/* ---------------- Sections ---------------- */
.section { position: relative; padding: clamp(72px, 12vw, 130px) 0; }
.sec-head { text-align: center; max-width: 880px; margin: 0 auto clamp(32px, 5vw, 56px); }
.kicker { margin: 0 0 12px; font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--kim); font-weight: 700; }
.kicker::before, .kicker::after { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--line-strong); vertical-align: middle; margin: 0 12px; }
.sec-head h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 5.4vw, 54px); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; }
.sec-head h2 em { font-style: italic; color: var(--kim); }
.lead { margin: 16px auto 0; color: var(--ink-soft); font-size: clamp(15px, 1.9vw, 18px); max-width: 60ch; text-wrap: pretty; }

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Fireworks stage */
.stage {
  position: relative; min-height: clamp(360px, 56vh, 540px); border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 110%, rgba(181, 18, 27, .35), transparent 70%),
    linear-gradient(180deg, rgba(10, 1, 3, .25), rgba(37, 6, 9, .35));
  box-shadow: inset 0 1px 0 rgba(255, 229, 160, .12), 0 40px 80px -40px rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 24px 16px 22px; cursor: crosshair; overflow: hidden;
}
.stage-hint { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ink-mute); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; transition: opacity .6s; pointer-events: none; }
.stage.used .stage-hint { opacity: 0; }
.tap-ring { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--kim); position: relative; animation: ring 2s ease-out infinite; }
.tap-ring::after { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: var(--kim); box-shadow: 0 0 16px var(--kim); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(245, 196, 81, .5); } 100% { box-shadow: 0 0 0 26px rgba(245, 196, 81, 0); } }
.stage-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; position: relative; }
.stage-count, .stage-off { margin: 0; font-size: 13.5px; color: var(--ink-mute); text-align: center; }
.stage-count strong { color: var(--champ); font-variant-numeric: tabular-nums; }

/* Bento */
.bento { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; grid-template-areas: "mai mai" "dao dao" "cau den" "cau lixi" "chung tet" "ngu ngu" "loc loc"; }
@media (min-width: 900px) {
  .bento { gap: 18px; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(220px, auto);
    grid-template-areas: "mai mai dao dao" "mai mai cau den" "chung tet cau lixi" "ngu ngu loc loc"; }
}
.t-mai { grid-area: mai; } .t-dao { grid-area: dao; } .t-cau { grid-area: cau; } .t-den { grid-area: den; }
.t-chung { grid-area: chung; } .t-tet { grid-area: tet; } .t-ngu { grid-area: ngu; } .t-lixi { grid-area: lixi; } .t-loc { grid-area: loc; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(181, 18, 27, .32), transparent 70%),
    linear-gradient(180deg, rgba(60, 8, 14, .7), rgba(37, 6, 9, .85));
  box-shadow: inset 0 1px 0 rgba(255, 229, 160, .1);
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s var(--ease);
}
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(60% 50% at var(--mx, 50%) var(--my, 0%), rgba(245, 196, 81, .14), transparent 70%); opacity: 0; transition: opacity .4s; }
@media (hover: hover) {
  .tile:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 229, 160, .16), 0 24px 50px -24px rgba(245, 196, 81, .35); }
  .tile:hover::after { opacity: 1; }
  .tile:hover .art { transform: scale(1.04); }
}
.tile .art { display: block; width: 100%; height: auto; flex: 1 1 auto; min-height: 0; padding: 14px 14px 0; transition: transform .7s var(--ease); }
.t-mai .art { padding: 0; }
.tile .cap { padding: 12px 18px 18px; position: relative; z-index: 1; }
.tile h3 { margin: 0; font-family: var(--f-display); font-size: clamp(18px, 2vw, 22px); font-weight: 700; color: var(--champ); }
.tile p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.t-mai h3 { font-size: clamp(22px, 2.6vw, 30px); }
.t-den .art, .t-chung .art, .t-tet .art, .t-lixi .art { max-height: 190px; }
.svg-script { font-family: var(--f-display); font-weight: 700; font-style: italic; }
.lantern .swing { transform-origin: 100px 0; animation: swing 4s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

/* Câu đối */
.couplet { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 22px 12px 4px; }
.couplet .banner {
  font-family: var(--f-display); font-weight: 700; font-style: italic; color: var(--champ);
  background: linear-gradient(180deg, #c4161f, #8a0f17); border: 1px solid var(--kim); border-radius: 6px;
  padding: 6px 14px; font-size: clamp(13px, 1.5vw, 16px); white-space: nowrap; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .7);
}
.couplet .scrolls { display: flex; gap: clamp(14px, 3vw, 28px); }
.couplet .scroll {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px; min-width: 52px; border-radius: 4px;
  background: linear-gradient(90deg, #8a0f17, #c4161f 30%, #b5121b 70%, #8a0f17); border: 1px solid rgba(245, 196, 81, .7);
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .8);
  font-family: var(--f-display); font-weight: 700; color: var(--kim); font-size: clamp(14px, 1.5vw, 18px); line-height: 1.45;
}
.t-cau:hover .scroll { box-shadow: 0 10px 26px -6px rgba(245, 196, 81, .35); }

/* Wishes */
.wish-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .wish-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .wish-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.wish {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 22px 22px 18px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .4s var(--ease), border-color .3s, background-color .3s;
}
@media (hover: hover) { .wish:hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(80, 10, 18, .45); } }
.wish-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(245, 196, 81, .25), rgba(181, 18, 27, .3)); border: 1px solid var(--line); }
.wish-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--kim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wish h3 { margin: 4px 0 0; font-family: var(--f-display); font-size: 21px; color: var(--champ); line-height: 1.25; }
.wish p { margin: 0; color: var(--ink-soft); font-size: 15px; flex: 1; }
.wish .use { align-self: flex-start; margin-top: 6px; background: none; border: 0; padding: 6px 0; color: var(--kim); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.wish .use::after { content: "→"; transition: transform .3s var(--ease); }
.wish .use:hover::after { transform: translateX(4px); }
.wish-cta { display: flex; justify-content: center; margin-top: 36px; }

/* Footer */
.footer { padding: 40px 0 calc(var(--toolbar-h) + 40px); border-top: 1px solid rgba(245, 196, 81, .14); text-align: center; background: linear-gradient(180deg, transparent, rgba(10, 1, 3, .5)); }
.foot-title { margin: 0; font-family: var(--f-display); font-size: 20px; color: var(--champ); }
.foot-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-mute); }
@media (min-width: 900px) { .footer { padding-bottom: 48px; } }

/* ---------------- Toolbar ---------------- */
.toolbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(37, 6, 9, .72); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .8);
}
.tool { width: 46px; height: 46px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--champ); transition: background-color .25s, color .25s, transform .2s; }
.tool:hover { background: rgba(245, 196, 81, .14); }
.tool:active { transform: scale(.92); }
.tool svg { width: 22px; height: 22px; fill: currentColor; }
.tool .ic-off { display: none; }
.tool[data-action="sound"][aria-pressed="false"] .ic-on { display: none; }
.tool[data-action="sound"][aria-pressed="false"] .ic-off { display: inline; }
.tool[data-action="fullscreen"][aria-pressed="true"] .ic-on { display: none; }
.tool[data-action="fullscreen"][aria-pressed="true"] .ic-off { display: inline; }
.tool[aria-pressed="true"][data-action="sound"], .tool[aria-pressed="true"][data-action="fx"] { color: #3a0a0e; background: var(--kim); }
.tool[data-action="fx"][aria-pressed="false"] { opacity: .6; }
.tool[hidden] { display: none; }
.tool-top { transition: opacity .3s, transform .3s; }
body:not(.scrolled) .tool-top { opacity: .35; pointer-events: none; }
@media (min-width: 900px) {
  .toolbar { left: auto; right: 20px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; padding: 6px; }
}

/* ---------------- Dialogs ---------------- */
.sheet {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: 24px; color: var(--ink); background: linear-gradient(180deg, #3a0910, #220508); overflow: auto;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9);
}
.sheet::backdrop { background: rgba(10, 1, 3, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in .35s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.sheet-inner { padding: 24px; }
.sheet h2 { margin: 0; font-family: var(--f-display); font-size: 26px; color: var(--champ); line-height: 1.2; }
.muted { color: var(--ink-mute); margin: 6px 0 0; font-size: 14px; }
.share-list { display: grid; gap: 10px; margin: 18px 0; }
.share-btn { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 244, 222, .05); font-weight: 600; text-decoration: none; color: var(--kem); }
.share-btn:hover { border-color: var(--line-strong); background: rgba(245, 196, 81, .1); }
.share-btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.share-btn.zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.sheet-close { width: 100%; }

.maker { width: min(980px, calc(100vw - 24px)); }
.maker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.icon-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 26px; line-height: 1; color: var(--champ); flex: none; }
.maker-body { display: grid; gap: 22px; }
@media (min-width: 820px) { .maker-body { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.maker-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 600; color: var(--champ); letter-spacing: .02em; display: flex; justify-content: space-between; padding: 0; }
.field small { color: var(--ink-mute); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; font-size: 16px;
  background: rgba(255, 244, 222, .06); border: 1px solid var(--line); color: var(--kem); resize: vertical;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--kim) 50%), linear-gradient(135deg, var(--kim) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: #2a060b; color: var(--kem); }
.field input::placeholder, .field textarea::placeholder { color: rgba(255, 244, 222, .35); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--kim); box-shadow: 0 0 0 3px rgba(245, 196, 81, .2); }
.themes { display: flex; flex-wrap: wrap; gap: 8px; }
.themes legend { width: 100%; margin-bottom: 6px; }
.themes label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; cursor: pointer; min-height: 42px; }
.themes input { position: absolute; opacity: 0; pointer-events: none; }
.themes label:has(input:checked) { border-color: var(--kim); background: rgba(245, 196, 81, .12); }
.themes label:has(input:focus-visible) { outline: 2px solid var(--kim); outline-offset: 2px; }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); }
.sw-son { background: var(--son); } .sw-kem { background: var(--kem); } .sw-dem { background: #12060a; box-shadow: inset 0 0 0 3px #12060a, inset 0 0 0 6px var(--kim); }
.maker-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.maker-actions .btn { flex: 1 1 180px; }

/* Card */
.card-wrap { display: flex; justify-content: center; }
.card {
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden;
  padding: 11% 11% 9%; display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9);
  container-type: inline-size;
}
.card.theme-son { background: radial-gradient(90% 60% at 50% 0%, #d32029, transparent 70%), linear-gradient(180deg, #b5121b, #720e16); color: var(--kem); --accent: var(--kim); }
.card.theme-kem { background: radial-gradient(90% 60% at 50% 0%, #fffaf0, transparent 70%), linear-gradient(180deg, #fff4de, #f6e1b6); color: #5a0b11; --accent: #b5121b; }
.card.theme-dem { background: radial-gradient(70% 45% at 50% 105%, rgba(181, 18, 27, .7), transparent 70%), radial-gradient(2px 2px at 20% 20%, #ffe5a0, transparent), radial-gradient(1.5px 1.5px at 70% 30%, #fff, transparent), radial-gradient(2px 2px at 85% 12%, #ffe5a0, transparent), radial-gradient(1.5px 1.5px at 35% 40%, #fff, transparent), linear-gradient(180deg, #0d0306, #250609); color: var(--kem); --accent: var(--kim); }
.card::before { content: ""; position: absolute; inset: 4.5%; border: 1.5px solid var(--accent); border-radius: 10px; opacity: .75; pointer-events: none; }
.card-corner { position: absolute; width: 13%; aspect-ratio: 1; border: 2px solid var(--accent); opacity: .9; }
.card-corner.c1 { top: 2.5%; left: 2.5%; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.card-corner.c2 { top: 2.5%; right: 2.5%; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.card-corner.c3 { bottom: 2.5%; left: 2.5%; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.card-corner.c4 { bottom: 2.5%; right: 2.5%; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.card-flower { width: 14%; height: auto; filter: drop-shadow(0 0 10px rgba(245, 196, 81, .5)); }
.card p { margin: 0; overflow-wrap: anywhere; }
.card-kicker { margin-top: 3% !important; font-size: 4cqw; letter-spacing: .3em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.card-to { margin-top: 7% !important; font-family: var(--f-display); font-style: italic; font-size: 6cqw; }
.card-wish { margin-top: 4% !important; font-size: 4.6cqw; line-height: 1.55; flex: 1; display: flex; align-items: center; }
.card-from { font-family: var(--f-display); font-style: italic; font-size: 5.2cqw; font-weight: 600; }
.card-year { margin-top: 3% !important; font-family: var(--f-display); font-weight: 800; font-size: 6.4cqw; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.received .sheet-inner { display: grid; gap: 18px; }
.received-title { text-align: center; }

/* Toast */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--toolbar-h) + 26px); transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--kem); color: var(--den); font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .8); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ---------------- Reduce motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .flip.flipping .flap { display: none; }
  .cele-title .ch, .cele-sub, .cele-wish, .cele-actions { opacity: 1; transform: none; filter: none; }
}
