/* Lingua – warmes Papier, Terrakotta als Akzent, Grün/Rot nur für richtig/falsch. */
@font-face { font-family: "Inter Tight"; src: url("/static/fonts/InterTight-var.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --bg: #f7f3ec;
  --card: #fffdf9;
  --text: #1c1714;
  --muted: #6f655d;
  --faint: #b3a89e;
  --line: #e7dfd3;
  --accent: #c2410c;
  --accent-soft: #fbe7dc;
  --ok: #15803d;
  --ok-soft: #e3f3e8;
  --bad: #c42b1c;
  --bad-soft: #fbe8e5;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tap: 54px;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --card: #1d1916;
    --text: #f3ede6;
    --muted: #a59a90;
    --faint: #5e554e;
    --line: #2e2823;
    --accent: #f0743b;
    --accent-soft: #3a1f12;
    --ok: #4fc27c;
    --ok-soft: #10281a;
    --bad: #ff6b5b;
    --bad-soft: #33130f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 17px/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
main {
  max-width: 560px; margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  min-height: 100dvh; display: flex; flex-direction: column;
}
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 6px 0 4px; }
h2 { font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 34px 0 10px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 20px; color: var(--accent); margin: 0; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.error { color: var(--bad); font-weight: 600; }

/* Buttons und Eingaben */
button, .btn {
  font: inherit; min-height: var(--tap); padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  cursor: pointer; touch-action: manipulation; user-select: none;
}
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.block { display: block; width: 100%; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 8px 10px; min-height: 44px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font-weight: 600; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); font-weight: 600; }
input[type="text"], input[type="password"] {
  font: inherit; width: 100%; min-height: var(--tap); padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
input:focus { border-color: var(--accent); outline: none; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }

/* Login */
.login { margin: auto 0; padding: 40px 0; display: grid; gap: 6px; }
.login form { margin-top: 18px; }

/* Startseite */
.top { display: flex; justify-content: space-between; align-items: center; }
.hero { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.hero .big { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hero .big small { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.hero .sub { color: var(--muted); margin: 8px 0 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.stages { display: grid; gap: 8px; }
.stage {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
}
.stage .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.stage .t { font-weight: 700; line-height: 1.2; }
.stage .s { font-size: 13px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.stage .bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.stage .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.stage .pct { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage.locked { opacity: .55; }
.stage.locked .n { background: var(--line); color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.url { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; word-break: break-all; background: var(--bg); border-radius: 8px; padding: 8px 10px; display: block; margin: 8px 0; }
ol.steps { padding-left: 20px; margin: 8px 0 0; }
ol.steps li { margin: 4px 0; }
.list { display: grid; gap: 6px; }
.list .li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.conv { padding: 10px 0; border-bottom: 1px solid var(--line); }
.conv:last-child { border-bottom: 0; }
.conv .when { font-size: 12px; color: var(--muted); }
.conv ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.toggle select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.foot { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }

/* Lernrunde */
.topbar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.topbar .close { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); display: grid; place-items: center; }
.topbar .close svg { width: 22px; height: 22px; }
.progress { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.kind { margin-top: 30px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.kind .tag { color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-left: 8px; }
.prompt { font-size: 30px; font-weight: 750; line-height: 1.2; letter-spacing: -.02em; margin: 10px 0 0; overflow-wrap: anywhere; }
.prompt .gap { display: inline-block; min-width: 2.4em; border-bottom: 3px solid var(--accent); margin: 0 .1em; }
.hint { color: var(--muted); margin-top: 8px; }
.speak { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; min-height: 40px; padding: 6px 14px; border-radius: 20px; font-size: 15px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 0; }
.speak svg { width: 18px; height: 18px; }
.answer { margin-top: 26px; display: grid; gap: 10px; }
.accents { display: flex; gap: 6px; flex-wrap: wrap; }
.accents button { min-height: 40px; min-width: 44px; padding: 4px 10px; border-radius: 10px; font-size: 18px; }
.options { display: grid; gap: 8px; }
.options button { text-align: left; font-size: 19px; font-weight: 600; }
.options button.right { border-color: var(--ok); background: var(--ok-soft); }
.options button.wrong { border-color: var(--bad); background: var(--bad-soft); }
.reveal { font-size: 22px; font-weight: 700; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .no { border-color: var(--bad); color: var(--bad); font-weight: 700; }
.two .yes { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.feedback { margin-top: 18px; border-radius: var(--radius); padding: 16px; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback .verdict { font-weight: 800; font-size: 18px; }
.feedback.ok .verdict { color: var(--ok); }
.feedback.bad .verdict { color: var(--bad); }
.feedback .sol { font-size: 22px; font-weight: 700; margin-top: 4px; }
.feedback .note { color: var(--muted); margin-top: 6px; font-size: 15px; }
.feedback .your { font-size: 15px; margin-top: 4px; }
.feedback .your s { color: var(--bad); }
.spacer { flex: 1; min-height: 20px; }
.actions { display: grid; gap: 10px; margin-top: 18px; }

/* Ergebnis */
.result-big { font-size: 72px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 40px; }
