:root {
  --pink: #ff6bb5;
  --pink-deep: #ff3d9a;
  --purple: #a78bfa;
  --yellow: #ffe566;
  --sky: #7dd3fc;
  --mint: #6ee7b7;
  --cream: #fff7ed;
  --ink: #3b0764;
  --box: #ff4d6d;
  --lid: #ff8fab;
  --ribbon: #ffe566;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 10%, #fbcfe8 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, #c4b5fd 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, #bae6fd 0%, transparent 50%),
    linear-gradient(165deg, #fdf2f8 0%, #ede9fe 45%, #e0f2fe 100%);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem calc(1.5rem + var(--safe-bottom));
}

#stars, #confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.7;
  animation: twinkle 2.4s ease-in-out infinite;
  box-shadow: 0 0 6px #fff;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

.screen {
  width: min(100%, 420px);
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.5s ease;
}
.screen[hidden] { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.sparkle-line {
  font-size: 1.4rem;
  letter-spacing: 0.4rem;
  margin: 0.5rem 0 0;
  animation: bounceY 1.6s ease-in-out infinite;
}
@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hello {
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 10vw, 3rem);
  margin: 0.2rem 0;
  background: linear-gradient(90deg, var(--pink-deep), var(--purple), #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.sub {
  font-size: 1.15rem;
  margin: 0.6rem 0 0.2rem;
  font-weight: 600;
}
.sub2 {
  font-size: 1.05rem;
  margin: 0 0 1.2rem;
  opacity: 0.85;
}

/* —— Gift —— */
.gift {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.gift:focus-visible { outline: 3px solid var(--purple); outline-offset: 6px; border-radius: 16px; }

.gift-box {
  width: min(72vw, 240px);
  position: relative;
  filter: drop-shadow(0 18px 24px rgba(190, 24, 93, 0.35));
  transition: transform 0.2s ease;
  animation: wiggle 2.2s ease-in-out infinite;
}
.gift:active .gift-box { transform: scale(0.96); }
@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2.5deg); }
}

.lid {
  height: 52px;
  background: linear-gradient(180deg, #ffb3c6, var(--lid));
  border-radius: 12px 12px 4px 4px;
  position: relative;
  z-index: 2;
  transform-origin: bottom center;
  border: 3px solid #fff6;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.06);
}
.box-body {
  height: 140px;
  margin-top: -4px;
  background: linear-gradient(180deg, var(--box), #e11d48);
  border-radius: 6px 6px 18px 18px;
  position: relative;
  border: 3px solid #fff6;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ribbon-v, .ribbon-h {
  position: absolute;
  background: linear-gradient(180deg, #fff1a8, var(--ribbon));
  z-index: 1;
}
.ribbon-v {
  width: 28px; left: 50%; top: 0; bottom: 0;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px #fde68a55;
}
.ribbon-h {
  height: 28px; left: 0; right: 0; top: 42%;
  box-shadow: 0 0 0 2px #fde68a55;
}
.qmark {
  position: relative;
  z-index: 2;
  font-size: 3.2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0,0,0,0.15);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.bow { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); z-index: 3; width: 80px; height: 40px; }
.bow-left, .bow-right {
  position: absolute; width: 36px; height: 28px; background: var(--yellow);
  border-radius: 50% 50% 40% 40%; top: 4px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.08);
}
.bow-left { left: 0; transform: rotate(-25deg); }
.bow-right { right: 0; transform: rotate(25deg); }
.bow-knot {
  position: absolute; left: 50%; top: 10px; width: 22px; height: 22px;
  background: #fbbf24; border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 3px 0 #d97706;
}

.tap-hint {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pink-deep);
  background: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 8px 0 #f9a8d4, 0 12px 24px rgba(244, 114, 182, 0.35);
  animation: hintBounce 1.1s ease-in-out infinite;
}
@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* opening animation */
.gift.opening .gift-box { animation: none; }
.gift.opening .lid {
  animation: lidFly 0.7s cubic-bezier(.2,.8,.2,1.2) forwards;
}
.gift.opening .box-body {
  animation: boxPop 0.55s ease forwards;
}
@keyframes lidFly {
  0% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(-120px) rotate(-18deg); opacity: 0; }
}
@keyframes boxPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(0.4); opacity: 0; }
}

.floaties {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  font-size: 1.6rem;
  opacity: 0.85;
}
.floaties span {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
.floaties span:nth-child(odd) { animation-delay: 0.4s; }
.floaties span:nth-child(3n) { animation-delay: 0.9s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}

/* —— Reveal —— */
.burst {
  font-size: 3.5rem;
  animation: popIn 0.6s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.yay {
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  margin: 0.2rem 0;
  color: var(--pink-deep);
  text-shadow: 0 3px 0 #fbcfe8;
}
.reveal-lead {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.3rem 0 1rem;
}

.ticket {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 8px var(--yellow),
    0 20px 40px rgba(124, 58, 237, 0.2);
  text-align: left;
  margin-bottom: 1.2rem;
}
.ticket-top {
  background: linear-gradient(135deg, #fce7f3, #ede9fe);
  padding: 1rem 1.1rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.zoo-logo {
  max-width: 170px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.ticket-label {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--purple);
  background: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.ticket-body {
  padding: 1rem 1.15rem 1.1rem;
}
.ticket-body h2 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  color: #9d174d;
  text-align: center;
}
.big-emoji {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.15rem;
  margin: 0.4rem 0 0.7rem;
}
.ticket-body p {
  margin: 0 0 0.9rem;
  line-height: 1.45;
  font-size: 1rem;
  text-align: center;
}
.ticket-perforation {
  height: 16px;
  background:
    radial-gradient(circle at 0 50%, transparent 8px, #fff 9px) left / 16px 100%,
    linear-gradient(90deg, transparent 0, transparent 6px, #fce7f3 6px, #fce7f3 10px, transparent 10px) center / 16px 2px;
  background-repeat: repeat-x;
  background-color: #fdf2f8;
  border-top: 2px dashed #f9a8d4;
  border-bottom: 2px dashed #f9a8d4;
}
.ticket-bottom {
  padding: 1rem 1.15rem 1.2rem;
  background: linear-gradient(180deg, #fffbeb, #fff);
  text-align: center;
}
.ticket-bottom h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #b45309;
}
.dinner-title {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.dinner-note {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
}
.dinner-plate {
  font-size: 1.8rem;
  margin-top: 0.6rem;
  letter-spacing: 0.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 8px 0 #c026d3aa, 0 12px 24px rgba(192, 38, 211, 0.3);
}
.btn.ghost {
  background: #fff;
  color: var(--pink-deep);
  box-shadow: 0 4px 0 #fbcfe8;
  margin-top: 0.5rem;
  width: auto;
  padding-inline: 1.4rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.fact {
  background: #fff9;
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 0.6rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.fact span { font-size: 1.2rem; display: block; margin-bottom: 0.2rem; }
.fact p { margin: 0; font-weight: 600; }

.love {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
  line-height: 1.45;
}
.hearts {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  animation: bounceY 1.4s ease-in-out infinite;
}

/* confetti pieces */
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
  opacity: 0.95;
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}

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