/*
  Zahbenteuer — Gestaltung.

  Dieselben Grundwerte wie Buchstabenteuer, damit sich beide Apps wie eine
  anfühlen. Die Werte sind Befund, nicht Geschmack: erhöhter Buchstaben- und
  Wortabstand halbiert die Lesefehler bei Dyslexie (Zorzi u. a. 2012, PNAS),
  die Schriftart selbst trägt nichts bei. Verdana, viel Luft, kein Blocksatz,
  keine Kursive, keine Versalien. Kein Rot: „noch nicht" ist kein Alarm.
*/
:root {
  --grund: #FAF7F0; --grund-tief: #F2EDE2; --karte: #FFFDF8;
  --text: #1A1A1A; --text-leise: #5A5248; --linie: #E2D9C8;
  --wald: #2F5D4A; --wald-hell: #E6EFE9; --tinte: #23324A;
  --kupfer: #A6542A; --kupfer-hell: #FBEDE4; --gold: #B8860B; --gold-hell: #FBF3DC;
  --gelungen: #2F6B45; --nochnicht: #8A5A2B;
  --zeichenabstand: 0.08em; --wortabstand: 0.16em; --zeilenhoehe: 1.6; --schriftgroesse: 19px;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(60,45,25,.07);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--grund); color: var(--text);
  font-family: Verdana, Arial, "DejaVu Sans", Tahoma, sans-serif;
  font-size: var(--schriftgroesse); line-height: var(--zeilenhoehe);
  letter-spacing: var(--zeichenabstand); word-spacing: var(--wortabstand);
  -webkit-text-size-adjust: 100%;
}
body { min-height: 100dvh; }
p, li, td, th { text-align: left; hyphens: none; }
h1, h2, h3 { line-height: 1.3; letter-spacing: .02em; word-spacing: .04em; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
button { font: inherit; letter-spacing: inherit; word-spacing: inherit; color: inherit; }
.huelle { max-width: 48rem; margin: 0 auto; padding: 18px 16px 48px; }

/* ---------------------------------------------------------------- Kopf */
.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 16px;
  background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 20; }
.kopf .marke { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--wald); font-size: .95rem; }
.kopf .marke img { width: 34px; height: 34px; }
.kopf .luecke { flex: 1; }
.kopf nav { display: flex; flex-wrap: wrap; gap: 4px; }
.kopf nav button, .kopf nav a { border: 0; background: none; padding: 6px 10px; border-radius: 10px; cursor: pointer;
  font-size: .85rem; color: var(--text-leise); text-decoration: none; }
.kopf nav .an { background: var(--wald-hell); color: var(--wald); font-weight: 700; }
.kopf .fassung { font-size: .65rem; color: var(--text-leise); letter-spacing: 0; }

/* ---------------------------------------------------------------- Bausteine */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px; margin-bottom: 16px; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  padding: 10px 22px; border-radius: 14px; border: 2px solid var(--wald); background: var(--wald); color: #fff;
  font-weight: 700; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.knopf.leise { background: var(--karte); color: var(--wald); }
.knopf.klein { min-height: 42px; padding: 6px 14px; font-size: .9rem; }
.knopf.gross { min-height: 64px; font-size: 1.15rem; padding: 12px 32px; }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.gold { background: var(--gold); border-color: var(--gold); }
.reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reihe.mitte { justify-content: center; }
.leise { color: var(--text-leise); }
.klein { font-size: .85rem; }
.versteckt { display: none !important; }

/* Tinte spricht */
.tinte { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 14px; }
.tinte img { width: 56px; height: 56px; flex: none; }
.blase { position: relative; background: var(--karte); border: 1px solid var(--linie); border-radius: 16px;
  padding: 10px 14px; box-shadow: var(--schatten); flex: 1; }
.blase.gut { border-color: var(--gelungen); background: var(--wald-hell); }
.blase.hinweis { border-color: var(--gold); background: var(--gold-hell); }
.blase .hoeren { float: right; margin: -4px -6px 4px 8px; }
.hoeren { border: 0; background: var(--wald-hell); color: var(--wald); border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hoeren svg { width: 22px; height: 22px; }
.hoeren.spielt { background: var(--wald); color: #fff; }

/* ---------------------------------------------------------------- Start */
.welten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 18px; }
@media (max-width: 640px) { .welten { grid-template-columns: 1fr; } }
.welt { border: 3px solid var(--linie); border-radius: var(--radius); background: var(--karte); padding: 0; cursor: pointer;
  overflow: hidden; text-align: left; }
.welt img { width: 100%; aspect-ratio: 16/9; display: block; object-fit: cover; }
.welt .name { padding: 8px 12px 0; font-weight: 700; }
.welt .zeile { padding: 0 12px 10px; font-size: .8rem; color: var(--text-leise); }
.welt.an { border-color: var(--wald); box-shadow: 0 0 0 3px var(--wald-hell); }
.ritt { border: 2px solid var(--gold); background: var(--gold-hell); }

/* ---------------------------------------------------------------- Aufgabe */
.fortschritt { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.fortschritt span { width: 14px; height: 14px; border-radius: 50%; background: var(--linie); }
.fortschritt span.fertig { background: var(--wald); }
.fortschritt span.jetzt { background: var(--gold); }
.szene { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.szene .motiv { width: 46%; max-width: 260px; aspect-ratio: 16/9; border-radius: 12px; border: 1px solid var(--linie); background: var(--grund-tief); }
.szene .figuren { display: flex; gap: 4px; }
.szene .figuren img { width: 52px; height: 52px; }
.text { margin: 6px 0 10px; }
.text .satz { display: block; padding: 2px 6px; margin: 0 -6px 2px; border-radius: 8px; }
.text .satz.frage { font-weight: 700; margin-top: 8px; }
.text .satz.nachtrag { background: var(--gold-hell); border-left: 4px solid var(--gold); }
.text .satz.liest { background: var(--gold-hell); }
.text .wort.liest { background: var(--gold); color: #fff; border-radius: 4px; }
.zahl { display: inline-block; padding: 0 6px; border-radius: 8px; border: 2px solid transparent; font-weight: 700; }
.waehlbar .zahl { border-color: var(--linie); background: var(--karte); cursor: pointer; padding: 2px 8px; }
.zahl.gewaehlt { border-color: var(--wald) !important; background: var(--wald-hell) !important; color: var(--wald); }
.zahl.falsch { border-color: var(--nochnicht) !important; background: var(--kupfer-hell) !important; }
.schritt { border-top: 1px dashed var(--linie); margin-top: 12px; padding-top: 12px; }
.schritt h3 { display: flex; align-items: center; gap: 8px; }
.schritt h3 .nr { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--wald); color: #fff;
  align-items: center; justify-content: center; font-size: .85rem; flex: none; }
.bilder { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bildwahl { border: 3px solid var(--linie); border-radius: 12px; background: var(--karte); padding: 8px; cursor: pointer; }
.bildwahl.an { border-color: var(--wald); }
.bildwahl.falsch { border-color: var(--nochnicht); opacity: .6; }
.bild-gross { max-width: 640px; }
.diagramm { max-width: 640px; margin: 8px 0; }

/* Rechnung und Eingabe */
.rechnung { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.3rem; margin: 8px 0; }
.feld { min-width: 92px; min-height: 56px; padding: 6px 12px; border: 2px solid var(--linie); border-radius: 12px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; letter-spacing: .04em; }
.feld.aktiv { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-hell); }
.feld.leer { color: var(--text-leise); font-weight: 400; }
.feld.op { min-width: 56px; }
.feld.ok { border-color: var(--gelungen); background: var(--wald-hell); }
.einheit { font-size: 1rem; color: var(--text-leise); }
.tasten { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; margin: 10px 0; }
.tasten button { height: 58px; border-radius: 12px; border: 1px solid var(--linie); background: var(--karte); font-size: 1.3rem;
  font-weight: 700; cursor: pointer; touch-action: manipulation; }
.tasten button.zeichen { background: var(--wald-hell); color: var(--wald); }
.tasten button:active { background: var(--grund-tief); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chips button { min-height: 48px; padding: 4px 14px; border-radius: 12px; border: 2px solid var(--wald); background: var(--wald-hell);
  color: var(--wald); font-weight: 700; cursor: pointer; }

/* Stellentafel der Standortbestimmung */
.tafel { border-collapse: collapse; font-size: 1.4rem; margin: 10px 0; }
.tafel th, .tafel td { border: 2px solid var(--wald); width: 70px; height: 56px; text-align: center; }
.tafel th { background: var(--wald-hell); font-size: 1rem; }
.formel { font-size: 2rem; font-weight: 700; margin: 12px 0; letter-spacing: .06em; }

/* Meins */
.stempel { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.stempel div { border: 2px solid var(--linie); border-radius: 12px; padding: 10px 12px; background: var(--karte); }
.stempel .sicher { border-color: var(--gold); background: var(--gold-hell); }
.stempel .aktiv, .stempel .bekannt { border-color: var(--wald); }
.stempel .neu { opacity: .5; }

/* Anmeldung */
.kacheln { display: flex; flex-wrap: wrap; gap: 12px; }
.kachel { min-width: 140px; min-height: 90px; border: 2px solid var(--linie); border-radius: var(--radius); background: var(--karte);
  font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.kachel.probe { border-style: dashed; color: var(--text-leise); font-weight: 400; }
.pin { font-size: 2rem; letter-spacing: .4em; text-align: center; min-height: 56px; }
input[type=text], input[type=password], input[type=number], select { font: inherit; padding: 8px 10px; border: 1px solid var(--linie);
  border-radius: 10px; background: #fff; }

/* Verwaltung */
.tabelle { border-collapse: collapse; width: 100%; font-size: .85rem; letter-spacing: .02em; word-spacing: .02em; }
.tabelle th, .tabelle td { border-bottom: 1px solid var(--linie); padding: 6px 8px; vertical-align: top; }
.tabelle th { text-align: left; color: var(--text-leise); font-weight: 700; }
.ampel { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .8rem; font-weight: 700; }
.ampel.sicher { background: var(--wald-hell); color: var(--gelungen); }
.ampel.teilweise { background: var(--gold-hell); color: var(--gold); }
.ampel.noch_nicht { background: var(--kupfer-hell); color: var(--nochnicht); }
.punkte span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 3px; background: var(--kupfer-hell); border: 1px solid var(--nochnicht); }
.punkte span.ja { background: var(--gelungen); border-color: var(--gelungen); }
.reiter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.reiter button { border: 1px solid var(--linie); background: var(--karte); padding: 6px 12px; border-radius: 10px; cursor: pointer; font-size: .85rem; }
.reiter button.an { background: var(--wald); color: #fff; border-color: var(--wald); }
.hinweiszeile { font-size: .8rem; color: var(--text-leise); }
