/* Fische der Adria — Lichtenfels-CI.

   Dieselben Farben und dieselbe Schrift wie der offizielle Skin in TeacherOS
   (Thema „lichtenfels"): CI-Blau #40679f auf hellem Grund, Corbel, kleine
   Radien, der sechsfarbige Schul-Trenner unter dem Kopf.

   Gelernt wird am Handy, oft zu zweit auf einem Display und im Freien.
   Also: grosse Tippziele (ab 44 px), hoher Kontrast, das Foto so gross wie
   moeglich, und nie mehr als ein Knopf, der gerade wichtig ist.            */

:root {
  --ci:        #40679f;   /* Lichtenfels-Blau */
  --ci-hell:   #5b8ac7;
  --ci-weich:  #eef2f8;
  --text:      #2b3040;
  --dim:       #5a6178;
  --faint:     #8b92a6;
  --linie:     #dfe4ec;
  --karte:     #ffffff;
  --bg:        #f6f8fb;
  --gut:       #46801f;
  --warn:      #b05f26;
  --radius:    4px;
  --schatten:  0 1px 2px rgba(43,48,64,.08), 0 1px 6px rgba(43,48,64,.05);
  --font: Corbel, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; min-height: 100vh;
  min-height: 100dvh;
}
button { font: inherit; }
img { display: block; }

/* ----------------------------------------------------------------- Kopf */
/* Klebt — aus dem Kartenstapel muss man jederzeit zurueck (Aussenstellen-Standard). */
.kopf {
  position: sticky; top: 0; z-index: 20; background: var(--karte);
  padding: 8px 14px 0; padding-top: calc(8px + env(safe-area-inset-top));
  box-shadow: var(--schatten);
}
/* Der sechsfarbige Trenner der Schule — dasselbe Band wie auf den Ausdrucken. */
.kopf::after {
  content: ""; display: block; height: 3px; margin: 8px -14px 0;
  background: linear-gradient(90deg, #b488a6 0 16.6%, #af7875 0 33.3%, #7c84a4 0 50%,
                              #9ab6d9 0 66.6%, #96a4a9 0 83.3%, #eccd84 0 100%);
}
.kopf-innen { display: flex; align-items: center; gap: 10px; }
/* Die Bildmarke ist breit. Feste Breite UND Hoehe quetschen sie — deshalb
   nur die Hoehe setzen und die Breite rechnen lassen. */
.kopf-logo { height: 34px; width: auto; flex: none; cursor: pointer; }
.kopf-titel { display: flex; flex-direction: column; min-width: 0; }
.kopf-titel b { font-size: 17px; letter-spacing: .01em; }
.kopf-titel span {
  font-size: 11.5px; color: var(--dim); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.reiter { display: flex; gap: 2px; margin-top: 8px; }
.reiter button {
  flex: 1; font-size: 14px; padding: 11px 12px; border: 0; background: none;
  cursor: pointer; color: var(--dim); border-bottom: 2.5px solid transparent;
}
.reiter button.an { color: var(--ci); border-bottom-color: var(--ci); font-weight: 600; }

/* ---------------------------------------------------------------- Rumpf */
main { flex: 1; padding: 14px; max-width: 900px; width: 100%; margin: 0 auto; }
section[hidden] { display: none; }

.hinweis { margin: 0 2px 14px; font-size: 13.5px; color: var(--dim); }

/* ---------------------------------------------------------- Durchschauen */
.gitter {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.fisch {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten);
  display: flex; flex-direction: column;
}
/* Das Bild ist der Knopf. Die Fotos haben leicht verschiedene Seiten-
   verhaeltnisse (322x238 bis 343x259). Sie stehen in einem einheitlichen
   Feld, aber `contain` statt `cover`: so bleibt jedes Foto VOLLSTAENDIG —
   genau wie auf dem Blatt der Kinder, wo die Kacheln ja auch verschieden
   hoch in einem gleichmaessigen Raster sitzen. `cover` wuerde die breiteren
   Fotos an den Seiten anschneiden, und dann fehlt womoeglich genau die
   Flosse, an der man den Fisch erkennt. */
.fisch-bild {
  position: relative;
  border: 0; padding: 0; background: none; cursor: pointer; display: block;
  width: 100%;
}
.fisch-bild img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: var(--ci-weich);
}
.fisch-fuss {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px 8px 10px;
  /* Namen unten buendig, auch wenn einer davon zweizeilig wird. */
  margin-top: auto;
}
.fisch-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.25; flex: 1;
}
/* Das i ist ein eigenes Tippziel neben dem Namen, keine Schaltflaeche im Bild:
   im Bild haette es entweder den Fisch verdeckt oder waere zu klein geworden. */
.info-knopf {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--linie); background: var(--karte); color: var(--ci);
  font: italic 600 16px/1 var(--font); cursor: pointer;
}
.info-knopf:hover { border-color: var(--ci-hell); background: var(--ci-weich); }

/* -------------------------------------------------------- Karteikärtchen */
.stapel-kopf {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.fortschritt { font-size: 13.5px; color: var(--dim); }
.knopf-still {
  margin-left: auto; font-size: 13px; color: var(--dim);
  background: none; border: 0; cursor: pointer; padding: 8px 4px;
}
.knopf-still:hover { color: var(--ci); }

.karte-buehne { margin-bottom: 12px; }
.kartenfoto { position: relative; }
.kartenfoto { display: block; width: 100%; padding: 0; border: 0; cursor: pointer; }
.zoom-symbol, .zoom-label { position: absolute; right: 8px; bottom: 8px; background: white; color: #2b3040; border-radius: 3px; box-shadow: 0 1px 6px #0002; line-height: 1.2; }
.zoom-symbol { width: 27px; height: 27px; font-size: 24px; text-align: center; }
.zoom-label { padding: 7px 10px; font-size: 12px; }
[hidden] { display: none !important; }
.ladestatus { font-size: 13px; padding: 16px 20px; margin: 0; color: var(--dim); background: var(--ci-weich); }
.bildnummer { position: absolute; top: 8px; left: 8px; min-width: 26px; padding: 2px 6px; border-radius: 3px; background: #fff; color: #2b3040; font-size: 12px; font-weight: 700; }
.quellenlink { color: #40679f; font-size: 12px; display: inline-block; padding: 5px 0; }
#ffQuelle, #karteQuelle { display: block; width: fit-content; }
#ffNotiz, #karteNotiz { font-size: 12px; color: #5a6178; }
/* `display` schlaegt das hidden-Attribut — ohne diese zwei Zeilen blieben
   Buehne und Knoepfe sichtbar, wenn der Stapel durch ist. */
.karte-buehne[hidden], .karte-knoepfe[hidden] { display: none; }
.karte {
  margin: 0; background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten);
}
/* Wie im Gitter: vollstaendiges Foto in einem festen Feld. Fest deshalb,
   weil sonst mit jedem Kaertchen die Knoepfe darunter verrutschen — man
   tippt beim schnellen Durchgehen daneben. */
.karte img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: var(--ci-weich);
}
.karte-antwort { padding: 12px 14px 14px; border-top: 3px solid var(--ci); }
.karte-antwort[hidden] { display: none; }
.karte-antwort b { display: block; font-size: 22px; line-height: 1.2; }
.karte-antwort i { display: block; font-size: 13px; color: var(--faint); margin-top: 2px; }
.karte-antwort p { margin: 9px 0 0; font-size: 14.5px; color: var(--dim); }

.karte-knoepfe { display: flex; flex-direction: column; gap: 10px; }
.knopf {
  font-size: 15px; padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid var(--ci); background: var(--ci); color: #fff; cursor: pointer;
}
.knopf:hover { background: var(--ci-hell); border-color: var(--ci-hell); }
.knopf.gross { width: 100%; padding: 15px; font-size: 17px; }
.wertung { display: flex; gap: 10px; }
.wertung[hidden] { display: none; }
.wertung .knopf { flex: 1; padding: 15px 10px; font-size: 16px; }
.knopf.gewusst { background: var(--gut); border-color: var(--gut); }
.knopf.gewusst:hover { background: #55952a; border-color: #55952a; }
.knopf.nochmal { background: var(--karte); color: var(--warn); border-color: var(--warn); }
.knopf.nochmal:hover { background: #fbf2ea; }

.fertig { text-align: center; padding: 22px 10px 8px; }
.fertig[hidden] { display: none; }
.fertig-gross { font-size: 18px; margin: 0 0 18px; }

/* -------------------------------------------------------------- Fenster */
dialog {
  border: 0; border-radius: var(--radius); padding: 0; color: var(--text);
  box-shadow: 0 8px 40px rgba(43,48,64,.28); max-width: 92vw;
}
dialog::backdrop { background: rgba(43,48,64,.55); }

.fischschau { width: 1000px; overflow: auto; max-height: calc(100dvh - 28px); }
/* Hier hat das Foto die Buehne fuer sich — also seine eigene Hoehe, ohne
   Feld und ohne Rand drumherum. */
.fischschau img { width: 100%; height: auto; max-height: 65dvh; object-fit: contain; background: var(--ci-weich); }
.ff-text { padding: 14px 16px 4px; }
.ff-text b { display: block; font-size: 21px; line-height: 1.2; }
.ff-text i { display: block; font-size: 13px; color: var(--faint); margin-top: 2px; }
.ff-text p { margin: 9px 0 0; font-size: 15px; color: var(--dim); }
.fischschau .knopf { margin: 14px 16px 16px; }

.logoschau { width: 420px; text-align: center; padding: 16px; }
.logoschau img { width: 100%; height: auto; border-radius: var(--radius); }
.logoschau p { margin: 10px 0 0; font-size: 12.5px; color: var(--dim); }

.os-fenster { width: 400px; padding: 18px 20px 6px; }
.os-fenster h2 { margin: 0 0 10px; font-size: 18px; color: var(--ci); }
.os-fenster p { margin: 0 0 10px; font-size: 14px; color: var(--dim); }
.os-eigentum { font-size: 12.5px !important; color: var(--faint) !important; }
.os-fenster .knopf { margin-bottom: 14px; }

/* --------------------------------------------------------------- Fusszeile */
footer {
  padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
  text-align: center; border-top: 1px solid var(--linie); background: var(--karte);
}
footer p { margin: 0 0 5px; font-size: 12px; color: var(--faint); }
/* Der Bildnachweis darf leise sein, aber lesbar — nicht auf Graufleck. */
.fuss-bild {
  margin: 10px auto !important; padding-top: 10px; max-width: 30em;
  border-top: 1px solid var(--linie); color: var(--dim) !important;
  line-height: 1.5;
}
.fuss-bild span { color: var(--faint); }
.bildnachweis {
  margin: 10px 0 0 !important; font-size: 11.5px !important;
  color: var(--faint) !important; line-height: 1.4;
}
.teacheros-hinweis {
  background: none; border: 0; cursor: pointer; font-size: 11.5px;
  color: var(--faint); text-decoration: underline dotted; padding: 4px;
}
.teacheros-hinweis:hover { color: var(--ci); }
/* Shopseite und Impressum: so leise wie der Hinweis darueber. */
.fuss-os-links { font-size: 11px !important; }
.fuss-os-links a { color: var(--faint); text-decoration: underline dotted; padding: 4px; }
.fuss-os-links a:hover { color: var(--ci); }
.os-fenster a { color: var(--ci); }
/* „Bereitgestellt von Salbright“ – gemeinsamer Absender der Lichtenfels Apps
   (brand/salbright/lichtenfels-v1, wie auf lichtenfels.app): klein und leise. */
.fuss-marke { margin: 10px 0 0 !important; }
.fuss-marke a { display: inline-block; padding: 3px; opacity: .5; transition: opacity .15s; }
.fuss-marke a:hover, .fuss-marke a:focus-visible { opacity: 1; }
.fuss-marke img { display: block; width: 80px; height: auto; }

/* ------------------------------------------------------------ Am Rechner */
@media (min-width: 560px) {
  .karte-buehne { display: flex; justify-content: center; }
  .karte { width: 100%; max-width: 560px; }
  .karte-knoepfe { max-width: 560px; margin: 0 auto; width: 100%; }
  .fertig-gross { font-size: 20px; }
}

/* Weniger Bewegung, wenn das Geraet danach fragt. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
