:root {
  --bg: #0f1218;
  --surface: #1a1f2b;
  --border: #2d3548;
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --accent-dim: #3d5fa8;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e2840 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.section-title {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.menu-section {
  margin-bottom: 1.25rem;
}

.track-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  counter-reset: track-i;
}

.track-menu:empty {
  display: none;
}

.track-menu > li {
  counter-increment: track-i;
  border-bottom: 1px solid var(--border);
}

.track-menu > li:last-child {
  border-bottom: none;
}

.track-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.track-menu-btn::before {
  content: counter(track-i);
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track-menu-btn .track-menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-menu-btn:hover {
  background: rgba(91, 140, 255, 0.08);
}

.track-menu > li.is-active .track-menu-btn {
  background: rgba(91, 140, 255, 0.18);
  color: #b8ccff;
}

.empty-state {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state.hidden {
  display: none;
}

.player {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.now-playing {
  margin-bottom: 1rem;
}

.now-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.track-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.time {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.5rem;
}

.time:last-child {
  text-align: right;
}

.seek {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
}

.seek:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  margin-top: -4px;
}

.seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ctrl {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.ctrl:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
}

.ctrl:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ctrl-main {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ctrl-main:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vol-label {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.volume {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  margin-top: -3px;
}

.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.ctrl-small {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
