:root {
  --green-primary: #2d5a3f;
  --green-dark: #163821;
  --green-accent: #40916c;
  --green-light: #52b788;
  --bg-primary: #f6faf7;
}
html { scroll-behavior: smooth; }
body { background: #f6faf7; color: #163821; }
#scene { display: block; touch-action: none; }
.nebula {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 650px at 50% 45%, rgba(255,255,255,0.9), transparent 75%),
    radial-gradient(600px 400px at 15% 20%, rgba(82,183,136,0.12), transparent 60%),
    radial-gradient(700px 500px at 85% 75%, rgba(64,145,108,0.14), transparent 60%),
    radial-gradient(600px 600px at 50% 15%, rgba(45,90,63,0.08), transparent 65%);
}
.glass {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(45, 90, 63, 0.2);
  box-shadow: 0 10px 30px rgba(22, 56, 33, 0.06);
}
.count-box { border-radius: 1rem; padding: .65rem .75rem; min-width: 68px; }
.count-box span { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.85rem; line-height: 1.1; color: var(--green-dark); font-weight: 700; }
.count-box label { font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: var(--green-primary); font-weight: 600; }

.btn-gold, .btn-green {
  background: linear-gradient(135deg, #2d5a3f, #40916c);
  color: #ffffff; font-weight: 600; padding: .75rem 1.6rem; border-radius: 999px;
  transition: all .25s ease; display: inline-flex; align-items: center; gap: .5rem;
  box-shadow: 0 4px 18px rgba(45, 90, 63, 0.28);
}
.btn-gold:hover, .btn-green:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 26px rgba(45, 90, 63, 0.42);
}
.btn-ghost {
  border: 1.5px solid rgba(45, 90, 63, 0.4);
  color: var(--green-dark); padding: .75rem 1.6rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .5rem; transition: all .25s ease;
  background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 14px rgba(22, 56, 33, 0.05);
}
.btn-ghost:hover {
  background: rgba(45, 90, 63, 0.08); border-color: var(--green-primary);
  transform: translateY(-2px);
}
.fade-up { animation: fadeUp 1.2s ease both; }
.fade-up:nth-child(2) { animation-delay: .15s; } .fade-up:nth-child(3) { animation-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* floating photos orbiting the 3D globe */
#photoLayer { perspective: 1200px; pointer-events: none; }
.orbit-photo {
  position: absolute; top: 0; left: 0; pointer-events: auto; cursor: pointer;
  width: 56px; height: 72px; border-radius: 3px; overflow: hidden;
  border: 0.5px solid rgba(45, 90, 63, 0.22);
  background: #ffffff;
  padding: 0; /* Giảm triệt để viền dày, ảnh tràn viền thanh thoát */
  box-shadow: 0 2px 8px rgba(22, 56, 33, 0.1), 0 1px 2px rgba(0,0,0,0.03);
  transition: box-shadow .35s ease, border-color .35s ease;
  will-change: transform, opacity;
  user-select: none;
}
.orbit-photo .photo-frame {
  width: 100%; height: 100%; border-radius: 2.5px; overflow: hidden; background: #f0f0f0;
}
.orbit-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Auto-zoomed photo (3s random pick) - viền mảnh tinh xảo, thanh lịch */
.orbit-photo.focused {
  border: 1px solid var(--green-primary);
  border-radius: 3.5px;
  padding: 0;
  z-index: 250 !important;
  box-shadow: 0 12px 32px rgba(22, 56, 33, 0.22), 0 2px 8px rgba(0,0,0,0.06);
}

/* Hovered photo (user interaction - highest priority) - viền mảnh sắc nét */
.orbit-photo.hovered {
  border: 1px solid var(--green-dark);
  border-radius: 3.5px;
  padding: 0;
  z-index: 300 !important;
  box-shadow: 0 16px 40px rgba(22, 56, 33, 0.28), 0 3px 10px rgba(0,0,0,0.08);
}

/* Dimmed other photos when one is hovered */
.orbit-photo.dimmed {
  opacity: 0.12 !important; filter: saturate(.3) brightness(.92);
}

/* ============ FALLING PETALS CANVAS ============ */
#petalsCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 18;
}

/* ============ 4 CORNER BOTANICAL WHITE LILY VIGNETTES ============ */
.corner-lily {
  position: fixed; pointer-events: none; z-index: 35; user-select: none;
  width: 215px; height: 215px;
}
.lily-branch-wrap {
  position: relative; width: 100%; height: 100%;
  transform: translate3d(var(--mouse-shift-x, 0), var(--mouse-shift-y, 0), 0);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.lily-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 4px 14px rgba(22, 56, 33, 0.08));
}

/* Top-Left Corner */
.corner-tl { top: -6px; left: -6px; }
.corner-tl .lily-branch-wrap {
  transform-origin: top left;
  animation: lilySwayTL 7.5s ease-in-out infinite;
}
.corner-tl .lily-img { transform: scaleX(-1); }

/* Top-Right Corner */
.corner-tr { top: -6px; right: -6px; }
.corner-tr .lily-branch-wrap {
  transform-origin: top right;
  animation: lilySwayTR 8.5s ease-in-out infinite;
}

/* Bottom-Left Corner */
.corner-bl { bottom: -6px; left: -6px; }
.corner-bl .lily-branch-wrap {
  transform-origin: bottom left;
  animation: lilySwayBL 8s ease-in-out infinite;
}
.corner-bl .lily-img { transform: scale(-1, -1); }

/* Bottom-Right Corner */
.corner-br { bottom: -6px; right: -6px; }
.corner-br .lily-branch-wrap {
  transform-origin: bottom right;
  animation: lilySwayBR 9s ease-in-out infinite;
}
.corner-br .lily-img { transform: scaleY(-1); }

/* Living Fluttering Petals around each corner cluster */
.flutter-petal {
  position: absolute;
  width: 12px; height: 20px;
  background: radial-gradient(ellipse at 35% 25%, #ffffff 50%, rgba(235, 246, 240, 0.9) 85%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  border: 0.5px solid rgba(82, 183, 136, 0.25);
  box-shadow: 0 2px 6px rgba(22, 56, 33, 0.08);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(45, 90, 63, 0.1));
}
.fp-1 {
  top: 48%; left: 38%;
  animation: petalFloat1 4.8s ease-in-out infinite;
}
.fp-2 {
  top: 62%; left: 58%;
  animation: petalFloat2 6.2s ease-in-out infinite;
}

@keyframes lilySwayTL {
  0%, 100% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(1.8deg) scale(1.015) translateY(2px); }
  70% { transform: rotate(-1.2deg) scale(0.99) translateY(-1px); }
}
@keyframes lilySwayTR {
  0%, 100% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(-1.8deg) scale(1.02) translateY(2px); }
  75% { transform: rotate(1.2deg) scale(0.99) translateY(-1px); }
}
@keyframes lilySwayBL {
  0%, 100% { transform: rotate(0deg) scale(1); }
  45% { transform: rotate(-1.5deg) scale(1.015) translateY(-2px); }
  80% { transform: rotate(1.2deg) scale(0.995) translateY(1px); }
}
@keyframes lilySwayBR {
  0%, 100% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(1.6deg) scale(1.02) translateY(-2px); }
  75% { transform: rotate(-1.2deg) scale(0.995) translateY(1px); }
}

@keyframes petalFloat1 {
  0%, 100% { transform: translate(0, 0) rotate(12deg) scale(1); opacity: 0.85; }
  50% { transform: translate(-8px, 9px) rotate(28deg) scale(1.06); opacity: 1; }
}
@keyframes petalFloat2 {
  0%, 100% { transform: translate(0, 0) rotate(-18deg) scale(0.92); opacity: 0.8; }
  50% { transform: translate(9px, -7px) rotate(-6deg) scale(1.02); opacity: 0.98; }
}

.scroll-hint { position: absolute; bottom: .75rem; left: 50%; transform: translateX(-50%); z-index: 10; }

/* timeline */
.tl-item { display: grid; grid-template-columns: 70px 1fr; gap: 1rem; position: relative; padding-bottom: 1.5rem; }
.tl-item::before { content: ""; position: absolute; left: 88px; top: 34px; bottom: -6px; width: 1px; background: linear-gradient(rgba(45, 90, 63, 0.4), transparent); }
.tl-item:last-child::before { display: none; }
.tl-time { font-family: "Cormorant Garamond", serif; color: var(--green-primary); font-size: 1.35rem; font-weight: 700; text-align: right; padding-top: .4rem; }
.tl-card { display: flex; gap: .9rem; align-items: flex-start; background: rgba(255,255,255,.9); border: 1px solid rgba(45,90,63,.2); border-radius: 1rem; padding: 1rem 1.2rem; box-shadow: 0 6px 20px rgba(22, 56, 33, 0.05); }
.tl-card svg { width: 1.4rem; height: 1.4rem; color: var(--green-primary); flex-shrink: 0; margin-top: .15rem; }
.tl-card h3 { font-family: "Cormorant Garamond", serif; font-size: 1.35rem; color: var(--green-dark); font-weight: 700; }
.tl-card p { color: rgba(22, 56, 33, 0.75); font-size: .9rem; font-weight: 400; }

.leaflet-container { background: #f6faf7; font-family: Montserrat, sans-serif; }
@media (max-width: 768px) {
  .orbit-photo { width: 46px; height: 58px; }
  .corner-lily { width: 125px; height: 125px; }
  .flutter-petal { width: 9px; height: 15px; }
}

/* ============ 3D WEDDING PHOTOBOOK / ALBUM ============ */
.book-stage {
  perspective: 2600px;
  width: 100%;
}
.book-container {
  position: relative;
  width: 100%;
  max-width: 880px;
  aspect-ratio: 16 / 10.6;
  min-height: 470px;
  border-radius: 14px;
  padding: 16px 18px 20px 18px; /* Dày dặn - tạo lề bìa sách cổ bọc lấy ruột sách */
  background: radial-gradient(ellipse at 50% 25%, #1d432b 0%, #12301c 60%, #091a0f 100%);
  border: 2px solid rgba(212, 175, 55, 0.65); /* Viền mạ vàng antique */
  outline: 1.5px solid rgba(212, 175, 55, 0.45);
  outline-offset: -8px;
  box-shadow:
    0 35px 80px -15px rgba(5, 18, 9, 0.65),
    0 18px 36px -8px rgba(0, 0, 0, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.28),
    inset 0 -5px 14px rgba(0, 0, 0, 0.75),
    inset 3px 0 8px rgba(0, 0, 0, 0.45),
    inset -3px 0 8px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.book-container:hover {
  box-shadow:
    0 40px 90px -15px rgba(5, 18, 9, 0.75),
    0 22px 42px -8px rgba(0, 0, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.32),
    inset 0 -5px 14px rgba(0, 0, 0, 0.8);
}

/* 4 Antique Brass Metal Corner Guards (Bo góc kim loại đồng cổ điển) */
.book-corner-metal {
  position: absolute;
  width: 48px;
  height: 48px;
  z-index: 28;
  pointer-events: none;
}
.book-corner-metal.top-left {
  top: 2px; left: 2px;
  background: linear-gradient(135deg, rgba(245, 218, 125, 0.98) 0%, rgba(195, 150, 55, 0.88) 45%, rgba(135, 98, 32, 0.8) 100%);
  clip-path: polygon(0 0, 100% 0, 68% 32%, 32% 32%, 32% 68%, 0 100%);
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.55));
}
.book-corner-metal.top-right {
  top: 2px; right: 2px;
  background: linear-gradient(225deg, rgba(245, 218, 125, 0.98) 0%, rgba(195, 150, 55, 0.88) 45%, rgba(135, 98, 32, 0.8) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 68% 68%, 68% 32%, 32% 32%);
  filter: drop-shadow(-1px 2px 3px rgba(0,0,0,0.55));
}
.book-corner-metal.bottom-left {
  bottom: 2px; left: 2px;
  background: linear-gradient(45deg, rgba(245, 218, 125, 0.98) 0%, rgba(195, 150, 55, 0.88) 45%, rgba(135, 98, 32, 0.8) 100%);
  clip-path: polygon(0 0, 32% 32%, 32% 68%, 68% 68%, 100% 100%, 0 100%);
  filter: drop-shadow(1px -2px 3px rgba(0,0,0,0.55));
}
.book-corner-metal.bottom-right {
  bottom: 2px; right: 2px;
  background: linear-gradient(315deg, rgba(245, 218, 125, 0.98) 0%, rgba(195, 150, 55, 0.88) 45%, rgba(135, 98, 32, 0.8) 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 32% 68%, 68% 68%, 68% 32%);
  filter: drop-shadow(-1px -2px 3px rgba(0,0,0,0.55));
}

/* Antique Silk Bookmark Ribbon (Dải ruy băng lụa kẹp sách rủ xuống) */
.book-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 15px;
  height: calc(100% + 28px);
  transform: translateX(-50%);
  background: linear-gradient(to right, #1a4228 0%, #3a7550 50%, #153620 100%);
  box-shadow: 2px 6px 14px rgba(0, 0, 0, 0.45);
  z-index: 18;
  pointer-events: none;
  border-radius: 0 0 2px 2px;
}
.book-ribbon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 7.5px solid transparent;
  border-right: 7.5px solid transparent;
  border-bottom: 9px solid #f6faf7;
}

/* Book Body holding pages - Multi-layer Stacked Paper Edge (Hiệu ứng xếp chồng nhiều trang giấy dày) */
.book {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: #fbf8f1;
  transform-style: preserve-3d;
  box-shadow:
    0 3px 0 #ede5d4,
    0 6px 0 #e4dbca,
    0 9px 0 #d9cfbe,
    0 14px 6px rgba(0, 0, 0, 0.28),
    -4px 4px 0 #ece4d2,
    4px 4px 0 #ece4d2;
}

/* Center Antique Spine */
.book-spine {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.08) 32%,
    rgba(212, 175, 55, 0.22) 50%,
    rgba(0, 0, 0, 0.08) 68%,
    rgba(0, 0, 0, 0.28) 100%
  );
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 15;
}

/* Base Left & Right Static Pages with Antique Parchment Texture */
.book-page {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background-color: #fcf9f2;
  background-image:
    linear-gradient(135deg, rgba(246, 239, 226, 0.6) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(242, 233, 218, 0.6) 100%),
    radial-gradient(#ded2bd 0.6px, transparent 0.6px);
  background-size: auto, 14px 14px;
  box-shadow:
    inset 0 0 35px rgba(180, 145, 95, 0.14),
    inset 0 0 1px rgba(135, 100, 60, 0.25);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}
.page-left {
  left: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 5px 0 0 5px;
}
.page-right {
  right: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 0 5px 5px 0;
}

/* Page content wrapper with antique inner double frame */
.page-content {
  width: 100%;
  height: 100%;
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Spine fold shadows */
.page-fold-shadow {
  position: absolute;
  top: 0; bottom: 0;
  width: 48px;
  pointer-events: none;
  z-index: 5;
}
.page-fold-shadow.left {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.16), transparent);
}
.page-fold-shadow.right {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.16), transparent);
}

/* 3D Turning Leaf */
.turning-leaf {
  position: absolute;
  top: 0; bottom: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 30;
  display: none;
  pointer-events: none;
}

.leaf-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #fcf9f2;
  background-image:
    linear-gradient(135deg, rgba(246, 239, 226, 0.6) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(242, 233, 218, 0.6) 100%),
    radial-gradient(#ded2bd 0.6px, transparent 0.6px);
  background-size: auto, 14px 14px;
  box-shadow:
    inset 0 0 35px rgba(180, 145, 95, 0.14),
    inset 0 0 1px rgba(135, 100, 60, 0.25);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.leaf-front {
  transform: rotateY(0deg);
  border-radius: 0 5px 5px 0;
  box-shadow: inset 1px 0 3px rgba(0, 0, 0, 0.08);
}
.leaf-back {
  transform: rotateY(180deg);
  border-radius: 5px 0 0 5px;
  box-shadow: inset -1px 0 3px rgba(0, 0, 0, 0.08);
}

/* Turning Page Shadows */
.leaf-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.leaf-shadow.front {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.32), transparent 45%);
}
.leaf-shadow.back {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.32), transparent 45%);
}

/* Vintage Antique Photo Frame Mount with 4 corner tabs */
.vintage-photo-mount {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 5px;
  background: #f5eedf;
  border: 1px solid rgba(180, 145, 95, 0.38);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  border-radius: 3px;
}
.photo-corner-tab {
  position: absolute;
  width: 13px;
  height: 13px;
  z-index: 10;
  pointer-events: none;
}
.photo-corner-tab.tl {
  top: 2px; left: 2px;
  border-top: 3px solid #2d5a3f;
  border-left: 3px solid #2d5a3f;
}
.photo-corner-tab.tr {
  top: 2px; right: 2px;
  border-top: 3px solid #2d5a3f;
  border-right: 3px solid #2d5a3f;
}
.photo-corner-tab.bl {
  bottom: 2px; left: 2px;
  border-bottom: 3px solid #2d5a3f;
  border-left: 3px solid #2d5a3f;
}
.photo-corner-tab.br {
  bottom: 2px; right: 2px;
  border-bottom: 3px solid #2d5a3f;
  border-right: 3px solid #2d5a3f;
}

/* Album Controls */
.btn-album-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(45, 90, 63, 0.28);
  box-shadow: 0 4px 14px rgba(22, 56, 33, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-album-nav:hover {
  background: #ffffff;
  border-color: var(--green-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(45, 90, 63, 0.16);
}
.btn-album-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-album-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(45, 90, 63, 0.28);
  box-shadow: 0 4px 14px rgba(22, 56, 33, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-album-toggle:hover {
  background: #ffffff;
  border-color: var(--green-primary);
  transform: translateY(-2px);
}
.btn-album-toggle.active {
  background: linear-gradient(135deg, rgba(45, 90, 63, 0.12), rgba(82, 183, 136, 0.15));
  border-color: var(--green-primary);
  box-shadow: 0 0 0 1px var(--green-primary);
}

@media (max-width: 640px) {
  .book-container {
    min-height: 290px;
    padding: 10px 10px 14px 10px;
    border-radius: 10px;
  }
  .book-corner-metal {
    width: 32px;
    height: 32px;
  }
  .book-ribbon {
    width: 12px;
    height: calc(100% + 20px);
  }
  .page-content {
    padding: 0.55rem 0.55rem;
  }
}

/* ============ DANCING WEDDING COUPLE WIDGET (GÓC PHẢI DƯỚI) ============ */
.wedding-couple-widget {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Speech Bubble */
.couple-speech {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(45, 90, 63, 0.28);
  box-shadow: 0 6px 20px rgba(22, 56, 33, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 6px;
  max-width: 260px;
  text-align: center;
  white-space: nowrap;
  animation: speechFloat 3.6s ease-in-out infinite;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}
.couple-speech:hover {
  transform: scale(1.04) translateY(-2px);
  border-color: var(--green-primary);
  box-shadow: 0 8px 24px rgba(45, 90, 63, 0.2);
}
.speech-arrow {
  position: absolute;
  bottom: -6px;
  left: 55%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.96);
}

/* Action / Control buttons */
.couple-actions {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 15;
  display: flex;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.wedding-couple-widget:hover .couple-actions {
  opacity: 1;
}
.couple-ctrl-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(45, 90, 63, 0.3);
  box-shadow: 0 2px 8px rgba(22, 56, 33, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.couple-ctrl-btn:hover {
  background: #ffffff;
  transform: scale(1.15);
  color: var(--green-dark);
  border-color: var(--green-primary);
}

/* Stage Container */
.couple-stage {
  position: relative;
  width: 175px;
  height: 195px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.25s ease;
}
.couple-stage:hover {
  transform: scale(1.04);
}

/* 3D Character Animator Wrapper */
.couple-dancer-animator {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: 50% 92%;
  animation: coupleWaltzDance 2.5s ease-in-out infinite;
  will-change: transform;
}

/* Character Image */
.couple-char-img {
  width: auto;
  max-width: 100%;
  max-height: 185px;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 10px 22px rgba(22, 56, 33, 0.18));
}

/* Dance Floor Ground Shadow */
.couple-dance-shadow {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 135px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(22, 56, 33, 0.38) 0%, rgba(22, 56, 33, 0.14) 55%, transparent 75%);
  animation: shadowDancePulse 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* ============ DANCE ANIMATIONS ============ */
@keyframes coupleWaltzDance {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1, 1);
  }
  25% {
    transform: translateY(-8px) rotate(-3.5deg) scale(0.98, 1.02);
  }
  50% {
    transform: translateY(-1px) rotate(0deg) scale(1.02, 0.98);
  }
  75% {
    transform: translateY(-8px) rotate(3.5deg) scale(0.98, 1.02);
  }
}

@keyframes shadowDancePulse {
  0%, 50%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.85;
  }
  25%, 75% {
    transform: translateX(-50%) scale(0.86);
    opacity: 0.45;
  }
}

/* Floating Ambient Particles (Behind and around the couple) */
.couple-ambient-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.fx-item {
  position: absolute;
  user-select: none;
  pointer-events: none;
}
.fx-heart-1 {
  left: 25%;
  bottom: 45%;
  font-size: 1.1rem;
  animation: floatUpParticle1 3s ease-in infinite;
}
.fx-heart-2 {
  right: 25%;
  bottom: 50%;
  font-size: 1rem;
  animation: floatUpParticle2 3.4s ease-in infinite 0.9s;
}
.fx-heart-3 {
  left: 48%;
  bottom: 55%;
  font-size: 0.85rem;
  animation: floatUpParticle3 2.8s ease-in infinite 1.8s;
}
.fx-note-1 {
  left: 10%;
  bottom: 55%;
  font-size: 1.1rem;
  color: var(--green-primary);
  font-weight: 700;
  animation: floatNoteParticle1 3.6s ease-in-out infinite 0.4s;
}
.fx-note-2 {
  right: 12%;
  bottom: 60%;
  font-size: 1.1rem;
  color: #d4af37;
  font-weight: 700;
  animation: floatNoteParticle2 4s ease-in-out infinite 1.6s;
}
.fx-sparkle-1 {
  left: 18%;
  bottom: 75%;
  font-size: 1rem;
  color: #d4af37;
  animation: twinkleSparkle 2.2s ease-in-out infinite 0.2s;
}
.fx-sparkle-2 {
  right: 18%;
  bottom: 75%;
  font-size: 0.9rem;
  color: #52b788;
  animation: twinkleSparkle 2.6s ease-in-out infinite 1.1s;
}

@keyframes floatUpParticle1 {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  25% { opacity: 0.95; }
  85% { opacity: 0.8; }
  100% { transform: translate(-18px, -48px) scale(1.15); opacity: 0; }
}
@keyframes floatUpParticle2 {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  25% { opacity: 0.95; }
  85% { opacity: 0.8; }
  100% { transform: translate(16px, -44px) scale(1.1); opacity: 0; }
}
@keyframes floatUpParticle3 {
  0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
  30% { opacity: 0.9; }
  85% { opacity: 0.75; }
  100% { transform: translate(0px, -52px) scale(1); opacity: 0; }
}

@keyframes floatNoteParticle1 {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  25% { opacity: 0.9; }
  80% { opacity: 0.85; }
  100% { transform: translate(-14px, -38px) rotate(-18deg); opacity: 0; }
}
@keyframes floatNoteParticle2 {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  25% { opacity: 0.9; }
  80% { opacity: 0.85; }
  100% { transform: translate(14px, -38px) rotate(18deg); opacity: 0; }
}
@keyframes twinkleSparkle {
  0%, 100% { transform: scale(0.3) rotate(0deg); opacity: 0.15; }
  50% { transform: scale(1.25) rotate(45deg); opacity: 1; }
}

/* ============ SPECIAL INTERACTIONS ============ */
/* Twirl spin dance on click */
.wedding-couple-widget.twirling .couple-dancer-animator {
  animation: coupleTwirlSpin 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}
@keyframes coupleTwirlSpin {
  0% { transform: scale(1) translateY(0) rotate(0deg); }
  25% { transform: scale(1.18) translateY(-20px) rotate(-10deg); }
  65% { transform: scale(1.12) translateY(-12px) rotate(360deg); }
  100% { transform: scale(1) translateY(0) rotate(360deg); }
}

/* Bursts on click */
.burst-particle {
  position: absolute;
  pointer-events: none;
  font-size: 1.15rem;
  z-index: 50;
  animation: burstFly 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes burstFly {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1.3); opacity: 0; }
}

/* When background music is active: dance with upbeat rhythm! */
.wedding-couple-widget.music-dancing .couple-dancer-animator {
  animation-duration: 1.25s !important;
}
.wedding-couple-widget.music-dancing .couple-dance-shadow {
  animation-duration: 1.25s !important;
}
.wedding-couple-widget.music-dancing .couple-speech {
  border-color: var(--green-accent);
  box-shadow: 0 0 16px rgba(82, 183, 136, 0.4);
}

/* Collapsed Mini Badge */
.couple-collapsed-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--green-primary);
  box-shadow: 0 6px 18px rgba(22, 56, 33, 0.18);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: badgePulse 2.8s ease-in-out infinite;
}
.couple-collapsed-badge:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(45, 90, 63, 0.3);
  background: #ffffff;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(45, 90, 63, 0.15); }
  50% { box-shadow: 0 6px 20px rgba(82, 183, 136, 0.4); }
}

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

/* Responsive adjustment for small mobile screens */
@media (max-width: 640px) {
  .wedding-couple-widget {
    bottom: 8px;
    right: 8px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }
  .couple-speech {
    font-size: 0.72rem;
    padding: 0.32rem 0.75rem;
    max-width: 180px;
  }
  .couple-stage {
    width: 145px;
    height: 165px;
  }
}
