:root {
  --bg-deep: #1A0B2E;
  --accent-pink: #FF6B9D;
  --accent-purple: #C084FC;
  --accent-blue: #60A5FA;
  --accent-teal: #2DD4BF;
  --text-light: #FFFFFF;
  --text-soft: rgba(255,255,255,0.85);
  --glass: rgba(255,255,255,0.12);
  --glass-border: rgba(255,255,255,0.18);
}

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

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--bg-deep);
  overflow: hidden;
  width: 100%;
  height: 100vh;
  position: fixed;
}

.viewport {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* === VIDEO CONTAINER === */
.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gradient-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,107,157,0.25) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(192,132,252,0.25) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(26,11,46,0.3) 0%, transparent 50%, rgba(26,11,46,0.6) 100%);
  z-index: 2;
  animation: flowShift 12s ease-in-out infinite;
}

@keyframes flowShift {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* === TOP TITLE === */
.top-title {
  position: absolute;
  top: env(safe-area-inset-top, 2rem);
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  padding: 2rem 1rem 0;
  animation: titleSlideDown 1s ease-out 0.5s both;
}

@keyframes titleSlideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

.name-part {
  position: relative;
}

.love-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: heartPulse 2s ease-in-out infinite;
}

.love-symbol svg {
  color: var(--accent-pink);
  filter: drop-shadow(0 0 12px rgba(255,107,157,0.8));
}

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

.date-text {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 1px;
  text-shadow: 0 1px 16px rgba(0,0,0,0.6);
}

/* === PLAY OVERLAY === */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26,11,46,0.5);
  z-index: 15;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.play-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-circle {
  position: relative;
  width: 90px;
  height: 90px;
  border: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 32px rgba(255,107,157,0.5),
    0 0 0 0 rgba(255,107,157,0.6);
  cursor: pointer;
  animation: circlePulse 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.play-circle:active {
  transform: scale(0.92);
}

@keyframes circlePulse {
  0%, 100% {
    box-shadow: 
      0 8px 32px rgba(255,107,157,0.5),
      0 0 0 0 rgba(255,107,157,0.6);
  }
  50% {
    box-shadow: 
      0 12px 48px rgba(255,107,157,0.7),
      0 0 0 20px rgba(255,107,157,0);
  }
}

.circle-ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-pink);
  border-radius: 50%;
  animation: rippleOut 2.5s ease-out infinite;
  opacity: 0;
}

@keyframes rippleOut {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* === SOUND OVERLAY === */
.sound-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.sound-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sound-bubble {
  padding: 1rem 1.8rem;
  border: none;
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(192,132,252,0.95));
  backdrop-filter: blur(20px);
  border-radius: 50px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 32px rgba(96,165,250,0.6);
  cursor: pointer;
  animation: bubbleFloat 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.sound-bubble:active {
  transform: scale(0.95);
}

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

/* === PROGRESS WAVE === */
.progress-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.progress-wave.visible {
  opacity: 1;
}

.wave-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#wavePath {
  animation: waveFlow 3s ease-in-out infinite;
}

@keyframes waveFlow {
  0%, 100% {
    d: path("M0,30 Q360,10 720,30 T1440,30 L1440,60 L0,60 Z");
  }
  50% {
    d: path("M0,30 Q360,50 720,30 T1440,30 L1440,60 L0,60 Z");
  }
}

/* === FLOATING BUBBLES === */
.bubbles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
}

.bubble {
  position: absolute;
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 2px 8px rgba(255,255,255,0.2);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  animation-duration: 6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  color: var(--text-light);
}

.bubble::before {
  content: attr(data-label);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: var(--text-light);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.bubble:active:not(.moved) {
  transform: scale(0.88);
}

.bubble:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Location Bubble - Top Left */
.bubble-location {
  top: 25%;
  left: 12%;
  background: linear-gradient(135deg, rgba(255,107,157,0.85), rgba(255,107,157,0.7));
  animation-name: floatA;
  transition: top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-location.moved {
  top: 20%;
  left: 5%;
  animation: none;
  transition: none;
}

@keyframes floatA {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(3px, -5px);
  }
}

/* RSVP Bubble - Top Right */
.bubble-rsvp {
  top: 30%;
  right: 12%;
  background: linear-gradient(135deg, rgba(192,132,252,0.85), rgba(192,132,252,0.7));
  animation-name: floatB;
  animation-delay: 0.5s;
  transition: top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), right 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-rsvp.moved {
  top: 35%;
  left: 5%;
  right: auto;
  animation: none;
  transition: none;
}

@keyframes floatB {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-3px, 5px);
  }
}

/* Info Bubble - Bottom Left */
.bubble-info {
  top: 72%;
  left: 15%;
  background: linear-gradient(135deg, rgba(96,165,250,0.85), rgba(96,165,250,0.7));
  animation-name: floatC;
  animation-delay: 1s;
  transition: top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-info.moved {
  top: 50%;
  left: 5%;
  animation: none;
  transition: none;
}

@keyframes floatC {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(4px, 3px);
  }
}

/* Share Bubble - Bottom Right */
.bubble-share {
  top: 68%;
  right: 15%;
  background: linear-gradient(135deg, rgba(45,212,191,0.85), rgba(45,212,191,0.7));
  animation-name: floatD;
  animation-delay: 1.5s;
  transition: top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), right 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-share.moved {
  top: 65%;
  left: 5%;
  right: auto;
  animation: none;
  transition: none;
}

@keyframes floatD {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-4px, -3px);
  }
}

/* === BACKDROP === */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26,11,46,0.92);
  backdrop-filter: blur(8px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: env(safe-area-inset-bottom, 0);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(245,245,250,0.95));
  backdrop-filter: blur(24px);
  border-radius: 28px 28px 0 0;
  padding: 2rem 1.5rem calc(env(safe-area-inset-bottom, 1rem) + 1.5rem);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.open .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  color: #333;
}

.modal-close-btn:hover {
  background: rgba(0,0,0,0.12);
}

.modal-close-btn:active {
  transform: scale(0.9);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 1.5rem 0;
}

/* === LOCATION MODAL === */
.place-card {
  background: white;
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.place-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.place-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.place-icon--ceremony {
  background: linear-gradient(135deg, #FF6B9D, #C084FC);
  color: white;
}

.place-icon--party {
  background: linear-gradient(135deg, #60A5FA, #2DD4BF);
  color: white;
}

.place-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 0.25rem 0;
}

.place-when {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  margin: 0;
}

.place-address {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.place-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s ease;
}

.place-map-link:hover {
  color: var(--accent-pink);
}

/* === INFO MODAL === */
.detail-section {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.detail-value {
  font-size: 1rem;
  color: #1A1A1A;
  line-height: 1.6;
}

/* === RSVP FORM === */
.field-wrapper {
  margin-bottom: 1.5rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-sub {
  font-weight: 500;
  color: #999;
  text-transform: none;
  letter-spacing: 0;
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.choice-box {
  position: relative;
  cursor: pointer;
}

.choice-box input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
}

.choice-box input:checked ~ .choice-content {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  border-color: var(--accent-pink);
  color: white;
}

/* Quantity Selector */
.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.8rem;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.qty-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  color: white;
  font-size: 1.6rem;
  font-weight: 600;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-display {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1A1A1A;
  min-width: 50px;
  text-align: center;
}

/* Text Field */
.text-field {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: #1A1A1A;
  background: white;
  transition: border-color 0.3s ease;
}

.text-field:focus {
  outline: none;
  border-color: var(--accent-purple);
}

/* Submit Button */
.submit-button {
  width: 100%;
  padding: 1.2rem;
  border: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,157,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 0.5rem;
}

.submit-button:hover {
  box-shadow: 0 6px 24px rgba(255,107,157,0.6);
}

.submit-button:active {
  transform: scale(0.98);
}

/* === SUCCESS MODAL === */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26,11,46,0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 1.5rem;
}

.success-modal.show {
  opacity: 1;
  visibility: visible;
}

.success-bubble {
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(250,250,255,0.98));
  backdrop-filter: blur(24px);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 340px;
  box-shadow: 
    0 16px 48px rgba(0,0,0,0.3),
    inset 0 2px 8px rgba(255,255,255,0.5);
  animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successBounce {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(255,107,157,0.5);
  animation: checkmarkGrow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes checkmarkGrow {
  0% {
    transform: scale(0) rotate(-180deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 0.8rem 0;
}

.success-text {
  font-size: 1rem;
  color: #666;
  margin: 0 0 2rem 0;
  line-height: 1.6;
}

.success-btn {
  padding: 1rem 2.5rem;
  border: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,157,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.success-btn:hover {
  box-shadow: 0 6px 24px rgba(255,107,157,0.6);
}

.success-btn:active {
  transform: scale(0.95);
}

/* === RESPONSIVE === */
@media (max-width: 400px) {
  .title-text {
    font-size: 1.6rem;
    gap: 0.6rem;
  }

  .love-symbol svg {
    width: 20px;
    height: 20px;
  }

  .bubble {
    width: 58px;
    height: 58px;
  }

  .bubble svg {
    width: 22px;
    height: 22px;
  }
}

/* DejaCast player fill parent (kill video.js 56.25% aspect hack) */
.video-container.has-dejacast-player .dejacast-embed,
.video-container.has-dejacast-player .video-element,
.video-container.has-dejacast-player .video-js,
.video-container.has-dejacast-player .video-js .vjs-tech,
.video-container.has-dejacast-player .video-js video,
.video-container.has-dejacast-player .video-js .vjs-poster {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}

.video-container.has-dejacast-player .video-js .vjs-tech,
.video-container.has-dejacast-player .video-js video {
  object-fit: cover !important;
}

.video-container.has-dejacast-player .video-js .vjs-poster {
  background-size: cover !important;
}
