/* ========================================================
   4. SAVE THE DATE (HERO) & NÚT NHẠC
   ======================================================== */
.floating-music {
  position: fixed !important;
  top: auto !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  z-index: 998;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink-dark) !important;
  border-radius: 50%;
  background: var(--polaroid);
  color: var(--ink-dark);
  box-shadow: var(--hard-shadow);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.6s ease, transform 0.15s ease;
}

.floating-music:hover { background: var(--note-yellow); }

.floating-music.playing { background: var(--note-yellow); }

.floating-music:focus-visible {
  outline: 2px solid var(--accent-red) !important;
  outline-offset: 3px;
}

.floating-music .music-icon {
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
}

.floating-music.playing .music-icon {
  animation: spin-vinyl 4s linear infinite;
}

/* Nút nổi chỉ hiện sau khi mở thiệp, tránh đè lên bìa */
body:not(.invite-open):not(.invite-opening) .floating-music {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Save the date ---------- */
#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

/* Hai ảnh polaroid chồng nhau */
.envelope-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 334 / 420;
}

.hero-polaroid {
  position: absolute;
  background: var(--polaroid);
  box-shadow: var(--shadow-lg);
}

.hero-polaroid--main {
  left: 0;
  top: 0;
  z-index: 1;
  width: 72%;
  padding: 10px 10px 44px;
  container-type: inline-size;
  rotate: -4deg;
}

.hero-polaroid--main .photo-frame {
  aspect-ratio: 4 / 5;
  cursor: pointer;
}

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  margin: 0;
  padding: 0 2px;
  font-family: var(--font-hand);
  font-size: 22px;
  font-size: min(22px, 9.1cqi);
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-polaroid--small {
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 46%;
  padding: 8px 8px 30px;
  rotate: 6deg;
}

.hero-polaroid--small::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 30%;
  z-index: 1;
  width: 64px;
  height: 22px;
  background: var(--tape-blue);
  transform: rotate(-8deg);
}

.hero-photo-small {
  aspect-ratio: 1;
  background: var(--photo-2);
}

.hero-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-quote {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
  color: var(--ink-soft);
}

@media (max-width: 420px) {
  .hero-quote { font-size: 20px; }
}
