/* --- STILI MENU HEADER --- */
#main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 0.8rem 1.5rem;
}

.romantic-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  gap: 1rem;
}

/* FRECCIA PER TORNARE INDIETRO */
.menu-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  color: #e63946;
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(230, 57, 70, 0.12);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.menu-back-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-4px) scale(1.08);
  box-shadow: 0 6px 20px rgba(255, 77, 141, 0.25);
}

/* CONTENITORE BOLLE */
.menu-bubbles-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* SINGOLA BOLLA */
.menu-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.1);
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.menu-bubble:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #ff85a2;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 77, 141, 0.25);
}

.bubble-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff4d8d, #e63946);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 3px 10px rgba(255, 77, 141, 0.3);
}

.bubble-content {
  display: flex;
  flex-direction: column;
}

.bubble-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #881b3a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.click-hint {
  font-family: 'Dancing Script', cursive;
  font-size: 0.95rem;
  text-transform: none;
  color: #e63946;
  font-weight: 700;
}

.bubble-timer {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e63946;
  font-variant-numeric: tabular-nums;
}

/* ANIMAZIONE AL CLICK SULLA BOLLA */
.bubble-pop {
  animation: popScale 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.12) rotate(2deg); }
  100% { transform: scale(1); }
}

/* =========================================
   🟢 FIX RESPONSIVE AL 1000% (MOBILE & TABLET)
   ========================================= */

@media (max-width: 768px) {
  /* 1. HERO E CARD PRINCIPALE */
  .hero-section {
    padding: 1rem;
    min-height: calc(100vh - 80px); /* Lascia spazio al menu */
  }
  
  .glass-card {
    padding: 1.5rem 1rem; /* Riduciamo i bordi interni */
    border-radius: 20px;
    width: 100%;
  }

  .title-romantic {
    font-size: 2.2rem !important; /* Rimpiccioliamo il titolo */
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  .typing-container {
    font-size: 1rem;
    min-height: 4rem;
    margin-bottom: 1rem;
  }

  /* 2. MENU SUPERIORE COMPATTO */
  .romantic-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem;
  }

  .menu-back-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    position: absolute; /* Lo stacchiamo dal flusso delle bolle */
    left: 10px;
    top: 18px;
  }

  .menu-bubbles-container {
    width: 100%;
    justify-content: center;
    gap: 1rem;
    margin-top: -0.5rem; /* Spazio per la freccia indietro */
    margin-left: 15%;
  }

  .menu-bubble {
    padding: 0.4rem 0.6rem;
    gap: 6px;
  }

  .bubble-icon {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .bubble-title {
    font-size: 0.65rem;
  }

  .bubble-timer {
    font-size: 0.75rem;
  }

  .click-me-cursive {
    display: none; /* Nascondiamo il "cliccami" sul menu per fare spazio */
  }

  /* 3. GRIGLIA DATE (2 Agosto / 3 Novembre) */
  .milestones-grid {
    grid-template-columns: 1fr; /* Una sotto l'altra su mobile */
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .milestone-card {
    padding: 1rem;
  }

  /* 4. BOTTONE ARCHIVIO */
  .btn-archive-super {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    width: 100%; /* Occupa tutta la larghezza su mobile */
    justify-content: center;
  }

  /* 5. FIX FINESTRA MODALE (POPUP) */
  .modal-card {
    padding: 1rem;
    max-height: 90vh; /* Evita che esca dallo schermo in altezza */
    overflow-y: auto; /* Permette lo scroll se lo schermo è bassissimo */
    border-radius: 20px;
  }

  #modal-title {
    font-size: 1.6rem !important;
  }

  .modal-close-btn {
    top: 5px;
    right: 10px;
    font-size: 1.8rem;
  }

  .modal-precise-box {
    padding: 0.8rem;
  }

  /* Griglia tempo esatto: 3 colonne invece di 6 */
  .exact-counter-grid {
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 0.5rem;
  }

  .time-unit span {
    font-size: 1rem;
  }

  .time-unit small {
    font-size: 0.6rem;
  }

  .stat-value {
    font-size: 1rem;
  }
}

/* FIX EXTRA PER SCHERMI VERAMENTE PICCOLI (es. iPhone SE) */
@media (max-width: 380px) {
  .exact-counter-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 colonne se strettissimo */
  }
  .menu-bubbles-container {
    flex-direction: column; /* Bolle una sotto l'altra */
    align-items: center;
  }
}

/* =========================================
   🔒 MODAL / CARD SENZA SCROLL + SFOCATURA PROFONDA
   ========================================= */

/* Sfondo scuro e profondamente sfocato */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* Sfondo semi-trasparente e sfocatura attiva su tutti i browser supportati */
  background: rgba(45, 10, 20, 0.45);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  
  /* Blocco totale dello scroll della pagina sottostante */
  touch-action: none;
  overflow: hidden;
}

.modal-overlay.modal-active {
  opacity: 1;
  pointer-events: auto;
}

/* Card compatta e NO-SCROLL */
.modal-card {
  position: relative;
  max-width: 460px;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 1.5rem 1.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 
              0 0 40px rgba(255, 77, 141, 0.25);
  transform: scale(0.85) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Garantisce zero scrollbar interna */
  overflow: hidden !important;
  box-sizing: border-box;
}

.modal-overlay.modal-active .modal-card {
  transform: scale(1) translateY(0);
}

/* Tasto Chiusura x */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #e63946;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.modal-close-btn:hover {
  transform: scale(1.2) rotate(90deg);
}

/* Header della Modale */
.modal-header {
  text-align: center;
}

.modal-icon-wrap {
  margin-bottom: 0.2rem;
}

.modal-icon-wrap i {
  font-size: 2rem;
}

/* BOX TEMPO ESATTO (GRID COMPATTA 3x2) */
.modal-precise-box {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  padding: 0.8rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin: 1rem 0;
}

.modal-precise-box h3 {
  font-size: 0.75rem;
  color: #e63946;
  margin-bottom: 0.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.exact-counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.4rem;
}

.time-unit {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgba(255, 77, 141, 0.08);
}

.time-unit span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e63946;
  line-height: 1.1;
}

.time-unit small {
  font-size: 0.65rem;
  color: #881b3a;
  font-weight: 600;
  margin-top: 2px;
}

/* GRIGLIA STATISTICHE COMPATTA (2 COLONNE) */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  text-align: center;
}

.stat-full {
  grid-column: span 2;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #ff4d8d;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.68rem;
  color: #4a1525;
  font-weight: 600;
}

/* ADATTAMENTO DENSITÀ MOBILE PER EVITARE SCROLL */
@media (max-width: 480px) {
  .modal-card {
    padding: 1.2rem 1rem;
    border-radius: 22px;
  }
  
  #modal-title {
    font-size: 1.4rem !important;
  }

  #modal-subtitle {
    font-size: 0.8rem !important;
    margin-bottom: 0.8rem !important;
  }

  .stat-value {
    font-size: 0.9rem;
  }
}

/* Utilizzo dell'altezza reale su Mobile */
body, .hero-section {
  min-height: calc(var(--vh, 1vh) * 100);
}

/* Rende istantanei i click su dispositivi touch senza ritardi di sistema */
.menu-bubble, .btn-archive-super, .modal-close-btn, .click-me-cursive {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}










/* =========================================
   🌸 ROMANTIC FOOTER STYLES
   ========================================= */

.romantic-footer {
  width: 100%;
  margin-top: 4rem;
  padding: 2.5rem 1rem 1.5rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 230, 238, 0.4) 100%);
  border-top: 1px solid rgba(255, 182, 193, 0.3);
  box-sizing: border-box;
  text-align: center;
}

.footer-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

/* Citazione */
.footer-quote p {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #8b3a52;
  margin: 0;
  opacity: 0.9;
}

/* Pulsante Bacio */
.btn-kiss {
  background: linear-gradient(135deg, #ff4d8d 0%, #ff758c 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(255, 77, 141, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-kiss:active, .btn-kiss.kiss-active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(255, 77, 141, 0.2);
}

.pulse-icon {
  animation: heartPulse 1.5s infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Testo Finale */
.footer-dedication {
  font-size: 0.88rem;
  color: #4a1525;
  margin: 0;
}

.footer-dedication strong {
  color: #ff4d8d;
}

.footer-copy {
  font-size: 0.75rem;
  color: #999;
  display: block;
  margin-top: 0.3rem;
}