/* Tasten-Survivor – Gestaltung */
:root {
  --hg: #eef6ff; --karte: #ffffff; --text: #1e293b; --leise: #64748b; --rand: #dbe4f0;
  --haupt: #0d9488; --haupt-dunkel: #0f766e; --akzent: #f97316; --gelb: #facc15;
  --rot: #ef4444; --gruen: #22c55e;
  --radius: 18px; --schatten: 0 6px 0 rgba(30, 41, 59, .08), 0 10px 30px rgba(30, 41, 59, .08);
  --taste: 52px;
  --schrift: "Nunito", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--schrift); color: var(--text); background: var(--hg);
  background-image: radial-gradient(#d6e6fa 1.5px, transparent 1.5px); background-size: 26px 26px;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 2rem; } h1 small { font-size: 1rem; color: var(--leise); font-weight: 600; }
p { line-height: 1.5; }
.leise { color: var(--leise); }
kbd { display: inline-block; min-width: 1.8em; padding: .1em .45em; border-radius: 7px; background: #fff; border: 2px solid var(--rand);
  border-bottom-width: 4px; font-family: var(--mono); font-weight: 700; text-align: center; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- Knöpfe & Karten */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--haupt); color: #fff; font: 800 1rem var(--schrift); padding: .75em 1.3em; text-decoration: none;
  box-shadow: 0 5px 0 var(--haupt-dunkel); transition: transform .08s, box-shadow .08s, filter .15s; }
.knopf:hover { filter: brightness(1.08); }
.knopf:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--haupt-dunkel); }
.knopf:disabled { background: #cbd5e1; box-shadow: 0 5px 0 #94a3b8; cursor: not-allowed; }
.knopf small { opacity: .75; font-weight: 600; }
.knopf img { width: 22px; height: 22px; }
.knopf.zweit { background: #fff; color: var(--text); box-shadow: 0 5px 0 var(--rand); border: 2px solid var(--rand); }
.knopf.klein { padding: .45em .9em; font-size: .9rem; }
.knopf.gross { font-size: 1.25rem; padding: .85em 2em; }
.knopf.voll { width: 100%; margin-top: .6em; }
.knopfreihe { display: flex; gap: .8em; justify-content: center; flex-wrap: wrap; margin-top: 1em; }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.2rem 1.4rem; border: 2px solid #e8eef6; }

/* ---------------------------------------------------------------- Kopfleiste */
#kopf { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .5rem 1.2rem;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--rand); flex-wrap: wrap; }
#kopf[hidden] { display: none; }
.logo img { height: 52px; display: block; }
#kopf nav { display: flex; gap: .3rem; flex: 1; flex-wrap: wrap; }
.tab { display: flex; align-items: center; gap: .4em; padding: .5em .9em; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 800; }
.tab img { width: 26px; height: 26px; object-fit: contain; }
.tab:hover { background: #f1f5f9; }
.tab.aktiv { background: #ccfbf1; color: var(--haupt-dunkel); }
.werte { display: flex; align-items: center; gap: .8rem; }
.wert { display: flex; align-items: center; gap: .25em; font-weight: 900; font-size: 1.1rem; }
.wert img { width: 28px; height: 28px; }
.profil-knopf { display: flex; align-items: center; gap: .5em; border: 2px solid var(--rand); background: #fff; border-radius: 40px; padding: .2em .9em .2em .2em; cursor: pointer; font-family: var(--schrift); text-align: left; }
.profil-knopf img { width: 44px; height: 44px; }
.profil-knopf span:not(.th-held) { display: flex; flex-direction: column; min-width: 90px; } /* nicht das Held-Porträt (sonst verzerrt) */
.profil-knopf small { color: var(--leise); font-weight: 700; }
.xp-balken { display: block; height: 7px; background: #e2e8f0; border-radius: 9px; overflow: hidden; margin-top: 2px; }
.xp-balken i { display: block; height: 100%; background: linear-gradient(90deg, #a78bfa, #7c3aed); border-radius: 9px; }

main { max-width: 1400px; margin: 0 auto; padding: 1.2rem; }

/* ---------------------------------------------------------------- Start */
.start { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; min-height: 85vh; }
.start-held { text-align: center; }
.start-logo { width: min(480px, 100%); }
.start-slogan { font-size: 1.35rem; font-weight: 800; color: var(--haupt-dunkel); }
.start-fixi { width: min(380px, 80%); animation: schweben 3s ease-in-out infinite; }
.start-karte h2 { font-size: 1.7rem; }
.profil-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.profil-wahl { display: flex; flex-direction: column; align-items: center; gap: .2em; padding: .8em; border-radius: 16px; border: 2px solid var(--rand); background: #f8fafc; cursor: pointer; font-family: var(--schrift); font-size: 1rem; transition: transform .1s; }
.profil-wahl:hover { transform: translateY(-3px); border-color: var(--haupt); }
.profil-wahl img { width: 84px; }
.profil-wahl small { color: var(--leise); font-weight: 700; }
.neu-form { display: grid; gap: .6rem; border-top: 2px dashed var(--rand); padding-top: 1rem; }
.neu-form h3 { margin: 0; }
.neu-form input { font: 700 1.1rem var(--schrift); padding: .7em .9em; border-radius: 12px; border: 2px solid var(--rand); }
.neu-form input:focus { outline: none; border-color: var(--haupt); }
.klein-link { display: block; margin-top: 1rem; font-size: .9rem; text-align: right; }

/* ---------------------------------------------------------------- Lernpfad */
.pfad-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.4rem; align-items: start; }
.seitenleiste { position: sticky; top: 80px; display: grid; gap: 1rem; }
.welt { margin-bottom: 1.8rem; }
.welt-kopf { display: flex; justify-content: space-between; align-items: end; margin-bottom: .5rem; }
.welt-kopf small { font-weight: 900; color: var(--wf); text-transform: uppercase; letter-spacing: .08em; filter: brightness(.8); }
.welt-kopf h2 { margin: 0; font-size: 1.7rem; }
.welt-kopf span { color: var(--leise); font-weight: 700; }
.welt-sterne { display: flex; align-items: center; gap: .3em; font-weight: 900; background: #fff; padding: .3em .8em; border-radius: 20px; box-shadow: var(--schatten); }
.welt-sterne img { width: 24px; }
.welt-karte { position: relative; aspect-ratio: 1600 / 640; min-height: 300px; background-size: cover; background-position: center; border-radius: 24px;
  box-shadow: var(--schatten); border: 4px solid #fff; overflow: hidden; }
.pfadlinie { position: absolute; inset: 0; width: 100%; height: 100%; }
.pfadlinie polyline { fill: none; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 2 2; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 6; opacity: .85; }
.knoten { position: absolute; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff;
  background: var(--wf); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); transition: transform .12s; font-family: var(--schrift); }
.knoten:hover { transform: translate(-50%, -50%) scale(1.12); z-index: 3; }
.knoten-nr { font-weight: 900; font-size: 1.5rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.knoten-nr img { width: 30px; }
.knoten.gesperrt { background: #cbd5e1; cursor: default; }
.knoten.gesperrt:hover { transform: translate(-50%, -50%); }
.knoten.geschafft { background: linear-gradient(#ffe680, #f5a300); }
.knoten.boss { width: 92px; height: 92px; background: radial-gradient(#fff7cc, #f59e0b); }
.knoten.boss.gesperrt { background: #cbd5e1; }
.knoten.boss.gesperrt .boss-bild { filter: grayscale(1) opacity(.7); }
.boss-bild { width: 78px; }
.knoten.aktuell { animation: pulsieren 1.6s infinite; }
/* Spielstationen im Pfad (seit 2026-11) */
.knoten.station { width: 74px; height: 74px; border-radius: 22px; background: radial-gradient(#fff, #c7d2fe); }
.knoten.station.geschafft { background: radial-gradient(#fff7cc, #f5a300); }
.knoten.station.gesperrt { background: #cbd5e1; }
.station-bild { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.knoten.station.gesperrt .station-bild { filter: grayscale(1) opacity(.6); }
.station-schloss { position: absolute; width: 28px; right: -6px; bottom: -6px; }
.station-ziele { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .3rem; }
.station-ziele li { display: flex; align-items: center; gap: .5em; font-weight: 700; }
.station-ziele .stern { width: 18px; }
.fokus-tasten { align-items: center; gap: .4em; }
.fokus-tasten kbd { border-bottom: 4px solid var(--f, #999); }
.knoten-avatar { position: absolute; bottom: 100%; width: 58px; margin-bottom: 4px; animation: huepfen 1s ease-in-out infinite; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }
.knoten-sterne { position: absolute; top: 100%; margin-top: 2px; display: flex; white-space: nowrap; }
.knoten-sterne .stern { width: 15px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.knoten-titel { position: absolute; top: calc(100% + 20px); white-space: nowrap; background: rgba(255, 255, 255, .92); padding: .15em .55em; border-radius: 8px;
  font-size: .78rem; font-weight: 800; color: var(--text); opacity: 0; pointer-events: none; transition: opacity .15s; }
.knoten:hover .knoten-titel, .knoten.aktuell .knoten-titel { opacity: 1; }
.welt-gesperrt .welt-karte > *:not(.welt-schloss) { filter: grayscale(.6); }
.welt-schloss { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; background: rgba(15, 23, 42, .45); color: #fff; font-size: 1.1rem; text-align: center; }
.welt-schloss img { width: 70px; }
.welt-tipp { display: flex; align-items: center; gap: .7em; background: #fff; border-radius: 14px; padding: .4em 1em .4em .4em; margin: .6rem 0 0; font-weight: 700; box-shadow: var(--schatten); }
.welt-tipp img { width: 44px; }
.fixi-karte { display: flex; gap: .6rem; align-items: center; background: linear-gradient(135deg, #ccfbf1, #fff); }
.fixi-karte img { width: 110px; margin: -10px -6px -10px -10px; }
.tagesziel { display: flex; align-items: center; gap: .5rem; }
.tagesziel span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #e2e8f0; font-weight: 900; color: var(--leise); }
.tagesziel span.voll { background: var(--gruen); color: #fff; }
.mini-truhe { width: 74px; margin-left: auto; cursor: pointer; filter: grayscale(.7) opacity(.7); }
.mini-truhe.bereit { filter: none; animation: wackeln-dauer 1.2s infinite; }
.mini-truhe.offen { filter: none; opacity: .5; }
.serie-karte { display: flex; gap: .8rem; align-items: center; }
.serie-karte img { width: 54px; }

/* ---------------------------------------------------------------- Lektion */
.lektion { max-width: 1100px; margin: 0 auto; }
.lektion-kopf { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.lektion-titel { flex: 1; }
.lektion-titel small { font-weight: 900; color: var(--leise); text-transform: uppercase; letter-spacing: .05em; }
.lektion-titel h2 { margin: 0; font-size: 1.7rem; }
.live { display: flex; gap: .6rem; }
.live span { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: 14px; padding: .3em .9em; box-shadow: var(--schatten); min-width: 96px; }
.live b { font-size: 1.6rem; line-height: 1.1; }
.live small { font-size: .7rem; color: var(--leise); font-weight: 700; }
.live b.knapp { color: var(--rot); animation: pulsieren-text .5s infinite alternate; }
.fortschritt { height: 12px; background: #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: .8rem; }
.fortschritt i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--wf), #22d3ee); border-radius: 10px; transition: width .2s; }
.boss-leiste { display: flex; align-items: center; gap: 1rem; background: linear-gradient(90deg, #fff7cc, #fff); border-radius: 16px; padding: .4rem 1rem; margin-bottom: .8rem; box-shadow: var(--schatten); }
.boss-leiste img { width: 70px; animation: wackeln-dauer 2s infinite; }
.boss-leiste > div { flex: 1; }
.schloss-balken { height: 16px; background: #fde68a; border-radius: 10px; overflow: hidden; margin-top: .3rem; border: 2px solid #f59e0b; }
.schloss-balken i { display: block; height: 100%; background: repeating-linear-gradient(45deg, #ef4444 0 12px, #dc2626 12px 24px); transition: width .2s; }
.tipp-bereich { position: relative; }
.tipptext { font-family: var(--mono); font-size: 2.2rem; line-height: 1.75; background: #fff; border-radius: 20px; padding: .5em .8em; box-shadow: var(--schatten);
  border: 3px solid #e2e8f0; height: calc(1.75em * 2 + 1em); overflow: hidden; letter-spacing: .02em; }
.tipptext.lang { font-size: 1.75rem; height: calc(1.75em * 3 + 1em); }
.tipptext.klein { font-size: 1.4rem; height: calc(1.75em * 2 + 1em); }
.tipptext .wort { display: inline-block; white-space: nowrap; }
.tipptext .z { position: relative; border-radius: 6px; color: #475569; transition: color .1s; }
.tipptext .z.leer { display: inline-block; width: .62em; }
.tipptext .z.richtig { color: #a3b1c2; }
.tipptext .z.korrigiert { color: #f59e0b; }
.tipptext .z.aktuell { background: #ccfbf1; color: var(--text); box-shadow: inset 0 -5px 0 var(--haupt); }
.tipptext .z.leer.aktuell { background: #ccfbf1; }
.tipptext .z.falsch { animation: falsch .35s; background: #fee2e2; box-shadow: inset 0 -5px 0 var(--rot); }
.tipptext .z.falsch::after { content: attr(data-falsch); position: absolute; left: 50%; top: -0.9em; transform: translateX(-50%); font-size: .5em; color: var(--rot);
  background: #fff; border-radius: 6px; padding: 0 .3em; border: 1px solid #fecaca; line-height: 1.4; animation: weg 1.2s forwards; }
.start-hinweis { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); background: var(--akzent); color: #fff; font-weight: 800; padding: .3em 1em; border-radius: 20px;
  animation: huepfen 1.2s infinite; white-space: nowrap; }
.finger-hinweis { text-align: center; font-size: 1.15rem; min-height: 1.8em; margin: 1rem 0 .2rem; }
.tastatur-bereich { display: flex; flex-direction: column; align-items: center; }
.haende { width: 440px; margin-top: -26px; pointer-events: none; position: relative; z-index: 1; opacity: .96; }

/* ---------------------------------------------------------------- Tastatur */
.tastatur { display: flex; flex-direction: column; gap: 5px; padding: 10px; background: #334155; border-radius: 18px; box-shadow: 0 8px 0 #1e293b; width: min(100%, 880px); }
.tasten-reihe { display: flex; gap: 5px; }
.taste { --f: #cbd5e1; flex: 1 1 0; min-width: 0; height: var(--taste); border-radius: 9px; position: relative; display: grid; place-items: center;
  background: color-mix(in srgb, var(--f) 38%, #fff); border-bottom: 4px solid color-mix(in srgb, var(--f) 70%, #334155);
  font-weight: 800; font-size: 1.05rem; color: #1e293b; transition: transform .08s, background .1s; }
.taste small { position: absolute; top: 2px; left: 6px; font-size: .68rem; opacity: .7; }
.taste.sonder { background: #e2e8f0; border-bottom-color: #94a3b8; font-size: .8rem; color: #475569; }
.taste.unbekannt { opacity: .45; }
.taste.rille span { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.taste.naechste { background: var(--f); transform: translateY(2px); box-shadow: 0 0 0 4px #fff, 0 0 18px 6px var(--f); z-index: 2; opacity: 1; animation: tasten-puls 1s infinite; }
.taste.umschalt { background: var(--f); box-shadow: 0 0 0 4px #fff, 0 0 14px 4px var(--f); opacity: 1; z-index: 2; }
.taste.daneben { animation: daneben .3s; }
#waerme .taste { background: #f1f5f9; border-bottom-color: #cbd5e1; }
#waerme .taste.waerme { background: color-mix(in srgb, #ef4444 calc(var(--w) * 100%), #f1f5f9); }

/* ---------------------------------------------------------------- Overlay & Dialoge */
#overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 1rem; animation: einblenden .2s; overflow: auto; }
#overlay[hidden] { display: none; }
.dialog { max-width: 720px; width: 100%; text-align: center; animation: aufpoppen .3s cubic-bezier(.2, 1.6, .5, 1); }
.einleitung-kopf, .ergebnis-kopf { display: flex; gap: 1rem; align-items: center; text-align: left; }
.einleitung-kopf img, .ergebnis-fixi { width: 170px; flex-shrink: 0; }
.einleitung-kopf small { font-weight: 900; color: var(--leise); text-transform: uppercase; }
.einleitung-kopf p { font-size: 1.1rem; }
.neue-tasten { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: .6rem 0; }
.neue-taste { display: flex; align-items: center; gap: .6em; background: color-mix(in srgb, var(--f) 18%, #fff); border: 2px solid var(--f); border-radius: 14px; padding: .4em .8em; }
.neue-taste kbd { font-size: 1.6rem; border-color: var(--f); }
.haende-gross { width: 420px; }
.boss-regel { background: #fff7cc; border-radius: 12px; padding: .5em; font-weight: 800; }
.ziel-zeile { color: var(--leise); }
.ergebnis-sterne { display: flex; gap: .3rem; }
.stern-gross { width: 54px; }
.stern-gross.plopp { animation: plopp .5s cubic-bezier(.2, 1.8, .5, 1) both; }
.ergebnis-werte { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.ergebnis-werte div { background: #f1f5f9; border-radius: 14px; padding: .6em; }
.ergebnis-werte b { display: block; font-size: 1.7rem; }
.ergebnis-werte small { color: var(--leise); font-weight: 700; }
.sterne-gruende { list-style: none; padding: 0; margin: 0 auto; text-align: left; display: inline-grid; gap: .15rem; color: var(--leise); }
.sterne-gruende li.ok { color: #15803d; font-weight: 800; }
.problem { margin: .6rem 0 0; }
.beute { display: flex; gap: 1rem; justify-content: center; margin-top: .8rem; }
.beute span { display: flex; align-items: center; gap: .3em; font-weight: 900; font-size: 1.3rem; background: #fef9c3; padding: .2em .8em; border-radius: 20px; }
.beute img { width: 30px; }
.blase { display: flex; gap: 1rem; align-items: center; text-align: left; max-width: 560px; }
.blase img { width: 160px; }
.blase p { font-size: 1.15rem; }
.schalter { display: flex; align-items: center; gap: .6em; font-weight: 700; margin: .5em 0; justify-content: center; }
.schalter input { width: 22px; height: 22px; }
.truhe-gross { width: 240px; cursor: pointer; }
.truhe-gross.wackelt { animation: wackeln-dauer .8s infinite; }
.truhe-gross.auf { animation: aufpoppen .5s; }

/* ---------------------------------------------------------------- Toasts, Level, Konfetti */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; }
.toast { display: flex; gap: .8rem; align-items: center; background: #fff; border-radius: 18px; padding: .6rem 1.2rem .6rem .6rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25); border: 3px solid var(--gelb); animation: reinrutschen .5s cubic-bezier(.2, 1.5, .5, 1), weg .5s 4s forwards; max-width: 380px; }
.toast img { width: 80px; }
.toast div { display: flex; flex-direction: column; }
.toast small { font-weight: 900; color: var(--akzent); }
.toast b { font-size: 1.2rem; }
.levelup { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 90; display: flex; flex-direction: column; align-items: center; background: linear-gradient(#7c3aed, #4c1d95);
  color: #fff; padding: 1.2rem 2.4rem; border-radius: 24px; box-shadow: 0 20px 60px rgba(76, 29, 149, .5); animation: aufpoppen .5s cubic-bezier(.2, 1.8, .5, 1), weg .6s 2.6s forwards; }
.levelup img { width: 80px; } .levelup b { font-size: 2.4rem; }
.konfetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 100; border-radius: 3px; pointer-events: none; animation: fallen linear forwards; }

/* ---------------------------------------------------------------- Seiten: Spiele, Abzeichen, Shop, Statistik */
.seite { max-width: 1200px; margin: 0 auto; }
.spiel-gitter, .shop-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.spiel-karte { text-align: center; display: flex; flex-direction: column; }
.spiel-karte p { flex: 1; }
.spiel-bild { width: 120px; height: 120px; object-fit: contain; margin: 0 auto; }
.spiel-karte.gesperrt { opacity: .7; } .spiel-karte.gesperrt .spiel-bild { filter: grayscale(1); }
.rekord { display: flex; align-items: center; justify-content: center; gap: .4em; font-weight: 700; }
.rekord img { width: 24px; }
.abzeichen-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.abz { background: #fff; border-radius: 18px; padding: 1rem; text-align: center; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--schatten); }
.abz img { width: 120px; margin: 0 auto; filter: grayscale(1) opacity(.35); }
.abz.hat img { filter: none; animation: aufpoppen .4s; }
.abz small { color: var(--leise); }
.abz i { font-size: .8rem; color: var(--haupt-dunkel); font-weight: 700; }
.outfit { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.outfit > img { width: 190px; }
.outfit.traegt { border-color: var(--haupt); background: #f0fdfa; }
.marke { background: var(--haupt); color: #fff; font-weight: 800; border-radius: 20px; padding: .3em 1em; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kennzahlen .karte { display: flex; flex-direction: column; }
.kennzahlen small { font-weight: 800; color: var(--leise); }
.kennzahlen b { font-size: 2.2rem; }
.kennzahlen span { color: var(--leise); }
.seite > .karte { margin-bottom: 1rem; }
.kurve { width: 100%; height: 220px; }
.legende { display: flex; gap: 1.5rem; font-weight: 700; }
#waerme { margin: 0 auto; }
.tabelle-wrap { overflow-x: auto; }
.tabelle { border-collapse: collapse; width: 100%; }
.tabelle th, .tabelle td { padding: .5em .7em; border-bottom: 1px solid var(--rand); text-align: left; white-space: nowrap; }
.tabelle th { font-size: .85rem; color: var(--leise); }
.mini-avatar { width: 32px; vertical-align: middle; margin-right: .4em; }

/* ---------------------------------------------------------------- Spielfelder */
.spiel-seite .lektion-kopf h2 { flex: 1; margin: 0; }
.spielfeld { position: relative; height: 72vh; min-height: 480px; border-radius: 24px; overflow: hidden; background-size: cover; background-position: center; box-shadow: var(--schatten); border: 4px solid #fff; }
.spiel-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: .8rem; justify-content: space-between; z-index: 5; pointer-events: none; }
.spiel-hud > span { background: rgba(255, 255, 255, .92); border-radius: 14px; padding: .3em .9em; font-weight: 900; font-size: 1.3rem; display: flex; align-items: center; gap: .2em; }
.herzen img { width: 30px; }
.ballon { position: absolute; top: 0; width: 110px; text-align: center; will-change: transform; }
.ballon img { width: 110px; }
.ballon b { position: absolute; left: 0; right: 0; top: 30px; font-size: 2.3rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 8px rgba(0, 0, 0, .3); font-family: var(--mono); }
.faller { position: absolute; top: 0; left: 0; width: 140px; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.faller img { width: 110px; }
.faller.ist-ufo img { width: 130px; }
.wortschild { background: #fff; border-radius: 10px; padding: .1em .5em; font: 800 1.35rem var(--mono); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); margin-top: -12px; }
.wortschild i { font-style: normal; color: var(--gruen); }
.faller.ziel .wortschild { outline: 3px solid var(--akzent); }
.partikel { position: absolute; width: 10px; height: 10px; border-radius: 50%; z-index: 6; animation: explodieren .7s ease-out forwards; }
.blitz-feld { position: absolute; inset: 0; display: grid; place-items: center; }
.blitz-wort { font: 900 4.5rem var(--mono); background: rgba(255, 255, 255, .93); padding: .2em .6em; border-radius: 26px; box-shadow: var(--schatten); }
.blitz-wort i { font-style: normal; color: var(--gruen); }
.blitz-wort u { text-decoration: none; background: #ccfbf1; border-radius: 8px; box-shadow: inset 0 -6px 0 var(--haupt); }
.blitz-feld.treffer .blitz-wort { animation: plopp .3s; }
.rennbahn { position: absolute; top: 70px; left: 20px; right: 20px; display: grid; gap: 10px; }
.bahn { position: relative; height: 80px; background: rgba(255, 255, 255, .75); border-radius: 40px; border: 3px dashed rgba(255, 255, 255, .9); }
.bahn-name { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 900; color: var(--leise); font-size: .85rem; }
.laeufer { position: absolute; top: 4px; left: 0; height: 68px; transition: left .25s linear; margin-left: 70px; }
.laeufer.geist { opacity: .45; filter: grayscale(.5) brightness(1.2); }
.ziel-flagge { position: absolute; right: 8px; top: 12px; height: 54px; }
.renn-text { position: absolute; left: 20px; right: 20px; bottom: 20px; }
.renn-hinweis { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: var(--akzent); color: #fff; font-weight: 800; padding: .4em 1em; border-radius: 20px; animation: huepfen 1.2s infinite; }

/* ---------------------------------------------------------------- Animationen */
@keyframes schweben { 50% { transform: translateY(-14px); } }
@keyframes huepfen { 50% { transform: translateY(-6px); } }
.start-hinweis { animation-name: huepfen-mitte; }
@keyframes huepfen-mitte { 50% { transform: translate(-50%, -5px); } }
@keyframes pulsieren { 0%, 100% { box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 0 0 0 rgba(255, 255, 255, .9); } 50% { box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 0 0 14px rgba(255, 255, 255, 0); } }
@keyframes pulsieren-text { to { transform: scale(1.15); } }
@keyframes tasten-puls { 50% { box-shadow: 0 0 0 4px #fff, 0 0 26px 10px var(--f); } }
@keyframes falsch { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes daneben { 50% { background: #fca5a5; transform: translateY(3px); } }
@keyframes weg { to { opacity: 0; } }
@keyframes einblenden { from { opacity: 0; } }
@keyframes aufpoppen { from { transform: scale(.6); opacity: 0; } }
@keyframes plopp { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1); } }
@keyframes reinrutschen { from { transform: translateX(120%); } }
@keyframes fallen { to { transform: translateY(105vh) rotate(var(--dreh)); } }
@keyframes explodieren { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@keyframes wackeln-dauer { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(3deg); } }
.wackeln { animation: falsch .3s; }

/* ---------------------------------------------------------------- Schmalere Bildschirme */
@media (max-width: 1100px) {
  .pfad-layout { grid-template-columns: 1fr; }
  .seitenleiste { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .start { grid-template-columns: 1fr; }
  :root { --taste: 44px; }
}
@media (max-width: 700px) {
  #kopf nav .tab { font-size: 0; padding: .4em; }
  .tipptext { font-size: 1.5rem; } .tipptext.lang { font-size: 1.25rem; }
  .ergebnis-werte { grid-template-columns: repeat(2, 1fr); }
  .einleitung-kopf, .ergebnis-kopf, .blase { flex-direction: column; text-align: center; }
  .haende, .haende-gross { width: 100%; }
  :root { --taste: 34px; }
  .taste { font-size: .8rem; }
}

/* ---------------------------------------------------------------- Lernportal-Modus */
button.tab { border: 0; background: none; font: inherit; font-weight: 800; color: var(--text); cursor: pointer; }
.tab-duell { background: linear-gradient(135deg, #fde68a, #fdba74) !important; }
.tab-duell:disabled { opacity: .6; cursor: wait; }
.lade-hinweis { text-align: center; color: var(--leise); font-weight: 800; margin-top: 30vh; }
.hinweis-toast { border-color: var(--rot); padding: .8rem 1.2rem; }

/* Im Lernportal (seit 1.6.0): Avatar = eigener Held aus Mathe-Survivor (gezeichnet von assets/js/held.js) */
.th-held { display: inline-block; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; vertical-align: middle; background: #e8eef4; }
.th-held canvas { display: block; width: 100%; height: 100%; }
.profil-wahl .th-held { width: 84px; height: 84px; }
.th-held.knoten-avatar { display: block; width: 58px; height: 58px; border: 3px solid #fff; }
.th-held.mini-avatar { width: 32px; height: 32px; margin-right: .4em; }
.th-held-gross { width: 150px; height: 150px; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.held-karte { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.held-karte h2 { margin: 0 0 .4rem; }
/* Schwierigkeitsstufen der Spiele */
.stufenwahl { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 .2rem; }
.stufe { border: 2px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: .35rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.stufe:hover { border-color: #94a3b8; }
.stufe.aktiv { border-color: transparent; color: #111; }
.stufe--leicht.aktiv { background: #86efac; } .stufe--normal.aktiv { background: #93c5fd; }
.stufe--schwer.aktiv { background: #fdba74; } .stufe--profi.aktiv { background: #f87171; }
.stufe.klein { font-size: .75rem; padding: .1rem .55rem; vertical-align: middle; cursor: default; }
.stufen-info { margin: .2rem 0 .8rem; font-size: .9rem; }
.kopf-sterne .stern { width: 26px; }

/* Eigener Held in den Minispielen (schießt auf die Ziele) */
.spiel-held { position: absolute; left: 50%; bottom: 4px; height: 150px; width: auto; transform: translateX(-50%); z-index: 2; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.spiel-held--links { left: 70px; transform: none; }
.spiel-held.schiesst { animation: held-schuss .22s ease-out; }
.spiel-held--links.schiesst { animation: held-schuss-links .22s ease-out; }
@keyframes held-schuss { 0% { transform: translateX(-50%) scale(1); } 35% { transform: translateX(-50%) translateY(5px) scale(1.04, .95); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes held-schuss-links { 0% { transform: none; } 35% { transform: translateY(5px) scale(1.04, .95); } 100% { transform: none; } }
.geschoss { position: absolute; z-index: 5; pointer-events: none; will-change: transform; }
.geschoss--pfeil { width: 46px; height: 4px; background: linear-gradient(90deg, #9a6b3f 0 70%, #cbd5e1 70%); border-radius: 2px; box-shadow: 0 0 4px rgba(0, 0, 0, .35); }
.geschoss--pfeil::after { content: ''; position: absolute; right: -6px; top: -4px; border: 6px solid transparent; border-left: 9px solid #94a3b8; border-right: 0; }
.geschoss--pfeil::before { content: ''; position: absolute; left: -2px; top: -4px; width: 10px; height: 12px; background: #ef4444; clip-path: polygon(0 0, 100% 50%, 0 100%, 30% 50%); }
.geschoss--kugel { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #c084fc 45%, #7c3aed); box-shadow: 0 0 14px 6px rgba(168, 85, 247, .65); }
.geschoss--axt { width: 26px; height: 26px; background: conic-gradient(from 200deg, #cbd5e1 0 30%, #8b5a2b 30% 100%); border-radius: 50% 10% 50% 10%; box-shadow: 0 0 4px rgba(0, 0, 0, .4); }
.geschoss--stern { width: 22px; height: 22px; background: #facc15; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 0 6px #fde047); }
.ballon.getroffen, .faller.getroffen { opacity: .85; }
.laeufer-held { height: 76px; top: -2px; }
.laeufer.rennt { animation: renn-hupf .3s ease-in-out infinite; }
@keyframes renn-hupf { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* Link zum Schwesterspiel Mathe-Survivor (nur im Lernportal) */
.tab-mathe { background: linear-gradient(135deg, #ddd6fe, #a5b4fc); }
.tab-emoji { font-size: 22px; line-height: 1; width: 26px; text-align: center; }
