:root {
  --primary-pink: #ff6b8b;
  --primary-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  --rose-gold: #e2878c;
  --heart-red: #ff3366;
  --bg-gradient: linear-gradient(180deg, #ffeef2 0%, #ffd6e0 40%, #ffc2d1 100%);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 12px 36px 0 rgba(255, 107, 139, 0.18);
  --text-dark: #4a2e35;
  --text-muted: #8c6b75;
  --font-main: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-handwriting: 'Caveat', cursive;
  --font-romantic: 'Dancing Script', cursive;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text-dark);
  background: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* Background Canvas for Floating Particles */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
}

/* Screen Transitions */
.screen {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen:not(.active) {
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

/* Floating Music Button */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--primary-pink);
  border-radius: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 139, 0.25);
  transition: all 0.3s ease;
}

.music-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.music-btn:hover {
  transform: scale(1.05);
}

.music-icon {
  font-size: 1.1rem;
}

.music-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.music-waves span {
  width: 3px;
  background-color: var(--primary-pink);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite alternate;
}

.music-waves span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.music-waves span:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.music-waves span:nth-child(3) { height: 10px; animation-delay: 0.2s; }

.music-btn.paused .music-waves span {
  animation-play-state: paused;
  height: 3px;
}

@keyframes wave {
  0% { height: 4px; }
  100% { height: 14px; }
}

/* =========================================================
   SCREEN 1: INTRO / GIFT OPENING SCREEN
   ========================================================= */
#intro-screen {
  text-align: center;
}

.intro-card {
  max-width: 440px;
  width: 90%;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: floatCard 4s ease-in-out infinite alternate;
}

@keyframes floatCard {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.badge-tag {
  background: #fff0f3;
  color: var(--heart-red);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #ffccd5;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(255, 51, 102, 0.12);
}

/* Gift Box Animation */
.gift-box-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 10px auto 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-box {
  position: relative;
  width: 100px;
  height: 90px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-box-wrapper:hover .gift-box {
  transform: scale(1.08) rotate(-2deg);
}

.gift-body {
  position: absolute;
  bottom: 0;
  width: 100px;
  height: 70px;
  background: linear-gradient(135deg, #ff4e78 0%, #ff2a5f 100%);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(255, 42, 95, 0.35);
}

.gift-lid {
  position: absolute;
  top: 10px;
  left: -5px;
  width: 110px;
  height: 22px;
  background: linear-gradient(135deg, #ff6b8b 0%, #ff4e78 100%);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 3;
  transition: transform 0.5s ease;
}

/* Ribbons */
.gift-ribbon {
  position: absolute;
  width: 20px;
  height: 70px;
  bottom: 0;
  left: 40px;
  background: #ffea79;
  box-shadow: 0 0 6px rgba(255, 234, 121, 0.5);
  z-index: 2;
}

.gift-lid::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 22px;
  left: 45px;
  top: 0;
  background: #ffea79;
}

/* Ribbon Bow */
.gift-lid::after {
  content: '🎀';
  position: absolute;
  top: -24px;
  left: 36px;
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.gift-pulse {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 107, 139, 0.2);
  animation: pulseRings 2s infinite;
  z-index: -1;
}

@keyframes pulseRings {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.intro-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #3b1e28;
  margin-bottom: 8px;
}

.intro-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-main);
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 107, 139, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(255, 107, 139, 0.5);
}

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

/* =========================================================
   SCREEN 2: MAIN ROMANTIC SHOWCASE
   ========================================================= */
#main-content {
  padding: 30px 16px 60px;
  justify-content: flex-start;
}

.content-container {
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.romantic-header {
  text-align: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

.sparkle-stars {
  font-size: 1.2rem;
  margin-bottom: 4px;
  animation: twinkle 2s infinite ease-in-out alternate;
}

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

.main-title {
  font-family: var(--font-romantic);
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d62252 0%, #ff5277 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  margin-bottom: 6px;
}

.date-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff4d73;
  background: rgba(255, 77, 115, 0.08);
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.receiver-name {
  font-family: var(--font-handwriting);
  font-size: 1.8rem;
  font-weight: 700;
  color: #5a2030;
}

/* Polaroid Photo Gallery */
.photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  perspective: 1000px;
  margin-top: 10px;
}

.polaroid-wrapper {
  position: relative;
  width: 290px;
  height: 360px;
  margin: 0 auto 18px;
}

.polaroid-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  padding: 14px 14px 20px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translateY(20px) rotate(4deg);
}

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

.polaroid-card.prev {
  opacity: 0.4;
  transform: scale(0.9) translateX(-40px) rotate(-6deg);
  z-index: 5;
}

.polaroid-card.next {
  opacity: 0.4;
  transform: scale(0.9) translateX(40px) rotate(6deg);
  z-index: 5;
}

.pin {
  position: absolute;
  top: -12px;
  font-size: 1.3rem;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.polaroid-img-box {
  width: 100%;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f7e6eb;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img {
  transform: scale(1.04);
}

.polaroid-caption {
  font-family: var(--font-handwriting);
  font-size: 1.35rem;
  font-weight: 700;
  color: #4a2832;
  text-align: center;
  margin-top: 12px;
  line-height: 1.2;
}

/* Carousel Nav */
.carousel-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-arrow {
  background: white;
  border: 1px solid #ffd1dc;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--primary-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.nav-arrow:hover {
  background: var(--primary-pink);
  color: white;
  transform: scale(1.1);
}

.dots-indicator {
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb8c6;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  width: 22px;
  border-radius: 10px;
  background: var(--heart-red);
}

/* Love Letter Section */
.letter-section {
  padding: 28px 22px;
  position: relative;
  background: rgba(255, 255, 255, 0.82);
}

.letter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px dashed #ffb8c8;
  padding-bottom: 12px;
}

.letter-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4a1f2b;
}

.letter-stamp {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ff3366;
  background: #ffe3ea;
  border: 1px solid #ff99b0;
  padding: 3px 8px;
  border-radius: 6px;
}

.letter-body {
  font-size: 0.98rem;
  line-height: 1.8;
  color: #422930;
}

.letter-body .greeting {
  font-weight: 700;
  margin-bottom: 10px;
  color: #8c253d;
}

.typed-text {
  position: relative;
  min-height: 80px;
}

.letter-signature {
  margin-top: 20px;
  text-align: right;
  display: flex;
  flex-direction: column;
  font-family: var(--font-handwriting);
  font-size: 1.45rem;
  color: #a12344;
}

/* Reasons Section */
.reasons-section {
  padding: 24px 20px;
  text-align: center;
}

.reasons-section h3 {
  font-size: 1.2rem;
  color: #4a1f2b;
  margin-bottom: 4px;
}

.reasons-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.reason-card {
  background: #fff5f7;
  border: 1.5px dashed #ffaec0;
  border-radius: 18px;
  padding: 20px 16px;
  margin-bottom: 18px;
  position: relative;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.reason-card p {
  font-size: 1.02rem;
  font-weight: 600;
  color: #701d32;
  line-height: 1.5;
  z-index: 2;
}

.quote-icon {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 1.8rem;
  color: #ffccd5;
  font-family: serif;
}

.quote-icon.right {
  top: auto;
  bottom: -4px;
  left: auto;
  right: 12px;
}

.btn-secondary {
  background: white;
  color: #ff4d73;
  border: 1.5px solid #ff4d73;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-main);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(255, 77, 115, 0.12);
}

.btn-secondary:hover {
  background: #ff4d73;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 77, 115, 0.25);
}

/* Love Meter & Tap Heart */
.love-meter-section {
  padding: 24px 20px;
  text-align: center;
}

.love-meter-section h3 {
  font-size: 1.2rem;
  color: #4a1f2b;
  margin-bottom: 4px;
}

.meter-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.big-heart-container {
  margin: 12px 0 20px;
}

.tap-heart-btn {
  background: white;
  border: none;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 51, 102, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tap-heart-btn:active {
  transform: scale(0.85);
}

.heart-icon {
  font-size: 2.8rem;
  animation: beatHeart 1.4s infinite;
  display: inline-block;
}

@keyframes beatHeart {
  0% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.18); }
  70% { transform: scale(1); }
}

.meter-bar-container {
  width: 100%;
  height: 14px;
  background: #ffd6df;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.meter-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff758c 0%, #ff3366 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.meter-status {
  font-size: 0.95rem;
  font-weight: 600;
  color: #612232;
}

.highlight-text {
  color: #ff2a5f;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Floating Click Heart Effect */
.floating-click-heart {
  position: fixed;
  pointer-events: none;
  font-size: 24px;
  user-select: none;
  z-index: 999;
  animation: floatUp 1.2s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1.3) rotate(var(--rot, 20deg));
  }
}

/* Footer */
.romantic-footer {
  text-align: center;
  padding: 20px 10px 10px;
  font-size: 0.9rem;
  color: #8c606e;
}

.romantic-footer .small-text {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* Media Queries for Small Screens */
@media (max-width: 380px) {
  .polaroid-wrapper {
    width: 250px;
    height: 320px;
  }
  .polaroid-img-box {
    height: 215px;
  }
  .main-title {
    font-size: 1.8rem;
  }
}
