:root {
  --bg-start: #ffe6f0;
  --bg-end: #fff9f2;
  --accent: #f7b6d5;
  --accent-strong: #f09bbf;
  --text-main: #3a2b3b;
  --text-soft: #7b5b7a;
  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: linear-gradient(145deg, var(--bg-start), var(--bg-end));
  overflow: hidden;
}

#intro-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 198, 227, 0.45), rgba(255, 198, 227, 0) 45%),
    radial-gradient(circle at 85% 70%, rgba(255, 230, 156, 0.32), rgba(255, 230, 156, 0) 40%),
    linear-gradient(165deg, #ffe7f2 0%, #fff4ec 46%, #fde9f4 100%);
  z-index: 1000;
  overflow: hidden;
}

.intro-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.intro-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.45;
  animation: introBlobFloat 10s ease-in-out infinite;
}

.ib1 {
  width: 220px;
  height: 220px;
  left: 10%;
  top: 14%;
  background: radial-gradient(circle, rgba(255, 193, 226, 0.9), rgba(255, 193, 226, 0.15));
}

.ib2 {
  width: 300px;
  height: 300px;
  right: -80px;
  top: 56%;
  background: radial-gradient(circle, rgba(253, 233, 169, 0.9), rgba(253, 233, 169, 0.12));
  animation-delay: -3s;
}

.ib3 {
  width: 160px;
  height: 160px;
  left: 36%;
  bottom: -40px;
  background: radial-gradient(circle, rgba(210, 227, 255, 0.92), rgba(210, 227, 255, 0.12));
  animation-delay: -6s;
}

.intro-spark {
  position: absolute;
  color: rgba(165, 121, 163, 0.6);
  font-size: 1rem;
  animation: introSparkle 2.6s ease-in-out infinite;
}

.is1 { left: 23%; top: 24%; }
.is2 { right: 25%; top: 22%; animation-delay: -0.9s; }
.is3 { right: 18%; bottom: 24%; animation-delay: -1.7s; }
.is4 { left: 30%; bottom: 20%; animation-delay: -0.4s; }

.intro-gift {
  font-size: 1.7rem;
  margin-bottom: 0.9rem;
  filter: drop-shadow(0 10px 15px rgba(240, 155, 191, 0.32));
  animation: giftPop 2s ease-in-out infinite;
}

.intro-balloon-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.intro-heart-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.intro-heart {
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(243, 80, 146, 0.95);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(246, 112, 156, 0.48);
  animation: introHeartFloat 3.2s ease-in-out infinite;
}

.intro-heart::before,
.intro-heart::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: inherit;
}

.intro-heart::before { left: -10px; }
.intro-heart::after { top: -10px; }

.ih1 { left: 14%; bottom: 26%; animation-delay: -0.3s; }
.ih2 { right: 16%; bottom: 22%; animation-delay: -1.2s; }
.ih3 { left: 26%; top: 24%; animation-delay: -2s; }
.ih4 { right: 30%; top: 28%; animation-delay: -2.6s; }

.intro-content {
  text-align: center;
  padding: 2.2rem 2.2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow:
    0 22px 45px rgba(220, 163, 205, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  max-width: 500px;
  margin: 1rem;
  animation:
    introCardIn 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) forwards,
    introFloat 4s ease-in-out 0.9s infinite alternate;
  position: relative;
  z-index: 4;
}

.intro-subtitle {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6e4f6c;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

#open-surprise-btn {
  border: none;
  cursor: pointer;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  background-size: 210% 100%;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 24px rgba(240, 155, 191, 0.44);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, background-position 0.4s ease;
  animation:
    buttonGlow 2.6s ease-in-out infinite,
    introButtonSheen 5s linear infinite;
  position: relative;
  overflow: hidden;
}

#open-surprise-btn::after {
  content: "♥";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -10px) scale(0.4);
  opacity: 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 14px rgba(255, 192, 220, 0.9);
  pointer-events: none;
}

#open-surprise-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
  box-shadow: 0 14px 30px rgba(240, 155, 191, 0.6);
  background-position: 100% 0;
}

#open-surprise-btn:hover::after {
  animation: introHeartPop 0.9s ease-out forwards;
}

.intro-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #6f5470;
  font-weight: 500;
}

#main-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hidden {
  display: none;
}

.background-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 214, 255, 0.55) 0, transparent 50%),
    radial-gradient(circle at 90% 0%, rgba(255, 244, 214, 0.7) 0, transparent 52%),
    linear-gradient(145deg, #ffe4f2, #fffaf5);
  z-index: 0;
  animation: bgGlow 10s ease-in-out infinite alternate;
}

.cinematic-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0) 42%, rgba(100, 66, 97, 0.1) 100%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 58%);
}

.ambient-orbs {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: orbFloat 16s ease-in-out infinite;
}

.orb-1 {
  width: 220px;
  height: 220px;
  top: 8%;
  left: 8%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 196, 227, 0.2));
}

.orb-2 {
  width: 320px;
  height: 320px;
  top: 58%;
  right: -70px;
  background: radial-gradient(circle at 40% 40%, rgba(255, 246, 202, 0.9), rgba(249, 217, 118, 0.18));
  animation-delay: -4s;
}

.orb-3 {
  width: 150px;
  height: 150px;
  bottom: 12%;
  left: 14%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.9), rgba(247, 182, 213, 0.22));
  animation-delay: -8s;
}

.orb-4 {
  width: 120px;
  height: 120px;
  top: 18%;
  right: 24%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.88), rgba(219, 195, 255, 0.2));
  animation-delay: -12s;
}

.balloon-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
}

.balloon {
  position: absolute;
  bottom: -150px;
  width: 78px;
  height: 102px;
  border-radius: 50% 50% 45% 45%;
  box-shadow: inset -12px -14px 28px rgba(255, 255, 255, 0.4), 0 18px 32px rgba(117, 77, 114, 0.35);
  opacity: 0.96;
  animation: balloonRise linear infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 95px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(138, 100, 136, 0.65), rgba(138, 100, 136, 0.05));
}

.b1 { left: 10%; background: #ffb6dc; animation-duration: 13s; animation-delay: -2s; }
.b2 { left: 28%; background: #ffe08d; animation-duration: 15s; animation-delay: -8s; }
.b3 { right: 30%; background: #ffc9e5; animation-duration: 12s; animation-delay: -4s; }
.b4 { right: 10%; background: #b9ddff; animation-duration: 14s; animation-delay: -10s; }
.b5 { left: 50%; background: #ffc8b8; animation-duration: 16s; animation-delay: -6s; }

.ibal1 { left: 12%; width: 82px; height: 108px; background: #ffb3d7; animation-duration: 13s; animation-delay: -1s; opacity: 0.96; }
.ibal2 { right: 12%; width: 80px; height: 106px; background: #ffe08d; animation-duration: 16s; animation-delay: -5s; opacity: 0.95; }
.ibal3 { left: 46%; width: 78px; height: 102px; background: #b9ddff; animation-duration: 15s; animation-delay: -8s; opacity: 0.94; }

#heart-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

#fireworks-darkener {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(3, 4, 12, 0.76);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

#main-container.fireworks-mode #fireworks-darkener {
  opacity: 1;
}

.heart {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #ff4f8d;
  transform: rotate(45deg);
  border-radius: 2px;
  opacity: 1;
  box-shadow: 0 0 14px rgba(255, 92, 153, 0.48);
  animation: heartFloat 2.6s ease-out forwards;
}

.sparkle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(249, 217, 118, 0.95) 52%, rgba(249, 217, 118, 0) 100%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
  animation: sparkleBurst 0.95s ease-out forwards;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: inherit;
}

.heart::before { left: -11px; }
.heart::after { top: -11px; }

#stars-canvas,
#petals-canvas,
#fireworks-canvas,
#confetti-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#fireworks-canvas {
  z-index: 9;
}

.content-wrapper {
  position: relative;
  z-index: 3;
  height: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 4vh 1.6rem 6vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 28px;
  backdrop-filter: blur(6px);
  box-shadow: 0 28px 45px rgba(123, 91, 122, 0.16);
}

.greeting-line {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
}

.line-1 {
  position: relative;
  display: inline-block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  color: #2f2431;
  text-shadow: 0 8px 30px rgba(255, 255, 255, 0.7);
}

.line-1::after {
  content: "";
  position: absolute;
  top: -8%;
  left: -34%;
  width: 26%;
  height: 116%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
  filter: blur(1px);
  opacity: 0;
}

.line-1.shimmer::after {
  animation: nameShimmer 1.8s ease-in-out 1;
}

.line-1 span {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.8s ease;
}

.line-1 span.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.line-1 span.landed {
  animation: letterGlowPulse 0.85s ease-out 1;
}

.line-2 {
  position: relative;
  display: inline-block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff4f97;
  text-shadow: 0 8px 26px rgba(255, 120, 170, 0.62);
  margin-bottom: 1.8rem;
}

.line-2::after {
  content: "";
  position: absolute;
  top: -8%;
  left: -30%;
  width: 26%;
  height: 116%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0));
  filter: blur(1px);
  opacity: 0;
}

.line-2.shimmer::after {
  animation: nameShimmer 1.8s ease-in-out 1;
}

.name-line span {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  text-shadow: 0 0 0 rgba(255, 255, 255, 0);
}

.name-line span.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  text-shadow: 0 0 18px rgba(255, 216, 236, 0.88);
  transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.7s ease, text-shadow 0.9s ease;
}

.cake-section {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
  margin: 1.2rem 0 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cake {
  position: relative;
  width: min(260px, 70vw);
  height: 220px;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 24px 32px rgba(122, 72, 120, 0.32));
}

.cake.alive {
  animation: cakeBreath 3.8s ease-in-out infinite;
}

.cake-plate,
.cake-layer,
.cake-frosting,
.candle,
.blow-btn {
  opacity: 0;
  transition: opacity 0.85s ease, transform 0.9s cubic-bezier(0.2, 0.9, 0.2, 1), filter 0.9s ease;
}

.cake-plate {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 82%;
  height: 26px;
  transform: translateX(-50%) translateY(16px) scale(0.9);
  background: radial-gradient(circle at 50% 0, #ffffff, #f0dde8);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(123, 91, 122, 0.35);
}

.cake-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.92);
  border-radius: 20px 20px 16px 16px;
  box-shadow: 0 10px 26px rgba(123, 91, 122, 0.25);
}

.cake-layer.bottom {
  width: 88%;
  height: 80px;
  bottom: 26px;
  background: linear-gradient(180deg, #ffd9eb, #f7a9d1);
}

.cake-layer.middle {
  width: 72%;
  height: 72px;
  bottom: 90px;
  background: linear-gradient(180deg, #fff2f9, #ffcae4);
}

.cake-layer.top {
  width: 56%;
  height: 60px;
  bottom: 152px;
  background: linear-gradient(180deg, #ffffff, #ffd9eb);
}

.cake-frosting {
  position: absolute;
  left: 50%;
  bottom: 152px;
  transform: translateX(-50%) translateY(14px) scale(0.94);
  width: 60%;
  height: 34px;
  background: linear-gradient(180deg, #ffffff, #ffe8f5);
  border-radius: 18px 18px 24px 24px;
  box-shadow: 0 6px 14px rgba(240, 155, 191, 0.45);
}

.candles {
  position: absolute;
  bottom: 172px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(12px) scale(0.9);
}

.candle-body {
  width: 12px;
  height: 54px;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, #ffd2ef, #ffd2ef 5px, #f3b8de 5px, #f3b8de 10px);
  box-shadow: 0 4px 12px rgba(123, 91, 122, 0.5);
}

.flame {
  width: 18px;
  height: 28px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #fffbe7 0, #ffe7a3 40%, #f6a15b 75%, rgba(0, 0, 0, 0) 100%);
  box-shadow: 0 0 28px rgba(249, 217, 118, 0.98);
  transform-origin: bottom center;
  animation: flameFlicker 0.9s ease-in-out infinite alternate;
}

.candle.extinguished .flame {
  opacity: 0;
  animation: none;
  box-shadow: none;
}

.blow-btn {
  border: none;
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(123, 91, 122, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  transform: translateY(8px) scale(0.94);
}

.cake-plate.built,
.cake-layer.built,
.cake-frosting.built,
.candle.built,
.blow-btn.built {
  opacity: 1;
  filter: drop-shadow(0 10px 20px rgba(122, 72, 120, 0.35));
}

.cake-plate.built {
  transform: translateX(-50%) translateY(0) scale(1);
  animation: cakePiecePop 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.cake-layer.built {
  transform: translateX(-50%) translateY(0) scale(1);
  animation: cakePiecePop 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.cake-frosting.built {
  transform: translateX(-50%) translateY(0) scale(1);
  animation: cakePiecePop 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.candle.built {
  transform: translateY(0) scale(1);
  animation: cakePiecePop 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.blow-btn.built {
  transform: translateY(0) scale(1);
  animation: cakePiecePop 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.blow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(123, 91, 122, 0.28);
}

.blow-hint {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 73, 90, 0.9);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.cake-section .blow-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.blow-arrow {
  font-size: 1.3rem;
  animation: blowArrowBounce 1.4s ease-in-out infinite;
}

.blow-text {
  background: rgba(255, 255, 255, 0.82);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(123, 91, 122, 0.24);
}

.final-greeting {
  max-width: 620px;
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #5a3f58;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.58);
}

.special-note {
  max-width: 650px;
  margin-top: 0;
  font-size: 0.96rem;
  line-height: 1.7;
  color: #41213a;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
  font-weight: 500;
}

#fireworks-message-card {
  position: absolute;
  left: 50%;
  top: 62%;
  width: min(760px, 90vw);
  min-height: 160px;
  padding: 1.2rem 1.3rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 167, 203, 0.95), rgba(246, 138, 187, 0.93));
  border: 3px solid rgba(255, 235, 246, 0.85);
  box-shadow: 0 20px 36px rgba(26, 11, 26, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.42);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8) rotateX(-55deg);
  filter: blur(4px);
  pointer-events: none;
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
  transform-style: preserve-3d;
  perspective: 1200px;
  z-index: 12;
}

#fireworks-message-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 4px solid rgba(255, 245, 214, 0.92);
  box-shadow: inset 0 0 0 1px rgba(243, 184, 211, 0.7);
  pointer-events: none;
}

#fireworks-message-card.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotateX(0deg);
  filter: blur(0);
  animation: messageCardFloat 4.2s ease-in-out infinite;
}

.special-note.message-card-open {
  animation: messageCardOpen 0.95s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  position: relative;
  z-index: 3;
  color: #4b2038;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
  font-weight: 600;
  max-width: 100%;
  padding: 1.1rem 2.2rem;
  text-align: center;
}

.card-heart {
  position: absolute;
  color: #ffd8ea;
  text-shadow: 0 2px 8px rgba(195, 71, 123, 0.45);
  font-size: 1.2rem;
  opacity: 0.96;
  animation: cardFloatHeart 2.6s ease-in-out infinite;
  z-index: 2;
}

.ch1 { left: 5%; top: 12%; }
.ch2 { right: 7%; top: 12%; animation-delay: -0.7s; }
.ch3 { left: 8%; bottom: 14%; animation-delay: -1.6s; }
.ch4 { right: 10%; bottom: 14%; animation-delay: -1.1s; }

.card-balloon {
  position: absolute;
  width: 26px;
  height: 34px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #ffbfd8, #f8a7c8);
  box-shadow: inset -7px -8px 14px rgba(255, 255, 255, 0.4), 0 8px 16px rgba(126, 65, 111, 0.3);
  opacity: 0.82;
  animation: cardBalloonFloat 3.2s ease-in-out infinite;
  z-index: 2;
}

.card-balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 26px;
  transform: translateX(-50%);
  background: rgba(140, 93, 132, 0.7);
}

.cb1 { right: 20%; top: -12px; }
.cb2 { left: 22%; bottom: -12px; animation-delay: -1.4s; }

#main-container.fireworks-mode .balloon-layer {
  opacity: 0.45;
}

#main-container.fireworks-mode #fireworks-message-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  filter: blur(0);
}

#main-container.fireworks-mode .content-wrapper {
  z-index: 13;
}

#main-container.fireworks-mode .greeting-line,
#main-container.fireworks-mode .cake-section,
#main-container.fireworks-mode .final-greeting {
  opacity: 0.75;
  filter: blur(0);
}

.fireworks-balloon {
  position: absolute;
  width: 22px;
  height: 28px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #ffc7e1, #f68fc0);
  box-shadow: inset -6px -7px 10px rgba(255, 255, 255, 0.45), 0 10px 20px rgba(56, 25, 50, 0.45);
  z-index: 10;
  pointer-events: none;
  animation: fireworksBalloonRise 6s ease-out forwards;
}

.fireworks-balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 20px;
  transform: translateX(-50%);
  background: rgba(255, 227, 238, 0.8);
}

.tap-hint {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(90, 73, 90, 0.75);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 26px rgba(123, 91, 122, 0.28);
  opacity: 0;
  z-index: 4;
  animation: tapHintPulse 3.5s ease-in-out infinite;
}

.music-hint {
  position: absolute;
  bottom: 3.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: rgba(90, 73, 90, 0.9);
  background: rgba(255, 255, 255, 0.88);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(123, 91, 122, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 4;
}

.music-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.music-toggle-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  border: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #7a5878;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(112, 74, 110, 0.2);
}

.replay-fireworks-btn {
  position: absolute;
  right: 1rem;
  top: 3.5rem;
  z-index: 5;
  border: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #6d4b6b;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(112, 74, 110, 0.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.replay-fireworks-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.replay-hint {
  position: absolute;
  right: 1rem;
  top: 2.5rem;
  z-index: 5;
  padding: 0.32rem 0.66rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #7a5878;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(112, 74, 110, 0.16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.replay-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.content-wrapper.cinematic-focus {
  animation: cinematicFocusIn 2.2s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

@keyframes introFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

@keyframes introCardIn {
  0% {
    transform: translateY(18px) scale(0.96);
    opacity: 0;
    box-shadow: 0 36px 60px rgba(220, 163, 205, 0.0);
  }
  60% {
    transform: translateY(0) scale(1.02);
    opacity: 1;
    box-shadow: 0 30px 52px rgba(220, 163, 205, 0.45);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    box-shadow:
      0 22px 45px rgba(220, 163, 205, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.8);
  }
}

@keyframes introBlobFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -16px) scale(1.06); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes introHeartFloat {
  0% { transform: translateY(0) rotate(45deg) scale(0.9); opacity: 0.55; }
  50% { transform: translateY(-14px) rotate(45deg) scale(1.14); opacity: 1; }
  100% { transform: translateY(0) rotate(45deg) scale(0.9); opacity: 0.55; }
}

@keyframes introSparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 0.95; transform: scale(1.18); }
}

@keyframes giftPop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes balloonRise {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-55vh) translateX(14px);
  }
  100% {
    transform: translateY(-120vh) translateX(-10px);
  }
}

@keyframes heartFloat {
  0% {
    transform: translate(0, 0) rotate(45deg) scale(0.7);
    opacity: 0.92;
  }
  100% {
    transform: translate(var(--dx, 0px), var(--dy, -120px)) rotate(45deg) scale(1.3);
    opacity: 0;
  }
}

@keyframes sparkleBurst {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 0.95;
  }
  100% {
    transform: translate(var(--sx, 0px), var(--sy, -22px)) scale(1.25);
    opacity: 0;
  }
}

@keyframes buttonGlow {
  0% { box-shadow: 0 10px 24px rgba(240, 155, 191, 0.44); }
  50% { box-shadow: 0 14px 30px rgba(240, 155, 191, 0.62); }
  100% { box-shadow: 0 10px 24px rgba(240, 155, 191, 0.44); }
}

@keyframes introButtonSheen {
  0%, 60%, 100% {
    background-position: 0 0;
  }
  70% {
    background-position: 100% 0;
  }
  80% {
    background-position: 0 0;
  }
}

@keyframes introHeartPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.2);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -30px) scale(1.1);
  }
}

@keyframes letterGlowPulse {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  45% {
    text-shadow: 0 0 18px rgba(255, 236, 248, 0.95), 0 0 30px rgba(244, 178, 213, 0.6);
  }
  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes messageCardOpen {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92) rotateX(-62deg);
    filter: blur(6px) brightness(0.95);
    transform-origin: top center;
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02) rotateX(8deg);
    filter: blur(0) brightness(1.03);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: blur(0) brightness(1);
  }
}

@keyframes cardFloatHeart {
  0%, 100% { transform: translateY(0) scale(0.9); }
  50% { transform: translateY(-7px) scale(1.06); }
}

@keyframes cardBalloonFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes messageCardFloat {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1) rotateX(0deg);
  }
  50% {
    transform: translate(-50%, calc(-50% - 6px)) scale(1.01) rotateX(0deg);
  }
}

@keyframes fireworksBalloonRise {
  0% {
    transform: translate(-50%, 0) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 0.95;
  }
  100% {
    transform: translate(calc(-50% + var(--balloon-drift-x, 0px)), calc(-1 * var(--balloon-rise, 180px))) scale(1.06);
    opacity: 0;
  }
}

@keyframes bgGlow {
  from { filter: brightness(1) saturate(1); }
  to { filter: brightness(1.07) saturate(1.08); }
}

@keyframes nameShimmer {
  0% {
    left: -34%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    left: 112%;
    opacity: 0;
  }
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -24px) scale(1.06); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes flameFlicker {
  0% { transform: scaleY(1) translateY(0); opacity: 0.95; }
  50% { transform: scaleY(1.08) translateY(-2px); opacity: 1; }
  100% { transform: scaleY(0.9) translateY(1px); opacity: 0.9; }
}

@keyframes cakeBreath {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 24px 32px rgba(122, 72, 120, 0.32));
  }
  50% {
    transform: translateY(-3px) scale(1.015);
    filter: drop-shadow(0 28px 38px rgba(122, 72, 120, 0.42));
  }
}

@keyframes cakePiecePop {
  0% {
    transform: translateY(10px) scale(0.9);
    filter: brightness(0.96) drop-shadow(0 4px 10px rgba(122, 72, 120, 0.2));
  }
  55% {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.06) drop-shadow(0 14px 26px rgba(122, 72, 120, 0.45));
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) drop-shadow(0 10px 20px rgba(122, 72, 120, 0.35));
  }
}

@keyframes cinematicFocusIn {
  0% {
    transform: scale(1);
    filter: saturate(1);
  }
  35% {
    transform: scale(1.045);
    filter: saturate(1.08);
  }
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes tapHintPulse {
  0%, 100% {
    box-shadow: 0 12px 26px rgba(123, 91, 122, 0.28);
  }
  50% {
    box-shadow: 0 14px 30px rgba(123, 91, 122, 0.38);
  }
}

@keyframes blowArrowBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

@keyframes tapHintPulse {
  0%, 100% {
    box-shadow: 0 12px 26px rgba(123, 91, 122, 0.28);
  }
  50% {
    box-shadow: 0 14px 30px rgba(123, 91, 122, 0.38);
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 3vh 1.2rem 5vh;
    border-radius: 20px;
  }
  .line-1, .line-2 { letter-spacing: 0.12em; }
}

@media (max-width: 480px) {
  .intro-content { padding: 2rem 1.3rem; }
  #open-surprise-btn { width: 100%; }
  .music-toggle-btn { top: 0.7rem; right: 0.7rem; }
}
