/* ═══════════════════════════════════════════════
   LyricsFlow — Lyrics Styles
   Ported from Lyrics/main.css + Lyrics/Mixed.css
   ═══════════════════════════════════════════════ */

/* ── Lyrics Container ── */
#LyricsflowPage .LyricsContainer {
  height: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  width: 100%;
  z-index: 4;
  flex: 1;
}

#LyricsflowPage .LyricsContainer.Hidden {
  display: none;
}

/* ── Lyrics Content ── */
#LyricsflowPage .LyricsContainer .LyricsContent {
  --TextGlowDef: rgba(255, 255, 255, 0.15) 0px 0px 6px;
  --ActiveTextGlowDef: rgba(111, 111, 111, 0.4) 0px 0px 14px;
  --StrongTextGlowDef: rgba(255, 255, 255, 0.322) 0px 0px 16.4px;
  --StrongerTextGlowDef: rgba(201, 201, 201, 0.74) 0px 0px 16px;
  --DefaultLyricsSize: clamp(1.85rem, calc(1cqw * 7), 3.5rem);
  --Simplebar-Scrollbar-Color: rgba(255, 255, 255, 0.6);
  --vertical-gap: 0px;

  overflow-x: clip !important;
  overflow-clip-margin: 200px;
  overflow-y: auto !important;
  height: calc(100% - var(--vertical-gap));
  width: 100%;
  font-size: var(--DefaultLyricsSize) !important;
  font-weight: 700;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  z-index: 9;
  transition: scrollbar-color 0.3s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent:hover {
  scrollbar-color: rgba(255, 255, 255, 0.38) transparent;
}

#LyricsflowPage .LyricsContainer .LyricsContent::-webkit-scrollbar {
  width: 6px;
}

#LyricsflowPage .LyricsContainer .LyricsContent::-webkit-scrollbar-track {
  background: transparent;
}

#LyricsflowPage .LyricsContainer .LyricsContent::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.25s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.38);
}

#LyricsflowPage .LyricsContainer .LyricsContent::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.65);
}

#LyricsflowPage .LyricsContainer .LyricsContent {
  --ImageMask: linear-gradient(180deg,
      transparent 0,
      transparent 16px,
      #000 64px,
      #000 calc(100% - 100px),
      transparent calc(100% - 20px),
      transparent);

  -webkit-mask-image: var(--ImageMask);
  mask-image: var(--ImageMask);
  container-type: size;
  opacity: 1;
  transition: opacity 0.25s;

  padding-left: var(--LyricsLeftSidePadding);
  padding-right: var(--LyricsRightSidePadding);
  font-family: var(--lyricsflow-custom-font, inherit);
  font-synthesis: none !important;
  text-rendering: optimizeLegibility !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line {
  font-weight: 700;
  font-synthesis: none !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent.HiddenTransitioned {
  opacity: 0;
}

/* ── Scroll Container ── */
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer {
  container-type: inline-size !important;
  width: 100cqw;
  transition: padding-right 0.4s, padding-left 0.4s;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  margin-top: 25cqh;
  padding-bottom: 75vh;
}


/* ═══════════════════════════════════════════════
   Lines — Base
   ═══════════════════════════════════════════════ */

:root {
  --LyricsFlow-LineSpacing: 0 1cqw 25px;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line {
  --font-size: var(--DefaultLyricsSize);
  display: block;
  text-align: left !important;
  opacity: 0.35;
  filter: blur(var(--blur-amount, 0px));
  transform: translate3d(0, var(--ty, 0px), 0) scale(var(--line-scale, 0.98));
  transform-origin: left center;
  margin-bottom: clamp(14px, 0.45em, 32px) !important;
  padding: 0.28em 0.7em !important;
  border-radius: 18px;
  position: relative;
  transition:
    opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    filter 0.35s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: var(--font-size) !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line::before {
  content: "";
  position: absolute;
  inset: -2px -8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: -1;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line:hover::before {
  opacity: 1;
  transform: scale(1);
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.tap-pop {
  animation: lineTapPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes lineTapPop {
  0% {
    transform: translate3d(0, var(--ty, 0px), 0) scale(calc(var(--line-scale, 1) * 0.96));
  }

  50% {
    transform: translate3d(0, var(--ty, 0px), 0) scale(calc(var(--line-scale, 1) * 1.03));
  }

  100% {
    transform: translate3d(0, var(--ty, 0px), 0) scale(var(--line-scale, 1));
  }
}

#LyricsflowPage .LyricsContainer .LyricsContent:has(.line:hover) .line {
  filter: blur(0px) !important;
  transition: filter 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line::before {
  content: "";
  position: absolute;
  inset: 0 -0.5em;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: -1;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line:hover::before {
  opacity: 1;
  transform: scale(1);
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.static {
  cursor: pointer;
  font-weight: 700;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  background-image: linear-gradient(var(--gradient-degrees, 90deg),
      rgba(255, 255, 255, var(--gradient-alpha, 0.9)) var(--gradient-position, -20%),
      rgba(255, 255, 255, var(--gradient-alpha-end, 0.35)) calc(var(--gradient-position, -20%) + var(--gradient-fade-width, 20%) + var(--gradient-offset, 0%)));
  position: relative;
  white-space: pre-wrap;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: geometricPrecision !important;
  font-synthesis: none !important;
  font-variant-ligatures: normal !important;
  font-feature-settings: "liga" 1, "calt" 1, "kern" 1 !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

/* GPU-promote only active and nearby lines to avoid 500+ compositing layers */
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letter {
  will-change: transform, opacity;
}

/* ── Gradient Variables ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line,
#LyricsflowPage .LyricsContainer .LyricsContent .line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letter {
  --gradient-position: -20%;
  --gradient-color: 255;
  --gradient-alpha: 0.85;
  --gradient-alpha-end: 0.4;
  --gradient-degrees: 90deg;
  --gradient-offset: 0%;
}

/* ── Line Base Properties ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line {
  --BlurAmount: 0px;
  --DefaultLyricsScale: 1.0;
  --DefaultEmphasisLyricsScale: 1.0;
  --line-scale: 0.98;
  --Vocal-NotSung-opacity: 0.38;
  --Vocal-Active-opacity: 1;
  --Vocal-Sung-opacity: 0.38;
  --Vocal-Hover-opacity: 0.85;
  --gradient-degrees: 90deg;
  --gradient-alpha: 0.9;
  --gradient-alpha-end: 0.35;
  letter-spacing: 0;
  --lyrics-line-height: 1.1818181818;
  line-height: var(--lyrics-line-height) !important;
  unicode-bidi: plaintext !important;
  text-align: start;
}

/* ── Active Line ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active {
  --line-scale: 1;
  opacity: 1 !important;
  --gradient-alpha: 1 !important;
  --gradient-alpha-end: 0.45 !important;
  transition: none;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.static {
  background-image: linear-gradient(var(--gradient-degrees, 90deg),
      rgba(255, 255, 255, var(--gradient-alpha, 1)) var(--gradient-position, -20%),
      rgba(255, 255, 255, var(--gradient-alpha-end, 0.45)) calc(var(--gradient-position, -20%) + var(--gradient-fade-width, 20%) + var(--gradient-offset, 0%)));
}

/* ── NotSung State ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung {
  opacity: var(--Vocal-NotSung-opacity);
  --gradient-position: -20% !important;
  text-shadow: 0 0 var(--BlurAmount, 0) rgba(var(--gradient-color), var(--gradient-color), var(--gradient-color), calc(var(--gradient-alpha-end) * 0.55));
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung .letter {
  --text-shadow-blur-radius: 0px !important;
  --text-shadow-opacity: 0% !important;
  --gradient-position: -20% !important;
}

/* ── Sung State ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung,
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer[data-lyrics-type="Static"] .line {
  opacity: var(--Vocal-Sung-opacity);
  --gradient-position: 100% !important;
  text-shadow: 0 0 var(--BlurAmount, 0) color-mix(in srgb, rgba(var(--ArtworkGlowColor, 255, 255, 255), calc(var(--gradient-alpha) * 0.55)) 15%, rgba(255, 255, 255, calc(var(--gradient-alpha) * 0.55)));
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung .letter {
  --gradient-position: 100% !important;
}

/* RTL line and word gradient direction: 270deg sweeps right-to-left */
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl,
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word-group {
  --gradient-degrees: 270deg !important;
  font-variant-ligatures: normal !important;
  font-feature-settings: "liga" 1, "calt" 1, "kern" 1 !important;
  letter-spacing: normal !important;
}

/* ── Active State ── */
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer[data-lyrics-type="Syllable"] .line.Active {
  opacity: 1 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer[data-lyrics-type="Syllable"] .line:not(.Active) {
  opacity: 0.38 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer[data-lyrics-type="Syllable"] .line:not(.Active):hover {
  opacity: 0.85 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.Active {
  opacity: 1;
  --BlurAmount: 0px !important;
  /*margin-top: 2.5cqw !important;
  margin-bottom: 2.5cqw !important;*/
  /* disgusting */
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letterGroup,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letterGroup .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letter {
  opacity: 1;
}

/* ── Text Shadow ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup {
  --text-shadow-blur-radius: 4px;
  --text-shadow-opacity: -30%;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Active .letterGroup {
  text-shadow: 0 0 var(--text-shadow-blur-radius) color-mix(in srgb, rgba(var(--ArtworkGlowColor, 255, 255, 255), var(--text-shadow-opacity)) 15%, rgba(255, 255, 255, var(--text-shadow-opacity)));
}

/* ── Word Display ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line:not(.musical-line) .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letter {
  display: inline-block;
  unicode-bidi: isolate;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup {
  display: inline-flex;
  direction: ltr !important;
  unicode-bidi: isolate;
  vertical-align: baseline;
}

/* ── Word Spacing (Logical Gap) ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line .word:not(.PartOfWord, .dot, .LastWordInLine)::after,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup:not(.PartOfWord, .dot, .LastWordInLine)::after {
  content: "";
  margin-inline-end: 0.3ch;
}

/* ── Word Groups ── */
.word-group {
  display: inline;
  white-space: nowrap;
}

.OppositeAligned .word-group {
  text-align: end;
}

/* ── Transform Origins ── */
#LyricsflowPage .LyricsContainer .LyricsContent .line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letter {
  transform-origin: center center;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .word.PartOfWord,
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup.PartOfWord {
  transform-origin: right center;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .word.PartOfWord+ :is(.word.PartOfWord, .letterGroup.PartOfWord),
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup.PartOfWord+ :is(.word.PartOfWord, .letterGroup.PartOfWord) {
  transform-origin: center center;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .word.PartOfWord+ :is(.word, .letterGroup),
#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup.PartOfWord+ :is(.word, .letterGroup) {
  transform-origin: left center;
}

/* ═══════════════════════════════════════════════
   RTL (Right-to-Left) Rules
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl {
  text-align: start !important;
  direction: rtl !important;
  unicode-bidi: isolate !important;
  transform-origin: center center !important;
  font-weight: 700 !important;
  font-synthesis: none !important;
  font-variant-ligatures: normal;
  font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
  letter-spacing: 0 !important;
  --lyrics-line-height: 1.45;
  line-height: var(--lyrics-line-height) !important;
  padding-top: 0.35em !important;
  overflow: visible !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl.OppositeAligned {
  text-align: end !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word-group {
  --gradient-degrees: -90deg !important;
  transform-origin: center center;
  font-weight: 900 !important;
  vertical-align: baseline !important;
  font-variant-ligatures: normal;
  font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word-group {
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0 !important;
  vertical-align: baseline !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl .word-group .word {
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
  vertical-align: baseline !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl :is(.word, .letterGroup).PartOfWord {
  display: inline-block !important;
  transform-origin: left center;
  margin-inline-end: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  letter-spacing: 0 !important;
  vertical-align: baseline !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl :is(.word, .letterGroup).PartOfWord::after {
  content: none !important;
  margin: 0 !important;
  width: 0 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl :is(.word, .letterGroup).PartOfWord+ :is(.word, .letterGroup) {
  display: inline-block !important;
  transform-origin: center center;
  margin-inline-end: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  letter-spacing: 0 !important;
  vertical-align: baseline !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.rtl :is(.word, .letterGroup).PartOfWord+ :is(.word, .letterGroup):not(.PartOfWord) {
  transform-origin: right center;
  margin-inline-end: 0.3ch;
  vertical-align: baseline !important;
}

/* ═══════════════════════════════════════════════
   Opposite Aligned Lines (Duet Mode)
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line.OppositeAligned {
  text-align: right !important;
  transform-origin: right center !important;
}

/* Duet Singer Distinction: subtle singer-2 styling.
   Composes the progressive line blur (--blur-amount) with the singer glow so
   the singer drop-shadow no longer overrides the blur filter. */
#LyricsflowPage .LyricsContainer .LyricsContent .line.singer-2 {
  filter: blur(var(--blur-amount, 0px)) drop-shadow(0 0 16px rgba(130, 180, 255, 0.15));
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.singer-1 {
  filter: blur(var(--blur-amount, 0px)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.1));
}

/* Word spacing for OppositeAligned is inherited from the base ::after rule (margin-inline-end: 0.3ch) */

/* Padding for opposite-aligned layouts (Duets) */
#LyricsflowPage .LyricsContainer .LyricsContent:has(.OppositeAligned) .line.OppositeAligned,
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer.has-opposite .line.OppositeAligned {
  padding-left: 20cqw !important;
  padding-right: 2cqw !important;
  text-align: right !important;
  transform-origin: right center !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent:has(.OppositeAligned) .line:not(.OppositeAligned),
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer.has-opposite .line:not(.OppositeAligned) {
  padding-right: 20cqw !important;
  padding-left: 2cqw !important;
  text-align: left !important;
  transform-origin: left center !important;
}

/* RTL Duet Alignment: In RTL (Arabic), primary singer is right-aligned, opposite singer is indented to left */
#LyricsflowPage .LyricsContainer .LyricsContent:has(.OppositeAligned) .line.rtl:not(.OppositeAligned),
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer.has-opposite .line.rtl:not(.OppositeAligned) {
  padding-right: 2cqw !important;
  padding-left: 20cqw !important;
  text-align: right !important;
  transform-origin: right center !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent:has(.OppositeAligned) .line.rtl.OppositeAligned,
#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer.has-opposite .line.rtl.OppositeAligned {
  padding-left: 2cqw !important;
  padding-right: 20cqw !important;
  text-align: left !important;
  transform-origin: left center !important;
}

/* Ensure pronunciation and translation subtext inherits line alignment */
#LyricsflowPage .LyricsContainer .LyricsContent .line .line-subtext {
  text-align: inherit;
}

#LyricsflowPage .LyricsContainer .LyricsContent:not(:has(.OppositeAligned)):not(:has(.has-opposite)) .line {
  padding-right: 5cqw;
}

#LyricsflowPage .LyricsContainer .LyricsContent:not(:has(.OppositeAligned)):not(:has(.has-opposite)) .line.rtl {
  padding-left: 5cqw;
}

/* ═══════════════════════════════════════════════
   Hover States
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung:hover,
#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung:hover .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.NotSung:hover .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung:hover,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung:hover .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.Sung:hover .letter {
  opacity: var(--Vocal-Hover-opacity, 1) !important;
  --BlurAmount: 0px !important;
}

/* ═══════════════════════════════════════════════
   Line-Synced Specific
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer[data-lyrics-type="Line"] .line {
  --text-shadow-blur-radius: 4px;
  --text-shadow-opacity: 0%;
  transform-origin: left center;
  transition:
    scale 0.2s cubic-bezier(0.37, 0, 0.63, 1),
    opacity 0.2s cubic-bezier(0.37, 0, 0.63, 1) !important;
  margin: var(--LyricsFlow-LineSpacing, 2cqw 0);
}

#LyricsflowPage .LyricsContainer .LyricsflowScrollContainer[data-lyrics-type="Line"] .line:not(.Active) {
  --text-shadow-blur-radius: 4px !important;
  --text-shadow-opacity: 0% !important;
}

#LyricsflowPage .LyricsContainer .LyricsflowScrollContainer[data-lyrics-type="Line"] .line.OppositeAligned {
  transform-origin: right center;
}

/* ═══════════════════════════════════════════════
   Static Lyrics
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsflowScrollContainer[data-lyrics-type="Static"] {
  --DefaultLyricsSize: clamp(0.8rem, calc(1cqw * 5), 2.5rem);
}

#LyricsflowPage .LyricsContainer .LyricsflowScrollContainer[data-lyrics-type="Static"] .line {
  font-weight: 500 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.static {
  cursor: default;
  opacity: 1 !important;
  --gradient-alpha: 1 !important;
  --gradient-alpha-end: 1 !important;
  --gradient-position: 100% !important;
}

/* ═══════════════════════════════════════════════
   Non-Musical Line Spacing
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line:not(.musical-line) {
  margin: var(--LyricsFlow-LineSpacing, 1cqw 0);
}

/* ═══════════════════════════════════════════════
   Musical Lines (Interlude Dots)
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line {
  position: relative;
  transform-origin: left center !important;
  display: flex !important;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0 !important;
  padding: 0 0.7em !important;
  z-index: 1;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.35s ease,
    opacity 0.35s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line .dotGroup {
  --dot-gap: clamp(8px, 0.8cqw, 18px);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--dot-gap);
  transform-origin: left center;
  transform: scale(0.6);
  opacity: 0;
  will-change: transform, scale, opacity;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line .dotGroup .dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--DefaultLyricsSize) * 1.8) !important;
  line-height: 1 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  border-radius: 50%;
  user-select: none;
  pointer-events: none;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.Active {
  max-height: calc(var(--DefaultLyricsSize) * 2.4);
  padding: 0.28em 0.7em !important;
  margin-top: clamp(8px, 0.3em, 20px) !important;
  margin-bottom: clamp(14px, 0.45em, 32px) !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.Active .dotGroup {
  transform: scale(1);
  opacity: 1;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.OppositeAligned,
#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.rtl {
  justify-content: flex-end;
  transform-origin: right center !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.OppositeAligned .dotGroup,
#LyricsflowPage .LyricsContainer .LyricsContent .line.musical-line.rtl .dotGroup {
  transform-origin: right center;
}

/* ═══════════════════════════════════════════════
   Background Lines
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .letterGroup .letter,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word .letter {
  --gradient-alpha: 0.75 !important;
  --gradient-alpha-end: 0.3 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word.active,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word.sung,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .letterGroup .letter.active,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .letterGroup .letter.sung,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word .letter.active,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word .letter.sung {
  --gradient-alpha: 1 !important;
  --gradient-alpha-end: 0.55 !important;
}

/* AMLL-style bg-wrapper in normal flow: max-height animated by a
   critically-damped spring in lyrics-animator.js (advanceBgSlide), so the
   line's space grows/shrinks smoothly and overflow is clipped while
   collapsed. */
#LyricsflowPage .LyricsContainer .LyricsContent .line .bg-wrapper {
  display: block;
  width: 100%;
  max-height: 0px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform-origin: left top;
  transform: translateY(-8px);
  transition: opacity 0.3s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .bg-wrapper.top {
  transform-origin: left bottom;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .bg-wrapper.active {
  opacity: 0.75;
  pointer-events: auto;
  overflow: visible !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line {
  display: block !important;
  width: 100% !important;
  margin: 0.3em 0 0 0 !important;
  padding: 0 0 0.25em 0 !important;
  line-height: 1.35 !important;
  text-align: inherit !important;
  transform: none !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line .bg-wrapper.top .line.bg-line {
  margin: 0 0 0.3em 0 !important;
  padding: 0.25em 0 0 0 !important;
  line-height: 1.35 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .word,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .letterGroup,
#LyricsflowPage .LyricsContainer .LyricsContent .line.bg-line .letterGroup .letter {
  --font-size: calc(var(--DefaultLyricsSize) * 0.72);
  font-size: var(--font-size) !important;
  font-weight: 600 !important;
}

/* ═══════════════════════════════════════════════
   Letter Groups
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup {
  display: inline-flex;
}

/* ═══════════════════════════════════════════════
   Credits / Song Info
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent .Credits {
  --font-size: calc(var(--DefaultLyricsSize) * 0.4);
  font-weight: 500 !important;
  font-size: var(--font-size) !important;
  margin: 8cqw 0 0 !important;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 4cqw;
  display: flex;
  flex-direction: column;
  gap: 0.5cqw;
  transform: translate3d(0, var(--ty, 0px), 0);
  transition: opacity 0.3s ease;
}

#LyricsflowPage .LyricsContainer .LyricsContent .CreditLine {
  opacity: 0.8;
  transition: opacity 0.2s;
}

#LyricsflowPage .LyricsContainer .LyricsContent .CreditNotice {
  opacity: 0.4;
  font-size: 0.85em;
  margin-top: 1cqw;
  font-weight: 400 !important;
}

#LyricsflowPage .LyricsContainer .LyricsContent .MakerSection {
  display: flex;
  flex-direction: column;
  gap: 0.4cqw;
}

#LyricsflowPage .LyricsContainer .LyricsContent .maker-link {
  color: #fff;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.9;
  cursor: pointer;
}

#LyricsflowPage .LyricsContainer .LyricsContent .maker-link:hover {
  opacity: 1;
  border-bottom-color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

#LyricsflowPage .LyricsContainer .LyricsContent .SongInfo {
  --font-size: calc(var(--DefaultLyricsSize) * 0.35);
  font-size: var(--font-size) !important;
  font-weight: 600;
  margin: 2cqw 0 0 !important;
  color: white;
  scale: 1;
  display: flex;
  flex-direction: column;
  gap: 0.29cqw;
}

/* ═══════════════════════════════════════════════
   Lyrics Notice (empty state)
   ═══════════════════════════════════════════════ */

.LyricsNotice {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: white;
  transform: translate(-50%, -50%);
  font-weight: 500;
  opacity: .7;
}

.LyricsNotice .notice-descriptor {
  font-size: clamp(1.25rem, 3.5cqw, 2.5rem);
}

/* ═══════════════════════════════════════════════
   Hide Line Blur
   ═══════════════════════════════════════════════ */

#LyricsflowPage .LyricsContainer .LyricsContent.HideLineBlur .line {
  --blur-amount: 0px !important;
  --BlurAmount: 0px !important;
  filter: none !important;
}

#LyricsflowPage .LyricsContainer:hover .LyricsContent .line {
  --blur-amount: 0px !important;
  --BlurAmount: 0px !important;
  filter: none !important;
}

/* Spacer for centering last line */
.lyrics-spacer {
  height: 50vh;
  width: 100%;
  pointer-events: none;
}

/* ── Mobile Responsive Fix ── */
@media (max-width: 768px) {
  #LyricsflowPage .LyricsContainer .LyricsContent {
    --DefaultLyricsSize: clamp(2rem, calc(1cqw * 10), 3.5rem) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    text-align: center;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  }

  #LyricsflowPage .LyricsContainer .LyricsContent .LyricsflowScrollContainer {
    width: 100%;
    margin-top: 0vh !important;
    padding-top: 12dvh !important;
    padding-bottom: 25dvh !important;
  }

  :root {
    --Lyricsflow-LineSpacing: 0.25cqw 0;
  }

  #LyricsflowPage .LyricsContainer .LyricsContent .line {
    padding: 2px 10px !important;
    transform-origin: left center !important;
    width: 100% !important;
  }

  #LyricsflowPage .LyricsContainer .LyricsContent .line.OppositeAligned {
    transform-origin: right center !important;
  }

  /* RTL keeps its natural start alignment on mobile */
  #LyricsflowPage .LyricsContainer .LyricsContent .line.rtl {
    transform-origin: right center !important;
  }
}

/* ═══════════════════════════════════════════════
   GPU Acceleration Hack — Hardware Acceleration Hack
   ═══════════════════════════════════════════════ */
/* When enabled, promote word/letter elements to GPU compositor layers.
   Without this, only .Active elements get will-change via CSS. */

.lf-hw-accel #LyricsflowPage .LyricsContainer .LyricsContent .line .word,
.lf-hw-accel #LyricsflowPage .LyricsContainer .LyricsContent .line .letter,
.lf-hw-accel #LyricsflowPage .LyricsContainer .LyricsContent .line .letterGroup {
  will-change: transform, opacity;
}