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

:root {
  --pink-1: #ffd6e7;
  --pink-2: #ff9fc1;
  --pink-3: #ff5f98;
  --pink-4: #ff2e75;
  --wine: #8f1147;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(143, 17, 71, 0.25);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(circle at top left, #ffe6f0 0%, transparent 35%),
    radial-gradient(circle at top right, #ffd7e8 0%, transparent 30%),
    linear-gradient(135deg, #fff5f9 0%, #ffd7e8 45%, #ffc1da 100%);
  position: relative;
}

.main-content {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.anniversary-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px 20px 28px;
  text-align: center;
  overflow: hidden;
}

.big-heart {
  position: relative;
  width: 150px;
  height: 135px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

.heart-shape {
  position: relative;
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--pink-3), var(--pink-4));
  transform: rotate(-45deg);
  animation: heartbeat 1.8s infinite;
  box-shadow: 0 12px 30px rgba(255, 46, 117, 0.35);
}

.heart-shape::before,
.heart-shape::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--pink-3), var(--pink-4));
  border-radius: 50%;
}

.heart-shape::before {
  top: -45px;
  left: 0;
}

.heart-shape::after {
  top: 0;
  left: 45px;
}

.content {
  position: relative;
  z-index: 4;
  animation: fadeUp 0.5s ease;
}

.hidden {
  display: none;
}

.small-text {
  font-size: 0.92rem;
  color: var(--wine);
  opacity: 0.9;
  margin-bottom: 8px;
}

h1 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.7rem, 8vw, 4.8rem);
  color: var(--wine);
  margin-bottom: 10px;
  line-height: 1.1;
}

.second-title {
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.subtitle {
  color: #7a2951;
  font-size: 0.98rem;
  margin-bottom: 20px;
}

.date-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.date-form input[type="date"] {
  width: 100%;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(143, 17, 71, 0.18);
  font-size: 1rem;
  outline: none;
  background: rgba(255, 255, 255, 0.85);
  color: #6d2145;
  box-shadow: inset 0 0 0 1px transparent;
  transition: all 0.25s ease;
}

.date-form input[type="date"]:focus {
  border-color: var(--pink-4);
  box-shadow: 0 0 0 4px rgba(255, 46, 117, 0.12);
}

.date-form button {
  border: none;
  background: linear-gradient(135deg, var(--pink-3), var(--pink-4));
  color: var(--white);
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 46, 117, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 220px;
}

.date-form button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(255, 46, 117, 0.34);
}

.date-form button:active {
  transform: scale(0.98);
}

.message {
  min-height: 56px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-box {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 500;
  max-width: 360px;
  animation: popIn 0.35s ease;
}

.message-box.error {
  background: rgba(255, 235, 241, 0.95);
  color: #9b1d4f;
  border: 1px solid rgba(255, 46, 117, 0.16);
  box-shadow: 0 10px 22px rgba(155, 29, 79, 0.12);
}

.message-box.success {
  background: rgba(236, 255, 243, 0.95);
  color: #16754a;
  border: 1px solid rgba(22, 117, 74, 0.14);
  box-shadow: 0 10px 22px rgba(22, 117, 74, 0.12);
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.counter-box {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  padding: 18px 10px;
  box-shadow: 0 10px 24px rgba(143, 17, 71, 0.08);
  backdrop-filter: blur(8px);
}

.counter-box span {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pink-4);
  line-height: 1;
  margin-bottom: 6px;
}

.counter-box p {
  font-size: 0.92rem;
  color: #7a2951;
  font-weight: 500;
}

.romantic-text {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  color: #7a2951;
  font-size: 0.95rem;
  line-height: 1.6;
}

.letter-section {
  margin-top: 26px;
}

.letter-intro {
  color: var(--wine);
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 1rem;
}

.envelope {
  position: relative;
  width: min(100%, 360px);
  height: 220px;
  margin: 0 auto;
  perspective: 1000px;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.envelope:hover {
  transform: translateY(-4px);
}

.envelope::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 150px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff7cab, #ff4f8c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 12px 24px rgba(255, 79, 140, 0.18);
  z-index: 2;
}

.envelope::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 125px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff94bb, #ff699d);
  border-radius: 0 0 22px 22px;
  z-index: 3;
}

.letter-paper {
  position: absolute;
  left: 50%;
  bottom: 45px;
  transform: translateX(-50%) translateY(55px);
  width: 88%;
  max-width: 320px;
  height: 150px;
  background: linear-gradient(180deg, #fffdfd 0%, #fff6fa 100%);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 14px 26px rgba(143, 17, 71, 0.12);
  z-index: 1;
  opacity: 0;
  transition: transform 0.7s ease, opacity 0.7s ease, height 0.7s ease;
  overflow: hidden;
}

.letter-paper-content {
  color: #7a2951;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.65;
}

.letter-paper-content p + p {
  margin-top: 10px;
}

.letter-greeting {
  font-family: "Great Vibes", cursive;
  font-size: 2rem;
  color: var(--wine);
  margin-bottom: 8px;
}

.letter-sign {
  font-weight: 600;
  color: var(--pink-4);
  text-align: right;
  margin-top: 16px;
}

.envelope.open .letter-paper {
  transform: translateX(-50%) translateY(-35px);
  opacity: 1;
  height: 360px;
  z-index: 5;
}

.tap-hint {
  margin-top: 14px;
  color: #8b4064;
  font-size: 0.9rem;
  opacity: 0.9;
}

.gallery-section {
  margin-top: 40px;
}

.gallery-title {
  font-family: "Great Vibes", cursive;
  font-size: 36px;
  color: #8f1147;
  margin-bottom: 6px;
}

.gallery-subtitle {
  color: #7a2951;
  margin-bottom: 20px;
  font-size: 14px;
}

.gallery-wrapper {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.gallery-wrapper::-webkit-scrollbar {
  height: 8px;
}

.gallery-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 95, 152, 0.45);
  border-radius: 999px;
}

.gallery {
  display: flex;
  gap: 16px;
  padding-bottom: 10px;
}

.photo-card {
  min-width: 220px;
  max-width: 220px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  scroll-snap-align: center;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.photo-card p {
  padding: 12px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #7a2951;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.reasons-section {
  margin-top: 42px;
}

.reasons-title {
  font-family: "Great Vibes", cursive;
  font-size: 36px;
  color: var(--wine);
  margin-bottom: 6px;
}

.reasons-subtitle {
  color: #7a2951;
  margin-bottom: 20px;
  font-size: 14px;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.reason-card {
  background: transparent;
  border: none;
  padding: 0;
  perspective: 1000px;
  width: 100%;
  height: 170px;
  cursor: pointer;
}

.reason-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s ease;
  transform-style: preserve-3d;
}

.reason-card.flipped .reason-card-inner {
  transform: rotateY(180deg);
}

.reason-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-shadow: 0 12px 24px rgba(143, 17, 71, 0.1);
}

.reason-front {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 235, 243, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.7);
  flex-direction: column;
  gap: 10px;
  color: var(--wine);
}

.reason-front span {
  font-size: 1.8rem;
}

.reason-front p {
  font-weight: 600;
  font-size: 0.95rem;
}

.reason-back {
  background: linear-gradient(135deg, var(--pink-3), var(--pink-4));
  color: var(--white);
  transform: rotateY(180deg);
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: center;
}

.video-section {
  margin-top: 44px;
}

.video-title {
  font-family: "Great Vibes", cursive;
  font-size: 38px;
  color: var(--wine);
  margin-bottom: 8px;
}

.video-subtitle {
  color: #7a2951;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(143, 17, 71, 0.14);
  background: rgba(255, 255, 255, 0.5);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.final-love-text {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  color: #7a2951;
  font-size: 0.98rem;
  line-height: 1.7;
  font-weight: 500;
}

.hearts-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.floating-heart {
  position: absolute;
  top: -40px;
  color: rgba(255, 70, 130, 0.55);
  font-size: 16px;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  user-select: none;
}

@keyframes fall {
  0% {
    transform: translateY(-30px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translateY(50vh) translateX(18px) rotate(90deg);
  }
  100% {
    transform: translateY(110vh) translateX(-18px) rotate(180deg);
    opacity: 0;
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: rotate(-45deg) scale(1);
  }
  14% {
    transform: rotate(-45deg) scale(1.06);
  }
  28% {
    transform: rotate(-45deg) scale(1);
  }
  42% {
    transform: rotate(-45deg) scale(1.08);
  }
  70% {
    transform: rotate(-45deg) scale(1);
  }
}

@keyframes popIn {
  from {
    transform: translateY(8px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .main-content {
    align-items: center;
    padding: 12px;
  }

  .anniversary-card {
    padding: 24px 16px 24px;
    border-radius: 24px;
    max-width: 100%;
  }

  .big-heart {
    width: 130px;
    height: 118px;
    margin-bottom: 12px;
  }

  .heart-shape,
  .heart-shape::before,
  .heart-shape::after {
    width: 78px;
    height: 78px;
  }

  .heart-shape::before {
    top: -39px;
  }

  .heart-shape::after {
    left: 39px;
  }

  .small-text {
    font-size: 0.88rem;
  }

  .subtitle {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .counter-grid {
    gap: 10px;
  }

  .counter-box {
    border-radius: 16px;
    padding: 15px 8px;
  }

  .counter-box span {
    font-size: 1.55rem;
  }

  .counter-box p {
    font-size: 0.85rem;
  }

  .romantic-text {
    font-size: 0.9rem;
    padding: 14px;
  }

  .letter-intro {
    font-size: 0.94rem;
  }

  .envelope {
    height: 205px;
  }

  .letter-paper {
    width: 92%;
    height: 145px;
    padding: 16px 14px;
  }

  .letter-paper-content {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .letter-greeting {
    font-size: 1.75rem;
  }

  .envelope.open .letter-paper {
    height: 380px;
    transform: translateX(-50%) translateY(-38px);
  }

  .tap-hint {
    font-size: 0.84rem;
  }

  .gallery-title,
  .reasons-title,
  .video-title {
    font-size: 32px;
  }

  .gallery-wrapper {
    padding-bottom: 6px;
  }

  .gallery {
    gap: 12px;
    padding-bottom: 6px;
  }

  .photo-card {
    min-width: 160px;
    max-width: 160px;
    border-radius: 16px;
  }

  .photo-card img {
    height: 160px;
  }

  .photo-card p {
    padding: 10px 8px;
    font-size: 11.5px;
    line-height: 1.35;
    min-height: 54px;
  }

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

  .reason-card {
    height: 155px;
  }

  .reason-back {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .video-subtitle,
  .final-love-text {
    font-size: 0.92rem;
  }
}