:root {
  --bg-cream: #f7f4f3;
  --bg-rose: #fff1f5;
  --ink-soft: #7d706f;
  --ink-dark: #423632;
  --pink-1: #ff4f8a;
  --pink-2: #d91b66;
  --pink-3: #ff9bc1;
  --gold: #f7cd47;
  --violet-bg: #1c0f23;
  --violet-2: #32152c;
  --white: #ffffff;
  --shadow-xl: 0 24px 60px rgba(173, 111, 132, 0.22);
  --shadow-card: 0 18px 40px rgba(76, 44, 56, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  font-family: "Inter", Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 190, 213, 0.24), transparent 28%),
    linear-gradient(180deg, #fbfafa 0%, #f6f3f4 100%);
  color: var(--ink-dark);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.fx-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  pointer-events: none;
  z-index: 5;
}

.hero-fx-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: 1;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.screen-backdrops {
  position: absolute;
  inset: 0;
  min-height: 100%;
  z-index: 0;
}

.screen-backdrop {
  position: absolute;
  inset: 0;
  min-height: 100%;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.screen-backdrop-active {
  opacity: 1;
}

.backdrop-intro {
  background:
    radial-gradient(circle at top, rgba(255, 182, 206, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 244, 0.96));
}

.backdrop-countdown,
.backdrop-hero {
  background:
    radial-gradient(circle at center, rgba(120, 53, 102, 0.35), transparent 35%),
    linear-gradient(180deg, var(--violet-bg) 0%, #120a19 100%);
}

.backdrop-memory,
.backdrop-paper {
  background:
    linear-gradient(rgba(250, 247, 247, 0.28), rgba(250, 247, 247, 0.38)),
    url("./background-memory.jpg") center/cover no-repeat;
  filter: blur(6px) saturate(1);
  transform: scale(1.04);
}

.backdrop-moments {
  background:
    linear-gradient(rgba(250, 247, 247, 0.24), rgba(250, 247, 247, 0.34)),
    url("./background-memory.jpg") center/cover no-repeat;
  filter: blur(7px) saturate(1.02);
  transform: scale(1.04);
}

.backdrop-gifts {
  background:
    linear-gradient(rgba(255, 241, 234, 0.26), rgba(255, 244, 248, 0.38)),
    url("./background-memory.jpg") center/cover no-repeat;
  filter: blur(7px) saturate(0.96);
  transform: scale(1.04);
}

.screen {
  position: absolute;
  inset: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 36px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.55s ease, transform 0.55s ease;
  z-index: 2;
}

.screen-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.intro-screen {
  gap: 18px;
}

.gift-stage {
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(18px) scale(0.94);
  animation: introGiftReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.gift-box {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 330px);
  padding: 0;
  background: transparent;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.gift-box:hover {
  transform: translateY(-5px) scale(1.015);
  filter: saturate(1.02);
}

.gift-box-glow {
  position: absolute;
  inset: 20% 21% 26%;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 123, 174, 0.32), transparent 28%),
    radial-gradient(circle at 50% 72%, rgba(255, 186, 118, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(255, 244, 248, 0.9), rgba(255, 228, 209, 0.62));
  filter: blur(12px);
  transform: scale(0.98);
}

.gift-box-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 20px 42px rgba(212, 33, 96, 0.22))
    drop-shadow(0 36px 60px rgba(255, 108, 148, 0.2));
}

.intro-copy {
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  animation: introCopyReveal 0.7s ease 0.78s forwards;
}

.eyebrow,
.subcopy,
.ghost-trigger,
.countdown-label,
.time-unit {
  font-family: inherit;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8e8281;
  font-size: 0.72rem;
}

.intro-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  font-style: italic;
  font-weight: 500;
  color: #6b5d59;
}

.subcopy {
  margin-top: 10px;
  color: #afa3a2;
  font-size: 0.65rem;
}

.ghost-trigger,
.text-link {
  background: transparent;
  color: #b7adb0;
  font-size: 0.75rem;
  padding: 12px 16px;
}

.intro-screen .ghost-trigger {
  opacity: 0;
  transform: translateY(14px);
  animation: introCopyReveal 0.65s ease 0.94s forwards;
}

.countdown-screen,
.hero-screen {
  color: var(--white);
}

.countdown-card {
  width: 100%;
  text-align: center;
}

.countdown-label {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-size: 14px;
  margin: 0;
  font-weight: 700;
}

.timer {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.time-block {
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-value {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
}

.time-unit {
  margin-top: 10px;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
}

.time-separator {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 2rem;
}

.text-link {
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 1px dotted rgba(255, 255, 255, 0.38);
}

.hero-screen {
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 40px 24px 56px;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(100%, 980px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-screen h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: inherit;
  font-size: 72px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ff77a8, #ffa64b, #ec85ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-top: 0.12em;
}

.hero-turning {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-family: inherit;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
}

.cta-button {
  position: relative;
  z-index: 1;
  min-width: 220px;
  padding: 16px 24px;
  border-radius: 999px;
  color: var(--white);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff5f8d, #ffbd3e, #bf4dff);
  box-shadow: 0 16px 34px rgba(211, 87, 140, 0.3);
}

.hero-cta {
  min-width: 232px;
  padding: 14px 40px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 36px rgba(211, 87, 140, 0.28);
  font-size: 28px;
}

.cta-soft {
  background: linear-gradient(90deg, #e58daf, #ef9cc8, #c98ee8);
}

.dedication-screen,
.memory-screen,
.card-screen,
.story-screen,
.moments-screen {
  justify-content: space-between;
  padding-top: 56px;
  padding-bottom: 28px;
}

.dedication-card,
.note-card,
.paper-card,
.caption-card,
.gift-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.note-card {
  padding: 30px 22px;
  margin-top: auto;
  margin-bottom: 22px;
  text-align: center;
}

.memory-screen {
  justify-content: center;
  gap: 22px;
  text-align: center;
}

.memory-screen .note-card {
  width: min(100%, 760px);
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.memory-screen .note-icon {
  display: none;
}

.memory-screen .cta-soft {
  margin-top: 10px;
}

.cake-stage {
  position: relative;
  width: min(100%, 300px);
  height: 230px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cake-candle-button {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 72px;
  height: 96px;
  padding: 0;
  background: transparent;
  transform: translateX(-50%);
  z-index: 2;
}

.cake-candle {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 8px;
  height: 42px;
  border-radius: 999px 999px 6px 6px;
  background:
    repeating-linear-gradient(
      180deg,
      #842127 0 11px,
      #c03c2e 11px 22px
    );
  box-shadow:
    inset -1px 0 0 rgba(255, 188, 156, 0.28),
    inset 0 -4px 8px rgba(98, 18, 24, 0.22);
  transform: translateX(-50%);
}

.cake-flame {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 18px;
  height: 28px;
  border-radius: 56% 56% 62% 62% / 78% 78% 40% 40%;
  background:
    radial-gradient(circle at 48% 26%, #fff7c8 0 18%, #ffd15f 18% 50%, #ff9915 50% 78%, #ff6a00 78% 100%);
  box-shadow:
    0 0 12px rgba(255, 183, 40, 0.7),
    0 0 24px rgba(255, 138, 38, 0.34);
  transform: translateX(-50%) rotate(3deg);
  animation: flameFlicker 1s ease-in-out infinite;
  transform-origin: center bottom;
}

.cake-smoke {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 34px;
  height: 42px;
  opacity: 0;
  transform: translateX(-50%);
}

.cake-smoke::before,
.cake-smoke::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.68), rgba(187, 179, 190, 0.08) 72%);
}

.cake-smoke::before {
  left: 4px;
  bottom: 10px;
}

.cake-smoke::after {
  right: 3px;
  bottom: 20px;
}

.cake-stage.is-blown .cake-flame {
  opacity: 0;
  animation: none;
}

.cake-stage.is-blown .cake-smoke {
  animation: smokeRise 1.9s ease-out forwards;
}

.birthday-cake {
  position: relative;
  width: 250px;
  height: 168px;
  filter: drop-shadow(0 16px 20px rgba(71, 46, 32, 0.14));
}

.cake-art {
  display: block;
  width: 100%;
  height: 100%;
}

.cake-tip {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.16);
  color: #fff7fb;
  font-size: 0.98rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(87, 52, 66, 0.12);
}

.mic-button.is-listening {
  background: rgba(255, 116, 163, 0.28);
  border-color: rgba(255, 220, 234, 0.8);
  box-shadow: 0 12px 28px rgba(209, 87, 132, 0.24);
}

.dedication-screen {
  justify-content: center;
  gap: 28px;
  text-align: center;
  overflow: hidden;
}

.dedication-card {
  position: relative;
  z-index: 2;
  width: min(100%, 760px);
  padding: 12px 22px 16px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.dedication-top,
.dedication-age,
.dedication-quote,
.dedication-from,
.dedication-sign {
  margin: 0;
}

.dedication-top {
  color: #ef7fa7;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.dedication-name,
.dedication-sign {
  font-family: cursive;
  font-weight: 500;
  color: #f05d8f;
  line-height: 1;
  text-shadow: 0 8px 26px rgba(255, 255, 255, 0.26);
}

.dedication-name {
  margin: 14px 0 12px;
  font-size: clamp(2.6rem, 12vw, 4.8rem);
}

.dedication-age {
  color: rgba(72, 56, 56, 0.92);
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 0 4px 18px rgba(255, 255, 255, 0.4);
}

.dedication-quote {
  margin-top: 12px;
  color: rgba(88, 72, 78, 0.92);
  font-size: 1.45rem;
  font-style: italic;
  text-shadow: 0 4px 18px rgba(255, 255, 255, 0.36);
}

.dedication-from {
  margin-top: 18px;
  color: rgba(92, 74, 80, 0.92);
  font-size: 1.35rem;
  text-shadow: 0 4px 18px rgba(255, 255, 255, 0.36);
}

.dedication-sign {
  margin-top: 10px;
  font-size: clamp(2rem, 10vw, 3.8rem);
}

.dedication-firework {
  position: absolute;
  top: 18%;
  width: 110px;
  height: 110px;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(255, 120, 180, 0.12));
}

.dedication-firework-right {
  right: 18px;
}

.dedication-firework-gif {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.note-icon {
  font-size: 4.6rem;
  margin-bottom: 12px;
}

.note-card h3,
.paper-card h3,
.gift-panel h3 {
  margin: 0 0 16px;
  font-family: inherit;
  color: #524441;
}

.note-card p,
.paper-card p,
.caption-card p {
  margin: 0;
  color: #6c5a56;
  font-size: 1rem;
  line-height: 1.72;
  font-style: italic;
}

.signature {
  margin-top: 24px !important;
  color: #8f807d !important;
}

.memory-screen h3,
.memory-screen p {
  text-shadow: 0 6px 18px rgba(255, 255, 255, 0.28);
}

.memory-screen h3 {
  color: #51403e;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.memory-screen p {
  color: #5a4643;
}

.memory-screen .signature {
  color: #705c5b !important;
}

.paper-card {
  padding: 24px 20px 30px;
  margin: auto 0;
}

.paper-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.paper-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 1.5rem;
  color: #f07096;
  background: linear-gradient(180deg, #fff2f6, #f7f0f5);
}

.floating-polaroid {
  position: relative;
  z-index: 1;
  width: 112px;
  padding: 10px 10px 18px;
  background: #fff;
  box-shadow: 0 16px 26px rgba(92, 74, 75, 0.2);
}

.polaroid-top {
  align-self: center;
  margin-bottom: 12px;
  transform: rotate(-8deg);
}

.polaroid-bottom {
  align-self: center;
  margin-top: 18px;
  transform: rotate(5deg);
}

.wide {
  width: 126px;
  transform: rotate(7deg);
}

.photo-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
}

.photo-one {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 214, 134, 0.7), transparent 18%),
    linear-gradient(135deg, #7fcf87, #d5f3cf);
}

.photo-two {
  background:
    radial-gradient(circle at 40% 40%, rgba(255, 166, 198, 0.6), transparent 15%),
    linear-gradient(135deg, #313131, #666);
}

.photo-three {
  background:
    radial-gradient(circle at 45% 35%, rgba(254, 226, 136, 0.66), transparent 15%),
    linear-gradient(135deg, #f58d8d, #fee7b3);
}

.photo-four {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.38), transparent 20%),
    linear-gradient(135deg, #89d9dc, #f8b8ca);
}

.moments-screen {
  justify-content: center;
  gap: 26px;
}

.moments-chip {
  position: relative;
  z-index: 1;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: #5b4b49;
}

.moment-preview {
  position: relative;
  z-index: 1;
  width: 132px;
  padding: 10px 10px 20px;
  background: #fff;
  box-shadow: var(--shadow-card);
  transform: rotate(-8deg);
}

.caption-card {
  z-index: 1;
  padding: 24px 22px;
  text-align: center;
}

.gifts-screen {
  justify-content: center;
}

.gift-panel {
  padding: 28px 18px 20px;
  text-align: center;
}

.gift-panel h3 {
  margin-bottom: 8px;
  font-size: 2rem;
  color: #db3f7f;
}

.gift-panel > p {
  margin-top: 0;
  color: #ff77a0;
  font-family: inherit;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.mini-gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fff4fa);
  box-shadow: 0 12px 24px rgba(225, 139, 176, 0.18);
  color: #d54f84;
  font-family: inherit;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mini-gift:hover,
.mini-gift.selected {
  transform: translateY(-4px);
  box-shadow: 0 18px 28px rgba(225, 139, 176, 0.28);
  background: linear-gradient(180deg, #fff7fb, #ffe4f0);
}

.mini-gift-emoji {
  font-size: 2rem;
}

.prize-result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: #7e5b63;
  min-height: 58px;
  font-family: inherit;
}

.confetti::before,
.confetti::after {
  content: "🎉";
  position: absolute;
  top: 110px;
  font-size: 1.6rem;
}

.confetti-left::before {
  left: 18px;
}

.confetti-left::after {
  right: 18px;
}

@media (max-width: 380px) {
  .gift-box {
    width: min(82vw, 286px);
  }

  .time-block {
    min-width: 50px;
  }

  .cta-button {
    min-width: 200px;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100vw, 420px);
    border-radius: 28px;
  }

  .hero-screen {
    padding: 140px 18px 48px;
  }

  .hero-content {
    width: 100%;
  }

  .hero-screen h2 {
    font-size: 36px;
    line-height: 1.08;
  }

  .hero-turning {
    font-size: clamp(1.4rem, 8vw, 2.4rem);
  }

  .countdown-label {
    font-size: 11px;
  }

  .hero-cta {
    padding: 12px 32px;
    font-size: 24px;
  }

  .memory-screen {
    padding-top: 42px;
    padding-bottom: 24px;
    gap: 18px;
  }

  .cake-stage {
    width: min(100%, 248px);
    height: 200px;
  }

  .birthday-cake {
    width: 220px;
    height: 148px;
    transform: none;
    transform-origin: center bottom;
  }

  .memory-screen h3 {
    font-size: 1.9rem;
  }
}

@keyframes flameFlicker {
  0%,
  100% {
    transform: translateX(-50%) rotate(4deg) scale(1);
  }

  50% {
    transform: translateX(-50%) rotate(-5deg) scale(0.92, 1.06);
  }
}

@keyframes smokeRise {
  0% {
    opacity: 0.1;
    transform: translateX(-50%) translateY(0) scale(0.6);
  }

  25% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-34px) scale(1.45);
  }
}

@keyframes introGiftReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes introCopyReveal {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
