:root {
  --bg: #0b0f3a; --bg2: #17124f; --card: rgba(255, 255, 255, 0.07); --line: rgba(255, 255, 255, 0.12);
  --text: #fff; --muted: #b9b6d6; --amber: #ffb020; --ink: #17124f; --red: #ff8a8a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg2) 55%, #34155e) fixed;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--red); min-height: 1.5em; margin: 8px 0 0; }

button {
  height: 44px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--amber); color: var(--ink); font: 700 15px inherit;
}
button.ghost { background: var(--card); color: var(--text); }
button.icon { width: 44px; padding: 0; background: transparent; color: var(--text); font-size: 18px; }
button.icon:hover { background: var(--card); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
input:not([type="file"]) {
  width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); font: inherit;
}
label { display: block; margin: 12px 0 6px; font-size: 14px; color: var(--muted); }

#login { max-width: 360px; margin: 18vh auto 0; padding: 0 20px; }
#login button { margin-top: 16px; width: 100%; }

main { max-width: 760px; margin: 0 auto; padding: 40px 20px 140px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
header p { margin: 0; }

#drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 12px; padding: 32px 16px;
  border: 2px dashed var(--line); border-radius: 18px; cursor: pointer; text-align: center; color: var(--text);
}
#drop strong { font-size: 18px; }
#drop.over, #drop:hover { border-color: var(--amber); background: var(--card); }
#drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

ul { list-style: none; margin: 0; padding: 0; }
#uploads li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 4px; font-size: 14px; }
#uploads .ok { color: var(--amber); }
#uploads .bad { color: var(--red); }
#uploads span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#uploads span:last-child { flex: none; }

#search { margin: 12px 0; }
#songs li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
#songs li.playing .title { color: var(--amber); }
.cover {
  flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--card);
  display: grid; place-items: center; color: var(--muted); font-size: 20px;
}
.meta { flex: 1; min-width: 0; }
.meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title { font-weight: 600; }
.time { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

#player {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 20px 14px;
  background: rgba(40, 22, 84, 0.97); border-top: 1px solid var(--line);
}
#now { max-width: 760px; margin: 0 auto 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
audio { display: block; width: 100%; max-width: 760px; margin: 0 auto; height: 40px; }

dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #1d1758; color: var(--text); }
dialog::backdrop { background: rgba(5, 5, 30, 0.7); }
.row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 520px) { .time { display: none; } h1 { font-size: 28px; } }
