/* ───
   Project: Secret Birthday Gift
   Author: @saklin_01
─── */

/* ─── RESET & BASE ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background-color: #080708;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 85%, rgba(225, 135, 55, 0.16) 0%, rgba(135, 65, 20, 0.06) 45%, transparent 75%),
    radial-gradient(circle 900px at 50% 40%, #171215 0%, #0e0b0d 55%, #080708 100%);
  font-family: 'Playfair Display', serif;
}

#bg-ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden;
}

/* ─── INTIMATE CANDLELIGHT MOTES & ROSE PETALS ─── */
.candle-mote {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 220, 150, 0.85) 0%, rgba(230, 140, 50, 0.25) 60%, transparent 80%);
  animation: moteRise var(--md, 8s) ease-in-out infinite var(--mdelay, 0s);
  filter: blur(0.5px);
}
@keyframes moteRise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  25% { opacity: 0.65; }
  75% { opacity: 0.75; }
  100% { transform: translateY(-75vh) scale(1.1); opacity: 0; }
}

.petal {
  position: absolute; top: -60px; border-radius: 80% 0 80% 0; opacity: 0.85;
  animation: petalFall var(--pd, 6s) linear var(--pdelay, 0s) infinite;
}
@keyframes petalFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.85; }
  50% { transform: translateY(55vh) translateX(-15px) rotate(180deg); opacity: 0.65; }
  100% { transform: translateY(110vh) translateX(10px) rotate(360deg); opacity: 0; }
}

/* ─── SHINCHAN DATE QUIZ SCREEN (FULL SCREEN LOCKSCREEN) ─── */
#quiz-screen {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity 0.8s ease;
}
#quiz-screen.show { opacity: 1; pointer-events: auto; }
#quiz-screen.hidden { opacity: 0; pointer-events: none; }

.quiz-card {
  width: 100%; height: 100%;
  display: flex; flex-direction: row; align-items: stretch;
  position: relative; overflow: hidden;
}
.quiz-card.shake { animation: cardShake 0.45s ease-in-out; }
@keyframes cardShake {
  0%,100%{transform:translateX(0)}
  20%,60%{transform:translateX(-10px)}
  40%,80%{transform:translateX(10px)}
}

/* Left Half: Aesthetic Vertical Striped Wallpaper with Scalloped Cameo */
.quiz-visual-side {
  flex: 1; height: 100%;
  background: repeating-linear-gradient(90deg, #fefae0 0px, #fefae0 22px, #f7eed2 22px, #f7eed2 44px);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cameo-star {
  position: absolute; font-size: 1.4rem; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}
.cameo-star.s1 { top: 8%; left: 10%; color: #2a9d8f; }
.cameo-star.s2 { top: 12%; right: 14%; color: #e76f51; }
.cameo-star.s3 { bottom: 10%; left: 12%; color: #f4a261; }
.cameo-star.s4 { bottom: 14%; right: 16%; color: #0288d1; }
.cameo-star.s5 { top: 50%; left: 6%; color: #e76f51; font-size: 1.1rem; }
.cameo-star.s6 { top: 46%; right: 8%; color: #2a9d8f; font-size: 1.1rem; }

.rosette-cameo {
  position: relative;
  width: clamp(280px, 35vw, 420px);
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.rosette-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  filter: drop-shadow(0 14px 34px rgba(110, 70, 140, 0.42));
}
.rosette-petals { fill: #ab8ec4; }
.rosette-ring-outer { fill: #ffffff; }
.rosette-ring-inner { fill: none; stroke: #e5b974; stroke-width: 2.5; }

.shinchan-box {
  position: relative; z-index: 2;
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 14px; overflow: hidden;
  border: 3.5px solid #ffffff; background: #fffdf8;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.08), 0 6px 18px rgba(0,0,0,0.16);
  display: flex; align-items: center; justify-content: center;
}
.shinchan-box img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

/* Right Half: Fullscreen Lavender Lockscreen with Round Keypad */
.quiz-input-side {
  flex: 1.05; height: 100%;
  background: linear-gradient(155deg, #9983b3 0%, #7d679b 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: -8px 0 25px rgba(0,0,0,0.18);
}

.torn-deckle {
  position: absolute; top: 0; bottom: 0; left: -14px; width: 16px; height: 100%;
  pointer-events: none; z-index: 5;
  filter: drop-shadow(-4px 0 5px rgba(0,0,0,0.18));
}

.passcode-container {
  width: 100%; max-width: 440px; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; position: relative; z-index: 6;
}

.passcode-header { margin-bottom: 14px; }
#quiz-title {
  font-family: 'Poppins', sans-serif; font-size: clamp(1.4rem, 2.5vw, 1.8rem); font-weight: 700;
  color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.25);
  margin-bottom: 3px;
  animation: passcodeTitleIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
#quiz-text {
  font-family: 'Poppins', sans-serif; font-size: clamp(0.85rem, 1.3vw, 0.95rem); font-weight: 500;
  color: #f3ecf8; opacity: 0.95;
  animation: passcodeTextIn 0.75s ease-out 0.15s both;
}

@keyframes passcodeTitleIn {
  0% { opacity: 0; transform: translateY(-24px) scale(0.9); }
  70% { transform: translateY(4px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes passcodeTextIn {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0.95; transform: translateY(0); }
}

/* ─── 4 PASSCODE BOXES (MATCHING REFERENCE EXACTLY) ─── */
.passcode-boxes-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 8px 0 18px;
}
.passcode-box {
  width: 44px; height: 46px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-size: 1.45rem; font-weight: 700;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
.passcode-box.active {
  background: rgba(255, 255, 255, 0.5);
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.9);
}

/* ─── VIRTUAL CIRCULAR KEYPAD (MATCHING REFERENCE) ─── */
.keypad {
  display: grid; grid-template-columns: repeat(3, clamp(54px, 5.5vw, 64px));
  justify-content: center; gap: clamp(10px, 1.4vw, 14px) clamp(16px, 2.2vw, 24px);
  margin: 0 auto;
}
.key-btn {
  width: clamp(54px, 5.5vw, 64px); height: clamp(54px, 5.5vw, 64px);
  border-radius: 50%;
  background: #ffffff; border: none;
  font-family: 'Poppins', sans-serif; font-size: clamp(1.3rem, 1.8vw, 1.55rem); font-weight: 700;
  color: #881928;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 12px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}
.key-btn span {
  border-bottom: 2px solid rgba(136, 25, 40, 0.55);
  line-height: 1.1;
}
.key-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(0,0,0,0.25);
  background: #fffdfa;
}
.key-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.key-action {
  color: #c0392b; font-size: 1.25rem; background: #fff5f2;
}
.key-submit {
  color: #e91e63; font-size: 1.35rem; background: #ffebee;
}

#retry-btn {
  margin-top: 16px; width: 100%; max-width: 260px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #fff; border: none; border-radius: 14px;
  padding: 12px; font-family: 'Poppins', sans-serif;
  font-size: 0.98rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px rgba(194, 24, 91, 0.45);
  transition: transform 0.15s ease;
}
#retry-btn:hover { transform: scale(1.02); }
.hidden-btn { display: none !important; }

/* ─── STAGE CURTAINS (FULL SCREEN TOP-TO-BOTTOM) ─── */
#curtain-left, #curtain-right {
  position: fixed; top: 0; bottom: 0; height: 100vh; width: 51%;
  z-index: 150; pointer-events: none; overflow: hidden;
  transition: transform 2.2s cubic-bezier(.77,0,.175,1);
}
#curtain-left { left: 0; transform: translateX(0); box-shadow: 12px 0 35px rgba(0,0,0,0.85); }
#curtain-right { right: 0; transform: translateX(0); }
#curtain-left.open { transform: translateX(-102%); }
#curtain-right.open { transform: translateX(102%); }

.fabric {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(255,255,255,0.07) 16%, rgba(0,0,0,0.04) 55%, rgba(0,0,0,0.65) 100%),
    repeating-linear-gradient(90deg,
      #2a0006 0px, #52010e 12px, #8f081c 24px, #c4122d 36px,
      #eb2645 44px, #c4122d 52px, #7a0415 64px, #3d0008 74px, #1e0004 80px
    );
}
#curtain-left .fabric::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 40px; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.7)); }
#curtain-right .fabric::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 40px; background: linear-gradient(270deg, transparent, rgba(0,0,0,0.7)); }

/* ─── STAGE CLOCK ─── */
#countdown-wrap {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 160; text-align: center; pointer-events: none;
  transition: transform 1s cubic-bezier(.4,0,.2,1), opacity 0.8s ease;
  display: flex; flex-direction: column; align-items: center;
}
#countdown-wrap.hidden { opacity: 0; transform: translate(-50%,-50%) scale(0.7); }

.clock-housing {
  display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(0 25px 45px rgba(0,0,0,0.95)) drop-shadow(0 0 35px rgba(212,160,23,0.35));
}
.clock-dial-wrap {
  position: relative; width: clamp(220px, 26vw, 290px); height: clamp(220px, 26vw, 290px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #380829 0%, #1c0216 65%, #0d000c 100%);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 0 6px #8b6508, 0 0 0 9px #ffd700, 0 0 0 13px #5c4000, 0 12px 35px rgba(0,0,0,0.85);
}
.clock-svg { width: 100%; height: 100%; display: block; }
.clock-glass {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 40%, transparent 60%);
  pointer-events: none;
}
.second-hand { transform-origin: 140px 140px; transition: transform 0.25s cubic-bezier(0.4, 2.2, 0.55, 0.44); }
.minute-hand, .hour-hand { transform-origin: 140px 140px; transition: transform 0.5s ease; }

.clock-plate {
  margin-top: 14px; background: linear-gradient(180deg, #2b041c 0%, #12010d 100%);
  border: 2px solid #d4a017; border-radius: 12px; padding: 8px 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8), 0 0 20px rgba(212,160,23,0.3);
}
.plate-tag { font-family: 'Poppins', sans-serif; font-size: 0.75rem; letter-spacing: 0.22em; color: #f5deb3; text-transform: uppercase; margin-bottom: 2px; }
.digital-time { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; color: #ffd700; text-shadow: 0 0 12px rgba(255,215,0,0.9); line-height: 1.1; }
.plate-hint { font-family: 'Poppins', sans-serif; font-size: 0.72rem; letter-spacing: 0.1em; color: #f5deb3aa; margin-top: 2px; }
.colon { display: inline-block; animation: colonBlink 1s step-end infinite; }
@keyframes colonBlink { 0%,100%{opacity:1} 50%{opacity:.15} }

/* ─── SURPRISE QUESTION SCREEN (GINGHAM TABLECLOTH & SHINCHAN DANCE CARD) ─── */
#surprise-screen {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
  overflow: hidden;
}
#surprise-screen.show-screen { opacity: 1; pointer-events: auto; }
#surprise-screen.hidden-screen { opacity: 0; pointer-events: none; }

.gingham-stage {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 2vw, 26px);
  box-sizing: border-box;
  background-color: #f7f3ed;
  background-image: 
    linear-gradient(90deg, rgba(200, 36, 52, 0.42) 50%, transparent 50%),
    linear-gradient(rgba(200, 36, 52, 0.42) 50%, transparent 50%);
  background-size: 32px 32px;
}

.surprise-paper-card {
  background-color: #fff6f9;
  background-image: 
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 246, 249, 0.5) 55%, rgba(252, 224, 234, 0.85) 100%),
    repeating-linear-gradient(90deg, #fff7fa 0px, #fff7fa 24px, #fae2ea 24px, #fae2ea 48px);
  width: 100%;
  height: 100%;
  border-radius: 40px;
  border: 4px solid #8e202d;
  box-shadow: 0 14px 40px rgba(130, 20, 35, 0.22);
  padding: clamp(10px, 1.8vh, 20px) clamp(16px, 2.5vw, 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  animation: cardPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sprinkled Pastel Stars inside Surprise Card */
.card-bg-star {
  position: absolute; pointer-events: none; z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  animation: starTwinkle 2.5s ease-in-out infinite alternate;
  user-select: none;
}
.card-bg-star.cs1 { top: 7%; left: 5%; color: #26a69a; font-size: 1.4rem; animation-delay: 0s; }
.card-bg-star.cs2 { top: 9%; right: 6%; color: #ff7043; font-size: 1.3rem; animation-delay: 0.5s; }
.card-bg-star.cs3 { top: 48%; left: 3.5%; color: #e91e63; font-size: 1.35rem; animation-delay: 1.2s; }
.card-bg-star.cs4 { top: 50%; right: 4%; color: #ffb300; font-size: 1.4rem; animation-delay: 0.8s; }
.card-bg-star.cs5 { bottom: 10%; left: 6%; color: #ab47bc; font-size: 1.35rem; animation-delay: 1.5s; }
.card-bg-star.cs6 { bottom: 12%; right: 7%; color: #26a69a; font-size: 1.35rem; animation-delay: 0.3s; }
.card-bg-star.cs7 { top: 26%; left: 12%; color: #ffa726; font-size: 1.15rem; animation-delay: 0.9s; }
.card-bg-star.cs8 { top: 28%; right: 13%; color: #42a5f5; font-size: 1.15rem; animation-delay: 1.7s; }

.curved-title-wrap {
  width: 100%;
  max-width: 1050px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  max-height: clamp(75px, 16vh, 125px);
  margin-top: 2px;
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
}

/* Distinct In-Animation for Page 1: Smooth Arch Wave & Drop */
.anim-wave-drop {
  animation: waveTitleDrop 0.8s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
@keyframes waveTitleDrop {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(0.92);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Distinct In-Animation for Page 2 ("Are you really excited?"): Energetic Pop & Spring Bounce */
.anim-excited-bounce {
  animation: excitedTitleBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes excitedTitleBounce {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
  75% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* In-Animation for Prompt Text: Gentle Spring Float */
.prompt-entrance-pop {
  animation: promptFloatIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
@keyframes promptFloatIn {
  0% { opacity: 0; transform: translateY(24px) scale(0.9); }
  70% { transform: translateY(-4px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* In-Animation for GIF: Joyful Scale Pop */
.gif-entrance-pop {
  animation: gifPopIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes gifPopIn {
  0% { opacity: 0; transform: scale(0.7) translateY(18px); }
  70% { transform: scale(1.05) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* In-Animation for Buttons: Bouncy Group Entrance */
.btn-entrance-bounce {
  animation: btnGroupBounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes btnGroupBounce {
  0% { opacity: 0; transform: translateY(26px) scale(0.85); }
  70% { transform: translateY(-5px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.curved-title-svg {
  width: 100%;
  height: 100%;
  max-height: 125px;
  display: block;
  overflow: visible;
  transform-origin: center center;
}
.arched-text {
  font-family: 'Chewy', 'Fredoka', 'Bubblegum Sans', 'Sniglet', cursive, sans-serif;
  font-size: 64px;
  font-weight: 800;
  fill: #9a1b28;
  letter-spacing: 0.02em;
  user-select: none;
}
.arched-text.excited-mode {
  font-size: 74px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.dance-gif-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  max-height: clamp(160px, 42vh, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto;
  overflow: visible;
  position: relative;
  z-index: 2;
}
.dance-gif-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.prompt-text {
  flex-shrink: 0;
  font-family: 'Chewy', 'Fredoka', 'Sniglet', cursive, sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 700;
  color: #9a1b28;
  text-align: center;
  margin: 4px 0 8px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
}

/* Red Pill / Capsule YES & NO Buttons */
.surprise-btn-group {
  flex-shrink: 0;
  display: flex;
  gap: clamp(18px, 3.5vw, 48px);
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: clamp(6px, 1.5vh, 16px);
  margin-top: 2px;
  z-index: 10;
}
.pill-btn {
  background: #c52433;
  border: none;
  border-radius: 60px;
  padding: clamp(8px, 1.4vh, 13px) clamp(32px, 4vw, 56px);
  min-width: 145px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 18px rgba(180, 25, 40, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pill-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 22px rgba(180, 25, 40, 0.42);
  background: #d82839;
}
.pill-btn:active {
  transform: scale(0.95);
}
.btn-label {
  font-family: 'Chewy', 'Fredoka', 'Sniglet', cursive, sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  border-bottom: 4px solid #ffffff;
  line-height: 1.1;
  letter-spacing: 0.06em;
  padding-bottom: 2px;
}
.btn-shine-tr {
  position: absolute;
  top: 8px;
  right: 15px;
  width: 12px;
  height: 20px;
  border-right: 4px solid rgba(255, 255, 255, 0.95);
  border-radius: 0 50% 50% 0;
  pointer-events: none;
}
.btn-shine-bl {
  position: absolute;
  bottom: 9px;
  left: 17px;
  width: 16px;
  height: 5px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  pointer-events: none;
}
.opening-badge {
  font-family: 'Chewy', 'Fredoka', 'Sniglet', cursive, sans-serif;
  font-size: 1.4rem; font-weight: 700;
  color: #9a1b28; background: #ffffff;
  padding: 14px 40px; border-radius: 50px;
  box-shadow: 0 6px 18px rgba(180, 25, 40, 0.2);
  border: 2.5px solid #9a1b28;
}

/* ─── CANVAS & OVERLAYS ─── */
#midnight-burst { position: fixed; inset: 0; z-index: 140; background: radial-gradient(ellipse at center, rgba(255,215,0,.55) 0%, transparent 60%); pointer-events: none; opacity: 0; }
#midnight-burst.flash { animation: burstFlash 1.5s ease-out forwards; }
@keyframes burstFlash { 0%{opacity:0;transform:scale(.2)} 20%{opacity:1;transform:scale(1.2)} 60%{opacity:.8;transform:scale(1)} 100%{opacity:0} }

.confetti-piece { position: fixed; z-index: 200; pointer-events: none; animation: confettiFall var(--cf-d, 3s) ease-in var(--cf-delay, 0s) forwards; opacity: 0; }
@keyframes confettiFall { 0%{opacity:1;transform:translateY(0) rotate(0deg)} 80%{opacity:1} 100%{opacity:0;transform:translateY(100vh) rotate(720deg)} }

/* ─── MYSTERY GIFT BOXES SCREEN (3 FLOATING HEART BOXES) ─── */
#gift-screen {
  position: fixed; inset: 0; z-index: 105;
  background-color: #fff2f6;
  background-image: 
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 242, 246, 0.45) 55%, rgba(250, 218, 228, 0.8) 100%),
    repeating-linear-gradient(90deg, #fff4f8 0px, #fff4f8 24px, #fae0e8 24px, #fae0e8 48px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
}
#gift-screen.show-screen {
  opacity: 1; pointer-events: auto;
}
#gift-screen.hidden-screen {
  opacity: 0; pointer-events: none;
}

/* Sprinkled Decorative Stars (Sister Aesthetic to Passcode Screen) */
.gift-bg-star {
  position: absolute; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
  user-select: none;
}
@keyframes starTwinkle {
  0% { opacity: 0.45; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(14deg); }
  100% { opacity: 0.6; transform: scale(0.95) rotate(-6deg); }
}

.gift-bg-star.gs1 { top: 7%; left: 7%; color: #26a69a; font-size: 1.5rem; animation-delay: 0s; }
.gift-bg-star.gs2 { top: 14%; left: 24%; color: #ff7043; font-size: 1.3rem; animation-delay: 0.6s; }
.gift-bg-star.gs3 { top: 11%; right: 23%; color: #ffb300; font-size: 1.6rem; animation-delay: 1.2s; }
.gift-bg-star.gs4 { top: 8%; right: 8%; color: #e91e63; font-size: 1.4rem; animation-delay: 0.3s; }
.gift-bg-star.gs5 { top: 48%; left: 4%; color: #ab47bc; font-size: 1.35rem; animation-delay: 1.5s; }
.gift-bg-star.gs6 { top: 52%; right: 5%; color: #26a69a; font-size: 1.4rem; animation-delay: 0.9s; }
.gift-bg-star.gs7 { bottom: 12%; left: 8%; color: #ffa726; font-size: 1.5rem; animation-delay: 0.2s; }
.gift-bg-star.gs8 { bottom: 20%; left: 22%; color: #42a5f5; font-size: 1.2rem; animation-delay: 1.8s; }
.gift-bg-star.gs9 { bottom: 18%; right: 21%; color: #ec407a; font-size: 1.5rem; animation-delay: 0.7s; }
.gift-bg-star.gs10 { bottom: 9%; right: 9%; color: #7e57c2; font-size: 1.35rem; animation-delay: 1.3s; }

.gift-stage {
  width: 100%; height: 100%; max-width: 1240px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: clamp(20px, 4vh, 48px) clamp(16px, 3vw, 40px);
  position: relative; z-index: 5; box-sizing: border-box;
}

/* 3 Heart Mystery Boxes Row (Original Position Restored) */
.mystery-boxes-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(16px, 4.5vw, 64px);
  width: 100%;
  margin: auto 0;
}
.mystery-box-item {
  flex: 0 1 clamp(170px, 25vw, 310px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  user-select: none;
}

/* Floating Animations for the 3 Boxes */
.float-box-1 { animation: floatBox1 3.2s ease-in-out infinite alternate; }
.float-box-2 { animation: floatBox2 3.6s ease-in-out infinite alternate -1.2s; }
.float-box-3 { animation: floatBox3 3.0s ease-in-out infinite alternate -2.1s; }

@keyframes floatBox1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-16px) rotate(-1.5deg); }
}
@keyframes floatBox2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(1.2deg); }
}
@keyframes floatBox3 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(-1deg); }
}

.mystery-box-item:hover {
  filter: drop-shadow(0 16px 32px rgba(216, 27, 96, 0.5));
  transform: scale(1.08) translateY(-22px) !important;
}
.mystery-box-item:active {
  transform: scale(0.94) translateY(-8px) !important;
}

.heart-box-visual {
  width: 100%;
  display: flex; justify-content: center; align-items: center;
}
.heart-box-svg {
  width: 100%; height: auto;
  max-height: clamp(150px, 30vh, 240px);
  display: block; overflow: visible;
  filter: drop-shadow(0 14px 26px rgba(136, 14, 40, 0.32));
}

.box-rays line {
  animation: rayPulse 2s ease-in-out infinite alternate;
}
@keyframes rayPulse {
  0% { opacity: 0.35; stroke-width: 2.2; }
  100% { opacity: 0.95; stroke-width: 3.5; }
}

/* Aesthetic Framed Shinchan Cameo Mascot */
.mystery-shinchan-frame {
  position: relative;
  margin: 0 auto clamp(8px, 1.8vh, 18px);
  padding: 8px 14px 0px 14px;
  background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #fff0f5 65%, #ffdce6 100%);
  border-radius: 36px 36px 22px 22px;
  border: 3.5px solid #ffffff;
  outline: 2.5px solid #ff7597;
  box-shadow: 
    0 14px 32px rgba(216, 27, 96, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.05),
    inset 0 0 16px rgba(255, 128, 171, 0.18);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  z-index: 5;
  animation: mascotFloat 3.2s ease-in-out infinite alternate;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mystery-shinchan-frame:hover {
  transform: translateY(-8px) scale(1.04) !important;
  box-shadow: 0 18px 40px rgba(216, 27, 96, 0.38);
}
@keyframes mascotFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-10px) scale(1.03); }
}

.shinchan-cameo-inner {
  width: clamp(230px, 30vw, 340px);
  height: clamp(160px, 24vh, 230px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.shinchan-cameo-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Little Gold & Rose Sparkle Stars on Frame */
.cameo-decor-star {
  position: absolute;
  font-size: 1.25rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  animation: starTwinkle 2s ease-in-out infinite alternate;
  z-index: 6;
}
.cameo-decor-star.c-star1 {
  top: 8px; left: 14px; color: #ffb300; animation-delay: 0.3s;
}
.cameo-decor-star.c-star2 {
  top: 8px; right: 14px; color: #e91e63; animation-delay: 1.1s;
}

/* Bottom Mystery Text Matching Screenshot */
.mystery-prompt-wrap {
  text-align: center;
  margin-bottom: clamp(10px, 3vh, 32px);
  position: relative; z-index: 5;
  animation: mysteryTextIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes mysteryTextIn {
  0% { opacity: 0; transform: translateY(22px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.mystery-title {
  font-family: 'Chewy', 'Fredoka', 'Bubblegum Sans', 'Sniglet', cursive, sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  color: #8c1932;
  margin: 0;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}
.mystery-subtitle {
  font-family: 'Chewy', 'Fredoka', 'Bubblegum Sans', 'Sniglet', cursive, sans-serif;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 700;
  color: #8c1932;
  margin: 4px 0 0;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* Mystery Gift Reveal Modal Popup */
.gift-modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(40, 5, 18, 0.58);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 1; pointer-events: auto;
  transition: opacity 0.3s ease;
}
.gift-modal.hidden {
  opacity: 0; pointer-events: none;
}

/* ─── CLOTHESLINE HANGING MEMORIES GALLERY (MATCHING REFERENCE IMAGE 2) ─── */
.memories-board-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
}
.memories-backdrop {
  position: absolute; inset: 0;
  background-color: #fff2f6;
  background-image: 
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 240, 246, 0.45) 55%, rgba(250, 214, 226, 0.95) 100%),
    repeating-linear-gradient(45deg, #fff5f8 0px, #fff5f8 24px, #fae0e8 24px, #fae0e8 48px);
  z-index: 1;
  overflow: hidden;
}

/* Sprinkled Decorative Stars in the Background behind the board */
.mem-bg-star {
  position: absolute; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
  user-select: none;
}
.mem-bg-star.mbs1 { top: 6%; left: 6%; color: #26a69a; font-size: 1.5rem; animation-delay: 0s; }
.mem-bg-star.mbs2 { top: 12%; left: 22%; color: #ff7043; font-size: 1.3rem; animation-delay: 0.6s; }
.mem-bg-star.mbs3 { top: 8%; right: 20%; color: #ffb300; font-size: 1.6rem; animation-delay: 1.2s; }
.mem-bg-star.mbs4 { top: 7%; right: 7%; color: #e91e63; font-size: 1.4rem; animation-delay: 0.3s; }
.mem-bg-star.mbs5 { top: 48%; left: 3%; color: #ab47bc; font-size: 1.35rem; animation-delay: 1.5s; }
.mem-bg-star.mbs6 { top: 52%; right: 4%; color: #26a69a; font-size: 1.4rem; animation-delay: 0.9s; }
.mem-bg-star.mbs7 { bottom: 10%; left: 7%; color: #ffa726; font-size: 1.5rem; animation-delay: 0.2s; }
.mem-bg-star.mbs8 { bottom: 18%; left: 20%; color: #42a5f5; font-size: 1.2rem; animation-delay: 1.8s; }
.mem-bg-star.mbs9 { bottom: 16%; right: 19%; color: #ec407a; font-size: 1.5rem; animation-delay: 0.7s; }
.mem-bg-star.mbs10 { bottom: 8%; right: 8%; color: #7e57c2; font-size: 1.35rem; animation-delay: 1.3s; }

/* Scrapbook Board Container (Restored to Authentic Craft Paper Style) */
.memories-board-container {
  position: relative; z-index: 5;
  width: 95vw; max-width: 1180px;
  height: 86vh; max-height: 660px;
  background: #fbf7ee;
  background-image: 
    radial-gradient(#ebdcc8 1.5px, transparent 1.5px),
    radial-gradient(#f2e4d2 1.5px, #fbf7ee 1.5px);
  background-size: 24px 24px;
  border: 4px solid #ebd0b5;
  border-radius: 26px;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.32), inset 0 0 35px rgba(220, 190, 160, 0.25);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(16px, 2.8vh, 24px) clamp(16px, 2.5vw, 32px);
  box-sizing: border-box;
  animation: clotheslineDropIn 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
  overflow: hidden;
}

@keyframes clotheslineDropIn {
  0% { opacity: 0; transform: translateY(-50px) scale(0.9); }
  70% { opacity: 1; transform: translateY(5px) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close Button */
.memories-board-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #b71c1c; background: #ffffff;
  color: #b71c1c; font-size: 1.2rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 15;
}
.memories-board-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: #ffebee;
}

/* Scrapbook Title Cutout Letter Blocks: M E M O R I E S */
.scrapbook-title-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  margin-top: 4px; margin-bottom: 8px;
  user-select: none;
}
.letter-tile {
  width: clamp(34px, 4.2vw, 54px);
  height: clamp(40px, 5vw, 62px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.1);
  font-family: 'Chewy', 'Sniglet', 'Fredoka', cursive, serif;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  font-weight: 700;
  color: #ffffff;
  transition: transform 0.2s ease;
}
.letter-tile:hover {
  transform: translateY(-4px) scale(1.1) !important;
}

/* Individual letter tile styles matching reference image */
.letter-tile.lt-1 { background: #b71c1c; transform: rotate(-3deg); }
.letter-tile.lt-2 { background: #880e4f; transform: rotate(2.5deg); }
.letter-tile.lt-3 { background: #c62828; transform: rotate(-2deg); }
.letter-tile.lt-4 { background: #ff7043; transform: rotate(3deg); }
.letter-tile.lt-5 { background: #d81b60; transform: rotate(-2.5deg); }
.letter-tile.lt-6 { background: #ad1457; transform: rotate(1.5deg); }
.letter-tile.lt-7 { 
  background: #fff8e1; color: #b71c1c;
  border: 1px solid #ffcc80;
  transform: rotate(-3deg); 
}
.letter-tile.lt-8 { background: #7f0000; transform: rotate(2.5deg); }

.title-sparkle-star {
  color: #b71c1c; font-size: 1.8rem;
  margin-left: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  animation: starTwinkle 2.5s infinite alternate;
}

/* Clothesline Stage */
.clothesline-stage {
  position: relative; width: 100%; flex: 1;
  display: flex; align-items: center;
  overflow: hidden;
  padding: 10px 0 15px;
}

/* Hanging Wire SVG */
.clothesline-wire-svg {
  position: absolute; top: 16px; left: 0;
  width: 100%; height: 75px;
  pointer-events: none; z-index: 3;
}
.wire-bulb circle {
  filter: drop-shadow(0 0 8px rgba(255, 213, 79, 0.85));
  animation: bulbGlow 2s ease-in-out infinite alternate;
}
@keyframes bulbGlow {
  0% { opacity: 0.75; }
  100% { opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 235, 59, 1)); }
}

/* Horizontal Track for Hanging Photos */
.clothesline-photos-track {
  display: flex; align-items: flex-start; justify-content: flex-start;
  gap: clamp(14px, 2.2vw, 32px);
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 30px clamp(20px, 3.5vw, 60px) 15px;
  position: relative; z-index: 4;
}
.clothesline-photos-track::-webkit-scrollbar {
  display: none;
}

/* Hanging Polaroid Item */
.hanging-polaroid-item {
  flex: 0 0 clamp(165px, 17.5vw, 215px);
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s ease;
}
.hanging-polaroid-item.tilt-left { transform: rotate(-3deg); }
.hanging-polaroid-item.tilt-right { transform: rotate(2.5deg); }
.hanging-polaroid-item.tilt-straight { transform: rotate(-0.5deg); }

.hanging-polaroid-item:hover,
.hanging-polaroid-item.active-sway {
  transform: translateY(-10px) scale(1.07) rotate(0deg) !important;
  z-index: 10;
}

/* Wooden Clothespin (Peg) */
.wooden-clothespin {
  position: absolute; top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 38px;
  background: linear-gradient(90deg, #ecd8b8 0%, #dfc49e 50%, #d1b288 100%);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  z-index: 7;
}
.peg-slit {
  position: absolute; top: 14px; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 2px; background: rgba(90, 60, 40, 0.45);
}
.peg-spring {
  position: absolute; top: 12px; left: 0; right: 0;
  height: 4px; background: #8d6e63;
  border-radius: 1px;
}

/* Red-and-White Gingham Plaid Frame (Exact Match to Reference Image 2) */
.gingham-frame {
  background-color: #ffffff;
  background-image: 
    linear-gradient(90deg, rgba(218, 41, 60, 0.52) 50%, transparent 50%),
    linear-gradient(rgba(218, 41, 60, 0.52) 50%, transparent 50%);
  background-size: 15px 15px;
  padding: 10px 10px 12px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(120, 20, 35, 0.22), 0 2px 6px rgba(0,0,0,0.12);
  transition: box-shadow 0.25s ease;
}
.hanging-polaroid-item:hover .gingham-frame {
  box-shadow: 0 16px 36px rgba(160, 25, 45, 0.35);
}

.photo-inner-box {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 6px; overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.18);
}
.photo-inner-box img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.photo-caption-tag {
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 6px;
  margin-top: 8px;
  font-family: 'Chewy', 'Fredoka', cursive, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #b71c1c;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ribbons and Flower Decorations along the wire */
.line-deco-element {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  align-self: flex-start;
  margin-top: 25px;
  user-select: none;
  pointer-events: none;
}
.line-deco-element.bow-deco {
  animation: bowBob 3s ease-in-out infinite alternate;
}
.line-deco-element.flower-deco {
  animation: flowerBob 3.4s ease-in-out infinite alternate -1s;
}
@keyframes bowBob {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(4px) rotate(4deg); }
}
@keyframes flowerBob {
  0% { transform: translateY(0) rotate(5deg); }
  100% { transform: translateY(5px) rotate(-5deg); }
}

/* Vintage Camera in Bottom-Left Corner */
.vintage-camera-deco {
  position: absolute; bottom: 8px; left: 16px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.16));
  pointer-events: none; z-index: 5;
  transition: transform 0.2s ease;
}

/* Track Navigation Arrow Buttons (Matching Reference '>' Arrow on right) */
.track-arrow-btn {
  position: absolute; top: 52%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  color: #ffffff; border: 2.5px solid #ffffff;
  font-size: 1.25rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(183, 28, 28, 0.4);
  z-index: 12;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease;
}
.track-arrow-btn:hover {
  transform: translateY(-50%) scale(1.12);
  background: #c62828;
}
.track-arrow-btn.arrow-prev {
  left: 10px;
}
.track-arrow-btn.arrow-next {
  right: 10px;
}

/* Footer Hint */
.clothesline-footer-hint {
  font-family: 'Chewy', 'Fredoka', cursive, sans-serif;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  color: #b71c1c;
  text-align: center;
  margin-top: 4px;
  opacity: 0.9;
}

/* ─── MAKE A WISH: INTERACTIVE CAKE CUTTING MODAL (BOX 2) ─── */
.cake-screen-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
}
.cake-modal-backdrop {
  position: absolute; inset: 0;
  background-color: #fff2f6;
  background-image: 
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 240, 246, 0.45) 55%, rgba(250, 214, 226, 0.95) 100%),
    repeating-linear-gradient(45deg, #fff5f8 0px, #fff5f8 24px, #fae0e8 24px, #fae0e8 48px);
  z-index: 1; overflow: hidden;
}

/* Sprinkled Backdrop Stars for Cake Screen */
.cake-bg-star {
  position: absolute; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
  user-select: none;
}
.cake-bg-star.cks1 { top: 8%; left: 8%; color: #26a69a; font-size: 1.5rem; animation-delay: 0s; }
.cake-bg-star.cks2 { top: 12%; right: 10%; color: #ff7043; font-size: 1.3rem; animation-delay: 0.6s; }
.cake-bg-star.cks3 { top: 46%; left: 4%; color: #ffb300; font-size: 1.6rem; animation-delay: 1.2s; }
.cake-bg-star.cks4 { top: 48%; right: 5%; color: #e91e63; font-size: 1.4rem; animation-delay: 0.3s; }
.cake-bg-star.cks5 { bottom: 12%; left: 10%; color: #ab47bc; font-size: 1.35rem; animation-delay: 1.5s; }
.cake-bg-star.cks6 { bottom: 10%; right: 9%; color: #26a69a; font-size: 1.4rem; animation-delay: 0.9s; }
.cake-bg-star.cks7 { top: 25%; left: 18%; color: #ffa726; font-size: 1.2rem; animation-delay: 0.2s; }
.cake-bg-star.cks8 { bottom: 25%; right: 18%; color: #42a5f5; font-size: 1.2rem; animation-delay: 1.8s; }

/* Cake Card Container */
.cake-card-container {
  position: relative; z-index: 5;
  width: 96vw; max-width: 860px;
  background: #fdfaf7;
  border: 3.5px solid #d32f2f;
  border-radius: 28px;
  box-shadow: 0 28px 75px rgba(211, 47, 47, 0.28), inset 0 0 20px rgba(255, 235, 238, 0.6);
  padding: clamp(8px, 1.5vh, 14px) clamp(10px, 2vw, 16px);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: cardPopIn 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.cake-card-close {
  position: absolute; top: 12px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #b71c1c; background: #ffffff;
  color: #b71c1c; font-size: 1.2rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 40;
}
.cake-card-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: #ffebee;
}

/* Cake Interactive Stage matching 16:10 reference screenshot */
.cake-interactive-stage {
  position: relative; width: 100%;
  max-width: 820px; aspect-ratio: 920 / 580;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}
.cake-svg-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cake-svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 6px 18px rgba(180, 20, 50, 0.12));
  overflow: visible;
}

/* Candle Flame Glow & Extinguish */
.candle-item {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.candle-item:hover {
  transform: scale(1.06);
}
.flame-wrap {
  transform-origin: 0px 0px;
  animation: flameFlicker 1.4s ease-in-out infinite alternate;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.flame-wrap.extinguished {
  opacity: 0;
  transform: scale(0.1) translateY(-8px);
  pointer-events: none;
}
@keyframes flameFlicker {
  0% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.08) rotate(3deg); }
  100% { transform: scale(0.96) rotate(-2deg); }
}

/* Hanging "CLICK ME" Tag Swing & Balloons Float */
.click-me-heart-badge {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: 858px 68px;
  animation: clickMeTagSwing 2.5s ease-in-out infinite alternate;
}
.click-me-heart-badge:hover {
  transform: scale(1.15) rotate(5deg);
}
@keyframes clickMeTagSwing {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}
.balloons-floating {
  animation: balloonsDrift 3s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
@keyframes balloonsDrift {
  0% { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(-7px) rotate(2deg); }
}

/* Wish Banner: Seamless Bottom Celebration Ribbon (Never covers the cake!) */
.cake-wish-banner {
  width: 100%;
  max-width: 820px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slideWishIn 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
  z-index: 10;
}
.cake-wish-banner.hidden {
  display: none !important;
}
@keyframes slideWishIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.wish-ribbon-card {
  width: 100%;
  background: #fff8fa;
  border: 2px solid #ff7597;
  border-radius: 20px;
  padding: 8px 18px;
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wish-main-text {
  flex: 1 1 300px;
  font-family: 'Fredoka', 'Poppins', sans-serif;
  font-size: clamp(0.9rem, 1.3vw, 1.02rem);
  color: #8c1932;
  font-weight: 600;
  margin: 0;
  text-align: left;
  line-height: 1.35;
}
.wish-buttons-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.cake-btn-again, .cake-btn-back {
  padding: 8px 18px; border-radius: 50px;
  font-family: 'Chewy', 'Fredoka', cursive;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.cake-btn-again {
  background: linear-gradient(180deg, #ff4081, #d81b60);
  color: #ffffff; border: 2px solid #b71c1c;
  box-shadow: 0 4px 12px rgba(216, 27, 96, 0.3);
}
.cake-btn-back {
  background: #ffffff; color: #b71c1c;
  border: 2px solid #ff80ab;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.cake-btn-again:hover, .cake-btn-back:hover {
  transform: scale(1.05);
}

.cake-footer-hint {
  font-family: 'Chewy', 'Fredoka', cursive, sans-serif;
  font-size: clamp(0.85rem, 1.4vw, 0.98rem);
  color: #b71c1c;
  text-align: center;
  margin-top: 6px;
  opacity: 0.9;
}

/* Generic Modal Card */
.gift-modal-card {
  background: #ffffff;
  border-radius: 28px;
  padding: clamp(24px, 4vh, 36px) clamp(20px, 3vw, 32px);
  max-width: 440px; width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  border: 3.5px solid #ff80ab;
  animation: cardPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-close-btn {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.4rem;
  color: #8c1932; cursor: pointer; padding: 6px;
}
.gift-modal-icon {
  font-size: clamp(2.8rem, 6vw, 4rem);
  margin-bottom: 8px;
  animation: modalIconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIconBounce {
  0% { transform: scale(0.2) rotate(-15deg); }
  60% { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.gift-modal-title {
  font-family: 'Chewy', 'Fredoka', 'Sniglet', cursive, sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 700; color: #c2185b;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.gift-modal-desc {
  font-family: 'Poppins', 'Fredoka', sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: #4a154b; line-height: 1.6;
  margin: 0 0 22px;
}
.modal-action-btn {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #ffffff; border: none; border-radius: 50px;
  padding: 12px 34px;
  font-family: 'Chewy', 'Fredoka', 'Sniglet', cursive, sans-serif;
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(194, 24, 91, 0.4);
  transition: transform 0.15s ease;
}
.modal-action-btn:hover {
  transform: scale(1.05);
}


/* ─── SPECIAL BOX 3: LOVE & BIRTHDAY LETTER MODAL (MATCHING REFERENCE IMAGE) ─── */
.letter-screen-overlay {
  position: fixed; inset: 0; z-index: 125;
  background: linear-gradient(145deg, #a48ebd 0%, #957eb0 50%, #836c9d 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  opacity: 1; pointer-events: auto;
  transition: opacity 0.35s ease;
}
.letter-screen-overlay.hidden {
  opacity: 0; pointer-events: none;
}

/* Background Stars Matching Passcode & Reference Screenshot */
.letter-bg-backdrop {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; z-index: 1;
}
.letter-bg-star {
  position: absolute;
  color: rgba(255, 255, 255, 0.58);
  font-family: serif; user-select: none; pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(60, 30, 80, 0.22));
  animation: letterStarGlow 3.5s ease-in-out infinite alternate;
}
@keyframes letterStarGlow {
  0% { transform: scale(0.85); opacity: 0.35; }
  100% { transform: scale(1.15); opacity: 0.85; }
}
.lbs1 { top: 7%; left: 6%; font-size: 1.6rem; animation-delay: 0.2s; }
.lbs2 { top: 12%; left: 32%; font-size: 1.2rem; animation-delay: 1.1s; }
.lbs3 { top: 6%; right: 28%; font-size: 1.4rem; animation-delay: 0.7s; }
.lbs4 { top: 18%; right: 8%; font-size: 1.1rem; animation-delay: 1.8s; }
.lbs5 { top: 46%; left: 3%; font-size: 1.3rem; animation-delay: 0.5s; }
.lbs6 { top: 38%; left: 45%; font-size: 1.5rem; animation-delay: 1.4s; }
.lbs7 { top: 58%; right: 5%; font-size: 1.6rem; animation-delay: 2.1s; }
.lbs8 { bottom: 12%; left: 10%; font-size: 1.4rem; animation-delay: 0.9s; }
.lbs9 { bottom: 8%; left: 42%; font-size: 1.2rem; animation-delay: 1.6s; }
.lbs10 { bottom: 15%; right: 20%; font-size: 1.5rem; animation-delay: 0.4s; }
.lbs11 { top: 82%; right: 38%; font-size: 1.1rem; animation-delay: 2.4s; }
.lbs12 { top: 28%; right: 35%; font-size: 1.3rem; animation-delay: 1.9s; }

/* Top Right Cream Back Button (Exact Match) */
.letter-back-btn {
  position: absolute;
  top: clamp(14px, 3vh, 26px);
  right: clamp(16px, 3vw, 32px);
  background: #f7eee4;
  color: #3b2a2a;
  border: 1.5px solid rgba(130, 95, 150, 0.2);
  border-radius: 20px;
  padding: 5px 22px 6px;
  font-family: 'Poppins', 'Fredoka', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(40, 20, 60, 0.15);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 20;
}
.letter-back-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(40, 20, 60, 0.25);
}

/* Two-Column Letter Container */
.letter-card-container {
  position: relative; z-index: 5;
  width: 95%; max-width: 1260px;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: clamp(32px, 5vw, 75px);
  padding: clamp(16px, 3.5vw, 45px);
  animation: letterCardPop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes letterCardPop {
  0% { transform: scale(0.92) translateY(18px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.letter-photo-column {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}

/* Tilted Polaroid Frame */
.letter-polaroid-frame {
  position: relative;
  transform: rotate(-4.5deg);
  box-shadow: 0 24px 50px rgba(35, 12, 50, 0.38), 0 6px 18px rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  transition: transform 0.35s ease;
}
.letter-polaroid-frame:hover {
  transform: rotate(-2deg) scale(1.02);
}

/* Purple Gingham Checkered Frame Border */
.letter-gingham-wrap {
  background-color: #f6f0fb;
  background-image:
    linear-gradient(90deg, rgba(188, 168, 216, 0.72) 50%, transparent 50%),
    linear-gradient(rgba(188, 168, 216, 0.72) 50%, transparent 50%);
  background-size: 18px 18px;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 14px;
  border: 1.5px solid rgba(160, 135, 195, 0.35);
  display: flex; align-items: center; justify-content: center;
}

.letter-photo-inner {
  width: clamp(260px, 28vw, 380px);
  aspect-ratio: 1 / 1.05;
  border-radius: 8px; overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(140, 110, 175, 0.25);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.08);
}
.letter-photo-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Purple Ribbon Bow in Bottom-Left Corner */
.letter-purple-bow {
  position: absolute;
  bottom: -44px; left: -44px;
  width: 142px; height: 142px;
  pointer-events: none; z-index: 10;
}
.bow-svg {
  width: 100%; height: 100%;
  overflow: visible;
}

/* Letter Typography Column (Typewriter style matching screenshot) */
.letter-text-column {
  flex: 1;
  max-width: clamp(480px, 48vw, 680px);
  text-align: center;
  padding: 10px 18px;
}
.letter-headline {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: #ffffff;
  font-size: clamp(1.4rem, 2.2vw, 2.05rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 clamp(18px, 2.8vh, 28px);
  text-shadow: 0 2px 10px rgba(25, 5, 35, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.letter-para {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: #ffffff;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  font-weight: 700;
  line-height: 1.58;
  margin: 0 0 clamp(16px, 2.4vh, 24px);
  letter-spacing: 0.005em;
  text-shadow: 0 2px 8px rgba(25, 5, 35, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.letter-closing {
  margin-bottom: 0;
}

/* Glowing Neon Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 3.5px;
  height: 1.15em;
  background: #ffffff;
  margin-left: 4px;
  vertical-align: -0.12em;
  border-radius: 2px;
  box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 180, 215, 0.95);
  animation: cursorBlink 0.6s ease-in-out infinite alternate;
}
@keyframes cursorBlink {
  0% { opacity: 0.15; transform: scaleY(0.9); }
  100% { opacity: 1; transform: scaleY(1.05); }
}

/* ─── 3D PERSPECTIVE POLAROID & BOW ANIMATION ─── */
.animate-letter .letter-polaroid-frame {
  animation: polaroid3DDrop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes polaroid3DDrop {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateY(-28deg) rotateZ(-10deg) translateY(-32px) scale(0.88);
  }
  65% {
    transform: perspective(900px) rotateY(6deg) rotateZ(-2.5deg) translateY(4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateY(0deg) rotateZ(-4deg) translateY(0) scale(1);
  }
}

.animate-letter .letter-purple-bow {
  animation: bowPop3D 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

@keyframes bowPop3D {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-35deg);
  }
  70% {
    transform: scale(1.18) rotate(6deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}


/* ─── RESPONSIVE MOBILE (PORTRAIT FULL SCREEN) ─── */
@media (max-width: 768px) {
  .quiz-card {
    flex-direction: column;
    width: 100%; height: 100%;
    overflow-y: auto;
  }
  .quiz-visual-side {
    flex: 0 0 40vh; width: 100%; padding: 16px;
  }
  .rosette-cameo { width: clamp(200px, 56vw, 260px); aspect-ratio: 1 / 1; height: auto; }
  .shinchan-box { width: 72%; aspect-ratio: 1 / 1; height: auto; border-radius: 10px; }
  .quiz-input-side {
    flex: 1; width: 100%; padding: 18px 16px 28px;
    box-shadow: none;
  }
  .torn-deckle { display: none; }
  .keypad { grid-template-columns: repeat(3, 48px); gap: 8px 14px; }
  .key-btn { width: 48px; height: 48px; font-size: 1.15rem; }

  /* Mobile Clothesline Board */
  .memories-board-container {
    width: 98vw;
    height: 92vh;
    max-height: none;
    padding: 16px 10px 12px;
  }
  .clothesline-photos-track {
    padding: 25px 12px 10px;
    gap: 12px;
  }
  .hanging-polaroid-item {
    flex: 0 0 165px;
  }
  .track-arrow-btn {
    width: 38px; height: 38px;
    font-size: 1.05rem;
  }
  .vintage-camera-deco {
    display: none;
  }

  /* Mobile Cake Modal */
  .cake-card-container {
    width: 96vw;
    padding: 16px 12px 14px;
    border-radius: 24px;
  }
  .cake-interactive-stage {
    max-width: 100%;
    aspect-ratio: 920 / 580;
    height: auto;
    cursor: pointer;
  }

  /* Mobile Letter Modal */
  .letter-card-container {
    flex-direction: column;
    max-height: 92vh;
    overflow-y: auto;
    gap: 16px;
    padding: 56px 16px 24px;
  }
  .letter-photo-inner {
    width: clamp(160px, 50vw, 220px);
  }
  .letter-purple-bow {
    width: 92px; height: 92px;
    bottom: -26px; left: -26px;
  }
  .letter-headline {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
  .letter-para {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 14px;
  }
}
