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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #ff4444;
  --accent-dim: #cc2222;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  min-height: 100dvh;
  padding: 16px 16px 32px;
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  color: var(--text);
}

/* Player */
#player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: none;
}
#player.visible { display: block; }
#player-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  width: 52px;
  height: 52px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.ctrl-btn:hover { border-color: #555; }
.ctrl-btn:active { background: #222; }

#btn-play {
  width: 64px;
  height: 64px;
  font-size: 22px;
  border-color: var(--accent);
}
#btn-play:hover { border-color: var(--accent-dim); }

audio {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  accent-color: var(--accent);
}

/* List */
#list { display: flex; flex-direction: column; gap: 10px; }

.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.item:hover { border-color: #444; }
.item.active { border-color: var(--accent); }
.item.error { border-color: #663333; cursor: default; }

.item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-title.placeholder { color: var(--muted); font-style: italic; }

.item-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.item-remove:hover { color: var(--accent); }

.item-retry {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.item-retry:hover { border-color: var(--accent); color: var(--text); }

.item-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.item-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s linear;
}

.item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.item-error-msg {
  font-size: 12px;
  color: #ff6666;
  margin-top: 5px;
}

/* Spinner */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Add button */
#add-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
#add-btn:hover { border-color: var(--accent); color: var(--text); }
