/* =========================================================
   INVITACIÓN SIMPLE: MINECRAFT - JACKSON NIVEL 6
   Estilo Overworld, Bloques Pixelados, Diamante y Experiencia
   ========================================================= */

:root {
  --bg-deep: #0b140b;
  --bg-card: rgba(18, 34, 18, 0.88);
  --mc-green: #45a025;
  --mc-grass: #55c42a;
  --mc-diamond: #2ce8f5;
  --mc-tnt: #eb2f06;
  --mc-gold: #f6b93b;
  --wa-color: #25D366;
  --text-light: #f4fdf4;
  --text-muted: #c8dec8;
  --border-glass: rgba(255, 255, 255, 0.16);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.6);
}

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

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-light);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Fondo ambiental Overworld con gradientes de césped y diamantes */
body {
  background: 
    radial-gradient(circle at 50% 12%, rgba(69, 160, 37, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(44, 232, 245, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 90% 60%, rgba(246, 185, 59, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #091209 0%, #132413 50%, #070d07 100%);
  background-attachment: fixed;
}

/* Canvas de partículas perimetrales de experiencia y diamantes */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Accesibilidad para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================================================
   PANTALLA DE BIENVENIDA / ACTIVACIÓN DE AUDIO
   ========================================================= */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 6, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

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

.welcome-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(145deg, rgba(22, 42, 22, 0.95), rgba(11, 22, 11, 0.98));
  border: 2px solid rgba(69, 160, 37, 0.45);
  border-radius: 28px;
  padding: 34px 24px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(69, 160, 37, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: welcomePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes welcomePop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pixel-badge-ring {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  background: linear-gradient(135deg, #45a025, #2ce8f5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(44, 232, 245, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  margin-bottom: 18px;
  animation: badgePulse 2.2s infinite ease-in-out;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(44, 232, 245, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 35px rgba(69, 160, 37, 0.75); }
}

.pixel-badge {
  width: 66px;
  height: 66px;
  background: #0e200e;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2ce8f5;
}

.pixel-icon {
  width: 38px;
  height: 38px;
}

.welcome-tag {
  display: inline-block;
  background: rgba(69, 160, 37, 0.2);
  color: #70e000;
  border: 1px solid rgba(69, 160, 37, 0.45);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.welcome-title {
  font-family: 'Kanit', sans-serif;
  font-weight: 900;
  font-size: 1.75rem;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
  line-height: 1.15;
}

.welcome-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.btn-open-invite {
  background: linear-gradient(135deg, #45a025 0%, #2ce8f5 100%);
  color: #0b140b;
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(69, 160, 37, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-open-invite:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(44, 232, 245, 0.55);
}

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

/* =========================================================
   BOTÓN FLOTANTE DE CONTROL DE MÚSICA
   ========================================================= */
.music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  background: rgba(14, 28, 14, 0.85);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.music-toggle:hover {
  background: rgba(22, 44, 22, 0.95);
  border-color: rgba(69, 160, 37, 0.5);
  transform: scale(1.03);
}

.music-toggle:focus-visible {
  outline: 2px solid var(--mc-diamond);
  outline-offset: 2px;
}

.sound-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.sound-waves .bar {
  width: 3px;
  height: 4px;
  background: var(--mc-diamond);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.music-toggle.is-playing .bar-1 { animation: wave 0.8s infinite ease-in-out; }
.music-toggle.is-playing .bar-2 { animation: wave 0.8s infinite ease-in-out 0.2s; }
.music-toggle.is-playing .bar-3 { animation: wave 0.8s infinite ease-in-out 0.4s; }
.music-toggle.is-playing .bar-4 { animation: wave 0.8s infinite ease-in-out 0.1s; }

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.music-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */
.invite-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 70px 16px 40px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* =========================================================
   MARCO VIVO DE LA LÁMINA (IMAGEN ORIGINAL DE CANVA)
   ========================================================= */
.poster-card-wrapper {
  width: 100%;
  position: relative;
  margin-bottom: 24px;
  border-radius: 24px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(69, 160, 37, 0.45), rgba(44, 232, 245, 0.35), rgba(246, 185, 59, 0.3));
  box-shadow: var(--shadow-lg), 0 0 35px rgba(69, 160, 37, 0.25);
  transition: transform 0.3s ease;
}

.poster-frame {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #112211;
}

.poster-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
}

.poster-sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(44, 232, 245, 0.16) 0%, transparent 45%);
  pointer-events: none;
}

/* =========================================================
   SECCIÓN DE ACCIONES (RSVP, MAPA, CALENDARIO)
   ========================================================= */
.actions-section {
  width: 100%;
  position: relative;
}

.actions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.action-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

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

.action-btn:focus-visible {
  outline: 2px solid var(--mc-diamond);
  outline-offset: 2px;
}

/* Botón 1: RSVP */
.btn-rsvp {
  background: linear-gradient(135deg, #45a025 0%, #2ce8f5 100%);
  color: #0b140b;
  border: none;
  font-weight: 800;
}

.btn-rsvp:hover {
  box-shadow: 0 10px 25px rgba(69, 160, 37, 0.55);
}

/* Botón 2: Ubicación */
.btn-location {
  background: rgba(18, 38, 18, 0.9);
  border-color: rgba(44, 232, 245, 0.4);
}

.btn-location:hover {
  background: rgba(26, 52, 26, 0.95);
  border-color: var(--mc-diamond);
}

/* Botón 3: Calendario */
.btn-calendar {
  background: rgba(18, 38, 18, 0.9);
  border-color: rgba(246, 185, 59, 0.4);
}

.btn-calendar:hover {
  background: rgba(26, 52, 26, 0.95);
  border-color: var(--mc-gold);
}

.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menú desplegable calendario */
.calendar-dropdown {
  background: rgba(12, 26, 12, 0.98);
  border: 1px solid rgba(69, 160, 37, 0.4);
  border-radius: 16px;
  padding: 8px;
  margin-top: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: dropdownIn 0.25s ease-out;
}

@keyframes dropdownIn {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(69, 160, 37, 0.2);
  color: #70e000;
}

.dropdown-item:focus-visible {
  outline: 2px solid var(--mc-diamond);
}

.footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* =========================================================
   MODAL DE CONFIRMACIÓN DE ASISTENCIA (RSVP)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(5, 10, 5, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: modalFadeIn 0.3s ease;
}

@media (min-width: 500px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

@keyframes modalFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #193819, #0d1e0d);
  border: 1px solid rgba(69, 160, 37, 0.4);
  border-radius: 28px 28px 0 0;
  padding: 28px 20px;
  position: relative;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  animation: sheetUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 500px) {
  .modal-sheet {
    border-radius: 28px;
  }
}

@keyframes sheetUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(235, 47, 6, 0.8);
}

.modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.modal-badge {
  font-size: 2rem;
  margin-bottom: 6px;
}

.modal-header h3 {
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  color: #fff;
  margin-bottom: 4px;
}

.modal-header p {
  font-size: 0.88rem;
  color: var(--mc-diamond);
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(9, 20, 9, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #fff;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--mc-diamond);
  box-shadow: 0 0 10px rgba(44, 232, 245, 0.35);
}

.form-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.btn-rsvp-submit {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-rsvp-submit.btn-wa {
  background: #25D366;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.btn-rsvp-submit.btn-wa:hover {
  background: #20ba5a;
  transform: translateY(-1px);
}

.btn-rsvp-submit.btn-direct {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.btn-rsvp-submit.btn-direct:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rsvp-status {
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 8px;
}

.rsvp-status.error {
  background: rgba(235, 47, 6, 0.2);
  border: 1px solid rgba(235, 47, 6, 0.5);
  color: #ffb4a2;
}

.rsvp-success {
  text-align: center;
  padding: 20px 10px;
  animation: fadeIn 0.4s ease;
}

.rsvp-success .success-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.rsvp-success h4 {
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #2ce8f5;
  margin-bottom: 8px;
}

.rsvp-success p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* =========================================================
   PREFERS REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
