/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9e3e3;
  overflow-x: hidden;
  padding: 1rem;
  position: relative;
}

/* ============================================
   FAIRY ANIMATION (same as main)
   ============================================ */
.fairy-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.fairy {
  position: absolute;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  opacity: 0.85;
  z-index: 1;
  animation: fairyBob 2s ease-in-out infinite;
  white-space: nowrap;
}

.fairy.right-side {
  transform: scaleX(-1);
}

@keyframes fairyBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.fairy.right-side {
  animation: fairyBobRight 2s ease-in-out infinite;
}

@keyframes fairyBobRight {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50%      { transform: scaleX(-1) translateY(-10px); }
}

.flying-heart {
  position: absolute;
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.flying-heart.to-right {
  animation: shootRight 2.5s linear forwards;
}

.flying-heart.to-left {
  animation: shootLeft 2.5s linear forwards;
}

@keyframes shootRight {
  0%   { opacity: 0; transform: translateX(0) translateY(0) scale(0.5) rotate(0deg); }
  5%   { opacity: 1; transform: translateX(5vw) translateY(-5px) scale(1) rotate(10deg); }
  50%  { opacity: 1; transform: translateX(50vw) translateY(-20px) scale(1.1) rotate(0deg); }
  95%  { opacity: 0.9; transform: translateX(95vw) translateY(5px) scale(0.9) rotate(-10deg); }
  100% { opacity: 0; transform: translateX(100vw) translateY(10px) scale(0.7) rotate(-15deg); }
}

@keyframes shootLeft {
  0%   { opacity: 0; transform: translateX(0) translateY(0) scale(0.5) rotate(0deg); }
  5%   { opacity: 1; transform: translateX(-5vw) translateY(-5px) scale(1) rotate(-10deg); }
  50%  { opacity: 1; transform: translateX(-50vw) translateY(-20px) scale(1.1) rotate(0deg); }
  95%  { opacity: 0.9; transform: translateX(-95vw) translateY(5px) scale(0.9) rotate(10deg); }
  100% { opacity: 0; transform: translateX(-100vw) translateY(10px) scale(0.7) rotate(15deg); }
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  z-index: 1;
  padding: 1.5rem;
}

/* ============================================
   TITLE
   ============================================ */
.title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 700;
  color: #d32f2f;
  text-align: center;
  text-shadow: 0 2px 10px rgba(211, 47, 47, 0.2);
  line-height: 1.3;
}

/* ============================================
   ALBUM LAYOUT
   ============================================ */
.album {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  width: 100%;
}

/* ============================================
   HEART-SHAPED PHOTO FRAME
   ============================================ */
.heart-frame {
  width: clamp(280px, 75vw, 420px);
  height: clamp(280px, 75vw, 420px);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.heart-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: url(#heartClip);
  transition: opacity 0.3s ease;
}

/* ============================================
   NAVIGATION ARROWS
   ============================================ */
.arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: #d32f2f;
  width: clamp(36px, 8vw, 48px);
  height: clamp(36px, 8vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.arrow:hover {
  background: rgba(211, 47, 47, 0.1);
}

.arrow:active {
  transform: scale(0.9);
}

.arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

.arrow svg {
  width: 60%;
  height: 60%;
}

/* ============================================
   CAPTION
   ============================================ */
.caption {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: #d32f2f;
  text-align: center;
  line-height: 1.5;
  min-height: 2.5em;
  transition: opacity 0.3s ease;
}

/* ============================================
   CONTINUE BUTTON
   ============================================ */
.btn-continue {
  display: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #d32f2f;
  text-decoration: none;
  padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1.5rem, 4vw, 2.5rem);
  border: 2px solid #d32f2f;
  border-radius: 50px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-continue.visible {
  display: inline-block;
}

.btn-continue:hover {
  background: #d32f2f;
  color: #fff;
}

.btn-continue:active {
  transform: scale(0.96);
}

/* ============================================
   PHOTO TRANSITION
   ============================================ */
.heart-photo.fade-out {
  opacity: 0;
}

/* ============================================
   RESPONSIVE — PHONE (≤ 430px)
   ============================================ */
@media (max-width: 430px) {
  body {
    padding: 0.75rem;
  }

  .container {
    padding: 1rem;
    gap: 1rem;
  }

  .title {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }

  .heart-frame {
    width: clamp(260px, 80vw, 340px);
    height: clamp(260px, 80vw, 340px);
  }
}

/* ============================================
   RESPONSIVE — TABLET (431px – 1024px)
   ============================================ */
@media (min-width: 431px) and (max-width: 1024px) {
  .container {
    max-width: 550px;
    gap: 1.5rem;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP (≥ 1025px)
   ============================================ */
@media (min-width: 1025px) {
  .container {
    max-width: 600px;
    gap: 2rem;
  }
}

/* ============================================
   LANDSCAPE PHONES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    max-width: 90vw;
    gap: 0.75rem;
    padding: 0.5rem;
  }

  .title {
    font-size: 1.2rem;
  }

  .heart-frame {
    width: clamp(150px, 35vh, 220px);
    height: clamp(150px, 35vh, 220px);
  }
}

/* ============================================
   SAFE AREA (NOTCH / DYNAMIC ISLAND)
   ============================================ */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
