/* ==========================================================================
   DIGITAL SCRAPBOOK DESIGN SYSTEM & BASE STYLES
   Crafted with warm textures, washi tape, polaroids, 3D transforms & rich animations
   ========================================================================== */

:root {
  /* Color Palette - Romantic Warm Craft Scrapbook */
  --bg-parchment: #f5ece0;
  --bg-craft: #ebdcce;
  --bg-card: #fffdf9;
  --paper-grain: #dfcfbe;
  --paper-border: #d4c0ab;
  --desk-tone: #e6d5c3;
  --ink-primary: #2e2323;
  --ink-secondary: #574646;
  --ink-muted: #877474;
  --accent-rose: #e44d73;
  --accent-rose-soft: #fbcfe8;
  --accent-blush: #fdf2f4;
  --accent-gold: #c99355;
  --accent-gold-glow: rgba(201, 147, 85, 0.4);
  --accent-terracotta: #bf5b3b;
  --accent-amber: #e09f3e;
  --wax-red: #a42426;
  --wax-gold: #c29525;
  
  /* Fonts */
  --font-hand: 'Caveat', cursive;
  --font-script: 'Dancing Script', cursive;
  --font-doodle: 'Patrick Hand', cursive;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Shadows & Scrapbook Tactile Depth */
  --shadow-polaroid: 0 12px 28px -6px rgba(70, 48, 38, 0.18), 0 4px 10px -2px rgba(70, 48, 38, 0.1);
  --shadow-polaroid-hover: 0 24px 45px -8px rgba(70, 48, 38, 0.28), 0 10px 20px -4px rgba(70, 48, 38, 0.15);
  --shadow-card: 0 10px 28px -5px rgba(80, 55, 42, 0.12), 0 3px 8px -2px rgba(80, 55, 42, 0.08);
  --shadow-box: 0 30px 60px -10px rgba(50, 30, 25, 0.4);
  --shadow-wax: 0 5px 14px rgba(164, 36, 38, 0.45);
  
  /* Radius & Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --container-max: 1200px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Theme Variations */
[data-theme="lavender"] {
  --bg-parchment: #f4ecf8;
  --bg-craft: #e8dbf0;
  --accent-rose: #9254c8;
  --accent-rose-soft: #ebdcf8;
  --accent-gold: #aa75e6;
  --desk-tone: #e2d2ec;
}

[data-theme="terracotta"] {
  --bg-parchment: #f6ede6;
  --bg-craft: #ebd7cb;
  --accent-rose: #b54f30;
  --accent-rose-soft: #f8d8ce;
  --accent-gold: #d48348;
  --desk-tone: #e2cbbe;
}

[data-theme="golden"] {
  --bg-parchment: #f8f2e4;
  --bg-craft: #ede3cc;
  --accent-rose: #cc8e25;
  --accent-rose-soft: #faebd0;
  --accent-gold: #dba339;
  --desk-tone: #e3d7bd;
}

/* ==========================================================================
   RESET & BASE SETUP
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-parchment);
  color: var(--ink-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* Rich Layered Scrapbook Desk Atmosphere */
  background-image: 
    /* Ambient Candlelight Warmth Vignette */
    radial-gradient(ellipse at 50% 12%, rgba(255, 248, 235, 0.95) 0%, rgba(245, 236, 224, 0.75) 45%, rgba(228, 210, 192, 0.6) 80%, rgba(206, 183, 160, 0.75) 100%),
    /* Diary Dotted Paper Grid Pattern */
    radial-gradient(rgba(180, 150, 125, 0.28) 1.2px, transparent 1.2px),
    /* Soft Atmospheric Fairy Light Blooms */
    radial-gradient(circle at 12% 20%, rgba(255, 182, 193, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 88% 55%, rgba(255, 215, 0, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(224, 187, 228, 0.15) 0%, transparent 40%),
    /* Subtle Vintage Wood/Linen Table Streaks */
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(160, 125, 95, 0.025) 35px, rgba(160, 125, 95, 0.025) 70px);
  background-size: 100% 100%, 26px 26px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

/* Rich Authentic Paper Texture Noise & Fiber Overlay */
.paper-texture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperPulpFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paperPulpFilter)'/%3E%3C/svg%3E");
}

/* Global Canvas for floating petals & fairy particles */
#atmosphere-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.25;
}

.handwritten {
  font-family: var(--font-hand);
  letter-spacing: 0.5px;
}

.script-font {
  font-family: var(--font-script);
}

.doodle-font {
  font-family: var(--font-doodle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition-bounce);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px -4px rgba(230, 92, 123, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-rose), #d6336c);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 24px -4px rgba(230, 92, 123, 0.45);
}

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

.btn-secondary {
  background: #fff;
  color: var(--ink-primary);
  border: 1.5px solid var(--paper-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.btn-secondary:hover {
  background: var(--bg-craft);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #e6b980, var(--accent-gold));
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(212, 163, 115, 0.4);
}

.btn-gold:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 24px -4px rgba(212, 163, 115, 0.55);
}

/* Floating Navigation / Top Toolbar */
.top-toolbar {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 1000;
  background: rgba(255, 253, 250, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(224, 212, 195, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.icon-btn:hover {
  color: var(--accent-rose);
  transform: scale(1.12);
  background: var(--accent-blush);
}

.icon-btn.active {
  background: var(--accent-rose);
  color: #fff;
}

/* Music Visualizer Bar within button */
.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.music-bars span {
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  animation: barPulse 1s ease-in-out infinite alternate;
}

.music-bars span:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.music-bars span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.music-bars span:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.music-bars span:nth-child(4) { height: 80%; animation-delay: 0.4s; }

.paused .music-bars span {
  animation: none;
  height: 4px;
}

@keyframes barPulse {
  0% { height: 25%; }
  100% { height: 100%; }
}

/* Section Common Titles & Badges */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-doodle);
  font-size: 1.15rem;
  color: var(--accent-rose);
  background: var(--accent-blush);
  padding: 0.3rem 1.2rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  transform: rotate(-2deg);
  border: 1px dashed rgba(230, 92, 123, 0.4);
}

.section-title {
  font-size: 2.6rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.6rem;
  position: relative;
  display: inline-block;
}

.section-subtitle {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--ink-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.curved-underline {
  position: absolute;
  bottom: -8px;
  left: 10%;
  width: 80%;
  height: 12px;
  stroke: var(--accent-rose);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
}

/* ==========================================================================
   PASSCODE LOCK SCREEN (OPTIONAL / PERSONAL TOUCH)
   ========================================================================== */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
}

#lock-screen.unlocked {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
  pointer-events: none;
}

.lock-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--paper-border);
  box-shadow: var(--shadow-polaroid-hover);
  text-align: center;
  position: relative;
  transform: rotate(-1deg);
}

.lock-envelope-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.2rem;
  background: var(--accent-blush);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-rose);
  font-size: 2.5rem;
  box-shadow: 0 8px 16px rgba(230, 92, 123, 0.2);
  animation: floatingBob 3s ease-in-out infinite;
}

.lock-pin-display {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--paper-border);
  background: transparent;
  transition: var(--transition-bounce);
}

.pin-dot.filled {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(230, 92, 123, 0.4);
}

.lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto 1.5rem;
}

.key-btn {
  aspect-ratio: 1;
  font-size: 1.35rem;
  font-weight: 600;
  border-radius: 50%;
  border: 1.5px solid var(--paper-border);
  background: #fff;
  color: var(--ink-primary);
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.key-btn:hover {
  background: var(--accent-blush);
  color: var(--accent-rose);
  transform: scale(1.08);
}

.key-btn:active {
  transform: scale(0.92);
  background: var(--accent-rose);
  color: #fff;
}

.lock-hint {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--ink-secondary);
  margin-bottom: 1rem;
}

.skip-btn {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-family: var(--font-doodle);
  font-size: 1.1rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.4rem;
}

/* ==========================================================================
   3D OPENING SURPRISE GIFT BOX
   ========================================================================== */
.hero-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 1.5rem 2rem;
  perspective: 1200px;
  overflow: hidden;
}

.hero-glow-bg {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 92, 123, 0.18) 0%, rgba(212, 163, 115, 0.12) 50%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: pulseGlow 5s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9) translate(-10px, -10px); opacity: 0.7; }
  100% { transform: scale(1.2) translate(10px, 10px); opacity: 1; }
}

.box-wrapper {
  perspective: 1200px;
  margin-bottom: 2rem;
  position: relative;
  z-index: 20;
}

/* The 3D Gift Box */
.gift-box-3d {
  width: 200px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(25deg);
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin: 0 auto;
}

.gift-box-3d:hover {
  transform: rotateX(-12deg) rotateY(35deg) scale(1.05);
}

.gift-box-3d.opened {
  cursor: default;
  transform: rotateX(10deg) rotateY(0deg) translateY(40px);
}

/* Box Faces */
.box-face {
  position: absolute;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #f87171, #e11d48);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.15);
}

.box-front  { transform: translateZ(100px); }
.box-back   { transform: rotateY(180deg) translateZ(100px); }
.box-right  { transform: rotateY(90deg) translateZ(100px); background: linear-gradient(135deg, #e11d48, #be123c); }
.box-left   { transform: rotateY(-90deg) translateZ(100px); background: linear-gradient(135deg, #fb7185, #e11d48); }
.box-bottom { transform: rotateX(-90deg) translateZ(100px); background: #9f1239; box-shadow: 0 40px 60px rgba(0,0,0,0.3); }

/* Box Ribbons */
.ribbon-vertical {
  position: absolute;
  left: 50%;
  top: 0;
  width: 36px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #d4a373, #faedcd, #d4a373);
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.ribbon-horizontal {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 36px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #d4a373, #faedcd, #d4a373);
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

/* 3D Box Lid */
.box-lid-3d {
  position: absolute;
  width: 216px;
  height: 50px;
  left: -8px;
  top: -8px;
  transform-style: preserve-3d;
  transform: translateZ(108px);
  transition: all 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.box-lid-top {
  position: absolute;
  width: 216px;
  height: 216px;
  background: linear-gradient(135deg, #fb7185, #e11d48);
  transform: rotateX(90deg) translateZ(25px);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.15);
}

.box-lid-front {
  position: absolute;
  width: 216px;
  height: 40px;
  background: #e11d48;
  transform: translateZ(108px);
}

.box-lid-back {
  position: absolute;
  width: 216px;
  height: 40px;
  background: #be123c;
  transform: rotateY(180deg) translateZ(108px);
}

.box-lid-left {
  position: absolute;
  width: 216px;
  height: 40px;
  background: #f43f5e;
  transform: rotateY(-90deg) translateZ(108px);
}

.box-lid-right {
  position: absolute;
  width: 216px;
  height: 40px;
  background: #be123c;
  transform: rotateY(90deg) translateZ(108px);
}

/* 3D Ribbon Bow on top */
.ribbon-bow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(10px);
  width: 60px;
  height: 60px;
}

.bow-knot {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #e6b980;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 5;
}

.bow-loop-left, .bow-loop-right {
  position: absolute;
  width: 38px;
  height: 24px;
  background: linear-gradient(135deg, #faedcd, #d4a373);
  border-radius: 50% 50% 10% 50%;
  top: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bow-loop-left {
  left: 4px;
  transform: translateY(-50%) rotate(-35deg);
}

.bow-loop-right {
  right: 4px;
  transform: translateY(-50%) rotate(35deg) scaleX(-1);
}

/* Open Animation for Lid */
.gift-box-3d.opened .box-lid-3d {
  transform: translateY(-240px) translateZ(150px) rotateX(-55deg) rotateY(40deg) rotateZ(-25deg);
  opacity: 0.9;
}

/* Pulsing "Tap to Open" Tag */
.tap-to-open-tag {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 0.5rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-rose);
  box-shadow: 0 8px 20px rgba(230, 92, 123, 0.25);
  white-space: nowrap;
  animation: bounceTag 1.8s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px dashed var(--accent-rose-soft);
  z-index: 30;
}

@keyframes bounceTag {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.gift-box-3d.opened + .tap-to-open-tag {
  display: none;
}

/* POP-UP STAGE (CARDS RISING OUT OF BOX) */
.popup-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 950px;
  height: 520px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 100;
}

.popup-stage.active {
  opacity: 1;
  pointer-events: auto;
}

.popup-card {
  position: absolute;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-polaroid-hover);
  border: 2px solid var(--paper-border);
  padding: 1.25rem;
  transform: scale(0.2) translateY(300px);
  opacity: 0;
  transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.popup-stage.active .popup-card {
  opacity: 1;
}

/* Center Card: The Main Birthday Card */
.popup-stage.active .card-center {
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 360px;
  max-width: 90vw;
  z-index: 50;
  transition-delay: 0.3s;
  text-align: center;
  padding: 2.2rem 1.8rem;
  background: #fffdfa;
  border: 2px solid var(--accent-rose-soft);
}

/* Left Card: 20 Reasons Preview */
.popup-stage.active .card-left {
  top: 25%;
  left: 8%;
  transform: rotate(-10deg) scale(0.9);
  width: 230px;
  z-index: 40;
  transition-delay: 0.5s;
}

/* Right Card: Open When Preview */
.popup-stage.active .card-right {
  top: 25%;
  right: 8%;
  transform: rotate(9deg) scale(0.9);
  width: 230px;
  z-index: 40;
  transition-delay: 0.6s;
}

/* Bottom Card: Scrapbook Polaroids Preview */
.popup-stage.active .card-bottom {
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%) rotate(2deg) scale(0.92);
  width: 280px;
  z-index: 45;
  transition-delay: 0.7s;
}

.popup-card:hover {
  transform: scale(1.05) !important;
  z-index: 60 !important;
}

/* Hero Content under box (Before opened) */
.hero-greeting {
  text-align: center;
  max-width: 600px;
  margin-top: 1.5rem;
}

.hero-subtitle {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  color: var(--ink-secondary);
}

.hero-title {
  font-size: 3.2rem;
  color: var(--ink-primary);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   WASHI TAPE & POLAROID BASE STYLING
   ========================================================================== */
.washi-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background-color: rgba(254, 215, 226, 0.85);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(230, 92, 123, 0.15) 8px,
    rgba(230, 92, 123, 0.15) 16px
  );
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  opacity: 0.9;
  z-index: 10;
  clip-path: polygon(0 0, 97% 2%, 100% 98%, 3% 97%);
}

.washi-tape-dots {
  background-color: rgba(254, 243, 199, 0.85);
  background-image: radial-gradient(rgba(212, 163, 115, 0.4) 2px, transparent 2px);
  background-size: 8px 8px;
}

.washi-tape-stripe {
  background-color: rgba(230, 242, 230, 0.85);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(163, 177, 138, 0.25) 6px,
    rgba(163, 177, 138, 0.25) 12px
  );
}

/* Polaroid Base Card */
.polaroid {
  background: #fff;
  padding: 14px 14px 28px 14px;
  border-radius: 4px;
  box-shadow: var(--shadow-polaroid);
  position: relative;
  transition: var(--transition-bounce);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.polaroid:hover {
  transform: scale(1.04) translateY(-6px) !important;
  box-shadow: var(--shadow-polaroid-hover);
  z-index: 30 !important;
}

.polaroid-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: #f0ece6;
  position: relative;
}

.polaroid-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.polaroid:hover .polaroid-img-wrap img {
  transform: scale(1.06);
}

.polaroid-caption {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--ink-primary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.2;
}

.polaroid-sub {
  font-family: var(--font-doodle);
  font-size: 0.95rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 4px;
}

/* Wooden Peg / Clothes Pin */
.clothes-pin {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 36px;
  background: #d4a373;
  border-radius: 3px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.18);
  z-index: 15;
}

.clothes-pin::after {
  content: '';
  position: absolute;
  top: 12px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: #997b66;
  border-radius: 2px;
}

/* ==========================================================================
   FAIRY LIGHTS STRING
   ========================================================================== */
.fairy-lights-string {
  position: relative;
  width: 100%;
  height: 40px;
  margin-bottom: 2rem;
  overflow: visible;
}

.fairy-wire {
  width: 100%;
  height: 25px;
  border-bottom: 2px dashed rgba(160, 130, 100, 0.4);
  border-radius: 50%;
  position: absolute;
  top: 0;
}

.bulb-group {
  position: absolute;
  width: 100%;
  top: 22px;
  display: flex;
  justify-content: space-around;
  padding: 0 2rem;
}

.fairy-bulb {
  width: 14px;
  height: 20px;
  border-radius: 50% 50% 40% 40%;
  background: #fff3c4;
  box-shadow: 0 0 14px 4px rgba(254, 215, 102, 0.7);
  animation: glowFairy 2.5s ease-in-out infinite alternate;
  position: relative;
}

.fairy-bulb:nth-child(even) {
  animation-delay: 0.7s;
  background: #ffd6e0;
  box-shadow: 0 0 14px 4px rgba(255, 182, 193, 0.7);
}

.fairy-bulb:nth-child(3n) {
  animation-delay: 1.3s;
  background: #e8dff5;
  box-shadow: 0 0 14px 4px rgba(216, 180, 226, 0.7);
}

@keyframes glowFairy {
  0% { opacity: 0.55; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* Floating Hearts & Petals */
@keyframes floatingBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

/* ==========================================================================
   MODAL DIALOG (STORY LIGHTBOX & LETTER VIEW)
   ========================================================================== */
.scrapbook-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(45, 36, 36, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.scrapbook-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-paper-sheet {
  background: #fffdfa;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: var(--transition-bounce);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--paper-border);
}

.scrapbook-modal.active .modal-paper-sheet {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-craft);
  border: 1px solid var(--paper-border);
  color: var(--ink-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.modal-close-btn:hover {
  background: var(--accent-rose);
  color: #fff;
  transform: rotate(90deg);
}

/* Torn Edge Effect */
.torn-top {
  position: relative;
}

.torn-top::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background-image: radial-gradient(circle at 10px 10px, transparent 10px, #fffdfa 11px);
  background-size: 20px 20px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(45, 36, 36, 0.92);
  color: #fff;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUpToast 0.4s ease, fadeOutToast 0.4s ease 2.6s forwards;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateY(-10px); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-craft);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-rose);
}
