:root {
	--bg: #0f1419;
	--flaeche: #171e26;
	--flaeche2: #1f2833;
	--linie: #2c3744;
	--text: #e3e8ee;
	--leise: #8b98a8;
	--akzent: #4fb3ff;
	--train: #4fb3ff;
	--test: #ffa94d;
	--gut: #51cf66;
	--schlecht: #ff6b6b;
	--mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

header {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 12px 24px;
	background: var(--flaeche);
	border-bottom: 1px solid var(--linie);
}
header h1 { font-size: 18px; margin: 0; letter-spacing: .5px; }
header h1 span { color: var(--akzent); }
header nav a {
	color: var(--leise);
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 6px;
}
header nav a.aktiv, header nav a:hover { color: var(--text); background: var(--flaeche2); }
header .info { margin-left: auto; color: var(--leise); font-size: 13px; }

main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }

.karte {
	background: var(--flaeche);
	border: 1px solid var(--linie);
	border-radius: 10px;
	padding: 16px 18px;
	margin-bottom: 18px;
}
.karte h2 { font-size: 15px; margin: 0 0 4px; }
.karte .hinweis { color: var(--leise); font-size: 13px; margin: 0 0 12px; }

/* flache Karten mit eigener Scrolleiste (Lernverlauf: Probefragen, Fragetypen) */
.karte.flach { height: 300px; display: flex; flex-direction: column; }
.karte.flach .rollbar { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
.rollbar { scrollbar-width: thin; scrollbar-color: var(--linie) transparent; }

/* Zeitleiste bleibt beim Scrollen oben stehen, damit man die Zeichen-Karte
   darunter sieht, während man den Regler bewegt */
.karte.klebt {
	position: sticky;
	top: 8px;
	z-index: 5;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}

.raster { display: grid; gap: 18px; }
.raster.zwei { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .raster.zwei { grid-template-columns: 1fr; } }

input[type=text], select {
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--linie);
	border-radius: 8px;
	padding: 10px 12px;
	font: inherit;
}
input[type=text] { width: 100%; font-size: 17px; }
input[type=text]:focus, select:focus { outline: none; border-color: var(--akzent); }

button {
	background: var(--akzent);
	color: #06121e;
	border: 0;
	border-radius: 8px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
button.leise { background: var(--flaeche2); color: var(--text); font-weight: normal; }
button:disabled { opacity: .5; cursor: default; }

.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zeile label { color: var(--leise); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
	font-size: 13px;
	padding: 3px 10px;
	border-radius: 20px;
	border: 1px solid var(--linie);
	background: var(--flaeche2);
	cursor: pointer;
	color: var(--text);
}
.chip.train { border-color: color-mix(in srgb, var(--train) 50%, transparent); }
.chip.test { border-color: color-mix(in srgb, var(--test) 60%, transparent); }
.chip.erfunden { border-color: var(--schlecht); }
.legende { display: flex; gap: 16px; font-size: 12px; color: var(--leise); margin-top: 8px; flex-wrap: wrap; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Zeichenkästchen */
.zeichenreihe { display: flex; flex-wrap: wrap; gap: 3px; font-family: var(--mono); }
.zk {
	min-width: 26px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	background: var(--flaeche2);
	font-size: 17px;
	position: relative;
	cursor: default;
	white-space: pre;
	transition: background .15s, transform .15s;
}
.zk.neu { animation: auftauchen .25s ease-out; }
@keyframes auftauchen { from { transform: translateY(-8px) scale(1.3); opacity: 0; } }
.zk.antwort { cursor: pointer; color: #fff; }
.zk.gewaehlt { outline: 2px solid #fff; outline-offset: 1px; }
.zk.klein { min-width: 15px; height: 26px; font-size: 14px; border-radius: 3px; }
.zk.steuer { color: var(--leise); font-size: 11px; }

/* Balken */
.balken { display: grid; grid-template-columns: 42px 1fr 64px; gap: 4px 8px; align-items: center; font-family: var(--mono); }
.balken .z { text-align: center; background: var(--flaeche2); border-radius: 4px; padding: 2px 0; white-space: pre; }
.balken .b { height: 18px; border-radius: 3px; background: var(--akzent); transition: width .3s; }
.balken .b.gewinner { background: var(--gut); }
.balken .w { color: var(--leise); text-align: right; font-size: 13px; }

/* Aufmerksamkeits-Raster (Schicht × Kopf) */
.attraster { display: grid; gap: 4px; }
.attraster .kopf { font-size: 11px; color: var(--leise); text-align: center; }
.attraster canvas { width: 100%; height: 22px; border-radius: 3px; cursor: pointer; border: 1px solid transparent; image-rendering: pixelated; }
.attraster canvas.gewaehlt { border-color: #fff; }

.antwortgross { font-family: var(--mono); font-size: 26px; margin: 6px 0 2px; min-height: 36px; }
.klein { font-size: 12px; color: var(--leise); }

table.proben { width: 100%; border-collapse: collapse; font-size: 14px; }
table.proben td { padding: 5px 6px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
table.proben td:first-child { color: var(--leise); width: 46%; }
table.proben .marke { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
.marke.test { background: color-mix(in srgb, var(--test) 25%, transparent); color: var(--test); }
.marke.erfunden { background: color-mix(in srgb, var(--schlecht) 25%, transparent); color: var(--schlecht); }

canvas.diagramm { width: 100%; height: 260px; display: block; }

.zeitleiste { display: flex; gap: 12px; align-items: center; }
.zeitleiste input[type=range] { flex: 1; accent-color: var(--akzent); }
.zeitleiste .stand { font-family: var(--mono); min-width: 190px; text-align: right; color: var(--leise); }

.typen { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 3px 10px; font-size: 13px; align-items: center; }
.typen .kopfzeile { color: var(--leise); font-size: 12px; }
.typen .t { height: 14px; background: var(--flaeche2); border-radius: 3px; overflow: hidden; }
.typen .t div { height: 100%; transition: width .25s; }

.status { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 13px; }
.status.laeuft { background: color-mix(in srgb, var(--test) 25%, transparent); color: var(--test); }
.status.fertig { background: color-mix(in srgb, var(--gut) 25%, transparent); color: var(--gut); }

details.erklaerung summary { cursor: pointer; color: var(--akzent); }
details.erklaerung p, details.erklaerung li { color: var(--leise); font-size: 14px; }

.fehler { color: var(--schlecht); }
