/* ---- Auswahl-Screen ---- */
.songs { flex: 1; overflow-y: auto; padding: 1rem; }
.songs__status { color: var(--text-dim); text-align: center; margin-top: 2rem; }
.songs__list { list-style: none; margin: 0 auto; padding: 0; max-width: 620px; display: grid; gap: 0.7rem; }
.song-card {
  display: flex; align-items: center; gap: 0.8rem;
  width: 100%; text-align: left;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--bg-elev); color: var(--text); border: 1px solid #ffffff10;
  cursor: pointer; font: inherit;
}
.song-card:hover { background: #22222f; }
.song-card__icon { font-size: 1.6rem; }
.song-card__body { flex: 1; min-width: 0; }
.song-card__title { font-weight: 600; font-size: 1.05rem; }
.song-card__artist { color: var(--text-dim); font-size: 0.9rem; }
.badge { font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.badge--karaoke { background: #6c8cff22; color: #aebcff; }
.badge--text { background: #ffffff14; color: var(--text-dim); }

/* ---- Player-Screen ---- */
#screen-player { position: relative; }

.lyrics {
  flex: 1; overflow-y: auto; position: relative; /* Anker fuer Countdown/Ball/Scroll */
  padding: 30vh 1.2rem;            /* viel Luft, damit aktive Zeile mittig scrollen kann */
  scroll-behavior: smooth;
  font-size: calc(clamp(1.6rem, 6.5vw, 3.2rem) * var(--lyric-scale, 1));
  line-height: 1.5;
  text-align: center;
}

.line {
  margin: 0.35em 0;
  color: var(--text-dim);
  opacity: 0.5;
  transition: opacity 0.18s linear, color 0.18s linear;
}
.line.is-past { opacity: 0.4; }
.line.is-active { opacity: 1; color: var(--active-color); }

.word { display: inline-block; margin-right: 0.3em; }

/* Silbe: zwei deckungsgleiche Ebenen; obere (Farbe) per clip-path freigegeben. */
.unit { position: relative; display: inline-block; white-space: pre; }
.unit__base { color: inherit; }
.unit__fill {
  position: absolute; inset: 0;
  color: var(--fill-color);
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0);
  -webkit-clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0);
  will-change: clip-path;
  pointer-events: none;
}

/* Reiner Text (kein Timing) */
.lyrics--plain .line { color: var(--text); opacity: 0.85; }

/* Ball */
.ball {
  position: absolute; left: 0; top: 0;
  width: 0.5em; height: 0.5em; margin-left: -0.25em;
  border-radius: 50%;
  background: var(--fill-color);
  box-shadow: 0 0 12px var(--fill-color);
  will-change: transform; pointer-events: none;
  transform: translate(-9999px, -9999px);
}

/* Countdown-Overlay */
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(4rem, 22vw, 11rem); font-weight: 700; color: var(--fill-color);
  text-shadow: 0 0 40px #ffd54a66; pointer-events: none;
}
.countdown__hint { font-size: clamp(1rem, 4vw, 1.6rem); color: var(--text-dim); text-shadow: none; }

/* Instrumental-Hinweis */
.lyrics.is-instrumental::after {
  content: "♪"; position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%);
  font-size: 2rem; color: var(--text-dim); opacity: 0.7; animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.8; } }

/* ---- Einstellungen ---- */
.settings {
  position: absolute; right: 0.8rem; top: 3.4rem; z-index: 5;
  background: var(--bg-elev); border: 1px solid #ffffff1a; border-radius: var(--radius);
  padding: 0.8rem; display: grid; gap: 0.7rem; min-width: 240px;
  box-shadow: 0 18px 40px #00000066;
}
.settings__row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.settings__label { color: var(--text-dim); font-size: 0.9rem; }
.seg { display: inline-flex; background: #00000033; border-radius: 10px; padding: 2px; gap: 2px; }
.seg__btn { font: inherit; border: 0; background: transparent; color: var(--text-dim); padding: 0.35rem 0.6rem; border-radius: 8px; cursor: pointer; }
.seg__btn.is-active { background: var(--accent); color: #0c1030; font-weight: 600; }

/* ---- Transport ---- */
.transport {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1rem;
  padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
  border-top: 1px solid #ffffff14; background: #0e0e14ee;
}
.btn--play {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  background: var(--accent); color: #0c1030; font-size: 1.4rem; line-height: 1;
}
.btn--play:hover { background: #87a0ff; }
.transport__time { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 0.9rem; min-width: 3ch; }
.transport__seek { flex: 1; accent-color: var(--accent); height: 24px; }
