:root {
  --bg: #f7f1e6;
  --card: #fffdf8;
  --ink: #23201b;
  --muted: #6c655a;
  --line: #e4dccd;
  --accent: #a8222c;
  --accent-ink: #ffffff;
  --green: #1f5a3c;
  --ok-bg: #e6f2ea;
  --ok-ink: #1f5a3c;
  --err-bg: #fbe9e9;
  --err-ink: #8c1c24;
  --warn-bg: #fdf3dc;
  --warn-ink: #6b4b07;
  --shadow: 0 1px 2px rgb(35 32 27 / 6%), 0 8px 24px rgb(35 32 27 / 6%);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100d;
    --card: #1c1915;
    --ink: #f1ebe0;
    --muted: #a39a8b;
    --line: #322d26;
    --accent: #e0545d;
    --accent-ink: #1a0a0b;
    --green: #7cc59a;
    --ok-bg: #16301f;
    --ok-ink: #9fdcb5;
    --err-bg: #3a1619;
    --err-ink: #f4a9ae;
    --warn-bg: #33290f;
    --warn-ink: #f0d48f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.hero { margin-bottom: 24px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 13px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.15;
  letter-spacing: -.01em;
}

h2 { margin: 0 0 8px; font-size: 18px; }

.lead { margin: 0; color: var(--muted); font-size: 17px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.field { display: block; margin-bottom: 20px; }

.label { display: block; font-weight: 650; margin-bottom: 6px; }

.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 44px;
}

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

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  min-height: 44px;
}

button.primary {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  padding: 12px 16px;
}

button.primary:disabled { opacity: .45; cursor: not-allowed; }

button.secondary, a.button.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 8px 14px;
}

a.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
}

button.link {
  min-height: 0;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 4px 8px;
  text-decoration: underline;
}

a { color: var(--accent); }

.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.slot {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}

.rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.slot-body { min-width: 0; position: relative; }

.picked {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 6px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.cover {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--line);
}

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

.title, .artist {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title { font-weight: 600; }

.artist { color: var(--muted); font-size: 14px; }

.results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow-y: auto;
}

.results:empty { display: none; }

.results button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  padding: 6px;
}

.results button:hover, .results button:focus-visible { background: var(--bg); }

.results .muted { color: var(--muted); padding: 8px; font-size: 14px; }

.status { margin: 12px 0 0; min-height: 1.5em; font-size: 15px; }

.status.ok, .notice-ok { color: var(--ok-ink); }

.status.error { color: var(--err-ink); }

.banner {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 14px;
}

.banner.ok { background: var(--ok-bg); color: var(--ok-ink); }

.banner.error { background: var(--err-bg); color: var(--err-ink); }

.banner.warning { background: var(--warn-bg); color: var(--warn-ink); }

[hidden] { display: none !important; }

/* Beheer */

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.row input { flex: 1 1 220px; }

.stats { color: var(--muted); margin: 0 0 12px; }

.submission { border-top: 1px solid var(--line); padding: 14px 0; }

.submission:first-of-type { border-top: 0; padding-top: 4px; }

.submission header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.submission h3 { margin: 0; font-size: 16px; }

.submission time { color: var(--muted); font-size: 13px; }

.submission ol { margin: 6px 0 0; padding-left: 22px; font-size: 14px; }

.submission li span { color: var(--muted); }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.submission .count { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
