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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #EAE0D7;
  color: #2B181A;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Animations */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spinSlow 6s linear infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.22); }
  60% { transform: scale(1.08); }
}
.animate-heartbeat {
  animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-3deg); }
  75% { transform: translateY(-3px) rotate(3deg); }
}
.animate-gift-bounce {
  animation: giftBounce 2.2s ease-in-out infinite;
}

@keyframes carDrive {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  50% { transform: translate(-6px, 4px) rotate(-2deg); }
}
.animate-car {
  animation: carDrive 3s ease-in-out infinite;
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  50% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
.animate-ken-burns {
  animation: kenBurns 18s ease-in-out infinite;
}

@keyframes petalFloat {
  0% {
    transform: translate3d(0, -8vh, 0) rotate(0deg) scale(0.85);
    opacity: 0;
  }
  12% { opacity: 0.92; }
  88% { opacity: 0.92; }
  100% {
    transform: translate3d(var(--sway, 34px), 105vh, 0) rotate(28deg) scale(1.05);
    opacity: 0;
  }
}
.petal-particle {
  position: fixed;
  top: -6vh;
  pointer-events: none;
  z-index: 45;
  animation: petalFloat var(--duration, 11s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes floatUpHeart {
  0% {
    transform: translate3d(0, 0, 0) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--tx, -20px), -230px, 0) scale(1.35);
    opacity: 0;
  }
}
.floating-heart-burst {
  position: absolute;
  bottom: 26px;
  right: 12px;
  pointer-events: none;
  animation: floatUpHeart 2.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal-section {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile 9:16 Wedding Card Shell */
.wedding-viewport {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at top, #F4ECE4, #E2D4C8);
}

.wedding-mobile-frame {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background-color: var(--secondary-color, #FBF9F6);
  box-shadow: 0 20px 60px rgba(60, 16, 22, 0.22);
  position: relative;
  overflow: hidden;
  padding-bottom: 84px;
  transition: background-color 0.4s ease;
}

/* Top Floating Buttons (Auto-scroll Left & Music Vinyl Right) */
.autoscroll-btn {
  position: fixed;
  top: 16px;
  left: max(14px, calc(50% - 204px));
  z-index: 60;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #E04F62;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(224, 79, 98, 0.38);
  transition: transform 0.2s, background-color 0.2s;
}
.autoscroll-btn:active {
  transform: scale(0.9);
}

.lang-switch-btn {
  position: fixed;
  top: 16px;
  left: max(14px, calc(50% - 204px));
  z-index: 60;
  height: 38px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1.5px solid rgba(110, 17, 27, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-color, #6E111B);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(110, 17, 27, 0.16);
  backdrop-filter: blur(8px);
  transition: transform 0.2s, left 0.25s ease;
}
.lang-switch-btn.opened {
  left: max(60px, calc(50% - 158px));
}
.lang-switch-btn:active {
  transform: scale(0.93);
}

.music-disc-btn {
  position: fixed;
  top: 16px;
  right: max(14px, calc(50% - 204px));
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(110, 17, 27, 0.3);
  backdrop-filter: blur(8px);
  transition: transform 0.2s;
}
.music-disc-btn:active {
  transform: scale(0.9);
}

/* 3D Envelope Cover */
.envelope-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 48px 24px 36px;
  text-align: center;
  user-select: none;
  background: radial-gradient(circle at center, #FFFDFB 0%, #F7EFEA 100%);
}

.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 332px;
  margin: 30px auto 18px;
  cursor: pointer;
  perspective: 1000px;
}

.envelope-back {
  width: 100%;
  height: 180px;
  border-radius: 12px 12px 0 0;
  background-color: var(--primary-color, #6E111B);
  position: relative;
  box-shadow: 0 12px 30px rgba(105, 20, 31, 0.28);
}

.envelope-flap {
  position: absolute;
  top: -92px;
  left: 0;
  right: 0;
  height: 93px;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  background-color: var(--primary-color, #6E111B);
  filter: brightness(0.86);
  transform-origin: bottom center;
  transition: transform 1.05s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.envelope-photo-card {
  position: absolute;
  top: -54px;
  left: 20px;
  right: 20px;
  height: 235px;
  background: #FFFFFF;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
  overflow: hidden;
  transition: transform 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.envelope-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
}

.envelope-wrapper.opening .envelope-photo-card {
  transform: translateY(-62px) scale(1.05);
}

.envelope-front {
  position: relative;
  width: 100%;
  height: 175px;
  border-radius: 0 0 14px 14px;
  background-color: var(--primary-color, #6E111B);
  z-index: 30;
  box-shadow: 0 18px 38px rgba(80, 12, 22, 0.35);
  overflow: hidden;
}

.envelope-fold-left {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 54%, 0 100%);
  background: rgba(255, 255, 255, 0.07);
}
.envelope-fold-right {
  position: absolute;
  inset: 0;
  clip-path: polygon(100% 0, 50% 54%, 100% 100%);
  background: rgba(0, 0, 0, 0.09);
}
.envelope-fold-bottom {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  background: rgba(0, 0, 0, 0.17);
}

.wax-seal {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 30%, #F5DF98, #C59B27 55%, #7D5810);
  border: 2px solid rgba(255, 238, 180, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF8DC;
  font-family: Georgia, serif;
  font-size: 18px;
  transition: transform 0.3s ease;
}

/* MẪU 2: Deep Burgundy Party Cards */
.mau2-party-card {
  background: linear-gradient(180deg, #74121D 0%, #5B0C15 100%);
  color: #FFFFFF;
  border-radius: 22px;
  padding: 24px 18px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(91, 12, 21, 0.26);
  border: 1px solid rgba(232, 184, 91, 0.28);
  margin-bottom: 18px;
}

.mau2-gold-date {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #EBB963;
  margin: 6px 0 4px;
  line-height: 1.15;
}

.mau2-direction-btn {
  display: inline-block;
  margin-top: 14px;
  background: #FFFFFF;
  color: #5B0C15;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 24px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease;
}
.mau2-direction-btn:active {
  transform: scale(0.95);
}

/* MẪU 2: 4 Burgundy Countdown Boxes */
.mau2-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 18px;
  margin-top: 18px;
}
.mau2-countdown-box {
  background: linear-gradient(180deg, #78131E 0%, #5E0D16 100%);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 12px 4px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(110, 17, 27, 0.24);
}

/* Gallery Swipe */
.gallery-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gallery-carousel::-webkit-scrollbar {
  display: none;
}
.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  position: relative;
  cursor: pointer;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
}

/* Floating Wishes Barrage & Bottom Bar (MẪU 2) */
.floating-wishes-container {
  position: fixed;
  bottom: 62px;
  left: max(12px, calc(50% - 208px));
  z-index: 48;
  max-width: 286px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.wish-pill {
  background: rgba(214, 96, 112, 0.88);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 11.5px;
  padding: 8px 13px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(110, 17, 27, 0.2);
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.wish-pill-rotator {
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.wish-pill-rotator.is-fading-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.wish-pill-rotator.is-fading-out {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

.floating-right-dock {
  position: fixed;
  bottom: 66px;
  right: max(12px, calc(50% - 208px));
  z-index: 49;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bottom-action-bar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 416px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}

/* Admin Panel Layout */
.admin-shell {
  min-height: 100vh;
  background-color: #F7F3F0;
  color: #1F2937;
  padding-bottom: 80px;
}
.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.admin-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}
.admin-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-bottom: 20px;
}
.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #D1D5DB;
  font-size: 14px;
  font-family: inherit;
  background: #FFFFFF;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  outline: none;
  border-color: #6E111B;
  box-shadow: 0 0 0 3px rgba(110, 17, 27, 0.15);
}
.admin-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background-color: #6E111B;
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  text-decoration: none;
}
.admin-btn-primary:hover {
  background-color: #550C14;
}
.admin-btn-primary:active {
  transform: scale(0.98);
}
.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background-color: #FFFFFF;
  color: #374151;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid #D1D5DB;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
}
.admin-btn-secondary:hover {
  background-color: #F9FAFB;
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.admin-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .admin-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Smooth Scroll Offsets & Mobile/Desktop Responsiveness */
#rsvp-section,
#gift-box-section {
  scroll-margin-top: 24px;
}

@supports (min-height: 100dvh) {
  .wedding-viewport,
  .wedding-mobile-frame,
  .envelope-screen {
    min-height: 100dvh;
  }
}

.bottom-action-bar {
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 640px) {
  .admin-input,
  .admin-textarea,
  .admin-select,
  #form-rsvp input[type="text"],
  #form-rsvp input[type="tel"],
  #form-rsvp select,
  #form-rsvp textarea {
    font-size: 16px !important;
  }

  .autoscroll-btn,
  .music-disc-btn {
    width: 44px;
    height: 44px;
  }
}
