/* ─────────────────────────────────────────
   Fullscreen player — lyrics overlay (FsLyricsApple)
   Synced + plain scrollable list. Other old fullscreen-player
   styles were removed with the legacy player.
──────────────────────────────────────────── */

/* ── Apple Music-style fullscreen lyrics ─────────────────────────────────────
   Full-screen scrollable list. Active line scrolls to ~35% from top.
   User scroll pauses auto-scroll for 4 s. Word-sync via imperative DOM updates. */

.fsa-lyrics-container {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 0 clamp(28px, 5vw, 72px);
  overscroll-behavior-x: none;
  /* pointer-events on children only — container itself scrollable */
  pointer-events: auto;
}

.fsa-lyrics-container::-webkit-scrollbar {
  display: none;
}

/* Top padding — clears the close button (44 px) + some breathing room */
.fsa-lyrics-top-pad {
  height: 80px;
  pointer-events: none;
}

/* Bottom padding — lets last line scroll to ~35% from top even on short tracks */
.fsa-lyrics-bottom-pad {
  height: 60vh;
  pointer-events: none;
}

/* ── Line base styles ── */
.fsa-lyric-line {
  /* Fixed font-size avoids layout reflow on active-line switch.
     Visual "size" difference is done via transform: scale below. */
  font-size: clamp(1.4rem, 3.2vh, 3rem);
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.28);
  margin-bottom: 0.45em;
  cursor: pointer;
  user-select: none;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  max-width: 100%;
  transform-origin: left center;
  /* All visual changes are compositor-friendly (color, text-shadow, transform) */
  transition:
    color      380ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    text-shadow 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform   380ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity     380ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(0.9);
  opacity: 0.9;
}

.fsa-lyric-line:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* Past: subtly smaller and more faded */
.fsa-lyric-line.fsal-past {
  color: rgba(255, 255, 255, 0.16);
  transform: scale(0.86);
  opacity: 0.7;
}

/* Active: full scale, bright, glowing — font-weight snaps (no layout cost on same size) */
.fsa-lyric-line.fsal-active {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  transform: scale(1);
  opacity: 1;
  text-shadow:
    0 0 48px color-mix(in srgb, var(--dynamic-fs-accent, var(--accent)), transparent 25%),
    0 2px 18px rgba(0, 0, 0, 0.55);
}

/* Word-sync — active line dims base so only lit words pop */
.fsa-lyric-line.fsal-active .fsa-lyric-word {
  color: rgba(255, 255, 255, 0.28);
  text-shadow: none;
}

.fsa-lyric-word {
  display: inline;
  white-space: pre-wrap;  /* preserves trailing spaces from lyricsplus tokens, allows wrapping */
  transition: color 160ms ease, text-shadow 160ms ease;
}

.fsa-lyric-line.fsal-active .fsa-lyric-word.played {
  color: rgba(255, 255, 255, 0.72);
}

.fsa-lyric-line.fsal-active .fsa-lyric-word.active {
  color: #ffffff;
  text-shadow: 0 0 32px color-mix(in srgb, var(--dynamic-fs-accent, var(--accent)), transparent 10%);
}

/* Plain (unsynced) lyrics */
.fsa-plain-lyrics {
  pointer-events: none;
}

/* Fade the bottom of the scroll viewport when showing plain lyrics */
.fsa-lyrics-container--plain {
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.fsa-plain-line {
  font-size: clamp(1.1rem, 2.5vh, 2.2rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 0.2em;
  word-break: break-word;
}
