:root {
  --ink: #2b1640;
}

html, body {
  font-family: 'Fraunces', 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 10% -10%, #ffd1e8 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, #d9c6ff 0%, transparent 60%),
    radial-gradient(900px 900px at 50% 120%, #fff0c2 0%, transparent 60%),
    linear-gradient(180deg, #fff5fb 0%, #f6f0ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Wild animated aurora blob behind everything */
body::before {
  content: "";
  position: fixed; inset: -20%;
  background:
    radial-gradient(500px 400px at 20% 30%, rgba(255,94,168,0.35), transparent 60%),
    radial-gradient(600px 500px at 80% 60%, rgba(168,85,247,0.35), transparent 60%),
    radial-gradient(500px 400px at 50% 90%, rgba(250,204,21,0.25), transparent 60%);
  filter: blur(40px);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}
@keyframes drift {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); }
  50%  { transform: translate(3%, -2%) rotate(6deg) scale(1.05); }
  100% { transform: translate(-2%, 3%) rotate(-4deg) scale(1.08); }
}

.display {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.rainbow-text {
  background: linear-gradient(90deg, #ff5ea8, #fbbf24, #a855f7, #22d3ee, #ff5ea8);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 5s linear infinite;
}
@keyframes rainbowShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.wiggle { display: inline-block; animation: wiggle 2.5s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50%      { transform: rotate(6deg) scale(1.08); }
}

.bouncy { display: inline-block; animation: bouncy 1.8s ease-in-out infinite; }
@keyframes bouncy {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-10px) rotate(6deg); }
}

/* Marquee across the top */
.marquee {
  overflow: hidden; position: relative;
  padding: 0.55rem 0;
  background: linear-gradient(90deg, #ff5ea8, #a855f7, #fbbf24, #ff5ea8);
  background-size: 200% 100%;
  animation: rainbowShift 6s linear infinite;
  color: white; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  font-size: 0.9rem;
  border-bottom: 3px dashed rgba(255,255,255,0.5);
}
.marquee-track {
  display: inline-flex; gap: 2.5rem;
  white-space: nowrap;
  animation: slide 22s linear infinite;
  padding-left: 100%;
}
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* Sparkle background accent */
.sparkle-bg::before {
  content: "✦  ✧  ✦  ✧  ✦  ✧";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  opacity: 0.25;
  font-size: 2rem;
  pointer-events: none;
}

/* Cards */
.card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 1.75rem;
  overflow: hidden;
  transform: rotate(var(--tilt, 0deg));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 20px 40px -20px rgba(110, 40, 120, 0.45);
  transition: transform 250ms cubic-bezier(.2,.9,.3,1.4), box-shadow 200ms ease;
  border: 3px solid rgba(255,255,255,0.6);
}
.card:hover {
  transform: rotate(calc(var(--tilt, 0deg) * -0.3)) translateY(-6px) scale(1.03);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 30px 60px -20px rgba(255, 80, 160, 0.55);
}

/* SPECTACULAR — gift #5 grand finale treatment */
.card.spectacular {
  border: 4px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow:
    0 0 0 2px #fbbf24 inset,
    0 30px 60px -15px rgba(236, 72, 153, 0.6),
    0 0 40px rgba(251, 191, 36, 0.3);
  animation: spectacularPulse 2.4s ease-in-out infinite;
}
.card.spectacular::before {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 1.9rem;
  padding: 4px;
  background: linear-gradient(135deg, #fbbf24, #ff5ea8, #a855f7, #fbbf24);
  background-size: 300% 300%;
  animation: rainbowShift 3s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
.card.spectacular .gift-face .title { font-size: 1.2rem; }
.card.spectacular .gift-face .emoji { font-size: 4.5rem; }
.card.spectacular .sparkle-ring {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.9) 2px, transparent 3px),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,0.9) 2px, transparent 3px),
    radial-gradient(circle at 15% 80%, rgba(255,255,255,0.9) 2px, transparent 3px),
    radial-gradient(circle at 85% 85%, rgba(255,255,255,0.9) 2px, transparent 3px),
    radial-gradient(circle at 50% 10%, rgba(255,255,255,0.7) 1.5px, transparent 2.5px);
  pointer-events: none;
  animation: sparkleTwinkle 2s ease-in-out infinite alternate;
}
@keyframes sparkleTwinkle {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}
@keyframes spectacularPulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px #fbbf24 inset,
      0 30px 60px -15px rgba(236, 72, 153, 0.6),
      0 0 40px rgba(251, 191, 36, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 2px #fbbf24 inset,
      0 35px 70px -15px rgba(236, 72, 153, 0.8),
      0 0 70px rgba(251, 191, 36, 0.6);
  }
}
.card.spectacular .grand-finale-ribbon {
  position: absolute; top: 0.4rem; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #fbbf24, #ff5ea8);
  color: white; font-weight: 900;
  font-size: 0.65rem; letter-spacing: 0.2em;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 4;
  white-space: nowrap;
}

/* Hero collage on the landing page */
.collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  max-width: 52rem;
  margin: 2rem auto 0;
}
.collage-item {
  aspect-ratio: 3/4;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #fde1ef, #e9d5ff);
  box-shadow: 0 15px 30px -12px rgba(168, 85, 247, 0.35);
  border: 4px solid white;
  transition: transform 300ms cubic-bezier(.2,.9,.3,1.4);
}
.collage-item:nth-child(1) { transform: rotate(-5deg); }
.collage-item:nth-child(2) { transform: rotate(3deg) translateY(-10px); }
.collage-item:nth-child(3) { transform: rotate(-2deg) translateY(8px); }
.collage-item:nth-child(4) { transform: rotate(4deg); }
.collage-item:nth-child(5) { transform: rotate(-3deg) translateY(-6px); }
.collage-item:hover { transform: rotate(0) scale(1.06) translateY(-10px); z-index: 5; }
.collage-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 640px) {
  .collage { grid-template-columns: repeat(3, 1fr); max-width: 24rem; }
  .collage-item:nth-child(n+4) { display: none; }
}

.card.pulse { animation: pulseGlow 1.8s ease-in-out infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 0 0 0 rgba(255, 94, 168, 0.6), 0 20px 40px -20px rgba(110, 40, 120, 0.45); }
  50%      { box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 0 0 14px rgba(255, 94, 168, 0.0), 0 25px 50px -20px rgba(255, 94, 168, 0.6); }
}

.card .gift-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.25rem; text-align: center;
  gap: 0.5rem;
}
.card .gift-face .num {
  position: absolute; top: 0.9rem; left: 1rem;
  font-weight: 900; font-size: 0.85rem;
  background: white;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.card .gift-face .emoji {
  font-size: 3.8rem;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.08));
  animation: wobble 3s ease-in-out infinite;
}
@keyframes wobble {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(8deg) scale(1.05); }
}
.card .gift-face .title { font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.card .gift-face .tag { font-size: 0.8rem; opacity: 0.8; font-style: italic; }

.card canvas.scratch {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: grab;
}
.card canvas.scratch:active { cursor: grabbing; }

.card.unlocked canvas.scratch { display: none; }
.card.unlocked {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 30px 50px -20px rgba(255, 80, 160, 0.45);
}

.badge-locked,
.badge-unlocked {
  position: absolute; top: 0.9rem; right: 1rem;
  padding: 0.25rem 0.55rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800;
  backdrop-filter: blur(6px);
  letter-spacing: 0.05em;
}
.badge-locked { background: rgba(255,255,255,0.7); }
.badge-unlocked {
  background: linear-gradient(90deg, #fbbf24, #ff5ea8);
  color: white;
  box-shadow: 0 6px 14px -4px rgba(255, 94, 168, 0.55);
}

.countdown {
  margin-top: 0.4rem;
  font-family: 'Inter', monospace;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.85);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px -4px rgba(0,0,0,0.15);
}
.countdown-label {
  font-size: 0.7rem; opacity: 0.7; font-style: italic; margin-top: 0.15rem;
}

/* Stickers on corners of cards */
.sticker {
  position: absolute; z-index: 3;
  font-size: 1.6rem; pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  animation: stickerSpin 8s linear infinite;
}
.sticker-tl { top: -0.6rem; left: -0.6rem; animation-direction: reverse; }
.sticker-br { bottom: -0.4rem; right: -0.4rem; }
@keyframes stickerSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.float-heart {
  position: absolute; font-size: 1.4rem; opacity: 0.9;
  animation: floatup 6s ease-in-out infinite;
}
@keyframes floatup {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.0; }
  20%  { opacity: 0.9; }
  100% { transform: translateY(-140px) rotate(20deg); opacity: 0; }
}

.btn-primary {
  background: linear-gradient(135deg, #ff5ea8, #a855f7);
  color: white; font-weight: 800;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.6);
  transition: transform 150ms ease, box-shadow 150ms ease;
  display: inline-block;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.04) rotate(-1deg);
  box-shadow: 0 14px 40px -10px rgba(255, 94, 168, 0.75);
}

.chaos-btn {
  background: linear-gradient(135deg, #fbbf24, #ff5ea8, #a855f7);
  background-size: 200% 200%;
  animation: rainbowShift 3s linear infinite;
  color: white; font-weight: 900;
  padding: 0.7rem 1.4rem; border-radius: 999px;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.6);
  transition: transform 150ms ease;
  font-size: 0.8rem;
}
.chaos-btn:hover { transform: scale(1.08) rotate(-2deg); }

/* Hype banner that pops in on unlock */
.hype-banner {
  position: fixed; z-index: 40;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%) scale(0.6) rotate(-4deg);
  background: linear-gradient(135deg, #fbbf24, #ff5ea8, #a855f7);
  background-size: 200% 200%;
  animation: rainbowShift 2s linear infinite;
  color: white; font-weight: 900;
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  padding: 1.5rem 2.5rem; border-radius: 2rem;
  box-shadow: 0 30px 60px -20px rgba(168, 85, 247, 0.7);
  text-transform: uppercase; letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transition: transform 500ms cubic-bezier(.2,.9,.3,1.6), opacity 400ms ease;
  pointer-events: none;
}
.hype-banner.in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-4deg);
}

/* Gallery */
.gallery-img {
  border-radius: 1rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #fde1ef, #e9d5ff);
}
.gallery-placeholder {
  border-radius: 1rem;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fde1ef, #e9d5ff);
  display: flex; align-items: center; justify-content: center;
  color: #8b5cf6; font-weight: 700; font-size: 0.85rem;
  border: 3px dashed rgba(139, 92, 246, 0.35);
  text-align: center; padding: 0.5rem;
}

/* Spectacular hero (gift 5 detail page) */
.spectacular-hero {
  position: relative;
  padding: 2.5rem 1rem 3rem;
  margin-top: 1rem;
  border-radius: 2.5rem;
  overflow: hidden;
  isolation: isolate;
}
.spectacular-hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 20% 30%, rgba(251,191,36,0.6), transparent 60%),
    radial-gradient(600px 400px at 80% 70%, rgba(255,94,168,0.65), transparent 60%),
    radial-gradient(500px 400px at 50% 100%, rgba(168,85,247,0.5), transparent 60%),
    linear-gradient(135deg, #ff5ea8, #a855f7);
  background-size: 200% 200%;
  animation: drift 10s ease-in-out infinite alternate;
  filter: blur(10px);
}
.spectacular-ribbon {
  position: absolute; top: 1rem; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #fbbf24, #ff5ea8, #a855f7, #fbbf24);
  background-size: 200% 100%;
  animation: rainbowShift 3s linear infinite;
  color: white; font-weight: 900;
  font-size: 0.8rem; letter-spacing: 0.25em;
  padding: 0.5rem 1.25rem; border-radius: 999px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.25);
  white-space: nowrap;
  z-index: 3;
}
.back-link {
  position: absolute; top: 1rem; left: 1rem;
  font-size: 0.85rem; font-weight: 800;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(6px);
  padding: 0.4rem 0.9rem; border-radius: 999px;
  z-index: 4;
}

.video-frame {
  position: relative;
  border-radius: 1.75rem;
  padding: 6px;
  background: linear-gradient(135deg, #fbbf24, #ff5ea8, #a855f7, #fbbf24);
  background-size: 300% 300%;
  animation: rainbowShift 4s linear infinite;
  box-shadow: 0 30px 60px -15px rgba(168,85,247,0.55);
}
.video-el {
  width: 100%;
  display: block;
  border-radius: 1.4rem;
  background: #000;
  max-height: 70vh;
  object-fit: cover;
}

/* Lock screen */
.lock-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(1000px 700px at 20% 10%, #ffc6e3 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 90%, #d9c6ff 0%, transparent 60%),
    linear-gradient(180deg, #fff5fb 0%, #f6f0ff 100%);
  backdrop-filter: blur(4px);
}
.lock-card {
  position: relative;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  border-radius: 2rem;
  padding: 2.5rem 2rem;
  max-width: 26rem; width: 100%;
  box-shadow: 0 30px 60px -20px rgba(168, 85, 247, 0.4);
  text-align: center;
  border: 3px solid rgba(255,255,255,0.9);
}
.lock-card input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  background: white;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.lock-card input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}
.lock-card.wrong { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px) rotate(-1deg); }
  75% { transform: translateX(10px) rotate(1deg); }
}
.lock-error {
  color: #e11d48;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.75rem;
  min-height: 1.2em;
}
