:root {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #1e242c;
  --line: #2a323c;
  --text: #e6eaef;
  --muted: #94a1b2;
  --accent: #f56600;
  --accent-soft: #f5660022;
  --ok: #4ade80;
  --err: #f87171;
  --radius: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-2: #f0f2f5;
    --line: #dde1e7;
    --text: #16191d;
    --muted: #5c6773;
    --accent: #d95700;
    --accent-soft: #d9570018;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 22px;
}

h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 span { color: var(--accent); }

header .meta {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
  display: flex;
  gap: 14px;
  align-items: center;
}

header form { margin: 0; }

.linkbtn {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}
.linkbtn:hover { color: var(--text); }

/* --- Eingabe --- */

.ask {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.hints[hidden] { display: none; }

textarea, input[type="password"] {
  flex: 1;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  min-height: 52px;
}

textarea:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
button.primary:disabled { opacity: 0.5; cursor: default; }

.hints {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 5px 13px;
}
.hint:hover { border-color: var(--accent); color: var(--text); }

/* --- Gespraechsverlauf --- */

#verlauf:empty { display: none; }
#verlauf { margin-bottom: 26px; }

.runde + .runde {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.frage {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 13px;
  display: flex;
  gap: 9px;
}

.frage::before {
  content: "?";
  color: var(--accent);
  font-weight: 700;
  flex: none;
}

.koerper { padding-left: 21px; }

/* --- Ausgabe --- */

.status {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.antwort {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 16px;
  margin-bottom: 18px;
}

.antwort.wissen {
  border-left-color: var(--muted);
}

.fehler {
  background: var(--panel);
  border: 1px solid var(--err);
  border-left: 3px solid var(--err);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

summary {
  cursor: pointer;
  padding: 11px 16px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}
summary:hover { color: var(--text); }

details > *:not(summary) { padding: 0 16px 14px; }

pre {
  margin: 0;
  overflow-x: auto;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.tabelle { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 7px 12px 7px 0;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; padding-right: 18px; }

.zeilen { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* --- Anmeldung --- */

.login {
  max-width: 340px;
  margin: 14vh auto 0;
  padding: 0 20px;
}

.login h1 { margin-bottom: 6px; }
.login p { color: var(--muted); font-size: 14px; margin-top: 0; margin-bottom: 20px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input { min-height: 0; }
.login button { padding: 11px 22px; }

.login .antwort.wissen {
  border-left-color: var(--muted);
}

.fehler {
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

footer {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
