/* styles.css – mobile first, helles und dunkles Design, Tap-Ziele ab 48px. */

:root {
  color-scheme: light dark;

  --grund: #f5efe5;
  --flaeche: #fffdf9;
  --flaeche-2: #f1e9dd;
  --rand: #dfd2c1;
  --text: #292333;
  --text-leise: #6e6474;

  --primaer: #5b3fc0;
  --primaer-hell: #765ddd;
  --primaer-text: #ffffff;
  --primaer-weich: #eee8ff;

  --gold: #c98518;
  --gold-hell: #e6ad3e;
  --gold-weich: #fff0cf;
  --wein: #8e3157;
  --wein-weich: #f8e4ec;

  --richtig: #1f8a54;
  --richtig-weich: #dff5e8;
  --falsch: #c62f4a;
  --falsch-weich: #fce3e8;
  --fast: #a86a09;
  --fast-weich: #fdf0d8;
  --warnung: #b3261e;

  --fell: #c77c3e;
  --fell-dunkel: #70401f;
  --bauch: #f3d3a6;
  --auge: #efc23c;
  --auge-rand: #4b2b17;

  --radius: 20px;
  --radius-klein: 13px;
  --schatten: 0 2px 3px rgb(55 38 25 / 5%), 0 12px 30px rgb(55 38 25 / 8%);
  --schatten-stark: 0 5px 10px rgb(55 38 25 / 10%), 0 22px 48px rgb(55 38 25 / 16%);
  --tap: 48px;
  --kopf-hoehe: 56px;
  --tab-hoehe: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #17121d;
    --flaeche: #211b29;
    --flaeche-2: #2b2334;
    --rand: #42364a;
    --text: #f5eee6;
    --text-leise: #b8aebe;

    --primaer: #a692ff;
    --primaer-hell: #c0b2ff;
    --primaer-text: #181020;
    --primaer-weich: #32284b;

    --gold: #efbd5c;
    --gold-hell: #ffd47b;
    --gold-weich: #3b2c18;
    --wein: #ef8cad;
    --wein-weich: #3b2230;

    --richtig: #52d19a;
    --richtig-weich: #17342a;
    --falsch: #ff8098;
    --falsch-weich: #3a1e26;
    --fast: #f2c264;
    --fast-weich: #372c17;
    --warnung: #ff8a80;

    --schatten: 0 2px 4px rgb(0 0 0 / 24%), 0 14px 34px rgb(0 0 0 / 28%);
    --schatten-stark: 0 6px 14px rgb(0 0 0 / 30%), 0 24px 54px rgb(0 0 0 / 38%);

    --fell: #c27b42;
    --fell-dunkel: #6c3d20;
    --bauch: #e8c99f;
    --auge: #ffd45e;
    --auge-rand: #3e2414;
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  padding-bottom: calc(var(--tab-hoehe) + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
}

.visuell-versteckt {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

.ist-latein { font-family: Georgia, 'Times New Roman', serif; }

/* --- Kopfzeile --- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--kopf-hoehe);
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}

.kopf-titel {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: .01em;
}

.kopf-zurueck {
  min-width: var(--tap);
  min-height: var(--tap);
  margin-left: -6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}
.kopf-zurueck:hover { background: var(--flaeche-2); }

.kopf-status { display: flex; gap: 6px; }

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--text-leise);
  font-size: .82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip-knopf {
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  cursor: pointer;
}

/* --- Grundlayout --- */

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }

.screen { animation: einblenden .18s ease-out; }

@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.abschnitt-titel { margin: 4px 0 4px; font-size: 1.3rem; }
.abschnitt-hinweis { margin: 0 0 16px; color: var(--text-leise); font-size: .92rem; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 18px;
  margin-bottom: 16px;
}

.karte-titel { margin: 0 0 6px; font-size: 1.05rem; }
.karte-hinweis { margin: 0 0 12px; color: var(--text-leise); font-size: .9rem; }

.karte-hero { text-align: center; }
.hero-zeile { margin: 0 0 14px; font-size: .95rem; color: var(--text-leise); }
.hero-lektion { margin: 0; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--text-leise); }
.hero-titel { margin: 2px 0 12px; font-size: 1.5rem; font-weight: 700; }
.hero-hinweis { margin: 8px 0 18px; font-size: .88rem; color: var(--text-leise); }

.fussnote { margin: 24px 0 8px; text-align: center; color: var(--text-leise); font-size: .8rem; }

.code {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-klein);
  background: var(--flaeche-2);
  font-size: .88rem;
  overflow-x: auto;
}

code { background: var(--flaeche-2); border-radius: 5px; padding: 1px 5px; font-size: .88em; }

/* --- Knoepfe --- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform .08s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.knopf + .knopf { margin-top: 10px; }
.knopf:active:not(:disabled) { transform: scale(.98); }
.knopf:disabled { opacity: .5; cursor: default; }

.knopf-primaer { background: var(--primaer); color: var(--primaer-text); }
.knopf-primaer:hover:not(:disabled) { background: var(--primaer-hell); }
.knopf-gross { font-size: 1.05rem; min-height: 54px; }
.knopf-flach { background: transparent; color: var(--primaer); }
.knopf-flach:hover { background: var(--primaer-weich); }
.knopf-warnung { background: transparent; color: var(--warnung); border-color: var(--warnung); }
.knopf-klein { width: auto; min-height: var(--tap); padding: 6px 14px; font-size: .9rem; }
.dateiknopf { cursor: pointer; }

:focus-visible { outline: 3px solid var(--primaer); outline-offset: 2px; }

/* --- Kacheln und Statistik --- */

.kachelreihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }

.kachel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 6px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
}
.kachel-zahl { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel-text { font-size: .74rem; color: var(--text-leise); text-align: center; }

.faecher { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; }
.fach { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fach-zahl { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fach-raum { display: flex; align-items: flex-end; width: 100%; height: 64px; background: var(--flaeche-2); border-radius: 8px; overflow: hidden; }
.fach-balken { width: 100%; background: linear-gradient(180deg, var(--primaer-hell), var(--primaer)); border-radius: 8px; }
.fach-text { font-size: .66rem; color: var(--text-leise); }

.dl { margin: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rand); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--text-leise); font-size: .92rem; }
.dl dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }

/* --- Fortschrittsbalken --- */

.fortschrittsbalken {
  display: block;
  width: 100%;
  height: 10px;
  background: var(--flaeche-2);
  border-radius: 999px;
  overflow: hidden;
}
.fortschrittsbalken-schmal { height: 6px; margin-top: 8px; }
.fortschrittsbalken-fuellung {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primaer), var(--primaer-hell));
  border-radius: 999px;
  transition: width .3s ease;
}

/* --- Listen --- */

.liste { display: flex; flex-direction: column; gap: 10px; }

.listeneintrag {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  text-align: left;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.listeneintrag:hover { border-color: var(--primaer); }
.listeneintrag-aktiv { border-color: var(--primaer); background: var(--primaer-weich); }
.listeneintrag-titel { font-weight: 650; }
.listeneintrag-text { color: var(--text-leise); font-size: .85rem; }

/* --- Aufgaben --- */

.session-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.session-zaehler { margin: 0; color: var(--text-leise); font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.aufgabe-anweisung { margin: 0 0 12px; color: var(--text-leise); font-size: .92rem; }
.aufgabe-status {
  width: fit-content;
  margin: -4px 0 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primaer-weich);
  color: var(--primaer);
  font-size: .82rem;
  font-weight: 650;
}
.aufgabe-bereich { margin-bottom: 16px; }

.frage {
  padding: 26px 18px;
  margin-bottom: 18px;
  text-align: center;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.frage-wort { margin: 0; font-size: 2rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.frage-zusatz { margin: 6px 0 0; color: var(--text-leise); font-size: .9rem; }
.frage-merkmal { margin: 12px 0 0; font-size: 1.05rem; font-weight: 650; color: var(--primaer); }

.optionen { display: grid; gap: 10px; }

.option {
  width: 100%;
  min-height: var(--tap);
  padding: 13px 16px;
  text-align: left;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background-color .15s ease;
}
.option:active:not(:disabled) { transform: scale(.99); }
.option-gewaehlt { border-color: var(--primaer); background: var(--primaer-weich); }
.option-richtig { border-color: var(--richtig); background: var(--richtig-weich); color: var(--text); }
.option-falsch { border-color: var(--falsch); background: var(--falsch-weich); color: var(--text); }
.option:disabled { cursor: default; opacity: 1; }

.eingabe {
  width: 100%;
  min-height: var(--tap);
  padding: 13px 16px;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
}
.eingabe:focus { border-color: var(--primaer); outline: none; }
.eingabe-richtig { border-color: var(--richtig); background: var(--richtig-weich); }
.eingabe-falsch { border-color: var(--falsch); background: var(--falsch-weich); }
.eingabe:disabled { opacity: 1; -webkit-text-fill-color: var(--text); }

.rueckmeldung {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-klein);
  font-weight: 650;
}
.ist-richtig { background: var(--richtig-weich); color: var(--richtig); }
.ist-fast { background: var(--fast-weich); color: var(--fast); }
.ist-falsch { background: var(--falsch-weich); color: var(--falsch); }
.ist-teilweise { background: var(--fast-weich); color: var(--fast); }

.session-fuss { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }

/* --- Maki, der Koboldmaki --- */

.maki-platz { display: flex; justify-content: center; }
.maki { flex: none; line-height: 0; }
.maki-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 4px 4px rgb(56 30 14 / 16%));
}

.maki-schatten { fill: rgb(31 17 9 / 20%); }
.maki-schwanz-rand { fill: none; stroke: var(--fell-dunkel); stroke-width: 11; stroke-linecap: round; }
.maki-schwanz { fill: none; stroke: var(--fell); stroke-width: 7; stroke-linecap: round; }
.maki-schwanz-licht { fill: none; stroke: rgb(255 236 199 / 28%); stroke-width: 2; stroke-linecap: round; }
.maki-koerper-rand, .maki-gesicht-rand, .maki-ohr-rand { fill: var(--fell-dunkel); }
.maki-koerper, .maki-kopf .maki-gesicht, .maki-ohr, .maki-glied, .maki-hand, .maki-fuss { fill: var(--fell); }
.maki-koerper-schatten, .maki-gesicht-schatten { fill: var(--fell-dunkel); opacity: .24; }
.maki-bauch, .maki-schnauze { fill: var(--bauch); }
.maki-bauch-licht { fill: #fff8e8; opacity: .36; }
.maki-ohr-innen { fill: #d89b79; }
.maki-schopf { fill: none; stroke: var(--fell-dunkel); stroke-width: 4; stroke-linecap: round; }
.maki-augenmaske { fill: var(--fell-dunkel); opacity: .9; }
.maki-augapfel { fill: #fffdf6; stroke: #f1e2c8; stroke-width: 1; }
.maki-iris-rand { fill: #8a5e19; }
.maki-iris { fill: var(--auge); }
.maki-pupille { fill: var(--auge-rand); }
.maki-glanz, .maki-glanz-klein { fill: #fff; }
.maki-nase { fill: var(--auge-rand); }
.maki-nasenstrich, .maki-zehen { fill: none; stroke: var(--auge-rand); stroke-width: 1.6; stroke-linecap: round; opacity: .72; }
.maki-mund { fill: none; stroke: var(--auge-rand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.maki-mund-froh { fill: var(--auge-rand); }
.maki-wange { display: none; fill: #dd725f; opacity: .45; }
.maki-freut .maki-wange, .maki-feiert .maki-wange { display: inline; }

.maki-halstuch { fill: #5b3fc0; }
.maki-halstuch-zipfel { fill: #442a9a; }
.maki-medaillon { fill: var(--gold-hell); stroke: #9b6213; stroke-width: 1.2; }
.maki-medaillon-zeichen { fill: none; stroke: #69400c; stroke-width: 1.4; stroke-linecap: round; }

.maki-funken { display: none; fill: var(--gold-hell); }
.maki-feiert .maki-funken { display: inline; animation: funkeln 1.1s ease-in-out infinite; transform-origin: center; }

@keyframes funkeln {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Nur ein Mund ist sichtbar, je nach Stimmung. */
.maki-mund-froh, .maki-mund-traurig { display: none; }
.maki-freut .maki-mund-neutral,
.maki-feiert .maki-mund-neutral,
.maki-traurig .maki-mund-neutral { display: none; }
.maki-freut .maki-mund-froh, .maki-feiert .maki-mund-froh { display: inline; }
.maki-traurig .maki-mund-traurig { display: inline; }

/* Blinzeln: das Auge wird kurz flach gedrückt. transform-box sorgt dafür,
   dass sich der Ursprung auf das Auge bezieht und nicht auf die ganze SVG. */
.maki-auge { transform-box: fill-box; transform-origin: center; animation: blinzeln 5.5s infinite; }
.maki-svg .maki-auge:nth-of-type(2) { animation-delay: .12s; }

@keyframes blinzeln {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 96% { transform: scaleY(.08); }
}

/* Der Kopf wippt leicht - das reicht, damit die Figur lebendig wirkt. */
.maki-kopf { transform-box: fill-box; transform-origin: 50% 90%; animation: wippen 4s ease-in-out infinite; }

@keyframes wippen {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

.maki-huepft { animation: huepfen .5s ease-out; }

@keyframes huepfen {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-14px) scale(1.04); }
  60% { transform: translateY(0) scale(.97); }
  100% { transform: translateY(0) scale(1); }
}

.maki-traurig .maki-kopf { animation: none; transform: translateY(3px) rotate(-4deg); }
.maki-traurig .maki-schwanz { stroke-dasharray: none; opacity: .7; }

.maki-arm { transform-box: fill-box; transform-origin: 50% 20%; transition: transform .25s ease; }
.maki-feiert .maki-arm-links { transform: rotate(-42deg); }
.maki-feiert .maki-arm-rechts { transform: rotate(42deg); }
.maki-feiert .maki-kopf { animation: wippen 1.1s ease-in-out infinite; }

.hero-maki { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; text-align: left; }
.hero-maki .maki-platz { flex: none; }

.sprechblase {
  position: relative;
  flex: 1;
  margin: 0;
  padding: 12px 14px;
  background: var(--flaeche-2);
  border-radius: 14px;
  font-size: .95rem;
}
.sprechblase::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--flaeche-2);
}

.rueckmeldung-reihe { display: flex; align-items: center; gap: 10px; }
.rueckmeldung-reihe .rueckmeldung { flex: 1; margin-bottom: 0; }
.rueckmeldung-reihe:has(.rueckmeldung[hidden]) { display: none; }
.maki-klein { flex: none; }
.maki-ergebnis { margin-bottom: 4px; }

/* --- Tagesziel und Rang --- */

.karte-ziel { display: flex; align-items: center; gap: 16px; }

.ziel-ring { position: relative; flex: none; width: 72px; height: 72px; }
.ziel-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ziel-ring-bahn { stroke: var(--flaeche-2); stroke-width: 8; }
.ziel-ring-fuellung {
  stroke: var(--primaer);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s ease;
}
.ziel-ring.ist-erreicht .ziel-ring-fuellung { stroke: var(--richtig); }
.ziel-ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ziel-ring.ist-erreicht .ziel-ring-text { color: var(--richtig); }

.ziel-text { flex: 1; min-width: 0; }
.ziel-titel { margin: 0; font-weight: 700; }
.ziel-zeile { margin: 2px 0 10px; color: var(--text-leise); font-size: .85rem; }

.rang { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.rang-name {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primaer-weich);
  color: var(--primaer);
  font-size: .78rem;
  font-weight: 700;
}
.rang-hinweis { grid-column: 1 / -1; color: var(--text-leise); font-size: .76rem; }

.ziel-wahl { display: flex; gap: 8px; }
.ziel-knopf {
  flex: 1;
  min-height: var(--tap);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  background: var(--flaeche);
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.ziel-knopf.ist-gewaehlt { border-color: var(--primaer); background: var(--primaer-weich); color: var(--primaer); }

.stimme-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stimme-knopf {
  min-height: var(--tap);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  background: var(--flaeche);
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.stimme-knopf.ist-gewaehlt { border-color: var(--primaer); background: var(--primaer-weich); color: var(--primaer); }

/* --- Hörprobe der Aussprache --- */

.stimme-abschnitt { margin-top: 16px; font-weight: 650; color: var(--text); }
.stimme-probe { display: flex; flex-wrap: wrap; gap: 8px; }

.probe-knopf {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 14px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 999px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.probe-knopf:hover { border-color: var(--primaer); }
.probe-wort { font-weight: 650; }
.probe-umschrift { color: var(--text-leise); font-size: .82rem; font-variant-numeric: tabular-nums; }
.probe-umschrift::before { content: '→ '; }
.probe-pfeil { font-size: .9rem; }

/* --- Abzeichen --- */

.abzeichen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }

.abzeichen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  background: var(--flaeche);
}
.abzeichen.ist-offen { opacity: .5; }
.abzeichen.ist-erreicht { border-color: var(--primaer); background: var(--primaer-weich); }
.abzeichen-symbol { font-size: 1.7rem; line-height: 1.1; }
.abzeichen-titel { font-size: .8rem; font-weight: 700; }
.abzeichen-text { font-size: .68rem; color: var(--text-leise); }

.abzeichen-marke {
  margin-top: 2px;
  font-size: .64rem;
  font-weight: 650;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
}
.abzeichen.ist-erreicht .abzeichen-marke { color: var(--primaer); }
.abzeichen .fortschrittsbalken-schmal { width: 100%; margin-top: 6px; }
.abzeichen.ist-offen .abzeichen-symbol { filter: grayscale(1); opacity: .65; }

/* --- Abzeichen auf dem Startbildschirm --- */

.karte-abzeichen, .karte-rang {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.karte-abzeichen:hover, .karte-rang:hover { border-color: var(--primaer); }
.abzeichen-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.abzeichen-kopf .karte-titel { margin: 0; }
.abzeichen-zaehler {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primaer-weich);
  color: var(--primaer);
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Frisch geschafft: bleibt stehen, bis man den Weg angeschaut hat. */
.frisch {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primaer-weich), var(--flaeche-2));
  border: 1px solid var(--primaer);
  border-radius: var(--radius-klein);
  animation: frisch-auf .5s ease-out;
}
.frisch-marke {
  margin: 0 0 8px;
  color: var(--primaer);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.frisch-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.frisch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  background: var(--flaeche);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 650;
}
.frisch-symbol { font-size: 1.15rem; line-height: 1; animation: frisch-wackeln 2.4s ease-in-out infinite; }
.frisch-rest { align-self: center; color: var(--text-leise); font-size: .78rem; }

@keyframes frisch-auf {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: none; }
}
@keyframes frisch-wackeln {
  0%, 82%, 100% { transform: rotate(0) scale(1); }
  88% { transform: rotate(-12deg) scale(1.15); }
  94% { transform: rotate(12deg) scale(1.15); }
}

/* Fast geschafft: konkrete nächste Schritte statt einer Zahl. */
.abzeichen-naechstes {
  margin: 16px 0 8px;
  color: var(--text-leise);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.fast-liste { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.fast-eintrag { display: flex; align-items: flex-start; gap: 10px; }
.fast-symbol { flex: none; font-size: 1.3rem; line-height: 1.2; }
.fast-text { flex: 1; min-width: 0; }
.fast-satz { display: block; font-size: .88rem; line-height: 1.35; }
.fast-satz strong { font-weight: 700; }
.fast-titel { color: var(--primaer); }
.fast-eintrag .fortschrittsbalken-schmal { margin-top: 6px; }
.abzeichen-mehr { color: var(--primaer); font-size: .85rem; font-weight: 650; }

/* --- Rangkarte und Rangliste --- */

.karte-rang { display: flex; align-items: center; gap: 14px; }
.held-platz { flex: none; display: flex; justify-content: center; }
.rang-text { flex: 1; min-width: 0; }
.rang-lage { margin: 0; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--text-leise); }
.rang-name-gross { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; }
.rang-erklaerung { margin: 0 0 10px; color: var(--text-leise); font-size: .85rem; }
.rang-hinweis { margin: 6px 0 0; color: var(--text-leise); font-size: .78rem; }

.rang-eintrag {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}
/* Kommende Raenge bleiben gut erkennbar - man soll ja sehen, was noch kommt. */
.rang-eintrag.ist-offen { opacity: .72; }
.rang-eintrag.ist-eigener { border-color: var(--primaer); background: var(--primaer-weich); opacity: 1; }
.rang-eintrag-text { flex: 1; min-width: 0; }
.rang-eintrag-kopf { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rang-eintrag-name { margin: 0; font-size: 1.1rem; }
.rang-marke {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primaer);
  color: var(--primaer-text);
  font-size: .68rem;
  font-weight: 700;
}
.rang-eintrag-erklaerung { margin: 2px 0 0; color: var(--text-leise); font-size: .8rem; }
.rang-eintrag-beschreibung { margin: 6px 0 0; font-size: .88rem; }
.rang-eintrag-fehlt { margin: 6px 0 0; font-size: .78rem; font-weight: 650; color: var(--primaer); }

/* --- Der Avatar, der dich selbst zeigt --- */

.held {
  flex: none;
  line-height: 0;
  filter: drop-shadow(0 4px 4px rgb(44 25 20 / 16%));
}
.held-svg { width: 100%; height: auto; overflow: visible; }
.held-schatten { fill: rgb(33 19 14 / 20%); }
.held-kopf, .held-hals, .held-ohr, .held-bein, .held-hand, .held-fuss { fill: var(--haut, #e8b98f); }
.held-gesicht-schatten { fill: #673d2d; opacity: .13; }
.held-gesicht-licht { fill: #fff; opacity: .14; }
.held-haar { fill: var(--haar, #4a3524); }
.held-haar-glanz { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; opacity: .13; }
.held-augapfel { fill: #fffdf8; }
.held-auge { fill: #302219; }
.held-augenlicht { fill: #fff; }
.held-braue, .held-nase, .held-mund {
  fill: none;
  stroke: #33231b;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.held-wange { fill: #cf695f; opacity: .2; }
.held-sommersprossen circle { fill: rgb(135 70 42 / 62%); }
.held-mund { stroke-width: 1.7; }
.held-bart { fill: var(--haar, #4a3524); stroke: var(--haar, #4a3524); stroke-width: 1.5; stroke-linecap: round; }
.bart-schnurr { fill: none; }
.held-brille g { fill: rgb(255 255 255 / 8%); stroke: #302d39; stroke-width: 1.8; }

.held-tunika, .held-arm { fill: var(--tunika, #b98555); }
.held-tunika-schatten { fill: #29172e; opacity: .18; }
.held-tunika-licht { fill: #fff; opacity: .12; }
.held-tunika-falten, .held-tunika-saum {
  fill: none;
  stroke: #3d2839;
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: .22;
}
.held-toga { fill: var(--toga, #eadfc9); }
.held-toga-schatten { fill: #584657; opacity: .13; }
.held-toga-falten {
  fill: none;
  stroke: #584657;
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: .26;
}
.held-clavus { fill: var(--clavus, #7b2d4e); }
.held-umhang { fill: var(--umhang, #a83232); }
.held-umhang-schatten { fill: #351423; opacity: .24; }
.held-umhang-falte { fill: none; stroke: #3e1721; stroke-width: 1.4; stroke-linecap: round; opacity: .35; }
.held-guertel { fill: none; stroke: var(--leder, #714526); stroke-width: 4; stroke-linecap: round; }
.held-fibel { fill: var(--akzent, #d6a13c); stroke: rgb(75 45 17 / 45%); stroke-width: 1; }
.held-sandale { fill: none; stroke: var(--leder, #714526); stroke-width: 2; stroke-linecap: round; }
.held-kranz-bogen { fill: none; stroke: var(--kranz, #4a7c3f); stroke-width: 2.4; stroke-linecap: round; }
.held-kranz ellipse { fill: var(--kranz, #4a7c3f); stroke: rgb(31 70 28 / 45%); stroke-width: .6; }
.held-tafel > rect:first-child { fill: #72472e; stroke: #4a2d1c; stroke-width: 1; }
.held-tafel .held-tafel-innen { fill: #dcbf81; }
.held-tafel-schrift { fill: none; stroke: #8e673d; stroke-width: 1; stroke-linecap: round; }
.held-rolle-blatt { fill: #f2dfae; stroke: #b99255; stroke-width: 1; }
.held-rolle-ende { fill: #c69d5e; }
.held-rolle-schrift { fill: none; stroke: #9d7544; stroke-width: 1; stroke-linecap: round; }
.held-beutel-riemen { fill: none; stroke: #694326; stroke-width: 2; }
.held-beutel-koerper { fill: #986136; stroke: #613b21; stroke-width: 1; }
.held-beutel-band { fill: none; stroke: #633b21; stroke-width: 2; }
.held-beutel-knopf { fill: var(--akzent, #d6a13c); }
.held-stab rect { fill: #8b5e3c; }
.held-stab-kopf { fill: var(--akzent, #d6a13c); stroke: #704718; stroke-width: 1; }
.held-rute path { fill: none; stroke: #9b6737; stroke-width: 2.2; stroke-linecap: round; }
.held-rute .held-rute-band { stroke: #6e2b38; stroke-width: 3; }
.held-saum { fill: none; stroke: var(--saum, #7b2d4e); stroke-width: 3.5; stroke-linecap: round; }
.held-fasces-ruten { fill: none; stroke: #ad7840; stroke-width: 3; stroke-linecap: round; }
.held-fasces-band { fill: none; stroke: #6d3d24; stroke-width: 3; }
.held-fasces-beil { fill: var(--metall, #aeb7bf); stroke: #59636b; stroke-width: 1; }
.held-zepter rect, .held-zepter-kopf { fill: var(--gold, #d9a441); stroke: #8f651e; stroke-width: 1; }
.held-zepter-glanz { fill: none; stroke: #fff1b8; stroke-width: 1.2; stroke-linecap: round; }
.held-blitz-schein { fill: none; stroke: #f6d148; stroke-width: 5; opacity: .3; stroke-linejoin: round; }
.held-blitz path:not(.held-blitz-schein) { fill: #f8d848; stroke: #a97816; stroke-width: 1.3; stroke-linejoin: round; }
.held-helm-kalotte, .held-helm-wange { fill: var(--metall, #aeb7bf); stroke: #59636b; stroke-width: 1; }
.held-helm-licht { fill: #fff; opacity: .3; }
.held-helm-rand { fill: none; stroke: var(--akzent, #d6a13c); stroke-width: 2.5; }
.held-crista { fill: var(--crista, #a83232); stroke: #682027; stroke-width: 1; }
.held-heiligenschein-aussen { fill: none; stroke: var(--gold, #d9a441); stroke-width: 3; }
.held-heiligenschein-innen { fill: none; stroke: #fff0a7; stroke-width: 1.3; opacity: .8; }

/* Sichtbar ist nur, was der Rang hergibt. Welche Teile das sind, steht als
   Daten in js/held.js - hier wird nur noch gezeichnet. */
.held-toga, .held-saum, .held-clavus, .held-kranz, .held-tafel, .held-rolle,
.held-rute, .held-stab, .held-fasces, .held-beutel, .held-zepter, .held-blitz,
.held-umhang, .held-helm, .held-crista, .held-heiligenschein { display: none; }

.zeigt-toga .held-toga { display: inline; }
.zeigt-saum .held-saum { display: inline; }
.zeigt-clavus .held-clavus { display: inline; }
.zeigt-kranz .held-kranz { display: inline; }
.zeigt-tafel .held-tafel { display: inline; }
.zeigt-rolle .held-rolle { display: inline; }
.zeigt-rute .held-rute { display: inline; }
.zeigt-stab .held-stab { display: inline; }
.zeigt-fasces .held-fasces { display: inline; }
.zeigt-beutel .held-beutel { display: inline; }
.zeigt-zepter .held-zepter { display: inline; }
.zeigt-blitz .held-blitz { display: inline; }
.zeigt-umhang .held-umhang { display: inline; }
.zeigt-helm .held-helm { display: inline; }
.zeigt-crista .held-crista { display: inline; }
.zeigt-heiligenschein .held-heiligenschein { display: inline; }

/* --- Farben nach Rang --- */

.held-tiro { --tunika: #bd7d49; --akzent: #e8bd66; }
.held-discipulus { --tunika: #668f79; --akzent: #e6c46e; }
.held-civis { --tunika: #527b98; --toga: #eadfc8; --akzent: #d18a45; }
.held-scriba { --tunika: #a26543; --toga: #eee2ca; --akzent: #dba648; }
.held-miles { --tunika: #80505a; --umhang: #bd3540; --akzent: #e2ad44; }
.held-centurio { --tunika: #704550; --umhang: #9e2632; --metall: #c7a046; --crista: #cc3f43; --akzent: #e5bd5c; }
.held-magister { --tunika: #426f8d; --toga: #f0e6d3; --akzent: #cf9143; }
.held-quaestor { --tunika: #3e8078; --toga: #eee4d1; --akzent: #d2a044; }
.held-aedilis { --tunika: #a85f47; --toga: #f1e7d5; --akzent: #d6a13c; }
.held-praetor { --tunika: #77405d; --toga: #f2e9da; --clavus: #9d365f; --saum: #9d365f; --akzent: #d3a84e; }
.held-senator { --tunika: #633c68; --toga: #f5ecdc; --clavus: #7b2d4e; --akzent: #dab35b; }
.held-consul { --tunika: #345d72; --toga: #f7efe0; --clavus: #7b2d4e; --kranz: #4d843e; --akzent: #e2bd5f; }
.held-censor { --tunika: #59606e; --toga: #eee5d5; --clavus: #672744; --kranz: #71833d; --akzent: #c89f52; }
/* Die Buergerliste des Censors ist eine andere Tafel als die des Schuelers. */
.held-censor .held-tafel > rect:first-child { fill: #526474; }
.held-censor .held-tafel .held-tafel-innen { fill: #dce7ef; }
.held-imperator { --tunika: #722743; --toga: #9d3b65; --clavus: #dfa943; --kranz: #d9a441; --akzent: #efc86d; }
.held-divus { --tunika: #54245c; --toga: #863d79; --clavus: #f0cf7a; --kranz: #e5b94c; --gold: #f0cf7a; --akzent: #f0cf7a; }
.held-deus { --tunika: #38235f; --toga: #654096; --clavus: #f6d148; --kranz: #f0c842; --gold: #f6d148; --akzent: #f6d148; }

@media (prefers-color-scheme: dark) {
  .held-civis { --toga: #d7ccb7; }
  .held-scriba { --toga: #ddd1bb; }
  .held-magister { --toga: #ddd3c1; }
  .held-quaestor { --toga: #dcd2bf; }
  .held-aedilis { --toga: #dfd5c3; }
  .held-praetor { --toga: #e0d7c8; }
  .held-senator { --toga: #e3dacb; }
  .held-consul { --toga: #e7dece; }
  .held-censor { --toga: #dcd2c1; }
}

/* --- Gesicht nach eigener Wahl --- */

.held-haar, .held-bart, .held-brille g, .held-sommersprossen { display: none; }
.held[data-frisur="kurz"] .haar-kurz { display: inline; }
.held[data-frisur="lang"] .haar-lang { display: inline; }
.held[data-frisur="locken"] .haar-locken { display: inline; }
.held[data-frisur="zopf"] .haar-zopf { display: inline; }
.held[data-brille="rund"] .brille-rund { display: inline; }
.held[data-brille="eckig"] .brille-eckig { display: inline; }
.held[data-bart="schnurr"] .bart-schnurr { display: inline; }
.held[data-bart="voll"] .bart-voll { display: inline; }
.held[data-sommersprossen="ja"] .held-sommersprossen { display: inline; }

/* Unter dem Helm sieht man die Frisur ohnehin nicht. */
.held-miles .held-haar, .held-centurio .held-haar { display: none; }

.neuer-rang {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
  padding: 14px;
  text-align: left;
  background: var(--primaer-weich);
  border-radius: var(--radius-klein);
  animation: abzeichen-auf .5s ease-out backwards;
}
.neuer-rang-text { flex: 1; min-width: 0; }
.neuer-rang-marke { margin: 0; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--primaer); }
.neuer-rang-name { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; }
.neuer-rang-satz { margin: 4px 0 0; font-size: .85rem; color: var(--text-leise); }

.konto-wahl { display: flex; gap: 8px; margin-bottom: 14px; }
.feld-label { display: block; margin: 12px 0 4px; font-size: .8rem; font-weight: 650; color: var(--text-leise); }
#konto-formular .knopf { margin-top: 14px; }

/* --- Erinnerung an die Sicherung --- */

/* Ein Punkt an der Tableiste statt einer Karte auf dem Startbildschirm. */
.tab.hat-hinweis { position: relative; }
.tab.hat-hinweis .tab-symbol::after {
  content: '';
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--fast);
  border: 2px solid var(--flaeche);
}

/* --- Avatar-Editor --- */

.avatar-buehne { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-rang {
  margin: 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--primaer-weich);
  color: var(--primaer);
  font-size: .8rem;
  font-weight: 700;
}
.avatar-buehne .knopf { width: auto; padding: 10px 22px; }

.avatar-wahl { display: flex; flex-wrap: wrap; gap: 8px; }

.avatar-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 14px;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  color: inherit;
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}
.avatar-knopf.ist-gewaehlt { border-color: var(--primaer); background: var(--primaer-weich); color: var(--primaer); }

.avatar-tupfer {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgb(0 0 0 / 15%);
}

/* --- Abzeichen-Weg --- */

.abzeichen-leiste {
  position: sticky;
  top: calc(var(--kopf-hoehe) + env(safe-area-inset-top));
  z-index: 5;
  margin: 0 -16px 8px;
  padding: 12px 16px;
  background: var(--grund);
  border-bottom: 1px solid var(--rand);
}
.abzeichen-gross { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.abzeichen-unterzeile { margin: 8px 0 0; color: var(--text-leise); font-size: .82rem; }

.weg { position: relative; margin-top: 16px; }
.weg-linie { position: absolute; inset: 0; width: 100%; height: 100%; }
#weg-pfad { stroke: var(--rand); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 14; vector-effect: non-scaling-stroke; }
#weg-pfad-geschafft { stroke: var(--primaer); stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .55; }

.weg-station {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
}
.weg-station.ist-links { flex-direction: row-reverse; }

.weg-kreis {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--flaeche);
  border: 3px solid var(--rand);
  box-shadow: var(--schatten);
  font-size: 1.5rem;
  line-height: 1;
}
.ist-erreicht .weg-kreis { border-color: var(--primaer); background: var(--primaer-weich); }
.ist-offen .weg-kreis { filter: grayscale(1); opacity: .6; border-style: dashed; }

.ist-naechstes .weg-kreis {
  filter: none;
  opacity: 1;
  border-style: solid;
  border-color: var(--primaer);
  animation: pochen 2s ease-in-out infinite;
}

@keyframes pochen {
  0%, 100% { box-shadow: 0 0 0 0 rgb(76 81 191 / 35%); }
  50% { box-shadow: 0 0 0 10px rgb(76 81 191 / 0%); }
}

/* Der Text liegt auf dem Untergrund und damit ueber der Wegstrecke - sonst
   laeuft die Linie mitten durch die Beschriftung. */
.weg-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 132px;
  padding: 5px 9px;
  background: var(--grund);
  border-radius: 10px;
}
.ist-links .weg-text { text-align: right; align-items: flex-end; }
.weg-titel { font-size: .84rem; font-weight: 650; line-height: 1.25; }
.weg-unter { margin-top: 1px; font-size: .72rem; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.weg-text .fortschrittsbalken-schmal { width: 100%; margin-top: 5px; }
.ist-offen .weg-titel { color: var(--text-leise); }

.weg-station.ist-ich { z-index: 2; }
.ist-ich .weg-titel { color: var(--primaer); }
.ist-ich .held { filter: drop-shadow(0 3px 6px rgb(27 29 42 / 18%)); }

.neue-abzeichen { margin: 4px 0 16px; }/* --- Wortart und Geschlecht --- */

:root {
  /* Geschlecht nach der Schulkonvention: blau, rot, gruen. */
  --genus-m: #1d4ed8;
  --genus-f: #be123c;
  --genus-n: #15803d;

  --art-nomen: #6d28d9;
  --art-verb: #c2410c;
  --art-adjektiv: #0f766e;
  --art-adverb: #a16207;
  --art-konjunktion: #475569;
  --art-praeposition: #be185d;
  --art-pronomen: #0e7490;
  --art-sonstiges: #57534e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --genus-m: #2f5fd0;
    --genus-f: #b32a48;
    --genus-n: #1c7a42;

    --art-nomen: #c4b5fd;
    --art-verb: #fdba74;
    --art-adjektiv: #7dd3c0;
    --art-adverb: #fcd34d;
    --art-konjunktion: #cbd5e1;
    --art-praeposition: #f9a8d4;
    --art-pronomen: #7dd3fc;
    --art-sonstiges: #d6d3d1;
  }
}

.wortchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.wortchip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Die Wortart bleibt zurueckhaltend, das Geschlecht traegt kraeftige Farbe -
   sonst konkurrieren zwei Farbsysteme um dieselbe Aufmerksamkeit. */
.wortchip-art {
  border: 1px solid currentColor;
  background: transparent;
  color: var(--art-sonstiges);
}
.wortchip-art[data-wortart="nomen"] { color: var(--art-nomen); }
.wortchip-art[data-wortart="verb"] { color: var(--art-verb); }
.wortchip-art[data-wortart="adjektiv"] { color: var(--art-adjektiv); }
.wortchip-art[data-wortart="adverb"] { color: var(--art-adverb); }
.wortchip-art[data-wortart="konjunktion"] { color: var(--art-konjunktion); }
.wortchip-art[data-wortart="praeposition"] { color: var(--art-praeposition); }
.wortchip-art[data-wortart="pronomen"] { color: var(--art-pronomen); }

/* Das Geschlecht ist voll gefuellt, die Wortart nur umrandet. Zwei
   Farbsysteme nebeneinander unterscheiden sich so auch dann, wenn die Farbtoene
   nah beieinander liegen - Violett fuer Nomen neben Blau fuer maskulin. */
.wortchip-genus { border: 1px solid transparent; color: #fff; }
.wortchip-genus[data-genus="m"] { background: var(--genus-m); }
.wortchip-genus[data-genus="f"] { background: var(--genus-f); }
.wortchip-genus[data-genus="n"] { background: var(--genus-n); }

.wortkarte .wortchips { justify-content: center; margin-top: 12px; }

.legende { margin-bottom: 16px; }
.legende-kopf { cursor: pointer; font-weight: 650; }
.legende .wortchips { margin-top: 10px; }
.legende-warnung { margin-top: 14px; margin-bottom: 0; }

/* --- Wortkarte: die erste Begegnung mit einer neuen Vokabel --- */

.wortkarte {
  padding: 24px 20px;
  text-align: center;
  background: var(--flaeche);
  border: 2px solid var(--primaer);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}

.wortkarte-marke {
  margin: 0 0 14px;
  color: var(--primaer);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.wortkarte-wort { margin: 0; font-size: 2.1rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.wortkarte-zusatz { margin: 4px 0 0; color: var(--text-leise); font-size: .9rem; }
.wortkarte-bedeutung { margin: 14px 0 0; font-size: 1.25rem; font-weight: 650; }


.hilfe {
  margin-top: 12px;
  padding: 10px 14px;
  text-align: left;
  border-radius: var(--radius-klein);
  border-left: 3px solid var(--rand);
  background: var(--flaeche-2);
}
.hilfe-marke {
  display: block;
  margin-bottom: 2px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-leise);
}
.hilfe-text { margin: 0; font-size: .9rem; }
.ist-verwandtschaft { border-left-color: var(--primaer); }
.ist-verwandtschaft .hilfe-marke { color: var(--primaer); }
.ist-merkhilfe { border-left-color: var(--fast); }
.ist-merkhilfe .hilfe-marke { color: var(--fast); }

.beispiel {
  margin-top: 16px;
  padding: 12px 14px;
  text-align: left;
  background: var(--flaeche-2);
  border-left: 3px solid var(--primaer);
  border-radius: 0 var(--radius-klein) var(--radius-klein) 0;
}
.beispiel-lat { margin: 0; min-width: 0; font-size: 1rem; font-weight: 650; }
.beispiel-de { margin: 2px 0 0; color: var(--text-leise); font-size: .9rem; }

.sprech-zeile { display: flex; align-items: center; justify-content: center; gap: 8px; }
.beispiel .sprech-zeile { justify-content: flex-start; }
.sprech-knopf {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--rand);
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--primaer);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sprech-knopf:hover { background: var(--primaer-weich); }
.sprech-knopf:active { transform: scale(.96); }

/* --- Wörterliste --- */

.wort {
  padding: 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}
.wort-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wort-latein-zeile { display: flex; align-items: center; min-width: 0; gap: 8px; }
.wort-latein { margin: 0; font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.wort-zusatz { margin: 2px 0 0; color: var(--text-leise); font-size: .82rem; }
.wort-bedeutung { margin: 8px 0 0; font-size: 1.02rem; font-weight: 600; }

.wort-stand {
  flex: none;
  max-width: 48%;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--text-leise);
  font-size: .72rem;
  font-weight: 650;
  text-align: right;
}
.wort-stand.ist-neu { background: var(--primaer-weich); color: var(--primaer); }
.wort-stand.ist-sicher { background: var(--richtig-weich); color: var(--richtig); }

/* --- Satz zusammenlegen --- */

.satz-sprecher { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.satz-sprecher .maki { flex: none; }

.satz-blase {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.satz-blase-text { flex: 1; min-width: 0; }
.satz-blase::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--flaeche);
  border-left: 1px solid var(--rand);
  border-bottom: 1px solid var(--rand);
}

/* Zwei angedeutete Schreibzeilen, in die die Bausteine wandern. */
.satz-antwort {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  /* Eine Zeile hoch, waechst bei laengeren Saetzen mit. */
  min-height: 56px;
  padding: 8px 0;
  margin-bottom: 20px;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 51px, var(--rand) 51px, var(--rand) 52px);
}
.satz-antwort.ist-richtig { background-image: repeating-linear-gradient(
  to bottom, transparent 0, transparent 51px, var(--richtig) 51px, var(--richtig) 52px); }
.satz-antwort.ist-falsch { background-image: repeating-linear-gradient(
  to bottom, transparent 0, transparent 51px, var(--falsch) 51px, var(--falsch) 52px); }

.satz-bank { display: flex; flex-wrap: wrap; gap: 8px; }

.baustein {
  min-height: 44px;
  padding: 10px 14px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-bottom-width: 3px;
  border-radius: var(--radius-klein);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .08s ease;
}
.baustein:active:not(:disabled) { transform: translateY(1px); }
.baustein:disabled { cursor: default; opacity: 1; }

/* Der Platz bleibt stehen, damit beim Antippen nichts springt. */
.baustein-platz { display: inline-flex; border-radius: var(--radius-klein); }
.baustein-platz.ist-benutzt { background: var(--flaeche-2); }
.baustein-platz.ist-benutzt .baustein { visibility: hidden; }

/* --- Paare --- */

.paare-hinweis { margin: 0 0 14px; color: var(--text-leise); font-size: .88rem; }
.paare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paare-spalte { display: flex; flex-direction: column; gap: 10px; }

.paar-knopf {
  min-height: var(--tap);
  padding: 12px 10px;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius-klein);
  color: inherit;
  font: inherit;
  font-size: .96rem;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: transform .08s ease, opacity .2s ease, border-color .15s ease;
}
.paar-gewaehlt { border-color: var(--primaer); background: var(--primaer-weich); }
.paar-richtig { border-color: var(--richtig); background: var(--richtig-weich); opacity: .55; cursor: default; }
.paar-falsch { border-color: var(--falsch); background: var(--falsch-weich); animation: wackeln .3s ease; }

@keyframes wackeln {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* --- Ergebnis --- */

.karte-ergebnis { text-align: center; }
.ergebnis-titel { margin: 8px 0 4px; font-size: 1.6rem; }
.ergebnis-satz { margin: 0 0 18px; color: var(--text-leise); font-size: .95rem; }

.ergebnis-liste {
  margin: 4px 0 18px;
  padding: 14px 16px;
  list-style: none;
  text-align: left;
  background: var(--flaeche-2);
  border-radius: var(--radius-klein);
  font-size: .95rem;
}
.ergebnis-liste:empty { display: none; }
.ergebnis-liste li + li { margin-top: 4px; }
.ergebnis-liste-titel { margin-bottom: 8px; font-weight: 650; font-size: .85rem; color: var(--text-leise); }

.jubel { position: relative; height: 92px; margin-bottom: 4px; }

.haekchen { position: absolute; inset: 0; display: grid; place-items: center; }
.haekchen svg { width: 76px; height: 76px; }
.haekchen-kreis { stroke: var(--richtig); stroke-width: 3; stroke-dasharray: 152; stroke-dashoffset: 152; }
.haekchen-strich { stroke: var(--richtig); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; }

.jubel-laeuft .haekchen-kreis { animation: strich-zeichnen .5s ease-out forwards; }
.jubel-laeuft .haekchen-strich { animation: strich-zeichnen .35s .4s ease-out forwards; }

@keyframes strich-zeichnen { to { stroke-dashoffset: 0; } }

.konfetti { position: absolute; inset: -10px 0 auto; height: 220px; overflow: hidden; pointer-events: none; }
.schnipsel {
  position: absolute;
  top: 0;
  left: var(--x);
  width: 9px;
  height: 14px;
  background: var(--farbe);
  border-radius: 2px;
  opacity: 0;
  animation: rieseln 1.5s var(--verzug) ease-in forwards;
}

@keyframes rieseln {
  0% { opacity: 1; transform: translate(0, -20px) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--drift), 210px) rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .haekchen-kreis, .haekchen-strich { stroke-dashoffset: 0; }
  .konfetti { display: none; }
  .maki-auge, .maki-kopf, .maki-huepft, .neue-abzeichen .abzeichen,
  .ist-naechstes .weg-kreis, .neuer-rang, .frisch, .frisch-symbol { animation: none !important; }
  .maki-traurig .maki-kopf { transform: none; }
}

/* --- Grammatiktabellen --- */

.tabelle-huelle { margin: 0 0 16px; }
.tabelle-titel {
  margin-bottom: 8px;
  font-weight: 650;
  font-size: .95rem;
}
.tabelle-rollbereich {
  overflow-x: auto;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.formentabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.formentabelle th, .formentabelle td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.formentabelle thead th { background: var(--flaeche-2); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-leise); }
.formentabelle tbody tr:last-child th, .formentabelle tbody tr:last-child td { border-bottom: 0; }
.formentabelle tbody th { font-weight: 600; color: var(--text-leise); }
.formentabelle tbody td { font-family: Georgia, 'Times New Roman', serif; }

.kapitel-erklaerung { margin: 0; font-size: .97rem; }

/* --- Tableiste --- */

.tableiste {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--flaeche);
  border-top: 1px solid var(--rand);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tab-hoehe);
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--text-leise);
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab-symbol { font-size: 1.25rem; line-height: 1; }
.tab-aktiv { color: var(--primaer); font-weight: 650; }

/* --- Update-Hinweis --- */

.update-balken {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-hoehe) + 12px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 420px;
  padding: 10px 12px 10px 16px;
  background: var(--text);
  color: var(--grund);
  border-radius: 999px;
  box-shadow: var(--schatten);
  font-size: .9rem;
}
.update-balken .knopf { background: var(--grund); color: var(--text); }

@media (min-width: 560px) {
  body { font-size: 18px; }
  .frage-wort { font-size: 2.3rem; }
  main { padding: 24px 20px 32px; }
}

/* Warme Rom-Farben geben den Belohnungen Charakter, während die eigentlichen
   Lernflächen ruhig bleiben und den Text in den Vordergrund stellen. */

body {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-hoehe) + 28px + env(safe-area-inset-bottom));
  background-color: var(--grund);
  background-image:
    radial-gradient(circle at 12% -8%, rgb(91 63 192 / 16%), transparent 30rem),
    radial-gradient(circle at 105% 20%, rgb(201 133 24 / 13%), transparent 25rem),
    linear-gradient(180deg, rgb(255 255 255 / 18%), transparent 34rem);
}

.kopf {
  min-height: calc(var(--kopf-hoehe) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  background: rgb(255 253 249 / 88%);
  border-bottom-color: rgb(91 63 192 / 14%);
  box-shadow: 0 5px 24px rgb(55 38 25 / 7%);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.kopf-titel {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: .025em;
}

.kopf-zurueck,
.chip {
  border: 1px solid rgb(91 63 192 / 10%);
  background: rgb(255 255 255 / 58%);
  box-shadow: 0 2px 8px rgb(55 38 25 / 5%);
}

.chip { color: var(--text); }
.chip-knopf { padding: 4px; }

main { padding-top: 22px; }

.abschnitt-titel {
  margin-top: 2px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1.15;
}

.abschnitt-hinweis { max-width: 54ch; }

.karte {
  border-color: rgb(115 91 70 / 16%);
  box-shadow: var(--schatten);
}

.karte-titel {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.13rem;
  line-height: 1.25;
}

.karte-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px;
  color: #fffaf0;
  border: 1px solid rgb(255 255 255 / 13%);
  background:
    radial-gradient(circle at 105% -20%, rgb(255 213 121 / 30%), transparent 42%),
    linear-gradient(145deg, #7149cf 0%, #4d319d 55%, #34236f 100%);
  box-shadow: var(--schatten-stark);
}

.karte-hero::after {
  content: 'SPQR';
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: -34px;
  color: rgb(255 255 255 / 6%);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 6.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.08em;
  pointer-events: none;
}

.karte-hero .hero-lektion,
.karte-hero .hero-hinweis { color: rgb(255 250 240 / 74%); }

.karte-hero .hero-lektion {
  font-weight: 750;
  letter-spacing: .15em;
}

.karte-hero .hero-titel {
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 8vw, 2.15rem);
  line-height: 1.15;
  text-wrap: balance;
}

.karte-hero .sprechblase {
  color: #34284a;
  background: #fff9ed;
  box-shadow: 0 6px 20px rgb(31 18 69 / 22%);
}

.karte-hero .sprechblase::before { background: #fff9ed; }

.karte-hero .fortschrittsbalken { background: rgb(255 255 255 / 18%); }
.karte-hero .fortschrittsbalken-fuellung { background: linear-gradient(90deg, var(--gold-hell), #ffe7a8); }

.karte-hero .knopf-primaer {
  color: #382710;
  background: linear-gradient(180deg, #ffe39c, #efb848);
  border-color: rgb(255 255 255 / 18%);
  box-shadow: 0 5px 0 #af6f12, 0 12px 24px rgb(29 15 66 / 28%);
}

.karte-hero .knopf-primaer:hover:not(:disabled) { background: linear-gradient(180deg, #ffebb8, #f4c660); }
.karte-hero .knopf-primaer:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #af6f12; }
.karte-hero .knopf-flach { color: #fffaf0; }
.karte-hero .knopf-flach:hover { background: rgb(255 255 255 / 12%); }

.knopf {
  border-color: rgb(115 91 70 / 11%);
  box-shadow: 0 3px 9px rgb(55 38 25 / 7%);
  transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease;
}

.knopf-primaer {
  background: linear-gradient(145deg, var(--primaer-hell), var(--primaer));
  box-shadow: 0 4px 0 #3f288e, 0 10px 20px rgb(91 63 192 / 20%);
}

.knopf-primaer:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #3f288e; }
.knopf-flach { box-shadow: none; border-color: transparent; }

.kachelreihe { gap: 11px; }

.kachel {
  position: relative;
  overflow: hidden;
  min-height: 86px;
  justify-content: center;
  border-color: rgb(115 91 70 / 13%);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgb(55 38 25 / 6%);
}

.kachel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primaer);
}

.kachel:nth-child(2)::before { background: var(--gold); }
.kachel:nth-child(3)::before { background: var(--wein); }
.kachel-zahl { font-size: 1.5rem; color: var(--primaer); }
.kachel:nth-child(2) .kachel-zahl { color: var(--gold); }
.kachel:nth-child(3) .kachel-zahl { color: var(--wein); }

.karte-ziel {
  border-color: rgb(201 133 24 / 24%);
  background:
    radial-gradient(circle at 0 50%, rgb(255 255 255 / 72%), transparent 42%),
    linear-gradient(135deg, var(--gold-weich), var(--flaeche));
}

.ziel-ring {
  padding: 4px;
  border-radius: 50%;
  background: var(--flaeche);
  box-shadow: 0 8px 20px rgb(156 94 10 / 13%);
}

.ziel-ring-bahn { stroke: var(--gold-weich); }
.ziel-ring-fuellung { stroke: var(--gold); }

.karte-rang {
  position: relative;
  overflow: hidden;
  color: #fff8eb;
  border-color: rgb(255 255 255 / 10%);
  background:
    radial-gradient(circle at 92% 12%, rgb(255 214 123 / 20%), transparent 38%),
    linear-gradient(135deg, #34204f, #5a2d69 58%, #7d385c);
  box-shadow: var(--schatten-stark);
}

.karte-rang::after {
  content: '✦';
  position: absolute;
  right: 13px;
  top: 4px;
  color: rgb(255 225 155 / 18%);
  font-size: 4.8rem;
  line-height: 1;
  pointer-events: none;
}

.karte-rang .held-platz {
  position: relative;
  z-index: 1;
  padding: 5px;
  border: 1px solid rgb(255 232 180 / 22%);
  border-radius: 999px 999px 28px 28px;
  background: rgb(255 255 255 / 9%);
}

.karte-rang .held { filter: drop-shadow(0 5px 5px rgb(18 8 26 / 34%)); }

.karte-rang .rang-lage,
.karte-rang .rang-erklaerung,
.karte-rang .rang-hinweis { color: rgb(255 248 235 / 72%); }

.karte-rang .rang-name-gross {
  color: #ffe29b;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.55rem;
}

.karte-rang .fortschrittsbalken { background: rgb(255 255 255 / 15%); }
.karte-rang .fortschrittsbalken-fuellung { background: linear-gradient(90deg, #e8a839, #ffe5a5); }

#screen-start > #knopf-avatar {
  display: flex;
  width: auto;
  margin: -7px auto 16px;
  padding-inline: 20px;
}

.karte-abzeichen {
  border-color: rgb(91 63 192 / 20%);
  background:
    radial-gradient(circle at 100% 0, rgb(201 133 24 / 13%), transparent 34%),
    linear-gradient(145deg, var(--flaeche), var(--primaer-weich));
}

.abzeichen-zaehler,
.rang-name,
.aufgabe-status {
  border: 1px solid rgb(91 63 192 / 15%);
}

.faecher { gap: 10px; }
.fach-raum { border: 1px solid rgb(91 63 192 / 10%); border-radius: 10px; }
.fach-balken { background: linear-gradient(180deg, var(--gold-hell), var(--primaer)); }

.listeneintrag,
.rang-eintrag {
  box-shadow: 0 6px 18px rgb(55 38 25 / 5%);
  transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease;
}

.listeneintrag-aktiv,
.rang-eintrag.ist-eigener { box-shadow: 0 9px 24px rgb(91 63 192 / 13%); }

.frage,
.wortkarte {
  position: relative;
  overflow: hidden;
  border-color: rgb(91 63 192 / 18%);
  background:
    radial-gradient(circle at 100% 0, rgb(91 63 192 / 10%), transparent 34%),
    var(--flaeche);
  box-shadow: var(--schatten-stark);
}

.frage::before,
.wortkarte::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primaer), var(--gold-hell), var(--wein));
}

.frage-wort,
.wortkarte-wort,
.wort-latein,
.satz-blase-text { font-family: Georgia, 'Times New Roman', serif; }

.frage-wort,
.wortkarte-wort { color: var(--primaer); }

.option,
.paar-knopf,
.eingabe,
.baustein {
  box-shadow: 0 4px 12px rgb(55 38 25 / 5%);
}

.option:hover:not(:disabled),
.paar-knopf:hover:not(:disabled),
.probe-knopf:hover { border-color: var(--primaer); background: var(--primaer-weich); }

.hilfe {
  border: 1px solid rgb(201 133 24 / 20%);
  background: linear-gradient(135deg, var(--gold-weich), var(--flaeche));
}

.hilfe-marke { color: var(--gold); }

.beispiel {
  border: 1px solid rgb(91 63 192 / 13%);
  background: linear-gradient(135deg, var(--primaer-weich), var(--flaeche));
}

.wort,
.tabelle-rollbereich { box-shadow: var(--schatten); }

.wort { border-radius: var(--radius); }

.satz-blase {
  border-color: rgb(91 63 192 / 20%);
  background: linear-gradient(135deg, var(--primaer-weich), var(--flaeche));
  box-shadow: var(--schatten);
}

.satz-blase::before { background: var(--primaer-weich); border-color: rgb(91 63 192 / 20%); }

.avatar-buehne {
  overflow: hidden;
  border-color: rgb(201 133 24 / 22%);
  background:
    radial-gradient(circle at 50% 35%, var(--gold-weich) 0 22%, transparent 50%),
    linear-gradient(180deg, var(--flaeche), var(--primaer-weich));
}

.avatar-buehne .held { filter: drop-shadow(0 9px 8px rgb(59 34 20 / 20%)); }

.rang-eintrag > .held-platz {
  align-items: flex-end;
  width: 68px;
  min-height: 80px;
  padding: 5px;
  border: 1px solid rgb(91 63 192 / 12%);
  border-radius: 999px 999px 18px 18px;
  background: radial-gradient(circle at 50% 32%, var(--gold-weich), var(--primaer-weich));
}

/* Kommende Kleidung soll neugierig machen; nur ihr Text tritt etwas zurück. */
.rang-eintrag.ist-offen { opacity: 1; }
.rang-eintrag.ist-offen .rang-eintrag-text { opacity: .72; }

.avatar-rang,
.neuer-rang-name { font-family: Georgia, 'Times New Roman', serif; }

.avatar-knopf { box-shadow: 0 4px 12px rgb(55 38 25 / 5%); }

.abzeichen-leiste {
  border-bottom: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(135deg, var(--primaer-weich), var(--gold-weich));
  box-shadow: 0 9px 24px rgb(55 38 25 / 7%);
}

.weg-kreis { box-shadow: 0 6px 16px rgb(55 38 25 / 10%); }

.tabelle-rollbereich { border-color: rgb(91 63 192 / 15%); }
.formentabelle thead th { background: linear-gradient(180deg, var(--primaer-weich), var(--flaeche-2)); }

#screen-mehr > .karte { border-top: 3px solid rgb(91 63 192 / 55%); }
#screen-mehr > .karte:nth-of-type(2n) { border-top-color: rgb(201 133 24 / 65%); }

.tableiste {
  left: 50%;
  right: auto;
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: calc(100% - 20px);
  max-width: 620px;
  padding: 5px;
  padding-bottom: 5px;
  transform: translateX(-50%);
  border: 1px solid rgb(91 63 192 / 14%);
  border-radius: 22px;
  background: rgb(255 253 249 / 92%);
  box-shadow: 0 7px 26px rgb(55 38 25 / 16%);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.tab {
  min-height: 54px;
  border-radius: 17px;
  transition: background-color .16s ease, color .16s ease, transform .12s ease;
}

.tab:active { transform: scale(.96); }
.tab-aktiv { color: var(--primaer); background: var(--primaer-weich); }
.tab-aktiv .tab-symbol { transform: translateY(-1px) scale(1.08); }

.update-balken { bottom: calc(var(--tab-hoehe) + 26px + env(safe-area-inset-bottom)); }

@media (hover: hover) {
  .listeneintrag:hover,
  .rang-eintrag:hover,
  .karte-abzeichen:hover,
  .karte-rang:hover {
    transform: translateY(-2px);
    box-shadow: var(--schatten-stark);
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(circle at 12% -8%, rgb(139 111 255 / 16%), transparent 30rem),
      radial-gradient(circle at 105% 20%, rgb(239 189 92 / 9%), transparent 25rem);
  }

  .kopf,
  .tableiste { background: rgb(33 27 41 / 89%); }

  .kopf-zurueck,
  .chip { background: rgb(255 255 255 / 5%); border-color: rgb(255 255 255 / 7%); }

  .knopf-primaer { box-shadow: 0 4px 0 #6d57c0, 0 10px 20px rgb(0 0 0 / 24%); }
  .knopf-primaer:active:not(:disabled) { box-shadow: 0 2px 0 #6d57c0; }

  .karte-ziel {
    background:
      radial-gradient(circle at 0 50%, rgb(255 255 255 / 4%), transparent 42%),
      linear-gradient(135deg, var(--gold-weich), var(--flaeche));
  }

  .karte-abzeichen,
  .beispiel,
  .satz-blase,
  .avatar-buehne { background-color: var(--flaeche); }

  .karte-rang { border-color: rgb(255 255 255 / 9%); }
}

@media (max-width: 360px) {
  main { padding-inline: 12px; }
  .karte-hero { padding: 18px 16px; }
  .kopf { padding-inline: 8px; gap: 5px; }
  .kopf-status { gap: 4px; }
  .chip { padding-inline: 7px; }
  .chip-knopf { padding-inline: 2px; }
  .kachelreihe { gap: 7px; }
  .kachel { padding-inline: 4px; }
  .tableiste { width: calc(100% - 12px); }
}

/* --- Notbremse: sichtbar nur, wenn die App gar nicht hochkommt --- */

.notbremse {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--grund);
  color: var(--text);
}
.notbremse h2 { margin: 0 0 12px; font-size: 1.2rem; }
.notbremse p { margin: 0 0 10px; font-size: .95rem; }
.notbremse pre {
  margin: 0;
  padding: 12px;
  background: var(--flaeche-2);
  border-radius: var(--radius-klein);
  font-size: .78rem;
  white-space: pre-wrap;
  word-break: break-word;
}
