/* Quadratzahlen-Quiz (08.11.2026): nur was das Quiz braucht. Grundstile in /seite.css. */

:root {
	--richtig: #1d6b3c;
	--richtig-hell: #eaf5ee;
	--falsch: #a12a1c;
	--falsch-hell: #fbeeec;
}

/* Auswahl */
.gruppen {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.2rem;
}

fieldset { border: none; min-width: 0; }

.gruppe legend, .laenge legend {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-weight: 700;
	color: var(--akzent-dark);
	margin-bottom: 0.4rem;
}

.typen { list-style: none; }

.haken {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-height: 2.75rem;
	cursor: pointer;
	line-height: 1.3;
}

.haken input, .wahlknopf input {
	width: 1.3rem;
	height: 1.3rem;
	flex: none;
	accent-color: var(--akzent);
	cursor: pointer;
}

.haken .beispiel { color: var(--ink-light); font-size: 0.92rem; white-space: nowrap; }

.laenge {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 1.6rem;
	margin-top: 1.2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.laenge legend { float: left; width: 100%; }

.wahlknopf {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 2.75rem;
	cursor: pointer;
}

.fehlertext { color: var(--falsch); font-weight: 700; margin-top: 0.6rem; }
.fehlertext:empty { display: none; }

#blitz-info { margin-top: 0.8rem; }

/* Laufende Runde */
#quiz, #ergebnis, #auswahl { scroll-margin-top: 5rem; }

.quiz-kopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.6rem 1rem;
	margin-bottom: 0.6rem;
}

.stand { font-size: 1.05rem; margin: 0; }

.zeit {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--akzent-dark);
	background: var(--akzent-light);
	border-radius: 999px;
	padding: 0.25rem 0.9rem;
	margin-left: auto;
}

.fortschritt {
	height: 6px;
	background: var(--akzent-light);
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 1rem;
}

.fortschritt-balken {
	height: 100%;
	width: 0;
	background: var(--akzent);
	transition: width 0.3s;
}

.auftrag { color: var(--ink-light); margin-bottom: 0.4rem; }
.auftrag:empty { display: none; }

.frage {
	font-size: clamp(1.6rem, 6.5vw, 2.1rem);
	line-height: 1.5;
	color: var(--akzent-dark);
	margin-bottom: 0.6rem;
	font-variant-numeric: lining-nums;
}

.frage:empty { display: none; }

/* Gestapelter Bruch */
.bruch {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	vertical-align: middle;
	font-size: 0.82em;
	line-height: 1.15;
	margin: 0 0.12em;
}

.bruch > span:first-child { border-bottom: 2px solid currentColor; padding: 0 0.2em 0.05em; }
.bruch > span:last-child { padding: 0.05em 0.2em 0; }

/* Quadrat (Typ 3 und 4) */
.bild svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0.2rem 0 0.8rem; }
.bild .flaeche { fill: var(--akzent-light); stroke: var(--akzent-dark); stroke-width: 2.5; }
.bild .beschriftung { font-family: 'PT Serif', Georgia, serif; font-size: 17px; fill: var(--ink); }
.bild .masslinie { stroke: var(--ink-light); stroke-width: 1.5; }

/* Eingabefelder */
.felder {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.8rem 1.2rem;
	margin: 0.4rem 0 0.2rem;
}

.feld { display: flex; flex-direction: column; gap: 0.25rem; }
.feld > label { font-size: 0.95rem; color: var(--ink-light); }

.feld-zeile { display: flex; align-items: center; gap: 0.4rem; }

.felder input[type="text"] {
	font-family: 'PT Serif', Georgia, serif;
	font-size: 1.45rem;
	width: 7.5rem;
	min-height: 3.1rem;
	padding: 0.35rem 0.6rem;
	border: 1.5px solid var(--ink-light);
	border-radius: 10px;
	background: var(--white);
	color: var(--ink);
	font-variant-numeric: tabular-nums lining-nums;
}

.felder input[readonly] { background: #f4f3ef; }

.einheit { font-size: 1.3rem; color: var(--ink); }

.vorzeichen {
	min-width: 3rem;
	min-height: 3.1rem;
	border-radius: 10px;
	border: 1.5px solid var(--akzent);
	background: var(--white);
	color: var(--akzent-dark);
	font: inherit;
	font-size: 1.35rem;
	font-weight: 700;
	cursor: pointer;
}

.vorzeichen:hover { background: var(--akzent-light); }

/* Bruch-Eingabe: Zähler über Nenner */
.bruch-eingabe { display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.bruch-eingabe .strich { width: 100%; height: 0; border-top: 2.5px solid var(--ink); }
.bruch-eingabe input[type="text"] { text-align: center; }

/* Wurzelterm: Faktor √ Radikand */
.wurzel-eingabe { display: inline-flex; align-items: center; gap: 0.2rem; }
.wurzel-eingabe .wurzelzeichen { font-size: 2.1rem; line-height: 1; color: var(--ink); padding-left: 0.2rem; }
.wurzel-eingabe .radikand input[type="text"] { border-top-width: 3px; border-top-color: var(--ink); }

.felder .knopf { min-height: 3.1rem; }

.zwischen { font-size: 1.15rem; padding-bottom: 0.7rem; }

.aktionen { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.1rem; }
.aktionen .knopf { min-width: 9rem; }

/* Rückmeldung */
.rueckmeldung:empty { display: none; }

.rueckmeldung {
	margin-top: 1.1rem;
	padding: 0.9rem 1rem;
	border-radius: 10px;
	border-left: 5px solid var(--ink-light);
	background: #f4f3ef;
	font-size: 1.08rem;
}

.rueckmeldung.ist-richtig { border-left-color: var(--richtig); background: var(--richtig-hell); }
.rueckmeldung.ist-falsch { border-left-color: var(--falsch); background: var(--falsch-hell); }

.rueckmeldung .urteil {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 700;
}

.rueckmeldung.ist-richtig .urteil { color: var(--richtig); }
.rueckmeldung.ist-falsch .urteil { color: var(--falsch); }
.rueckmeldung .urteil svg { flex: none; }
.rueckmeldung p + p { margin-top: 0.35rem; }

/* Ergebnis */
.ergebnis-zahl {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 1.35rem;
	color: var(--akzent-dark);
	margin-bottom: 0.4rem;
}

#ergebnis h3 { font-size: 1.1rem; margin: 1.4rem 0 0.6rem; }

.fehler-liste { padding-left: 1.4rem; }
.fehler-liste li { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.fehler-liste li:first-child { border-top: none; }
.fehler-liste .term { font-size: 1.15rem; color: var(--akzent-dark); }
.fehler-liste .klein { display: block; }

/* Tabelle */
.tabelle summary {
	cursor: pointer;
	font-family: 'Libre Baskerville', Georgia, serif;
	font-weight: 700;
	color: var(--akzent-dark);
	min-height: 2.75rem;
	display: flex;
	align-items: center;
}

.tabelle table {
	margin-top: 0.8rem;
	border-collapse: collapse;
	width: 100%;
	max-width: 26rem;
	font-variant-numeric: tabular-nums lining-nums;
}

.tabelle caption { text-align: left; color: var(--ink-light); font-size: 0.95rem; padding-bottom: 0.4rem; }
.tabelle th, .tabelle td { padding: 0.3rem 0.6rem; text-align: right; border-bottom: 1px solid var(--border); }
.tabelle thead th { color: var(--akzent-dark); border-bottom: 2px solid var(--akzent); }
.tabelle tbody th { font-weight: 400; color: var(--ink-light); }
.tabelle td { font-weight: 700; }
.tabelle tbody th:nth-of-type(2) { border-left: 1px solid var(--border); }

.hinweis { color: var(--ink-light); }

@media (max-width: 640px) {
	.gruppen { grid-template-columns: 1fr; }
	.aktionen .knopf { width: 100%; }
	.felder input[type="text"] { width: 6.5rem; }
}
