@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  --bg-midnight: #080914;
  --bg-card: rgba(20, 18, 40, 0.82);
  --bg-card-hover: rgba(34, 28, 65, 0.92);
  --primary-pink: #ff5e90;
  --primary-pink-glow: rgba(255, 94, 144, 0.55);
  --secondary-purple: #9b51e0;
  --accent-gold: #ffd166;
  --accent-cyan: #4cc9f0;
  --text-main: #f8f9fa;
  --text-muted: #c2c3da;
  --border-glass: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 14px 45px rgba(0, 0, 0, 0.55);
  --font-body: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-hand: 'Caveat', cursive;
  --nav-height: 75px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-midnight);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Hardware Accelerated Butterfly Cursor Companion */
#butterfly-cursor {
  position: fixed;
  top: 0;
  left: 0;
  font-size: 2.2rem;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transform: translate3d(-50%, -50%, 0);
  filter: drop-shadow(0 0 12px rgba(76, 201, 240, 0.85));
}

/* Background Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(8, 9, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.nav-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary-pink);
  box-shadow: 0 0 14px var(--primary-pink-glow);
  object-fit: cover;
}

.nav-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--primary-pink), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.audio-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.audio-toggle-btn:hover {
  background: var(--primary-pink);
  box-shadow: 0 0 15px var(--primary-pink-glow);
}

/* UNIDIRECTIONAL JOURNEY STEPPER */
.journey-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: calc(var(--nav-height) + 1.2rem);
  margin-bottom: 1.8rem;
  padding: 10px 18px;
  background: rgba(20, 18, 40, 0.7);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 40px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.step-item .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-purple));
  box-shadow: 0 0 15px var(--primary-pink-glow);
}

.step-item.active .step-num {
  background: #fff;
  color: var(--primary-pink);
}

.step-divider {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
}

/* Page Layout Container */
.page-container {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - var(--nav-height) - 100px);
  padding: 1rem 1.2rem 5rem 1.2rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Glass Card Component */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 2.2rem;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Page Header Typography */
.page-header {
  text-align: center;
  margin-bottom: 2.8rem;
}

.chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 30px;
  background: rgba(255, 94, 144, 0.18);
  border: 1px solid rgba(255, 94, 144, 0.35);
  color: var(--primary-pink);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 1rem;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #ffffff 20%, #ff9ebb 60%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

/* Custom Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-pink), #e03a70);
  color: #fff;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--primary-pink-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px; /* Mobile touch friendly target */
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 94, 144, 0.65);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

/* NEXT CHAPTER UNIDIRECTIONAL BOTTOM BAR */
.next-chapter-bar {
  margin-top: 3.5rem;
  padding: 1.8rem;
  background: rgba(18, 16, 38, 0.9);
  backdrop-filter: blur(18px);
  border: 1px solid var(--primary-pink-glow);
  border-radius: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 35px rgba(0,0,0,0.55);
  flex-wrap: wrap;
  gap: 1.2rem;
}

.next-chapter-info h4 {
  font-size: 0.82rem;
  color: var(--primary-pink);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.next-chapter-info h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: #fff;
}

/* HERO SECTION */
.hero-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.hero-content h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

.hero-content .highlight {
  color: var(--primary-pink);
  font-style: italic;
}

.hero-content .highlight-blue {
  color: var(--accent-cyan);
  font-style: italic;
}

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-image-wrapper img {
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  border: 2px solid var(--border-glass);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 35px rgba(76, 201, 240, 0.3);
}

.pika-speech-bubble {
  position: absolute;
  bottom: -18px;
  right: 0px;
  background: rgba(18, 16, 36, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  border-radius: 20px;
  padding: 12px 18px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 250px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* LOVE STATS GRID */
.love-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 22px;
  padding: 1.6rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-top: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* REASON & WISH BOX */
.reason-box {
  background: linear-gradient(135deg, rgba(155, 81, 224, 0.18), rgba(255, 94, 144, 0.18));
  border: 1px solid rgba(255, 94, 144, 0.38);
  border-radius: 26px;
  padding: 2.5rem;
  text-align: center;
  margin-top: 2.5rem;
}

.reason-display {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent-gold);
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.2rem 0;
  line-height: 1.5;
}

/* BOUQUET MASTER STUDIO WORKSPACE */
.bouquet-studio-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.bouquet-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bouquet-stage-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 380px;
  border-radius: 24px;
  overflow: hidden;
  border: 2px dashed rgba(255, 94, 144, 0.35);
  background: rgba(9, 10, 22, 0.6);
  user-select: none;
  touch-action: none;
}

.bouquet-stage-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border-radius: 22px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.bouquet-items-layer {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2;
}

.placed-flower-item {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
}

.placed-flower-item:active {
  cursor: grabbing;
}

.placed-flower-item.selected {
  outline: 2px dashed var(--primary-pink);
  outline-offset: 4px;
  border-radius: 50%;
}

.flower-stem-line {
  width: 4px;
  height: 60px;
  background: linear-gradient(to bottom, #2a9d8f, #1b4332);
  margin: 0 auto;
  border-radius: 2px;
}

.flower-head-symbol {
  font-size: 3.2rem;
  text-align: center;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.bouquet-ribbon-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.bouquet-ribbon-tag-display {
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-purple));
  color: #fff;
  padding: 8px 22px;
  border-radius: 20px;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  white-space: nowrap;
}

/* Bouquet Tools & Controls Sidebar */
.bouquet-controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.flower-tray-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.flower-tray-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 10px 4px;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flower-tray-btn:hover, .flower-tray-btn:active {
  background: rgba(255, 94, 144, 0.2);
  border-color: var(--primary-pink);
  transform: scale(1.08);
}

.flower-tray-btn span {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  font-family: var(--font-body);
}

/* MEADOW PAGE */
.meadow-view {
  position: relative;
  min-height: 580px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  background-size: cover;
  background-position: center;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meadow-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(8, 9, 20, 0.35) 0%, rgba(8, 9, 20, 0.82) 100%);
  pointer-events: none;
  z-index: 1;
}

.meadow-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(18, 16, 36, 0.85);
  backdrop-filter: blur(14px);
  padding: 12px 24px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

.basket-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-gold);
  font-size: 1.05rem;
}

.flower-grid-field {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 1.8rem;
}

.flower-item {
  background: rgba(24, 20, 44, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.4rem 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.flower-item:hover, .flower-item:active {
  transform: translateY(-4px);
  border-color: var(--primary-pink);
}

.flower-item.picked {
  opacity: 0.65;
  border-color: rgba(255, 255, 255, 0.12);
}

.flower-emoji-large {
  font-size: 3.5rem;
  margin-bottom: 0.4rem;
  display: inline-block;
}

.flower-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.flower-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.flower-modal {
  background: var(--bg-midnight);
  border: 1px solid var(--primary-pink);
  border-radius: 28px;
  padding: 2.2rem;
  max-width: 460px;
  width: 92%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(255, 94, 144, 0.35);
}

.modal-flower-icon {
  font-size: 4.5rem;
  margin-bottom: 0.8rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
  color: var(--primary-pink);
}

.modal-meaning {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* SECRET STASH */
.stash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.6rem;
}

.coupon-card {
  background: var(--bg-card);
  border: 1px dashed var(--primary-pink);
  border-radius: 22px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.coupon-card.redeemed {
  opacity: 0.7;
  border-color: var(--border-glass);
}

.coupon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.coupon-icon {
  font-size: 2rem;
}

.coupon-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: rgba(255, 209, 102, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
}

.coupon-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.coupon-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.redeem-btn {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: var(--primary-pink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

/* LETTER PAGE STYLES */
.letter-wrapper {
  max-width: 740px;
  margin: 0 auto;
  position: relative;
}

.envelope-card {
  background: url('assets/wax_seal.jpg') center/cover;
  border-radius: 28px;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  border: 1px solid var(--border-glass);
  cursor: pointer;
}

.envelope-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(8, 9, 20, 0.72);
  backdrop-filter: blur(4px);
}

.envelope-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.wax-seal-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff2e63 0%, #b80036 100%);
  border: 3px solid #ffa0b4;
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.2rem auto 0 auto;
  box-shadow: 0 0 25px rgba(255, 46, 99, 0.7);
  cursor: pointer;
}

.letter-paper {
  display: none;
  background: rgba(255, 250, 245, 0.96);
  color: #2b2b44;
  border-radius: 28px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}

.letter-paper.open {
  display: block;
}

.letter-header-tag {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--primary-pink);
  margin-bottom: 1.2rem;
}

.letter-text-body {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  line-height: 1.6;
  color: #1e1e36;
  white-space: pre-line;
}

.proposal-box {
  margin-top: 2.5rem;
  background: rgba(255, 94, 144, 0.08);
  border: 2px dashed var(--primary-pink);
  border-radius: 24px;
  padding: 2rem;
  text-align: center;
}

.proposal-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
}

.btn-yes {
  background: linear-gradient(135deg, var(--primary-pink), #e03a70);
  color: #fff;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-no {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  border: 1px solid #ccc;
  cursor: pointer;
}

.celebration-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 3000;
}

.certificate-card {
  display: none;
  margin-top: 2.5rem;
  background: #fff;
  border: 8px solid var(--accent-gold);
  border-radius: 24px;
  padding: 2.2rem;
  text-align: center;
  color: #1e1e36;
}

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border-glass);
  margin-top: 3.5rem;
  position: relative;
  z-index: 2;
}

.footer span {
  color: var(--primary-pink);
}

/* MOBILE RESPONSIVE OPTIMIZATIONS */
@media (max-width: 850px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content h2 {
    font-size: 2.2rem;
  }
  .bouquet-studio-workspace {
    grid-template-columns: 1fr;
  }
  .page-header h1 {
    font-size: 2.2rem;
  }
  .journey-stepper {
    justify-content: flex-start;
  }
  .pika-speech-bubble {
    position: relative;
    bottom: 0;
    right: 0;
    margin: 15px auto 0 auto;
  }
  #butterfly-cursor {
    display: none; /* Disable cursor follower on small touch screens for performance */
  }
}
