/* ── base resets ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #664f43;
  color: #fdfbf7;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ── 1. entry screen ── */
.entry-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #8c7365 0%, #664f43 85%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s cubic-bezier(0.85, 0, 0.15, 1), visibility 1s;
}

.entry-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.entry-card {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wax-seal-wrapper {
  margin-bottom: 30px;
  perspective: 1000px;
}

.wax-seal {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 35%, #e83e60 0%, #b81635 60%, #85041a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 10px 25px rgba(133, 4, 26, 0.45),
    inset 2px 2px 4px rgba(255, 255, 255, 0.25),
    inset -3px -3px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transform: rotate(-10deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid rgba(133, 4, 26, 0.65);
}

.wax-seal:hover {
  transform: scale(1.05) rotate(5deg);
}

.wax-seal:active {
  transform: scale(0.95);
}

.wax-text {
  font-family: 'Cormorant Garamond', serif;
  color: #fffdf5;
  font-size: 34px;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  opacity: 0.9;
}

.entry-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: #fdfbf7;
}

.entry-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(253, 251, 247, 0.65);
  margin-bottom: 30px;
  line-height: 1.5;
}

/* Loader bar */
.loader-bar {
  width: 160px;
  height: 2px;
  background-color: rgba(253, 251, 247, 0.08);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 20px;
}

.loader-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e52b50);
  transition: width 0.3s ease;
}

.enter-btn {
  background: linear-gradient(135deg, #e52b50, #b71c3c);
  border: none;
  color: #ffffff;
  padding: 12px 30px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(229, 43, 80, 0.3);
  transition: all 0.3s ease;
  animation: fadeIn 0.8s ease;
}

.enter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 43, 80, 0.45);
}

.enter-btn:active {
  transform: translateY(1px);
}

/* ── 2. main content screen ── */
.main-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  transition: opacity 1.5s ease;
}

.three-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Overlay UI */
.overlay-ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none; /* Let canvas capture drag gestures */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

/* Top guest badge */
.guest-badge {
  align-self: center;
  background-color: rgba(13, 9, 10, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(253, 251, 247, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 1s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 10px;
}

.guest-name {
  color: #c9a84c;
  font-weight: 700;
}

/* UI Flex Groups */
.ui-top-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-top: 60px; /* Space for the top header buttons */
  pointer-events: none;
}

.ui-top-group * {
  pointer-events: auto;
}

.ui-bottom-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-top: auto;
  pointer-events: none;
}

.ui-bottom-group * {
  pointer-events: auto;
}

/* UI Cards */
.wedding-header-card {
  pointer-events: auto;
  align-self: center;
  max-width: 380px;
  width: 90%;
  background-color: rgba(13, 9, 10, 0.65);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(253, 251, 247, 0.08);
  border-radius: 24px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: slideDown 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.wedding-details-card {
  pointer-events: auto;
  align-self: center;
  max-width: 380px;
  width: 90%;
  background-color: rgba(13, 9, 10, 0.65);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(253, 251, 247, 0.08);
  border-radius: 24px;
  padding: 20px 24px;
  text-align: center;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.names-header {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #fdfbf7;
  margin-bottom: 4px;
}

/* Date block (Horizontal & Compact) */
.date-container {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.date-block {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(253, 251, 247, 0.1);
  border-bottom: 1px solid rgba(253, 251, 247, 0.1);
  padding: 6px 20px;
}

.date-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: #c9a84c;
}

.date-separator {
  color: rgba(253, 251, 247, 0.25);
  font-weight: 300;
  font-size: 14px;
}

.date-month-year {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(253, 251, 247, 0.85);
}

.venue-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(253, 251, 247, 0.4);
  margin-bottom: 4px;
}

.venue-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: #fdfbf7;
  margin-bottom: 24px;
}

/* Countdown */
.countdown-grid {
  display: grid;
  grid-cols: 4;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-val {
  font-size: 20px;
  font-weight: 600;
  color: #c9a84c;
  font-family: monospace;
}

.countdown-lbl {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(253, 251, 247, 0.35);
  margin-top: 2px;
}

/* Maps button */
.maps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background-color: rgba(253, 251, 247, 0.04);
  border: 1px solid rgba(253, 251, 247, 0.15);
  border-radius: 14px;
  color: #fdfbf7;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
  cursor: pointer;
}

.maps-btn:hover {
  background-color: #fdfbf7;
  color: #0d090a;
  border-color: #fdfbf7;
  box-shadow: 0 4px 15px rgba(253, 251, 247, 0.15);
}

/* Rotate Hint */
.drag-hint {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(253, 251, 247, 0.3);
  margin-bottom: 10px;
}

/* Toggle UI Button */
.toggle-ui-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 30;
  pointer-events: auto;
  background-color: rgba(13, 9, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(253, 251, 247, 0.15);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(253, 251, 247, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-ui-btn:hover {
  background-color: rgba(253, 251, 247, 0.95);
  color: #0d090a;
  border-color: rgba(253, 251, 247, 0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

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

.overlay-ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-ui.hidden-ui {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  pointer-events: none !important;
}

.overlay-ui.hidden-ui .wedding-header-card,
.overlay-ui.hidden-ui .wedding-details-card {
  pointer-events: none !important;
}

/* Floating Maps Button at Top Left */
.floating-maps-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 30;
  pointer-events: auto;
  background-color: rgba(13, 9, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(253, 251, 247, 0.15);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fdfbf7;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s;
}

.floating-maps-btn span {
  display: none;
}

.floating-maps-btn:hover {
  background-color: #fdfbf7;
  color: #0d090a;
  border-color: #fdfbf7;
  box-shadow: 0 6px 20px rgba(253, 251, 247, 0.25);
}

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

/* Cinematic Slideshow Overlay */
.cinematic-texts {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #8a7366 0%, #664f43 100%);
  pointer-events: none;
}

.cinematic-slide {
  position: absolute;
  text-align: center;
  max-width: 320px;
  width: 90%;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-slide.show {
  opacity: 1;
  transform: scale(1);
}

.cinematic-heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #c9a84c;
  margin-bottom: 12px;
}

.cinematic-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 300;
  font-style: italic;
  color: #fdfbf7;
  line-height: 1.2;
}

.cinematic-body-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 300;
  font-style: italic;
  color: #fdfbf7;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.cinematic-guest-highlight {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  color: #c9a84c;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ── Floating Congratulate Button ── */
.congratulate-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 30;
  pointer-events: auto;
  background-color: rgba(229, 43, 80, 0.85); /* Romantic crimson-rose red */
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 22px;
  padding: 0 18px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(229, 43, 80, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s;
}

.congratulate-btn .btn-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.congratulate-btn .btn-icon {
  margin-top: -1px;
}

.congratulate-btn:hover {
  transform: scale(1.08);
  background-color: #e52b50;
  box-shadow: 0 6px 25px rgba(229, 43, 80, 0.6);
}

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

/* Wishes Modal */
.wishes-modal {
  position: fixed;
  inset: 0;
  z-index: 105;
  background-color: rgba(13, 9, 10, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

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

.wishes-modal-content {
  background-color: rgba(30, 21, 23, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(253, 251, 247, 0.12);
  border-radius: 28px;
  width: 90%;
  max-width: 400px;
  padding: 30px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #fdfbf7;
}

.wishes-modal.show .wishes-modal-content {
  transform: scale(1);
}

.wishes-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: rgba(253, 251, 247, 0.5);
  font-size: 26px;
  cursor: pointer;
  transition: color 0.3s;
}

.wishes-modal-close:hover {
  color: #fdfbf7;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 6px;
  color: #c9a84c;
  text-align: center;
}

.modal-subtitle {
  font-size: 11px;
  color: rgba(253, 251, 247, 0.55);
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(253, 251, 247, 0.5);
}

.form-group input, .form-group textarea {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(253, 251, 247, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fdfbf7;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.3s, background-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: #c9a84c;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Voice Recorder controls */
.voice-recorder-section {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-recorder-section label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(253, 251, 247, 0.5);
}

.recorder-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(253, 251, 247, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
}

.record-btn {
  background-color: rgba(229, 43, 80, 0.15);
  border: 1px solid rgba(229, 43, 80, 0.4);
  border-radius: 10px;
  padding: 6px 14px;
  color: #e52b50;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.record-btn.recording {
  background-color: #e52b50;
  color: #ffffff;
  animation: pulseRecord 1.2s infinite;
}

@keyframes pulseRecord {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.97); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.recording-status {
  font-size: 11px;
  color: rgba(253, 251, 247, 0.55);
}

.play-recorded-btn {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 10px;
  padding: 6px 12px;
  color: #c9a84c;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.play-recorded-btn:hover {
  background-color: rgba(201, 168, 76, 0.15);
}

.submit-wish-btn {
  width: 100%;
  background: linear-gradient(135deg, #c9a84c, #9e7f33);
  border: none;
  border-radius: 14px;
  padding: 12px;
  color: #0d090a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.25);
  transition: all 0.3s;
}

.submit-wish-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

/* Floating message container and bubbles */
.floating-wishes-container {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.wish-bubble {
  position: absolute;
  pointer-events: auto; /* Allow users to click wishes */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 12px 18px;
  max-width: 240px;
  color: #fdfbf7;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: floatUpAnimation 12s linear forwards;
}

.wish-bubble-name {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c9a84c;
  font-weight: 700;
}

.wish-bubble-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.3;
  color: rgba(253, 251, 247, 0.9);
}

/* Audio progress bar */
.wish-audio-progress-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.wish-audio-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #c9a84c, #f0d080);
  border-radius: 99px;
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.6);
  /* width transitions to 0% via JS when audio plays */
}

/* Waveform icon + label */
.wish-audio-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: #c9a84c;
}

.wish-audio-icon span {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(201, 168, 76, 0.8);
}

@keyframes floatUpAnimation {
  0% {
    transform: translateY(110vh) translateX(0) scale(0.85);
    opacity: 0;
  }
  8% {
    opacity: 1;
    transform: translateY(90vh) translateX(var(--sway-x-1)) scale(1);
  }
  50% {
    transform: translateY(50vh) translateX(var(--sway-x-2)) scale(1);
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20vh) translateX(var(--sway-x-3)) scale(0.9);
    opacity: 0;
  }
}
