/* spotlyrfy — tuned for the Tesla landscape touchscreen: dark, high-contrast,
   large type, generous tap targets. */

:root {
  --bg: #0a0a0c;
  --fg: #f5f5f7;
  --dim: rgba(245, 245, 247, 0.32);
  --accent: #1db954; /* Spotify green */
  --art-url: none;
  --line-size: 1.9rem; /* lyric font size — adjustable via A− / A+ (persisted) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* Blurred album art as an ambient backdrop. */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  background-image: var(--art-url);
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.35) saturate(1.2);
  opacity: 0.55;
  transition: background-image 0.6s ease;
  z-index: -1;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2vh 4vw;
}

/* ── Top bar: now playing ── */
#topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 0 0 auto;
  padding-bottom: 1.5vh;
}

#art {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.75rem;
  background: #222 center / cover no-repeat;
  flex: 0 0 auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

#nowplaying { flex: 1 1 auto; min-width: 0; }

#title {
  font-size: 2rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#artist {
  font-size: 1.4rem;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button {
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.8rem;
  cursor: pointer;
  flex: 0 0 auto;
}

#logout { background: rgba(255, 255, 255, 0.12); }

#controls {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.7rem 1.1rem;
  font-size: 1.2rem;
  min-width: 3.2rem;
  line-height: 1;
}

#font-inc { font-size: 1.5rem; }

/* ── Lyrics viewport: masked, auto-centering scroll ── */
#lyrics-viewport {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

#lyrics-scroll {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Message state: fill the viewport and center the text. */
#lyrics-scroll.centered {
  top: 0;
  bottom: 0;
  transform: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.line {
  font-size: var(--line-size);
  font-weight: 600;
  line-height: 1.3;
  padding: 0.4rem 2vw;
  color: var(--dim);
  transition: color 0.3s ease, transform 0.3s ease, font-size 0.15s ease;
}

.line.active {
  color: var(--fg);
  transform: scale(1.06);
}

.message {
  font-size: 2rem;
  color: var(--fg);
  opacity: 0.9;
  max-width: 80%;
  text-align: center;
  line-height: 1.4;
  padding: 2rem;
}

/* Unsynced fallback: plain scrollable text. */
#lyrics-scroll.plain {
  position: static;
  transform: none;
}
#lyrics-viewport:has(.plain) { overflow-y: auto; }

.plain-lyrics {
  font-size: 1.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--fg);
  padding: 1rem 2vw 4rem;
}

/* ── Status line ── */
#status {
  flex: 0 0 auto;
  min-height: 1.4rem;
  text-align: center;
  font-size: 1rem;
  color: var(--dim);
  padding-top: 1vh;
}
