/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  background: #06020f;
}

body {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #0a0415;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
}

/* ── Desktop fixed-width (>650px): show as 430px centered column ── */
@media (min-width: 651px) {
  body {
    width: 430px;
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
  }
}

/* ── Canvas area ────────────────────────────────────────── */
#canvas-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-image: url('../img2.png');
  background-size: cover;
  background-position: center top;
}

#canvas {
  display: block;
}

/* tap hint pill */
#tap-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: clamp(12px, 3.6vw, 16px);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 10px 26px;
  border-radius: 50px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  will-change: transform, opacity;
  animation: hintPulse 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 1;    transform: translate(-50%, -50%) scale(1);    }
  50%       { opacity: 0.38; transform: translate(-50%, -50%) scale(0.91); }
}

/* ══════════════════════════════════════════════════════════
   GIFT SECTION — 3-D gift box
   ══════════════════════════════════════════════════════════ */
#gift-section {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 0 24px;
  background: linear-gradient(180deg, #130822 0%, #1a0d2e 100%);
  gap: 16px;
  position: relative;
  overflow: hidden;

  opacity: 0;
  transform: translateY(50px) scale(0.85);
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.34, 1.5, 0.64, 1);
}

/* subtle sparkle dots in background */
#gift-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,200,100,0.18) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,120,160,0.14) 1px, transparent 1px);
  background-size: 38px 38px, 60px 60px;
  background-position: 0 0, 19px 19px;
  pointer-events: none;
  animation: sparkleShift 8s linear infinite;
}

@keyframes sparkleShift {
  0%   { background-position: 0 0,    19px 19px; }
  100% { background-position: 38px 38px, 57px 57px; }
}

#gift-section.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Glow pulse on box after reveal */
#gift-section.revealed #gift-box:not(.opened) {
  animation: giftFloat 3.2s ease-in-out infinite,
             giftReadyPulse 2s ease-in-out 3;
}

@keyframes giftReadyPulse {
  0%, 100% { filter: drop-shadow(0 14px 28px rgba(220, 50, 80, 0.6)); }
  50%       { filter: drop-shadow(0 18px 50px rgba(255, 160, 0, 0.95))
                       drop-shadow(0 0 24px rgba(255, 220, 60, 0.7)); }
}

/* ── Outer box wrapper ──────────────────────────────────── */
#gift-box {
  position: relative;
  width: 200px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: giftFloat 3.2s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(220, 50, 80, 0.6));
  transition: filter 0.3s ease;
}
#gift-box.opened { animation: none; filter: none; }
#gift-box:active:not(.opened) {
  filter: brightness(0.85) drop-shadow(0 6px 14px rgba(220, 50, 80, 0.4));
}

@keyframes giftFloat {
  0%   { transform: translateY(0px)    rotate(0deg);    }
  20%  { transform: translateY(-7px)   rotate(-1.2deg); }
  45%  { transform: translateY(-13px)  rotate(-2.2deg); }
  65%  { transform: translateY(-8px)   rotate(1.4deg);  }
  85%  { transform: translateY(-3px)   rotate(0.6deg);  }
  100% { transform: translateY(0px)    rotate(0deg);    }
}

/* ── Lid group (bow + lid face) ─────────────────────────── */
.box-lid-group {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity   0.45s cubic-bezier(0.4, 0, 0.6, 1);
  transform-origin: center bottom;
}
.box-lid-group.lid-open {
  transform: translateY(-260px) translateX(20px) rotate(-28deg) scale(0.6);
  opacity: 0;
  pointer-events: none;
}

/* ── BOW ────────────────────────────────────────────────── */
.box-bow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -4px;
}

.bow-loops {
  position: relative;
  width: 120px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bow-loop {
  position: absolute;
  width: 52px;
  height: 38px;
  border-radius: 50%;
  box-shadow: inset 3px 3px 7px rgba(255,255,255,0.38),
              inset -2px -2px 5px rgba(0,0,0,0.22);
}
.bow-loop-l {
  right: calc(50% + 1px);
  background: linear-gradient(135deg, #ffe066, #f7a000);
  transform: rotate(32deg);
  transform-origin: right center;
}
.bow-loop-r {
  left: calc(50% + 1px);
  background: linear-gradient(225deg, #ffe066, #f7a000);
  transform: rotate(-32deg);
  transform-origin: left center;
}
.bow-knot {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0a0, #d48800);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  z-index: 3;
}

.bow-tails {
  display: flex;
  gap: 7px;
  margin-top: -6px;
  position: relative;
  z-index: 1;
}
.bow-tail {
  width: 16px;
  height: 28px;
  background: linear-gradient(180deg, #f7a000, #c97800);
  border-radius: 0 0 10px 10px;
}
.bow-tail-l { transform: rotate(-14deg); transform-origin: top center; }
.bow-tail-r { transform: rotate(14deg);  transform-origin: top center; }

/* ── LID face ───────────────────────────────────────────── */
.box-lid {
  position: relative;
  width: 214px;
  height: 58px;
  margin-left: -7px;
  background: linear-gradient(180deg, #ff7088 0%, #e62e50 100%);
  border-radius: 10px 10px 0 0;
  box-shadow:
    inset 0 6px 12px rgba(255,255,255,0.2),
    inset -8px 0 14px rgba(0,0,0,0.12),
    0 -2px 10px rgba(232,48,80,0.25);
}
.lid-ribbon {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 22px;
  background: linear-gradient(180deg, #ffe066 0%, #c97800 100%);
  box-shadow: inset 0 0 5px rgba(0,0,0,0.18);
}

/* ── BOX BODY ───────────────────────────────────────────── */
.box-body {
  position: relative;
  width: 200px;
  height: 144px;
  background: linear-gradient(175deg, #ff4060 0%, #c01e3a 100%);
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  box-shadow:
    inset -12px 0 20px rgba(0,0,0,0.18),
    inset 0 -8px 14px rgba(0,0,0,0.1),
    0 22px 55px rgba(192,30,58,0.65),
    0 8px 18px rgba(0,0,0,0.35);
}
.body-ribbon-v {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 22px;
  background: linear-gradient(180deg, #ffe066 0%, #c97800 100%);
}
.body-ribbon-h {
  position: absolute;
  left: 0; right: 0;
  top: 44px;
  height: 22px;
  background: linear-gradient(90deg, #c97800 0%, #ffe066 50%, #c97800 100%);
}
.body-shine {
  position: absolute;
  top: 0; left: 0;
  width: 52%;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.13) 0%,
    rgba(255,255,255,0)    100%);
  border-radius: 0 0 0 12px;
  pointer-events: none;
}
.body-glow {
  position: absolute;
  top: -18px;
  left: 50%; transform: translateX(-50%);
  width: 78%;
  height: 65px;
  background: radial-gradient(ellipse, rgba(255,225,110,0.95), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.box-body.lid-removed .body-glow { opacity: 1; }

/* ── Burst particles ────────────────────────────────────── */
#burst-particles {
  position: absolute;
  top: 56px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 20;
}

.burst-particle {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  line-height: 1;
  will-change: transform, opacity;
  animation: burstFly var(--dur) var(--delay) cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes burstFly {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  14% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 1;
  }
  55% {
    transform: translate(
      calc(-50% + var(--tx) * 0.55),
      calc(-50% + var(--ty) * 0.55)
    ) scale(1.1);
    opacity: 0.9;
  }
  100% {
    transform: translate(
      calc(-50% + var(--tx)),
      calc(-50% + var(--ty))
    ) scale(0.1);
    opacity: 0;
  }
}

/* ── Hint text ──────────────────────────────────────────── */
#gift-hint {
  font-size: clamp(12px, 3.2vw, 14px);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.07em;
  transition: opacity 0.5s ease;
  margin: 0;
  animation: hintPulse 2.4s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════
   GIFT MODAL
   ══════════════════════════════════════════════════════════ */
#gift-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 3, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#gift-overlay.visible { display: flex; }

#gift-modal {
  position: relative;
  background: linear-gradient(160deg, #fff9fc 0%, #ffe8f3 50%, #ffd2e8 100%);
  border-radius: 28px;
  padding: 42px 30px 30px;
  width: min(92vw, 400px);
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  color: #5a1a3a;
  box-shadow:
    0 30px 80px rgba(180, 50, 120, 0.42),
    0 0 0 1px rgba(255,255,255,0.6),
    inset 0 1px 0 rgba(255,255,255,0.9);
  scrollbar-width: none;

  opacity: 0;
  transform: scale(0.65) translateY(40px);
  will-change: transform, opacity;
  transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.45s cubic-bezier(0.34, 1.6, 0.64, 1);
}
#gift-modal::-webkit-scrollbar { display: none; }

#gift-modal.open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* sparkle corners on modal */
#gift-modal::before,
#gift-modal::after {
  content: '✨';
  position: absolute;
  font-size: 22px;
  opacity: 0.5;
  pointer-events: none;
  animation: floatDeco 3s ease-in-out infinite;
}
#gift-modal::before { top: 10px; left: 14px; animation-delay: 0s; }
#gift-modal::after  { top: 10px; right: 14px; animation-delay: 0.8s; }

/* close (✕) button */
#gift-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(160, 50, 110, 0.1);
  color: #a0406e;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s ease, transform 0.18s ease;
  z-index: 2;
}
#gift-close:hover { background: rgba(160, 50, 110, 0.22); transform: scale(1.1); }
#gift-close:active { transform: scale(0.95); }

/* floating deco emoji */
#gift-deco {
  font-size: 52px;
  margin-bottom: 10px;
  display: block;
  will-change: transform;
  animation: floatDeco 2.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes floatDeco {
  0%   { transform: translateY(0px)   rotate(0deg);  }
  30%  { transform: translateY(-6px)  rotate(-5deg); }
  55%  { transform: translateY(-10px) rotate(0deg);  }
  75%  { transform: translateY(-6px)  rotate(5deg);  }
  100% { transform: translateY(0px)   rotate(0deg);  }
}

#gift-modal-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(18px, 5vw, 22px);
  color: #8b1a5a;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

/* ── Note text ──────────────────────────────────────────── */
#gift-note {
  text-align: left;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.9;
  color: #5c1e3a;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 18px 20px;
  border-left: 3px solid #f47fb5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#gift-note p          { margin-bottom: 14px; }
#gift-note p:last-child { margin-bottom: 0; }

/* ── Footer & Collect button ────────────────────────────── */
#gift-footer {
  margin-top: 20px;
  text-align: center;
}

#collect-gift-btn {
  padding: 13px 30px;
  background: linear-gradient(135deg, #ff6b95, #c0357a);
  color: #fff;
  border: none;
  border-radius: 32px;
  font-size: clamp(13px, 3.8vw, 15px);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow:
    0 5px 18px rgba(192, 53, 122, 0.5),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              opacity 0.3s ease;
}
#collect-gift-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 9px 26px rgba(192, 53, 122, 0.62),
              inset 0 1px 0 rgba(255,255,255,0.3);
}
#collect-gift-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 10px rgba(192, 53, 122, 0.38);
}

/* ══════════════════════════════════════════════════════════
   CARDS SECTION — swipeable love messages
   ══════════════════════════════════════════════════════════ */
#cards-section {
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #1a0d2e 0%, #110929 100%);
  padding-bottom: env(safe-area-inset-bottom, 20px);

  opacity: 0;
  transform: translateY(44px) scale(0.96);
  will-change: transform, opacity;
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.75s cubic-bezier(0.34, 1.45, 0.64, 1);
}
#cards-section.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cards-label {
  text-align: center;
  font-size: clamp(10px, 2.8vw, 12px);
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 0 6px;
  flex-shrink: 0;
}

/* ── Scroll track ───────────────────────────────────────── */
.cards-container {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  padding: 0;
  height: 600px;  /* 240px × 2.5 */
}
.cards-container::-webkit-scrollbar { display: none; }

/* ── Card base ──────────────────────────────────────────── */
.card {
  flex: 0 0 100%;
  max-width: 100%;
  scroll-snap-align: start;
  border-radius: 0;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.card:active { transform: scale(0.97); }

/* glossy orb overlay */
.card::before {
  content: '';
  position: absolute;
  top: -45%;
  left: -15%;
  width: 70%;
  height: 70%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.card-icon {
  font-size: clamp(28px, 8vw, 40px);
  margin-bottom: 8px;
  filter: drop-shadow(0 3px 9px rgba(0, 0, 0, 0.3));
  line-height: 1;
}

.card h3 {
  font-size: clamp(13px, 3.8vw, 17px);
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  margin-bottom: 8px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
  line-height: 1.2;
}

.card p {
  font-size: clamp(10px, 2.9vw, 13px);
  line-height: 1.65;
  opacity: 0.93;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

/* ── Card gradient themes ───────────────────────────────── */
.c1  { background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%); }
.c2  { background: linear-gradient(135deg, #f953c6 0%, #b91d73 100%); }
.c3  { background: linear-gradient(135deg, #7f7fd5 0%, #86a8e7 50%, #91eae4 100%); }
.c4  { background: linear-gradient(135deg, #fc5c7d 0%, #6a3093 100%); }
.c5  { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.c6  { background: linear-gradient(135deg, #2980b9 0%, #6dd5fa 100%); }
.c7  { background: linear-gradient(135deg, #f7971e 0%, #ee5a24 100%); }
.c8  { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
.c9  { background: linear-gradient(135deg, #834d9b 0%, #d04ed6 100%); }
.c10 { background: linear-gradient(135deg, #1fa2ff 0%, #12d8fa 100%); }
.c11 { background: linear-gradient(135deg, #e96c75 0%, #e38d43 100%); }
.c12 { background: linear-gradient(135deg, #da4453 0%, #89216b 100%); }
.c13 { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }
.c14 { background: linear-gradient(135deg, #4776e6 0%, #8e54e9 100%); }
.c15 { background: linear-gradient(135deg, #f8a5c2 0%, #ff6b6b 100%); }

.c5 h3, .c5 p,
.c10 h3, .c10 p { text-shadow: 0 1px 5px rgba(0, 80, 60, 0.45); }

/* ── Dot indicators ─────────────────────────────────────── */
.dots-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 5px 0 10px;
  flex-shrink: 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.32s ease,
              border-radius 0.32s ease;
}
.dot.active {
  width: 22px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.82);
}

/* ══════════════════════════════════════════════════════════
   PHOTO SECTION — hidden until gift modal closed
   ══════════════════════════════════════════════════════════ */
#photo-section {
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #110929 0%, #0a0415 100%);
  padding-bottom: 6px;

  opacity: 0;
  transform: translateY(44px) scale(0.97);
  will-change: transform, opacity;
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1);
}
#photo-section.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Photo scroll track */
.photo-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 12px;
  padding: 6px min(9vw, 38px) 10px;
  height: 290px;
}
.photo-container::-webkit-scrollbar { display: none; }

.photo-card {
  flex: 0 0 min(82vw, 340px);
  max-width: 340px;
  scroll-snap-align: center;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 14px 42px rgba(0,0,0,0.6),
              0 0 0 2px rgba(255,255,255,0.07);
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
}
.photo-heart {
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.photo-unlock-hint {
  text-align: center;
  font-size: clamp(10px, 2.8vw, 12px);
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
  padding: 2px 16px 8px;
  margin: 0;
}

/* ── Full-screen sections (always, since layout is always mobile-width) ── */
#gift-section {
  min-height: 100vh;
  padding: 0;
}

#photo-section {
  min-height: 100vh;
  justify-content: center;
  padding: 24px 0 32px;
}

.photo-container {
  height: min(65vw, 280px);
}

/* ── Cards container: responsive height ─────────────────── */
.cards-container {
  height: min(600px, calc(100vh - 120px));
}

/* ── Swipe hint (fades out after first swipe) ────────────── */
.swipe-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 0 8px;
  font-size: clamp(10px, 2.6vw, 12px);
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  user-select: none;
}
.swipe-prompt.hidden { opacity: 0; }
.swipe-arrow {
  display: inline-block;
  animation: swipeArrow 1.6s ease-in-out infinite;
}
@keyframes swipeArrow {
  0%,100% { transform: translateX(0);   opacity: 0.45; }
  50%      { transform: translateX(7px); opacity: 1;    }
}

/* ── Dots: allow wrapping if too many ────────────────────── */
.dots-container {
  flex-wrap: wrap;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  row-gap: 4px;
}

/* ══════════════════════════════════════════════════════════
   FINAL GIFT SECTION — appears after all cards swiped
   ══════════════════════════════════════════════════════════ */
#final-gift-section {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  background: linear-gradient(180deg, #090d28 0%, #0d1540 100%);
  gap: 16px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(50px) scale(0.85);
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.34, 1.5, 0.64, 1);
}
#final-gift-section.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* sparkle backdrop */
#final-gift-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(100,160,255,0.18) 1px, transparent 1px),
    radial-gradient(circle, rgba(160,100,255,0.14) 1px, transparent 1px);
  background-size: 38px 38px, 60px 60px;
  background-position: 0 0, 19px 19px;
  pointer-events: none;
  animation: sparkleShift 8s linear infinite;
}

/* ── Final gift box ─────────────────────────────────────── */
#final-gift-box {
  position: relative;
  width: 200px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: giftFloat 3.2s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(60,90,230,0.65));
  transition: filter 0.3s ease;
}
#final-gift-box.opened { animation: none; filter: none; }
#final-gift-box:active:not(.opened) {
  filter: brightness(0.85) drop-shadow(0 6px 14px rgba(60,90,230,0.4));
}

/* Blue theme overrides for the final gift box */
#final-gift-section .box-lid {
  background: linear-gradient(180deg, #7090ff 0%, #3050e0 100%);
}
#final-gift-section .lid-ribbon,
#final-gift-section .body-ribbon-v {
  background: linear-gradient(180deg, #c0d0ff 0%, #6080c0 100%);
}
#final-gift-section .body-ribbon-h {
  background: linear-gradient(90deg, #5070b0 0%, #c0d0ff 50%, #5070b0 100%);
}
#final-gift-section .box-body {
  background: linear-gradient(175deg, #3858e8 0%, #1c38b8 100%);
  box-shadow:
    inset -12px 0 20px rgba(0,0,0,0.18),
    inset 0 -8px 14px rgba(0,0,0,0.1),
    0 22px 55px rgba(28,56,184,0.65),
    0 8px 18px rgba(0,0,0,0.35);
}
#final-gift-section .bow-loop-l {
  background: linear-gradient(135deg, #c0d0ff, #6080d0);
}
#final-gift-section .bow-loop-r {
  background: linear-gradient(225deg, #c0d0ff, #6080d0);
}
#final-gift-section .bow-knot {
  background: radial-gradient(circle at 35% 30%, #e0eaff, #4868c0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
#final-gift-section .bow-tail {
  background: linear-gradient(180deg, #6080d0, #3858a0);
}

/* Float + pulse on reveal */
#final-gift-section.revealed #final-gift-box:not(.opened) {
  animation: giftFloat 3.2s ease-in-out infinite,
             finalGiftPulse 2s ease-in-out 3;
}
@keyframes finalGiftPulse {
  0%,100% { filter: drop-shadow(0 14px 28px rgba(60,90,230,0.6)); }
  50%      { filter: drop-shadow(0 18px 52px rgba(120,160,255,0.95))
                      drop-shadow(0 0 24px rgba(180,210,255,0.7)); }
}

/* Final burst particles container */
#final-burst-particles {
  position: absolute;
  top: 56px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 20;
}

#final-gift-hint {
  font-size: clamp(12px, 3.2vw, 14px);
  color: rgba(255,255,255,0.52);
  letter-spacing: 0.07em;
  transition: opacity 0.5s ease;
  margin: 0;
  animation: hintPulse 2.4s ease-in-out infinite;
}

/* ── Final gift modal overlay ────────────────────────────── */
#final-gift-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,6,22,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#final-gift-overlay.visible { display: flex; }

#final-gift-modal {
  position: relative;
  background: linear-gradient(160deg, #f2f5ff 0%, #dce6ff 50%, #c8d6ff 100%);
  border-radius: 28px;
  padding: 42px 30px 30px;
  width: min(92vw, 400px);
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  color: #1a2858;
  box-shadow:
    0 30px 80px rgba(40,70,210,0.42),
    0 0 0 1px rgba(255,255,255,0.6),
    inset 0 1px 0 rgba(255,255,255,0.9);
  scrollbar-width: none;
  opacity: 0;
  transform: scale(0.65) translateY(40px);
  will-change: transform, opacity;
  transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.45s cubic-bezier(0.34, 1.6, 0.64, 1);
}
#final-gift-modal::-webkit-scrollbar { display: none; }
#final-gift-modal.open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* sparkle corners */
#final-gift-modal::before {
  content: '🌟';
  position: absolute;
  top: 10px; left: 14px;
  font-size: 22px;
  opacity: 0.5;
  pointer-events: none;
  animation: floatDeco 3s ease-in-out infinite;
}
#final-gift-modal::after {
  content: '💙';
  position: absolute;
  top: 10px; right: 14px;
  font-size: 22px;
  opacity: 0.5;
  pointer-events: none;
  animation: floatDeco 3s ease-in-out 0.8s infinite;
}

#final-gift-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(40,70,200,0.1);
  color: #2a50b0;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s ease, transform 0.18s ease;
  z-index: 2;
}
#final-gift-close:hover  { background: rgba(40,70,200,0.22); transform: scale(1.1); }
#final-gift-close:active { transform: scale(0.95); }

#final-gift-deco {
  font-size: 52px;
  margin-bottom: 10px;
  display: block;
  will-change: transform;
  animation: floatDeco 2.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

#final-gift-modal-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(18px, 5vw, 22px);
  color: #1a3080;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

#final-gift-note {
  text-align: left;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.9;
  color: #1e3068;
  background: rgba(255,255,255,0.55);
  border-radius: 16px;
  padding: 18px 20px;
  border-left: 3px solid #7fa0f5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
#final-gift-note p           { margin-bottom: 14px; }
#final-gift-note p:last-child { margin-bottom: 0; }
