:root {
  --bg: #111418;
  --card: #1b2027;
  --line: #2a313b;
  --text: #e8ecf1;
  --muted: #8b95a3;
  --accent: #4fb3ff;
  --accent-dim: #1f3a52;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.player { position: sticky; top: 8px; z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.title { font-size: 20px; font-weight: 600; margin: 2px 0; overflow-wrap: anywhere; }
.sub { font-size: 13px; color: var(--muted); min-height: 1.2em; }

input[type=range] { width: 100%; accent-color: var(--accent); }
#seek { margin-top: 12px; }

.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

button {
  font: inherit;
  color: var(--text);
  background: var(--line);
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  touch-action: manipulation;
}
button:active { filter: brightness(1.3); }
button.small { padding: 6px 10px; font-size: 14px; }

.controls { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 12px 0; }
.controls button { min-width: 52px; height: 52px; font-size: 18px; font-weight: 600; }
.controls button.big { min-width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: #062033; font-size: 26px; }

.speed { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 8px; }
#speedDown, #speedUp { min-width: 36px; font-size: 18px; font-weight: 600; }
.speed label { font-size: 14px; white-space: nowrap; }
.speed strong { display: inline-block; min-width: 3.4em; font-variant-numeric: tabular-nums; }

.options { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.options input { accent-color: var(--accent); }

.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.head h2 { overflow-wrap: anywhere; }
.buttons { display: flex; gap: 6px; flex-shrink: 0; }
button.primary { background: var(--accent); color: #062033; font-weight: 600; }
button:disabled { opacity: .4; cursor: default; }
.list .count { color: var(--muted); font-size: 13px; white-space: nowrap; }
h2 { margin: 0; font-size: 18px; }
.hint { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }

.upload {
  display: block;
  margin: 12px 0;
  padding: 14px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 12px;
  color: var(--accent);
  cursor: pointer;
}
.upload input { display: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; }
.list .name { flex: 1; min-width: 0; padding: 6px 4px; overflow-wrap: anywhere; cursor: pointer; }
.list .num { color: var(--muted); font-size: 13px; width: 1.8em; text-align: right; font-variant-numeric: tabular-nums; }
.list button { padding: 6px 10px; }
.list button.del { color: var(--danger); }
.list li.current { background: var(--accent-dim); border-radius: 8px; }
.list li.current .name { color: var(--accent); font-weight: 600; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
