:root {
  --fg: #fff;
  --fg-dim: rgba(255, 255, 255, 0.72);
  --fg-faint: rgba(255, 255, 255, 0.45);
  --accent: #1ed760;
  /* TVs can overscan; keep content inside a ~5% safe area. */
  --safe-x: 6vw;
  --safe-y: 7vh;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: none;
}

/* Blurred album art fills the screen behind everything. Two layers crossfade. */
.bg {
  position: fixed;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.4) brightness(0.45);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.bg.visible { opacity: 1; }

.player {
  position: relative;
  height: 100%;
  padding: var(--safe-y) var(--safe-x);
  display: flex;
  align-items: center;
  gap: 5vw;
  transition: opacity 0.6s ease;
}

.art {
  height: min(78vh, 46vw);
  aspect-ratio: 1;
  flex: none;
  object-fit: cover;
  border-radius: 1.2vh;
  box-shadow: 0 2vh 8vh rgba(0, 0, 0, 0.6);
  background: rgba(255, 255, 255, 0.06);
}

.meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
}

.state {
  font-size: 2.4vh;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.state.paused { color: var(--fg-faint); }

.title {
  font-size: 7.5vh;
  line-height: 1.08;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.artist {
  font-size: 4.2vh;
  font-weight: 600;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album {
  font-size: 3vh;
  color: var(--fg-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress { margin-top: 3vh; }
.bar {
  height: 0.8vh;
  border-radius: 1vh;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 0;
  background: var(--fg);
  border-radius: inherit;
}
.times {
  display: flex;
  justify-content: space-between;
  margin-top: 1.2vh;
  font-size: 2.4vh;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

.message {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--safe-y) var(--safe-x);
  text-align: center;
  font-size: 4vh;
  color: var(--fg-dim);
  transition: opacity 0.6s ease;
}

.hidden { opacity: 0; pointer-events: none; }

/* Portrait / narrow screens (handy when testing on a phone). */
@media (max-aspect-ratio: 1/1) {
  .player { flex-direction: column; justify-content: center; text-align: center; }
  .art { height: auto; width: min(80vw, 50vh); }
  .meta { flex: none; width: 100%; }
  .title { font-size: 5vh; }
}
