:root {
  color-scheme: dark;
  --bg: #101014;
  --card: #1b1b22;
  --card-hi: #23232c;
  --line: #2c2c37;
  --text: #eae8e4;
  --muted: #9793a4;
  --accent: #c9a227;
  --accent-dim: #6b5615;
  --danger: #ff9d8a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, #1a1a24 0%, var(--bg) 60%) no-repeat,
    var(--bg);
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.1rem 5rem;
}

/* ---------- masthead ---------- */

.masthead { text-align: center; margin-bottom: 2.25rem; }

.band {
  margin: 0 0 .4rem;
  font-size: .78rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
  letter-spacing: -.01em;
}

h2 {
  margin: 0 0 .5rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.lede { color: var(--muted); margin: 0 0 1.5rem; }
.lede strong { color: var(--text); }
.muted { color: var(--muted); }

.fineprint {
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
  margin: 1.25rem 0 0;
}

/* ---------- views ---------- */

.view[hidden] { display: none; }

#view-thanks, #view-voted, #view-loading { text-align: center; }

.bigmark {
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ---------- login ---------- */

.field { display: block; margin-bottom: 1rem; }

.field span {
  display: block;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

input[type="password"] {
  width: 100%;
  padding: .8rem .9rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

input[type="password"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .2);
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: .8rem 1.2rem;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-hi);
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #17140a;
}

.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn.submit { margin-top: 1.75rem; }

.error {
  color: var(--danger);
  font-size: .9rem;
  margin: .8rem 0 0;
  text-align: center;
}

/* ---------- disclaimer ---------- */

.disclaimer {
  background: rgba(201, 162, 39, .07);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  font-size: .88rem;
  line-height: 1.55;
  color: #d9d3c2;
  margin-bottom: 1.5rem;
}

.disclaimer strong { color: var(--accent); display: block; margin-bottom: .15rem; }

/* ---------- section headings ---------- */

.section-title {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 600;
  margin: 2rem 0 .6rem;
}

.picks-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 2rem 0 .6rem;
}

.picks-head .section-title { margin: 0; }

.counter {
  font-size: .8rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-picks {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  margin: 0;
}

.empty-picks strong { color: var(--text); }

/* ---------- song list ---------- */

.songs {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* One card template serves both lists; each list hides the controls it doesn't use. */
.pool .pos,
.pool .moves,
.pool .handle,
.pool .remove { display: none; }

.picks .add { display: none; }

.picks .song { border-color: var(--accent-dim); }

.song {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  margin-bottom: .55rem;
  touch-action: pan-y;
}

.song.dragging {
  background: var(--card-hi);
  border-color: var(--accent-dim);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  position: relative;
  z-index: 2;
}

.song.moved { animation: flash .45s ease; }

/* Tinted rather than --card-hi, which would swallow the progress bar mid-animation. */
@keyframes flash {
  from { background: rgba(201, 162, 39, .14); }
  to { background: var(--card); }
}

.pos {
  width: 1.3rem;
  flex: none;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
}

.play {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-hi);
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.play:hover { border-color: var(--accent-dim); }
.play svg { width: 22px; height: 22px; fill: currentColor; }
.song.playing .play { background: var(--accent); color: #17140a; border-color: var(--accent); }

/* Swapped by class, not the `hidden` attribute — `hidden` has no effect on SVG. */
.icon-pause { display: none; }
.song.playing .icon-play { display: none; }
.song.playing .icon-pause { display: block; }

.body { flex: 1; min-width: 0; }

.title {
  margin: 0 0 .4rem;
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  height: 6px;
  background: var(--card-hi);
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
}

.bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.add {
  flex: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(201, 162, 39, .1);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: .45rem .95rem;
  min-height: 38px;
  cursor: pointer;
}

.add:hover:not(:disabled) { background: rgba(201, 162, 39, .2); }
.add:disabled { opacity: .3; cursor: default; }

.remove {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.remove:hover { color: var(--danger); background: rgba(255, 157, 138, .1); }

.moves { display: flex; flex-direction: column; flex: none; }

/* Sized for thumbs: on phones the arrows, not the drag handle, do the reordering. */
.move {
  width: 40px;
  height: 34px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .72rem;
  padding: 0;
  line-height: 1;
}

.move:hover:not(:disabled) { color: var(--accent); }
.move:disabled { opacity: .25; cursor: default; }

.handle {
  flex: none;
  width: 34px;
  height: 44px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: grab;
  padding: 0;
  touch-action: none;
  display: grid;
  place-items: center;
}

.handle:active { cursor: grabbing; }
.handle svg { width: 24px; height: 24px; fill: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.live {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .song.moved { animation: none; }
}
