/* Lyrics widget (supporter-only, js/media/lyrics-widget.js). Large type for reading
   across the room, over the song's cover: the same blurred, evenly darkened
   backdrop as the Media tile's lyrics mode (--lyw-cover, set by the script). */

.lyrics-panel {
  container-type: size;
}

.lyrics-panel .lyrics-widget-mount {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  padding: 14px 16px 10px;
  border-radius: inherit;
  color: var(--text);
}

/* A still layer, never animated: the blur is drawn once per cover. */
.lyrics-panel.has-cover .lyrics-widget-mount::before,
.lyrics-panel.has-cover .lyrics-widget-mount::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.lyrics-panel.has-cover .lyrics-widget-mount::before {
  inset: -40px;
  z-index: -2;
  background: var(--lyw-cover) center / cover no-repeat;
  filter: blur(34px) saturate(1.35) brightness(0.78);
  transform: scale(1.15);
}
.lyrics-panel.has-cover .lyrics-widget-mount::after {
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7,12,11,0.62), rgba(7,12,11,0.74));
}
/* Over the dark backdrop the type and the small buttons are light in every theme. */
.lyrics-panel.has-cover .lyrics-widget-mount {
  --text: #f4f6f5;
  --muted-text: rgba(244, 246, 245, 0.68);
  --floating-ui-bg: rgba(255, 255, 255, 0.1);
  --floating-ui-border: rgba(255, 255, 255, 0.18);
}

.lyrics-widget-mount button,
.lyrics-widget-mount input {
  color: inherit;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.lyrics-widget-mount p { margin: 0; }

/* The view sizes its type from this tile, not from the Media tile: from its
   width AND its height. Width alone gave a wide, short tile 30-40px lines in a
   viewport that holds barely one of them, so the sung line sat cut under the
   header's fade; most visible with the app zoomed, where the header keeps its
   size and the tile shrinks around it (Discord, Oct 2026, macOS at 150%).
   12cqb keeps two to three lines in view below the header at any height. */
.lyrics-panel .lyv { --lyv-size: clamp(16px, min(6.2cqi, 12cqb), 40px); }

.lyw-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lyw-titles { flex: 1 1 auto; min-width: 0; }

.lyw-title,
.lyw-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyw-title {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.lyw-sub {
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 620;
}

.lyw-sub[hidden] { display: none; }

.lyw-offset {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

.lyw-offset[hidden] { display: none; }

.lyw-step {
  width: 36px;
  height: 36px;
  border: 1px solid var(--floating-ui-border);
  border-radius: var(--radius-control);
  background: var(--floating-ui-bg);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lyw-step:active { transform: scale(0.95); }
.lyw-step:disabled { opacity: 0.4; cursor: default; transform: none; }

.lyw-offset-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2em;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* This song has its own nudge: the value is in the accent and tapping it
   drops the nudge. Without one it is a plain label. */
button.lyw-offset-val:not(:disabled) { cursor: pointer; }
.lyw-offset-val:disabled { opacity: 1; }
.lyw-offset-val.is-song { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.lyrics-panel.has-cover .lyw-offset-val.is-song { color: var(--text); }

.lyw-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--floating-ui-border);
  border-radius: var(--radius-control);
  background: var(--floating-ui-bg);
  cursor: pointer;
}

.lyw-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lyw-icon:active { transform: scale(0.95); }

/* Cover beside the song name: a plain square, same corner as the buttons. */
.lyw-cover {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--floating-ui-bg);
}
.lyw-cover[hidden] { display: none; }

.lyw-transport-row {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
.lyw-transport-row[hidden] { display: none; }
.lyw-icon.lyw-transport svg { fill: currentColor; stroke: none; }

/* Translation state ("after 20 s of listening", limit reached…). */
.lyw-trstat {
  flex: 0 0 auto;
  color: var(--muted-text);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.35;
}

.lyw-trstat[hidden] { display: none; }

/* A running trial: when it ends, and the way to keep the widget. */
.lyw-trial {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  color: var(--muted-text);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.35;
}

.lyw-trial[hidden] { display: none; }
.lyw-trial a { color: var(--accent); font-weight: 730; text-underline-offset: 3px; }
.lyw-trial a[hidden], .lyw-trial-unlock[hidden] { display: none; }
/* Same weight as the join link it replaces, with a real touch target. */
.lyw-trial-unlock {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 730;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lyw-trial-unlock:disabled { opacity: .6; cursor: default; }

.lyw-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* Small tile: the nudge is a fine-tuning control, the lyrics come first. */
@container (max-width: 420px) {
  .lyw-head .lyw-offset { display: none; }
}
@container (max-width: 380px) {
  .lyw-head .lyw-cover { display: none; }
}
@container (max-width: 300px) {
  .lyw-head .lyw-transport-row .lyw-icon:not(:nth-child(2)) { display: none; }
}
