/* =========================================================
   Bốn năm – Một hành trình rực rỡ · Design tokens
   ========================================================= */
:root {
  --ink: #2a1e5c;
  --ink-soft: #5b4f86;
  --paper: #fffdf5;
  --cream: #fff6da;
  --white: #ffffff;

  --red: #ff5a5f;
  --orange: #ff8c42;
  --sun: #ffc233;
  --green: #2ec27e;
  --teal: #16bfae;
  --blue: #3b9eff;
  --purple: #8b5cf6;
  --pink: #ff5c9a;

  --rainbow: linear-gradient(90deg, var(--red), var(--orange), var(--sun), var(--green), var(--blue), var(--purple), var(--pink));
  --font-display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Patrick Hand', 'Nunito', cursive;

  --line: 3px solid var(--ink);
  --pop: 0 5px 0 var(--ink);
  --pop-sm: 0 3px 0 var(--ink);
  --radius: 22px;
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff9ec;
  overflow-x: hidden;
}
body.is-intro { overflow: hidden; height: 100svh; }
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { fill: currentColor; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 3px dashed var(--purple); outline-offset: 3px; }

.is-left { transform: scaleX(-1); }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.1;
  text-decoration: none; color: var(--ink);
  background: var(--bg); border: var(--line); border-radius: 999px; box-shadow: var(--pop);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-sun { --bg: var(--sun); }
.btn-pink { --bg: var(--pink); color: var(--white); }
.btn-purple { --bg: var(--purple); color: var(--white); }
.btn-ghost { --bg: var(--white); }
.btn-lg { min-height: 56px; padding: 12px 26px; font-size: 1.15rem; }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: .98rem; min-height: 44px;
}
.btn-link:hover, .btn-link:active { transform: none; box-shadow: none; }

.icon-btn {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  background: var(--white); border: var(--line); border-radius: 50%; box-shadow: var(--pop-sm);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* =========================================================
   CẢNH 1 — Intro
   ========================================================= */
.intro {
  --hy: 62vh; /* đường chân trời, JS cập nhật theo kích thước màn hình */
  position: fixed; inset: 0; z-index: 50; overflow: hidden;
  background: linear-gradient(180deg, #8fd6ff 0%, #bfe8ff 28%, #ffe1ef 52%, #ffd9a0 var(--hy), #ffd9a0 100%);
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky-rays {
  position: absolute; left: 50%; top: var(--hy); width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .5) 0deg 6deg, rgba(255, 255, 255, 0) 6deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0 8%, transparent 50%);
          mask: radial-gradient(circle, #000 0 8%, transparent 50%);
  animation: spin 90s linear infinite;
}
.sky-cloud { position: absolute; color: #fff; filter: drop-shadow(0 4px 0 rgba(42, 30, 92, .12)); }
.sky-cloud--a { width: 120px; height: 68px; left: -24px; top: 9vh; animation: drift 26s ease-in-out infinite alternate; }
.sky-cloud--b { width: 96px; height: 54px; right: -14px; top: 30vh; animation: drift 22s ease-in-out infinite alternate-reverse; }
.sky-cloud--c { width: 70px; height: 40px; left: 12%; top: calc(var(--hy) - 22vh); opacity: .9; animation: drift 30s ease-in-out infinite alternate; }

.land { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.land-sun { transform-box: fill-box; transform-origin: center; animation: sunRise 1.6s var(--ease-out) both; }
.land-rainbow path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawArc 1.4s var(--ease-out) forwards; }
.land-road-lane { animation: fadeIn .8s ease both; }

.sparkles { position: absolute; inset: 0; }
.sparkle {
  position: absolute; width: var(--s, 14px); height: var(--s, 14px); color: var(--c, #fff);
  animation: twinkle var(--d, 2.4s) ease-in-out var(--delay, 0s) infinite;
}

.loader {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; z-index: 4;
  padding: var(--gutter); text-align: center; transition: opacity .5s ease, transform .5s ease;
  background: rgba(255, 249, 236, .55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.loader.is-done { opacity: 0; transform: scale(.94); pointer-events: none; }
.loader-feet { display: flex; gap: 14px; height: 54px; align-items: flex-end; }
.loader-foot { width: 26px; height: 42px; color: var(--pink); opacity: 0; animation: stepIn 1.6s ease-in-out infinite; }
.loader-foot:nth-child(2) { color: var(--orange); animation-delay: .2s; margin-bottom: 10px; }
.loader-foot:nth-child(3) { color: var(--green); animation-delay: .4s; }
.loader-foot:nth-child(4) { color: var(--blue); animation-delay: .6s; margin-bottom: 10px; }
.loader-foot--l { transform: scaleX(-1); }
.loader-bar {
  width: min(260px, 70vw); height: 16px; padding: 3px; border: var(--line); border-radius: 99px; background: var(--white);
}
.loader-bar span {
  display: block; height: 100%; width: 8%; border-radius: 99px; background: var(--rainbow);
  transition: width .4s var(--ease-out);
}
.loader-text { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

/* Tiêu đề: ô chữ dán sticker + dải ruy băng */
.intro-content {
  position: absolute; left: 0; right: 0; top: max(5vh, env(safe-area-inset-top)); z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 var(--gutter); text-align: center; pointer-events: none;
}
.intro-eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 4px 14px;
  font-weight: 800; font-size: .88rem; letter-spacing: .04em;
  background: var(--white); border: var(--line); border-radius: 99px; box-shadow: var(--pop-sm);
  animation: popIn .6s var(--ease-bounce) both;
}
.intro-title { margin: 0; display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); }
.intro-tiles { display: flex; flex-wrap: nowrap; justify-content: center; gap: clamp(3px, 1vw, 8px); }
.intro-tile {
  display: grid; place-items: center; width: 1.08em; height: 1.18em; padding-top: .08em;
  font-size: clamp(2.3rem, 11.5vw, 4.4rem); font-weight: 800; line-height: 1; color: var(--white);
  background: var(--c); border: 3px solid var(--ink); border-radius: .26em; box-shadow: 0 5px 0 var(--ink);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  transform: rotate(var(--r)) translateY(var(--ty));
  animation: tileDrop .7s var(--ease-bounce) calc(.15s + var(--i) * .08s) both, tileFloat 3.2s ease-in-out calc(1s + var(--i) * .2s) infinite;
}
.intro-tile--gap { width: .32em; background: none; border: 0; box-shadow: none; animation: none; }
.intro-ribbon {
  position: relative; margin-top: 18px; padding: 0 22px; transform: rotate(-2deg);
  animation: popIn .7s var(--ease-bounce) .8s both;
}
.intro-ribbon > span {
  position: relative; z-index: 1; display: block; padding: 8px 20px 10px;
  font-weight: 800; font-size: clamp(1.15rem, 5.4vw, 1.7rem); line-height: 1.1; color: var(--white);
  background: var(--pink); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 0 4px 0 var(--ink);
  -webkit-text-stroke: 1px rgba(42, 30, 92, .5); white-space: nowrap;
}
.intro-ribbon::before, .intro-ribbon::after {
  content: ''; position: absolute; top: 12px; width: 36px; height: 100%;
  background: #d9417f; border: 3px solid var(--ink);
}
.intro-ribbon::before { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); }
.intro-ribbon::after { right: 0; clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%); }
.intro-guest {
  margin: 18px 0 0; padding: 4px 18px 6px; max-width: 100%;
  font-family: var(--font-hand); font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.2;
  background: rgba(255, 255, 255, .9); border: var(--line); border-radius: 16px; box-shadow: var(--pop-sm);
  transform: rotate(1.5deg); overflow-wrap: anywhere;
  animation: popIn .6s var(--ease-bounce) .95s both;
}
.intro-guest strong { color: var(--pink); font-weight: 400; }
.intro-hint {
  display: inline-flex; align-items: center; gap: 8px; max-width: 290px; margin: 20px auto 0; padding: 8px 14px;
  font-weight: 800; font-size: .95rem; line-height: 1.3;
  background: rgba(255, 255, 255, .92); border: var(--line); border-radius: 18px; box-shadow: var(--pop-sm);
  animation: popIn .6s var(--ease-bounce) 1.1s both, bob 2.4s ease-in-out 1.7s infinite;
}
.intro-hint-foot { width: 18px; height: 28px; color: var(--pink); flex: none; }

.intro-field { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.foot-btn {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w, 52px); height: calc(var(--w, 52px) * 1.6); margin: calc(var(--w, 52px) * -.8) 0 0 calc(var(--w, 52px) * -.5);
  padding: 0; border: 0; background: none; color: var(--c); pointer-events: auto;
  transform: rotate(var(--r, 0deg)) scaleX(var(--flip, 1));
  -webkit-tap-highlight-color: transparent;
  animation: footDrop .7s var(--ease-bounce) var(--delay, 0s) both;
}
.foot-btn svg {
  width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 4px 0 rgba(42, 30, 92, .85));
  animation: footBreath 2.6s ease-in-out calc(var(--delay, 0s) + .7s) infinite;
  transition: transform .2s var(--ease-bounce);
}
.foot-btn:hover svg, .foot-btn:focus-visible svg { transform: scale(1.18); }
.foot-btn::after {
  content: ''; position: absolute; inset: -14%; border-radius: 50%;
  border: 3px dashed currentColor; opacity: 0; animation: ripple 2.6s ease-out calc(var(--delay, 0s) + 1s) infinite;
}
.foot-btn.is-chosen svg { animation: stamp .5s var(--ease-bounce) forwards; }
.foot-walk {
  position: absolute; width: 30px; height: 48px; margin: -24px 0 0 -15px; color: var(--c);
  pointer-events: none; opacity: 0; animation: walkStep .9s ease forwards;
}

.burst {
  position: fixed; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; z-index: 60;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle,
    #fff 0 16%, var(--pink) 16% 27%, var(--purple) 27% 38%, var(--blue) 38% 49%,
    var(--green) 49% 60%, var(--sun) 60% 71%, var(--orange) 71% 82%, var(--red) 82% 100%);
}

/* ---------- Music ---------- */
.music-btn {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 40;
  display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 12px;
  background: var(--white); border: var(--line); border-radius: 99px; box-shadow: var(--pop-sm);
}
.music-note { width: 22px; height: 22px; color: var(--purple); }
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.music-bars i { width: 3px; height: 4px; border-radius: 2px; background: var(--ink); }
.music-btn[aria-pressed='true'] .music-bars i { animation: eq .9s ease-in-out infinite; }
.music-btn[aria-pressed='true'] .music-bars i:nth-child(2) { animation-delay: .2s; }
.music-btn[aria-pressed='true'] .music-bars i:nth-child(3) { animation-delay: .4s; }
.music-btn[aria-pressed='false'] { opacity: .85; }
.music-btn[aria-pressed='false'] .music-note { color: var(--ink-soft); }

/* =========================================================
   Hành trình chính
   ========================================================= */
.journey { position: relative; }
.scene { position: relative; padding: 72px var(--gutter) 56px; }
.scene-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.scene-head h2 {
  margin: 8px 0 6px; font-family: var(--font-display); font-weight: 800; line-height: 1.08;
  font-size: clamp(2rem, 8vw, 3rem);
}
.scene-head p { margin: 0; color: var(--ink-soft); font-weight: 600; }
.scene-badge {
  display: inline-grid; place-items: center; width: 54px; height: 54px; color: var(--c);
  background: var(--white); border: var(--line); border-radius: 50%; box-shadow: var(--pop-sm);
}
.scene-badge svg { width: 22px; height: 34px; }
.scene-cta { display: flex; justify-content: center; margin-top: 28px; }

/* Thanh điều hướng dấu chân */
.trail-nav {
  position: fixed; right: 8px; top: 50%; z-index: 30; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px; padding: 8px 5px;
  background: rgba(255, 255, 255, .82); border: 2px solid var(--ink); border-radius: 99px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.trail-nav a { display: grid; place-items: center; width: 26px; height: 32px; color: #c9c2e0; transition: color .3s, transform .3s var(--ease-bounce); }
.trail-nav a:nth-child(even) svg { transform: scaleX(-1); }
.trail-nav svg { width: 14px; height: 22px; }
.trail-nav span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.trail-nav a.is-active { color: var(--c, var(--pink)); transform: scale(1.25); }
.trail-nav a.is-done { color: var(--ink-soft); }
.trail-nav a[data-nav='invite'] { --c: var(--orange); }
.trail-nav a[data-nav='letter'] { --c: var(--pink); }
.trail-nav a[data-nav='wishes'] { --c: var(--green); }
.trail-nav a[data-nav='rsvp'] { --c: var(--purple); }

/* Dải dấu chân nối giữa các cảnh */
.trail { position: relative; height: 210px; margin: -30px auto; max-width: 420px; pointer-events: none; z-index: 1; }
.trail-step {
  position: absolute; width: 24px; height: 38px; margin: -19px 0 0 -12px; color: var(--c);
  opacity: 0; transform: translateY(8px) rotate(var(--r)) scale(.6);
}
.trail-step svg { width: 100%; height: 100%; }
.trail.is-walking .trail-step { animation: trailIn .5s var(--ease-bounce) calc(var(--i) * .16s) forwards; }

/* =========================================================
   CẢNH 2 — Thiệp mời
   ========================================================= */
.scene-invite {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 92px; overflow: hidden;
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(255, 241, 170, .95), rgba(255, 241, 170, 0) 70%),
    linear-gradient(180deg, #bfe8ff 0%, #e2f4ff 32%, #fff6da 70%, #fff9ec 100%);
}
.invite-sky { position: absolute; inset: 0; pointer-events: none; }
.invite-glow {
  position: absolute; left: 50%; top: -260px; width: 620px; height: 620px; margin-left: -310px;
  background: repeating-conic-gradient(rgba(255, 255, 255, .6) 0deg 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 64%); mask: radial-gradient(circle, #000 0 18%, transparent 64%);
  animation: spin 70s linear infinite;
}
.invite-sun {
  position: absolute; right: 7%; top: 70px; width: 84px; height: 84px; color: var(--sun);
  filter: drop-shadow(0 0 18px rgba(255, 194, 51, .7)); animation: spin 26s linear infinite;
}
.invite-cloud { position: absolute; color: #fff; }
.invite-cloud--a { width: 120px; height: 68px; left: 4%; top: 120px; animation: drift 24s ease-in-out infinite alternate; }
.invite-cloud--b { width: 90px; height: 50px; right: 10%; bottom: 18%; animation: drift 20s ease-in-out infinite alternate-reverse; }

.invite-card {
  position: relative; z-index: 2; width: min(100%, 460px); margin-top: 40px;
  padding: 76px 26px 30px; text-align: center;
  background:
    radial-gradient(circle at 12% 88%, rgba(255, 92, 154, .12) 0 60px, transparent 61px),
    radial-gradient(circle at 92% 78%, rgba(59, 158, 255, .12) 0 46px, transparent 47px),
    var(--paper);
  border: var(--line); border-radius: 30px; box-shadow: 0 8px 0 var(--ink), 0 24px 50px rgba(42, 30, 92, .18);
  transform-origin: 50% 100%;
}
.invite-card::before {
  content: ''; position: absolute; inset: 10px; border: 2px dashed rgba(42, 30, 92, .25); border-radius: 22px; pointer-events: none;
}
.invite-card-rainbow {
  position: absolute; left: 50%; top: -58px; width: 210px; height: 112px; transform: translateX(-50%);
  filter: drop-shadow(0 4px 0 rgba(42, 30, 92, .2));
}
.invite-eyebrow {
  display: inline-block; margin: 0 0 8px; padding: 3px 14px;
  font-weight: 800; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--sun); border: 2px solid var(--ink); border-radius: 99px;
}
/* Ảnh chính: khung vòm như cầu vồng, viền 7 màu */
.invite-hero { position: relative; width: min(86%, 330px); margin: 18px auto 12px; }
.invite-hero-frame {
  position: relative; aspect-ratio: 4 / 5; padding: 9px;
  background: conic-gradient(from 200deg, var(--red), var(--orange), var(--sun), var(--green), var(--blue), var(--purple), var(--pink), var(--red));
  border: 3px solid var(--ink); border-radius: 999px 999px 26px 26px;
  box-shadow: 0 7px 0 var(--ink), 0 18px 36px rgba(42, 30, 92, .2);
  transform: rotate(-1.5deg);
}
.invite-hero-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
  background: #fff3c4; border: 3px solid var(--ink); border-radius: 999px 999px 18px 18px;
}
.invite-hero-sun {
  position: absolute; right: -16px; top: 10%; width: 64px; height: 64px; color: var(--sun);
  filter: drop-shadow(0 3px 0 var(--ink)); animation: spin 22s linear infinite;
}
.invite-hero-star { position: absolute; left: -12px; top: 30%; width: 32px; height: 32px; color: var(--pink); stroke: var(--ink); stroke-width: 1.4; animation: bob 2.8s ease-in-out infinite; }
.invite-hero-spark { position: absolute; color: var(--sun); animation: twinkle 2.6s ease-in-out infinite; }
.invite-hero-spark--a { left: 4%; top: -4px; width: 22px; height: 22px; }
.invite-hero-spark--b { right: 6%; bottom: 16%; width: 18px; height: 18px; color: #fff; filter: drop-shadow(0 0 2px var(--purple)); animation-delay: 1.2s; }
.invite-hero-feet {
  position: absolute; left: -10px; bottom: -14px; display: flex; gap: 3px; padding: 6px 8px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 99px; transform: rotate(-8deg); box-shadow: var(--pop-sm);
}
.invite-hero-feet svg { width: 13px; height: 21px; color: var(--c); }
.invite-hero-feet svg:first-child { margin-top: 4px; }
.invite-hero-empty {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(circle at 50% 108%, #fff 0 22%, transparent 22.5%),
    repeating-radial-gradient(circle at 50% 108%, #ff8a8f 0 7%, #ffb27a 7% 14%, #ffd76a 14% 21%, #8fe0b0 21% 28%, #8fc8ff 28% 35%, #c0a8ff 35% 42%, #ffe9f2 42% 100%);
  border: 3px solid var(--ink); border-radius: 999px 999px 18px 18px;
}
.invite-hero-empty-cap {
  width: 46%; aspect-ratio: 1; margin-top: -8%; padding: 6%; color: var(--ink);
  background: var(--white); border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 5px 0 var(--ink);
}
.invite-hero-empty-feet { position: absolute; bottom: 9%; display: flex; gap: 6px; }
.invite-hero-empty-feet svg { width: 16px; height: 26px; color: var(--c); }
.invite-hero-empty-feet svg:first-child { margin-top: 8px; }
.invite-card { padding-top: 64px; }

.invite-guest { margin: 4px 0 0; font-family: var(--font-hand); font-size: 1.35rem; color: var(--ink-soft); }
.invite-guest strong { color: var(--pink); font-weight: 400; }
.invite-host { margin: 6px 0 0; font-family: var(--font-display); line-height: 1; }
.invite-host-prefix {
  display: inline-block; margin-bottom: 4px; padding: 2px 12px; font-size: 1rem; font-weight: 800; letter-spacing: .1em;
  color: var(--white); background: var(--purple); border: 2px solid var(--ink); border-radius: 10px; transform: rotate(-4deg);
}
.invite-host-name {
  display: block; font-weight: 800; font-size: clamp(2.6rem, 12vw, 3.4rem); letter-spacing: -.01em;
  background: linear-gradient(90deg, #e8364c, #f06b1f, #d99a00, #1f9e5e, #1e7fe0, #7a46ea);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 4px 0 2px;
}
.invite-event {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 18px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
}
.invite-event svg { width: 30px; height: 30px; color: var(--ink); }

.invite-info { display: grid; gap: 12px; margin: 0 0 22px; text-align: left; }
.invite-info-row {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--white); border: 2px solid var(--ink); border-radius: 18px;
}
.invite-info dt { display: grid; place-items: center; }
.invite-info dt svg { width: 44px; height: 44px; padding: 10px; border: 2px solid var(--ink); border-radius: 14px; }
.invite-info-row--time dt svg { background: var(--sun); }
.invite-info-row--place dt svg { background: #8fd6ff; }
.invite-info dt span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.invite-info dd { margin: 0; display: grid; line-height: 1.35; }
.invite-info dd strong { font-family: var(--font-display); font-size: 1.25rem; }
.invite-info dd > span { color: var(--ink-soft); font-size: .95rem; font-weight: 600; }

.invite-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.invite-card-feet { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.invite-card-feet svg { width: 16px; height: 26px; color: var(--c); }
.invite-card-feet svg:nth-child(odd) { margin-top: 8px; }

[data-reveal] { opacity: 0; transform: translateY(14px); }
.is-revealed [data-reveal] { animation: rise .6s var(--ease-out) calc(var(--ri, 0) * 90ms + .35s) forwards; }

.next-step {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 30px;
  text-decoration: none; font-weight: 800;
}
.next-step-feet { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.next-step-feet svg { width: 16px; height: 26px; color: var(--orange); animation: stepDown 1.6s ease-in-out infinite; }
.next-step-feet svg:last-child { color: var(--pink); margin-left: 18px; animation-delay: .4s; }

/* =========================================================
   CẢNH 3 — Bức thư
   ========================================================= */
.scene-letter {
  background:
    radial-gradient(40% 30% at 0% 10%, rgba(255, 92, 154, .14), transparent 70%),
    radial-gradient(40% 30% at 100% 40%, rgba(255, 194, 51, .2), transparent 70%),
    radial-gradient(40% 30% at 0% 80%, rgba(59, 158, 255, .14), transparent 70%),
    #fff9ec;
}
.paper {
  position: relative; max-width: 680px; margin: 0 auto; padding: 56px 26px 34px;
  background: radial-gradient(rgba(59, 158, 255, .16) 1.5px, transparent 1.6px) 0 0 / 22px 22px, var(--paper);
  border: var(--line); border-radius: 10px 26px 10px 26px; box-shadow: 0 8px 0 var(--ink), 0 22px 40px rgba(42, 30, 92, .12);
}
.paper::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-radius: 8px 23px 0 0; background: var(--rainbow);
  border-bottom: 2px solid var(--ink);
}
.paper-rainbow { position: absolute; right: -14px; top: -40px; width: 120px; height: 64px; transform: rotate(12deg); }
.paper-sun { position: absolute; left: -22px; top: -26px; width: 64px; height: 64px; color: var(--sun); animation: spin 30s linear infinite; }
.paper-flower { position: absolute; width: 46px; height: 46px; stroke: var(--ink); stroke-width: 2; }
.paper-flower--a { right: 14px; bottom: -20px; color: var(--pink); }
.paper-flower--b { left: -14px; top: 30%; color: var(--purple); }
.paper-leaf { position: absolute; width: 34px; height: 34px; color: var(--green); }
.paper-leaf--a { right: 52px; bottom: -14px; transform: rotate(40deg); }
.paper-leaf--b { left: 6px; top: calc(30% + 40px); transform: rotate(-80deg); }
.paper-star { position: absolute; right: -12px; top: -16px; width: 40px; height: 40px; color: var(--sun); stroke: var(--ink); stroke-width: 1.4; animation: twinkle 3s ease-in-out infinite; }
.paper--end { margin-top: 36px; padding-top: 40px; }
.paper-title {
  margin: 0 0 16px; font-family: var(--font-display); font-weight: 800; line-height: 1.15;
  font-size: clamp(1.55rem, 6.4vw, 2.1rem); color: var(--ink);
}
.paper-title::after { content: ''; display: block; width: 96px; height: 6px; margin-top: 8px; border-radius: 6px; background: var(--rainbow); }
.paper-body { font-family: var(--font-hand); font-size: 1.32rem; line-height: 1.6; }
.paper-body > * { margin: 0 0 1em; opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s var(--ease-out); }
.paper-body > .is-in { opacity: 1; transform: none; }
.paper-body > :last-child { margin-bottom: 0; }

/* Phần cuối thư: mỗi đoạn một vai trò */
.letter-memory {
  position: relative; padding: 14px 18px 14px 22px; font-size: 1.38rem;
  background: rgba(255, 255, 255, .75); border-radius: 4px 18px 18px 4px;
}
.letter-memory::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 4px; background: linear-gradient(180deg, var(--red), var(--orange), var(--sun), var(--green), var(--blue), var(--purple));
}
.letter-callout {
  position: relative; margin-top: 1.6em !important; padding: 26px 20px 18px; text-align: center; font-size: 1.42rem; line-height: 1.5;
  background: #fff3c4; border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--pop);
}
.letter-callout-sun {
  position: absolute; left: 50%; top: -26px; width: 50px; height: 50px; margin-left: -25px; color: var(--sun);
  filter: drop-shadow(0 2px 0 var(--ink)); animation: spin 24s linear infinite;
}
.letter-info {
  display: grid; gap: 10px; margin-top: 1.4em !important; padding: 14px;
  background: var(--white); border: 3px dashed rgba(42, 30, 92, .35); border-radius: 22px;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.45;
}
.letter-info-row {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center; margin: 0;
  padding: 8px 10px; border-radius: 14px; background: #fbf8ff;
}
.letter-info-icon { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border: 2px solid var(--ink); border-radius: 12px; color: var(--ink); }
.letter-info-label { font-size: .86rem; font-weight: 700; color: var(--ink-soft); }
.letter-info-value { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.paper-body .letter-info a {
  display: inline-block; margin: 2px 0; padding: 1px 10px; text-decoration: none; word-break: break-all;
  color: var(--ink); background: #cfe6ff; border: 2px solid var(--ink); border-radius: 99px;
}
.paper-body .letter-info a[href^='tel:'] { background: #ffd3e6; word-break: normal; white-space: nowrap; }
.letter-closing {
  margin-top: 1.6em !important; padding-top: 18px; text-align: center; font-size: 1.55rem; line-height: 1.45; color: var(--pink);
  border-top: 3px dotted rgba(42, 30, 92, .25);
}
.letter-closing-heart { display: block; width: 30px; height: 30px; margin: 10px auto 0; color: var(--pink); animation: bob 2.4s ease-in-out infinite; }
.paper--end .paper-feet { justify-content: center; }
.paper-body a { color: var(--blue); font-weight: 700; word-break: break-all; text-decoration-thickness: 2px; }
.paper-body a[href^='tel:'] { color: var(--pink); word-break: normal; }
.gallery-lead {
  margin: 26px 0 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 6vw, 1.9rem);
  text-align: center; color: var(--pink);
}
.paper-feet { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.paper-feet svg { width: 18px; height: 28px; color: var(--c); }
.paper-feet svg:first-child { margin-top: 10px; }

/* Bộ sưu tập ảnh scrapbook */
.scrapbook { max-width: 1080px; margin: 34px auto 0; display: flex; align-items: flex-start; gap: 14px; }
.scrapbook-col { flex: 1 1 0; min-width: 0; }
.scrapbook-col:nth-child(even) { padding-top: 26px; }
@media (min-width: 720px) { .scrapbook { gap: 24px; } }

.polaroid {
  --rot: 0deg;
  position: relative; display: block; width: var(--w, 100%); margin: 18px 0 18px var(--mx, 0);
  padding: 8px 8px 30px; break-inside: avoid;
  background: var(--white); border: 2px solid var(--ink); border-radius: 4px;
  box-shadow: 0 5px 0 rgba(42, 30, 92, .9), 0 14px 26px rgba(42, 30, 92, .14);
  cursor: zoom-in; -webkit-tap-highlight-color: transparent;
  opacity: 0; transform: translateY(30px) rotate(0deg) scale(.9);
  transition: opacity .6s ease var(--delay, 0s), transform .7s var(--ease-bounce) var(--delay, 0s);
}
.polaroid.is-in { opacity: 1; transform: rotate(var(--rot)); }
.polaroid.is-in:hover { transform: rotate(0deg) scale(1.03); z-index: 2; transition-delay: 0s; }
.polaroid img { width: 100%; height: auto; background: #f1ecff; border-radius: 2px; }
.polaroid::before {
  content: ''; position: absolute; left: 50%; top: -12px; width: 74px; height: 22px; margin-left: -37px;
  background: var(--tape, rgba(255, 194, 51, .75)); transform: rotate(var(--tape-r, -3deg));
  border-left: 2px dashed rgba(255, 255, 255, .7); border-right: 2px dashed rgba(255, 255, 255, .7);
}
.polaroid--empty { aspect-ratio: 4 / 5; cursor: default; display: grid; place-items: center; }
.polaroid--empty .empty-fill {
  width: 100%; height: 100%; border-radius: 2px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffe3ef, #e5f3ff 60%, #fff3c4);
}
.polaroid--empty svg { width: 28px; height: 44px; color: rgba(42, 30, 92, .25); }

.sticker {
  display: grid; place-items: center; break-inside: avoid; margin: 10px 0; height: 70px; pointer-events: none;
}
.sticker svg { width: 56px; height: 56px; color: var(--c); filter: drop-shadow(0 3px 0 rgba(42, 30, 92, .8)); animation: bob 3.2s ease-in-out infinite; }
.sticker--rainbow svg { width: 96px; height: 52px; filter: none; }
.sticker--foot svg { width: 30px; height: 48px; }

/* =========================================================
   CẢNH 4 — Con đường lời chúc
   ========================================================= */
.scene-wishes {
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(46, 194, 126, .18), transparent 70%),
    linear-gradient(180deg, #fff9ec 0%, #eafbe6 40%, #e6f6ff 100%);
}
.road { position: relative; max-width: 900px; margin: 0 auto; min-height: 200px; }
.road-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.road-prints { position: relative; width: 100%; height: 100%; }
.wish-print {
  position: absolute; left: var(--x); top: var(--y); width: 34px; height: 54px; margin: -27px 0 0 -17px;
  padding: 0; border: 0; background: none; color: var(--c); -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--r)) scaleX(var(--flip, 1));
  transition: left .5s var(--ease-out), top .5s var(--ease-out);
}
.wish-print svg {
  width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 0 rgba(42, 30, 92, .85));
  transition: transform .2s var(--ease-bounce);
}
.wish-print:hover svg, .wish-print:focus-visible svg { transform: scale(1.25); }
.wish-print.is-new svg { animation: stamp .7s var(--ease-bounce) var(--delay, 0s) both; }
.wish-print.is-new::after {
  content: ''; position: absolute; inset: -40%; border-radius: 50%; border: 3px solid var(--c);
  animation: ripple 1.2s ease-out calc(var(--delay, 0s) + .3s) both;
}
.wish-print--pending { color: transparent; }
.wish-print--pending svg { stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: 4 3; filter: none; fill: rgba(255, 255, 255, .7); }
.road-marker {
  position: absolute; left: var(--x); top: var(--y); width: 52px; height: 52px; margin: -26px 0 0 -26px; pointer-events: none;
}
.road-marker svg { width: 100%; height: 100%; }
.road-marker--start svg { color: var(--sun); animation: spin 20s linear infinite; }
.road-marker--end svg { color: var(--pink); stroke: var(--ink); stroke-width: 1.4; animation: bob 2.6s ease-in-out infinite; }
.road-empty { text-align: center; margin: 10px 0 0; font-weight: 700; color: var(--ink-soft); }

/* =========================================================
   Hộp thoại
   ========================================================= */
dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(42, 30, 92, .55); backdrop-filter: blur(3px); }
.sheet {
  width: min(100% - 24px, 480px); max-height: calc(100svh - 24px); overflow: auto;
  padding: 30px 22px 24px; background: var(--paper); border: var(--line); border-radius: 26px; box-shadow: 0 8px 0 var(--ink);
}
.sheet[open] { animation: sheetIn .45s var(--ease-bounce); }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; }
.sheet-title { margin: 0 44px 4px 0; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.15; }
.sheet-sub { margin: 0 0 18px; color: var(--ink-soft); font-weight: 600; font-size: .98rem; }

.wish-view { text-align: center; padding-top: 0; overflow: hidden; }
.wish-view-head {
  margin: 0 -22px 20px; padding: 22px 0 16px; background: var(--c, var(--pink)); border-bottom: var(--line);
}
.wish-view-foot { width: 40px; height: 64px; color: var(--white); filter: drop-shadow(0 3px 0 var(--ink)); }
.wish-view-message {
  margin: 0 0 14px; font-family: var(--font-hand); font-size: 1.4rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.wish-view-name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--purple); }
.wish-view-name::before { content: '— '; }
.wish-view-note { margin: 12px 0 0; font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.wish-view-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; font-weight: 800; }
.wish-view .sheet-close { background: var(--white); }

.wish-sent { text-align: center; padding: 10px 0; }
.wish-sent-foot { width: 50px; height: 80px; color: var(--pink); margin: 0 auto 10px; animation: stamp .7s var(--ease-bounce) both; filter: drop-shadow(0 4px 0 var(--ink)); }
.wish-sent .sheet-title { margin-right: 0; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; overflow: hidden;
  background: rgba(24, 16, 54, .94); display: none;
}
.lightbox[open] { display: grid; place-items: center; animation: fadeIn .25s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox-figure {
  margin: 0; padding: 70px 12px 104px; width: 100%; height: 100%; overflow: hidden;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
}
.lightbox-figure img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border: 8px solid var(--white); border-bottom-width: 30px; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  animation: popIn .35s var(--ease-bounce);
  cursor: zoom-in; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1); will-change: transform;
}
.lightbox-figure.is-zoomed img { cursor: grab; }
.lightbox-figure.is-dragging img { transition: none; }
.lightbox-figure.is-zoomed.is-dragging img { cursor: grabbing; }
.lightbox-count {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1; margin: 0; padding: 4px 12px;
  border-radius: 999px; background: rgba(24, 16, 54, .6); color: var(--white); font-weight: 800;
}
.lightbox-close, .lightbox-zoom { position: absolute; top: 12px; z-index: 1; }
.lightbox-close { right: 12px; }
.lightbox-zoom { left: 12px; }
.lightbox-zoom[aria-pressed="true"] { background: var(--sun); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; margin-top: -23px; z-index: 1; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.is-zoomed ~ .lightbox-prev, .is-zoomed ~ .lightbox-next { opacity: .35; }
@media (min-width: 760px) {
  .lightbox-prev { left: 20px; }
  .lightbox-next { right: 20px; }
}

/* Thả cảm xúc cho ảnh */
.reaction-bar {
  position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1;
  display: flex; gap: 4px; padding: 6px; max-width: calc(100vw - 24px);
  background: var(--white); border: var(--line); border-radius: 999px; box-shadow: var(--pop-sm);
}
.reaction-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 46px; height: 44px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-weight: 800; font-size: .85rem; color: var(--ink); cursor: pointer;
  transition: background .2s ease, transform .2s var(--ease-bounce); -webkit-tap-highlight-color: transparent;
}
.reaction-btn:hover { transform: translateY(-3px); }
.reaction-btn.is-mine { background: #ffe3ef; box-shadow: inset 0 0 0 2px var(--pink); }
.reaction-emoji { font-size: 1.35rem; line-height: 1; }
.reaction-count:empty { display: none; }
.reaction-btn.is-pop .reaction-emoji { animation: stamp .45s var(--ease-bounce); }
.reaction-fly {
  position: absolute; left: 50%; top: 0; font-size: 1.6rem; pointer-events: none;
  animation: reactionFly .9s ease-out both;
}
.reaction-error {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: .85rem; font-weight: 700;
}
@media (max-width: 420px) {
  .reaction-bar { gap: 0; padding: 4px; }
  .reaction-btn { min-width: 40px; padding: 0 5px; }
  .reaction-emoji { font-size: 1.2rem; }
}
@keyframes reactionFly {
  from { opacity: 1; transform: translate(-50%, 0) scale(.6); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -120px) scale(1.3); }
}

/* Cảm xúc nhỏ ở mép dưới ảnh trong album */
.polaroid-reactions {
  position: absolute; right: 10px; bottom: 5px; font-size: .78rem; font-weight: 800; line-height: 20px; color: var(--ink);
}
.polaroid-reactions:empty { display: none; }
.polaroid-reactions.is-mine { color: var(--pink); }

/* =========================================================
   Form
   ========================================================= */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 800; font-size: .98rem; display: flex; justify-content: space-between; gap: 8px; }
.field small { font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: var(--line); border-radius: 16px; outline: none;
  transition: box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 4px rgba(139, 92, 246, .3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  margin: 0 0 14px; padding: 10px 14px; font-weight: 700; font-size: .95rem;
  background: #ffe1e3; border: 2px solid var(--red); border-radius: 14px;
}

/* =========================================================
   CẢNH 5 — Lời hẹn
   ========================================================= */
.scene-rsvp {
  padding-bottom: 40px;
  background:
    radial-gradient(50% 40% at 100% 10%, rgba(255, 92, 154, .18), transparent 70%),
    radial-gradient(50% 40% at 0% 60%, rgba(139, 92, 246, .16), transparent 70%),
    linear-gradient(180deg, #e6f6ff 0%, #f6ecff 45%, #ffe9f2 100%);
}
.rsvp-card, .rsvp-done {
  position: relative; max-width: 520px; margin: 0 auto; padding: 46px 22px 26px;
  background: var(--paper); border: var(--line); border-radius: 28px; box-shadow: 0 8px 0 var(--ink), 0 22px 44px rgba(42, 30, 92, .14);
}
.rsvp-card-rainbow { position: absolute; left: 50%; top: -40px; width: 150px; height: 80px; transform: translateX(-50%); }

/* Dải giờ & nơi hẹn ngay đầu thiệp */
.rsvp-when {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 0 0 18px;
}
.rsvp-when > span {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px;
  font-weight: 800; font-size: .88rem; background: var(--cream); border: 2px solid var(--ink); border-radius: 99px;
}
.rsvp-when svg { width: 16px; height: 16px; color: var(--purple); }

.rsvp-choices { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.rsvp-choices legend { padding: 0; margin-bottom: 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; text-align: center; width: 100%; }
.rsvp-choice-grid { display: grid; gap: 10px; }
.choice { position: relative; display: block; --tint: var(--white); --deep: var(--ink); }
.choice--yes { --tint: #fff1bf; --deep: var(--orange); }
.choice--maybe { --tint: #efe6ff; --deep: var(--purple); }
.choice--no { --tint: #e3f1ff; --deep: var(--blue); }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.choice-face {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 44px 10px 12px;
  font-weight: 800; font-size: 1.02rem; line-height: 1.25;
  background: var(--white); border: var(--line); border-radius: 18px; box-shadow: var(--pop-sm);
  transition: background .2s, transform .25s var(--ease-bounce), box-shadow .2s;
}
.choice-art {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: var(--tint); border: 2px solid var(--ink); border-radius: 14px;
  transition: transform .35s var(--ease-bounce);
}
.choice-icon { width: 30px; height: 30px; }
.choice--yes .choice-icon { color: var(--orange); }
.choice--no .choice-icon { width: 32px; height: 20px; color: #9fb2cf; }
.choice--maybe .choice-icon { width: 34px; height: 20px; }
.choice-check {
  position: absolute; right: 12px; top: 50%; width: 24px; height: 24px; margin-top: -12px;
  padding: 4px; color: var(--white); background: var(--deep); border: 2px solid var(--ink); border-radius: 50%;
  transform: scale(0); transition: transform .3s var(--ease-bounce);
}
.choice:hover .choice-face { transform: translateY(-1px); }
.choice input:checked + .choice-face { background: var(--tint); transform: translateY(-3px); box-shadow: var(--pop); }
.choice input:checked + .choice-face .choice-art { transform: rotate(-8deg) scale(1.08); background: var(--white); }
.choice input:checked + .choice-face .choice-check { transform: scale(1); }
.choice input:focus-visible + .choice-face { outline: 3px dashed var(--purple); outline-offset: 3px; }
/* Đã chọn một ô: làm nhạt các ô còn lại để câu trả lời nổi bật */
.rsvp-choice-grid:has(input:checked) .choice input:not(:checked) + .choice-face { opacity: .62; box-shadow: none; }

@media (min-width: 520px) {
  .rsvp-choice-grid { grid-template-columns: repeat(3, 1fr); }
  .choice, .choice-face { height: 100%; }
  .choice-face { flex-direction: column; justify-content: flex-start; text-align: center; gap: 10px; padding: 16px 10px 14px; }
  .choice-art { width: 58px; height: 58px; border-radius: 18px; }
  .choice-icon { width: 38px; height: 38px; }
  .choice--no .choice-icon { width: 42px; height: 26px; }
  .choice--maybe .choice-icon { width: 44px; height: 26px; }
  .choice-check { top: 8px; right: 8px; margin-top: 0; }
}

/* Mảnh giấy ghi tên & lời nhắn */
.rsvp-note {
  position: relative; margin: 0 0 18px; padding: 18px 16px 4px;
  background: var(--white); border: 2px dashed rgba(42, 30, 92, .35); border-radius: 20px;
}
.rsvp-note::before {
  content: ''; position: absolute; left: 50%; top: -9px; width: 64px; height: 18px; margin-left: -32px;
  background: rgba(255, 194, 51, .75); border-radius: 4px; transform: rotate(-3deg);
}
.rsvp-note textarea {
  font-family: var(--font-hand); font-size: 1.2rem; line-height: 32px; padding-top: 2px; padding-bottom: 2px;
  background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(139, 92, 246, .18) 31px 32px) var(--white);
  background-attachment: local;
}

.rsvp-done { text-align: center; padding-top: 34px; animation: popIn .6s var(--ease-bounce); }
.rsvp-done:focus { outline: none; }
.rsvp-done-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1.15; }
.rsvp-done-text { margin: 0 0 20px; font-weight: 600; color: var(--ink-soft); }
.rsvp-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }

.ticket {
  display: grid; grid-template-columns: 1fr 74px; text-align: left;
  background: var(--white); border: var(--line); border-radius: 20px; box-shadow: var(--pop); overflow: hidden;
}
.ticket-main { padding: 16px 16px 14px; border-right: 3px dashed var(--ink); position: relative; }
.ticket-main::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--rainbow); }
.ticket-kicker { margin: 6px 0 2px; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.ticket-host { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.ticket-grid dt { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ticket-grid-wide { grid-column: 1 / -1; }
.ticket-grid dd { margin: 0; font-weight: 800; font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.ticket-status {
  display: inline-block; margin: 12px 0 0; padding: 2px 12px; font-weight: 800; font-size: .85rem;
  background: var(--sun); border: 2px solid var(--ink); border-radius: 99px;
}
.ticket-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: repeating-linear-gradient(135deg, #ffe08a 0 10px, #ffd25c 10px 20px);
}
.ticket-stub svg { width: 26px; height: 42px; color: var(--pink); filter: drop-shadow(0 2px 0 var(--ink)); }
.ticket-no { writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 800; letter-spacing: .1em; }

/* Kết */
.finale {
  position: relative; padding: 30px var(--gutter) 70px; text-align: center;
  background: linear-gradient(180deg, #ffe9f2, #fff3c4);
}
.finale-feet { display: flex; justify-content: center; gap: 12px; }
.finale-feet svg { width: 18px; height: 28px; color: var(--c); }
.finale-feet svg:nth-child(odd) { margin-top: 10px; }
.finale-sun { width: 90px; height: 90px; margin: 12px auto 4px; color: var(--sun); filter: drop-shadow(0 0 20px rgba(255, 194, 51, .8)); animation: spin 24s linear infinite; }
.finale-line { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 5.4vw, 1.8rem); line-height: 1.25; }
.finale-contact { margin: 10px 0 0; font-weight: 700; color: var(--ink-soft); }
.finale-contact a { color: var(--pink); }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* =========================================================
   Responsive
   ========================================================= */
@media (min-width: 760px) {
  .invite-card { padding: 84px 40px 36px; }
  .paper { padding: 64px 52px 44px; }
  .rsvp-card, .rsvp-done { padding: 52px 36px 32px; }
  .sky-sun { width: 150px; height: 150px; margin-left: -75px; }
  .trail-nav { right: 18px; }
}
@media (max-width: 380px) {
  body { font-size: 16px; }
  .paper-body { font-size: 1.2rem; }
  .invite-card { padding-left: 18px; padding-right: 18px; }
  .ticket { grid-template-columns: 1fr 56px; }
}
@media (max-width: 640px) {
  /* Màn hẹp: dải dấu chân giữa các cảnh đã đủ dẫn đường, ẩn thanh bên để không che thiệp. */
  .trail-nav { display: none; }
}

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translateX(-20px); } to { transform: translateX(30px); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.5) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes intro-pop { from { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes stepIn { 0% { opacity: 0; transform: translateY(6px) scale(.8); } 25%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes stepDown { 0%, 100% { opacity: .35; transform: translateY(-3px); } 50% { opacity: 1; transform: translateY(3px); } }
@keyframes footDrop { from { opacity: 0; transform: translateY(-30px) rotate(var(--r, 0deg)) scaleX(var(--flip, 1)) scale(.4); } }
@keyframes footBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ripple { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes stamp { 0% { transform: scale(2.2); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes walkStep { 0% { opacity: 0; transform: rotate(var(--r)) scaleX(var(--flip, 1)) scale(1.6); } 30% { opacity: 1; transform: rotate(var(--r)) scaleX(var(--flip, 1)) scale(1); } 100% { opacity: .9; transform: rotate(var(--r)) scaleX(var(--flip, 1)) scale(1); } }
@keyframes trailIn { to { opacity: 1; transform: rotate(var(--r)) scale(1); } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px) scale(.95); } }
@keyframes sunRise { from { transform: translateY(45%); } }
@keyframes drawArc { to { stroke-dashoffset: 0; } }
@keyframes tileDrop { from { opacity: 0; transform: translateY(-60px) rotate(calc(var(--r) * -3)) scale(.6); } }
@keyframes tileFloat { 0%, 100% { transform: rotate(var(--r)) translateY(var(--ty)); } 50% { transform: rotate(calc(var(--r) * -1)) translateY(calc(var(--ty) - 5px)); } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal], .paper-body > *, .polaroid, .trail-step { opacity: 1 !important; transform: none !important; }
  .polaroid.is-in { transform: rotate(var(--rot)) !important; }
}
