:root {
  --bg: #14110f;
  --surface: #1f1b18;
  --surface-2: #2b2622;
  --text: #f4ede4;
  --muted: #a89d90;
  --accent: #f0a23c;
  --on-accent: #1d1305;
  --danger: #ff8a7a;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 120px;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.brand, .login h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand span, .login h1 span { color: var(--accent); }

.top {
  display: flex; align-items: center; gap: 16px;
  max-width: 960px; margin: 0 auto; padding: 16px;
}
.search { flex: 1; display: flex; gap: 8px; min-width: 0; }
.search input, .login input {
  flex: 1; min-width: 0; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius);
}
.search button, .login button {
  padding: 10px 16px; background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.ghost { background: transparent; padding: 8px 10px; color: var(--muted); }
.ghost:hover, .ghost[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }

.tabs { display: flex; gap: 4px; max-width: 960px; margin: 0 auto; padding: 0 16px 8px; overflow-x: auto; }
.tab { background: transparent; color: var(--muted); padding: 8px 12px; white-space: nowrap; }
.tab[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

main { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.screen { display: block; width: 100%; max-height: 54vh; background: #000; border-radius: var(--radius); margin: 8px 0; }
.status { color: var(--muted); margin: 16px 0; }
.status.error { color: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: var(--radius); }
.row:hover { background: var(--surface); }
.row.current { background: var(--surface-2); }
.row-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  background: transparent; padding: 0; text-align: left;
}
.row img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.row-text { min-width: 0; display: flex; flex-direction: column; }
.row-title, .row-artist, #now-title, #now-artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-artist, #now-artist { color: var(--muted); font-size: 13px; }
.row-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.badge { color: var(--muted); font-size: 12px; white-space: nowrap; background: transparent; padding: 0; }
.badge-error { color: var(--danger); text-decoration: underline; }
.fav { background: transparent; color: var(--muted); padding: 6px 8px; font-size: 16px; }
.fav[aria-pressed="true"] { color: var(--accent); }

.player {
  position: fixed; inset: auto 0 0 0;
  display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 16px;
  padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--surface-2);
}
.now { display: flex; align-items: center; gap: 10px; min-width: 0; }
.now img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.now-text { min-width: 0; display: flex; flex-direction: column; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.buttons { display: flex; align-items: center; gap: 8px; }
.round { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.seek { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.seek input { flex: 1; min-width: 0; }
input[type="range"] { accent-color: var(--accent); }
.extras { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.extras input { width: 90px; }

@media (max-width: 720px) {
  body { padding-bottom: 170px; }
  .top { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .top > form:last-child { margin-left: auto; }
  .player { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .controls { grid-column: 1 / -1; grid-row: 2; }
  .extras input { display: none; }
  .row-time { display: none; }
}

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login {
  width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px;
  padding: 24px; background: var(--surface); border-radius: var(--radius);
}
.login h1 { margin-bottom: 8px; font-size: 24px; }
.login input { flex: none; }
.login-error { margin: 0; color: var(--danger); font-size: 14px; }
