/* ==========================================================================
   LUXURY & CUTE BIRTHDAY GREETING CARD - STYLES
   ========================================================================== */

/* Glassmorphism & Modern Utilities */
.glass-pill {
  box-shadow: 0 8px 32px 0 rgba(255, 105, 180, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card {
  box-shadow: 0 16px 40px 0 rgba(25, 5, 20, 0.37);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* --------------------------------------------------------------------------
   LUXURY 3D BIRTHDAY GIFT BOX STAGE & WEBGL CANVAS
   -------------------------------------------------------------------------- */
.gift-box-stage {
  box-shadow: 0 25px 60px -15px rgba(225, 29, 72, 0.4), 0 0 35px rgba(244, 63, 122, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#threeGiftMount {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  border-radius: inherit;
  overflow: hidden;
}

#threeGiftMount canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
}

.is-gift-opened #letterPeek {
  transform: translateY(-120px) scale(1.06);
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 30px 60px -12px rgba(225, 29, 72, 0.5);
  z-index: 45;
}

.shimmer-sweep {
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 80%
  );
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   STEP 2: DREAMY SOFT PINK AURA & CUTE COQUETTE LOVE LETTER
   -------------------------------------------------------------------------- */
.step2-aura-bg {
  background: linear-gradient(
    135deg,
    #fff0f6 0%,
    #ffd6e8 28%,
    #ffc2dd 52%,
    #ffe3ee 76%,
    #fff7fa 100%
  );
  background-size: 300% 300%;
  animation: introPinkGradient 10s ease-in-out infinite;
}

/* Radiant glowing aura halos in the background (GPU-composited) */
.step2-aura-halo {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.step2-aura-halo-1 {
  width: min(82vw, 680px);
  height: min(82vw, 680px);
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(
    circle,
    rgba(255, 130, 178, 0.48) 0%,
    rgba(255, 182, 213, 0.32) 42%,
    rgba(254, 215, 226, 0.12) 66%,
    rgba(255, 240, 246, 0) 76%
  );
  animation: step2AuraPulse 4.5s ease-in-out infinite alternate;
}

.step2-aura-halo-2 {
  width: min(95vw, 820px);
  height: min(95vw, 820px);
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(251, 113, 133, 0.22) 38%,
    rgba(253, 224, 71, 0.16) 58%,
    rgba(255, 158, 196, 0) 75%
  );
  animation: step2AuraSpin 22s linear infinite;
}

.step2-aura-halo-3 {
  width: 24rem;
  height: 24rem;
  top: 12%;
  left: 18%;
  transform: translate3d(0, 0, 0);
  background: radial-gradient(circle, rgba(255, 196, 221, 0.65) 0%, rgba(255, 196, 221, 0) 70%);
  animation: introOrbFloat1 9s ease-in-out infinite alternate;
}

@keyframes step2AuraPulse {
  0% { transform: translate3d(-50%, -50%, 0) scale(0.92); opacity: 0.75; }
  100% { transform: translate3d(-50%, -50%, 0) scale(1.12); opacity: 1; }
}

@keyframes step2AuraSpin {
  0% { transform: translate3d(-50%, -50%, 0) scale(1); }
  50% { transform: translate3d(-50%, -50%, 0) scale(1.06); }
  100% { transform: translate3d(-50%, -50%, 0) scale(1); }
}

/* Swaying Real Pink Rose Corners on Step 2 */
.step2-rose-corner {
  position: absolute;
  filter: drop-shadow(0 10px 22px rgba(190, 18, 78, 0.16));
  opacity: 0.92;
}
.step2-rose-tl {
  top: -22px;
  left: -22px;
  width: clamp(115px, 24vw, 280px);
  height: clamp(115px, 24vw, 280px);
}
.step2-rose-tr {
  top: -22px;
  right: -22px;
  width: clamp(115px, 24vw, 280px);
  height: clamp(115px, 24vw, 280px);
}
.step2-rose-bl {
  bottom: -24px;
  left: -22px;
  width: clamp(120px, 26vw, 300px);
  height: clamp(115px, 24vw, 270px);
}
.step2-rose-br {
  bottom: -24px;
  right: -22px;
  width: clamp(120px, 26vw, 300px);
  height: clamp(115px, 24vw, 270px);
}

/* Magical Aura Ring & Glow Directly Behind the Letter Card */
.step2-card-aura-ring {
  position: absolute;
  inset: -18px;
  border-radius: 2.6rem;
  background: linear-gradient(135deg, rgba(255, 143, 179, 0.65), rgba(255, 255, 255, 0.9), rgba(251, 113, 133, 0.6), rgba(253, 230, 138, 0.65));
  background-size: 250% 250%;
  filter: blur(22px);
  z-index: 5;
  animation: introPinkGradient 5s ease-in-out infinite, step2CardAuraBreathe 3.2s ease-in-out infinite alternate;
}

.step2-card-aura-glow {
  position: absolute;
  inset: -6px;
  border-radius: 2.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #ffb3c6 50%, #ffe5ec 100%);
  opacity: 0.85;
  z-index: 10;
  box-shadow:
    0 0 45px rgba(244, 63, 122, 0.35),
    0 0 90px rgba(255, 158, 196, 0.45);
}

@keyframes step2CardAuraBreathe {
  0% { transform: scale(0.97); opacity: 0.72; }
  100% { transform: scale(1.04); opacity: 1; }
}

/* Cute Coquette Stationery Card */
/* Real paper: warm cream sheet with a fine fiber grain, no white glow */
.luxury-paper-card.step2-cute-letter {
  background-color: #fdf4ea;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.4  0 0 0 0 0.35  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, #fffaf3 0%, #fdf4ea 60%, #f7e6d8 100%);
  border: 1px solid rgba(214, 170, 150, 0.45);
  box-shadow:
    0 22px 50px -18px rgba(120, 50, 60, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.6) inset;
}

/* Crayon sticker placement helper */
.step2-sticker {
  filter: drop-shadow(0 3px 4px rgba(120, 40, 60, 0.18));
  z-index: 12;
}

/* Soft notebook horizontal lines behind the letter text */
.step2-letter-body {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 27px,
    rgba(244, 114, 182, 0.16) 28px
  );
  border-radius: 0.75rem;
}

/* --------------------------------------------------------------------------
   CAKE ANIMATIONS & CANDLE
   -------------------------------------------------------------------------- */
@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) rotate(-1deg);
    opacity: 0.95;
  }
  25% {
    transform: scale(1.08, 0.92) rotate(2deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.95, 1.05) rotate(-2deg);
    opacity: 0.9;
  }
  75% {
    transform: scale(1.04, 0.98) rotate(1deg);
    opacity: 1;
  }
}

.animate-flame-flicker {
  animation: flameFlicker 0.8s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

.smoke-puff {
  animation: smokeRise 1.6s forwards cubic-bezier(0.1, 0.8, 0.3, 1);
}

@keyframes smokeRise {
  0% {
    opacity: 0.8;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-25px) scale(1.4) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(2) rotate(30deg);
  }
}

/* --------------------------------------------------------------------------
   POLAROID STACK CAROUSEL
   -------------------------------------------------------------------------- */
.polaroid-card {
  transform-origin: center center;
}

.polaroid-card.active {
  z-index: 30;
  transform: scale(1) translateY(0px) rotate(0deg);
  opacity: 1;
  pointer-events: auto;
}

.polaroid-card.next-1 {
  z-index: 20;
  transform: scale(0.95) translateY(10px) rotate(3deg);
  opacity: 0.88;
  pointer-events: none;
}

.polaroid-card.next-2 {
  z-index: 10;
  transform: scale(0.9) translateY(20px) rotate(-3.5deg);
  opacity: 0.65;
  pointer-events: none;
}

.polaroid-card.hidden-card {
  z-index: 0;
  transform: scale(0.82) translateY(30px);
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   FLOATING HEARTS IN BACKGROUND
   -------------------------------------------------------------------------- */
.heart-float-item {
  position: absolute;
  color: rgba(251, 111, 155, 0.6);
  pointer-events: none;
  animation: floatUp linear forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.8;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-10vh) scale(1.2) rotate(360deg);
    opacity: 0;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #120815;
}
::-webkit-scrollbar-thumb {
  background: #f43f7a;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   STEP 1: FULL-SCREEN 3D GIFT SCENE
   -------------------------------------------------------------------------- */
#giftScene,
#cakeScene,
#figureScene {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Warm studio backdrop with bokeh lights (dots added by gift3d.js) */
#giftBokeh,
#cakeBokeh,
#figureBokeh {
  background:
    radial-gradient(ellipse 70% 45% at 50% 82%, rgba(250, 232, 208, 0.95) 0%, rgba(236, 206, 170, 0.55) 45%, rgba(236, 206, 170, 0) 75%),
    linear-gradient(180deg, #2e1d12 0%, #5a3a22 38%, #9a7048 62%, #e2c7a2 82%, #f1e0c8 100%);
}
#giftBokeh i,
#cakeBokeh i,
#figureBokeh i {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
}

/* Clicks fall through the step-1 overlay to the 3D scene, except on the button */
main { pointer-events: none; }
main .step-section { pointer-events: auto; }
main #step1-envelope,
main #step3-cake,
main #step6-figure { pointer-events: none; }
main #step1-envelope button,
main #step3-cake button,
main #step6-figure button,
main #wishRevealedBox { pointer-events: auto; }

/* Soft sakura garden behind the 3D book */
/* Sakura garden behind the whole site: sits under all in-flow content */
.book-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.book-scene svg {
  width: 100%;
  height: 100%;
  display: block;
}

#threeCakeMount canvas,
#threeFigureMount canvas,
#bookMount canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
}

/* --------------------------------------------------------------------------
   INTRO: screen-record invitation (Dreamy Animated Soft Pink Theme)
   -------------------------------------------------------------------------- */
#introScreen {
  background: linear-gradient(
    -45deg,
    #fff0f5 0%,
    #ffd6e7 25%,
    #ffc4dd 50%,
    #ffe3ee 75%,
    #fff5f8 100%
  );
  background-size: 350% 350%;
  animation: introPinkGradient 12s ease-in-out infinite;
}

@keyframes introPinkGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Soft floating pastel aurora orbs in the intro background (Zero-blur radial gradients for 90fps+ GPU compositing) */
.intro-orb {
  position: absolute;
  border-radius: 9999px;
  opacity: 0.78;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.intro-orb-1 {
  width: 28rem;
  height: 28rem;
  top: -7rem;
  left: -7rem;
  background: radial-gradient(circle, rgba(255, 158, 187, 0.75) 0%, rgba(255, 158, 187, 0.25) 45%, rgba(255, 158, 187, 0) 72%);
  animation: introOrbFloat1 10s ease-in-out infinite alternate;
}

.intro-orb-2 {
  width: 32rem;
  height: 32rem;
  bottom: -8rem;
  right: -7rem;
  background: radial-gradient(circle, rgba(255, 166, 201, 0.75) 0%, rgba(255, 166, 201, 0.25) 45%, rgba(255, 166, 201, 0) 72%);
  animation: introOrbFloat2 13s ease-in-out infinite alternate;
}

.intro-orb-3 {
  width: 24rem;
  height: 24rem;
  top: 22%;
  right: 8%;
  background: radial-gradient(circle, rgba(255, 214, 165, 0.6) 0%, rgba(255, 214, 165, 0.18) 45%, rgba(255, 214, 165, 0) 72%);
  opacity: 0.65;
  animation: introOrbFloat1 15s ease-in-out infinite alternate-reverse;
}

.intro-orb-4 {
  width: 25rem;
  height: 25rem;
  bottom: 14%;
  left: 6%;
  background: radial-gradient(circle, rgba(251, 207, 232, 0.75) 0%, rgba(251, 207, 232, 0.25) 45%, rgba(251, 207, 232, 0) 72%);
  animation: introOrbFloat2 11s ease-in-out infinite alternate-reverse;
}

@keyframes introOrbFloat1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, 30px, 0) scale(1.12); }
  100% { transform: translate3d(-25px, 50px, 0) scale(0.95); }
}

@keyframes introOrbFloat2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-45px, -35px, 0) scale(1.1); }
  100% { transform: translate3d(30px, -45px, 0) scale(0.92); }
}

/* Drifting Fluffy Clouds in the Sky */
.intro-cloud {
  position: absolute;
  filter: drop-shadow(0 8px 18px rgba(244, 114, 182, 0.15));
  will-change: transform;
  opacity: 0.88;
}

.intro-cloud-1 {
  width: 15rem;
  top: 7%;
  left: -4%;
  animation: introCloudDriftRight 26s ease-in-out infinite alternate;
}

.intro-cloud-2 {
  width: 18rem;
  top: 13%;
  right: -5%;
  opacity: 0.78;
  animation: introCloudDriftLeft 32s ease-in-out infinite alternate;
}

.intro-cloud-3 {
  width: 12rem;
  top: 46%;
  left: 3%;
  opacity: 0.6;
  animation: introCloudDriftRight 22s ease-in-out infinite alternate-reverse;
}

.intro-cloud-4 {
  width: 13rem;
  top: 52%;
  right: 4%;
  opacity: 0.62;
  animation: introCloudDriftLeft 24s ease-in-out infinite alternate-reverse;
}

@keyframes introCloudDriftRight {
  0% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(48px) translateY(-8px); }
  100% { transform: translateX(95px) translateY(4px); }
}

@keyframes introCloudDriftLeft {
  0% { transform: translateX(0) translateY(0) scaleX(-1); }
  50% { transform: translateX(-52px) translateY(7px) scaleX(-1); }
  100% { transform: translateX(-100px) translateY(-5px) scaleX(-1); }
}

/* 4-Corner & Side Swaying Coquette Pink Rose Frames */
.intro-floral-corner,
.intro-floral-side {
  position: absolute;
  filter: drop-shadow(0 10px 22px rgba(190, 18, 78, 0.18));
  z-index: 2;
  will-change: transform, opacity;
}

.intro-floral-tl {
  top: -22px;
  left: -22px;
  width: clamp(130px, 30vw, 340px);
  height: clamp(130px, 30vw, 340px);
  transform-origin: top left;
}

.intro-floral-tr {
  top: -22px;
  right: -22px;
  width: clamp(130px, 30vw, 340px);
  height: clamp(130px, 30vw, 340px);
  transform-origin: top right;
}

.intro-floral-ml {
  top: 32%;
  left: -28px;
  width: clamp(95px, 20vw, 240px);
  height: clamp(120px, 25vw, 300px);
  transform-origin: center left;
}

.intro-floral-mr {
  top: 32%;
  right: -28px;
  width: clamp(95px, 20vw, 240px);
  height: clamp(120px, 25vw, 300px);
  transform-origin: center right;
}

.intro-floral-bl {
  bottom: -26px;
  left: -22px;
  width: clamp(135px, 32vw, 350px);
  height: clamp(125px, 28vw, 320px);
  transform-origin: bottom left;
}

.intro-floral-br {
  bottom: -26px;
  right: -22px;
  width: clamp(135px, 32vw, 350px);
  height: clamp(125px, 28vw, 320px);
  transform-origin: bottom right;
}

.intro-breeze-branch {
  transform-origin: 0% 0%;
  animation: introFloralSwayTop 5.5s ease-in-out infinite alternate;
}

.intro-breeze-branch-delayed {
  transform-origin: 0% 0%;
  animation: introFloralSwayTop 6.2s ease-in-out -2.4s infinite alternate;
}

.intro-side-sway {
  transform-origin: 0% 50%;
  animation: introFloralSwaySide 5.2s ease-in-out infinite alternate;
}

.intro-side-sway-delayed {
  transform-origin: 0% 50%;
  animation: introFloralSwaySide 6s ease-in-out -1.9s infinite alternate;
}

.intro-garden-sway {
  transform-origin: 20% 100%;
  animation: introFloralSwayBottom 5s ease-in-out infinite alternate;
}

.intro-garden-sway-delayed {
  transform-origin: 20% 100%;
  animation: introFloralSwayBottom 5.8s ease-in-out -1.8s infinite alternate;
}

@keyframes introFloralSwayTop {
  0% { transform: rotate(-2.2deg) scale(1); }
  50% { transform: rotate(1.8deg) scale(1.02); }
  100% { transform: rotate(3.6deg) scale(1); }
}

@keyframes introFloralSwaySide {
  0% { transform: rotate(-2.8deg) translateX(0); }
  50% { transform: rotate(2.2deg) translateX(3px); }
  100% { transform: rotate(-1.5deg) translateX(0); }
}

@keyframes introFloralSwayBottom {
  0% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(1.5deg) translateY(-3px); }
  100% { transform: rotate(3.8deg) translateY(0); }
}

/* 3D Flapping Butterflies & Falling SVG Rose Petals */
.intro-butterfly-flight {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 4;
}

.intro-butterfly-body {
  perspective: 320px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 6px 10px rgba(225, 29, 98, 0.22));
}

.butterfly-wing-left {
  transform-origin: 50px 50px;
  animation: butterflyWingLeft 0.34s ease-in-out infinite alternate;
}

.butterfly-wing-right {
  transform-origin: 50px 50px;
  animation: butterflyWingRight 0.34s ease-in-out infinite alternate;
}

@keyframes butterflyWingLeft {
  0% { transform: rotateY(10deg) scaleX(1); }
  100% { transform: rotateY(68deg) scaleX(0.42); }
}

@keyframes butterflyWingRight {
  0% { transform: rotateY(-10deg) scaleX(1); }
  100% { transform: rotateY(-68deg) scaleX(0.42); }
}

/* Falling SVG Flower Petals */
.intro-svg-petal {
  position: absolute;
  top: -8vh;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 3px 6px rgba(244, 63, 122, 0.18));
  animation: introPetalFall linear forwards;
}

@keyframes introPetalFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) rotateX(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.88;
  }
  50% {
    transform: translateY(52vh) translateX(42px) rotate(160deg) rotateX(180deg);
  }
  88% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(108vh) translateX(-28px) rotate(340deg) rotateX(360deg);
    opacity: 0;
  }
}

/* Frosted soft-pink glassmorphism card */
.intro-glass-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 240, 246, 0.68) 100%
  );
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 24px 60px -15px rgba(225, 29, 98, 0.18),
    0 8px 24px -6px rgba(244, 114, 182, 0.16),
    inset 0 2px 6px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.intro-count-box {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(251, 182, 206, 0.85);
  box-shadow:
    0 8px 20px -6px rgba(244, 63, 122, 0.14),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-count-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -6px rgba(244, 63, 122, 0.24);
}

.intro-start-btn {
  box-shadow:
    0 12px 28px -6px rgba(244, 63, 122, 0.45),
    0 0 0 4px rgba(255, 255, 255, 0.65);
  animation: introBtnPulse 2.4s ease-in-out infinite;
}

@keyframes introBtnPulse {
  0%, 100% {
    box-shadow:
      0 12px 28px -6px rgba(244, 63, 122, 0.45),
      0 0 0 4px rgba(255, 255, 255, 0.65);
  }
  50% {
    box-shadow:
      0 16px 34px -4px rgba(244, 63, 122, 0.6),
      0 0 0 8px rgba(251, 111, 155, 0.25);
  }
}

.intro-rec-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: introRecBlink 1.2s ease-in-out infinite;
}
@keyframes introRecBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Step-3 "Tiup Lilin" button pulses once the wish is saved, inviting the next click */
.blow-ready {
  animation: blowReadyPulse 1.4s ease-in-out infinite;
}
@keyframes blowReadyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
  50% { box-shadow: 0 0 0 14px rgba(251, 191, 36, 0); }
}

/* --------------------------------------------------------------------------
   3D PHOTO SCRAPBOOK (SINGLE CONTINUOUS 3D ENTITY - SEAMLESS GSAP ANIMATION)
   -------------------------------------------------------------------------- */
.book-3d-stage {
  perspective: 2400px;
  perspective-origin: 50% 50%;
}

.book-3d-object {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 470px;
  transform-style: preserve-3d;
  will-change: transform;
  border-radius: 18px;
  transition: box-shadow 0.4s ease;
}

@media (max-width: 640px) {
  .book-3d-object {
    height: 400px;
  }
}

/* 3D Hardcover base underlay */
.book-3d-cover-back {
  position: absolute;
  top: -6px;
  bottom: -6px;
  right: -6px;
  left: calc(50% - 4px);
  width: calc(50% + 10px);
  background: linear-gradient(135deg, #4c1126 0%, #2a0b17 50%, #58162d 100%);
  border-radius: 4px 22px 22px 4px;
  border: 2px solid rgba(245, 223, 148, 0.55);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  transform: translateZ(-8px);
  z-index: 0;
  /* No CSS transition: script.js tweens left/width in the same GSAP timeline as the cover flip */
}

.book-3d-object.book-open .book-3d-cover-back {
  left: -6px;
  width: calc(100% + 12px);
  border-radius: 22px;
}

/* Hide left base completely when book is closed so NO black or ghost box shows */
.book-3d-object:not(.book-open) .book-base-left {
  display: none !important;
}

/* 3D Rounded Spine Cylinder */
.book-3d-spine-cylinder {
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 50%;
  width: 26px;
  transform: translateX(-50%) translateZ(-3px);
  background: linear-gradient(
    90deg, 
    #3b0818 0%, 
    #701a35 25%, 
    #be124e 50%, 
    #881337 75%, 
    #3b0818 100%
  );
  border-radius: 10px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 25;
  pointer-events: none;
}

.book-spine-rib {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 2.5px;
  background: linear-gradient(90deg, #92400e, #fef3c7, #92400e);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.book-spine-rib.rib-1 { top: 22%; }
.book-spine-rib.rib-2 { top: 50%; }
.book-spine-rib.rib-3 { top: 78%; }

/* Layered 3D Gilded Paper Edges (Block Thickness) */
.book-3d-paper-edge-right {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: -10px;
  width: 14px;
  background: repeating-linear-gradient(
    180deg,
    #fefbf6 0px,
    #fefbf6 2px,
    #dfd2be 3px,
    #fefbf6 4px
  );
  border-radius: 0 6px 6px 0;
  box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.4);
  transform: translateZ(-2px);
  z-index: 1;
}

.book-3d-paper-edge-top {
  position: absolute;
  top: -5px;
  left: 50%;
  right: 4px;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #fefbf6 0px,
    #fefbf6 2px,
    #dfd2be 3px,
    #fefbf6 4px
  );
  border-radius: 4px 4px 0 0;
  transform: translateZ(-2px);
  z-index: 1;
}

.book-3d-paper-edge-bottom {
  position: absolute;
  bottom: -5px;
  left: 50%;
  right: 4px;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #fefbf6 0px,
    #fefbf6 2px,
    #dfd2be 3px,
    #fefbf6 4px
  );
  border-radius: 0 0 4px 4px;
  transform: translateZ(-2px);
  z-index: 1;
}

/* Base Parchment Pages */
.book-base-left {
  background: linear-gradient(135deg, #faf4e8 0%, #f4ebe0 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.04);
  display: flex;
}

.book-base-right {
  background: linear-gradient(135deg, #faf4e8 0%, #f4ebe0 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.04);
}

/* Spine Crease Overlay */
.book-spine-crease {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right, 
    rgba(0, 0, 0, 0.28) 0%, 
    rgba(0, 0, 0, 0.04) 40%, 
    rgba(255, 255, 255, 0.12) 50%, 
    rgba(0, 0, 0, 0.04) 60%, 
    rgba(0, 0, 0, 0.28) 100%
  );
  z-index: 45;
  pointer-events: none;
}

/* Silk Ribbon Bookmark */
.book-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 54px;
  background: linear-gradient(180deg, #be124e 0%, #e11d62 100%);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 50;
  pointer-events: none;
}
.book-ribbon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #4c1126;
}

/* Flippable Book Leaves */
.book-leaf {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}

.book-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.book-face.front {
  border-radius: 0 16px 16px 0;
  box-shadow: inset 18px 0 25px -10px rgba(0, 0, 0, 0.12), inset -2px 0 5px rgba(0, 0, 0, 0.04);
}

.book-face.back {
  transform: rotateY(180deg);
  border-radius: 16px 0 0 16px;
  box-shadow: inset -18px 0 25px -10px rgba(0, 0, 0, 0.12), inset 2px 0 5px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   LUXURY HARDCOVER FRONT COVER (SAMPUL BUKU HARIAN HILDA YANG MEWAH & LUCU)
   -------------------------------------------------------------------------- */
.book-cover-leaf {
  position: absolute;
  top: -6px;
  bottom: -6px;
  right: -6px;
  width: calc(50% + 6px);
  height: calc(100% + 12px);
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}

.book-cover-front {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 22px 22px 0 !important;
  background: radial-gradient(circle at 75% 25%, #ffe6ee 0%, #ffc0d5 35%, #f689ac 70%, #d83a73 100%) !important;
  border: 2.5px solid rgba(245, 215, 130, 0.85) !important;
  box-shadow: 
    inset 20px 0 35px -10px rgba(0, 0, 0, 0.35), 
    -10px 25px 50px rgba(0, 0, 0, 0.55),
    0 0 45px rgba(244, 63, 122, 0.4) !important;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Embossed gold stitch line running inside the perimeter */
.cover-gold-stitch {
  position: absolute;
  inset: 8px;
  border: 1.5px dashed rgba(254, 240, 138, 0.7);
  border-radius: 0 15px 15px 0;
  pointer-events: none;
  z-index: 10;
}

/* Spine edge band on the left of the cover */
.cover-spine-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  background: linear-gradient(90deg, #501328 0%, #881337 50%, rgba(136, 19, 55, 0) 100%);
  pointer-events: none;
  z-index: 12;
}

/* 3D Leather Clasp with Gold Heart Lock on right edge */
.cover-diary-clasp {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 68px;
  background: linear-gradient(90deg, #9d174d 0%, #be124e 65%, #881337 100%);
  border-radius: 0 14px 14px 0;
  border: 2px solid rgba(245, 223, 148, 0.95);
  box-shadow: 3px 6px 15px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}
.cover-clasp-heart {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 60%, #b45309 100%);
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-size: 11px;
}

/* Vintage Postal Stamp in top-right */
.cover-postal-stamp {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 42px;
  height: 48px;
  background: #fff9f0;
  border: 2px dashed #f472b6;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.2);
  transform: rotate(5deg);
  z-index: 14;
  pointer-events: none;
}

/* Back Face of Cover (Inside Dedication Page when Cover Flips to Left) */
.book-cover-back {
  border-radius: 22px 0 0 22px !important;
  box-shadow: inset -18px 0 30px -8px rgba(0, 0, 0, 0.25) !important;
  background: linear-gradient(135deg, #faf4e8 0%, #f4ebe0 100%) !important;
}

/* Dynamic Paper Curl Shadow */
.paper-curl-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent 60%);
  transition: opacity 0.25s ease;
}

/* Large 3D Gold Metal Corner Protectors */
.gold-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(245, 223, 148, 0.95);
  pointer-events: none;
  z-index: 20;
}
.gold-corner.tl { top: 6px; left: 24px; border-top: 3px solid; border-left: 3px solid; border-top-left-radius: 8px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3)); }
.gold-corner.tr { top: 6px; right: 8px; border-top: 3px solid; border-right: 3px solid; border-top-right-radius: 8px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3)); }
.gold-corner.bl { bottom: 6px; left: 24px; border-bottom: 3px solid; border-left: 3px solid; border-bottom-left-radius: 8px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3)); }
.gold-corner.br { bottom: 6px; right: 8px; border-bottom: 3px solid; border-right: 3px solid; border-bottom-right-radius: 8px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3)); }

/* --------------------------------------------------------------------------
   VINYL RECORD TURNTABLE MUSIC PLAYER WIDGET
   -------------------------------------------------------------------------- */
.vinyl-player-btn {
  background: linear-gradient(135deg, rgba(157, 23, 77, 0.85) 0%, rgba(225, 29, 98, 0.78) 55%, rgba(180, 83, 9, 0.72) 100%);
  box-shadow:
    0 10px 25px -5px rgba(244, 63, 122, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    0 0 0 1px rgba(251, 207, 232, 0.25);
}

.vinyl-player-btn:hover {
  background: linear-gradient(135deg, rgba(190, 18, 78, 0.95) 0%, rgba(244, 63, 122, 0.9) 55%, rgba(217, 119, 6, 0.85) 100%);
  transform: translateY(-1px);
}

.vinyl-disc {
  background:
    radial-gradient(circle at center, #1f1224 0%, #110915 24%, transparent 25%),
    repeating-radial-gradient(
      circle at center,
      #140b18 0px,
      #140b18 1.5px,
      #291830 2.2px,
      #120816 3px
    );
  border: 1.5px solid rgba(253, 230, 138, 0.65);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.55),
    inset 0 0 4px rgba(255, 255, 255, 0.2);
  animation: vinylSpin 2.6s linear infinite;
  animation-play-state: paused;
}

.vinyl-player-btn.is-playing .vinyl-disc {
  animation-play-state: running;
  box-shadow:
    0 0 14px rgba(251, 191, 36, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.6);
}

.vinyl-sheen {
  background: conic-gradient(
    from 35deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.26) 25deg,
    transparent 55deg,
    transparent 180deg,
    rgba(253, 224, 71, 0.22) 205deg,
    transparent 235deg
  );
}

.vinyl-label {
  background: radial-gradient(circle at 35% 35%, #ffc2d4 0%, #f43f7a 55%, #9d174d 100%);
  border: 1.2px solid #fde68a;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.vinyl-tonearm {
  transform-origin: 19px 5px;
  transform: rotate(-16deg);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.vinyl-player-btn.is-playing .vinyl-tonearm {
  transform: rotate(8deg);
}

@keyframes vinylSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.vinyl-eq-bar {
  width: 2.5px;
  border-radius: 9999px;
  background: linear-gradient(to top, #f472b6, #fde68a);
  animation: vinylEqBounce 0.85s ease-in-out infinite alternate;
}
.vinyl-eq-bar.bar-1 { height: 45%; animation-duration: 0.55s; }
.vinyl-eq-bar.bar-2 { height: 95%; animation-duration: 0.75s; animation-delay: 0.15s; }
.vinyl-eq-bar.bar-3 { height: 60%; animation-duration: 0.48s; animation-delay: 0.3s; }
.vinyl-eq-bar.bar-4 { height: 80%; animation-duration: 0.65s; animation-delay: 0.22s; }

@keyframes vinylEqBounce {
  0% { height: 25%; opacity: 0.7; }
  100% { height: 100%; opacity: 1; }
}

