/* ───
   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;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background-color: #070002;
  background-image:
    radial-gradient(ellipse 95% 75% at 50% 88%, #6a0015 0%, #3a000c 45%, #140004 80%, #050001 100%),
    radial-gradient(circle 600px at 50% 100%, rgba(255, 23, 68, 0.35) 0%, transparent 70%),
    radial-gradient(circle 450px at 50% 15%, rgba(255, 45, 85, 0.16) 0%, transparent 65%);
  background-attachment: fixed;
  font-family: 'Playfair Display', serif;
}

#bg-ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; 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; }
}

/* Floating Ambient Hearts & Twinkly Stars */
.ambient-float-symbol {
  position: absolute; bottom: -50px; pointer-events: none; opacity: 0.7;
  filter: drop-shadow(0 2px 6px rgba(255, 182, 193, 0.4));
  animation: ambientFloatUp var(--af-d, 10s) ease-in-out var(--af-delay, 0s) infinite;
  user-select: none;
}
@keyframes ambientFloatUp {
  0% { transform: translate3d(0, 0, 0) scale(0.6) rotate(0deg); opacity: 0; }
  15% { opacity: 0.75; }
  50% { transform: translate3d(var(--af-sway, 25px), -50vh, 0) scale(1) rotate(15deg); opacity: 0.85; }
  85% { opacity: 0.65; }
  100% { transform: translate3d(calc(var(--af-sway, 25px) * -1), -105vh, 0) scale(0.8) rotate(-15deg); 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%;
  max-width: 440px;
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.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)}
}

/* Cameo Banner */
.quiz-visual-side {
  flex: 0 0 auto;
  width: 100%;
  max-height: 25vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 10px 4px;
}
.cameo-star {
  position: absolute; font-size: 1.2rem; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}
.cameo-star.s1 { top: 12%; left: 14%; color: #ffd700; }
.cameo-star.s2 { top: 16%; right: 16%; color: #ff1744; }
.cameo-star.s3 { bottom: 10%; left: 18%; color: #ffb300; }
.cameo-star.s4 { bottom: 12%; right: 20%; color: #ff4d6d; }
.cameo-star.s5 { top: 48%; left: 8%; color: #ffc107; font-size: 1rem; }
.cameo-star.s6 { top: 44%; right: 10%; color: #ff758f; font-size: 1rem; }

.rosette-cameo {
  position: relative;
  width: clamp(120px, 28vw, 150px);
  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 10px 24px rgba(220, 20, 60, 0.45));
}
.rosette-petals { fill: #8b001a; }
.rosette-ring-outer { fill: #1c0207; stroke: #ff1744; stroke-width: 2.5; }
.rosette-ring-inner { fill: none; stroke: #ffd700; stroke-width: 2.5; }

.shinchan-box {
  position: relative; z-index: 2;
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden;
  border: 3px solid #ff3366; background: #1c0207;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.6), 0 0 20px rgba(255, 23, 68, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.shinchan-box img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

/* Keypad Section */
.quiz-input-side {
  flex: 1 1 auto;
  width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: none;
  padding: 4px 12px 18px;
}
.torn-deckle { display: none; }

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

.passcode-header { margin-bottom: 8px; }
#quiz-title {
  font-family: 'Poppins', sans-serif; font-size: clamp(1.2rem, 4.4vw, 1.45rem); font-weight: 700;
  color: #ffffff; text-shadow: 0 2px 10px rgba(255, 23, 68, 0.4);
  margin-bottom: 2px;
  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.78rem, 2.8vw, 0.9rem); font-weight: 500;
  color: #ffd6df; opacity: 0.95;
  animation: passcodeTextIn 0.75s ease-out 0.15s both;
}

@keyframes passcodeTitleIn {
  0% { opacity: 0; transform: translateY(-20px) scale(0.92); }
  70% { transform: translateY(3px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes passcodeTextIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0.95; transform: translateY(0); }
}

/* 4 PASSCODE BOXES */
.passcode-boxes-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: 4px 0 14px;
}
.passcode-box {
  width: clamp(38px, 11vw, 44px);
  height: clamp(40px, 12vw, 46px);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 80, 110, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-size: 1.35rem; font-weight: 700;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 2px 8px rgba(220, 20, 60, 0.2);
  transition: all 0.2s ease;
}
.passcode-box.active {
  background: rgba(255, 255, 255, 0.28);
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.9);
}

/* VIRTUAL CIRCULAR KEYPAD */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, clamp(48px, 13vw, 58px));
  justify-content: center;
  gap: clamp(6px, 1.4vh, 10px) clamp(10px, 3.6vw, 18px);
  margin: 0 auto;
}
.key-btn {
  width: clamp(50px, 13.5vw, 62px);
  height: clamp(50px, 13.5vw, 62px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #fff2f5 55%, #ffdce3 100%);
  border: 1.8px solid rgba(255, 215, 225, 0.95);
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.2rem, 3.8vw, 1.45rem);
  font-weight: 700;
  color: #880016;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 
    0 8px 18px rgba(70, 0, 14, 0.32),
    0 2px 4px rgba(0, 0, 0, 0.12),
    inset 0 2px 3px rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(220, 20, 60, 0.14);
  cursor: pointer; 
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.key-btn span {
  border-bottom: none !important;
  text-decoration: none !important;
  line-height: 1;
  position: relative;
  z-index: 2;
}
.key-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50% 50% 100% 100% / 50% 50% 20% 20%;
  pointer-events: none;
}
.key-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 12px 24px rgba(255, 23, 68, 0.38),
    0 0 14px rgba(255, 100, 130, 0.35),
    inset 0 2px 3px #ffffff;
  border-color: #ff4d6d;
}
.key-btn:active {
  transform: scale(0.92) translateY(2px);
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(70, 0, 14, 0.25);
}
.key-action {
  color: #d90429;
  font-size: 1.3rem;
  background: radial-gradient(circle at 35% 28%, #fff5f6 0%, #ffe4e8 60%, #ffccd4 100%);
  border-color: rgba(255, 140, 160, 0.85);
}
.key-action:hover {
  border-color: #d90429;
  color: #ff1744;
}
.key-submit {
  color: #ffffff;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #ff2a55 0%, #e60039 50%, #9e0020 100%);
  border: 1.8px solid rgba(255, 215, 0, 0.7);
  box-shadow: 
    0 8px 24px rgba(255, 23, 68, 0.6),
    0 0 16px rgba(255, 215, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.55);
  animation: keySubmitPulse 2.2s infinite ease-in-out alternate;
}
@keyframes keySubmitPulse {
  0% { box-shadow: 0 8px 24px rgba(255, 23, 68, 0.55), 0 0 12px rgba(255, 215, 0, 0.3); }
  100% { box-shadow: 0 10px 28px rgba(255, 23, 68, 0.75), 0 0 20px rgba(255, 215, 0, 0.6); }
}
.key-submit:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: #ffd700;
  box-shadow: 0 14px 30px rgba(255, 23, 68, 0.8), 0 0 24px rgba(255, 215, 0, 0.7);
}

#retry-btn {
  margin-top: 16px; width: 100%; max-width: 260px;
  background: linear-gradient(135deg, #ff2a55 0%, #c21034 50%, #8b001a 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 215, 0, 0.55);
  border-radius: 999px;
  padding: 12px 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.96rem; font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 23, 68, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
#retry-btn:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #ffd700;
  box-shadow: 0 12px 28px rgba(255, 23, 68, 0.65), 0 0 18px rgba(255, 215, 0, 0.4);
}
#retry-btn:active {
  transform: scale(0.96) translateY(1px);
}
.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 (LUXURY LOVE RED & GOLD VELVET NOIR) ─── */
#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.65); }

.clock-housing {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.95)) drop-shadow(0 0 30px rgba(255, 23, 68, 0.5));
}

.clock-dial-wrap {
  position: relative;
  width: clamp(230px, 28vw, 296px);
  height: clamp(230px, 28vw, 296px);
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, #4a0312 0%, #220108 48%, #0e0004 80%, #050001 100%);
  box-shadow:
    inset 0 0 35px rgba(0, 0, 0, 0.95),
    inset 0 0 14px rgba(255, 23, 68, 0.4),
    0 0 0 1.5px #ffccd5,
    0 0 0 4.5px #800018,
    0 0 0 7.5px #ff1744,
    0 0 0 9.5px #99001e,
    0 0 0 12px #380009,
    0 0 0 13.5px rgba(255, 77, 109, 0.75),
    0 22px 55px rgba(0, 0, 0, 0.94),
    0 0 45px rgba(255, 23, 68, 0.55),
    0 0 65px rgba(255, 77, 109, 0.35);
}
.clock-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.clock-glass {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.09) 32%, transparent 58%),
    radial-gradient(circle at 75% 75%, rgba(255, 23, 68, 0.18) 0%, transparent 45%);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.45), inset 0 -3px 8px rgba(0,0,0,0.7);
  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: 16px;
  background: linear-gradient(180deg, rgba(46, 2, 11, 0.94) 0%, rgba(18, 0, 5, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 77, 109, 0.88);
  border-radius: 20px;
  padding: 10px 24px 11px 24px;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 0 18px rgba(255, 23, 68, 0.35),
    0 0 0 2.5px rgba(100, 0, 16, 0.9),
    0 0 0 4px rgba(255, 77, 109, 0.5),
    0 16px 45px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(255, 23, 68, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 360px);
}
.plate-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
}
.plate-gem {
  color: #ff4d6d;
  font-size: 0.72rem;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.9);
  animation: plateGemTwinkle 2s ease-in-out infinite alternate;
  flex-shrink: 0;
}
@keyframes plateGemTwinkle {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 6px #ff1744); }
}
.plate-tag {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: clamp(0.7rem, 2.4vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #ffccd5;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85), 0 0 12px rgba(255, 23, 68, 0.6);
  white-space: nowrap;
}
.digital-time {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: clamp(2rem, 5.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}
.digital-time .time-digit {
  background: linear-gradient(180deg, #ffffff 0%, #ffccd5 28%, #ff4d6d 65%, #c9184a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255, 23, 68, 0.7)) drop-shadow(0 0 20px rgba(255, 77, 109, 0.45));
  display: inline-block;
  min-width: 1.25em;
  text-align: center;
}
.colon {
  display: inline-block;
  margin: 0 2px;
  color: #ff1744;
  -webkit-text-fill-color: #ff1744;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.95em;
  text-shadow: 0 0 12px #ff1744, 0 0 24px rgba(255, 23, 68, 0.9);
  animation: colonHeartbeat 1s ease-in-out infinite;
}
@keyframes colonHeartbeat {
  0%, 100% { opacity: 1; transform: scale(1.06); filter: drop-shadow(0 0 8px #ff1744); }
  50% { opacity: 0.4; transform: scale(0.92); filter: drop-shadow(0 0 3px #ff1744); }
}
.plate-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #ffd6df;
  margin-top: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  white-space: nowrap;
}
.plate-hint-icon {
  font-size: 0.78rem;
  display: inline-block;
  animation: pulseHintHeart 1.8s ease-in-out infinite alternate;
}
@keyframes pulseHintHeart {
  0% { transform: scale(1); }
  100% { transform: scale(1.22); filter: drop-shadow(0 0 6px #ff1744); }
}

/* ─── 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;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  background: transparent;
}

.surprise-paper-card {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  animation: cardPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sprinkled Romantic 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: #ffd700; font-size: 1.4rem; animation-delay: 0s; }
.card-bg-star.cs2 { top: 9%; right: 6%; color: #ff1744; font-size: 1.3rem; animation-delay: 0.5s; }
.card-bg-star.cs3 { top: 48%; left: 3.5%; color: #ff4d6d; 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: #ff758f; font-size: 1.35rem; animation-delay: 1.5s; }
.card-bg-star.cs6 { bottom: 12%; right: 7%; color: #ffd700; font-size: 1.35rem; animation-delay: 0.3s; }
.card-bg-star.cs7 { top: 26%; left: 12%; color: #ffc107; font-size: 1.15rem; animation-delay: 0.9s; }
.card-bg-star.cs8 { top: 28%; right: 13%; color: #ff4060; 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: #fff0f3;
  filter: drop-shadow(0 2px 14px rgba(255, 30, 70, 0.75));
  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: #ffe4e8;
  text-shadow: 0 2px 14px rgba(255, 30, 60, 0.5);
  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: 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: 8px;
  margin-top: 4px;
  z-index: 10;
}
.pill-btn {
  background: linear-gradient(135deg, #ff2a55 0%, #db0a36 50%, #94001d 100%);
  border: 1.5px solid rgba(255, 230, 240, 0.5);
  border-radius: 999px;
  padding: 10px 28px;
  min-height: 48px;
  min-width: clamp(110px, 30vw, 145px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 10px 28px rgba(255, 23, 68, 0.52),
    0 0 18px rgba(255, 23, 68, 0.22),
    inset 0 2px 2px rgba(255, 255, 255, 0.45),
    inset 0 -2px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.pill-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.6s ease;
}
.pill-btn:hover::before {
  left: 160%;
}
.pill-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    0 14px 34px rgba(255, 23, 68, 0.68),
    0 0 24px rgba(255, 215, 0, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 215, 0, 0.7);
}
.pill-btn:active {
  transform: scale(0.95) translateY(1px);
  box-shadow: 0 4px 12px rgba(255, 23, 68, 0.4);
}
.btn-label {
  font-family: 'Poppins', 'Fredoka', cursive, sans-serif;
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  font-weight: 700;
  color: #ffffff;
  border-bottom: none !important;
  text-decoration: none !important;
  line-height: 1.1;
  letter-spacing: 0.04em;
  padding-bottom: 0;
  text-shadow: 0 2px 8px rgba(100, 0, 20, 0.5);
  position: relative;
  z-index: 2;
}
.yes-btn {
  animation: btnRadiantPulse 2.4s infinite ease-in-out alternate;
}
@keyframes btnRadiantPulse {
  0% { box-shadow: 0 10px 28px rgba(255, 23, 68, 0.52), 0 0 14px rgba(255, 23, 68, 0.2); }
  100% { box-shadow: 0 14px 36px rgba(255, 23, 68, 0.75), 0 0 24px rgba(255, 215, 0, 0.4); }
}
.no-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 180, 200, 0.1) 100%) !important;
  border: 1.5px solid rgba(255, 180, 200, 0.45) !important;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}
.no-btn .btn-label {
  color: #ffd6df;
  text-shadow: none;
}
.no-btn:hover {
  background: rgba(255, 255, 255, 0.24) !important;
  border-color: rgba(255, 215, 225, 0.8) !important;
}
.btn-shine-tr,
.btn-shine-bl {
  display: none !important;
}
.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,.75) 0%, rgba(255,23,68,0.45) 35%, transparent 70%); pointer-events: none; opacity: 0; }
#midnight-burst.flash { animation: burstFlash 1.6s ease-out forwards; }
@keyframes burstFlash { 0%{opacity:0;transform:scale(.2)} 20%{opacity:1;transform:scale(1.18);filter:brightness(1.4)} 60%{opacity:.85;transform:scale(1)} 100%{opacity:0} }

/* ─── CUTE CONFETTI SYSTEM (SMOOTH TOP-TO-BOTTOM GLITTER & HEARTS) ─── */
.confetti-piece {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  animation: confettiSmoothFall var(--cf-d, 3.2s) linear var(--cf-delay, 0s) forwards;
  user-select: none;
  font-size: var(--cf-sz, 20px);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(255, 105, 180, 0.45);
}

.confetti-piece .cf-content {
  display: inline-block;
  transform: rotate(var(--cf-r0, 0deg));
}

/* Smooth 100% Top-to-Bottom Falling Animation with gentle organic sway */
@keyframes confettiSmoothFall {
  0% {
    opacity: 0;
    transform: translate3d(var(--cf-x, 50vw), -40px, 0) scale(0.7);
  }
  8% {
    opacity: 1;
  }
  50% {
    opacity: 0.95;
    transform: translate3d(calc(var(--cf-x, 50vw) + var(--cf-sway, 12px)), 50vh, 0) scale(1);
  }
  85% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--cf-x, 50vw) - var(--cf-sway, 12px)), 106vh, 0) scale(0.8);
  }
}



/* ─── ⭐ "10 REASONS WHY I LOVE YOU" STAR JAR SCREEN ─── */
#star-jar-screen {
  position: fixed; inset: 0; z-index: 104;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s ease;
  overflow-y: auto; overflow-x: hidden;
}
#star-jar-screen.show-screen {
  opacity: 1; pointer-events: auto;
}
#star-jar-screen.hidden-screen {
  opacity: 0; pointer-events: none;
}

.jar-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;
}
.jar-bg-star.jbs1 { top: 8%; left: 8%; color: #ffd700; font-size: 1.5rem; animation-delay: 0.1s; }
.jar-bg-star.jbs2 { top: 12%; right: 12%; color: #ff1744; font-size: 1.4rem; animation-delay: 0.8s; }
.jar-bg-star.jbs3 { top: 45%; left: 5%; color: #ffb300; font-size: 1.6rem; animation-delay: 1.4s; }
.jar-bg-star.jbs4 { top: 48%; right: 6%; color: #ff4d6d; font-size: 1.3rem; animation-delay: 0.5s; }
.jar-bg-star.jbs5 { bottom: 10%; left: 10%; color: #ff758f; font-size: 1.5rem; animation-delay: 1.2s; }
.jar-bg-star.jbs6 { bottom: 12%; right: 14%; color: #ffd700; font-size: 1.4rem; animation-delay: 0.3s; }

.star-jar-stage {
  width: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(14px, 2.5vh, 24px) 14px max(76px, calc(54px + env(safe-area-inset-bottom)));
  position: relative; z-index: 10;
  box-sizing: border-box;
}

.jar-header-wrap {
  text-align: center;
  margin-bottom: clamp(12px, 2vh, 18px);
}
.jar-mini-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.72rem, 1.8vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffd6df;
  background: rgba(220, 20, 60, 0.22);
  border: 1.5px solid rgba(255, 100, 130, 0.45);
  border-radius: 30px;
  padding: 4px 16px;
  box-shadow: 0 4px 14px rgba(255, 23, 68, 0.25);
  margin-bottom: 8px;
}
.jar-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 6px;
  text-shadow: 0 2px 16px rgba(255, 30, 70, 0.75);
}
.jar-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.82rem, 2.5vw, 0.95rem);
  color: #ffd6df;
  opacity: 0.95;
}

.jar-display-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin-bottom: clamp(14px, 2.5vh, 22px);
}

.glass-star-jar-wrap {
  flex: 0 0 auto;
  width: clamp(140px, 38vw, 175px);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.glass-star-jar-wrap:hover {
  transform: translateY(-8px) scale(1.03);
}
.glass-star-jar-wrap.jar-shake {
  animation: jarPopShake 0.45s ease-out;
}
@keyframes jarPopShake {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.06) rotate(-5deg); }
  50% { transform: scale(1.08) rotate(5deg); }
  75% { transform: scale(1.04) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.jar-cork {
  width: 55%;
  height: 22px;
  background: linear-gradient(180deg, #d4a373 0%, #bc6c25 100%);
  border-radius: 6px 6px 2px 2px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 3px 6px rgba(0,0,0,0.18);
  border: 1px solid #99582a;
}
.jar-neck {
  position: relative;
  width: 72%;
  height: 26px;
  background: linear-gradient(90deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.85) 100%);
  border: 2px solid rgba(255,255,255,0.9);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 2px 8px rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.jar-ribbon-band {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 10px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #f472b6, #ec4899, #f472b6);
  box-shadow: 0 2px 4px rgba(236, 72, 153, 0.35);
}
.jar-ribbon-bow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
  z-index: 3;
}
.jar-ribbon-tag {
  position: absolute;
  top: 85%;
  right: -18px;
  font-family: 'Great Vibes', cursive;
  font-size: 0.95rem;
  color: #9d174d;
  background: #fffdf5;
  border: 1px dashed #f472b6;
  border-radius: 6px;
  padding: 2px 8px;
  transform: rotate(12deg);
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  z-index: 4;
}

.jar-glass-body {
  position: relative;
  width: 100%;
  height: clamp(150px, 22vh, 180px);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.72) 0%, 
    rgba(255, 245, 250, 0.4) 30%, 
    rgba(255, 230, 242, 0.25) 70%, 
    rgba(255, 255, 255, 0.65) 100%
  );
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px 18px 36px 36px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 
    inset 0 0 24px rgba(255, 255, 255, 0.7),
    inset -6px -6px 16px rgba(244, 114, 182, 0.22),
    0 16px 36px rgba(244, 114, 182, 0.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.jar-glass-glare-left {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 14%;
  height: 75%;
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.15) 100%);
  border-radius: 20px;
  pointer-events: none;
}
.jar-glass-glare-right {
  position: absolute;
  top: 15%;
  right: 8%;
  width: 7%;
  height: 55%;
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 20px;
  pointer-events: none;
}
.jar-fairy-glow {
  position: absolute;
  bottom: 10%;
  left: 15%;
  right: 15%;
  height: 50%;
  background: radial-gradient(ellipse at center, rgba(254, 240, 138, 0.5) 0%, rgba(244, 114, 182, 0.25) 50%, transparent 75%);
  filter: blur(12px);
  pointer-events: none;
}

.jar-stars-interior {
  position: relative;
  width: 100%;
  height: 80%;
  pointer-events: auto;
}
.jar-mini-star {
  position: absolute;
  width: clamp(34px, 4.5vw, 42px);
  height: clamp(34px, 4.5vw, 42px);
  cursor: pointer;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s;
  animation: miniStarFloat var(--ms-dur, 4s) ease-in-out infinite alternate var(--ms-del, 0s);
}
.jar-mini-star:hover {
  transform: scale(1.3) rotate(15deg);
  filter: drop-shadow(0 6px 14px var(--star-col));
  z-index: 10;
}
.jar-mini-star svg {
  width: 100%;
  height: 100%;
  display: block;
}

.jar-mini-star.star-pos-1  { bottom: 12%; left: 16%; --ms-dur: 3.8s; --ms-del: 0s; transform: rotate(-8deg); }
.jar-mini-star.star-pos-2  { bottom: 10%; left: 44%; --ms-dur: 4.2s; --ms-del: 0.6s; transform: rotate(12deg); }
.jar-mini-star.star-pos-3  { bottom: 15%; right: 14%; --ms-dur: 3.5s; --ms-del: 1.2s; transform: rotate(-15deg); }
.jar-mini-star.star-pos-4  { bottom: 32%; left: 22%; --ms-dur: 4.6s; --ms-del: 0.3s; transform: rotate(8deg); }
.jar-mini-star.star-pos-5  { bottom: 35%; right: 26%; --ms-dur: 3.9s; --ms-del: 1.5s; transform: rotate(-10deg); }
.jar-mini-star.star-pos-6  { bottom: 48%; left: 38%; --ms-dur: 4.4s; --ms-del: 0.9s; transform: rotate(20deg); }
.jar-mini-star.star-pos-7  { bottom: 52%; left: 14%; --ms-dur: 3.7s; --ms-del: 1.8s; transform: rotate(-6deg); }
.jar-mini-star.star-pos-8  { bottom: 56%; right: 16%; --ms-dur: 4.1s; --ms-del: 0.4s; transform: rotate(14deg); }
.jar-mini-star.star-pos-9  { bottom: 68%; left: 28%; --ms-dur: 4.5s; --ms-del: 1.1s; transform: rotate(-12deg); }
.jar-mini-star.star-pos-10 { bottom: 70%; right: 24%; --ms-dur: 3.6s; --ms-del: 1.6s; transform: rotate(6deg); }

@keyframes miniStarFloat {
  0% { transform: translateY(0) rotate(var(--ms-r0, 0deg)); }
  100% { transform: translateY(-7px) rotate(calc(var(--ms-r0, 0deg) + 6deg)); }
}

.jar-tap-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1.5px solid rgba(255, 255, 255, 0.9);
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #db2777;
}
.prompt-hand {
  animation: tapHandBounce 1.4s ease-in-out infinite;
}
@keyframes tapHandBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.unfolded-card-wrap {
  width: 100%;
  max-width: 520px;
  perspective: 1000px;
}
.unfolded-card-inner {
  position: relative;
  background: rgba(28, 2, 7, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 2px solid rgba(255, 70, 100, 0.45);
  padding: clamp(22px, 3.5vh, 34px) clamp(20px, 3vw, 32px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(220, 20, 60, 0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.unfolded-card-inner.flip-in {
  animation: starCardFlipIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes starCardFlipIn {
  0% { transform: rotateY(70deg) scale(0.9); opacity: 0; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.card-washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: rgba(220, 20, 60, 0.65);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-left: 2px dashed rgba(255,255,255,0.7);
  border-right: 2px dashed rgba(255,255,255,0.7);
}

.star-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  border-bottom: 1.5px dashed rgba(255, 100, 130, 0.4);
  padding-bottom: 12px;
}
.star-card-icon {
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}
.star-card-meta {
  flex: 1;
}
.star-card-number {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffd6df;
  background: rgba(255, 23, 68, 0.25);
  border: 1px solid rgba(255, 80, 110, 0.4);
  border-radius: 12px;
  padding: 2px 8px;
  margin-bottom: 4px;
}
.star-card-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(255, 30, 70, 0.4);
}

.star-card-body {
  margin-bottom: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
}
.star-card-text {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  line-height: 1.65;
  color: #ffe4e9;
}

.star-card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1.5px dashed rgba(255, 100, 130, 0.4);
  padding-top: 14px;
}
.star-nav-btn {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.82rem, 2.4vw, 0.94rem);
  font-weight: 700;
  color: #fff0f3;
  background: linear-gradient(135deg, rgba(45, 4, 12, 0.88) 0%, rgba(22, 2, 7, 0.96) 100%);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 80, 110, 0.45);
  border-radius: 999px;
  padding: 8px 18px;
  min-height: 40px;
  min-width: 82px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.star-nav-btn:hover {
  background: linear-gradient(135deg, #ff2a55, #c62828);
  color: #ffffff;
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 23, 68, 0.55), 0 0 14px rgba(255, 215, 0, 0.35);
}
.star-nav-btn:active {
  transform: scale(0.94);
}

.star-dots-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.star-dot {
  font-size: 1.15rem;
  padding: 3px;
  color: rgba(255, 150, 175, 0.38);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.star-dot:hover {
  transform: scale(1.35);
  color: #ffd700;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}
.star-dot.active {
  color: #ffd700;
  transform: scale(1.3);
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.85));
}
.star-dot.viewed {
  color: #ff2a55;
}

.jar-footer-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.jar-counter-pill {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffd6df;
  background: rgba(28, 2, 7, 0.88);
  border: 1.5px solid rgba(255, 80, 110, 0.4);
  border-radius: 30px;
  padding: 6px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.proceed-to-gifts-btn {
  width: auto;
  max-width: min(92vw, 360px);
  min-height: 52px;
  height: auto !important;
  padding: 13px 30px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #ff2453 0%, #db0a36 45%, #8c0019 100%) !important;
  color: #ffffff !important;
  border: 1.8px solid rgba(255, 215, 0, 0.75) !important;
  box-shadow: 
    0 10px 30px rgba(255, 23, 68, 0.6),
    0 0 20px rgba(255, 215, 0, 0.4),
    inset 0 2px 2px rgba(255, 255, 255, 0.5);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  animation: btnGlowPulse 2.4s ease-in-out infinite;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}
.proceed-to-gifts-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #ffd700 !important;
  box-shadow: 
    0 16px 36px rgba(255, 23, 68, 0.75),
    0 0 28px rgba(255, 215, 0, 0.65),
    inset 0 2px 3px rgba(255, 255, 255, 0.7);
}
.proceed-to-gifts-btn:active {
  transform: scale(0.96) translateY(1px);
}
.proceed-to-gifts-btn .btn-label {
  font-family: 'Poppins', sans-serif !important;
  font-size: clamp(0.92rem, 3.4vw, 1.08rem) !important;
  font-weight: 700 !important;
  border-bottom: none !important;
  white-space: normal !important;
  text-align: center;
  line-height: 1.25;
  color: #ffffff !important;
  letter-spacing: 0.02em;
}
@keyframes btnGlowPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(255, 23, 68, 0.45); }
  50% { box-shadow: 0 10px 30px rgba(255, 23, 68, 0.75); }
}

@media (max-width: 768px) {
  .jar-display-row {
    flex-direction: column;
    gap: 16px;
  }
  .glass-star-jar-wrap {
    flex: 0 0 auto;
    width: 170px;
  }
  .jar-glass-body {
    height: 180px;
  }
  .unfolded-card-wrap {
    width: 100%;
    max-width: 100%;
  }
  .unfolded-card-inner {
    padding: 16px 14px;
  }
  .star-card-body {
    min-height: 55px;
  }
  .jar-title {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    line-height: 1.25;
  }
}

/* ─── MYSTERY GIFT BOXES SCREEN (3 FLOATING HEART BOXES) ─── */
#gift-screen {
  position: fixed; inset: 0; z-index: 105;
  background: transparent;
  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: #ffd700; font-size: 1.5rem; animation-delay: 0s; }
.gift-bg-star.gs2 { top: 14%; left: 24%; color: #ff1744; 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: #ff4d6d; font-size: 1.4rem; animation-delay: 0.3s; }
.gift-bg-star.gs5 { top: 48%; left: 4%; color: #ff758f; font-size: 1.35rem; animation-delay: 1.5s; }
.gift-bg-star.gs6 { top: 52%; right: 5%; color: #ffd700; font-size: 1.4rem; animation-delay: 0.9s; }
.gift-bg-star.gs7 { bottom: 12%; left: 8%; color: #ffc107; font-size: 1.5rem; animation-delay: 0.2s; }
.gift-bg-star.gs8 { bottom: 20%; left: 22%; color: #ff4060; font-size: 1.2rem; animation-delay: 1.8s; }
.gift-bg-star.gs9 { bottom: 18%; right: 21%; color: #ff1744; font-size: 1.5rem; animation-delay: 0.7s; }
.gift-bg-star.gs10 { bottom: 9%; right: 9%; color: #ffd700; font-size: 1.35rem; animation-delay: 1.3s; }

.gift-stage {
  width: 100%; height: 100%; max-width: 440px;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.5vh, 24px) clamp(10px, 2.5vw, 16px) max(76px, calc(54px + env(safe-area-inset-bottom)));
  position: relative; z-index: 5; box-sizing: border-box;
}

/* 3 Heart Mystery Boxes Row */
.mystery-boxes-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 2.5vw, 16px);
  width: 100%;
  margin: auto 0;
  flex-wrap: nowrap;
}
.mystery-box-item {
  flex: 1 1 0;
  max-width: 130px;
  min-width: 80px;
  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;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 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: rgba(28, 2, 7, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 36px 36px 22px 22px;
  border: 2.5px solid rgba(255, 60, 90, 0.45);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(220, 20, 60, 0.35);
  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 45px rgba(255, 23, 68, 0.5);
}
@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: #ffd700; animation-delay: 0.3s;
}
.cameo-decor-star.c-star2 {
  top: 8px; right: 14px; color: #ff1744; 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: #ffffff;
  margin: 0;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-shadow: 0 2px 16px rgba(255, 30, 70, 0.8), 0 0 35px rgba(220, 20, 60, 0.45);
}
.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: #ffd6df;
  margin: 4px 0 0;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(255, 30, 70, 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: radial-gradient(ellipse at 50% 50%, #2b020a 0%, #150005 60%, #060002 100%);
  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 0 6px rgba(255, 23, 68, 0.45));
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
  user-select: none;
}
.mem-bg-star.mbs1 { top: 6%; left: 6%; color: #ffd700; font-size: 1.5rem; animation-delay: 0s; }
.mem-bg-star.mbs2 { top: 12%; left: 22%; color: #ff1744; 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: #ff4d6d; font-size: 1.4rem; animation-delay: 0.3s; }
.mem-bg-star.mbs5 { top: 48%; left: 3%; color: #ff758f; font-size: 1.35rem; animation-delay: 1.5s; }
.mem-bg-star.mbs6 { top: 52%; right: 4%; color: #ffd700; font-size: 1.4rem; animation-delay: 0.9s; }
.mem-bg-star.mbs7 { bottom: 10%; left: 7%; color: #ff1744; font-size: 1.5rem; animation-delay: 0.2s; }
.mem-bg-star.mbs8 { bottom: 18%; left: 20%; color: #ff85a1; font-size: 1.2rem; animation-delay: 1.8s; }
.mem-bg-star.mbs9 { bottom: 16%; right: 19%; color: #ff4d6d; font-size: 1.5rem; animation-delay: 0.7s; }
.mem-bg-star.mbs10 { bottom: 8%; right: 8%; color: #ffb300; 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: 440px;
  height: auto; max-height: 92dvh;
  margin: 0 auto;
  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(14px, 2vh, 20px) 12px;
  box-sizing: border-box;
  animation: clotheslineDropIn 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@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: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  width: 38px; height: 38px; min-width: 38px; min-height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 90, 120, 0.45);
  background: rgba(35, 4, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff0f3; font-size: 1.15rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease;
  z-index: 25;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.memories-board-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: #ff1744;
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.7);
}

/* 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: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(45, 4, 12, 0.9) 0%, rgba(20, 1, 6, 0.98) 100%);
  backdrop-filter: blur(14px);
  color: #ffd700;
  border: 1.8px solid rgba(255, 215, 0, 0.65);
  font-size: 1.25rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 14px rgba(255, 215, 0, 0.3);
  z-index: 12;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.track-arrow-btn:hover {
  transform: translateY(-50%) scale(1.14);
  background: linear-gradient(135deg, #ff2a55, #c62828);
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(255, 23, 68, 0.7), 0 0 20px rgba(255, 215, 0, 0.6);
}
.track-arrow-btn:active {
  transform: translateY(-50%) scale(0.94);
}
.track-arrow-btn.arrow-prev {
  left: 12px;
}
.track-arrow-btn.arrow-next {
  right: 12px;
}

/* 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: radial-gradient(ellipse at 50% 50%, #2b020a 0%, #150005 60%, #060002 100%);
  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 0 6px rgba(255, 23, 68, 0.45));
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
  user-select: none;
}
.cake-bg-star.cks1 { top: 8%; left: 8%; color: #ffd700; font-size: 1.5rem; animation-delay: 0s; }
.cake-bg-star.cks2 { top: 12%; right: 10%; color: #ff1744; 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: #ff4d6d; font-size: 1.4rem; animation-delay: 0.3s; }
.cake-bg-star.cks5 { bottom: 12%; left: 10%; color: #ff758f; font-size: 1.35rem; animation-delay: 1.5s; }
.cake-bg-star.cks6 { bottom: 10%; right: 9%; color: #ffd700; font-size: 1.4rem; animation-delay: 0.9s; }
.cake-bg-star.cks7 { top: 25%; left: 18%; color: #ff1744; font-size: 1.2rem; animation-delay: 0.2s; }
.cake-bg-star.cks8 { bottom: 25%; right: 18%; color: #ff85a1; font-size: 1.2rem; animation-delay: 1.8s; }

/* Cake Card Container */
.cake-card-container {
  position: relative; z-index: 5;
  width: 95vw; max-width: 440px;
  max-height: 92dvh;
  margin: 0 auto;
  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(10px, 1.8vh, 16px) clamp(10px, 2.5vw, 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-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.cake-card-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  width: 38px; height: 38px; min-width: 38px; min-height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 90, 120, 0.45);
  background: rgba(35, 4, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff0f3; font-size: 1.15rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease;
  z-index: 45;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cake-card-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: #ff1744;
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.7);
}

/* 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: 2.5px solid #ff7597;
  border-radius: 22px;
  padding: clamp(10px, 1.8vh, 14px) clamp(12px, 2.5vw, 20px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-sizing: border-box;
}
.wish-main-text {
  width: 100%;
  font-family: 'Fredoka', 'Poppins', sans-serif;
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  color: #8c1932;
  font-weight: 600;
  margin: 0;
  text-align: center;
  line-height: 1.42;
}
.wish-actions-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
  box-sizing: border-box;
}
.wish-secondary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
}
.cake-btn-again, .cake-btn-back {
  flex: 1 1 140px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.85rem, 2.2vw, 0.94rem);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-sizing: border-box;
  touch-action: manipulation;
}
.cake-btn-again {
  background: linear-gradient(135deg, #ff2a55 0%, #c21034 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 6px 20px rgba(255, 23, 68, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}
.cake-btn-again:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #ffd700;
  box-shadow: 0 10px 26px rgba(255, 23, 68, 0.6), 0 0 16px rgba(255, 215, 0, 0.4);
}
.cake-btn-back {
  background: rgba(35, 4, 12, 0.85);
  color: #ffd6df;
  border: 1.5px solid rgba(255, 100, 130, 0.45);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.cake-btn-back:hover {
  transform: translateY(-2px) scale(1.03);
  background: rgba(55, 6, 20, 0.95);
  border-color: #ff4d6d;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(255, 23, 68, 0.35);
}

.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: 14px; right: 16px;
  width: 36px; height: 36px;
  background: rgba(40, 4, 12, 0.75);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 90, 120, 0.45);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff0f3;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease;
  z-index: 20;
}
.modal-close-btn:hover {
  transform: scale(1.15) rotate(90deg);
  background: #ff1744;
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.7);
}
.modal-close-btn:active {
  transform: scale(0.92) rotate(90deg);
}
.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: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700; color: #b71c1c;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.gift-modal-desc {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.12rem);
  color: #3b0712; line-height: 1.6;
  margin: 0 0 22px;
}
.modal-action-btn {
  background: linear-gradient(135deg, #ff2a55 0%, #d80032 50%, #880017 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 215, 0, 0.65);
  border-radius: 999px;
  padding: 12px 34px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem; font-weight: 700; cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 25px rgba(255, 23, 68, 0.52), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.modal-action-btn:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: #ffd700;
  box-shadow: 0 12px 30px rgba(255, 23, 68, 0.7), 0 0 18px rgba(255, 215, 0, 0.4);
}
.modal-action-btn:active {
  transform: scale(0.95) translateY(1px);
}


/* ─── SPECIAL BOX 3: LOVE & BIRTHDAY LETTER MODAL (MATCHING REFERENCE IMAGE) ─── */
.letter-screen-overlay {
  position: fixed; inset: 0; z-index: 125;
  background: radial-gradient(ellipse at 50% 50%, #2b020a 0%, #150005 60%, #060002 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, 77, 109, 0.7);
  font-family: serif; user-select: none; pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.6));
  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: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  background: linear-gradient(135deg, rgba(35, 4, 12, 0.84) 0%, rgba(18, 1, 5, 0.94) 100%);
  color: #fff0f3;
  border: 1.5px solid rgba(255, 75, 110, 0.45);
  border-radius: 999px;
  padding: 8px 20px;
  min-height: 38px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 23, 68, 0.2);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.letter-back-btn:hover {
  background: linear-gradient(135deg, rgba(55, 6, 20, 0.95) 0%, rgba(30, 2, 9, 0.98) 100%);
  border-color: rgba(255, 215, 0, 0.75);
  color: #ffffff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.68), 0 0 18px rgba(255, 23, 68, 0.4);
}
.letter-back-btn:active {
  transform: scale(0.95);
}

/* Two-Column Letter Container */
.letter-card-container {
  position: relative; z-index: 5;
  width: 95vw; max-width: 440px;
  max-height: 92dvh;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 16px;
  padding: 44px 14px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: letterCardPop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-sizing: border-box;
}
@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: 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(160, 135, 195, 0.35);
  display: flex; align-items: center; justify-content: center;
}

.letter-photo-inner {
  width: clamp(105px, 26vw, 135px);
  aspect-ratio: 1 / 1;
  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: -16px; left: -16px;
  width: 52px; height: 52px;
  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); }
}

/* ─── 📱 DOWNLOADABLE INSTAGRAM STORY (1080x1920 PNG) ─── */
.letter-cert-btn-wrap {
  margin-top: clamp(20px, 3vh, 32px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-cert-btn-wrap.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.letter-cert-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 46px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #fff2be 0%, #f7c948 40%, #e09612 100%);
  color: #4a2205;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.88rem, 3vw, 1.02rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid #fffdf0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(224, 150, 18, 0.45), 0 3px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.letter-cert-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(224, 150, 18, 0.65), 0 4px 12px rgba(0, 0, 0, 0.3);
  filter: brightness(1.04);
}

.letter-cert-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 14px rgba(224, 150, 18, 0.4);
}

.letter-cert-btn.is-loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.cert-btn-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: certBtnSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes certBtnSweep {
  0%, 60% { left: -100%; }
  100% { left: 200%; }
}

.cert-btn-icon {
  font-size: 1.25em;
  line-height: 1;
}

.cert-btn-label {
  white-space: nowrap;
}

/* ─── CERTIFICATE PREVIEW & DOWNLOAD MODAL DIALOG ─── */
.cert-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(14, 5, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 1;
  transition: opacity 0.35s ease;
}

.cert-modal-overlay.hidden {
  display: none !important;
  opacity: 0;
}

.cert-modal-dialog {
  position: relative;
  width: 100%;
  max-width: min(92vw, 420px);
  max-height: 94vh;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 0%, #2b020a 0%, #150005 60%, #060002 100%);
  border: 1.5px solid rgba(255, 50, 80, 0.45);
  border-radius: 24px;
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 23, 68, 0.3);
  color: #ffffff;
  text-align: center;
  animation: certModalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes certModalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(18px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.cert-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 4, 12, 0.75);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 90, 120, 0.45);
  border-radius: 50%;
  color: #fff0f3;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease;
  z-index: 20;
}

.cert-modal-close:hover {
  background: #ff1744;
  border-color: #ffd700;
  color: #ffffff;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.7);
}

.cert-modal-header {
  margin-bottom: 12px;
}

.cert-modal-sparkle {
  display: inline-block;
  font-size: 2.2rem;
  margin-bottom: 4px;
  animation: sparkleWiggle 2s ease-in-out infinite alternate;
}

@keyframes sparkleWiggle {
  0% { transform: rotate(-8deg) scale(1); }
  100% { transform: rotate(8deg) scale(1.08); }
}

.cert-modal-title {
  font-family: 'Fredoka', 'Poppins', sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: #fff0f3;
  margin: 0 0 4px;
  text-shadow: 0 2px 10px rgba(255, 23, 68, 0.5);
}

.cert-modal-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.82rem, 1.1vw, 0.9rem);
  color: #ffd6df;
  opacity: 0.9;
  margin: 0;
}

.cert-modal-preview-frame {
  position: relative;
  width: auto;
  max-width: 290px;
  aspect-ratio: 9 / 16;
  max-height: 56vh;
  margin: 12px auto 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 23, 68, 0.35);
  background: #0f0514;
}

.cert-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cert-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cert-action-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-action-share-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.65);
}

.cert-action-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  background: linear-gradient(135deg, #ff1744 0%, #d50000 50%, #99001a 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 23, 68, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-action-download-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(255, 23, 68, 0.65);
}

.cert-action-dismiss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cert-action-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cert-mobile-tip {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #fed7aa;
  opacity: 0.9;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .letter-cert-btn {
    padding: 10px 18px;
    font-size: 0.86rem;
    width: 100%;
    max-width: 320px;
  }
  .cert-btn-label {
    white-space: normal;
    text-align: center;
  }
  .cert-modal-dialog {
    padding: 16px 12px;
  }
  .cert-action-share-btn,
  .cert-action-download-btn,
  .cert-action-dismiss-btn {
    width: 100%;
    font-size: 0.9rem;
    padding: 10px 18px;
  }
}

/* ─── 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) ─── */
/* ─── COMPREHENSIVE RESPONSIVE MOBILE SUITE (PORTRAIT & LANDSCAPE) ─── */
@media (max-width: 768px) {
  /* 0. GPU Fill-rate Optimization: Lightweight backdrop-filter on mobile */
  .quiz-card,
  .unfolded-card-inner,
  .memories-board-container,
  .cake-card-container,
  .letter-card-container,
  .cert-modal-dialog,
  .minimal-hud-btn,
  .clock-plate,
  .cert-modal-overlay {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* Universal Touch Responsiveness */
  button, .key-btn, .pill-btn, .star-nav-btn, .candle-item, .mystery-box-item, .sky-lantern {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* 1. Mobile Lockscreen Keypad & Rosette Cameo */
  .quiz-card {
    flex-direction: column;
    width: 100%; height: 100%;
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .quiz-visual-side {
    flex: 0 0 auto;
    width: 100%;
    max-height: 25vh;
    padding: 10px 10px 2px;
  }
  .rosette-cameo {
    width: clamp(120px, 28vw, 155px);
    aspect-ratio: 1 / 1;
    height: auto;
  }
  .shinchan-box {
    width: 72%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 10px;
  }
  .quiz-input-side {
    flex: 1 1 auto;
    width: 100%;
    padding: 4px 12px 18px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .torn-deckle { display: none; }
  .passcode-header { margin-bottom: 6px; }
  #quiz-title { font-size: clamp(1.15rem, 4.2vw, 1.45rem); }
  .passcode-subtext { font-size: clamp(0.78rem, 2.8vw, 0.9rem); }
  .passcode-boxes-wrap {
    margin: 4px 0 12px;
    gap: 8px;
  }
  .passcode-box {
    width: clamp(38px, 11vw, 44px);
    height: clamp(40px, 12vw, 46px);
    font-size: 1.3rem;
  }
  .keypad {
    grid-template-columns: repeat(3, clamp(48px, 13vw, 58px));
    gap: clamp(6px, 1.4vh, 10px) clamp(10px, 3.6vw, 18px);
  }
  .key-btn {
    width: clamp(48px, 13vw, 58px);
    height: clamp(48px, 13vw, 58px);
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  }

  /* 2. Mobile Surprise Yes/No Card Screen */
  .surprise-paper-card {
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 100dvh;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: max(16px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .curved-title-wrap {
    max-height: clamp(65px, 14vh, 95px);
  }
  .arched-text {
    font-size: 54px;
  }
  .arched-text.excited-mode {
    font-size: 58px;
  }
  .dance-gif-wrap {
    max-height: clamp(140px, 36vh, 260px);
  }
  .surprise-btn-group {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .pill-btn {
    min-width: clamp(100px, 28vw, 135px);
    padding: 7px 18px;
  }
  .btn-label {
    font-size: 1.35rem;
  }

  /* 3. Mobile Star Jar Screen */
  #star-jar-screen {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .star-jar-stage {
    margin: 0 auto;
    padding: 12px 10px 30px;
    width: 100%;
  }
  .jar-display-row {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
  }
  .glass-star-jar-wrap {
    flex: 0 0 auto;
    width: clamp(140px, 40vw, 180px);
  }
  .jar-glass-body {
    height: 160px;
  }
  .unfolded-card-wrap {
    width: 100%;
    max-width: 100%;
  }
  .unfolded-card-inner {
    padding: 14px 12px;
    border-radius: 18px;
  }
  .star-card-body {
    min-height: 50px;
    margin-bottom: 12px;
  }
  .star-card-text {
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
  }
  .jar-title {
    font-size: clamp(1.15rem, 4.8vw, 1.45rem);
    line-height: 1.25;
  }

  /* 4. Mobile Mystery Gifts Screen & 3 Boxes */
  .gift-stage {
    padding: clamp(10px, 2vh, 20px) clamp(8px, 2vw, 16px);
    height: 100%;
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: space-evenly;
  }
  .mystery-boxes-row {
    gap: clamp(6px, 2vw, 14px);
    margin: 8px auto;
    width: 100%;
    max-width: 460px;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .mystery-box-item {
    flex: 1 1 0;
    max-width: 125px;
    min-width: 80px;
  }
  .heart-box-svg {
    max-height: clamp(90px, 16vh, 135px);
  }
  .mystery-shinchan-frame {
    margin: 0 auto clamp(4px, 1vh, 10px);
  }
  .shinchan-cameo-inner {
    width: clamp(150px, 40vw, 210px);
    height: clamp(100px, 14vh, 145px);
  }
  .mystery-title {
    font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  }
  .mystery-subtitle {
    font-size: clamp(0.95rem, 3.2vw, 1.3rem);
  }

  /* 5. Mobile Clothesline Memories Board */
  .memories-board-container {
    width: 95vw;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 6px 10px;
    border-radius: 20px;
  }
  .clothesline-photos-track {
    padding: 16px 12px 10px;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }
  .hanging-polaroid-item {
    scroll-snap-align: center;
    flex: 0 0 clamp(160px, 50vw, 195px);
  }
  .track-arrow-btn {
    width: 34px; height: 34px;
    font-size: 0.95rem;
  }
  .vintage-camera-deco {
    display: none;
  }

  /* 6. Mobile Birthday Cake Modal & Action Buttons */
  .cake-card-container {
    width: 95vw;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px 8px 14px;
    border-radius: 20px;
  }
  .cake-interactive-stage {
    max-width: 100%;
    aspect-ratio: 920 / 580;
    max-height: 38vh;
    height: auto;
    cursor: pointer;
  }
  .wish-ribbon-card {
    padding: 8px 10px;
    gap: 6px;
    border-radius: 16px;
  }
  .wish-main-text {
    font-size: clamp(0.82rem, 2.5vw, 0.94rem);
    line-height: 1.35;
  }
  .cake-btn-lanterns {
    max-width: 300px;
    padding: 9px 14px;
    font-size: clamp(0.84rem, 2.7vw, 0.96rem);
    min-height: 40px;
  }
  .wish-secondary-row {
    max-width: 300px;
    gap: 6px;
  }
  .cake-btn-again, .cake-btn-back {
    flex: 1 1 110px;
    min-height: 34px;
    padding: 5px 8px;
    font-size: clamp(0.75rem, 2.3vw, 0.85rem);
    white-space: nowrap;
  }

  /* 7. Mobile Letter Modal */
  .letter-card-container {
    flex-direction: column;
    width: 95vw;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 42px 12px 18px;
    border-radius: 20px;
  }
  .letter-photo-inner {
    width: clamp(95px, 26vw, 125px);
    margin: 0 auto;
  }
  .letter-purple-bow {
    width: 44px; height: 44px;
    bottom: -12px; left: -12px;
  }
  .letter-headline {
    font-size: clamp(1.1rem, 3.4vw, 1.35rem);
    margin-bottom: 8px;
  }
  .letter-para {
    font-size: clamp(0.84rem, 2.5vw, 0.95rem);
    line-height: 1.5;
    margin-bottom: 10px;
  }

  /* 8. Mobile Story Card Modal (1080x1920) */
  .cert-modal-dialog {
    max-width: min(92vw, 360px);
    max-height: 90vh;
    max-height: 90dvh;
    padding: 14px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cert-modal-preview-frame {
    max-width: 230px;
    max-height: 46vh;
    max-height: 46dvh;
  }

  /* 9. Mobile Floating HUD Controls (Audio & Replay) */
  .hud-group {
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
  .floating-audio-pill {
    bottom: 14px;
    right: 14px;
    padding: 6px 12px 6px 6px;
    gap: 7px;
  }
  .audio-disc-outer, .audio-vinyl-record {
    width: 26px; height: 26px;
  }
  .audio-track-title {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }
  .audio-status-sub {
    display: none;
  }

  /* 10. Mobile Close Buttons & Touch Ergonomics (iOS/Android Safe Area) */
  .memories-board-close,
  .cake-card-close,
  .cert-modal-close {
    width: 42px;
    height: 42px;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    font-size: 1.3rem;
  }
  .letter-back-btn {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    min-height: 42px;
    padding: 6px 20px;
    font-size: 0.95rem;
  }
  .lanterns-close-btn {
    min-height: 42px;
  }
  .lanterns-controls-bar {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  .lantern-wish-card {
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ─── MOBILE LANDSCAPE ORIENTATION SUPPORT ─── */
@media (max-height: 520px) {
  .quiz-card {
    flex-direction: row !important;
    align-items: center;
    padding: 6px 14px;
  }
  .quiz-visual-side {
    max-height: 90vh !important;
    width: 38% !important;
    padding: 6px;
  }
  .rosette-cameo {
    width: clamp(85px, 16vw, 115px) !important;
  }
  .quiz-input-side {
    width: 62% !important;
    padding: 6px 14px;
  }
  .passcode-boxes-wrap {
    margin: 2px 0 6px !important;
  }
  .keypad {
    grid-template-columns: repeat(3, 44px) !important;
    gap: 4px 10px !important;
  }
  .key-btn {
    width: 44px !important;
    height: 36px !important;
    font-size: 1.05rem !important;
  }
  .dance-gif-wrap {
    max-height: 120px !important;
  }
  .cake-interactive-stage {
    max-height: 44vh !important;
  }
  .letter-card-container {
    padding-top: 24px !important;
  }
  .jar-glass-body {
    height: 110px !important;
  }
}


    /* ─── SECURE ARCHITECTURE OVERLAYS & UI REFINEMENTS ─── */
    #protected-content-container {
      position: relative;
      width: 100%;
      height: 100%;
      z-index: 10;
    }

    /* ─── MINIMAL FLOATING CONTROLS HUD (REPLAY, LOCK & MUSIC) ─── */
    .floating-controls-dock {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 100;
      transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .hud-group {
      position: fixed;
      bottom: max(14px, env(safe-area-inset-bottom));
      display: flex;
      align-items: center;
      gap: 8px;
      pointer-events: auto;
      z-index: 100;
    }

    .hud-left {
      left: max(12px, env(safe-area-inset-left));
    }

    .hud-right {
      right: max(12px, env(safe-area-inset-right));
    }

    /* Minimal HUD Button Base */
    .minimal-hud-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      height: 38px;
      padding: 0 16px;
      border-radius: 999px;
      background: linear-gradient(135deg, rgba(35, 4, 12, 0.84) 0%, rgba(18, 1, 5, 0.94) 100%);
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      border: 1.5px solid rgba(255, 75, 110, 0.38);
      box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.65), 
        0 0 14px rgba(255, 23, 68, 0.2), 
        inset 0 1px 1.5px rgba(255, 255, 255, 0.3);
      color: #fff0f3;
      font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.03em;
      cursor: pointer;
      user-select: none;
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
      box-sizing: border-box;
      outline: none;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      position: relative;
      overflow: hidden;
    }

    .hud-btn-shimmer {
      position: absolute;
      top: 0; left: -100%; width: 50%; height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
      transform: skewX(-20deg);
      pointer-events: none;
      transition: left 0.5s ease;
    }
    .minimal-hud-btn:hover .hud-btn-shimmer {
      left: 150%;
    }

    .minimal-hud-btn:hover {
      background: linear-gradient(135deg, rgba(50, 6, 18, 0.94) 0%, rgba(28, 2, 8, 0.98) 100%);
      border-color: rgba(255, 90, 130, 0.85);
      color: #ffffff;
      transform: translateY(-2.5px);
      box-shadow: 
        0 12px 28px rgba(0, 0, 0, 0.72), 
        0 0 20px rgba(255, 23, 68, 0.45), 
        inset 0 1px 2px rgba(255, 255, 255, 0.45);
    }

    .minimal-hud-btn:active {
      transform: translateY(1px) scale(0.96);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    }

    .hud-btn-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      color: #ff4d6d;
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
    }

    /* Redesigned Lock Button Spec */
    .minimal-lock-btn {
      padding: 0 16px 0 14px;
    }
    .minimal-lock-btn .lock-icon-wrap {
      color: #ffd700;
      filter: drop-shadow(0 1px 4px rgba(255, 215, 0, 0.4));
    }
    .minimal-lock-btn:hover {
      border-color: rgba(255, 215, 0, 0.85);
    }
    .minimal-lock-btn:hover .lock-icon-wrap {
      transform: scale(1.18) rotate(-8deg);
      color: #ff1744;
      filter: drop-shadow(0 2px 8px rgba(255, 23, 68, 0.6));
    }

    /* Redesigned Music Button Spec */
    .minimal-music-btn {
      padding: 0 16px 0 13px;
    }
    .minimal-music-btn .music-icon-wrap {
      color: #ffd700;
      animation: hudDiscSpin 3.6s linear infinite;
    }
    @keyframes hudDiscSpin {
      100% { transform: rotate(360deg); }
    }
    .minimal-music-btn:hover .music-icon-wrap {
      color: #ffffff;
    }
    .minimal-music-btn .music-icon-wrap.paused {
      animation-play-state: paused;
      opacity: 0.55;
      filter: grayscale(1);
    }

    /* 4-Bar Dynamic Equalizer Wave */
    .minimal-eq-wave {
      display: flex;
      align-items: flex-end;
      gap: 2.5px;
      height: 14px;
      margin-left: 4px;
      flex-shrink: 0;
    }
    .minimal-eq-wave span {
      width: 2.5px;
      background: linear-gradient(to top, #ff1744 0%, #ffd700 100%);
      border-radius: 2px;
      box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
      animation: miniEqWave 0.75s ease-in-out infinite alternate;
    }
    .minimal-eq-wave .eq-b1 { height: 45%; animation-delay: 0.08s; }
    .minimal-eq-wave .eq-b2 { height: 100%; animation-delay: 0.28s; }
    .minimal-eq-wave .eq-b3 { height: 65%; animation-delay: 0.18s; }
    .minimal-eq-wave .eq-b4 { height: 85%; animation-delay: 0.38s; }
    .minimal-eq-wave.paused span {
      animation-play-state: paused;
      height: 25% !important;
      opacity: 0.35;
      box-shadow: none;
    }
    @keyframes miniEqWave {
      0% { height: 25%; }
      100% { height: 100%; }
    }

    /* Modal Isolation: Hide HUD when any modal is open */
    body.in-modal .floating-controls-dock,
    body.in-modal .hud-group {
      opacity: 0 !important;
      pointer-events: none !important;
      transform: translateY(14px) scale(0.95);
      transition: all 0.22s ease;
    }

    @media (max-width: 600px) {
      .hud-group {
        bottom: max(10px, env(safe-area-inset-bottom));
        gap: 6px;
      }
      .hud-left { left: max(10px, env(safe-area-inset-left)); }
      .hud-right { right: max(10px, env(safe-area-inset-right)); }
      .minimal-hud-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 11px;
        gap: 6px;
      }
    }

    @media (max-width: 375px) {
      .hud-group {
        bottom: max(8px, env(safe-area-inset-bottom));
        gap: 4px;
      }
      .hud-left { left: max(8px, env(safe-area-inset-left)); }
      .hud-right { right: max(8px, env(safe-area-inset-right)); }
      .minimal-lock-btn .hud-btn-label {
        display: none;
      }
      .minimal-lock-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
      }
      .minimal-music-btn {
        padding: 0 10px 0 8px;
        font-size: 10.5px;
      }
    }

    .passcode-hint-row {
      margin-top: 12px;
      font-size: 11px;
      color: #8e729a;
      font-family: 'Poppins', sans-serif;
      letter-spacing: 0.02em;
    }
    .passcode-hint-row button {
      background: rgba(255, 255, 255, 0.08);
      border: 1px dashed rgba(255, 120, 150, 0.55);
      border-radius: 999px;
      padding: 3px 12px;
      color: #ff8098;
      font-weight: 700;
      font-size: 11px;
      cursor: pointer;
      text-decoration: none !important;
      font-family: inherit;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: inline-block;
      margin-left: 5px;
    }
    .passcode-hint-row button:hover {
      background: rgba(255, 23, 68, 0.22);
      border-color: #ffd700;
      color: #ffffff;
      transform: translateY(-1px) scale(1.05);
      box-shadow: 0 4px 12px rgba(255, 23, 68, 0.35);
    }

    /* ─── SHINCHAN SPEECH BUBBLE & INTERACTION ─── */
    .mystery-shinchan-frame {
      cursor: pointer;
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .mystery-shinchan-frame:hover {
      transform: scale(1.08) translateY(-4px);
    }
    .mystery-shinchan-frame.wiggle {
      animation: shinchanWiggle 0.55s ease-in-out;
    }
    @keyframes shinchanWiggle {
      0%, 100% { transform: scale(1) rotate(0deg); }
      20% { transform: scale(1.12) rotate(-8deg); }
      40% { transform: scale(1.15) rotate(8deg); }
      60% { transform: scale(1.1) rotate(-5deg); }
      80% { transform: scale(1.05) rotate(4deg); }
    }

    .shinchan-speech-bubble {
      position: absolute;
      bottom: 112%;
      left: 50%;
      transform: translateX(-50%) scale(0.85);
      min-width: 210px;
      max-width: 290px;
      padding: 12px 18px;
      background: #ffffff;
      border: 2.5px solid #ff4081;
      border-radius: 20px;
      color: #212121;
      font-family: 'Poppins', sans-serif;
      font-size: 0.85rem;
      font-weight: 600;
      line-height: 1.45;
      text-align: center;
      box-shadow: 0 10px 25px rgba(255, 64, 129, 0.35), 0 4px 10px rgba(0,0,0,0.15);
      pointer-events: none;
      z-index: 80;
      opacity: 0;
      transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .shinchan-speech-bubble.show {
      opacity: 1;
      transform: translateX(-50%) scale(1);
    }
    .shinchan-speech-bubble::after {
      content: '';
      position: absolute;
      bottom: -10px;
      left: 50%;
      transform: translateX(-50%);
      width: 0; height: 0;
      border-left: 10px solid transparent;
      border-right: 10px solid transparent;
      border-top: 10px solid #ff4081;
    }
    .shinchan-speech-bubble::before {
      content: '';
      position: absolute;
      bottom: -7px;
      left: 50%;
      transform: translateX(-50%);
      width: 0; height: 0;
      border-left: 8px solid transparent;
      border-right: 8px solid transparent;
      border-top: 8px solid #ffffff;
      z-index: 1;
    }

    /* ─── CAKE WISH BANNER LANTERN BUTTON ─── */
    .cake-btn-lanterns {
      padding: 13px 28px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ff6584 0%, #ff1744 45%, #ff8f00 100%);
      color: #ffffff;
      font-family: 'Poppins', sans-serif;
      font-size: 1.02rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      border: 1.8px solid rgba(255, 215, 0, 0.75);
      cursor: pointer;
      box-shadow: 
        0 10px 30px rgba(255, 23, 68, 0.55), 
        0 0 20px rgba(255, 143, 0, 0.45),
        inset 0 2px 2px rgba(255, 255, 255, 0.45);
      transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
      animation: pulseGlowBtn 2.2s infinite ease-in-out alternate;
      touch-action: manipulation;
    }
    .cake-btn-lanterns:hover {
      transform: translateY(-2.5px) scale(1.04);
      border-color: #ffd700;
      box-shadow: 
        0 14px 38px rgba(255, 23, 68, 0.7), 
        0 0 28px rgba(255, 215, 0, 0.65);
    }
    .cake-btn-lanterns:active {
      transform: scale(0.96);
    }
    @keyframes pulseGlowBtn {
      0% { box-shadow: 0 8px 22px rgba(255, 23, 68, 0.45), 0 0 14px rgba(255, 143, 0, 0.35); }
      100% { box-shadow: 0 12px 32px rgba(255, 23, 68, 0.7), 0 0 24px rgba(255, 215, 0, 0.55); }
    }

    /* ─── MIDNIGHT SKY LANTERNS OVERLAY & FIREWORKS ─── */
    #lanterns-overlay {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      z-index: 120;
      background: radial-gradient(ellipse at 50% 85%, #180826 0%, #080312 60%, #030107 100%);
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.65s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding: 28px 16px;
    }
    #lanterns-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }
    .lanterns-sky-sparks {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      overflow: hidden;
      z-index: 1;
    }
    .sky-css-spark {
      position: absolute;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
      animation: skySparkTwinkle var(--spark-dur, 2s) ease-in-out var(--spark-del, 0s) infinite alternate;
      will-change: transform, opacity;
    }
    @keyframes skySparkTwinkle {
      0% { transform: scale(0.3); opacity: 0; }
      50% { transform: scale(1.4); opacity: 0.95; }
      100% { transform: scale(0.5); opacity: 0.15; }
    }
    .lanterns-header {
      position: relative;
      z-index: 10;
      text-align: center;
      margin-top: 10px;
      user-select: none;
    }
    .lanterns-title {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.4rem, 3.2vw, 2.4rem);
      font-weight: 700;
      color: #ffd54f;
      text-shadow: 0 0 18px rgba(255, 213, 79, 0.7), 0 2px 6px rgba(0,0,0,0.85);
      margin-bottom: 6px;
    }
    .lanterns-subtitle {
      font-family: 'Poppins', sans-serif;
      font-size: clamp(0.78rem, 1.4vw, 1rem);
      color: #f8bbd0;
      text-shadow: 0 1px 3px rgba(0,0,0,0.8);
      opacity: 0.95;
    }
    .lanterns-hint {
      font-family: 'Poppins', sans-serif;
      font-size: 0.82rem;
      color: #ffe082;
      opacity: 0.8;
      margin-top: 4px;
      font-style: italic;
    }
    .lanterns-controls-bar {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 35;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
      width: calc(100% - 32px);
      max-width: 640px;
    }

    .lanterns-story-btn {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 24px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ffd54f 0%, #ff8f00 50%, #e91e63 100%);
      color: #ffffff;
      font-family: 'Poppins', sans-serif;
      font-size: clamp(0.85rem, 1.2vw, 0.95rem);
      font-weight: 700;
      border: 1.5px solid rgba(255, 255, 255, 0.7);
      cursor: pointer;
      box-shadow: 0 8px 24px rgba(255, 143, 0, 0.45), 0 0 16px rgba(233, 30, 99, 0.35);
      overflow: hidden;
      transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .lanterns-story-btn:hover {
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 12px 30px rgba(255, 143, 0, 0.65), 0 0 24px rgba(233, 30, 99, 0.5);
    }

    .lanterns-story-btn:active {
      transform: translateY(1px) scale(0.98);
    }

    .lanterns-story-btn.is-loading {
      opacity: 0.85;
      cursor: wait;
      pointer-events: none;
    }

    .story-btn-shine {
      position: absolute;
      top: 0; left: -100%;
      width: 60%; height: 100%;
      background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0) 100%);
      transform: skewX(-25deg);
      animation: storyBtnSweep 3s ease-in-out infinite;
      pointer-events: none;
    }

    @keyframes storyBtnSweep {
      0%, 60% { left: -100%; }
      100% { left: 200%; }
    }

    .lanterns-close-btn {
      position: static;
      transform: none;
      z-index: 30;
      padding: 12px 26px;
      border-radius: 999px;
      background: linear-gradient(135deg, rgba(40, 6, 18, 0.88) 0%, rgba(20, 2, 8, 0.96) 100%);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1.8px solid rgba(255, 215, 0, 0.65);
      color: #ffd700;
      font-family: 'Poppins', sans-serif;
      font-size: clamp(0.88rem, 1.2vw, 0.98rem);
      font-weight: 700;
      letter-spacing: 0.03em;
      cursor: pointer;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 215, 0, 0.35);
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      touch-action: manipulation;
    }

    .lanterns-close-btn:hover {
      transform: translateY(-2.5px) scale(1.03);
      background: linear-gradient(135deg, #ff2a55 0%, #c62828 100%);
      border-color: #ffffff;
      color: #ffffff;
      box-shadow: 0 14px 34px rgba(255, 23, 68, 0.7), 0 0 24px rgba(255, 215, 0, 0.55);
    }
    .lanterns-close-btn:active {
      transform: scale(0.96);
    }

    .sky-lantern {
      position: absolute;
      width: 58px;
      height: 82px;
      background: radial-gradient(ellipse at 50% 75%, #fffde7 0%, #ffd54f 35%, #ff8f00 80%, #bf360c 100%);
      border-radius: 14px 14px 22px 22px / 20px 20px 26px 26px;
      box-shadow: 0 0 25px #ffb300, 0 0 55px rgba(255, 111, 0, 0.65), inset 0 -6px 12px rgba(255, 238, 88, 0.85);
      pointer-events: auto;
      cursor: pointer;
      z-index: 5;
      animation: floatLanternUpwards linear forwards, lanternSway 3.6s ease-in-out infinite alternate;
      transition: transform 0.3s ease, filter 0.3s ease;
    }
    .sky-lantern:hover {
      transform: scale(1.25) !important;
      filter: brightness(1.25) drop-shadow(0 0 35px #ffe082);
      z-index: 25;
    }
    .sky-lantern-flame {
      position: absolute;
      bottom: 6px;
      left: 50%;
      transform: translateX(-50%);
      width: 11px;
      height: 16px;
      background: #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 12px #ffffff, 0 0 20px #ffca28;
      animation: flameFlicker 1.2s infinite ease-in-out alternate;
    }
    .sky-lantern-rim {
      position: absolute;
      bottom: 0;
      left: 10%;
      right: 10%;
      height: 6px;
      background: #4e1d08;
      border-radius: 50%;
      border-top: 1.5px solid #ffe082;
    }
    .sky-lantern-tag {
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      width: 22px;
      height: 28px;
      background: #ffecb3;
      border: 1px solid #ffb300;
      border-radius: 2px 2px 6px 6px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      color: #e65100;
    }
    @keyframes floatLanternUpwards {
      0% { transform: translateY(105vh) scale(0.65); opacity: 0; }
      10% { opacity: 0.95; }
      90% { opacity: 0.95; }
      100% { transform: translateY(-30vh) scale(1.1); opacity: 0; }
    }
    @keyframes lanternSway {
      0% { margin-left: -20px; }
      100% { margin-left: 20px; }
    }

    #lantern-wish-modal {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.72);
      backdrop-filter: blur(8px);
      z-index: 150;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    #lantern-wish-modal.show {
      opacity: 1;
      pointer-events: auto;
    }
    .lantern-wish-card {
      max-width: 440px;
      width: 100%;
      padding: 34px 28px;
      border-radius: 24px;
      background: linear-gradient(145deg, #fffaf0, #fff3e0);
      border: 2px solid #ffd54f;
      box-shadow: 0 15px 45px rgba(255, 179, 0, 0.45), 0 0 25px rgba(255, 238, 88, 0.3);
      text-align: center;
      position: relative;
      transform: scale(0.9);
      transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #lantern-wish-modal.show .lantern-wish-card {
      transform: scale(1);
    }
    .lantern-wish-icon {
      font-size: 2.6rem;
      margin-bottom: 12px;
      display: inline-block;
      animation: starTwinkle 1.8s infinite ease-in-out alternate;
    }
    .lantern-wish-text {
      font-family: 'Playfair Display', serif;
      font-size: 1.25rem;
      font-style: italic;
      color: #6a1b1a;
      line-height: 1.6;
      margin-bottom: 22px;
    }
    .lantern-wish-close {
      padding: 10px 26px;
      border-radius: 999px;
      background: linear-gradient(135deg, #f43f5e, #e11d48);
      color: #fff;
      border: none;
      font-family: 'Poppins', sans-serif;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(225, 29, 72, 0.4);
      transition: all 0.2s ease;
    }
    .lantern-wish-close:hover {
      transform: scale(1.04);
      background: linear-gradient(135deg, #fb7185, #f43f5e);
    }

/* ==========================================================================
   ✨ 1. MIDNIGHT SCREEN SHAKE & GOLDEN SPARK SHOWER (COUNTDOWN STAGE)
   ========================================================================== */
@keyframes midnightScreenShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-7px, 5px) rotate(-1.2deg); }
  30% { transform: translate(7px, -5px) rotate(1.2deg); }
  45% { transform: translate(-5px, -3px) rotate(-0.8deg); }
  60% { transform: translate(5px, 3px) rotate(0.8deg); }
  75% { transform: translate(-3px, 2px) rotate(-0.4deg); }
  90% { transform: translate(2px, -1px) rotate(0.2deg); }
}

body.midnight-shake {
  animation: midnightScreenShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

#midnight-spark-shower {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 145;
  overflow: hidden;
}

.midnight-spark-particle {
  position: fixed;
  pointer-events: none;
  z-index: 146;
  user-select: none;
  color: var(--spk-col, #ffd700);
  text-shadow: 0 0 10px var(--spk-col, #ffd700), 0 0 20px rgba(255, 215, 0, 0.85);
  will-change: transform, opacity;
  animation: sparkShowerAnim var(--spk-dur, 1.1s) cubic-bezier(0.22, 1, 0.36, 1) var(--spk-delay, 0s) forwards;
}

@keyframes sparkShowerAnim {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) scale(0.3) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--spk-x) * 0.35), calc(var(--spk-y) * 0.25)) scale(1.35) rotate(60deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--spk-x), var(--spk-y)) scale(0.35) rotate(260deg);
  }
}

/* ==========================================================================
   💌 2. 3D RED WAX SEAL OPENING GATE (BOX 3 LETTER)
   ========================================================================== */
.wax-seal-wrapper {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(32, 6, 42, 0.92) 0%, rgba(15, 2, 20, 0.96) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  cursor: pointer;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s ease;
  user-select: none;
}

.wax-seal-wrapper.broken {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.08);
}

.wax-envelope-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 30px;
  text-align: center;
}

/* Authentic 3D Uneven Wax Seal Stamp */
.wax-seal-stamp {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 51% 49% 52% 48% / 48% 52% 48% 52%;
  background: radial-gradient(circle at 38% 30%, #ff2a4a 0%, #d90429 35%, #8d0801 75%, #4a0404 100%);
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.7),
    0 4px 12px rgba(217, 4, 41, 0.45),
    inset 0 4px 10px rgba(255, 210, 220, 0.55),
    inset 0 -8px 14px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  animation: waxPulseGlow 2.5s ease-in-out infinite alternate;
}

.wax-seal-stamp:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 
    0 20px 42px rgba(0, 0, 0, 0.8),
    0 0 28px rgba(255, 42, 74, 0.55),
    inset 0 4px 10px rgba(255, 210, 220, 0.65),
    inset 0 -8px 14px rgba(0, 0, 0, 0.75);
}

@keyframes waxPulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 35, 60, 0)); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 16px rgba(239, 35, 60, 0.5)); }
}

.wax-seal-inner {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 230, 235, 0.45);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 45% 32%, #b5179e 0%, #9d0208 40%, #6a040f 90%);
}

.wax-seal-initial {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff0f3;
  text-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.85),
    0 0 14px rgba(255, 210, 220, 0.8);
  line-height: 1;
  letter-spacing: 1px;
}

.wax-seal-stars-top,
.wax-seal-stars-bottom {
  font-size: 0.68rem;
  color: #ffccd5;
  opacity: 0.85;
  letter-spacing: 4px;
}

.wax-seal-stamp.cracking {
  animation: waxShatter 0.6s ease-out forwards;
}

@keyframes waxShatter {
  0% { transform: scale(1.06); }
  25% { transform: scale(1.18) rotate(-4deg); filter: brightness(1.35); }
  50% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(0.85); opacity: 0; filter: blur(6px); }
}

.wax-crumb-particle {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2a4a;
  box-shadow: 0 0 8px rgba(255, 42, 74, 0.8);
  z-index: 130;
  pointer-events: none;
  animation: waxCrumbFly 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes waxCrumbFly {
  0% { transform: translate(-50%, -50%) translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--wx-x), var(--wx-y)) scale(0.2); opacity: 0; }
}

.wax-seal-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffccd5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 180, 200, 0.3);
  padding: 10px 22px;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: hintBounce 1.8s ease-in-out infinite;
}

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

/* ==========================================================================
   🔤 3. LETTER FONT SELECTOR & TYPOGRAPHY STYLES (BOX 3 LETTER)
   ========================================================================== */
.letter-font-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px 14px;
  background: rgba(20, 4, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50px;
  width: fit-content;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}

.font-bar-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffccd5;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-right: 2px;
}

.font-pill-btn {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: 'Poppins', sans-serif;
}

.font-pill-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.font-pill-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  box-shadow: 0 2px 10px rgba(255, 77, 109, 0.5);
}

/* 1. Vintage Typewriter (Default) */
.letter-card-container.font-typewriter .letter-headline {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
}
.letter-card-container.font-typewriter .letter-para {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  line-height: 1.58;
}

/* 2. Romantic Cursive (Dancing Script / Great Vibes) */
.letter-card-container.font-cursive .letter-headline {
  font-family: 'Great Vibes', 'Dancing Script', cursive;
  font-size: clamp(2.2rem, 3.4vw, 3.2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.22;
}
.letter-card-container.font-cursive .letter-para {
  font-family: 'Dancing Script', 'Great Vibes', cursive;
  font-size: clamp(1.38rem, 1.88vw, 1.78rem);
  font-weight: 600;
  line-height: 1.48;
  letter-spacing: 0.015em;
}

/* 3. Cute Casual Handwriting (Caveat) */
.letter-card-container.font-handwriting .letter-headline {
  font-family: 'Caveat', 'Comic Neue', cursive;
  font-size: clamp(1.95rem, 2.9vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.letter-card-container.font-handwriting .letter-para {
  font-family: 'Caveat', 'Comic Neue', cursive;
  font-size: clamp(1.35rem, 1.82vw, 1.7rem);
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: 0.01em;
}

