:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e8e8ec;
  --muted: #9a9ea8;
  --accent: #1db954;
  --border: #262a33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }

.site-nav { display: flex; align-items: center; gap: 1rem; }

.badge-admin {
  background: var(--accent);
  color: #05210f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.logout-form button, .btn-login, #listen-btn, .propose-submit, #propose-form button {
  background: var(--accent);
  color: #05210f;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.site-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.now-playing {
  display: flex;
  gap: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  align-items: center;
}

.np-artwork {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  background: #22262f;
  object-fit: cover;
  flex-shrink: 0;
}

.np-info { flex: 1; min-width: 0; }
.np-title { font-size: 1.1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { color: var(--muted); margin-bottom: 0.5rem; }

.np-progress {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.np-progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.5s linear; }

section h2 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.75rem; }

.queue ul, .history ul, .candidates ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.queue li, .history li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.candidates li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.vote-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}

#propose-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
#propose-url {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
}

.cta-login { color: var(--muted); }

.listen-status { color: var(--muted); font-size: 0.85rem; margin-left: 0.5rem; }

.admin-btn {
  background: transparent;
  border: 1px solid #e0575b;
  color: #e0575b;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.queue li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.stub-page, .profile, .empty-state {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.btn-stub {
  display: inline-block;
  margin-top: 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f7f9;
    --panel: #ffffff;
    --text: #1a1c22;
    --muted: #5c6270;
    --border: #e4e6ea;
  }
}
