:root {
  --bg: #000;
  --panel: #0b0b0d;
  --fg: #f2f2f2;
  --dim: #8a8a92;
  --accent: #ff5a3c;
  --gap: 2rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

main {
  display: flex;
  height: 100vh;
  gap: var(--gap);
  padding: var(--gap);
}

/* ---- left: now playing ---------------------------------------- */
#now-playing {
  flex: 0 0 34%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

#art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #161619;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
#art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
#art.show { display: block; }
#art-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 6rem;
  color: #2c2c31;
}
#art.show + #art-placeholder { display: none; }

#meta { min-height: 5rem; }
.title  { font-size: 2rem; font-weight: 700; line-height: 1.15; }
.artist { font-size: 1.25rem; color: var(--fg); margin-top: 0.35rem; }
.album  { font-size: 1rem; color: var(--dim); margin-top: 0.5rem; }
.length { font-size: 0.9rem; color: var(--dim); margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
.length::before { content: "⏱ "; opacity: 0.7; }

.progress {
  height: 4px;
  margin-top: 0.6rem;
  background: #1d1d22;
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s linear;
}

#footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status {
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.identify {
  flex: 0 0 auto;
  background: #18181c;
  color: var(--fg);
  border: 1px solid #2a2a30;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.identify:hover { border-color: var(--accent); background: #1f1f24; }
.identify:active { transform: translateY(1px); }
.status.live::before {
  content: "";
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  vertical-align: baseline;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---- right: visualizer ---------------------------------------- */
#viz {
  position: relative;
  flex: 1 1 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
#canvas { width: 100%; height: 100%; display: block; }

#controls {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0.25;
  transition: opacity 0.2s;
}
#viz:hover #controls { opacity: 1; }

.ctl { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--dim); }
.ctl select, .ctl input { accent-color: var(--accent); }
.ctl select {
  background: #18181c; color: var(--fg);
  border: 1px solid #2a2a30; border-radius: 6px;
  padding: 0.2rem 0.4rem; font-size: 0.8rem;
}
