/* Kunststoffe: Karteikarten und Quiz (Chemie) – nutzt die Farben aus style.css */
.kunststoffe { max-width: 760px; }
.kunststoffe .einleitung { margin-bottom: 1.5rem; }

/* Modus-Umschalter */
.ks-modus {
  display: inline-flex;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.kunststoffe .ks-tab {
  margin: 0;
  padding: .5rem 1.2rem;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.kunststoffe .ks-tab:hover { background: var(--bg); }
.kunststoffe .ks-tab.aktiv { background: var(--akzent); color: #fff; }

/* Leiste über der Karte */
.ks-leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.ks-leiste label { margin: 0; color: var(--text-soft); font-weight: 600; }
.ks-leiste select { width: auto; margin: 0; }
.ks-fortschritt { color: var(--muted); font-size: .95rem; }
.ks-leiste .ks-fortschritt:first-of-type { margin-left: auto; }
#ks-quiz .ks-leiste .ks-fortschritt:first-child { margin-left: 0; }
#ks-quiz .ks-leiste #ks-q-punkte { margin-left: auto; }

/* Karte */
.ks-karte {
  min-height: 220px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.ks-name {
  margin: .4rem 0 .8rem;
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 600;
}

.ks-kurz { color: var(--muted); font-weight: 400; }

.ks-label {
  margin-bottom: .4rem;
  color: var(--muted);
  font-size: .85rem;
}

.ks-hinten {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.ks-abschnitt { margin-bottom: 1.2rem; }
.kunststoffe .ks-abschnitt p { max-width: none; color: var(--text); font-size: 1rem; }
.kunststoffe .ks-abschnitt p.ks-bsp { margin-top: .3rem; color: var(--muted); font-size: .95rem; }
.kunststoffe p.ks-fertig { color: var(--text); font-size: 1.2rem; }

/* Strukturformeln */
.ks-formel {
  display: block;
  max-width: 100%;
  height: auto;
  color: var(--text);
}

.ks-formel .ks-bindungen line,
.ks-formel .ks-klammer {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.ks-formel text {
  fill: currentColor;
  font-family: Arial, sans-serif;
  font-size: 17px;
  text-anchor: middle;
  dominant-baseline: central;
}

.ks-formel text.ks-n { font-size: 15px; font-style: italic; text-anchor: start; }

.ks-bild { overflow-x: auto; }

.ks-monomere {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.ks-monomere figure { margin: 0; max-width: 100%; }

.ks-monomere figcaption {
  margin-top: .2rem;
  color: var(--text-soft);
  font-size: .9rem;
}

.ks-plus { color: var(--text-soft); font-size: 1.5rem; }

/* Knöpfe unter der Karte */
.ks-knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ks-knoepfe button { margin: 0; }

/* Quiz */
.ks-frage {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
}

.ks-frage .ks-kurz { font-weight: 600; }
.ks-quiz-bild, #ks-q-bild { margin-bottom: 1rem; }

.ks-optionen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ks-optionen.ks-formel-optionen { grid-template-columns: minmax(0, 1fr); }

.kunststoffe .ks-option {
  position: relative;
  margin: 0;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  text-align: left;
}

.kunststoffe .ks-option:hover { background: var(--bg); border-color: var(--akzent); }
.kunststoffe .ks-option.gesperrt { cursor: default; }
.kunststoffe .ks-option.gesperrt:hover { background: var(--card); border-color: var(--border); }

.kunststoffe .ks-option.richtig,
.kunststoffe .ks-option.richtig:hover {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.kunststoffe .ks-option.falsch,
.kunststoffe .ks-option.falsch:hover {
  border-color: var(--fehler-border);
  background: var(--fehler-bg);
  color: var(--fehler-text);
}

.ks-option.richtig .ks-formel { color: var(--ok-text); }
.ks-option.falsch .ks-formel { color: var(--fehler-text); }

.ks-formel-optionen .ks-option { padding-left: 2.6rem; }

.ks-buchstabe {
  position: absolute;
  top: .7rem;
  left: 1rem;
  font-weight: 600;
}

.ks-feedback { margin-top: 1rem; min-height: 1.5rem; color: var(--text); }
.ks-feedback.ok { color: var(--ok-text); font-weight: 600; }
.ks-feedback.fehler { color: var(--fehler-text); font-weight: 600; }
.kunststoffe .ks-feedback p { max-width: none; color: var(--text); font-size: 1rem; }
.ks-feedback ul { margin: .4rem 0 0 1.4rem; }

.kunststoffe p.ks-klein {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}
