@font-face {
  font-family: 'BirthdayMiao';
  src: url('assets/方正喵呜体-subset.woff2') format('woff2');
  font-display: swap;
}

/* Load the complete font only when free-form text needs a missing glyph. */
@font-face {
  font-family: 'BirthdayMiaoFull';
  src: url('assets/方正喵呜体.ttf') format('truetype');
  font-display: swap;
}

:root {
  --ink: #1e1116;
  --ink-soft: #39151e;
  --paper: #f6ece9;
  --paper-light: #fff8f4;
  --coral: #e54850;
  --red: #ff4757;
  --red-dark: #e63946;
  --red-bright: #ff6b7a;
  --ochre: #f0c56b;
  --sage: #b4c9b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'BirthdayMiao', 'BirthdayMiaoFull', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: #1a0a0f;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to bottom, #1a0610 0%, #2d0a14 30%, #4a0e1f 60%, #6b1329 100%);
}

/* Keep the fallback behind the animated canvas in the same red range. */
body.gta-page::before {
  background: linear-gradient(to bottom, #542028 0%, #6e2931 30%, #9b3f47 60%, #c65358 100%);
}

.global-wave-background {
  position: fixed;
  inset: -10%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.global-wave-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(229, 72, 80, 0.25), transparent 40%),
    radial-gradient(ellipse at 70% 60%, rgba(185, 48, 62, 0.2), transparent 50%);
  animation: ambient-glow 30s ease-in-out infinite alternate;
}

@keyframes ambient-glow {
  0% { opacity: 0.4; }
  100% { opacity: 0.7; }
}

.global-wave-background .wave-layer {
  position: absolute;
  left: -10%;
  width: 120%;
  background: linear-gradient(to bottom, transparent, rgba(185, 48, 62, 0.3) 30%, rgba(229, 72, 80, 0.25) 60%, transparent);
  border-radius: 50%;
  filter: blur(2px);
  transform-origin: center bottom;
}

.global-wave-background .wave-layer:nth-child(1) {
  bottom: 75%;
  height: 200px;
  background: linear-gradient(to bottom, transparent, rgba(239, 128, 110, 0.12) 40%, rgba(229, 72, 80, 0.2) 70%, transparent);
  animation: ocean-wave 12s ease-in-out infinite;
  animation-delay: 0s;
  opacity: 0.9;
}

.global-wave-background .wave-layer:nth-child(2) {
  bottom: 60%;
  height: 220px;
  background: linear-gradient(to bottom, transparent, rgba(217, 96, 98, 0.15) 35%, rgba(229, 72, 80, 0.28) 65%, transparent);
  animation: ocean-wave 14s ease-in-out infinite;
  animation-delay: -2s;
  opacity: 0.85;
}

.global-wave-background .wave-layer:nth-child(3) {
  bottom: 45%;
  height: 240px;
  background: linear-gradient(to bottom, transparent, rgba(185, 48, 62, 0.2) 30%, rgba(229, 72, 80, 0.35) 60%, rgba(217, 96, 98, 0.18) 85%, transparent);
  animation: ocean-wave 16s ease-in-out infinite;
  animation-delay: -5s;
  opacity: 0.8;
}

.global-wave-background .wave-layer:nth-child(4) {
  bottom: 28%;
  height: 260px;
  background: linear-gradient(to bottom, transparent, rgba(229, 72, 80, 0.25) 25%, rgba(185, 48, 62, 0.4) 55%, rgba(217, 96, 98, 0.22) 80%, transparent);
  animation: ocean-wave 18s ease-in-out infinite;
  animation-delay: -8s;
  opacity: 0.75;
}

.global-wave-background .wave-layer:nth-child(5) {
  bottom: 10%;
  height: 280px;
  background: linear-gradient(to bottom, transparent, rgba(217, 96, 98, 0.3) 20%, rgba(185, 48, 62, 0.45) 50%, rgba(143, 26, 53, 0.35) 75%, transparent);
  animation: ocean-wave 20s ease-in-out infinite;
  animation-delay: -12s;
  opacity: 0.7;
}

@keyframes ocean-wave {
  0% {
    transform: translateX(-10%) scaleY(1) rotateZ(0deg);
    border-radius: 45% 55% 50% 50%;
  }
  25% {
    transform: translateX(-5%) scaleY(1.08) rotateZ(-1deg);
    border-radius: 50% 50% 48% 52%;
  }
  50% {
    transform: translateX(5%) scaleY(1.15) rotateZ(0deg);
    border-radius: 48% 52% 50% 50%;
  }
  75% {
    transform: translateX(8%) scaleY(1.08) rotateZ(1deg);
    border-radius: 52% 48% 52% 48%;
  }
  100% {
    transform: translateX(-10%) scaleY(1) rotateZ(0deg);
    border-radius: 45% 55% 50% 50%;
  }
}

body {
  overscroll-behavior: none;
  touch-action: pan-y;
}

/* 滚动指示器 */
.scroll-indicator {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.3s;
  pointer-events: none;
}

.scroll-text-mobile {
  display: none;
}

.scroll-text-desktop {
  display: block;
}

.scroll-icon-mobile {
  display: none;
}

.scroll-icon-desktop {
  display: block;
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-icon-desktop {
  animation: bounce 2s infinite;
}

.scroll-icon-mobile {
  animation: slide 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@keyframes slide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

body.scrolled .scroll-indicator {
  opacity: 0;
}

/* 页面包装器 */
.page-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* 每个页面section */
.page-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.page-section.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateX(0) translateY(0);
  z-index: 10;
}

.page-section.before {
  opacity: 0.3;
  z-index: 5;
}

.page-section.after {
  opacity: 0;
  z-index: 1;
}

/* 桌面端：竖向动画 */
@media (min-width: 769px) {
  .page-section.before {
    transform: scale(0.95) translateY(-5%);
  }

  .page-section.after {
    transform: scale(1.05) translateY(5%);
  }
}

/* 移动端：横向动画 */
@media (max-width: 768px) {
  .page-section.before {
    transform: scale(0.95) translateX(-100%);
  }

  .page-section.after {
    transform: scale(0.95) translateX(100%);
  }
}

/* 背景层 */
.page-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  display: none;
}

.page-background img {
  display: none;
}

.page-section.active .page-background img {
  display: none;
}

.page-section.before .page-background img {
  display: none;
}

.page-section.after .page-background img {
  display: none;
}

.page-background.gradient-bg {
  background: transparent;
  display: none;
}

.page-background.gradient-bg-2 {
  background: transparent;
  display: none;
}

.page-background.gradient-bg-3 {
  background: transparent;
  display: none;
}

/* 背景遮罩 */
.page-background::after {
  display: none;
}

.page-background.gradient-bg::after,
.page-background.gradient-bg-2::after,
.page-background.gradient-bg-3::after {
  display: none;
}

/* 内容层 */
.page-content {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: white;
}

/* Hero 样式 */
.hero-content {
  max-width: 900px;
  text-align: left;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.page-section.active .hero-content {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
  opacity: 0.9;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 20px var(--red);
}

.hero-title {
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.hero-title span {
  display: block;
}

.hero-title-accent {
  color: var(--red-bright);
  font-style: italic;
  text-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
}

.hero-intro {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.6;
  opacity: 0.95;
  max-width: 600px;
}

/* 内容盒子 */
.content-box {
  max-width: 1000px;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.page-section.active .content-box {
  opacity: 1;
  transform: translateY(0);
}

.content-box.centered {
  text-align: center;
}

.section-number {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--red-bright);
  border: 2px solid var(--red-bright);
  padding: 8px 16px;
  border-radius: 24px;
  margin-bottom: 24px;
  letter-spacing: 2px;
  box-shadow: 0 0 20px rgba(255, 107, 122, 0.3);
}

.content-box h2 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.content-box h2 em {
  color: var(--red-bright);
  font-style: italic;
  text-shadow: 0 0 30px rgba(255, 71, 87, 0.4);
}

.content-box > p {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 40px;
}

/* 回忆网格 */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.memory-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 32px;
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}

.memory-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(255, 71, 87, 0.3);
}

.memory-date {
  font-size: 14px;
  color: var(--red-bright);
  margin-bottom: 12px;
  font-weight: 600;
}

.memory-card h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.memory-card p {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.9;
}

/* 信件部分 */
.letter-section {
  max-width: 800px;
}

.letter-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 60px;
}

.envelope-container {
  position: relative;
  min-height: 760px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.open-letter-btn {
  position: absolute;
  z-index: 20;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid var(--red-bright);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.4);
}

.open-letter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 71, 87, 0.6);
}

.open-letter-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.button-seal {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-seal svg {
  width: 100%;
  height: 100%;
  fill: var(--red-bright);
  animation: sparkle 2s infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

/* 信封 */
.envelope {
  position: relative;
  width: min(560px, calc(100vw - 80px));
  height: 600px;
  perspective: 1000px;
}

.envelope-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #fafafa 0%, #e8e8e8 100%);
  transform-origin: top center;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 15;
}

.envelope-flap::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.envelope.open .envelope-flap {
  transform: rotateX(-180deg);
  z-index: 5;
}

.letter-paper {
  position: absolute;
  top: 30px;
  left: 30px;
  width: calc(100% - 60px);
  height: calc(100% - 60px);
  background: #fffef7;
  border-radius: 4px;
  padding: 44px 46px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s, opacity 0.3s;
  z-index: 1;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  /* 隐藏滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.letter-paper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.envelope.open .letter-paper {
  transform: translateY(-150px);
  z-index: 20;
  opacity: 1;
  pointer-events: auto;
}

.letter-content-inner {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
}

.letter-content-inner p {
  margin-bottom: 18px;
}

.letter-content-inner strong {
  font-weight: 700;
}

.letter-content-inner p:first-child {
  font-weight: 600;
  color: var(--red-dark);
}

.letter-sign {
  text-align: right;
  font-style: italic;
  margin-top: 30px;
}

.letter-sign em {
  font-weight: 700;
  color: var(--red);
}

/* 愿望列表 */
.wish-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 40px;
}

.wish-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}

.wish-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(8px);
  box-shadow: 0 5px 20px rgba(255, 71, 87, 0.3);
}

.wish-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--red-bright);
  min-width: 60px;
  text-shadow: 0 0 20px rgba(255, 107, 122, 0.5);
}

.wish-item p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

/* 问卷部分 */
.survey-section {
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 20px;
  /* 美化滚动条 */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 122, 0.5) transparent;
}

.survey-section::-webkit-scrollbar {
  width: 8px;
}

.survey-section::-webkit-scrollbar-track {
  background: transparent;
}

.survey-section::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 122, 0.5);
  border-radius: 4px;
}

.survey-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 122, 0.8);
}

.gift-form {
  margin-top: 40px;
}

.question-block {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
}

.question-block legend {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding: 0 12px;
}

.question-block legend span {
  color: var(--red-bright);
  font-weight: 700;
  margin-right: 8px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.choice {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.choice:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--red-bright);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
}

.choice input[type="radio"] {
  display: none;
}

.choice input[type="radio"]:checked + span {
  color: var(--red-bright);
}

.choice input[type="radio"]:checked ~ span::before {
  background: var(--red);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.choice span {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  position: relative;
  padding-left: 32px;
}

.choice span::before {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: all 0.3s;
}

.choice span b {
  color: var(--red-bright);
  margin-right: 4px;
}

.details-block {
  margin-top: 32px;
  margin-bottom: 32px;
}

.details-block label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.details-block label span {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 8px;
}

.details-block textarea {
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s;
}

.details-block textarea:focus {
  outline: none;
  border-color: var(--red-bright);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
}

.details-block textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.form-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.form-progress #progress-count {
  color: var(--red-bright);
  font-weight: 700;
  font-size: 24px;
}

.progress-track {
  width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-bright) 100%);
  transition: width 0.3s;
  box-shadow: 0 0 10px var(--red);
}

.solid-button {
  background: var(--red);
  border: none;
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
  box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

.solid-button:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 71, 87, 0.6);
}

.solid-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-status {
  margin-top: 16px;
  font-size: 16px;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.form-status.error {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

/* 结束图片 */
.closing-image {
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.closing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.closing-signature {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.closing-signature svg {
  width: 24px;
  height: 24px;
  fill: var(--red);
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(1.1); }
  20%, 40% { transform: scale(1); }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 响应式 */
@media (max-width: 768px) {
  /* 移动端页面导航点 - 底部横向居中 */
  body .page-dots {
    position: fixed !important;
    right: auto !important;
    left: 50% !important;
    top: auto !important;
    bottom: 20px !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    gap: 12px !important;
  }

  .page-content {
    padding: 60px 20px 80px;
    overflow-y: auto;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(32px, 10vw, 48px);
    margin-bottom: 20px;
  }

  .hero-intro {
    font-size: clamp(16px, 4vw, 18px);
  }

  .content-box {
    max-width: 100%;
    padding: 0 10px;
  }

  .content-box h2 {
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 16px;
  }

  .content-box > p {
    font-size: clamp(14px, 4vw, 16px);
    margin-bottom: 24px;
  }

  .section-number {
    font-size: 12px;
    padding: 6px 12px;
    margin-bottom: 16px;
  }

  .memory-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }

  .memory-card {
    padding: 24px;
  }

  .memory-card h3 {
    font-size: 20px;
  }

  .memory-card p {
    font-size: 14px;
  }

  /* 信件部分移动端 */
  .letter-section {
    max-width: 100%;
  }

  .letter-subtitle {
    font-size: 16px;
    margin-bottom: 40px;
  }

  .envelope-container {
    min-height: 650px;
    padding: 20px 0;
  }

  .envelope {
    width: calc(100vw - 40px);
    max-width: 100%;
    height: clamp(460px, 68svh, 580px);
    max-height: none;
  }

  .envelope-flap {
    height: 50%;
    max-height: none;
  }

  .envelope-flap::after {
    width: 45px;
    height: 45px;
  }

  .letter-paper {
    padding: 34px 26px;
    font-size: 15px;
    line-height: 1.8;
    top: 25px;
    left: 25px;
    width: calc(100% - 50px);
    height: calc(100% - 50px);
  }

  .envelope.open .letter-paper {
    transform: translateY(-120px);
  }

  .letter-content-inner {
    font-size: 15px;
    line-height: 1.9;
  }

  .open-letter-btn {
    padding: 16px 32px;
    font-size: 17px;
  }

  /* 愿望列表移动端 */
  .wish-list {
    gap: 16px;
    margin-top: 24px;
  }

  .wish-item {
    flex-direction: row;
    align-items: center;
    padding: 20px;
    gap: 16px;
  }

  .wish-number {
    font-size: 28px;
    min-width: 50px;
  }

  .wish-item p {
    font-size: 15px;
  }

  /* 问卷部分移动端 */
  .survey-section {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    padding-right: 10px;
  }

  .gift-form {
    margin-top: 24px;
  }

  .question-block {
    padding: 20px;
    margin-bottom: 20px;
  }

  .question-block legend {
    font-size: 16px;
    margin-bottom: 16px;
    padding: 0 8px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .choice {
    padding: 14px 16px;
  }

  .choice span {
    font-size: 14px;
    padding-left: 28px;
  }

  .choice span::before {
    width: 18px;
    height: 18px;
  }

  .details-block {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .details-block label {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .details-block textarea {
    padding: 14px;
    font-size: 14px;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .form-progress {
    justify-content: center;
    font-size: 14px;
  }

  .form-progress #progress-count {
    font-size: 20px;
  }

  .progress-track {
    width: 120px;
  }

  .solid-button {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
  }

  /* 结束图片移动端 */
  .closing-image {
    width: 160px;
    height: 160px;
    margin-bottom: 24px;
  }

  .closing-signature {
    font-size: 18px;
    margin-top: 32px;
  }

  /* 滚动指示器移动端 */
  .scroll-indicator {
    bottom: 60px;
    font-size: 11px;
  }

  .scroll-text-desktop {
    display: none;
  }

  .scroll-text-mobile {
    display: block;
  }

  .scroll-icon-desktop {
    display: none;
  }

  .scroll-icon-mobile {
    display: block;
  }

  .scroll-indicator svg {
    width: 16px;
    height: 16px;
  }

  /* 移动端页面导航点 - 底部横向居中 */
  body .page-dots {
    position: fixed !important;
    right: auto !important;
    left: 50% !important;
    top: auto !important;
    bottom: 20px !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    gap: 10px !important;
  }

  body .page-dot {
    width: 8px !important;
    height: 8px !important;
    border-width: 1.5px !important;
  }

body .page-dot[style*="width: 16px"] {
    width: 10px !important;
    height: 10px !important;
  }
}

/* -------------------------------------------------------------------------
   Aurora console background
   The content is intentionally kept above one shared, low-cost visual field.
   This keeps the mobile experience calm while still giving the page depth.
   ------------------------------------------------------------------------- */
:root {
  --ink: #f7f9ff;
  --ink-soft: #d5dced;
  --paper: #f7f8fc;
  --paper-light: #ffffff;
  --coral: #ff718e;
  --red: #ff5f7e;
  --red-dark: #e8486b;
  --red-bright: #ff9ab0;
  --ochre: #ffd38a;
  --sage: #f2b09d;
  --tech-bg: #050914;
  --tech-panel: rgba(9, 17, 34, 0.74);
  --tech-line: rgba(145, 190, 255, 0.16);
  --tech-red: #ff8d86;
  --tech-violet: #d86a72;
}

html,
body {
  background: var(--tech-bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

body::before {
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 82% 8%, rgba(196, 60, 76, 0.24), transparent 42%),
    radial-gradient(ellipse at 10% 82%, rgba(235, 102, 88, 0.16), transparent 40%),
    linear-gradient(145deg, #040711 0%, #081225 48%, #050914 100%);
}

body.gta-page::before {
  background:
    radial-gradient(ellipse at 82% 8%, rgba(211, 61, 79, 0.3), transparent 42%),
    radial-gradient(ellipse at 10% 82%, rgba(235, 102, 88, 0.2), transparent 40%),
    linear-gradient(145deg, #03060f 0%, #081225 48%, #040711 100%);
}

.global-wave-background {
  inset: 0;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(11, 22, 43, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 22, 43, 0.14) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.global-wave-background::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 116, 108, 0.09) 44%, transparent 52%),
    linear-gradient(295deg, transparent 0 52%, rgba(210, 78, 92, 0.11) 60%, transparent 68%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.018) 6px 7px);
  transform: rotate(-4deg);
  animation: tech-scan 18s linear infinite;
}

.global-wave-background::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 28%, rgba(3, 7, 17, 0.1) 74%, rgba(2, 5, 12, 0.56) 100%),
    linear-gradient(to bottom, rgba(4, 8, 18, 0.06), transparent 22%, transparent 76%, rgba(3, 6, 16, 0.24));
}

.global-wave-background .wave-layer {
  display: none;
}

.tech-field-canvas {
  will-change: transform, filter;
}

/* Keep desktop mouse dragging responsive without forcing a mobile repaint. */
@media (min-width: 769px) {
  body.is-gesture-dragging,
  body.is-gesture-dragging * {
    cursor: grabbing !important;
    user-select: none !important;
  }

  body.is-gesture-dragging .tech-field-canvas {
    filter: saturate(1.14) brightness(1.05);
  }
}

@keyframes tech-scan {
  from { transform: translate3d(-2%, -2%, 0) rotate(-4deg); }
  to { transform: translate3d(2%, 2%, 0) rotate(-4deg); }
}

.effect-canvas {
  display: none !important;
}

.page-background {
  display: block;
  background: transparent;
}

.page-background.gradient-bg,
.page-background.gradient-bg-2,
.page-background.gradient-bg-3 {
  display: block;
  background: transparent;
}

.page-section {
  background: transparent;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.page-section::before {
  content: '';
  position: absolute;
  inset: -16%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.21;
  background:
    radial-gradient(ellipse at 76% 22%, var(--page-accent), transparent 42%),
    radial-gradient(ellipse at 14% 78%, var(--page-secondary), transparent 44%);
  filter: blur(18px);
  transform: translate3d(0, 0, 0);
  animation: page-bloom 16s ease-in-out infinite alternate;
}

.page-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 7, 17, 0.68) 0%, rgba(3, 7, 17, 0.28) 46%, rgba(3, 7, 17, 0.52) 100%),
    linear-gradient(180deg, rgba(3, 7, 17, 0.12), transparent 26%, transparent 72%, rgba(3, 7, 17, 0.44));
}

/* Only the visible page needs the slow bloom animation. */
.page-section::before {
  animation: none;
}

.page-section.active::before {
  animation: page-bloom 16s ease-in-out infinite alternate;
}

.page-section:nth-child(1) { --page-accent: rgba(255, 112, 105, 0.28); --page-secondary: rgba(183, 49, 66, 0.18); }
.page-section:nth-child(2) { --page-accent: rgba(224, 82, 86, 0.26); --page-secondary: rgba(255, 137, 107, 0.16); }
.page-section:nth-child(3) { --page-accent: rgba(188, 65, 83, 0.28); --page-secondary: rgba(255, 118, 105, 0.16); }
.page-section:nth-child(4) { --page-accent: rgba(255, 166, 108, 0.22); --page-secondary: rgba(209, 64, 77, 0.18); }
.page-section:nth-child(5) { --page-accent: rgba(236, 80, 88, 0.28); --page-secondary: rgba(184, 62, 84, 0.18); }
.page-section:nth-child(6) { --page-accent: rgba(255, 110, 112, 0.28); --page-secondary: rgba(245, 164, 110, 0.18); }

@keyframes page-bloom {
  from { transform: scale(0.98) translate3d(-1%, 1%, 0); }
  to { transform: scale(1.04) translate3d(1%, -1%, 0); }
}

.page-content {
  z-index: 10;
  overflow-y: auto;
  padding-top: max(60px, env(safe-area-inset-top));
  padding-bottom: max(60px, env(safe-area-inset-bottom));
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.36);
}

@supports (align-items: safe center) {
  .page-content {
    align-items: safe center;
  }
}

.hero-title,
.content-box h2 {
  letter-spacing: 0;
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.32);
}

.hero-title-accent,
.content-box h2 em {
  color: var(--tech-red);
  text-shadow: 0 0 24px rgba(255, 125, 116, 0.3);
}

.eyebrow-dot {
  background: var(--tech-red);
  box-shadow: 0 0 18px rgba(255, 125, 116, 0.78);
}

.section-number {
  border-color: rgba(255, 141, 134, 0.8);
  color: var(--tech-red);
  border-radius: 7px;
  box-shadow: 0 0 18px rgba(255, 125, 116, 0.18);
}

.memory-card,
.wish-item,
.question-block,
.choice,
.details-block textarea {
  background: var(--tech-panel);
  border-color: var(--tech-line);
  border-radius: 8px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 14px 32px rgba(1, 4, 12, 0.18);
}

.memory-card:hover,
.wish-item:hover,
.choice:hover {
  border-color: rgba(255, 141, 134, 0.58);
  box-shadow: 0 12px 34px rgba(33, 186, 210, 0.16);
}

.open-letter-btn,
.solid-button {
  border-radius: 8px;
}

.open-letter-btn {
  border-color: var(--tech-red);
  box-shadow: 0 0 26px rgba(255, 125, 116, 0.22);
}

.button-seal svg,
.solid-button svg {
  color: var(--tech-red);
}

.solid-button {
  background: linear-gradient(135deg, #ff5f7e, #e8486b);
  box-shadow: 0 8px 26px rgba(255, 95, 126, 0.26);
}

.solid-button:hover {
  background: linear-gradient(135deg, #ff718e, #ed5574);
  box-shadow: 0 10px 32px rgba(255, 95, 126, 0.36);
}

.progress-track i {
  background: linear-gradient(90deg, #ff8d86, #d86a72);
  box-shadow: 0 0 12px rgba(255, 116, 108, 0.52);
}

.page-dots .page-dot {
  border-color: rgba(255, 141, 134, 0.75) !important;
  box-shadow: 0 0 12px rgba(255, 125, 116, 0.22);
}

/* The letter is the one intentionally light surface in the dark interface. */
.letter-content-inner {
  color: #1e1116;
  text-shadow: none;
}

.letter-content-inner p:first-child,
.letter-sign em {
  color: #b73455;
  text-shadow: none;
}

.open-letter-btn:focus-visible,
.solid-button:focus-visible,
.page-dots .page-dot:focus-visible {
  outline: 2px solid var(--tech-red);
  outline-offset: 4px;
}

.choice {
  position: relative;
}

.choice input[type="radio"] {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.choice:focus-within {
  outline: 2px solid var(--tech-red);
  outline-offset: 3px;
  border-color: var(--tech-red);
}

@media (max-width: 768px) {
  .global-wave-background {
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  }

  .global-wave-background::before {
    opacity: 0.72;
  }

  .page-section::before {
    opacity: 0.14;
    filter: blur(12px);
  }

  .page-section::after {
    background:
      linear-gradient(90deg, rgba(3, 7, 17, 0.64), rgba(3, 7, 17, 0.36) 58%, rgba(3, 7, 17, 0.56)),
      linear-gradient(180deg, rgba(3, 7, 17, 0.1), transparent 22%, transparent 76%, rgba(3, 7, 17, 0.52));
  }

  .page-content {
    min-height: 100svh;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .survey-section {
    max-height: calc(100vh - 140px);
    max-height: calc(100svh - 140px);
  }

  .scroll-indicator {
    bottom: max(60px, calc(44px + env(safe-area-inset-bottom)));
  }
}

@media (max-height: 760px) {
  .page-content {
    align-items: flex-start;
  }
}

/* Single gift question and payment-style submission feedback. */
.gift-form .choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gift-form .choice {
  min-height: 72px;
  align-items: flex-start;
}

.gift-form .choice span {
  line-height: 1.45;
}

.gift-form {
  position: relative;
}

.details-block[hidden],
.submission-state[hidden],
.submission-note[hidden] {
  display: none !important;
}

.details-block {
  animation: details-reveal 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.details-block input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.details-block input:focus {
  outline: none;
  border-color: var(--tech-red);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
}

.details-block input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-footer {
  max-height: 180px;
  overflow: hidden;
  transition: opacity 0.45s ease, max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1), margin 0.55s ease;
}

.gift-form.is-submitting .solid-button {
  cursor: wait;
  opacity: 0.72;
}

.gift-form.is-complete .form-footer {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.submission-state {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 20;
  min-height: 0;
  margin: 0;
  padding: 26px 20px 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 9, 20, 0.72);
  -webkit-backdrop-filter: blur(13px) saturate(0.8);
  backdrop-filter: blur(13px) saturate(0.8);
  box-shadow: 0 18px 60px rgba(1, 4, 12, 0.28), inset 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  animation: submission-state-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.submission-mark {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.submission-mark::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(255, 125, 116, 0.08);
  box-shadow: 0 0 38px rgba(255, 125, 116, 0.18);
  transform: scale(0.78);
  opacity: 0;
}

.submission-spinner {
  position: absolute;
  width: 62px;
  height: 62px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--tech-red);
  border-right-color: rgba(255, 141, 134, 0.7);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.7);
}

.submission-state.is-loading .submission-spinner {
  opacity: 1;
  transform: scale(1);
  animation: submission-spin 0.82s linear infinite;
}

.submission-check {
  width: 82px;
  height: 82px;
  overflow: visible;
  opacity: 0;
  transform: scale(0.56) rotate(-10deg);
}

.submission-check circle,
.submission-check path {
  fill: none;
  stroke: var(--tech-red);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submission-check circle {
  stroke-width: 2.5;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
}

.submission-check path {
  stroke-width: 4;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
}

.submission-state.is-success .submission-spinner {
  opacity: 0;
  transform: scale(0.5);
  animation: none;
  transition: opacity 0.24s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.submission-state.is-success .submission-mark::before {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease 0.2s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.submission-state.is-success .submission-check {
  opacity: 1;
  transform: scale(1) rotate(0);
  transition: opacity 0.25s ease 0.08s, transform 0.65s cubic-bezier(0.22, 1.35, 0.36, 1);
}

.submission-state.is-success .submission-check circle {
  animation: submission-circle-draw 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.submission-state.is-success .submission-check path {
  animation: submission-check-draw 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.52s forwards;
}

.submission-state.is-error .submission-mark::before {
  opacity: 1;
  background: rgba(244, 67, 54, 0.08);
  box-shadow: 0 0 38px rgba(244, 67, 54, 0.15);
  transform: scale(1);
}

.submission-state.is-error .submission-spinner {
  opacity: 1;
  border-color: rgba(244, 67, 54, 0.75);
  animation: submission-error-pop 0.5s ease both;
}

.submission-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

.submission-note {
  max-width: 420px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

@keyframes details-reveal {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes submission-state-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes submission-spin {
  to { transform: scale(1) rotate(360deg); }
}

@keyframes submission-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes submission-check-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes submission-error-pop {
  0% { transform: scale(0.55); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .submission-state,
  .details-block,
  .submission-spinner,
  .submission-check,
  .submission-check circle,
  .submission-check path {
    animation: none !important;
    transition: none !important;
  }

  .submission-state.is-loading .submission-spinner {
    opacity: 1;
  }

  .submission-state.is-success .submission-check,
  .submission-state.is-success .submission-check circle,
  .submission-state.is-success .submission-check path {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: none;
  }
}

@media (max-width: 768px) {
  .gift-form .choice-grid {
    grid-template-columns: 1fr;
  }

  .gift-form .choice {
    min-height: 0;
  }

  .submission-state {
    padding-left: 8px;
    padding-right: 8px;
  }

  .submission-note {
    font-size: 13px;
  }
}

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

/* Keep the unopened-letter control readable above the white envelope. */
.envelope-container {
  isolation: isolate;
}

.envelope {
  z-index: 10;
}

.open-letter-btn {
  top: 50%;
  left: 50%;
  z-index: 40;
  transform: translate(-50%, -50%);
  background: rgba(8, 13, 26, 0.86);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 30px rgba(1, 4, 12, 0.36), 0 0 26px rgba(255, 125, 116, 0.22);
}

.open-letter-btn:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(16, 22, 40, 0.94);
}

/* Birthday accents around the portrait on the closing page. */
.closing-visual {
  position: relative;
  isolation: isolate;
  width: min(100%, 440px);
  min-height: 250px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.closing-image {
  position: relative;
  z-index: 2;
  margin: 0;
  border-color: rgba(255, 244, 232, 0.94);
  box-shadow: 0 12px 42px rgba(1, 4, 12, 0.42), 0 0 0 8px rgba(255, 126, 116, 0.08), 0 0 34px rgba(255, 107, 122, 0.22);
}

.birthday-side {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 104px;
  height: 220px;
  pointer-events: none;
  transform: translateY(-50%);
}

.birthday-side-left {
  left: 0;
  animation: birthday-float-left 4.8s ease-in-out infinite;
}

.birthday-side-right {
  right: 0;
  animation: birthday-float-right 5.2s ease-in-out 0.3s infinite;
}

.birthday-balloon {
  --balloon-color: #ff718e;
  position: absolute;
  display: block;
  width: 42px;
  height: 56px;
  border: 1px solid rgba(255, 244, 232, 0.5);
  border-radius: 54% 54% 48% 48%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.64) 0 7%, transparent 8%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    var(--balloon-color);
  box-shadow: inset -6px -8px 14px rgba(142, 22, 56, 0.18), 0 8px 22px rgba(255, 95, 126, 0.22);
}

.birthday-balloon::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  background: var(--balloon-color);
  transform: translateX(-50%) rotate(45deg);
}

.birthday-balloon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 78px;
  background: linear-gradient(to bottom, rgba(255, 244, 232, 0.7), rgba(255, 244, 232, 0.08));
  transform: rotate(3deg);
  transform-origin: top center;
}

.birthday-balloon-coral {
  --balloon-color: #ff718e;
  left: 11px;
  top: 38px;
  transform: rotate(-8deg);
}

.birthday-balloon-gold {
  --balloon-color: #f2bd70;
  width: 36px;
  height: 48px;
  left: 54px;
  top: 8px;
  transform: rotate(10deg);
  box-shadow: inset -6px -8px 14px rgba(139, 73, 20, 0.16), 0 8px 22px rgba(242, 189, 112, 0.2);
}

.birthday-gift {
  position: absolute;
  right: 12px;
  bottom: 30px;
  display: block;
  width: 56px;
  height: 46px;
  border: 2px solid rgba(255, 232, 216, 0.76);
  border-radius: 5px;
  background: linear-gradient(145deg, #e8486b, #9f315c);
  box-shadow: 0 10px 24px rgba(232, 72, 107, 0.28), inset 0 1px rgba(255, 255, 255, 0.26);
  transform: rotate(5deg);
}

.birthday-gift::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -10px;
  width: 60px;
  height: 12px;
  border: 2px solid rgba(255, 232, 216, 0.76);
  border-radius: 5px;
  background: linear-gradient(145deg, #ff718e, #d7486d);
}

.birthday-gift::after {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 50%;
  width: 9px;
  background: rgba(255, 211, 138, 0.86);
  transform: translateX(-50%);
}

.birthday-gift i,
.birthday-gift i::before,
.birthday-gift i::after {
  position: absolute;
  display: block;
  content: '';
}

.birthday-gift i {
  left: 50%;
  top: -21px;
  z-index: 2;
  width: 8px;
  height: 16px;
  border-radius: 50%;
  background: #ffd38a;
  transform: translateX(-50%);
}

.birthday-gift i::before,
.birthday-gift i::after {
  top: 2px;
  width: 18px;
  height: 11px;
  border: 3px solid #ffd38a;
  border-radius: 80% 20% 70% 30%;
}

.birthday-gift i::before {
  right: 2px;
  transform: rotate(26deg);
}

.birthday-gift i::after {
  left: 2px;
  transform: scaleX(-1) rotate(26deg);
}

.birthday-sparkle {
  position: absolute;
  display: block;
  color: #ffd38a;
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 211, 138, 0.74);
  animation: birthday-twinkle 2.2s ease-in-out infinite;
}

.birthday-sparkle-top {
  top: 35px;
  right: 6px;
}

.birthday-sparkle-bottom {
  right: 72px;
  bottom: 26px;
  color: #ff9ab0;
  font-size: 17px;
  animation-delay: -0.9s;
}

@keyframes birthday-float-left {
  0%, 100% { transform: translateY(-50%) rotate(-1deg); }
  50% { transform: translateY(calc(-50% - 7px)) rotate(2deg); }
}

@keyframes birthday-float-right {
  0%, 100% { transform: translateY(-50%) rotate(1deg); }
  50% { transform: translateY(calc(-50% + 6px)) rotate(-2deg); }
}

@keyframes birthday-twinkle {
  0%, 100% { opacity: 0.48; transform: scale(0.82) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(12deg); }
}

@media (max-width: 768px) {
  .closing-visual {
    width: min(100%, 330px);
    min-height: 210px;
    margin-bottom: 8px;
  }

  .birthday-side {
    width: 70px;
    height: 190px;
  }

  .birthday-side-left { left: 0; }
  .birthday-side-right { right: 0; }

  .birthday-balloon {
    width: 34px;
    height: 46px;
  }

  .birthday-balloon-coral { left: 5px; top: 34px; }
  .birthday-balloon-gold { left: 37px; top: 8px; width: 30px; height: 41px; }

  .birthday-gift {
    right: 3px;
    bottom: 22px;
    width: 47px;
    height: 39px;
  }

  .birthday-gift::before { width: 51px; }
  .birthday-gift i { transform: translateX(-50%) scale(0.86); transform-origin: bottom center; }
  .birthday-sparkle-top { top: 31px; right: -1px; }
  .birthday-sparkle-bottom { right: 52px; bottom: 18px; }
}

@media (max-width: 370px) {
  .closing-visual {
    width: calc(100% + 20px);
    min-height: 196px;
    margin-left: -10px;
    margin-right: -10px;
  }

  .birthday-side {
    width: 58px;
  }

  .birthday-balloon-coral { left: 0; }
  .birthday-balloon-gold { left: 28px; }
  .birthday-gift { right: -1px; transform: rotate(5deg) scale(0.9); }
  .birthday-sparkle-bottom { right: 42px; }
}
