@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #e4eae9;
  --surface: #ffffff;
  --ink: #10313a;
  --muted: #55696f;
  --line: #c3cecd;
  --amber: #e9a300;
  --amber-soft: #fbeecb;
  --ok: #1b7a52;
  --ok-soft: #e0f2e8;
  --bad: #b23a26;
  --bad-soft: #fae6e1;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--body);
}
h1, h2, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
main:focus { outline: none; }

.boot { padding: 48px 20px; color: var(--muted); }

/* Kopf */
.top { background: var(--ink); color: #fff; padding: 14px 20px 0; }
.top-row, .tabs { max-width: 680px; margin: 0 auto; }
.top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.brand { font: 700 24px/1 var(--display); letter-spacing: 0.01em; }
.brand-solo { color: var(--ink); margin-bottom: 20px; }
.who { display: flex; align-items: baseline; gap: 12px; font-size: 15px; min-width: 0; }
.who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.top .link { color: #fff; }
.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab {
  color: #fff; text-decoration: none; font-weight: 500;
  padding: 10px 14px 9px; border-bottom: 4px solid transparent; opacity: 0.75;
}
.tab:hover { opacity: 1; }
.tab.is-current { opacity: 1; border-bottom-color: var(--amber); }

/* Seite */
.main { max-width: 680px; margin: 0 auto; padding: 28px 20px 64px; }
.main-narrow { max-width: 460px; padding-top: 40px; }
.display { font: 700 40px/1.05 var(--display); letter-spacing: 0.005em; }
.h2 { font: 600 24px/1.15 var(--display); margin: 32px 0 12px; }
.panel .h2 { margin-top: 0; }
.lead { margin-top: 10px; max-width: 58ch; color: var(--muted); }
.hint { margin-top: 14px; font-size: 15px; color: var(--muted); }
.empty { color: var(--muted); padding: 4px 0; }
.block { margin-top: 8px; }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 20px; border-radius: 6px; border: 2px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1b4652; }
.btn-secondary { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn-quiet:hover:not(:disabled) { border-color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.row-tight { margin-top: 12px; gap: 8px; }

/* Formulare */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 20px 24px; margin-top: 24px; }
.auth { margin-top: 0; }
.field { display: block; margin-top: 16px; }
.field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field-hint { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: #fff; border: 1.5px solid #8e9d9f; border-radius: 6px;
}
textarea { resize: vertical; line-height: 1.4; }
.auth .btn { width: 100%; margin-top: 22px; }
.switch { margin-top: 18px; font-size: 15px; }
.answers { margin-top: 16px; }
.answers .field-hint { margin: 0 0 10px; }
.answer { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.answer input[type="radio"] { width: 24px; height: 24px; flex: none; accent-color: var(--ok); margin: 0; }

.msg { margin-top: 16px; padding: 10px 12px; border-radius: 6px; font-size: 15px; font-weight: 500; }
.msg-bad { background: var(--bad-soft); color: #7d2415; }
.msg-ok { background: var(--ok-soft); color: #0f5236; }

/* Karteikasten */
.tray {
  display: grid; grid-template-columns: repeat(6, 1fr);
  margin-top: 24px; background: var(--ink); border-radius: 6px; padding: 0 6px 12px;
}
.slot {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: #fff; padding: 0 3px; border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.slot:first-child { border-left: 0; }
.slot-stack {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 3px;
  height: 78px; width: 100%; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 3px solid rgba(255, 255, 255, 0.28);
}
.slot-card { display: block; width: 70%; max-width: 46px; height: 4px; border-radius: 1px; background: #f4f7f6; }
.slot-new .slot-card { background: transparent; border: 1px solid #f4f7f6; }
.slot-1 .slot-card { background: var(--amber); }
.slot-count { font: 700 30px/1 var(--display); }
.slot-label { font-size: 13px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.slot-sub { font-size: 12px; opacity: 0.72; white-space: nowrap; }
.slot.is-empty .slot-count { opacity: 0.45; }
.tray-note { margin-top: 10px; }

/* Themen */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; font-weight: 500;
}
.chip-n { font-size: 14px; color: var(--muted); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on .chip-n { color: #fff; opacity: 0.75; }

.cta { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.cta-status { font-weight: 600; margin-bottom: 14px; }

/* Lernrunde */
.round-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.round-pos { font-weight: 600; }
.meter { display: flex; gap: 4px; margin-top: 12px; }
.meter-seg { flex: 1; height: 6px; border-radius: 1px; background: var(--line); }
.meter-seg.is-now { background: var(--ink); }
.meter-seg.is-right { background: var(--ok); }
.meter-seg.is-wrong { background: var(--bad); }

.card {
  position: relative; margin-top: 22px; background: var(--surface);
  border: 1px solid var(--line); border-top: 5px solid var(--amber); border-radius: 6px;
  padding: 20px 20px 24px;
}
.card::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -7px; height: 6px;
  background: #f4f7f6; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px;
}
.card-cat { font-size: 15px; font-weight: 600; color: var(--muted); }
.card-q { font: 600 28px/1.15 var(--display); margin-top: 6px; max-width: 28ch; }
.opts { margin-top: 20px; display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  text-align: left; background: #fff; border: 1.5px solid #8e9d9f; border-radius: 6px; cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--ink); background: #f4f7f6; }
.opt:disabled { cursor: default; color: var(--ink); }
.opt-key {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border: 1.5px solid var(--line); border-radius: 4px; font-size: 14px; font-weight: 600; color: var(--muted);
}
.opt-text { flex: 1; }
.opt-mark { flex: none; font-size: 14px; font-weight: 600; }
.opt.is-pending { border-color: var(--ink); background: #f4f7f6; }
.opt.is-right { background: var(--ok-soft); border-color: var(--ok); }
.opt.is-right .opt-mark { color: #0f5236; }
.opt.is-right .opt-key { border-color: var(--ok); color: #0f5236; }
.opt.is-wrong { background: var(--bad-soft); border-color: var(--bad); }
.opt.is-wrong .opt-mark { color: #7d2415; }
.opt.is-wrong .opt-key { border-color: var(--bad); color: #7d2415; }
.opt.is-rest { opacity: 0.6; border-color: var(--line); }

.feedback { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.feedback-line { font-weight: 600; }
.feedback.is-right .feedback-line { color: #0f5236; }
.feedback.is-wrong .feedback-line { color: #7d2415; }
.feedback-why { margin-top: 8px; max-width: 58ch; }
.flag { margin-top: 6px; }

.recap { margin-top: 22px; display: grid; gap: 10px; }
.recap li { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--bad); border-radius: 6px; padding: 12px 14px; }
.recap-q { font-weight: 600; }
.recap-a { margin-top: 4px; color: var(--muted); }

/* Listen */
.list { display: grid; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px 16px; }
.item.is-off { background: transparent; }
.item-title { font-weight: 600; }
.item-quote { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--amber); }
.item-meta { margin-top: 6px; font-size: 15px; color: var(--muted); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 4px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; }
.tag-warn { background: var(--amber-soft); color: #6b4a00; }
.seg { display: inline-flex; margin-bottom: 14px; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg-btn { min-height: 40px; padding: 6px 14px; background: transparent; border: 0; cursor: pointer; font-weight: 500; }
.seg-btn.is-on { background: var(--ink); color: #fff; }

/* Rangliste */
.table-wrap { margin-top: 24px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th, .board td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board thead th { font-size: 14px; color: var(--muted); font-weight: 600; }
.board tbody th { font-weight: 600; }
.board tbody tr:last-child th, .board tbody tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; }
.board tr.is-me { background: var(--amber-soft); }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .display { font-size: 34px; }
  .card-q { font-size: 25px; }
  .main { padding: 22px 16px 56px; }
  .top { padding: 12px 16px 0; }
  .tray { padding: 0 2px 10px; }
  .slot-count { font-size: 26px; }
  .slot-label { font-size: 12px; }
  .slot-sub { font-size: 11px; }
  .cta .btn, .feedback .row .btn-primary { width: 100%; }
  .board th, .board td { padding: 10px 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  .opt, .chip, .btn, .tab { transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease; }
}
