:root {
  --white: #ffffff;
  --soft-pink: #ffd6e8;
  --blush-pink: #ffedf5;
  --baby-blue: #cdefff;
  --cool-blue: #e8f7ff;
  --lavender: #eee7ff;
  --text-main: #2f2f3a;
  --text-soft: #7b7280;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 214, 232, 0.72);
  --blue-border: rgba(205, 239, 255, 0.76);
  --danger: #c65c7a;
  --shadow: rgba(115, 91, 128, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 214, 232, 0.72), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(205, 239, 255, 0.78), transparent 30%),
    radial-gradient(circle at 74% 82%, rgba(238, 231, 255, 0.82), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fff7fb 36%, #edf9ff 68%, #f4efff 100%);
  background-color: #f4efff;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  font-family: "Inter", Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 214, 232, 0.72), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(205, 239, 255, 0.78), transparent 30%),
    radial-gradient(circle at 74% 82%, rgba(238, 231, 255, 0.82), transparent 34%),
    radial-gradient(circle at 20% 88%, rgba(232, 247, 255, 0.78), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #fff7fb 28%, #edf9ff 58%, #f4efff 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.world-open {
  overflow-y: auto;
}

body.gift-screen {
  overflow-y: auto;
}

button,
input {
  font: inherit;
}

.experience-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

body.world-open .experience-shell {
  display: block;
  overflow: visible;
}

body.gift-screen .experience-shell {
  overflow: visible;
}

.experience-shell::before,
.experience-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.experience-shell::before {
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1.3px, transparent 2.4px),
    radial-gradient(circle, rgba(255, 214, 232, 0.5) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(205, 239, 255, 0.46) 0 8px, transparent 9px),
    radial-gradient(circle, rgba(238, 231, 255, 0.46) 0 4px, transparent 5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.8px);
  background-position: 8% 18%, 18% 76%, 86% 28%, 74% 88%, 36% 42%;
  background-size: 130px 150px, 250px 280px, 320px 340px, 190px 220px, 88px 108px;
  opacity: 0.56;
  animation: bubblesDrift 28s ease-in-out infinite alternate;
}

.experience-shell::after {
  z-index: 1;
  background:
    radial-gradient(circle at 12% 68%, rgba(255, 255, 255, 0.46) 0 6px, transparent 7px),
    radial-gradient(circle at 89% 62%, rgba(255, 214, 232, 0.3) 0 10px, transparent 12px),
    radial-gradient(circle at 72% 34%, rgba(205, 239, 255, 0.34) 0 8px, transparent 10px),
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 237, 245, 0.2));
  animation: softOrbit 32s ease-in-out infinite alternate;
}

.ambient-glow {
  position: fixed;
  inset: -22%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 34%, rgba(255, 214, 232, 0.72), transparent 29%),
    radial-gradient(circle at 70% 28%, rgba(205, 239, 255, 0.72), transparent 31%),
    radial-gradient(circle at 54% 74%, rgba(238, 231, 255, 0.72), transparent 34%);
  filter: blur(42px);
  animation: glowPulse 11s ease-in-out infinite;
}

.cinematic-grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.8px),
    radial-gradient(circle at 70% 50%, rgba(255, 214, 232, 0.34) 0 1px, transparent 1.8px);
  background-size: 32px 32px, 48px 48px;
}

.cinematic-scene {
  position: fixed;
  inset: 0;
  --scene-parallax-left: 0px;
  --scene-parallax-right: 0px;
  display: grid;
  grid-template-areas: "scene";
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(14px, 4vw, 32px);
  overflow: hidden;
  z-index: 5;
  transition: opacity 900ms ease, visibility 900ms ease;
}

.cinematic-scene.opened {
  opacity: 0;
  visibility: hidden;
  transition-delay: 1000ms;
}

body.gift-screen .cinematic-scene {
  position: relative;
  inset: auto;
  overflow: visible;
}

.cinematic-depth,
.luxury-haze,
.light-beam,
.particle-field {
  position: absolute;
  inset: 0;
  grid-area: scene;
  pointer-events: none;
}

.cinematic-depth {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.62), transparent 32%),
    radial-gradient(circle at 18% 28%, rgba(255, 214, 232, 0.42), transparent 26%),
    radial-gradient(circle at 84% 72%, rgba(205, 239, 255, 0.44), transparent 30%),
    radial-gradient(circle at 70% 18%, rgba(238, 231, 255, 0.42), transparent 28%);
  animation: ambientDrift 22s ease-in-out infinite alternate;
}

.luxury-haze {
  z-index: 2;
  opacity: 0.56;
  filter: blur(52px);
}

.haze-left {
  background:
    radial-gradient(ellipse at 18% 55%, rgba(255, 214, 232, 0.74), transparent 38%),
    radial-gradient(ellipse at 50% 46%, rgba(232, 247, 255, 0.42), transparent 30%);
  animation: hazeDrift 18s ease-in-out infinite alternate;
}

.haze-right {
  background:
    radial-gradient(ellipse at 84% 42%, rgba(205, 239, 255, 0.72), transparent 38%),
    radial-gradient(ellipse at 58% 58%, rgba(238, 231, 255, 0.52), transparent 34%);
  animation: hazeDrift 24s ease-in-out 2s infinite alternate-reverse;
}

.light-beam {
  z-index: 3;
  width: 18vw;
  min-width: 120px;
  max-width: 260px;
  height: 120vh;
  top: -22vh;
  left: 50%;
  transform-origin: top center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 214, 232, 0.18) 46%, transparent 82%);
  filter: blur(24px);
  opacity: 0.45;
}

.beam-one {
  transform: translateX(calc(-250% + var(--scene-parallax-left))) rotate(8deg);
  animation: beamFloat 18s ease-in-out infinite alternate;
}

.beam-two {
  transform: translateX(calc(-14% + var(--scene-parallax-right))) rotate(-6deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(205, 239, 255, 0.2) 48%, transparent 82%);
  animation: beamFloat 23s ease-in-out 1.6s infinite alternate-reverse;
}

.beam-three {
  transform: translateX(calc(210% + var(--scene-parallax-left))) rotate(-10deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(238, 231, 255, 0.18) 48%, transparent 82%);
  animation: beamFloat 26s ease-in-out 3s infinite alternate;
}

.particle-field {
  z-index: 4;
  opacity: 0.52;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(255, 214, 232, 0.64) 0 1.4px, transparent 2.4px),
    radial-gradient(circle, rgba(205, 239, 255, 0.64) 0 1.6px, transparent 2.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.8px);
  background-size: 116px 156px, 186px 236px, 292px 360px, 72px 98px;
  background-position: 8% 18%, 68% 52%, 42% 82%, 32% 24%;
  filter: drop-shadow(0 0 10px rgba(255, 214, 232, 0.34));
  animation: dustFloat 30s linear infinite;
}

.particles-far {
  opacity: 0.34;
  transform: scale(1.12);
  background-size: 178px 240px, 292px 350px, 410px 480px;
  animation-duration: 40s;
  animation-direction: reverse;
}

.flow-card {
  position: relative;
  grid-area: scene;
  width: 100%;
  max-width: 650px;
  min-width: 0;
  padding: clamp(22px, 3.4vw, 36px);
  overflow: visible;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 237, 245, 0.54) 42%, rgba(232, 247, 255, 0.58));
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow:
    0 22px 64px rgba(115, 91, 128, 0.13),
    0 0 42px rgba(255, 214, 232, 0.32),
    0 0 62px rgba(205, 239, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
  z-index: 8;
  transition: opacity 360ms ease, transform 360ms ease, visibility 360ms ease;
}

.flow-card::before,
.flow-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

.flow-card::before {
  inset: -1px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 214, 232, 0.48), transparent 22%),
    radial-gradient(circle at 90% 18%, rgba(205, 239, 255, 0.48), transparent 24%),
    radial-gradient(circle at 50% 105%, rgba(238, 231, 255, 0.45), transparent 28%);
  opacity: 0.62;
}

.flow-card::after {
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.flow-card > * {
  position: relative;
}

.eyebrow,
.screen-kicker {
  margin: 0 0 12px;
  color: #a46d85;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before,
.screen-kicker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: min(44vw, 280px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 214, 232, 0.9), rgba(205, 239, 255, 0.9), transparent);
}

h1,
h2 {
  margin: 0;
  color: var(--text-main);
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.subtitle,
.screen-text {
  max-width: 540px;
  margin: 18px auto 28px;
  color: var(--text-soft);
  font-size: clamp(0.96rem, 1.7vw, 1.08rem);
  line-height: 1.65;
}

.screen-content {
  display: grid;
  min-height: clamp(250px, 38vh, 350px);
  align-content: center;
  gap: clamp(12px, 1.8vw, 16px);
  opacity: 0;
  transform: translateY(12px) scale(0.992);
  transition: opacity 420ms ease, transform 420ms ease;
}

.screen-content.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.screen-content.is-feedback {
  min-height: clamp(240px, 36vh, 330px);
  place-content: center;
  transition-duration: 860ms;
}

.screen-content.is-feedback.is-visible {
  transition-duration: 860ms;
}

.screen-title {
  margin: 0 auto;
  max-width: 640px;
  color: var(--text-main);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.question-text {
  display: block;
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-main);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.45rem, 4vw, 2.35rem);
  line-height: 1.2;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.message-text,
.gift-message {
  margin: 0 auto;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  line-height: 1.72;
  white-space: pre-line;
}

.gift-message {
  max-width: 590px;
  height: auto;
  padding: 2px 8px;
  overflow: visible;
  text-align: left;
}

.options-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 13px 14px;
  margin: 6px auto 0;
  max-width: 540px;
}

.option-card {
  width: fit-content;
  min-width: clamp(180px, 34vw, 220px);
  max-width: 100%;
  min-height: 58px;
  padding: 0 20px;
  color: var(--text-main);
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 237, 245, 0.7) 48%, rgba(232, 247, 255, 0.66));
  box-shadow:
    0 8px 20px rgba(115, 91, 128, 0.07),
    0 0 22px rgba(255, 214, 232, 0.26),
    0 0 26px rgba(205, 239, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease, background 240ms ease, opacity 240ms ease;
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 182, 217, 0.96);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(232, 247, 255, 0.74) 52%, rgba(255, 237, 245, 0.78));
  box-shadow:
    0 16px 34px rgba(115, 91, 128, 0.12),
    0 0 28px rgba(255, 214, 232, 0.5),
    0 0 36px rgba(205, 239, 255, 0.38);
}

.option-card:disabled {
  cursor: default;
  opacity: 0.72;
}

.primary-button {
  position: relative;
  justify-self: center;
  min-height: 52px;
  padding: 0 30px;
  overflow: hidden;
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--soft-pink) 0%, var(--lavender) 50%, var(--baby-blue) 100%);
  box-shadow:
    0 14px 32px rgba(115, 91, 128, 0.16),
    0 0 34px rgba(255, 214, 232, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: -130% auto -130% -62%;
  width: 46%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transition: left 640ms ease;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 52%);
  pointer-events: none;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  filter: saturate(1.04) brightness(1.02);
  box-shadow:
    0 18px 38px rgba(115, 91, 128, 0.2),
    0 0 42px rgba(255, 214, 232, 0.72),
    0 0 54px rgba(205, 239, 255, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.primary-button:hover::before,
.primary-button:focus-visible::before {
  left: 122%;
}

.primary-button:disabled {
  cursor: default;
  filter: grayscale(0.08);
  opacity: 0.72;
}

.primary-button:focus-visible,
.option-card:focus-visible,
.letter-envelope:focus-visible,
.letter-action:focus-visible,
.last-gift-button:focus-visible,
.memory-continue-button:focus-visible,
.reply-toggle-button:focus-visible,
.gift-yes-button:focus-visible,
.gift-no-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(205, 239, 255, 0.7);
  outline-offset: 4px;
}

input {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  color: var(--text-main);
  text-align: center;
  border: 1px solid var(--blue-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 10px 24px rgba(115, 91, 128, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input:focus {
  border-color: rgba(255, 182, 217, 0.96);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 26px rgba(255, 214, 232, 0.44),
    0 0 34px rgba(205, 239, 255, 0.32);
}

input::placeholder {
  color: rgba(123, 114, 128, 0.52);
}

.feedback {
  max-width: 500px;
  margin: 0 auto;
  color: #9b607b;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 4.2vw, 2.55rem);
  font-weight: 700;
  line-height: 1.22;
  white-space: pre-line;
  text-wrap: balance;
  text-shadow:
    0 8px 28px rgba(115, 91, 128, 0.12),
    0 0 32px rgba(255, 255, 255, 0.84);
  animation: feedbackIn 860ms ease both;
}

.feedback:empty {
  animation: none;
}

.feedback.error {
  color: var(--danger);
}

.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  pointer-events: none;
}

.flow-card:not(.hidden) {
  animation: questionReveal 430ms ease both;
}

.birthday-world {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: block;
  padding: clamp(72px, 12vh, 116px) clamp(22px, 4vw, 44px);
  opacity: 0;
  visibility: hidden;
  z-index: 3;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 214, 232, 0.64), transparent 30%),
    radial-gradient(circle at 80% 18%, rgba(205, 239, 255, 0.72), transparent 30%),
    radial-gradient(circle at 22% 82%, rgba(238, 231, 255, 0.72), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fff7fb 45%, #edf9ff 100%);
  transition: opacity 900ms ease, visibility 900ms ease, transform 900ms ease;
  transform: scale(0.985);
  will-change: opacity, transform;
}

.birthday-world::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 2px, transparent 2.8px),
    radial-gradient(circle, rgba(255, 214, 232, 0.5) 0 8px, transparent 8.8px);
  background-size: 150px 180px, 280px 320px;
  opacity: 0.5;
  animation: dustFloat 20s linear infinite;
}

.birthday-world.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.memory-story {
  position: relative;
  width: 100%;
}

.memory-list {
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: stretch;
  gap: clamp(18px, 2.2vw, 28px);
  margin: 0 auto;
}

.memory-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: clamp(430px, 42vw, 560px);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 237, 245, 0.58) 52%, rgba(232, 247, 255, 0.62));
  box-shadow:
    0 22px 54px rgba(115, 91, 128, 0.18),
    0 8px 22px rgba(115, 91, 128, 0.08),
    0 0 34px rgba(255, 214, 232, 0.26),
    0 0 42px rgba(205, 239, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.memory-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.memory-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 10px 10px 0 0;
}

.memory-card-message {
  flex: 1;
  margin: 0;
  padding: clamp(20px, 2.3vw, 28px);
  color: var(--text-main);
  font-size: clamp(0.94rem, 1.2vw, 1.02rem);
  line-height: 1.72;
  white-space: pre-line;
}

.memory-continue-button {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  gap: 2px;
  margin: clamp(34px, 6vw, 58px) auto 0;
  color: var(--text-main);
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 237, 245, 0.76), rgba(232, 247, 255, 0.72));
  box-shadow:
    0 16px 36px rgba(115, 91, 128, 0.14),
    0 0 34px rgba(255, 214, 232, 0.44),
    0 0 42px rgba(205, 239, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  animation: continueFloat 2.8s ease-in-out infinite;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.memory-continue-button span:first-child {
  font-size: 1.5rem;
  line-height: 1;
}

.memory-continue-button span:last-child {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.memory-continue-button:hover,
.memory-continue-button:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 20px 44px rgba(115, 91, 128, 0.18),
    0 0 42px rgba(255, 214, 232, 0.62),
    0 0 54px rgba(205, 239, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.letters-sky-section {
  position: relative;
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  margin: clamp(72px, 10vw, 118px) calc(50% - 50vw) 0;
  padding: clamp(42px, 7vw, 74px) 0 clamp(44px, 7vw, 80px);
  overflow: hidden;
  isolation: isolate;
  background-image: url("../assets/images/letters-garden-bg.jpg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 1;
  transform: none;
  transition: opacity 700ms ease, transform 700ms ease;
}

.letters-sky-section.is-hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.letters-sky-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 237, 245, 0.38) 34%, rgba(232, 247, 255, 0.18) 58%, rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.44), transparent 38%);
}

.letters-sky-note {
  width: min(92%, 620px);
  margin: 0 auto clamp(18px, 4vw, 34px);
  padding: clamp(18px, 3vw, 26px);
  text-align: center;
  color: var(--text-soft);
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow:
    0 16px 44px rgba(115, 91, 128, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.letters-sky-note h2 {
  margin: 0 0 16px;
  font-size: clamp(3rem, 5vw, 5rem);
  text-shadow:
    0 10px 30px rgba(115, 91, 128, 0.1),
    0 0 34px rgba(255, 255, 255, 0.84);
}

.letters-sky-note p {
  margin: 0;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.75;
}

.letters-cloud {
  position: relative;
  z-index: 3;
  width: min(100%, 1180px);
  min-height: clamp(560px, 66vw, 760px);
  margin: 0 auto;
  overflow: visible;
  opacity: 0;
  transform: translateY(30px) scale(0.99);
  transition: opacity 900ms ease, transform 900ms ease;
}

.birthday-world.visible .letters-cloud {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 420ms;
}

.letter-envelope {
  position: absolute;
  display: block;
  visibility: hidden;
  left: var(--x);
  top: var(--y);
  width: clamp(46px, 6vw, 68px);
  aspect-ratio: 1.34 / 1;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), #e8f7ff 34%, #cdefff 72%, #b9e7ff);
  box-shadow:
    0 12px 30px rgba(173, 220, 255, 0.25),
    0 0 16px rgba(205, 239, 255, 0.32),
    0 0 10px rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translate(-50%, 260px) rotate(var(--r)) scale(0.78);
  z-index: 5;
  animation: none;
  transition: opacity 420ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.letters-sky-section.garden-active .letter-envelope {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--r)) scale(1);
  animation:
    envelopeFountain 1100ms cubic-bezier(0.18, 0.86, 0.24, 1) var(--delay) both,
    envelopeFloat var(--d) ease-in-out calc(var(--delay) + 1100ms) infinite alternate;
}

.letter-envelope::before,
.letter-envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.letter-envelope::before {
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(135deg, transparent 49%, rgba(255, 255, 255, 0.9) 50%, transparent 52%),
    linear-gradient(225deg, transparent 49%, rgba(85, 161, 202, 0.3) 50%, transparent 52%);
}

.letter-envelope::after {
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(185, 231, 255, 0.62));
}

.letter-envelope:hover,
.letter-envelope:focus-visible {
  transform: translate(-50%, calc(-50% - 8px)) rotate(var(--r)) scale(1.05);
  box-shadow:
    0 16px 34px rgba(173, 220, 255, 0.34),
    0 0 22px rgba(205, 239, 255, 0.42),
    0 0 14px rgba(255, 255, 255, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.letter-envelope.opening {
  animation: envelopeOpen 520ms ease both;
  pointer-events: none;
}

.letter-envelope.completed {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 18px)) rotate(var(--r)) scale(0.82);
  pointer-events: none;
}

.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: clamp(20px, 5vh, 54px) 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.letter-modal.visible {
  opacity: 1;
  visibility: visible;
}

.letter-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.7), transparent 34%),
    rgba(255, 247, 251, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.letter-card {
  position: relative;
  width: min(92vw, 720px);
  height: auto;
  max-height: none;
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.4vw, 20px);
  padding: clamp(24px, 4vw, 42px);
  overflow: visible;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  background-image: url("../assets/images/letter-card-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow:
    0 26px 70px rgba(115, 91, 128, 0.2),
    0 0 52px rgba(255, 214, 232, 0.36),
    0 0 70px rgba(205, 239, 255, 0.26);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 420ms ease, transform 420ms ease;
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 237, 245, 0.78) 54%, rgba(232, 247, 255, 0.78));
}

.letter-card > * {
  position: relative;
  z-index: 1;
}

.letter-modal.visible .letter-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.letter-kicker {
  margin: 0;
  color: #a46d85;
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", sans-serif;
  font-size: clamp(0.9rem, 1.8vw, 1.04rem);
  font-weight: 800;
  letter-spacing: 0;
}

.letter-message {
  width: min(100%, 620px);
  margin: 0 auto;
  color: var(--text-main);
  direction: rtl;
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", sans-serif;
  font-size: clamp(1.08rem, 2.1vw, 1.26rem);
  line-height: 2;
  text-align: center;
  white-space: pre-line;
}

.reply-toggle-button {
  min-height: 44px;
  padding: 0 20px;
  color: var(--text-main);
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", sans-serif;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(115, 91, 128, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 260ms ease;
}

.reply-toggle-button:hover,
.reply-toggle-button:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(115, 91, 128, 0.12),
    0 0 28px rgba(205, 239, 255, 0.3);
}

.reply-area {
  width: min(100%, 560px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 320ms ease, transform 320ms ease;
}

.reply-area.visible {
  opacity: 1;
  transform: translateY(0);
}

.letter-card textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 16px 18px;
  color: var(--text-main);
  direction: rtl;
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", sans-serif;
  line-height: 1.8;
  text-align: right;
  border: 1px solid rgba(205, 239, 255, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.letter-card textarea::placeholder {
  color: rgba(123, 114, 128, 0.56);
}

.letter-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  direction: rtl;
}

.letter-action,
.last-gift-button {
  min-height: 46px;
  padding: 0 24px;
  color: var(--text-main);
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", sans-serif;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
}

.letter-action.secondary {
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.64);
}

.letter-action.primary,
.last-gift-button {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(135deg, var(--soft-pink) 0%, var(--lavender) 50%, var(--baby-blue) 100%);
  box-shadow:
    0 14px 32px rgba(115, 91, 128, 0.16),
    0 0 34px rgba(255, 214, 232, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.last-gift-button {
  display: block;
  margin: clamp(32px, 5vw, 54px) auto 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.last-gift-button.visible {
  opacity: 1;
  transform: translateY(0);
}

.last-gift-button[hidden] {
  display: none;
}

.final-gift-section {
  position: relative;
  z-index: 60;
  width: 100vw;
  min-height: 100dvh;
  height: auto;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 40px);
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  margin: 0 calc(50% - 50vw);
  isolation: isolate;
  background-image: url("../assets/images/final-gift-background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 520ms ease, visibility 520ms ease;
}

.final-gift-section.is-hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.final-gift-section.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.final-gift-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 214, 232, 0.72), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(205, 239, 255, 0.68), transparent 30%),
    radial-gradient(circle at 52% 82%, rgba(238, 231, 255, 0.7), transparent 34%),
    rgba(255, 250, 253, 0.68);
}

.final-gift-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1.4px, transparent 2.4px),
    radial-gradient(circle, rgba(255, 214, 232, 0.6) 0 1.6px, transparent 2.8px),
    radial-gradient(circle, rgba(205, 239, 255, 0.62) 0 1.8px, transparent 3px);
  background-size: 92px 130px, 154px 210px, 230px 280px;
  opacity: 0.62;
  animation: dustFloat 24s linear infinite;
}

.final-gift-card {
  position: relative;
  width: min(100%, 680px);
  padding: clamp(26px, 5vw, 46px);
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 237, 245, 0.72) 48%, rgba(232, 247, 255, 0.78));
  box-shadow:
    0 28px 82px rgba(115, 91, 128, 0.2),
    0 0 52px rgba(255, 214, 232, 0.38),
    0 0 64px rgba(205, 239, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 640ms ease, transform 640ms ease;
}

.final-gift-section.visible .final-gift-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gift-kicker {
  margin: 0 0 12px;
  color: #a46d85;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.final-gift-card h2 {
  margin: 0 auto 18px;
  max-width: 560px;
  font-size: clamp(1.9rem, 4.8vw, 3.25rem);
}

.final-gift-card p {
  max-width: 560px;
  margin: 0 auto 14px;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  line-height: 1.7;
}

.gift-question {
  color: var(--text-main) !important;
  font-weight: 800;
}

.gift-note {
  max-width: 540px;
  margin: 22px auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.gift-note strong {
  display: inline-block;
  margin: 4px 0 10px;
  color: var(--text-main);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  letter-spacing: 0.08em;
}

.no-attempt-message {
  min-height: 28px;
  color: #a46d85 !important;
  font-weight: 800;
}

.gift-actions {
  position: relative;
  min-height: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.gift-yes-button,
.gift-no-button {
  min-height: 52px;
  padding: 0 24px;
  color: var(--text-main);
  font-weight: 850;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, left 220ms ease, top 220ms ease;
}

.gift-yes-button {
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: linear-gradient(135deg, var(--soft-pink), var(--lavender), var(--baby-blue));
  box-shadow:
    0 16px 36px rgba(115, 91, 128, 0.16),
    0 0 34px rgba(255, 214, 232, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  transform: scale(var(--yes-scale, 1));
}

.gift-no-button {
  position: relative;
  left: var(--no-x, 0px);
  top: var(--no-y, 0px);
  border: 1px solid rgba(205, 239, 255, 0.82);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(115, 91, 128, 0.1);
}

.final-gift-success {
  animation: successIn 720ms ease both;
}

.final-gift-success::before {
  content: "";
  display: block;
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 24%, transparent 25%),
    conic-gradient(from 0deg, var(--soft-pink), var(--baby-blue), var(--lavender), var(--soft-pink));
  box-shadow:
    0 0 36px rgba(255, 214, 232, 0.58),
    0 0 44px rgba(205, 239, 255, 0.42);
  animation: glowPulse 2.4s ease-in-out infinite;
}

@keyframes ambientDrift {
  from {
    transform: translate3d(-1.2%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.2%, 1%, 0) scale(1.035);
  }
}

@keyframes bubblesDrift {
  from {
    transform: translate3d(-10px, 10px, 0) scale(1);
  }

  to {
    transform: translate3d(12px, -18px, 0) scale(1.02);
  }
}

@keyframes softOrbit {
  from {
    opacity: 0.72;
    transform: translate3d(-8px, 8px, 0);
  }

  to {
    opacity: 0.9;
    transform: translate3d(10px, -10px, 0);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.76;
    transform: scale(1);
  }

  50% {
    opacity: 0.96;
    transform: scale(1.035);
  }
}

@keyframes hazeDrift {
  from {
    transform: translate3d(-1.4%, 0, 0) scale(1);
  }

  to {
    transform: translate3d(1.4%, -1%, 0) scale(1.04);
  }
}

@keyframes beamFloat {
  from {
    opacity: 0.3;
    filter: blur(22px);
  }

  to {
    opacity: 0.54;
    filter: blur(30px);
  }
}

@keyframes dustFloat {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(28px, -44px, 0);
  }
}

@keyframes questionReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }

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

@keyframes feedbackIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

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

@keyframes continueFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes envelopeFloat {
  from {
    margin-top: -5px;
  }

  to {
    margin-top: 7px;
  }
}

@keyframes envelopeFountain {
  from {
    opacity: 0;
    transform: translate(-50%, 170px) rotate(calc(var(--r) * 0.45)) scale(0.9);
  }

  62% {
    opacity: 1;
    transform: translate(-50%, calc(-50% + 10px)) rotate(var(--r)) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r)) scale(1);
  }
}

@keyframes envelopeOpen {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r)) scale(1);
  }

  58% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 14px)) rotate(var(--r)) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 28px)) rotate(var(--r)) scale(0.86);
  }
}

@keyframes successIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }

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

@media (max-width: 760px) {
  .cinematic-scene {
    padding: 12px;
  }

  .flow-card {
    justify-self: center;
    width: min(100%, calc(100dvw - 24px), clamp(300px, 82vw, 560px));
    max-width: min(calc(100dvw - 24px), 560px);
    min-width: 0;
    padding: 24px 18px;
    border-radius: 26px;
  }

  .screen-content {
    gap: 12px;
  }

  .screen-title {
    font-size: clamp(1.9rem, 8.8vw, 2.25rem);
  }

  .question-text {
    font-size: clamp(1.32rem, 7vw, 2rem);
  }

  .subtitle,
  .screen-text {
    margin-bottom: 22px;
  }

  .primary-button {
    width: fit-content;
    max-width: 100%;
  }

  .light-beam {
    min-width: 220px;
    opacity: 0.24;
  }

  .beam-three {
    display: none;
  }

  .birthday-world {
    padding: 68px 0 96px;
  }

  .memory-list {
    width: 92%;
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .memory-card {
    min-height: auto;
    border-radius: 12px;
  }

  .memory-card img {
    border-radius: 10px 10px 0 0;
  }

  .letters-sky-section {
    margin-top: 72px;
  }

  .letters-sky-section {
    min-height: 112dvh;
  }

  .letters-cloud {
    width: 100%;
    min-height: 690px;
  }

  .letter-envelope {
    width: 42px;
  }

  .letter-modal {
    padding: 14px;
  }

  .letter-card {
    width: 92vw;
    padding: 22px 16px;
    overflow: visible;
  }

  .letter-actions {
    width: 100%;
  }

  .letter-action {
    flex: 1 1 120px;
  }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .memory-list {
    width: min(92%, 760px);
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 430px) {
  .flow-card {
    width: min(100%, calc(100dvw - 24px), 360px);
    max-width: calc(100dvw - 24px);
    padding: 22px 15px;
    border-radius: 24px;
  }

  .screen-title {
    font-size: clamp(1.75rem, 8vw, 2rem);
  }

  .eyebrow,
  .screen-kicker {
    margin-bottom: 8px;
    font-size: 0.66rem;
    letter-spacing: 0.15em;
  }

  .option-card {
    min-width: min(220px, 100%);
    min-height: 56px;
    padding: 0 16px;
    border-radius: 17px;
  }

  .primary-button,
  input {
    min-height: 50px;
  }
}

@media (max-height: 680px) {
  .flow-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .screen-content {
    gap: 10px;
  }

  .screen-title {
    font-size: clamp(1.95rem, 5.5vw, 3rem);
  }

  .question-text {
    font-size: clamp(1.25rem, 3.6vw, 2rem);
  }

  .option-card {
    min-height: 50px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

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