/* Kapitel 3 – Bio. Eigene Farbwelt: Nachtviolett, Impuls-Magenta, Nerven-Cyan
   und ein bisschen Neon-Limette. Aufbau wie Kapitel 1 und 2. */

:root {
  --nacht: #110a1c;
  --dunkel: #1b1129;
  --tiefer: #150d22;
  --rand: #3a2a55;
  --puls: #ff3d8b;
  --puls-hell: #ff7fb4;
  --nerv: #45e6ff;
  --lime: #a6ff5c;
  --lemon: #ffd447;
  --papier: #efe8ff;
  --grau: #9c8fb5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--nacht);
  color: var(--papier);
  font-family: "Comic Neue", "Comic Sans MS", sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
}
h1, h2 {
  font-family: "Bangers", "Impact", fantasy;
  font-weight: normal;
  letter-spacing: 3px;
  color: var(--puls);
  text-shadow: 0 0 20px rgba(255, 61, 139, .4), 0 4px 0 #3d0a22;
  margin: 0 0 .5em;
}
h2 { font-size: clamp(1.9rem, 6vw, 2.8rem); }
h3, h4 {
  font-family: "Bangers", fantasy; font-weight: normal; letter-spacing: 1.5px;
  color: var(--nerv); margin: 0 0 .3em;
}
section { padding: 66px 18px; max-width: 1160px; margin: 0 auto; }
a { color: var(--nerv); }
.vorspann { color: var(--grau); max-width: 70ch; margin: 0 0 22px; }

/* ---------- Startbild ---------- */
#start {
  max-width: none;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #2a1440 0%, var(--nacht) 68%);
}
#start h1 { font-size: clamp(2.4rem, 9.5vw, 6.2rem); line-height: 1; }
#start p { font-size: 1.12rem; max-width: 640px; padding: 0 18px; }
.untertitel { color: var(--nerv); letter-spacing: 2px; }

#impuls { width: min(94vw, 720px); height: auto; margin: 6px 0 14px; }
#impuls .bahn { fill: none; stroke: #4c3a6e; stroke-width: 5; stroke-linecap: round; }
#impuls .funke {
  fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 26 620; filter: drop-shadow(0 0 6px var(--lime));
  animation: fliessen 2.6s linear infinite;
}
@keyframes fliessen { from { stroke-dashoffset: 646; } to { stroke-dashoffset: 0; } }
#impuls .auge path { fill: #2a1a3f; stroke: var(--nerv); stroke-width: 3.5; }
#impuls .iris { fill: var(--nerv); opacity: .75; }
#impuls .pupille { fill: #0d0716; }
#impuls .glanz { fill: #fff; opacity: .9; }
#impuls .gehirn path { fill: #3a1d3c; stroke: var(--puls); stroke-width: 3.5; }
#impuls .gehirn .falten { fill: none; stroke: var(--puls-hell); stroke-width: 2.4; }
@media (prefers-reduced-motion: reduce) { #impuls .funke { animation: none; stroke-dashoffset: 300; } }

.runter {
  position: absolute; bottom: 20px; color: var(--lime); text-decoration: none;
  font-size: 2rem; animation: schweben 2s infinite;
}
@keyframes schweben { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* ---------- Gemeinsame Bausteine ---------- */
.infobox {
  background: var(--dunkel); border: 1px solid var(--rand);
  border-left: 5px solid var(--puls); padding: 16px 20px;
}
.infobox h4 { font-size: 1.35rem; }
.infobox p { margin: 0 0 .6em; }
.infobox p:last-child { margin-bottom: 0; }
.infobox.leise { border-left-color: var(--rand); color: var(--grau); }
.infobox .begriff {
  font-family: "Special Elite", monospace; color: var(--lemon); font-size: .95rem;
}
dl.kurz, .sinnesblatt dl { margin: 0 0 12px; }
dl.kurz dt, .sinnesblatt dt {
  font-family: "Special Elite", monospace; color: var(--nerv);
  font-size: .82rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 8px;
}
dl.kurz dd, .sinnesblatt dd { margin: 0; }

button { font: inherit; }
.schalterreihe { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 0; }
.schalterreihe button, .kettenknoepfe button, .lichtschalter button {
  font: inherit; font-size: .95rem; color: var(--papier); background: var(--dunkel);
  border: 2px solid var(--rand); padding: 8px 14px; cursor: pointer; transition: all .15s;
}
.schalterreihe button:hover, .kettenknoepfe button:hover, .lichtschalter button:hover {
  border-color: var(--nerv);
}
.schalterreihe button.aktiv, .lichtschalter button.aktiv {
  background: var(--nerv); border-color: var(--nerv); color: #06222b;
}
.schalterreihe button:disabled { opacity: .45; cursor: default; }

/* ---------- 1 · Die Kette ---------- */
.kettenknoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.glieder {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
/* Auf dem Bildschirm vier oben, drei unten – das sieht nach Kette aus */
@media (min-width: 901px) { .glieder { grid-template-columns: repeat(4, 1fr); } }
.glied {
  background: var(--dunkel); border: 1px solid var(--rand); border-top: 3px solid var(--rand);
  padding: 12px 14px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.glied:hover { transform: translateY(-3px); }
.glied .zahl {
  font-family: "Bangers", fantasy; font-size: 1.5rem; letter-spacing: 2px;
  line-height: 1; color: var(--grau);
}
.glied .szene { font-weight: 700; }
.glied .fach {
  display: none; font-family: "Special Elite", monospace;
  font-size: .82rem; color: var(--lemon); line-height: 1.35;
}
.glieder.mit-fach .fach { display: block; }
.glied.reiz     { border-top-color: var(--lime); }
.glied.hin      { border-top-color: var(--nerv); }
.glied.zentrum  { border-top-color: var(--puls); }
.glied.zurueck  { border-top-color: var(--lemon); }
.glied.reaktion { border-top-color: var(--lime); }
.glied.aktiv {
  background: #2a1a40; border-color: var(--puls);
  box-shadow: 0 0 16px rgba(255, 61, 139, .3);
}
.glied.aktiv .zahl { color: var(--puls); }

/* ---------- 2 · Begriffe ---------- */
.begriffe { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.begriff-karte {
  background: var(--dunkel); border: 1px solid var(--rand); border-left: 5px solid var(--nerv);
  padding: 16px 18px;
}
.begriff-karte h3 { font-size: 1.5rem; color: var(--lime); }
.begriff-karte p { margin: 0 0 .5em; }
.begriff-karte .bsp {
  font-family: "Special Elite", monospace; font-size: .86rem; color: var(--grau); margin: 0;
}

/* ---------- 3 · Sinne ---------- */
.sinnesfeld { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.sinneswahl { display: grid; gap: 8px; }
.sinneswahl button {
  font: inherit; text-align: left; display: flex; align-items: center; gap: 10px;
  background: var(--dunkel); color: var(--papier); border: 1px solid var(--rand);
  border-left: 4px solid var(--rand); padding: 9px 12px; cursor: pointer; transition: all .15s;
}
.sinneswahl button:hover { border-left-color: var(--nerv); }
.sinneswahl button.aktiv { background: #2a1a40; border-left-color: var(--puls); color: #fff; }
.sinneswahl .zeichen { font-size: 1.4rem; line-height: 1; }
.sinnesblatt {
  background: var(--dunkel); border: 1px solid var(--rand); border-top: 4px solid var(--puls);
  padding: 20px 24px; min-height: 280px;
}
.sinnesblatt h3 { font-size: 1.8rem; color: var(--puls-hell); }
.sinnesblatt .merk { margin-top: 0; }

/* ---------- 4 · Netzhaut ---------- */
.lichtweg { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; padding: 0; margin: 0 0 12px; }
.lichtweg li {
  background: var(--tiefer); border: 1px solid var(--rand); padding: 4px 10px;
  font-size: .9rem; display: flex; align-items: center; gap: 8px;
}
.lichtweg li::after { content: "▸"; color: var(--lemon); }
.lichtweg li:last-child { border-color: var(--lemon); }
.lichtweg li:last-child::after { content: ""; }
.wegtext { color: var(--grau); max-width: 75ch; margin: 0 0 22px; }

.lichtschalter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.zellen { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.zellkarte {
  background: var(--dunkel); border: 1px solid var(--rand); padding: 14px 18px;
  opacity: .45; transition: opacity .25s, box-shadow .25s, border-color .25s;
}
.zellkarte.aktiv { opacity: 1; border-color: var(--lime); box-shadow: 0 0 18px rgba(166, 255, 92, .18); }
.zellkarte h3 { font-size: 1.6rem; }
.zellkarte.staebchen h3 { color: var(--papier); }
.zellkarte.zapfen h3 { color: var(--lemon); }
.zellkarte .wann { color: var(--grau); font-size: .88rem; margin: 0 0 10px; }
.zellkarte .zeile {
  display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--rand); padding: 5px 0; font-size: .95rem;
}
.zellkarte .zeile span { color: var(--grau); flex: none; }
.zellkarte .zeile b { text-align: right; font-weight: 700; }
#netzhaut { transition: background .4s; }
#netzhaut.dunkel { background: linear-gradient(180deg, #0b0614 0%, var(--nacht) 100%); }
#netzhautinfo { margin-bottom: 12px; }
.infobox.blind { border-left-color: var(--lemon); }

/* ---------- 5 + 6 · Das Auge im Schnitt ---------- */
.augenfeld { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
.buehne { background: var(--tiefer); border: 1px solid var(--rand); padding: 6px; }
.buehne svg { width: 100%; height: auto; display: block; }

.apfel { fill: #241536; stroke: #6b53a0; stroke-width: 2; }
.netzhaut { fill: none; stroke: var(--puls); stroke-width: 5; opacity: .9; }
.hornhaut { fill: none; stroke: var(--nerv); stroke-width: 3; opacity: .8; }
.iris { stroke: var(--lemon); stroke-width: 6; stroke-linecap: round; opacity: .8; }
.linse { fill: rgba(69, 230, 255, .22); stroke: var(--nerv); stroke-width: 2.5; transition: rx .3s; }
.muskel { fill: none; stroke: #8a6fbe; stroke-width: 7; stroke-linecap: round; }
.muskel.fest { stroke: var(--puls); stroke-width: 9; }
.zonula { fill: none; stroke: #b9a7dc; stroke-width: 1.6; }
.brille { fill: rgba(166, 255, 92, .18); stroke: var(--lime); stroke-width: 2.5; }
.strahl { fill: none; stroke: var(--lemon); stroke-width: 2.2; opacity: .95; }
.strahl.gedacht { stroke-dasharray: 5 5; opacity: .5; }
.brennpunkt { fill: var(--lemon); stroke: #4a3a00; stroke-width: 1.5; }
.brennpunkt.sitzt { fill: var(--lime); }
.fleck { fill: rgba(255, 61, 139, .45); }
.beschriftung {
  font-family: "Special Elite", monospace; font-size: 13px; fill: var(--grau);
  /* dunkler Rand um die Schrift, damit sie auch über Strahlen lesbar bleibt */
  stroke: var(--tiefer); stroke-width: 4; paint-order: stroke;
}
.beschriftung.netz { fill: var(--puls-hell); }

/* Auf dem Handy ist die Tabelle breiter als der Bildschirm – sie bekommt
   einen eigenen Schieberahmen, damit die Seite selbst nicht wandert. */
.tabellenrahmen { margin-top: 26px; overflow-x: auto; }
.vergleich { width: 100%; min-width: 420px; border-collapse: collapse; }
.wischhinweis { display: none; color: var(--grau); font-size: .8rem; margin: 6px 0 0; }
.vergleich th {
  font-family: "Bangers", fantasy; font-weight: normal; letter-spacing: 1px;
  color: var(--nerv); font-size: 1.2rem; text-align: left; padding: 8px;
  border-bottom: 2px solid var(--rand);
}
.vergleich td { padding: 8px; border-bottom: 1px solid var(--rand); }
.vergleich .gu {
  font-family: "Bangers", fantasy; letter-spacing: 1px; color: var(--lemon);
  width: 3em; text-align: center;
}
.vergleich .gu.gleich { color: var(--lime); }

/* ---------- 7 · Farbensehen ---------- */
.farbfeld { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.proben { display: grid; gap: 7px; }
.proben button {
  font: inherit; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--dunkel); color: var(--papier); border: 1px solid var(--rand);
  padding: 7px 11px; cursor: pointer; transition: all .15s;
}
.proben button:hover { border-color: var(--probe); }
.proben button.aktiv { background: #2a1a40; border-color: var(--probe); box-shadow: 0 0 14px -2px var(--probe); }
.klecks {
  width: 22px; height: 22px; border-radius: 50%; background: var(--probe);
  border: 2px solid rgba(255,255,255,.25); flex: none;
}
.zapfenpult { display: grid; gap: 12px; }
.balken { background: var(--dunkel); border: 1px solid var(--rand); padding: 16px 18px; max-width: 620px; }
.balkenzeile { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.balkenzeile:last-child { margin-bottom: 0; }
.balkenzeile .kuerzel {
  font-family: "Bangers", fantasy; font-size: 1.3rem; letter-spacing: 1px;
  color: var(--zapfen); width: 1.4em; flex: none;
}
.rinne { flex: 1; height: 16px; background: var(--tiefer); border: 1px solid var(--rand); }
.fuellung { display: block; height: 100%; background: var(--zapfen); transition: width .35s; }
.balkenzeile .wert { font-size: .85rem; color: var(--grau); width: 3.4em; text-align: right; flex: none; }
#farbinfo small { font-family: "Special Elite", monospace; font-size: .75rem; color: var(--grau); }

/* ---------- Quiz ---------- */
.quiz { background: var(--dunkel); border: 1px solid var(--rand); padding: 28px 22px; text-align: center; }
.quiz .frage { font-size: 1.22rem; margin-bottom: 20px; min-height: 3em; }
.quiz #antworten { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quiz button {
  font: inherit; font-size: 1.02rem; color: var(--papier);
  background: #251838; border: 2px solid var(--rand); padding: 11px 18px;
  cursor: pointer; transition: background .2s, transform .1s, border-color .2s;
  width: min(100%, 520px);
}
.quiz button:hover { background: var(--nerv); border-color: var(--nerv); color: #06222b; transform: scale(1.02); }
.quiz button:disabled { cursor: default; transform: none; opacity: .55; }
.quiz .richtig { background: #2f6b33 !important; border-color: var(--lime) !important; color: #fff !important; opacity: 1 !important; }
.quiz .falsch  { background: #7d1840 !important; border-color: var(--puls) !important; color: #fff !important; opacity: 1 !important; }
.quiz .rueckmeldung { min-height: 1.6em; margin-top: 16px; font-size: 1.1rem; }
.quiz .punkte { color: var(--grau); margin-top: 10px; }
.fortschritt { height: 5px; background: #251838; margin-bottom: 22px; }
.fortschritt div { height: 100%; background: var(--puls); width: 0; transition: width .3s; }

#eintragen { margin-top: 22px; border-top: 1px dashed var(--rand); padding-top: 20px; }
#eintragen input[type=text] {
  font: inherit; font-size: 1.02rem; background: var(--nacht); color: var(--papier);
  border: 2px solid var(--rand); padding: 10px 12px; width: min(100%, 260px);
}
#eintragen input[type=text]:focus { outline: none; border-color: var(--nerv); }
#eintragen .honig { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.formfehler { color: var(--puls); min-height: 1.4em; margin-top: 8px; }

.siegerliste { background: var(--dunkel); border: 1px solid var(--rand); padding: 10px 18px; overflow-x: auto; }
.siegerliste table { width: 100%; border-collapse: collapse; }
.siegerliste th {
  font-family: "Bangers", fantasy; font-weight: normal; color: var(--nerv);
  font-size: 1.25rem; letter-spacing: 1px; text-align: left; padding: 8px;
}
.siegerliste td { padding: 8px; border-top: 1px solid var(--rand); }
.siegerliste tr.ich td { color: #fff; background: rgba(255, 61, 139, .2); }
.siegerliste td:first-child { width: 4em; }

footer { text-align: center; color: var(--grau); padding: 40px 20px; font-size: .9rem; }
footer strong { color: var(--puls); }
footer a { color: var(--grau); }
.quelle { font-size: .8rem; color: #6d6183; margin-top: 10px; }

/* ---------- Handy ---------- */
@media (max-width: 900px) {
  .sinnesfeld, .augenfeld, .farbfeld { grid-template-columns: 1fr; }
  .sinneswahl { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 640px) {
  section { padding: 46px 14px; }
  .zellen { grid-template-columns: 1fr; }
  .zellkarte { opacity: .7; }
  .glieder { grid-template-columns: 1fr; }
  .glied { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .glied .zahl { width: 1.2em; flex: none; }
  .glied .szene { flex: 1; min-width: 60%; }
  .glied .fach { width: 100%; padding-left: calc(1.2em + 10px); }
  .sinneswahl { grid-template-columns: 1fr 1fr; }
  .sinneswahl button { font-size: .88rem; padding: 8px 9px; }
  .sinnesblatt { padding: 16px; min-height: 0; }
  .vergleich { font-size: .85rem; min-width: 400px; }
  .vergleich th, .vergleich td { padding: 6px 4px; }
  .wischhinweis { display: block; }
  .quiz { padding: 20px 14px; }
  .beschriftung { font-size: 16px; }
}
