:root {
  --paper: #f6f1e7;
  --card: #fffdf8;
  --ink: #1d1a16;
  --muted: #6b6257;
  --line: #d9cfbf;
  --accent: #7a1f2b;
  --ag: #8a8478;
  --lg: #3f7d4e;
  --olg: #2f6690;
  --bgh: #6a4c93;
  --bverfg: #c46a1b;
  --eugh: #b3261e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17150f;
    --card: #211e17;
    --ink: #efe8da;
    --muted: #a39a8b;
    --line: #3a352b;
    --accent: #d98a94;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, .brand, .prompt, .score { font-family: Georgia, "Times New Roman", serif; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 20px;
  border-bottom: 3px double var(--line);
}
.brand { font-size: 1.6rem; font-weight: 700; letter-spacing: 0.02em; }
.brand::before { content: "§ "; color: var(--accent); }
.edition { color: var(--muted); font-size: 0.9rem; }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }
.foot { padding: 16px 20px; text-align: center; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 18px; }
h1 { font-size: 1.7rem; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.9rem; }
a { color: var(--accent); }

button {
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--olg); outline-offset: 2px; }

/* Stufen */
.tiers { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 6px; }
.tiers li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.tiers .range { color: var(--muted); margin-left: auto; }
.badge {
  display: inline-block;
  min-width: 64px;
  padding: 2px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--ag);
}
.badge.lg { background: var(--lg); }
.badge.olg { background: var(--olg); }
.badge.bgh { background: var(--bgh); }
.badge.bverfg { background: var(--bverfg); }
.badge.eugh { background: var(--eugh); }
.badge.miss { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* Frage */
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }
.chip { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: var(--accent); }
.prompt { font-size: 1.45rem; line-height: 1.3; margin: 0 0 6px; }
.timer { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 16px 0; }
.timer > div { height: 100%; width: 100%; background: var(--accent); transition: width 0.1s linear; }
.entry { display: flex; gap: 8px; }
input[type="text"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.note { min-height: 1.5em; margin: 10px 0 0; font-size: 0.92rem; color: var(--muted); }
.note.warn { color: var(--bverfg); }
.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } .timer > div { transition: none; } }

.verdict { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
.verdict .points { margin-left: auto; font-weight: 700; font-size: 1.2rem; }
.answer { font-size: 1.15rem; font-weight: 600; margin: 0; }

/* Ergebnis */
.score { font-size: 3rem; font-weight: 700; line-height: 1; margin: 6px 0; }
.score small { font-size: 1.1rem; color: var(--muted); font-weight: 400; }
.row { font-size: 1.6rem; letter-spacing: 0.1em; margin: 10px 0 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 8px; }
td { padding: 5px 4px; border-top: 1px solid var(--line); vertical-align: top; }
td.num { text-align: right; white-space: nowrap; color: var(--muted); }
tr.mine td { font-weight: 700; }
details summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; margin-top: 8px; }
