/* The OBS playlist overlay (`/{locale}/obs/playlist`), for a 1920×1080
   browser source. One look in both themes: OBS has no theme, and the
   overlay sits on video, so it uses only the fixed `--color-overlay-*`
   tokens. Transparent page; dark translucent plates with white text and a
   text shadow, so it reads over dark and bright video alike. */

/* `App` puts this class on <html> for overlay routes only. `color-scheme`
   is fixed so a browser in dark mode does not paint the page dark. */
html.overlay-page {
  color-scheme: light;
  background: transparent;
}

html.overlay-page body {
  min-height: 0;
  overflow: hidden;
  background: transparent none;
  color: var(--color-overlay-text);
}

/* A saved template's sandboxed frame (`template_frame.rs`) fills the
   source. The frame stays transparent unless the template paints itself. */
.overlay-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.overlay-playlist {
  position: fixed;
  top: var(--space-6);
  bottom: var(--space-6);
  left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: var(--size-overlay-column);
  color: var(--color-overlay-text);
  text-shadow: var(--shadow-overlay-text);
}

.overlay-now,
.overlay-history,
.overlay-note {
  border-top: var(--size-overlay-edge) solid var(--color-overlay-pink);
  border-radius: var(--radius);
  background: var(--color-overlay-plate);
  box-shadow: var(--shadow-overlay-plate);
}

.overlay-now {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
}

.overlay-now__label,
.overlay-history__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-overlay-pink);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.overlay-now__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  /* A title with no spaces (a long URL-like name) still breaks. */
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.overlay-now__title--waiting {
  color: var(--color-overlay-muted);
  font-size: var(--text-xl);
}

.overlay-now__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-overlay-muted);
  font-size: var(--text-xl);
}

.overlay-now__meta:empty {
  display: none;
}

.overlay-now__time {
  display: grid;
  gap: var(--space-1);
}

.overlay-now__clock {
  color: var(--color-overlay-muted);
  font-size: var(--text-md);
}

/* A song's own language picks its typeface, whatever the page's. */
.overlay-playlist [lang|="zh"] {
  font-family: var(--font-sans-zh);
}

.overlay-playlist [lang|="ja"] {
  font-family: var(--font-sans-ja);
}

.overlay-chip {
  flex: 0 1 auto;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 var(--space-2);
  border: var(--border-width) solid var(--color-overlay-pink);
  border-radius: var(--radius-pill);
  background: var(--color-overlay-chip);
  color: var(--color-overlay-text);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}

/* Progress: pink to blue on a faint track. Its value moves a few times a
   second; nothing else animates. */
.overlay-progress {
  width: 100%;
  height: var(--size-overlay-progress);
  border: 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--color-overlay-track);
  appearance: none;
}

.overlay-progress::-webkit-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--color-overlay-track);
}

.overlay-progress::-webkit-progress-value {
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-overlay-pink), var(--color-overlay-blue));
}

.overlay-progress::-moz-progress-bar {
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-overlay-pink), var(--color-overlay-blue));
}

.overlay-history {
  display: grid;
  gap: var(--space-2);
  min-height: 0;
  padding: var(--space-3) var(--space-4);
  overflow: hidden;
  border-top-color: var(--color-overlay-blue);
}

.overlay-history__label {
  color: var(--color-overlay-blue);
}

.overlay-history__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.overlay-history__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--text-lg);
}

.overlay-history__n {
  flex: 0 0 auto;
  color: var(--color-overlay-blue);
  font-weight: var(--weight-bold);
}

.overlay-history__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-history__artist {
  flex: 0 1 auto;
  max-width: 40%;
  overflow: hidden;
  color: var(--color-overlay-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-history__artist:empty {
  display: none;
}

/* Setting up: the link has no room. */
.overlay-note {
  margin: 0;
  padding: var(--space-4);
  font-size: var(--text-lg);
}
