/* Mias Tierwelt: Stile für die Anmeldeseite (bunt wie das Spiel) und den Elternbereich (ruhig, sachlich, volle Breite).
   Das Spiel selbst hat ein eigenes Stylesheet (app.css). Diese Datei kommt ohne Schriften und Bilder aus dem Netz aus. */

:root {
  --papier: #fbfaf6;
  --tinte: #1f2a2e;
  --leise: #5d6b70;
  --linie: #e3dfd3;
  --karte: #ffffff;
  --rahmen: #9aa7ab;
  --lesen: #1c8f9a;
  --fokus: #d9582f;
  --gut-grund: #dff5e1;
  --gut-tinte: #1d6b2a;
  --offen-grund: #fff1cc;
  --offen-tinte: #7a5600;
  --warn-grund: #fde8e4;
  --warn-tinte: #8f2d1a;
  --neutral-grund: #eceae2;
  --himmel-1: #7fd3f7;
  --himmel-2: #c9f1ff;
  --sonne: #ffc93c;
  --koralle: #f0524b;
  --koralle-dunkel: #c93a34;
  --meer: #2bb3c0;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--tinte); font: 16px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3, p, ul, figure { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--meer); outline-offset: 2px; }

/* ---------- Anmeldeseite ---------- */

body.tor {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: linear-gradient(180deg, var(--himmel-1), var(--himmel-2) 55%, #eaffd9);
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
}
.tor-blatt {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 28px;
  padding: 20px 22px 26px;
  box-shadow: 0 8px 0 rgba(31, 42, 46, 0.08), 0 24px 60px rgba(16, 24, 27, 0.18);
}
.tor-bild { display: block; width: 100%; height: auto; }
.tor h1 { font-size: 32px; font-weight: 900; line-height: 1.1; letter-spacing: -0.01em; margin-top: 16px; }
.tor-unter { margin-top: 6px; font-size: 16px; font-weight: 600; color: var(--leise); }
.tor-form { margin-top: 18px; display: grid; gap: 14px; }
.tor-feld { display: grid; gap: 6px; }
.tor-feld label { font-weight: 800; font-size: 16px; }
.tor-feld input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  background: #f4fbfe;
  border: 3px solid #bfe6f5;
  border-radius: 16px;
}
.tor-feld input:focus { outline: none; border-color: var(--meer); background: #ffffff; }
.tor-knopf {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  min-height: 62px;
  margin-top: 4px;
  padding: 14px 20px;
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  background: var(--koralle);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--koralle-dunkel);
}
.tor-knopf:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--koralle-dunkel); }
.tor-knopf:disabled { opacity: 0.6; cursor: progress; }
.tor-meldung { min-height: 1.4em; font-size: 16px; font-weight: 700; color: var(--warn-tinte); }
.tor-meldung:empty { min-height: 0; }
.tor-sperre { font-size: 15px; font-weight: 600; background: var(--offen-grund); color: var(--offen-tinte); border-radius: 14px; padding: 12px 14px; }
@media (prefers-reduced-motion: reduce) { .tor-knopf:active { transform: none; } }

/* ---------- Elternbereich: Grundgerüst ---------- */

body.eltern { background: var(--papier); }
.seite { padding: 24px clamp(16px, 4vw, 56px) 80px; }
.kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding-bottom: 18px; border-bottom: 2px solid var(--tinte); }
.kopf h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; }
.unter { color: var(--leise); margin-top: 4px; }
.kopf-wege { display: flex; flex-wrap: wrap; gap: 8px; }

h2 { font-size: 24px; letter-spacing: -0.01em; }
h3 { font-size: 16px; }
.einleitung { color: var(--leise); margin-top: 6px; max-width: 80ch; }
.klein { font-size: 14px; color: var(--leise); margin-top: 8px; max-width: 90ch; }
.feld { margin-top: 26px; }
.feld:focus { outline: none; }
.feld > * + * { margin-top: 16px; }
.titelzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.datum { color: var(--leise); font-variant-numeric: tabular-nums; }

.meldung { font-size: 15px; color: var(--leise); }
.meldung:empty { display: none; }
.meldung.fehler { color: var(--warn-tinte); font-weight: 600; }
.meldung.gut { color: var(--gut-tinte); font-weight: 600; }
.leer { padding: 18px; border: 1px dashed var(--rahmen); border-radius: 12px; color: var(--leise); background: var(--karte); max-width: 90ch; }

/* Knöpfe */
.knopf {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  color: #ffffff;
  background: var(--tinte);
  border: 1px solid var(--tinte);
  border-radius: 10px;
}
.knopf:hover { background: #33444a; }
.knopf.leise { color: var(--tinte); background: var(--karte); border-color: var(--rahmen); }
.knopf.leise:hover { border-color: var(--tinte); background: var(--karte); }
.knopf.leise.aktiv { background: var(--tinte); color: #ffffff; border-color: var(--tinte); }
.knopf.warnung { background: var(--warn-tinte); border-color: var(--warn-tinte); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Eingaben */
.eltern input[type="text"], .eltern input[type="password"], .eltern textarea, .eltern select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 16px;
  background: var(--karte);
  border: 1px solid var(--rahmen);
  border-radius: 10px;
}
textarea { resize: vertical; line-height: 1.45; }
.formular { display: grid; gap: 8px; margin-top: 12px; }
.formular label { font-size: 14px; font-weight: 600; margin-top: 6px; }

/* PIN */
.pin { margin-top: 28px; max-width: 520px; }
.pin-form { display: grid; gap: 8px; margin-top: 16px; }
.pin-form label { font-size: 14px; font-weight: 600; }
.pin-zeile { display: flex; flex-wrap: wrap; gap: 10px; }
.pin-zeile input { flex: 1 1 180px; width: auto; }
#pin-feld { font-size: 22px; letter-spacing: 0.3em; }

/* Reiter */
.reiter {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * clamp(16px, 4vw, 56px));
  padding: 12px clamp(16px, 4vw, 56px);
  overflow-x: auto;
  background: var(--papier);
  border-bottom: 1px solid var(--linie);
}
.reiter button {
  appearance: none;
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--tinte);
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 999px;
}
.reiter button:hover { border-color: var(--tinte); }
.reiter button[aria-selected="true"] { background: var(--tinte); color: #ffffff; border-color: var(--tinte); }

/* Kacheln und Tafeln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 14px; }
.kachel .kachel-titel { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); }
.kachel b { display: block; font-size: 28px; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kachel b.ohne { font-size: 20px; line-height: 1.7; color: var(--leise); font-weight: 600; }
.kachel small { display: block; font-size: 14px; color: var(--leise); }
.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.tafel { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 16px; min-width: 0; }
.tafel > * + * { margin-top: 10px; }
.hinweis-tafel { background: #f4f1e8; }
.hinweis-tafel p, .hinweis-tafel ul { max-width: 90ch; font-size: 15px; }
.hinweis-tafel ul { padding-left: 20px; }
.tafel.gefahr { border-color: #e2b6ac; }
.tafel.gefahr p { max-width: 90ch; }

/* Dienste */
.dienst { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.dienst:last-child { border-bottom: 0; }
.dienst b { display: block; font-size: 15px; }
.dienst p { font-size: 14px; color: var(--leise); }
.dienst .marke { margin-top: 2px; }
.warnkasten { background: var(--offen-grund); border: 1px solid #ecd58f; border-radius: 12px; padding: 14px 16px; }
.warnkasten h3 { color: var(--offen-tinte); }
.warnkasten .dienst { border-color: #ecd58f; }
.warnkasten .dienst p { color: var(--tinte); }

/* Marken */
.marke { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--neutral-grund); color: var(--tinte); }
.marke.ok { background: var(--gut-grund); color: var(--gut-tinte); }
.marke.offen { background: var(--offen-grund); color: var(--offen-tinte); }
.marke.fehlt { background: var(--warn-grund); color: var(--warn-tinte); }
.marken { display: flex; flex-wrap: wrap; gap: 6px; }

/* Reise-Fortschritt */
.reise-zahl { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.balken { height: 14px; border-radius: 999px; background: var(--neutral-grund); overflow: hidden; }
.balken span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--tinte); }

/* Diagramme */
.diagramm { position: relative; min-height: 120px; }
.diagramm svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.diagramm text { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 12px; fill: var(--leise); }
.diagramm text.wert { fill: var(--tinte); font-weight: 700; }
.diagramm text.achse { font-size: 12px; fill: var(--leise); }
.diagramm .leer { border: 0; padding: 12px 0; }
.schwebe {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  color: #ffffff;
  background: var(--tinte);
  border-radius: 8px;
}
.schwebe.links { transform: translate(0, calc(-100% - 12px)); }
.schwebe.rechts { transform: translate(-100%, calc(-100% - 12px)); }
.schwebe b { display: block; font-variant-numeric: tabular-nums; }

/* Tabellen */
.rollbar { overflow-x: auto; }
.rollbar.hoch { max-height: 360px; overflow-y: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tabelle th, .tabelle td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: 13px; font-weight: 600; color: var(--leise); }
.tabelle .zahl { text-align: right; }
.tabelle td.ohne { color: var(--leise); }
.tabelle tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--tinte); }
.tabelle td.umbruch { overflow-wrap: anywhere; min-width: 200px; }

/* Listen: Aufnahmen, Wünsche, Texte */
.liste { display: grid; }
.tafel.liste { padding: 4px 16px; }
.tafel.liste > * + * { margin-top: 0; }
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.zeile-titel { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.zeile small { display: block; font-size: 14px; color: var(--leise); }
.zeile-taten { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.zeile-voll { grid-column: 1 / -1; }
.zeile audio { width: 100%; margin-top: 4px; }
.zeile .formular { margin-top: 0; }
@media (max-width: 560px) {
  .zeile { grid-template-columns: 1fr; }
  .zeile-taten { justify-content: flex-start; }
}
.gruppe-titel { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); padding: 14px 0 2px; }

/* Texte */
.filter { display: flex; flex-wrap: wrap; gap: 8px; }
.text-karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; margin-bottom: 10px; }
.text-karte summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; min-height: 48px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
.text-karte[open] summary { border-bottom: 1px solid var(--linie); }
.text-inhalt { padding: 14px 16px 16px; display: grid; gap: 12px; }
.text-inhalt p { max-width: 70ch; font-size: 17px; line-height: 1.6; }
.text-karte.gesperrt summary span:first-child { color: var(--leise); }

/* Wochenbericht */
.wochenwahl { display: flex; flex-wrap: wrap; gap: 8px; }
.woche-titel { font-size: 18px; font-variant-numeric: tabular-nums; }
.bericht { padding: 16px; border-radius: 12px; background: #f4f1e8; font-size: 16px; }
.bericht p { max-width: 80ch; }
.bericht p + p { margin-top: 10px; }
.druck-kopf { display: none; }

/* ChatGPT */
.code { display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 24px; font-weight: 700; letter-spacing: 0.12em; padding: 6px 12px; background: var(--neutral-grund); border-radius: 8px; user-select: all; }
.schritte { padding-left: 20px; display: grid; gap: 8px; }
.schritte a { color: var(--tinte); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Druck: nur der offene Reiter, ohne Bedienung ---------- */

@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  body.eltern { background: #ffffff; font-size: 11pt; }
  .seite { padding: 0; }
  .kopf, .reiter, .pin, .kein-druck, .knopf, .filter, .schwebe, #start-meldung, .meldung { display: none !important; }
  .feld { margin-top: 0; }
  .druck-kopf { display: block; padding-bottom: 8pt; border-bottom: 1.5pt solid #000000; }
  .druck-marke { font-size: 10pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
  .tafel, .bericht, .kachel { background: #ffffff; border-color: #888888; break-inside: avoid; }
  .bericht { border: 1px solid #888888; }
  .tabelle th, .tabelle td { border-bottom-color: #888888; }
  .tabelle th, .klein, .tabelle td.ohne { color: #333333; }
  .rollbar, .rollbar.hoch { overflow: visible; max-height: none; }
  h2 { font-size: 18pt; margin-top: 10pt; }
  a { color: inherit; text-decoration: none; }
}

/* Seite ohne Internet (offline.html) */
.ohne-netz-bild { display: block; width: 96px; height: 96px; border-radius: 24px; margin: 0 auto; }
.ohne-netz-knopf { display: block; text-align: center; text-decoration: none; margin-top: 18px; }

/* Scrollbalken sind nie sichtbar. Scrollen geht weiter mit Finger, Mausrad und Tasten. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
