/* Farben wie auf den Folien (RUB): Blau = Struktur, Grün = aktiv/akzeptiert, Rot = abgelehnt */
:root { --ink: #1d2433; --muted: #5f6778; --blue: #003560; --blue-soft: #e6ecf2; --green: #8dae10; --green-soft: #f0f5dc;
  --green-text: #4f6d00; --red: #b3261e; --line: #dde2e8; --flaeche: #f4f6f9; --petrol: #007c91; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", "Segoe UI", system-ui, sans-serif; color: var(--ink); line-height: 1.45; background: #fff; }
header, main, footer { max-width: 1100px; margin: 0 auto; padding: 0 0.8rem; }
header { padding-top: 0.8rem; }
h1 { font-size: 1.4rem; color: var(--blue); margin: 0 0 0.2rem; }
h2 { font-size: 1.05rem; color: var(--blue); margin: 0 0 0.5rem; }
h3 { font-size: 1rem; margin: 0 0 0.4rem; color: var(--blue); }
.unterzeile, .klein, footer { color: var(--muted); font-size: 0.88rem; }
footer { padding-bottom: 1.5rem; }
button, select, input, textarea { font: inherit; color: inherit; }
button { border: 2px solid var(--blue); background: #fff; color: var(--blue); border-radius: 8px; padding: 0.3rem 0.7rem; font-weight: 600; cursor: pointer; }
button:hover { background: var(--blue-soft); }
button[aria-pressed="true"] { background: var(--blue); color: #fff; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }
button.gefahr { border-color: var(--red); color: var(--red); }
select, input, textarea { border: 1px solid #aab2bf; border-radius: 6px; padding: 0.3rem 0.4rem; background: #fff; }
input.falsch { border-color: var(--red); outline: 2px solid var(--red); }

.werkzeuge { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; margin: 0.6rem 0 0.3rem; }
.gruppe { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.sigma { font-weight: 600; }
.hilfe { font-size: 0.88rem; color: var(--muted); margin: 0.2rem 0 0.5rem; }

.flaeche-rahmen { position: relative; }
#flaeche { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
#flaeche .hintergrund { fill: #fff; }
#flaeche.kantenmodus .zustand { cursor: crosshair; }
.zustand { cursor: grab; }
.zustand .rand-treffer { fill: transparent; stroke: transparent; cursor: crosshair; }
.zustand .kreis { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.zustand .innen { fill: none; stroke: var(--ink); stroke-width: 2; }
.zustand-text { font-size: 21px; font-style: italic; fill: var(--ink); font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", serif; pointer-events: none; }
.zustand.aktiv .kreis { fill: var(--green); }
.zustand.aktiv .zustand-text { fill: var(--blue); }
.zustand.gewaehlt .kreis { stroke: var(--petrol); stroke-width: 4; }
.start-pfeil { stroke: var(--ink); stroke-width: 2; fill: none; }
.kante-linie { fill: none; stroke: var(--ink); stroke-width: 2; }
.kante-treffer { fill: none; stroke: transparent; stroke-width: 18; cursor: pointer; }
.kante-text { font-size: 18px; fill: var(--ink); font-family: "Latin Modern Math", "STIX Two Math", serif; paint-order: stroke; stroke: #fff; stroke-width: 5px; cursor: pointer; }
.kante.benutzt .kante-linie { stroke: var(--green); stroke-width: 4.5; }
.kante.benutzt .kante-text { fill: var(--green-text); font-weight: 700; }
.kante.gewaehlt .kante-linie { stroke: var(--petrol); stroke-width: 4; }
.kante.gewaehlt .kante-text { fill: var(--petrol); font-weight: 700; }
.kante.ohne-zeichen .kante-linie { stroke-dasharray: 6 5; }
.kante.ohne-zeichen .kante-text { fill: var(--red); font-style: italic; }
.kante-neu { stroke: var(--petrol); stroke-width: 2.5; stroke-dasharray: 6 4; }
.pfeilspitze.normal { fill: var(--ink); } .pfeilspitze.benutzt { fill: var(--green); } .pfeilspitze.gewaehlt { fill: var(--petrol); }
.leer-hinweis { fill: var(--muted); font-size: 20px; }

.auswahl { position: absolute; top: 0.6rem; right: 0.6rem; width: min(300px, 80%); background: #fff; border: 2px solid var(--petrol);
  border-radius: 10px; padding: 0.7rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); font-size: 0.92rem; }
.auswahl label { display: block; margin: 0.3rem 0; }
.auswahl label input:not([type]) { width: 7rem; margin-left: 0.3rem; }
.auswahl .zeile { margin-top: 0.5rem; }
.auswahl .zeichen { min-width: 2.6rem; font-family: "Latin Modern Math", "STIX Two Math", serif; font-size: 1.1rem; }

.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.8rem; }
@media (max-width: 760px) { .spalten { grid-template-columns: 1fr; } }
.karte { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; margin-top: 0.8rem; background: #fff; }
.spalten .karte { margin-top: 0; }
.zeile { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0.3rem 0; }
#wort { flex: 1; min-width: 8rem; font-family: "DejaVu Sans Mono", ui-monospace, monospace; font-size: 1.1rem; }

.meldungen { list-style: none; margin: 0; padding: 0; }
.meldungen li { padding: 0.35rem 0.5rem; border-left: 4px solid var(--muted); margin-bottom: 0.3rem; background: var(--flaeche); border-radius: 4px; }
.meldungen li.fehler { border-color: var(--red); }
.meldungen li.fehler::before { content: "✗ "; color: var(--red); font-weight: 700; }
.meldungen li.gut { border-color: var(--green-text); }
.meldungen li.gut::before { content: "✓ "; color: var(--green-text); font-weight: 700; }
.meldungen li.hinweis::before { content: "! "; color: var(--muted); font-weight: 700; }
.meldungen button { margin-left: 0.3rem; padding: 0.1rem 0.5rem; font-size: 0.85rem; }

.sim-wort { font-family: "DejaVu Sans Mono", ui-monospace, monospace; font-size: 1.6rem; letter-spacing: 0.1em; min-height: 2.2rem; margin-top: 0.4rem; }
.sim-wort .fertig { color: #6b7385; }
.sim-wort .naechstes { background: var(--green-soft); box-shadow: inset 0 -3px 0 var(--green); border-radius: 3px; }
.sim-wort .eps { font-size: 1rem; color: var(--muted); font-style: italic; letter-spacing: 0; }
.sim-spur { color: var(--muted); min-height: 1.4rem; }
.sim-spur .menge { color: var(--ink); white-space: nowrap; }
.sim-spur .pfeil { white-space: nowrap; color: var(--green-text); font-weight: 700; }
.sim-ergebnis { font-weight: 600; margin-top: 0.3rem; min-height: 1.4rem; }
.gut { color: var(--green-text); }
.schlecht { color: var(--red); }
.sim-ergebnis.gut::before { content: "✓ "; } .sim-ergebnis.schlecht::before { content: "✗ "; }
details { margin-top: 0.6rem; }
summary { cursor: pointer; color: var(--blue); font-weight: 600; }
#viele { width: 100%; font-family: "DejaVu Sans Mono", ui-monospace, monospace; margin-top: 0.4rem; }
.viele { list-style: none; padding: 0; margin: 0.3rem 0 0; font-family: "DejaVu Sans Mono", ui-monospace, monospace; }

.gruppen { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; margin: 0.6rem 0; }
.gruppe-karte { border: 2px solid var(--line); border-radius: 14px; padding: 0.5rem 0.6rem; background: var(--flaeche); }
.gruppe-karte.akz { border-color: var(--green-text); background: var(--green-soft); }
.gruppe-titel { font-weight: 700; color: var(--blue); }
.marke { font-size: 0.75rem; font-weight: 700; color: var(--muted); border: 1px solid currentColor; border-radius: 4px; padding: 0 0.25rem; margin-left: 0.2rem; }
.akz .marke { color: var(--green-text); }
.gruppe-woerter { font-family: "DejaVu Sans Mono", ui-monospace, monospace; margin-top: 0.3rem; line-height: 1.7; }
.gruppe-woerter .w { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 0 0.25rem; white-space: nowrap; }
.gruppe-woerter .mehr { color: var(--muted); font-family: inherit; font-size: 0.85rem; }
.vergleich { margin-top: 0.6rem; font-weight: 600; }
.vgl-ergebnis { margin: 0.3rem 0 0; }

.formel { font-family: "Latin Modern Math", "STIX Two Math", serif; font-size: 1.1rem; }
.tabelle-rahmen { overflow-x: auto; }
#tabelle { border-collapse: collapse; margin-top: 0.4rem; font-family: "Latin Modern Math", "STIX Two Math", serif; font-size: 1.05rem; }
#tabelle th, #tabelle td { border: 1px solid var(--line); padding: 0.25rem 0.8rem; text-align: center; }
#tabelle thead th { background: var(--blue-soft); }
#tabelle td.schlecht { background: #fbeaea; }
