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

:root {
  --bg:         #ffffff;
  --surface:    #f4f4f4;
  --text:       #111111;
  --muted:      #888888;
  --accent:     #4b5cf8;
  --accent-bg:  #eef0fe;
  --border:     #e0e0e0;
  --font:       system-ui, -apple-system, sans-serif;
  --mono:       'Courier New', 'Lucida Console', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #101010;
    --surface:    #1a1a1a;
    --text:       #e4e4e4;
    --muted:      #5a5a5a;
    --accent:     #8b97ff;
    --accent-bg:  #1a1d3a;
    --border:     #272727;
  }
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 500px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── Header ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wordmark {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timer {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Now playing ── */
.now-playing {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 40px;
}

.now-playing .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  flex-shrink: 0;
}

.now-playing .track-name {
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Track list ── */
.track-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.track-list::-webkit-scrollbar { width: 3px; }
.track-list::-webkit-scrollbar-thumb { background: var(--border); }

.track-btn {
  display: block;
  width: 100%;
  padding: 9px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 80ms;
  border-left: 2px solid transparent;
}

.track-btn:hover {
  background: var(--surface);
}

.track-btn.current {
  background: var(--accent-bg);
  color: var(--accent);
  border-left-color: var(--accent);
}

.empty {
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

/* ── Controls ── */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  width: 46px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 80ms, border-color 80ms, color 80ms;
  flex-shrink: 0;
}

.ctrl-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.ctrl-btn:active {
  background: var(--accent-bg);
}

.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.play-btn {
  width: 58px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

@media (max-width: 500px) {
  main {
    border-left: none;
    border-right: none;
  }
}
