:root {
  --bg: #fff8ea;
  --paper: #fffdf7;
  --ink: #231a12;
  --muted: #7b6a58;
  --line: #eadcbf;
  --red: #c8281e;
  --red-ink: #ffffff;
  --mustard: #f2b705;
  --mustard-ink: #231a12;
  --up: #2b8a3e;
  --up-bg: #e3f4e8;
  --down: #c92a2a;
  --down-bg: #fcE8E8;
  --display: "Rockwell", "Roboto Slab", "Rockwell Nova", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191410;
    --paper: #241d16;
    --ink: #f6ebdd;
    --muted: #b5a38f;
    --line: #3a2e22;
    --red: #ff6a55;
    --red-ink: #191410;
    --mustard: #f2b705;
    --up: #69db7c;
    --up-bg: #1d3324;
    --down: #ff8787;
    --down-bg: #3b1f1f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }

/* Kopfzeile */
.top {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.15;
}
#nav { display: flex; flex-wrap: wrap; gap: 6px; }
#nav a {
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
}
#nav a:hover { color: var(--ink); border-color: var(--line); }
#nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

main {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px 40px;
  flex: 1;
}
main:focus { outline: none; }

h1 {
  font-family: var(--display);
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.15;
  margin: 18px 0 6px;
  letter-spacing: -0.01em;
}
h2 { font-family: var(--display); font-size: 20px; margin: 26px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }
p { max-width: 68ch; }

/* Rangliste */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.rank {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
}
.item.top .rank { background: var(--mustard); color: var(--mustard-ink); }
.name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.votes { display: flex; align-items: center; gap: 6px; }
.vbtn {
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.25;
}
.vbtn .ico { font-size: 18px; }
.vbtn.up[aria-pressed="true"] { background: var(--up-bg); border-color: var(--up); color: var(--up); font-weight: 700; }
.vbtn.down[aria-pressed="true"] { background: var(--down-bg); border-color: var(--down); color: var(--down); font-weight: 700; }
.vbtn:disabled { opacity: .5; cursor: wait; }
.score { min-width: 40px; text-align: center; font-weight: 800; font-size: 18px; }
.counts { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.counts .score { color: var(--ink); }

.empty, .error {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}
.error { color: var(--down); }

/* Verlauf */
.months { display: flex; flex-direction: column; gap: 12px; }
.month {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
}
.month h2 { margin: 0 0 6px; font-size: 18px; }
.month ol { margin: 0; padding-left: 22px; }
.month li { margin: 2px 0; }
.month .muted { color: var(--muted); font-size: 14px; }

/* Formular */
form.suggest { display: grid; gap: 14px; max-width: 460px; }
label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--red);
  color: var(--red-ink);
  justify-self: start;
}
.btn:disabled { opacity: .55; cursor: wait; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ok-box {
  background: var(--up-bg);
  border: 1px solid var(--up);
  color: var(--ink);
  border-radius: 14px;
  padding: 16px;
  max-width: 460px;
}
.ok-box p { margin: 0 0 8px; }
.ok-box a { font-weight: 700; }

/* Datenschutz */
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; max-width: 68ch; }

.foot {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 28px;
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14.5px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.noscript { text-align: center; color: var(--down); }

@media (max-width: 520px) {
  .item { grid-template-columns: 40px minmax(0, 1fr); }
  .item .votes, .item .counts { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (prefers-reduced-motion: no-preference) {
  .toast { transition: opacity .2s; }
}
