:root {
  --accent: #ff4f8b;
  --ribbon: #ffd84d;
  --ink: #2a1b2d;
  --muted: #7b6a7d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body.gift-page {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 22%, #fff) 0, transparent 45%),
    radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--accent) 18%, #fff) 0, transparent 45%),
    color-mix(in srgb, var(--accent) 8%, #fff8f4);
  min-height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#stage {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; gap: 22px; text-align: center; position: relative;
}
.gift-title { font-weight: 900; font-size: clamp(1.4rem, 5vw, 2rem); margin: 0; max-width: 480px; line-height: 1.2; }
.hint { margin: 0; color: var(--muted); font-weight: 800; animation: pulse 1.6s ease-in-out infinite; }
.replay {
  border: 0; background: #fff; color: #2a1b2d; font: inherit; font-weight: 800;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.08);
  animation: fadeIn .4s 1.2s both;
}
#gift-footer { text-align: center; padding: 0 16px 22px; }
#gift-footer a {
  display: inline-block; text-decoration: none; font-weight: 800; color: #fff; background: var(--accent);
  padding: 12px 22px; border-radius: 999px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.error { max-width: 360px; font-weight: 700; color: var(--muted); }

/* Message card */
.msg-card {
  background: #fff; border-radius: 22px; padding: 28px 24px 22px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 18px 40px rgba(60, 20, 50, .15);
  animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both;
  user-select: text;
  color: #2a1b2d;
}
.msg-to { font-family: 'Caveat', cursive; color: var(--accent); font-size: 2.3rem; margin: 0 0 6px; line-height: 1.1; }
.msg-text { font-size: 1.15rem; line-height: 1.6; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-from { font-family: 'Caveat', cursive; font-size: 1.7rem; text-align: right; color: #7b6a7d; margin: 12px 0 0; }
.msg-card.paper {
  background: #fffdf6 repeating-linear-gradient(transparent 0 33px, #f0e6dc 33px 34px);
  text-align: left; font-family: 'Caveat', cursive;
}
.msg-card.paper .msg-text { font-family: 'Caveat', cursive; font-size: 1.65rem; line-height: 34px; }

/* Gift box */
.gbox { position: relative; width: 200px; height: 210px; cursor: pointer; animation: wobble 2.4s ease-in-out infinite; }
.gbox-body, .gbox-lid {
  position: absolute; background-color: var(--accent);
  background-image: linear-gradient(90deg, transparent 43%, var(--ribbon) 43%, var(--ribbon) 57%, transparent 57%);
}
.gbox-body { bottom: 0; left: 12px; width: 176px; height: 140px; border-radius: 6px 6px 10px 10px; box-shadow: inset 0 -14px 0 rgba(0,0,0,.12), inset 0 14px 0 rgba(0,0,0,.08); transition: transform .5s .5s, opacity .5s .5s; }
.gbox-lid { top: 46px; left: 0; width: 200px; height: 42px; border-radius: 8px; z-index: 2; filter: brightness(1.08); transition: transform .9s cubic-bezier(.5, -0.5, .5, 1.4), opacity .9s; }
.bow { position: absolute; left: 50%; top: -34px; }
.bow::before, .bow::after {
  content: ''; position: absolute; top: 0; width: 44px; height: 38px;
  border: 11px solid var(--ribbon); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.bow::before { right: 0; transform: rotate(-22deg); }
.bow::after { left: 0; transform: rotate(22deg); }
.gbox.open { animation: none; cursor: default; }
.gbox.open .gbox-lid { transform: translateY(-280px) rotate(-30deg); opacity: 0; }
.gbox.open .gbox-body { transform: scale(.7) translateY(40px); opacity: 0; }

/* Envelope */
.env { position: relative; width: 300px; height: 190px; cursor: pointer; perspective: 900px; margin-top: 60px; animation: float 3s ease-in-out infinite; }
.env-back { position: absolute; inset: 0; z-index: 0; background: color-mix(in srgb, var(--accent) 80%, #000); border-radius: 10px; }
.env-paper {
  position: absolute; left: 16px; right: 16px; bottom: 8px; height: 168px; z-index: 1;
  background: #fffdf6; border-radius: 6px; padding: 14px 16px; text-align: left;
  font-family: 'Caveat', cursive; font-size: 1.5rem; color: #7b6a7d; overflow: hidden;
  transition: transform .9s .45s ease;
}
.env-front {
  position: absolute; inset: 0; z-index: 2; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 92%, #fff);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 118px; z-index: 3;
  background: color-mix(in srgb, var(--accent) 72%, #000);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .6s ease, z-index 0s .3s;
}
.env-seal { position: absolute; left: 50%; top: 104px; transform: translate(-50%, -50%); z-index: 4; font-size: 2.2rem; transition: opacity .25s, transform .25s; }
.env.open { animation: none; cursor: default; }
.env.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.env.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
.env.open .env-paper { transform: translateY(-120px); }
.env.gone { transition: opacity .4s, transform .4s; opacity: 0; transform: scale(.85); }

/* Scratch */
.scratch-wrap { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px rgba(60, 20, 50, .15); }
.scratch-wrap .msg-card { animation: none; box-shadow: none; min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.scratch-canvas { position: absolute; top: 0; left: 0; touch-action: none; cursor: grab; transition: opacity .6s; }
.scratch-canvas.done { opacity: 0; pointer-events: none; }

/* Cake */
.cake { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 40px; transition: transform .6s; }
.cake.small { transform: scale(.7); margin-bottom: -40px; }
.candles { display: flex; gap: 10px; height: 76px; align-items: flex-end; position: relative; z-index: 2; margin-bottom: -4px; }
.candle {
  width: 12px; height: 46px; border-radius: 3px; position: relative; cursor: pointer;
  background: repeating-linear-gradient(45deg, #fff 0 5px, var(--accent) 5px 10px);
}
.candle::before { content: ''; position: absolute; left: -10px; right: -10px; top: -34px; bottom: 0; } /* bigger tap target */
.flame {
  position: absolute; left: 50%; bottom: calc(100% + 2px); width: 14px; height: 24px; margin-left: -7px;
  background: radial-gradient(circle at 50% 72%, #fffbe0 0 18%, #ffd34d 42%, #ff7a1a 78%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: 0 0 18px 6px rgba(255, 190, 60, .55);
  transform-origin: 50% 100%; animation: flicker .14s infinite alternate;
  transition: opacity .3s, transform .3s;
}
.candle.out { cursor: default; }
.candle.out .flame { animation: none; opacity: 0; transform: scale(.2) translateY(-10px); }
.smoke { position: absolute; left: 50%; bottom: 100%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: rgba(120, 120, 120, .45); animation: smoke 1.2s ease-out forwards; pointer-events: none; }
.tier { position: relative; border-radius: 14px 14px 8px 8px; box-shadow: inset 0 -10px 0 rgba(0,0,0,.08); }
.tier::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--accent); border-radius: 14px 14px 0 0; }
.tier::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 12px; height: 16px;
  background: radial-gradient(circle at 50% 0, var(--accent) 9px, transparent 10px) 0 0 / 22px 16px repeat-x;
}
.tier.t1 { width: 190px; height: 66px; background: #ffe9f0; z-index: 1; }
.tier.t2 { width: 260px; height: 88px; background: #ffd9a8; margin-top: -2px; }
.age { position: absolute; inset: 22px 0 0; display: grid; place-items: center; font-weight: 900; font-size: 1.7rem; color: var(--accent); z-index: 2; }
.plate { width: 300px; height: 16px; background: #ece4ee; border-radius: 50%; margin-top: -6px; box-shadow: 0 6px 12px rgba(0,0,0,.08); }
.mic-btn { border: 2px solid color-mix(in srgb, var(--accent) 40%, #fff); background: #fff; color: #2a1b2d; font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 999px; cursor: pointer; }
.mic-btn:disabled { opacity: .6; cursor: default; }

/* Floating decorations */
.floater { position: fixed; bottom: -80px; pointer-events: none; z-index: 5; animation: rise linear forwards; }
.balloon {
  width: 46px; height: 58px; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.08);
}
.balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 46px; background: rgba(0,0,0,.25); }
.heart { font-size: 28px; }

/* Backgrounds (pure CSS, royalty-free) */
#stage, #gift-footer { position: relative; z-index: 1; }
body.gift-page.bg-hearts {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M22 30c-4-8-16-6-16 3 0 7 9 12 16 19 7-7 16-12 16-19 0-9-12-11-16-3z' fill='%23ff4f8b' fill-opacity='.14'/%3E%3Cpath d='M66 66c-2.5-5-10-4-10 2 0 4 5.5 7.5 10 12 4.5-4.5 10-8 10-12 0-6-7.5-7-10-2z' fill='%23ff4f8b' fill-opacity='.1'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #fff0f5, #ffdce9);
}
body.gift-page.bg-stars {
  --ink: #ffffff; --muted: #d6d0f5;
  background: linear-gradient(180deg, #0f0c29, #302b63 65%, #24243e);
}
body.gift-page.bg-stars::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 70px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 150px 120px, #fff, transparent),
    radial-gradient(1px 1px at 60px 160px, #fff, transparent),
    radial-gradient(2px 2px at 175px 25px, #ffe9a8, transparent),
    radial-gradient(1px 1px at 120px 190px, #fff, transparent);
  background-size: 200px 200px;
  animation: twinkle 3s ease-in-out infinite alternate;
}
body.gift-page.bg-confetti {
  background:
    radial-gradient(circle at 15px 20px, #ffd84d 3px, transparent 4px),
    radial-gradient(circle at 70px 40px, #7dd3fc 3px, transparent 4px),
    radial-gradient(circle at 40px 90px, #ff4f8b 3px, transparent 4px),
    radial-gradient(circle at 100px 100px, #a78bfa 3px, transparent 4px),
    radial-gradient(circle at 95px 15px, #34d399 2px, transparent 3px),
    #fffaf3;
  background-size: 120px 120px;
}
body.gift-page.bg-sunset { background: linear-gradient(170deg, #ffd6a5 0%, #ffadad 50%, #bdb2ff 100%) fixed; }

/* Sound toggle */
.sound-btn {
  position: fixed; top: 12px; right: 12px; z-index: 20; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.85); font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

/* Ask ("Will you?") */
.ask-face { font-size: 5rem; line-height: 1; animation: float 2.4s ease-in-out infinite; }
.ask-buttons { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 70px; }
.ask-yes, .ask-no {
  border: 0; font: inherit; font-weight: 900; font-size: 1.15rem; padding: 14px 28px; border-radius: 999px; cursor: pointer;
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.ask-yes { background: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.ask-no { background: #fff; color: #2a1b2d; box-shadow: 0 4px 14px rgba(0,0,0,.1); white-space: nowrap; }
.ask-no.runaway { position: fixed; z-index: 15; transition: left .25s ease, top .25s ease; }

/* Balloon pop */
.pop-grid { display: grid; grid-template-columns: repeat(3, 80px); gap: 26px 22px; padding-bottom: 40px; }
.pop-balloon {
  width: 72px; height: 90px; position: relative; cursor: pointer; justify-self: center;
  border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.1);
  animation: bob 2.6s ease-in-out infinite;
}
.pop-balloon::before { content: ''; position: absolute; left: 16px; top: 14px; width: 12px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.55); transform: rotate(25deg); }
.pop-balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 36px; background: rgba(0,0,0,.25); }
.pop-balloon.popped { animation: burstAway .22s ease-out forwards; pointer-events: none; }

/* After-reveal actions */
.after-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; animation: fadeIn .4s 1.2s both; }
.after-row .replay { animation: none; }
.replay.primary { background: var(--accent); color: #fff; }
.replay:disabled { opacity: .6; }

.after-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Affiliate card ("send a real gift too") */
.aff-card {
  background: rgba(255,255,255,.92); color: #2a1b2d; border-radius: 18px; padding: 14px 16px 10px;
  width: min(420px, calc(100vw - 32px)); box-shadow: 0 8px 24px rgba(60,20,50,.1); animation: fadeIn .4s 1.6s both;
}
.aff-title { font-weight: 900; margin-bottom: 10px; }
.aff-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.aff-item {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #2a1b2d; font-weight: 800; font-size: .92rem;
  border: 2px solid #f1e1e8; border-radius: 999px; padding: 7px 14px; background: #fff;
}
.aff-item:hover { border-color: var(--accent); }
.aff-emoji { font-size: 1.15rem; }
.aff-note { font-size: .72rem; color: #9a8a9c; margin: 10px 0 0; }

/* Reply sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 25, .5);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s both;
}
.sheet {
  position: relative; background: #fff; color: #2a1b2d; width: min(480px, 100%);
  border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow: auto; text-align: left; user-select: text; animation: sheetUp .3s ease both;
}
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.sheet h2 { margin: 0 0 4px; font-size: 1.35rem; }
.sheet-sub { margin: 0 0 14px; color: #7b6a7d; }
.sheet-close { position: absolute; top: 10px; right: 12px; border: 0; background: #f6eef2; color: #2a1b2d; width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.sheet-field { display: block; margin-bottom: 12px; }
.sheet-field > span { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.sheet-field input, .sheet-field textarea {
  width: 100%; font: inherit; color: #2a1b2d; background: #fff8fa; border: 2px solid #f1e1e8;
  border-radius: 12px; padding: 10px 12px; outline: none;
}
.sheet-field textarea { min-height: 96px; resize: vertical; }
.sheet-field input:focus, .sheet-field textarea:focus { border-color: var(--accent); }
.sheet-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-chip { border: 2px solid #f1e1e8; background: #fff8fa; color: #2a1b2d; font: inherit; font-weight: 800; font-size: .88rem; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.sheet-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #fff); }
.sheet-btn { width: 100%; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 900; padding: 13px; border-radius: 999px; cursor: pointer; margin-top: 4px; }
.sheet-ready { font-weight: 800; margin: 16px 0 8px; text-align: center; }
.sheet-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sheet-share { border: 2px solid #f1e1e8; background: #fff; color: #2a1b2d; font: inherit; font-weight: 800; padding: 9px 16px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.sheet-share.wa { background: #25d366; border-color: #25d366; color: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: #2a1b2d; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700;
  width: max-content; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fadeIn .3s ease both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Lock screen + countdown */
.lock-card {
  background: #fff; color: #2a1b2d; border-radius: 22px; padding: 28px 22px 20px;
  width: min(360px, calc(100vw - 32px)); box-shadow: 0 18px 40px rgba(60, 20, 50, .15);
}
.lock-card h1 { font-size: 1.4rem; margin: 6px 0 0; }
.lock-icon { font-size: 3.4rem; line-height: 1; }
.lock-hint { color: #7b6a7d; margin: 8px 0 0; font-weight: 700; }
.lock-form { display: flex; gap: 8px; margin-top: 16px; }
.lock-form input {
  flex: 1; min-width: 0; font: inherit; color: #2a1b2d; border: 2px solid #f1e1e8; border-radius: 12px;
  padding: 10px 12px; outline: none; user-select: text;
}
.lock-form input:focus { border-color: var(--accent); }
.lock-btn { border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 900; padding: 10px 20px; border-radius: 12px; cursor: pointer; }
.lock-btn:disabled { opacity: .6; }
.lock-err { color: #dc2626; font-weight: 700; min-height: 1.4em; margin: 8px 0 0; font-size: .9rem; }
.shake-x { animation: shakeX .4s; }
.wait-sub { color: var(--muted); font-weight: 700; margin: 0; }
.countdown { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cd-box { background: #fff; border-radius: 14px; padding: 12px 8px; min-width: 70px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.cd-box b { display: block; font-size: 1.8rem; font-weight: 900; color: var(--accent); line-height: 1.1; }
.cd-box span { font-size: .8rem; color: #7b6a7d; font-weight: 700; }

/* Surprise egg */
.egg { position: relative; width: 170px; height: 220px; cursor: pointer; margin-top: 20px; transition: transform .6s; }
.egg.small { transform: scale(.65); margin: -20px 0 -30px; }
.egg-half {
  position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.75) 0 7%, transparent 22%),
    linear-gradient(180deg, transparent 0 28%, var(--accent) 28% 34%, transparent 34% 66%, #ffd84d 66% 72%, transparent 72%),
    radial-gradient(circle at 50% 45%, #fffaf0, #ffdcae);
  box-shadow: inset -14px -18px 0 rgba(0,0,0,.06);
}
.egg-top { z-index: 2; clip-path: polygon(0 0,100% 0,100% 52%,90% 46%,80% 52%,70% 46%,60% 52%,50% 46%,40% 52%,30% 46%,20% 52%,10% 46%,0 52%); transition: transform .8s cubic-bezier(.3,-0.4,.4,1.3), opacity .8s; }
.egg-bottom { clip-path: polygon(0 52%,10% 46%,20% 52%,30% 46%,40% 52%,50% 46%,60% 52%,70% 46%,80% 52%,90% 46%,100% 52%,100% 100%,0 100%); transition: transform .6s; }
.egg-crack { position: absolute; inset: 0; z-index: 3; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; overflow: hidden; pointer-events: none; transition: opacity .2s; }
.egg-crack svg { width: 100%; height: 100%; display: block; }
.egg-crack polyline { fill: none; stroke: #8a6236; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset .3s; }
.egg[data-crack="1"] .egg-crack polyline { stroke-dashoffset: 110; }
.egg[data-crack="2"] .egg-crack polyline { stroke-dashoffset: 55; }
.egg[data-crack="3"] .egg-crack polyline { stroke-dashoffset: 0; }
.egg.broken { cursor: default; }
.egg.broken .egg-crack { opacity: 0; }
.egg.broken .egg-top { transform: translateY(-160px) rotate(-28deg); opacity: 0; }
.egg.broken .egg-bottom { transform: translateY(16px); }
.egg.shake { animation: eggShake .35s; }
.egg-chick { position: absolute; left: 50%; top: 38%; z-index: 1; font-size: 4.2rem; transform: translate(-50%, 0) scale(0); animation: chickPop .6s .35s cubic-bezier(.2, 1.6, .4, 1) forwards; }

/* Coupon */
.ticket-wrap { filter: drop-shadow(0 14px 24px rgba(60, 20, 50, .16)); }
.ticket {
  position: relative; width: min(360px, calc(100vw - 32px)); background: #fff; color: #2a1b2d;
  border-radius: 16px; padding: 22px 30px 26px; text-align: left;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 14px, #000 15px) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent 14px, #000 15px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, transparent 14px, #000 15px) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent 14px, #000 15px) right / 51% 100% no-repeat;
}
.ticket::before { content: ''; position: absolute; inset: 8px; border: 2px dashed color-mix(in srgb, var(--accent) 45%, #fff); border-radius: 10px; pointer-events: none; }
.ticket-head { font-weight: 900; letter-spacing: .2em; font-size: .78rem; color: var(--accent); }
.ticket-text { font-family: 'Caveat', cursive; font-size: 2.3rem; line-height: 1.1; margin: 8px 0; overflow-wrap: anywhere; }
.ticket-to { color: #7b6a7d; font-weight: 700; }
.ticket-no { position: absolute; right: 26px; bottom: 14px; font-size: .72rem; color: #b3a3b5; font-family: ui-monospace, monospace; }
.stamp {
  position: absolute; right: 22px; top: 70%; border: 4px solid #16a34a; color: #16a34a; background: rgba(255,255,255,.75);
  font-weight: 900; padding: 4px 12px; border-radius: 8px; letter-spacing: .1em;
  transform: translateY(-50%) rotate(-14deg) scale(2.6); opacity: 0; animation: stampIn .35s ease-in forwards;
}

@keyframes shakeX { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes eggShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes chickPop { to { transform: translate(-50%, -70%) scale(1); } }
@keyframes stampIn { to { transform: translateY(-50%) rotate(-14deg) scale(1); opacity: 1; } }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes burstAway { to { transform: scale(1.5); opacity: 0; } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 8% { transform: rotate(-7deg); } 16% { transform: rotate(7deg); } 24% { transform: rotate(-4deg); } 32% { transform: rotate(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flicker { from { transform: scaleY(1) rotate(-2deg); } to { transform: scaleY(1.12) rotate(2deg); } }
@keyframes smoke { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-40px) scale(3); } }
@keyframes rise { to { transform: translateY(calc(-100vh - 160px)) rotate(var(--rot, 0deg)); } }

@media (prefers-reduced-motion: reduce) {
  .gbox, .env, .hint, .flame, .ask-face, .pop-balloon, body.gift-page.bg-stars::before { animation: none; }
}
