@property --bg1 { syntax: "<color>"; inherits: false; initial-value: #f9d3e0; }
@property --bg2 { syntax: "<color>"; inherits: false; initial-value: #f3b6cb; }
@property --bg3 { syntax: "<color>"; inherits: false; initial-value: #eea7c0; }

:root {
  --pink-50: #fff4f8;
  --pink-100: #fde3ec;
  --pink-200: #f8c6d7;
  --pink-300: #f2a2bd;
  --pink-500: #e35d8c;
  --pink-600: #d4467a;
  --pink-700: #b8335f;
  --ink: #4a2a35;
  --ink-soft: #8a5d6c;
  --paper: #fffaf6;
  --line: #f1dbe3;
  --red: #e0435f;
  --shadow: 0 10px 30px rgba(184, 51, 95, .18);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Playwrite VN", cursive;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, #ffe3ee 0, transparent 40%),
    radial-gradient(circle at 85% 80%, #f7cfe0 0, transparent 45%),
    #fbe6ee;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  position: relative;
  width: min(420px, 100%);
  height: min(860px, calc(100dvh - 48px));
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  transition: --bg1 1.4s ease, --bg2 1.4s ease, --bg3 1.4s ease;
  box-shadow: 0 30px 80px rgba(160, 50, 90, .25), inset 0 0 0 1px rgba(255, 255, 255, .5);
}

@media (max-width: 480px) {
  .stage { padding: 0; }
  .card { width: 100%; height: 100dvh; border-radius: 0; }
}

/* Lấp lánh nền */
.sparkles span {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: twinkle 3.5s infinite ease-in-out;
}
@keyframes twinkle { 50% { opacity: .9; transform: scale(1.4); } }

/* Nút nhạc */
.music-toggle {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 15;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(184, 51, 95, .2);
  opacity: 0; pointer-events: none;
  transition: opacity .4s, transform .2s;
}
.music-toggle.show { opacity: 1; pointer-events: auto; }
.music-toggle:active { transform: scale(.92); }
.music-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--pink-600); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.music-toggle.playing svg { animation: sway 1.6s ease-in-out infinite; }
.music-toggle.playing .slash { display: none; }
@keyframes sway { 50% { transform: rotate(-10deg) scale(1.06); } }

/* Màn hình */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(56px, calc(env(safe-area-inset-top) + 44px)) 22px max(28px, env(safe-area-inset-bottom));
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(28px) scale(.98);
  transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
  overflow-y: auto;
}
.screen.past { transform: translateY(-28px) scale(.98); }
#s-envelope { padding-top: max(28px, env(safe-area-inset-top)); }
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s ease .1s, transform .5s ease .1s, visibility 0s;
}

.eyebrow, .hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--pink-700);
  opacity: .75;
}
.hint { font-family: var(--script); font-size: 16px; letter-spacing: 0; text-transform: none; animation: pulse 2s infinite; transition: opacity .2s; }
.opening .hint, .opening .eyebrow { animation: none; opacity: 0; transition: opacity .2s; }
@keyframes pulse { 50% { opacity: .35; } }

.script { font-family: var(--script); font-size: 15px; line-height: 1.7; color: var(--ink-soft); margin: 0; }

.qbox {
  width: 100%;
  background: var(--paper);
  border-radius: 22px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.qbox h2 { margin: 6px 0; font-size: 19px; line-height: 1.4; font-weight: 700; }

/* Nút */
.btn {
  min-width: 150px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), opacity .3s, box-shadow .2s;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #ef7aa3, var(--pink-600));
  box-shadow: 0 8px 20px rgba(212, 70, 122, .4), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(212, 70, 122, .5), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn:active:not(:disabled) { scale: .94; transition: scale .08s; }
.btn { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), scale .25s cubic-bezier(.3, 1.8, .5, 1), opacity .3s, box-shadow .2s; }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { color: var(--pink-700); background: rgba(255, 255, 255, .85); min-width: 0; padding: 12px 24px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.soft { min-width: 0; padding: 11px 16px; font-size: 14px; color: var(--pink-700); background: rgba(255, 255, 255, .85); box-shadow: 0 4px 12px rgba(184, 51, 95, .15); }
.btn.soft:disabled { opacity: .6; }

/* 1. Phong bì */
.envelope {
  position: relative;
  width: min(330px, 86vw);
  aspect-ratio: 1.5;
  border-radius: 10px;
  background: linear-gradient(160deg, #fffdf9, #f5ece6);
  box-shadow: 0 20px 40px rgba(150, 50, 80, .25);
  perspective: 800px;
  transition: transform .6s ease;
  animation: float 3.2s ease-in-out infinite;
}
.envelope:hover { transform: rotate(-2deg) scale(1.02); }
@keyframes float { 50% { translate: 0 -8px; } }
.env-flap {
  position: absolute;
  inset: 0 0 auto 0;
  height: 58%;
  background: linear-gradient(180deg, #fbf5f0, #efe3da);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform .55s ease .1s, z-index 0s .38s;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .08));
  z-index: 4;
}
.env-label {
  position: absolute; top: 10px; left: 0; right: 0;
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: #8a7a74;
  z-index: 5;
  transition: opacity .2s;
}
.env-to { position: absolute; left: 22px; bottom: 22px; text-align: left; line-height: 1; }
.env-to { z-index: 3; }
.env-to small { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #9a8a84; margin-bottom: 10px; }
.env-to b { font-family: var(--script); font-size: 24px; font-weight: 400; color: #5b3a40; }
.env-seal {
  position: absolute; left: 50%; top: 58%;
  translate: -50% -50%;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #f06a8a, #c3284d 70%);
  box-shadow: 0 3px 6px rgba(120, 20, 40, .35), inset 0 0 0 4px rgba(255, 255, 255, .15);
  z-index: 6;
  transition: transform .3s cubic-bezier(.5, -.6, .7, 1), opacity .3s;
}
.env-stamp {
  position: absolute; right: 22px; bottom: 26px;
  width: 38px; height: 46px;
  display: grid; place-items: center;
  color: var(--red); font-size: 16px;
  background: #fde8ee;
  outline: 2px dotted #e8b8c6; outline-offset: -4px;
  z-index: 3;
}
.env-postmark {
  position: absolute; right: 50px; bottom: 34px;
  width: 54px; height: 24px;
  background: repeating-radial-gradient(ellipse at 0 50%, transparent 0 4px, #b9a8a2 4px 5px);
  opacity: .5;
  border-radius: 40%;
  z-index: 3;
}
.env-pocket {
  position: absolute; inset: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, #fffdf9, #f5ece6);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, .06));
  z-index: 2;
}
.env-letter {
  position: absolute; left: 7%; right: 7%; top: 8%; height: 84%;
  display: flex; flex-direction: column; gap: 9px;
  padding: 14px 16px;
  border-radius: 6px;
  background: repeating-linear-gradient(transparent 0 21px, #f6e3ea 21px 22px), #fffefb;
  box-shadow: 0 2px 8px rgba(120, 40, 70, .15);
  text-align: left;
  z-index: 1;
  transition: transform .6s cubic-bezier(.3, 1.3, .5, 1) .5s;
}
.env-letter b { font-family: var(--script); font-weight: 400; font-size: 15px; color: var(--pink-700); }
.env-letter i { display: block; height: 4px; border-radius: 4px; background: #f3d3de; width: 80%; }
.env-letter i:nth-of-type(2) { width: 65%; }
.env-letter i:nth-of-type(3) { width: 40%; }
.envelope.open { animation: none; transform: none; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.open .env-seal { transform: scale(1.4); opacity: 0; }
.envelope.open .env-label { opacity: 0; }
.envelope.open .env-letter { transform: translateY(-58%); }
.envelope.zoom { transform: scale(1.18) translateY(-12px); opacity: 0; transition: transform .35s ease-in, opacity .3s ease-in .05s; }

/* Mèo */
.cat { width: 200px; flex-shrink: 0; }
.cat svg { width: 100%; height: auto; display: block; animation: bob 3s ease-in-out infinite; overflow: visible; }
.cat.small { width: 150px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.cat .floaty { animation: floaty 2.4s ease-in-out infinite; transform-box: fill-box; }
.cat .floaty:nth-of-type(2) { animation-delay: .8s; }
.cat.tiny { width: 92px; margin-bottom: -10px; }
.cat .eyes-happy, .cat .brows, .cat .m-happy, .cat .m-sad, .cat .m-o { display: none; }
.cat[data-mood="happy"] .eyes-open, .cat[data-mood="happy"] .m-neutral,
.cat[data-mood="sad"] .m-neutral, .cat[data-mood="surprised"] .m-neutral { display: none; }
.cat[data-mood="happy"] .eyes-happy, .cat[data-mood="happy"] .m-happy,
.cat[data-mood="sad"] .brows, .cat[data-mood="sad"] .m-sad, .cat[data-mood="surprised"] .m-o { display: inline; }
.cat .eyes-open { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.cat .pupils { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform .15s ease-out; }
.cat .ear { transform-box: view-box; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.cat .ear-l { transform-origin: 70px 66px; }
.cat .ear-r { transform-origin: 130px 66px; }
.cat[data-mood="sad"] .ear-l { transform: rotate(-24deg); }
.cat[data-mood="sad"] .ear-r { transform: rotate(24deg); }
.cat[data-mood="surprised"] .ear { transform: translateY(-7px) scale(1.08); }
.cat[data-mood="surprised"] .pupils { transform: translate(var(--px, 0px), var(--py, 0px)) scale(1.12); transform-box: fill-box; transform-origin: center; }
.cat[data-mood="surprised"] svg { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1), bob 3s ease-in-out .45s infinite; }
.cat[data-mood="happy"] .blush { opacity: .9; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-14px); } }
@keyframes floaty { 0% { opacity: 0; transform: translateY(8px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

/* 2. Thẻ cào */
.scratch-wrap { position: relative; width: 100%; }
.scratch-wrap .qbox { min-height: 130px; display: flex; flex-direction: column; justify-content: center; }
.scratch-wrap.revealed .qbox { animation: reveal .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes reveal { 40% { transform: scale(1.04); } }
#scratch {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 22px;
  touch-action: none;
  cursor: grab;
  transition: opacity .6s;
}
#scratch.done { opacity: 0; pointer-events: none; }

.choices {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 64px;
  opacity: 0; pointer-events: none;
  transition: opacity .5s;
}
.choices.show { opacity: 1; pointer-events: auto; }
#yesBtn { transform: scale(var(--yes, 1)); }
#noBtn { transform: translate(var(--nx, 0), var(--ny, 0)) scale(var(--no, 1)); }
.choices.converted { flex-direction: column; gap: 10px; }
#yesBtn:not(:disabled) { animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat { 0%, 40%, 100% { scale: 1; } 15% { scale: 1.06; } 25% { scale: .99; } }

.tip {
  position: absolute; top: calc(100% + 14px); left: 50%;
  translate: -50% 0;
  width: max-content; max-width: 260px;
  padding: 10px 16px;
  border-radius: 18px;
  background: #fff;
  font-size: 16px; font-weight: 700; line-height: 1.35; text-align: center;
  color: var(--pink-700);
  box-shadow: 0 8px 20px rgba(184, 51, 95, .25);
  opacity: 0;
  transform: translateY(-6px) scale(.85);
  transform-origin: top center;
  transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
  z-index: 5;
  pointer-events: none;
}
.tip::before {
  content: "";
  position: absolute; top: -7px; left: calc(50% + var(--tail, 0px));
  width: 14px; height: 14px;
  translate: -50% 0;
  rotate: 45deg;
  background: #fff;
  border-radius: 3px 0 0 0;
}
.tip.show { opacity: 1; transform: none; }

/* 4. Form ngày giờ */
.form {
  width: 100%;
  background: rgba(255, 255, 255, .7);
  border-radius: 22px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.field-label { font-size: 12px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-soft); margin-left: 4px; }
.field-label + .field { margin-bottom: 8px; }
.field {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 15px; font-weight: 500; text-align: left;
  transition: border-color .2s;
}
.field:hover, .field:focus-visible { border-color: var(--pink-300); outline: none; }
.field .placeholder { color: #b9a0a8; font-weight: 400; }
.field svg { width: 20px; height: 20px; fill: none; stroke: var(--pink-500); stroke-width: 1.7; stroke-linecap: round; }

.popup {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(120, 40, 70, .22);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility 0s linear .25s;
  z-index: 10;
}
.popup.open { opacity: 1; visibility: visible; transition: opacity .25s; }
.pop-card {
  width: 100%; max-width: 330px;
  background: #fff;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(120, 40, 70, .3);
  transform: translateY(12px) scale(.96);
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
}
.popup.open .pop-card { transform: none; }
.pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pop-close { width: 28px; height: 28px; border-radius: 50%; background: var(--pink-50); color: var(--pink-600); font-size: 18px; line-height: 1; }

.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.cal-nav button { width: 32px; height: 32px; border-radius: 50%; font-size: 20px; color: var(--pink-600); }
.cal-nav button:hover:not(:disabled) { background: var(--pink-50); }
.cal-nav button:disabled { opacity: .25; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-week span { font-size: 12px; font-weight: 700; color: var(--ink-soft); padding: 4px 0; }
.cal-grid button { aspect-ratio: 1; border-radius: 50%; font-size: 13px; font-weight: 500; }
.cal-grid button:hover:not(:disabled) { background: var(--pink-100); }
.cal-grid button:disabled { color: #d8c8cd; cursor: default; }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--pink-300); }
.cal-grid button.sel { background: var(--pink-600); color: #fff; }

.wheel { position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; height: 180px; margin-bottom: 14px; }
.wheel-band { position: absolute; left: 0; right: 0; top: 72px; height: 36px; border-radius: 12px; background: var(--pink-50); }
.wheel-col {
  position: relative;
  list-style: none; margin: 0; padding: 72px 0;
  height: 180px; width: 70px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-col li {
  height: 36px; line-height: 36px;
  text-align: center;
  scroll-snap-align: center;
  font-size: 17px; color: #b9a0a8;
  cursor: pointer;
  transition: color .15s, font-size .15s;
}
.wheel-col li.sel { color: var(--pink-700); font-weight: 700; font-size: 20px; }
.wheel-colon { position: relative; font-weight: 700; color: var(--pink-700); font-size: 20px; }

/* 5. Hoạt động */
.activities { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.activity {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px 9px;
  border-radius: 20px;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: 0 6px 16px rgba(184, 51, 95, .12);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.activity:hover { transform: translateY(-2px); }
.activity .emoji { font-size: clamp(30px, 5.2dvh, 44px); line-height: 1.1; transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.activity .label { font-size: 13px; font-weight: 600; }
.activity.sel { border-color: var(--pink-500); box-shadow: 0 8px 20px rgba(212, 70, 122, .28); }
.activity.sel .emoji { transform: scale(1.12) rotate(-4deg); }
.activity::after {
  content: "✓";
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 800; color: #fff;
  background: var(--pink-600);
  transform: scale(0);
  transition: transform .25s cubic-bezier(.3, 1.8, .5, 1);
}
.activity.sel::after { transform: scale(1); }

/* 6. Vé */
#s-ticket { justify-content: flex-start; padding-top: max(56px, env(safe-area-inset-top)); }
.printer { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.slot {
  width: 100%; height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2b1a20, #4a2c36);
  box-shadow: 0 3px 0 rgba(255, 255, 255, .5), inset 0 3px 6px rgba(0, 0, 0, .6);
  position: relative; z-index: 2;
}
.paper { width: calc(90% + 28px); margin-top: -8px; overflow: hidden; padding: 0 14px 34px; }
.ticket {
  position: relative;
  background:
    radial-gradient(circle at 0 0, rgba(255, 220, 230, .5), transparent 40%),
    var(--paper);
  border-radius: 0 0 14px 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 26px rgba(120, 40, 70, .25);
  transform: translateY(-105%);
  font-size: 11px;
  color: #5b3a40;
}
.ticket.print { animation: print 3s cubic-bezier(.4, 0, .3, 1) forwards; }
@keyframes print {
  0% { transform: translateY(-105%); }
  20% { transform: translateY(-80%); }
  25% { transform: translateY(-78%); }
  50% { transform: translateY(-42%); }
  55% { transform: translateY(-40%); }
  100% { transform: translateY(0); }
}
.t-row { display: flex; justify-content: space-between; }
.t-top { flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.t-top span:last-child { font-size: 11px; }
.t-top b { color: var(--red); }
.t-kicker { text-align: center; margin: 12px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.t-title { text-align: center; margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.t-title em { font-family: var(--script); font-style: normal; color: var(--red); font-size: 28px; font-weight: 400; }
.t-admit { text-align: center; margin: 0 0 12px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.t-info { border-top: 1.5px dashed var(--line); border-bottom: 1.5px dashed var(--line); padding: 10px 6px; }
.t-info div:last-child { text-align: right; }
.t-info small, .t-plan-label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.t-info b { font-size: 15px; }
.t-plan-label { text-align: center; margin: 10px 0 6px; }
.t-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.t-chips span { padding: 4px 10px; border-radius: 999px; background: #fde8ee; font-size: 11px; font-weight: 600; color: var(--pink-700); }
.t-fine { text-align: center; margin: 10px 0; font-size: 11px; line-height: 1.5; color: #a88a94; }
.t-stub-wrap { position: relative; border-top: 2px dotted var(--pink-200); margin-top: 4px; }
.t-reveal { margin: 0; min-height: 64px; display: grid; place-items: center; text-align: center; font-family: var(--script); font-size: 15px; color: var(--red); }
.t-stub {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px;
  background: var(--paper);
  cursor: grab;
  touch-action: pan-y;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.t-stub.dragging { transition: none; cursor: grabbing; }
.t-stub.torn {
  transform: translate(calc(var(--dir, 1) * 70px), 240px) rotate(calc(var(--dir, 1) * 28deg));
  opacity: 0;
  pointer-events: none;
  transition: transform .9s cubic-bezier(.5, 0, .8, .6), opacity .9s ease-in;
}
.t-stub:focus-visible { outline: 2px solid var(--pink-500); outline-offset: 2px; }
.paper.printed { overflow: visible; }
.t-sign { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 6px; margin-top: -2px; }
.t-sign span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 8px; }
.t-sign svg { width: 130px; height: 42px; overflow: visible; }
.sig {
  font-family: var(--script); font-size: 26px;
  fill: #5b3a40; fill-opacity: 0;
  stroke: #5b3a40; stroke-width: .7;
  stroke-dasharray: 420; stroke-dashoffset: 420;
}
.ticket.signed .sig { animation: sign 1.8s ease forwards .2s; }
@keyframes sign { 70% { stroke-dashoffset: 0; fill-opacity: 0; } 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
.t-title { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: default; }
.barcode { flex: 1; height: 40px; display: flex; align-items: stretch; gap: 1.5px; }
.barcode i { background: #3a2329; }
.t-heart {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; font-size: 15px;
  background: radial-gradient(circle at 35% 30%, #f06a8a, #c3284d 70%);
}

.final { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: translateY(10px); transition: opacity .8s, transform .8s; }
.final.show { opacity: 1; transform: none; }
.final h2 { font-size: 19px; margin: 0; color: var(--pink-700); }
.final .btn.primary { margin-top: 4px; }
.keep { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); text-align: center; }
#sentNote { opacity: 0; transition: opacity .5s; }
#sentNote.show { opacity: 1; }
.next-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#saveImg { display: block; width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 12px; -webkit-touch-callout: default; user-select: auto; }
.share-fallback { width: 100%; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.share-fallback p { margin: 0 0 6px; }
.share-fallback textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--pink-200);
  background: #fff;
  font: 500 14px/1.5 var(--font);
  color: var(--ink);
  resize: none;
  user-select: text;
  -webkit-user-select: text;
}

/* Tim bay */
.float-heart {
  position: absolute; bottom: -30px;
  pointer-events: none;
  color: var(--red);
  animation: rise linear forwards;
  z-index: 0;
}
.particle {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, .7);
}

/* Nút quay lại + tiến trình */
.back-btn {
  position: absolute;
  top: max(14px, env(safe-area-inset-top)); left: 14px;
  z-index: 15;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(184, 51, 95, .2);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.back-btn.show { opacity: 1; pointer-events: auto; }
.back-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--pink-600); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.progress {
  position: absolute;
  top: max(24px, calc(env(safe-area-inset-top) + 10px)); left: 50%;
  translate: -50% 0;
  z-index: 15;
  display: flex; gap: 8px;
  margin: 0; padding: 0; list-style: none;
  opacity: 0; pointer-events: none;
  transition: opacity .4s;
}
.progress.show { opacity: 1; }
.progress li { font-size: 15px; line-height: 1; color: rgba(255, 255, 255, .7); transition: color .3s, transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.progress li.on { color: var(--red); transform: scale(1.15); }
@keyframes rise { to { transform: translateY(calc(-100dvh - 60px)) rotate(var(--r)); opacity: 0; } }

/* A2 · Nền đổi theo câu chuyện: hồng sáng → đào ấm → hoàng hôn tím hồng */
.card { --bg1: #f9d3e0; --bg2: #f3b6cb; --bg3: #eea7c0; }
.card[data-scene="s-yes"], .card[data-scene="s-when"] { --bg1: #fcdcd0; --bg2: #f7c2b9; --bg3: #f0a9b9; }
.card[data-scene="s-what"] { --bg1: #fdd7c6; --bg2: #f6b7b2; --bg3: #ec9fb5; }
.card[data-scene="s-ticket"] { --bg1: #c7a2d8; --bg2: #eaaccd; --bg3: #fbd2cf; }

/* Easter egg nửa đêm */
.eyebrow.night { font-family: var(--script); font-size: 15px; letter-spacing: 0; text-transform: none; opacity: 1; }

/* Mèo nói */
.cat { position: relative; }
.cat-say {
  position: absolute; left: 60%; top: 2%;
  width: max-content; max-width: 160px;
  padding: 9px 12px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  font-size: 13px; font-weight: 700; line-height: 1.35;
  color: var(--pink-700);
  box-shadow: 0 6px 16px rgba(184, 51, 95, .22);
  opacity: 0; transform: scale(.8); transform-origin: bottom left;
  transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
  z-index: 6;
}
.cat-say.show { opacity: 1; transform: none; }
.cat-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.cat-row .cat.tiny { margin: 0; }
.say {
  position: relative; flex: 1;
  margin: 0; padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.4;
  color: var(--pink-700);
  box-shadow: 0 6px 16px rgba(184, 51, 95, .15);
}
.say::before { content: ""; position: absolute; left: -6px; top: 50%; width: 12px; height: 12px; background: #fff; translate: 0 -50%; rotate: 45deg; border-radius: 0 0 0 3px; }
.say.bump, .hint2.bump { animation: reveal .45s cubic-bezier(.3, 1.6, .5, 1); }
.cat-prop {
  position: absolute; left: 50%; bottom: 14%;
  translate: -50% 0;
  font-size: 30px; line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(120, 40, 70, .25));
}
.cat-prop.pop { animation: propPop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes propPop { 0% { transform: scale(0) rotate(-20deg); } }
.activity.wide { grid-column: 1 / -1; flex-direction: row; gap: 10px; padding: 8px; }
.activity.wide .emoji { font-size: 26px; }

/* Gợi ý giờ */
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--pink-700);
  transition: background .2s, border-color .2s;
}
.quick button.sel { background: var(--pink-600); border-color: var(--pink-600); color: #fff; }
.quick button:disabled { opacity: .4; cursor: not-allowed; }

/* Vé: P.S., gợi ý, thông báo */
.ps { margin: 2px 0 0; font-family: var(--script); font-size: 14px; color: var(--pink-700); }
.toast {
  position: absolute; left: 50%; bottom: max(90px, calc(env(safe-area-inset-bottom) + 70px));
  translate: -50% 0;
  width: max-content; max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 18px;
  background: #fff;
  font-size: 15px; font-weight: 700; line-height: 1.4; text-align: center;
  color: var(--pink-700);
  box-shadow: 0 10px 30px rgba(120, 40, 70, .3);
  opacity: 0; transform: translateY(10px) scale(.9);
  transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
  z-index: 30;
}
.toast.show { opacity: 1; transform: none; }
a.btn { display: inline-block; text-decoration: none; text-align: center; }

/* 5b. Đón ở đâu */
.pickups .activity { padding: 12px 8px; }
.pickups .emoji { font-size: 30px; }
.place { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.place input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: 500 16px var(--font); /* 16px để iPhone không tự phóng to */
  color: var(--ink);
}
.place input:focus { outline: none; border-color: var(--pink-300); }
.place .field-label { text-transform: none; letter-spacing: 0; font-size: 13px; }
.place-tools { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -6px; }
.place-tools .btn { width: 100%; }
.place-tools .note:empty { display: none; }
#s-where .cat.tiny { margin-bottom: -6px; }
.t-pickup { margin: 8px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink); }
.t-pickup:empty { display: none; }

/* Màn hình thấp */
@media (max-height: 700px) {
  .cat { width: 150px; }
  .cat.small { width: 110px; }
  .cat.tiny { width: 64px; }
  .screen { gap: 12px; }
  .qbox { padding: 14px 16px; }
  .qbox h2 { font-size: 17px; }
  .activity { padding: 10px 6px 8px; }
}

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