/* ==============================================================================
   STYLE FOR OUR LOVE STORY
   Tone: Soft Rose, Warm Pink, Romantic Glassmorphism & Gold Accent
   ============================================================================== */

:root {
  --primary-pink: #ff6584;
  --deep-rose: #e63964;
  --soft-blush: #fff0f3;
  --card-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
  --text-main: #33272a;
  --text-muted: #6f595c;
  --gold-accent: #f7b267;
  --shadow-soft: 0 10px 30px rgba(230, 57, 100, 0.12);
  --shadow-hover: 0 16px 36px rgba(230, 57, 100, 0.22);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, #fff0f5 0%, #ffe4e8 35%, #ffd1dc 70%, #ffc4d6 100%);
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

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

/* Floating Controls (Top Right) */
.floating-controls {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 10px;
  z-index: 999;
}

.control-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep-rose);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.control-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(230, 57, 100, 0.25);
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Section Common Styling */
section {
  margin-bottom: 70px;
}

.section-heading {
  text-align: center;
  margin-bottom: 35px;
}

.section-heading .sub-label, .gift-box-card .sub-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--deep-rose);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.section-heading h2, .gift-box-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #2b1e22;
}

/* SECTION 1: HERO & TIMER */
.hero-section {
  text-align: center;
  padding-top: 30px;
}

.heart-pulse-glow {
  font-size: 3.5rem;
  display: inline-block;
  animation: heartPulse 1.4s infinite ease-in-out;
  filter: drop-shadow(0 0 18px rgba(255, 101, 132, 0.6));
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.couple-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  margin: 15px 0 10px;
  color: #221518;
}

.name-highlight {
  background: linear-gradient(135deg, var(--deep-rose), #ff477e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.heart-connector {
  display: inline-block;
  margin: 0 10px;
  font-size: 2.2rem;
}

.hero-subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: 1.55rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 35px;
}

/* Timer Card */
.timer-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 35px 25px;
  box-shadow: var(--shadow-soft);
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.timer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
}

.timer-badge {
  display: inline-block;
  background: rgba(255, 101, 132, 0.12);
  color: var(--deep-rose);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 12px;
}

.big-counter {
  font-size: 3.8rem;
  font-weight: 800;
  color: var(--deep-rose);
  line-height: 1;
  margin-bottom: 20px;
  font-family: 'Playfair Display', serif;
}

.big-counter .days-label {
  font-size: 1.3rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 5px;
}

.clock-grid {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.clock-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 218, 225, 0.8);
  border-radius: 16px;
  padding: 12px 18px;
  min-width: 80px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.clock-box .num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #2b1e22;
}

.clock-box .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.timer-footnote {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* SECTION 2: BỨC THƯ TÌNH (ENVELOPE) */
.envelope-wrapper {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  min-height: 260px;
  display: flex;
  justify-content: center;
}

.envelope {
  width: 100%;
  max-width: 440px;
  height: 250px;
  background: #ff758c;
  background: linear-gradient(145deg, #ff7e95, #fa6581);
  border-radius: 14px;
  position: relative;
  box-shadow: 0 15px 35px rgba(230, 57, 100, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.envelope:hover {
  transform: translateY(-5px);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 220px solid transparent;
  border-right: 220px solid transparent;
  border-top: 130px solid #f25574;
  transform-origin: top;
  transition: transform 0.5s ease;
  z-index: 3;
}

.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 220px solid #ff859c;
  border-right: 220px solid #ff859c;
  border-bottom: 140px solid #ff6e87;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 4;
}

.envelope-seal {
  position: relative;
  z-index: 6;
  background: #ffffff;
  color: var(--deep-rose);
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  animation: sealBounce 2s infinite ease-in-out;
}

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

/* Tờ giấy thư khi mở */
.letter-paper {
  display: none;
  background: #fffdf9;
  background-image: repeating-linear-gradient(#fffdf9, #fffdf9 31px, #f4e8eb 32px);
  border: 1px solid #ebd3d8;
  border-radius: 18px;
  padding: 35px 30px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-hover);
  position: relative;
  animation: slidePaperUp 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes slidePaperUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-letter-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(230, 57, 100, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--deep-rose);
  font-weight: bold;
  cursor: pointer;
}

.letter-paper-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: var(--deep-rose);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(230, 57, 100, 0.2);
}

.typewriter-content {
  font-size: 1rem;
  color: #3b2c30;
  white-space: pre-wrap;
  line-height: 2;
  min-height: 140px;
}

.letter-signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  text-align: right;
  color: var(--deep-rose);
  margin-top: 25px;
}

/* SECTION 3: TIMELINE KỶ NIỆM */
.timeline-container {
  position: relative;
  padding: 20px 0;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: linear-gradient(180deg, #ff8da1, #ffcad4);
  transform: translateX(-50%);
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  margin-bottom: 35px;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 35px;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 35px;
  text-align: left;
}

.timeline-node {
  position: absolute;
  top: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--deep-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(230, 57, 100, 0.3);
  z-index: 5;
}

.timeline-item:nth-child(odd) .timeline-node {
  right: -18px;
}

.timeline-item:nth-child(even) .timeline-node {
  left: -18px;
}

.timeline-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--deep-rose);
  margin-bottom: 6px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2b1e22;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* SECTION 4: POLAROID GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
}

.polaroid-card {
  background: #ffffff;
  padding: 12px 12px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  cursor: pointer;
}

.polaroid-card:nth-child(odd) {
  transform: rotate(-2deg);
}

.polaroid-card:nth-child(even) {
  transform: rotate(2deg);
}

.polaroid-card:hover {
  transform: scale(1.05) rotate(0deg);
  box-shadow: 0 16px 36px rgba(230, 57, 100, 0.25);
  z-index: 20;
}

.polaroid-img-box {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 4px;
  background: #ffeef2;
}

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

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

.polaroid-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.25rem;
  color: #443236;
  margin-top: 12px;
  line-height: 1.3;
}

/* SECTION 5: SURPRISE GIFT BOX */
.gift-box-card {
  text-align: center;
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px 25px;
  box-shadow: var(--shadow-soft);
  max-width: 580px;
  margin: 0 auto;
}

.gift-instruction {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 8px 0 25px;
}

.gift-box-interactive {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
  animation: giftWiggle 2.5s infinite ease-in-out;
}

@keyframes giftWiggle {
  0%, 75%, 100% { transform: rotate(0deg); }
  78% { transform: rotate(-8deg); }
  82% { transform: rotate(8deg); }
  86% { transform: rotate(-5deg); }
  90% { transform: rotate(5deg); }
}

.gift-bow {
  font-size: 2.5rem;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.gift-lid {
  width: 106px;
  height: 25px;
  background: #ff5277;
  border-radius: 8px;
  position: absolute;
  top: 5px;
  left: -3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.gift-body {
  width: 100px;
  height: 75px;
  background: linear-gradient(145deg, #ff6584, #e63964);
  border-radius: 0 0 10px 10px;
  position: absolute;
  top: 25px;
  box-shadow: 0 10px 20px rgba(230, 57, 100, 0.3);
}

.gift-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 42px;
  width: 16px;
  height: 100%;
  background: #ffd166;
}

/* FOOTER */
.love-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 40px;
}

.edit-hint {
  font-size: 0.8rem;
  color: #8c7276;
  margin-top: 6px;
}

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 35px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.modal-confetti {
  font-size: 3rem;
  margin-bottom: 10px;
}

.modal-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--deep-rose);
  margin-bottom: 15px;
}

.modal-gift-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4a383c;
  margin-bottom: 25px;
}

.modal-close-btn {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(230, 57, 100, 0.35);
  transition: transform 0.2s;
}

.modal-close-btn:hover {
  transform: scale(1.04);
}

/* Lightbox Modal for Gallery */
.photo-modal-card {
  max-width: 620px;
  width: 92vw;
  padding: 24px 20px 18px;
  position: relative;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.photo-modal-img-wrap {
  width: 100%;
  max-height: 72vh;
  overflow: hidden;
  border-radius: 12px;
  background: #fff5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-img-wrap img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.photo-modal-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.45rem;
  color: var(--deep-rose);
  margin-top: 14px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.close-photo-modal-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: #555;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.close-photo-modal-btn:hover {
  background: var(--deep-rose);
  color: #ffffff;
  transform: scale(1.1);
}

/* ==============================================================================
   SECTION 5: MINI-APPS ARCADE
   ============================================================================== */
.miniapps-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  padding: 10px 20px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-btn:hover {
  background: #ffffff;
  color: var(--deep-rose);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(230, 57, 100, 0.35);
  border-color: transparent;
}

.tab-content {
  display: none;
  animation: fadeInTab 0.4s ease forwards;
}

.tab-content.active {
  display: block;
}

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

.game-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 35px 25px;
  box-shadow: var(--shadow-soft);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.game-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: #2b1e22;
  margin-bottom: 8px;
}

.game-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.game-result {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--deep-rose);
  margin-top: 20px;
  min-height: 30px;
  animation: popIn 0.3s ease;
}

/* Mini-App 1: Runaway Proposal Button */
.runaway-arena {
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 240, 245, 0.5);
  padding: 20px;
}

.game-btn {
  padding: 14px 28px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.yes-btn {
  background: linear-gradient(135deg, #ff477e, #ff70a6);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(255, 71, 126, 0.4);
  z-index: 10;
}

.yes-btn:hover {
  transform: scale(1.08);
}

.no-btn {
  background: #ffffff;
  color: #666;
  border: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 20;
  user-select: none;
}

/* Mini-App 2: Lucky Wheel */
.wheel-wrapper {
  position: relative;
  width: 330px;
  height: 330px;
  max-width: 86vw;
  max-height: 86vw;
  margin: 10px auto 25px;
}

.wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  z-index: 30;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.25));
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(230, 57, 100, 0.2);
}

.spin-btn {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  border: none;
  padding: 14px 36px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 57, 100, 0.35);
  transition: all 0.2s;
}

.spin-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(230, 57, 100, 0.5);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mini-App 3: Scratch Card */
.scratch-container {
  position: relative;
  width: 320px;
  height: 160px;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  background: #fff0f3;
  user-select: none;
}

.scratch-secret {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--deep-rose);
  background: linear-gradient(135deg, #fff5f7, #ffe3e9);
  line-height: 1.5;
}

#scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.mini-tool-btn {
  background: #ffffff;
  border: 1px solid #ffd1dc;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mini-tool-btn:hover {
  color: var(--deep-rose);
  border-color: var(--deep-rose);
}

/* Mini-App 4: Reasons Generator */
.reason-display-box {
  background: #ffffff;
  border: 1px dashed #ffb3c1;
  border-radius: 18px;
  padding: 30px 35px;
  margin: 15px auto 25px;
  position: relative;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(255, 101, 132, 0.08);
}

.quote-mark {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: #ffccd5;
  position: absolute;
  top: 8px;
  left: 15px;
  line-height: 1;
}

.quote-mark.right {
  top: auto;
  left: auto;
  bottom: 0px;
  right: 15px;
}

#reason-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: #3b2c30;
  font-style: italic;
  line-height: 1.6;
  transition: opacity 0.3s ease;
}

.reason-btn {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  border: none;
  padding: 13px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(230, 57, 100, 0.3);
  transition: transform 0.2s;
}

.reason-btn:hover {
  transform: translateY(-2px);
}

/* ==============================================================================
   SECTION 6: GIẤY CHỨNG NHẬN TÌNH YÊU (LOVE CERTIFICATE)
   ============================================================================== */
.certificate-wrapper {
  background: #fffdf7;
  background-image: radial-gradient(#faf4e6 15%, transparent 16%), radial-gradient(#faf4e6 15%, transparent 16%);
  background-size: 60px 60px;
  background-position: 0 0, 30px 30px;
  border: 10px solid #f6ecd6;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  padding: 16px;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.cert-inner-frame {
  border: 4px double #d4af37;
  border-radius: 12px;
  padding: 35px 30px;
  position: relative;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
}

.cert-stamp-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #daa520);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(218, 165, 32, 0.4);
  border: 2px dashed #ffffff;
}

.badge-ribbon {
  font-size: 0.55rem;
  font-weight: 800;
  color: #5c3d00;
  letter-spacing: 1px;
}

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

.cert-decor {
  font-size: 1.1rem;
  color: #daa520;
  letter-spacing: 6px;
  display: block;
  margin-bottom: 6px;
}

.cert-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  color: #7a1c32;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.cert-subtitle {
  font-size: 0.85rem;
  color: #8c7276;
  font-style: italic;
  margin-bottom: 25px;
}

.cert-intro {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 12px;
}

.cert-couple-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 12px;
}

.cert-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--deep-rose);
  border-bottom: 2px solid #daa520;
  padding: 0 10px;
}

.cert-heart {
  font-size: 1.8rem;
  animation: heartPulse 1.5s infinite;
}

.cert-date-text {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
}

.cert-terms {
  background: rgba(254, 249, 237, 0.8);
  border-left: 3px solid #daa520;
  padding: 15px 20px;
  border-radius: 6px;
  text-align: left;
  margin: 0 auto 30px;
}

.cert-term-item {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #4a3b32;
  margin-bottom: 6px;
}

.cert-term-item:last-child {
  margin-bottom: 0;
}

/* Khu vực ký tên */
.cert-signatures {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-top: 15px;
  padding-top: 20px;
  border-top: 1px dashed #d4af37;
}

.sig-col {
  flex: 1;
  text-align: center;
}

.sig-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
}

.sig-preview {
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #aaa;
  position: relative;
}

.digital-sig-text {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  color: #1a4f8b;
  transform: rotate(-4deg);
}

.verified-seal {
  font-size: 0.65rem;
  color: #27ae60;
  font-weight: 700;
  border: 1px solid #27ae60;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.signature-pad-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#signature-canvas {
  background: rgba(255, 255, 255, 0.95);
  border: 1px dashed #daa520;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}

.sig-tools {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sig-tool-btn {
  background: #ffffff;
  border: 1px solid #d4af37;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7a1c32;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-tool-btn:hover {
  background: #fdf5e6;
}

.stamp-btn {
  background: #ffebee;
  border-color: var(--deep-rose);
  color: var(--deep-rose);
}

.cert-download-bar {
  text-align: center;
  margin-top: 25px;
}

.download-cert-btn {
  background: linear-gradient(135deg, #d4af37, #aa771c);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  border-radius: 30px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(170, 119, 28, 0.35);
  transition: all 0.3s;
}

.download-cert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(170, 119, 28, 0.5);
}

/* ==============================================================================
   CHẾ ĐỘ TRỜI ĐÊM LÃNG MẠN (NIGHT SKY MODE)
   ============================================================================== */
body.night-mode {
  background: linear-gradient(135deg, #060713 0%, #0d1026 35%, #18122b 70%, #1f0f29 100%);
  color: #f7eaf0;
}

body.night-mode .couple-title,
body.night-mode .section-heading h2,
body.night-mode .gift-box-card h2,
body.night-mode .game-title,
body.night-mode .clock-box .num {
  color: #ffffff;
}

body.night-mode .timer-card,
body.night-mode .game-card,
body.night-mode .gift-box-card,
body.night-mode .timeline-card {
  background: rgba(22, 18, 42, 0.85);
  border-color: rgba(255, 101, 132, 0.25);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

body.night-mode .clock-box {
  background: rgba(35, 27, 60, 0.95);
  border-color: rgba(255, 101, 132, 0.3);
}

body.night-mode .clock-box .lbl,
body.night-mode .hero-subtitle,
body.night-mode .timeline-desc,
body.night-mode .game-sub {
  color: #c9b1bd;
}

body.night-mode .control-btn {
  background: rgba(28, 22, 52, 0.85);
  color: #ff9ebb;
  border-color: rgba(255, 101, 132, 0.3);
}

body.night-mode .tab-btn {
  background: rgba(28, 22, 52, 0.7);
  color: #c9b1bd;
  border-color: rgba(255, 101, 132, 0.25);
}

body.night-mode .tab-btn.active {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
}

body.night-mode .runaway-arena {
  background: rgba(30, 22, 55, 0.6);
}

body.night-mode .reason-display-box {
  background: rgba(30, 22, 55, 0.9);
  border-color: rgba(255, 101, 132, 0.4);
}

body.night-mode #reason-text {
  color: #ffe6ee;
}

/* RESPONSIVE CHO ĐIỆN THOẠI */
@media (max-width: 768px) {
  .couple-title {
    font-size: 2.1rem;
  }
  .big-counter {
    font-size: 2.8rem;
  }
  .clock-box {
    min-width: 65px;
    padding: 10px 12px;
  }
  .clock-box .num {
    font-size: 1.3rem;
  }
  .timeline-container::before {
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 50px !important;
    padding-right: 0 !important;
    text-align: left !important;
  }
  .timeline-node {
    left: 2px !important;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .envelope {
    height: 210px;
  }
  .envelope-flap {
    border-left-width: 170px;
    border-right-width: 170px;
    border-top-width: 105px;
  }
  .envelope-pocket {
    border-left-width: 170px;
    border-right-width: 170px;
    border-bottom-width: 120px;
  }
}

/* ==============================================================================
   SECTION 8: REALTIME LOVE CHAT
   ============================================================================== */
.chat-section {
  margin: 60px 0;
}

.chat-card-wrap {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}

.chat-card-wrap:hover {
  box-shadow: var(--shadow-hover);
}

/* Chat Header */
.chat-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(255, 240, 243, 0.95), rgba(255, 228, 232, 0.9));
  border-bottom: 1px solid rgba(230, 57, 100, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.chat-couple-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatars {
  display: flex;
  align-items: center;
  position: relative;
}

.c-av {
  font-size: 1.6rem;
  background: #ffffff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.c-heart {
  font-size: 1.1rem;
  margin: 0 -4px;
  z-index: 2;
  animation: heartBeat 1.5s infinite;
}

.chat-names-status h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--deep-rose);
  margin-bottom: 2px;
}

.chat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.status-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffb703;
  box-shadow: 0 0 6px rgba(255, 183, 3, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-indicator-dot.online {
  background: #2ec4b6;
  box-shadow: 0 0 8px rgba(46, 196, 182, 0.8);
}

.status-indicator-dot.error {
  background: #e63946;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.8);
}

/* Identity Selector */
.chat-identity-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.identity-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.identity-btns {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.identity-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.identity-btn.active {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(230, 57, 100, 0.3);
}

/* Mode Banner */
.chat-mode-banner {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(230, 57, 100, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
}

.mode-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-tag {
  background: rgba(230, 57, 100, 0.12);
  color: var(--deep-rose);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.76rem;
}

.mode-note {
  color: var(--text-muted);
}

.chat-guide-link-btn {
  background: none;
  border: none;
  color: var(--deep-rose);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.chat-guide-link-btn:hover {
  opacity: 0.8;
}

/* Messages Area */
.chat-messages-area {
  height: 420px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255, 255, 255, 0.45);
  scroll-behavior: smooth;
}

.chat-messages-area::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-area::-webkit-scrollbar-thumb {
  background: rgba(230, 57, 100, 0.2);
  border-radius: 4px;
}

.chat-empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
}

.chat-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: floatEmpty 3s ease-in-out infinite;
}

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

/* Chat Message Item */
.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: msgPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes msgPop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-row.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-sender-name {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding: 0 6px;
  font-weight: 600;
}

.msg-bubble {
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-msg-row.mine .msg-bubble {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg-row.theirs .msg-bubble {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid rgba(230, 57, 100, 0.12);
  border-bottom-left-radius: 4px;
}

.msg-meta {
  font-size: 0.72rem;
  margin-top: 4px;
  padding: 0 4px;
  color: rgba(111, 89, 92, 0.7);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Quick Reactions Bar */
.chat-quick-reactions {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(230, 57, 100, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.quick-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quick-emojis {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.quick-emoji-btn {
  background: rgba(255, 240, 243, 0.85);
  border: 1px solid rgba(230, 57, 100, 0.15);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quick-emoji-btn:hover {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(230, 57, 100, 0.25);
}

/* Input Bar */
.chat-input-bar {
  padding: 14px 18px;
  background: #ffffff;
  border-top: 1px solid rgba(230, 57, 100, 0.12);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-message-input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 25px;
  border: 1.5px solid rgba(230, 57, 100, 0.2);
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.25s ease;
  background: #fffafa;
}

.chat-message-input:focus {
  border-color: var(--deep-rose);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(230, 57, 100, 0.12);
}

.chat-send-submit {
  background: linear-gradient(135deg, var(--deep-rose), #ff6584);
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: 25px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(230, 57, 100, 0.3);
  flex-shrink: 0;
}

.chat-send-submit:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(230, 57, 100, 0.4);
}

/* Chat Guide Modal */
.chat-guide-card {
  text-align: left;
  max-width: 520px;
}

.chat-guide-card h3 {
  text-align: center;
  margin-bottom: 15px;
}

.guide-steps-list {
  background: #fff8f9;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  border: 1px solid rgba(230, 57, 100, 0.12);
}

.guide-steps-list .guide-intro {
  margin-bottom: 12px;
  color: #4a383c;
}

.guide-steps-list ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-steps-list code {
  background: rgba(230, 57, 100, 0.1);
  color: var(--deep-rose);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.guide-steps-list a {
  color: var(--deep-rose);
  font-weight: 600;
}

@media (max-width: 600px) {
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .chat-identity-box {
    width: 100%;
    justify-content: space-between;
  }
  .chat-messages-area {
    height: 350px;
    padding: 14px;
  }
  .chat-msg-row {
    max-width: 88%;
  }
}
