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

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Poppins",
    "Segoe UI",
    sans-serif;
}

/* Fundo geral */
.love-page {
  min-height: 100vh;
  padding: 16px;
  background: radial-gradient(
    circle at top,
    #ffc2d6 0,
    #ff9aba 35%,
    #ffb5c7 70%,
    #ffcad4 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden; /* só esconde no eixo X */
}

/* Corações caindo */
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.heart {
  position: absolute;
  top: -10%;
  animation-name: heartFall;
  animation-timing-function: linear;
  color: #ffffff;
  text-shadow: 0 4px 10px rgba(255, 0, 90, 0.4);
  --drift: 0px;
  --rotate: 0deg;
}

@keyframes heartFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate3d(var(--drift), 120vh, 0) rotate(var(--rotate))
      scale(1.1);
  }
}

/* Tela inicial */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}

.intro-overlay--hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* card abaixo da overlay */
.love-card {
  position: relative;
  z-index: 10;
}

/* corações atrás de tudo */
.hearts-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* box da intro */
.intro-box {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  padding: 24px 22px;
  max-width: 320px;
  text-align: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: introBoxIn 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

@keyframes introBoxIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.intro-mini {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 6px;
}

.intro-box h1 {
  font-size: 1.3rem;
  margin: 0 0 14px;
}

.intro-button {
  border: none;
  padding: 9px 24px;
  border-radius: 999px;
  background: #ff7fb5;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.intro-button:hover,
.intro-button:focus-visible,
.share-btn:hover,
.share-btn:focus-visible,
.story-btn:hover,
.story-btn:focus-visible,
.guestbook-btn:hover,
.guestbook-btn:focus-visible,
.music-btn:hover,
.music-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
}

/* Card principal */
.love-card {
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
  border-radius: 26px;
  padding: 20px 16px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  color: #fff;
  animation: cardIn 0.6s ease-out;
  position: relative;
  z-index: 1;
  margin: 10px 0 40px; /* sobe um pouco o card p/ caber legenda no Insta */
}

.love-card--hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

/* Cabeçalho */
.love-header {
  text-align: center;
  margin-bottom: 18px;
}

.avatar-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  border-radius: 50%;
  padding: 3px;
  background: radial-gradient(circle at top, #fff0f6, #ff7aa2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.love-header h1 {
  font-size: 1.6rem;
  margin: 4px 0;
}

.since {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Estatísticas */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 10px 12px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

/* Bloco das fotos */
.photos {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 10px 10px 12px;
}

.photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.photos-header h2 {
  font-size: 1.05rem;
  margin: 0;
}

.photos-icon {
  font-size: 1.2rem;
}

/* Galeria (carrossel) */
.gallery-wrapper {
  position: relative;
}

.gallery {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.gallery::-webkit-scrollbar {
  display: none;
}

/* FOTO RESPONSIVA – sem height fixa */
.gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 60vh;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
  transform: scale(1.01);
}

.gallery img.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* celulares muito altos */
@media (max-height: 900px) {
  .gallery {
    min-height: 55vh;
  }
}

/* celulares médios */
@media (max-height: 750px) {
  .gallery {
    min-height: 50vh;
  }
}

/* celulares pequenos */
@media (max-height: 650px) {
  .gallery {
    min-height: 44vh;
  }
}

/* celulares bem antigos */
@media (max-height: 550px) {
  .gallery {
    min-height: 38vh;
  }
}

@media (max-height: 480px) {
  .gallery {
    min-height: 34vh;
  }
}

/* Foto 1 personalizada (só enquadramento) */
.foto1 {
  object-fit: cover !important;
  object-position: center 35% !important;
}

/* Lightbox para fotos */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 10, 16, 0.88);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.photo-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-lightbox__image {
  width: min(100%, 900px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.photo-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery img {
  cursor: zoom-in;
}

/* Pontinhos do carrossel */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.gallery-dots button {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  padding: 0;
  cursor: pointer;
}

.gallery-dots button.active {
  width: 14px;
  background: #ffffff;
}

/* Ações sociais */
.social-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.share-btn,
.story-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.share-btn {
  background: linear-gradient(135deg, #ff7fb5, #ff4d8d);
}

.story-btn {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
}

/* Mensagem final */
.message {
  margin-top: 10px;
  font-size: 0.95rem;
  text-align: center;
  opacity: 0.95;
}

/* Seção de recados */
.guestbook-card,
.timeline-card {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 12px 12px 14px;
}

.guestbook-note {
  margin: 6px 0 8px;
  font-size: 0.92rem;
  opacity: 0.95;
}

.guestbook-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  font-family: "Comic Sans MS", "Segoe Script", "Brush Script MT", cursive;
  font-size: 1rem;
  color: #7a2950;
  outline: none;
}

.guestbook-btn {
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: #ff7fb5;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.guestbook-message {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #fff4f8;
}

.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 6px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-left: 26px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: 0;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.timeline-item h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.timeline-item p {
  margin: 0;
  font-size: 0.84rem;
  opacity: 0.9;
}

/* Botão da música */
.music-btn {
  margin-top: 10px;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.music-btn.playing {
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.music-btn__icon {
  font-size: 1rem;
  line-height: 1;
}

.music-btn__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.music-btn__title {
  font-size: 0.92rem;
  font-weight: 700;
}

.music-btn__status {
  font-size: 0.74rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.music-btn__waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  min-width: 18px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.music-btn__waves span {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  animation: musicWave 1s infinite ease-in-out;
  transform-origin: bottom;
}

.music-btn__waves span:nth-child(2) {
  animation-delay: 0.15s;
  height: 8px;
}

.music-btn__waves span:nth-child(3) {
  animation-delay: 0.3s;
  height: 12px;
}

.music-btn.playing .music-btn__waves {
  opacity: 1;
  transform: scale(1);
}

@keyframes musicWave {
  0%,
  100% {
    transform: scaleY(0.4);
  }
  50% {
    transform: scaleY(1);
  }
}

/* Story preview */
.story-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 10, 16, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.story-preview-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.story-preview-card {
  width: min(92vw, 400px);
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(135deg, #ff8fb8 0%, #ff5d91 55%, #ffb9cb 100%);
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.story-preview-overlay.is-open .story-preview-card {
  transform: scale(1);
}

.story-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.story-preview-top h3 {
  margin: 4px 0 4px;
  font-size: 1.2rem;
}

.story-preview-kicker,
.story-preview-subtitle,
.story-preview-footer p {
  margin: 0;
  opacity: 0.95;
}

.story-preview-middle p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-family: "Comic Sans MS", "Segoe Script", "Brush Script MT", cursive;
}

.story-preview-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* Confete e mensagem de aniversário */
.birthday-message {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 80;
  pointer-events: none;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  animation: birthdayFade 2.8s ease forwards;
}

.confetti-piece {
  position: absolute;
  top: -10%;
  width: 8px;
  height: 16px;
  border-radius: 999px;
  opacity: 0.9;
  animation: confettiFall 2.4s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift), 110vh, 0) rotate(720deg);
  }
}

@keyframes birthdayFade {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  20%,
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

/* Animação de entrada do card */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Desktop */
@media (min-width: 700px) {
  .love-page {
    padding: 24px;
  }

  .love-card {
    max-width: 480px;
    margin: 24px 0 40px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
