/* ============================================
   COMPONENTS.CSS — Sakura Dreams
   Section-specific component styles
   All colours via CSS custom properties
   ============================================ */

/* ============================================
   SPLASH SCREEN extras
   ============================================ */
.splash-sub {
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: rgba(247, 231, 166, 0.55);
  margin-top: var(--space-sm);
  letter-spacing: 0.05em;
}

/* ============================================
   HERO
   ============================================ */
.hero-cta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.hero-scroll-hint {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: rgba(255,248,245,0.35);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
  z-index: 3;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid rgba(244, 167, 185, 0.4);
  border-bottom: 1.5px solid rgba(244, 167, 185, 0.4);
  transform: rotate(45deg);
}

/* ============================================
   ENVELOPE (Love Letter Section)
   ============================================ */
.envelope-svg {
  width: min(280px, 70vw);
  height: auto;
  filter: drop-shadow(0 8px 30px rgba(244, 167, 185, 0.3));
  /* native cursor */
  transition: filter var(--transition-base);
}
.envelope-svg:hover {
  filter: drop-shadow(0 12px 40px rgba(244, 167, 185, 0.5));
}

.envelope-prompt {
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: #7A4F62;
  opacity: 0.85;
  text-align: center;
  animation: float 2.2s ease-in-out infinite;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* Wax Seal SVG */
.wax-seal-svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 4px 12px rgba(244, 167, 185, 0.4));
}

/* ============================================
   FLIP CARDS — Why You're Special
   ============================================ */
.flip-card-front .flip-card-hint {
  font-size: 0.7rem;
  color: var(--rose);
  opacity: 0.6;
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

/* Hover effect on front - only on pointer devices with true hover */
@media (hover: hover) {
  .flip-card:not(.flipped):hover .flip-card-inner {
    transform: rotateY(20deg);
  }
}

/* ============================================
   POLAROID GALLERY
   ============================================ */
.gallery-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.5;
  margin-bottom: var(--space-xl);
  font-style: italic;
  font-family: var(--font-script);
  font-size: 1rem;
}

/* ============================================
   LIGHTBOX POLAROID MODAL (High-contrast, elegant framing)
   ============================================ */
.lightbox-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

.lightbox-polaroid {
  position: relative;
  background: #FFFDF9;
  padding: 16px 16px 20px 16px;
  border-radius: 12px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 45px rgba(244, 167, 185, 0.35);
  max-width: min(92vw, 560px);
  width: 100%;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  box-sizing: border-box;
}

.lightbox-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 120px;
  height: 26px;
  background: rgba(244, 167, 185, 0.8);
  border-left: 3px dashed rgba(255, 255, 255, 0.6);
  border-right: 3px dashed rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
  border-radius: 2px;
  z-index: 5;
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  gap: 12px;
  z-index: 2;
}

.lightbox-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7A3554;
  background: rgba(244, 167, 185, 0.22);
  border: 1px solid rgba(244, 167, 185, 0.45);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.lightbox-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF5F8;
  border: 1px solid rgba(244, 167, 185, 0.55);
  color: #3B2030;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(92, 58, 74, 0.08);
}

.lightbox-save-btn:hover {
  background: var(--rose);
  color: #1A0F18;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(244, 167, 185, 0.45);
}

.lightbox-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #1A0E18;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.lightbox-img {
  max-width: 100%;
  max-height: clamp(280px, 55vh, 490px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Authentic Polaroid Chin — crystal-clear dark typography with high contrast */
.lightbox-chin {
  width: 100%;
  padding: 14px 10px 4px 10px;
  text-align: center;
}

.lightbox-caption-text {
  font-family: var(--font-script, 'Dancing Script', cursive);
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  color: #1F0E1B !important; /* Rich deep espresso/black — 100% crystal-clear readability */
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 6px 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.lightbox-chin-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lightbox-chin-subtext {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: #8C4B67;
  letter-spacing: 0.02em;
}

.lightbox-nav-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  margin-top: 14px;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  width: 100%;
  display: block;
}

@media (max-width: 640px) {
  .lightbox-polaroid {
    max-width: min(88vw, 380px);
    margin: 0 auto !important;
    padding: 12px 12px 14px 12px;
    border-radius: 12px;
  }

  .lightbox-tape {
    width: 90px;
    height: 22px;
    top: -11px;
  }

  .lightbox-top-bar {
    margin-bottom: 8px;
  }

  .lightbox-badge {
    font-size: 0.74rem;
    padding: 3px 9px;
  }

  .lightbox-save-btn {
    font-size: 0.74rem;
    padding: 4px 10px;
  }

  .lightbox-img {
    max-height: clamp(200px, 42vh, 340px);
  }

  .lightbox-chin {
    padding: 10px 6px 2px 6px;
  }

  .lightbox-caption-text {
    font-size: clamp(1.2rem, 3.2vw, 1.45rem);
    margin: 0 0 3px 0;
  }

  .lightbox-chin-subtext {
    font-size: 0.74rem;
  }

  .lightbox-nav-hint {
    font-size: 0.76rem;
    margin-top: 10px;
    margin-bottom: 4.5rem;
    width: 100%;
    max-width: 290px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================
   TIMELINE
   ============================================ */
/* Alternating connector arrows */
.timeline-item::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  right: calc(50% - 1.5rem);
  width: 1.5rem;
  height: 1.5px;
  background: rgba(244, 167, 185, 0.4);
}

.timeline-item:nth-child(even)::before {
  left: calc(50% - 1.5rem);
  right: auto;
}

@media (max-width: 768px) {
  .timeline-item::before,
  .timeline-item:nth-child(even)::before {
    display: none;
  }
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--rose-15), var(--lavender-20), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}
.stat-card:hover .stat-card-glow { opacity: 1; }

/* ============================================
   MUSIC PLAYER
   ============================================ */
.music-error-msg {
  font-size: 0.82rem;
  color: rgba(255,248,245,0.4);
  text-align: center;
  font-style: italic;
  padding: var(--space-sm);
  display: none;
}
.music-error-msg.show { display: block; }

.volume-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  padding: 0 4px;
}

.volume-icon {
  background: none;
  border: none;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 248, 245, 0.6);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--transition-base), transform var(--transition-base);
}

.volume-icon:hover {
  color: var(--rose);
  transform: scale(1.15);
}

.volume-icon svg {
  display: block;
}

.volume-slider {
  flex: 1;
  appearance: none;
  height: 3px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    var(--rose) 0%,
    var(--rose) var(--vol, 70%),
    rgba(255,255,255,0.15) var(--vol, 70%)
  );
  outline: none;
  /* native cursor */
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: #fff;
  /* native cursor */
  box-shadow: 0 0 6px rgba(244, 167, 185, 0.5);
  transition: transform var(--transition-base);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.volume-slider:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}

/* ============================================
   CHAT SECTION
   ============================================ */
.chat-date-badge {
  align-self: center;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.75rem;
  font-size: 0.68rem;
  color: rgba(255,248,245,0.35);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin: var(--space-xs) 0;
}

.chat-sender-label {
  font-size: 0.68rem;
  color: rgba(255,248,245,0.3);
  margin-bottom: 0.15rem;
  font-family: var(--font-mono);
}
.chat-bubble-group.right .chat-sender-label {
  text-align: right;
}

.chat-bubble-group {
  display: flex;
  flex-direction: column;
}
.chat-bubble-group.right { align-items: flex-end; }
.chat-bubble-group.left  { align-items: flex-start; }

/* ============================================
   PETAL GAME
   ============================================ */
.game-instructions {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,248,245,0.4);
  font-family: var(--font-mono);
  margin-bottom: var(--space-md);
  letter-spacing: 0.04em;
}

.game-canvas-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(244, 167, 185, 0.15);
}

.game-canvas-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(244,167,185,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   GUESTBOOK
   ============================================ */
.guestbook-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text);
  opacity: 0.4;
  font-style: italic;
  font-family: var(--font-script);
  font-size: 1.1rem;
}

/* Note pastel backgrounds */
.note-pastel-1 { background: #FFF0F3; }
.note-pastel-2 { background: #F0EEFF; }
.note-pastel-3 { background: #FFF8ED; }
.note-pastel-4 { background: #EDFFED; }
.note-pastel-5 { background: #EDF5FF; }

/* ============================================
   SECTION DIVIDERS / DECORATIONS
   ============================================ */
.petal-divider {
  text-align: center;
  font-size: 1.2rem;
  opacity: 0.25;
  letter-spacing: 0.5em;
  padding: var(--space-sm) 0;
  user-select: none;
}

/* Floating background petals (decorative) */
.bg-petal {
  position: absolute;
  font-size: 8rem;
  opacity: 0.03;
  user-select: none;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-top-btn {
  position: fixed;
  bottom: max(1.2rem, calc(env(safe-area-inset-bottom, 0px) + 0.8rem));
  right: max(1.2rem, calc(env(safe-area-inset-right, 0px) + 0.8rem));
  width: 44px;
  height: 44px;
  background: rgba(244, 167, 185, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 1.15rem;
  /* native cursor */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(244, 167, 185, 0.35);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-spring);
  pointer-events: auto;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--rose);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(244, 167, 185, 0.5);
}

.scroll-top-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    right: max(1rem, env(safe-area-inset-right, 1rem));
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }
}

/* ============================================
   MOBILE NAV CLOSE INDICATOR
   ============================================ */
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   TOOLTIP
   ============================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep-bg2);
  color: rgba(255,248,245,0.85);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: var(--z-above);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ============================================
   SELECTION COLOUR
   ============================================ */
::selection {
  background: rgba(244, 167, 185, 0.35);
  color: var(--text);
}

/* ============================================
   FOCUS-VISIBLE GLOBAL RULE (accessibility)
   ============================================ */
:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

/* ============================================
   HERO AVATAR & PHOTO ENHANCEMENTS
   ============================================ */
.hero-avatar-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto var(--space-md);
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid rgba(244, 167, 185, 0.7);
  box-shadow:
    0 0 25px rgba(244, 167, 185, 0.45),
    0 0 50px rgba(201, 184, 232, 0.25);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.hero-card:hover .hero-avatar-img {
  transform: scale(1.06) rotate(-2deg);
  box-shadow:
    0 0 35px rgba(244, 167, 185, 0.7),
    0 0 65px rgba(247, 231, 166, 0.4);
}

.hero-avatar-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: rgba(255, 248, 245, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1.5px solid var(--rose);
  animation: float 2.5s ease-in-out infinite;
}

/* ============================================
   VINTAGE LOVE LETTER POSTAGE STAMP
   ============================================ */
.letter-stamp {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 62px;
  height: 78px;
  padding: 4px 4px 14px 4px;
  background: #fff;
  border-radius: 2px;
  box-shadow:
    0 4px 15px rgba(92, 58, 74, 0.12),
    0 0 0 2px rgba(244, 167, 185, 0.35);
  transform: rotate(5deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
  cursor: pointer;
}

.letter-stamp:hover {
  transform: rotate(0deg) scale(1.12);
  box-shadow: 0 8px 25px rgba(244, 167, 185, 0.4);
}

.letter-stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 2px;
  filter: contrast(1.05) saturate(1.05);
}

.letter-stamp .stamp-heart {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
}

/* ============================================
   POLAROID IMAGES & LIGHTBOX ENHANCEMENTS
   ============================================ */
.photo-placeholder.has-image {
  opacity: 1;
  background: rgba(244, 167, 185, 0.1);
  overflow: hidden;
  position: relative;
}

.photo-placeholder.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.polaroid:hover .photo-placeholder.has-image img {
  transform: scale(1.05);
}

.polaroid.featured-photo {
  /* Real polaroids have clean photographic edges */
  box-shadow: 0 12px 32px rgba(92, 58, 74, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ============================================
   FLOATING AMBIENT BGM CONTROLLER
   ============================================ */
.bgm-pill {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  left: max(1rem, env(safe-area-inset-left, 1rem));
  z-index: 990;
  display: flex;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: auto;
}

.bgm-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.15rem;
  background: rgba(45, 27, 46, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(244, 167, 185, 0.45);
  border-radius: 9999px;
  color: #FFF8F5;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow:
    0 8px 30px rgba(26, 15, 24, 0.4),
    0 0 18px rgba(244, 167, 185, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.bgm-toggle-btn:hover {
  background: rgba(61, 32, 64, 0.95);
  border-color: rgba(244, 167, 185, 0.8);
  box-shadow:
    0 12px 40px rgba(26, 15, 24, 0.5),
    0 0 28px rgba(244, 167, 185, 0.55);
  transform: translateY(-2px) scale(1.04);
}

.bgm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bgm-svg-playing {
  display: none;
  color: var(--rose);
}

.bgm-svg-muted {
  display: inline-block;
  color: rgba(255, 248, 245, 0.7);
}

.bgm-pill.is-playing .bgm-svg-playing {
  display: inline-block;
}

.bgm-pill.is-playing .bgm-svg-muted {
  display: none;
}

.bgm-label {
  letter-spacing: 0.02em;
}

.bgm-label strong {
  color: var(--gold);
  font-weight: 600;
}

/* Sound wave equalizer bars */
.bgm-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  padding-left: 2px;
}

.bgm-wave-bar {
  width: 2.5px;
  background: linear-gradient(to top, var(--rose), var(--gold));
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.bgm-pill.is-playing .bgm-wave-bar:nth-child(1) {
  animation: bgmWave 1.1s ease-in-out infinite alternate;
}
.bgm-pill.is-playing .bgm-wave-bar:nth-child(2) {
  animation: bgmWave 0.8s ease-in-out infinite alternate 0.2s;
}
.bgm-pill.is-playing .bgm-wave-bar:nth-child(3) {
  animation: bgmWave 1.3s ease-in-out infinite alternate 0.1s;
}
.bgm-pill.is-playing .bgm-wave-bar:nth-child(4) {
  animation: bgmWave 0.9s ease-in-out infinite alternate 0.3s;
}

.bgm-pill.is-paused .bgm-wave-bar {
  height: 3px !important;
  opacity: 0.35;
}

@keyframes bgmWave {
  0% { height: 3px; }
  100% { height: 14px; }
}

@media (max-width: 768px) {
  .bgm-pill {
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    left: max(1rem, env(safe-area-inset-left, 1rem));
  }
  .bgm-label {
    display: none;
  }
  .bgm-toggle-btn {
    padding: 0.55rem 0.75rem;
    min-width: 44px;
    height: 44px;
    justify-content: center;
    background: rgba(36, 20, 36, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(244, 167, 185, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 14px rgba(244, 167, 185, 0.25);
  }
  .bgm-waves {
    height: 12px;
  }
}

/* Hide floating controls when fullscreen modals, overlays, or mobile drawer are active, or when in #music, #reelstorm, #game, #chats */
.bgm-pill.in-music-section,
body.in-music-section .bgm-pill,
body.in-music-section .scroll-top-btn,
body.in-game-section .bgm-pill,
body.in-game-section .scroll-top-btn,
body.in-chat-section .bgm-pill,
body.in-chat-section .scroll-top-btn,
body.modal-open .bgm-pill,
body.modal-open .scroll-top-btn,
body.nav-open .bgm-pill,
body.nav-open .scroll-top-btn,
body.lightbox-open .bgm-pill,
body.lightbox-open .scroll-top-btn,
body.rs-gameover-open .bgm-pill,
body.rs-gameover-open .scroll-top-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

@media (max-width: 768px) {
  /* Gently dock floating controls during downward reading on phones to avoid obscuring text */
  body.scroll-down .scroll-top-btn,
  body.scroll-down .bgm-pill {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(16px) !important;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
}
