/* Ergänzungen zu Pico (classless, Jade). Farben immer über Pico-Variablen,
   damit Hell- und Dunkelmodus automatisch passen. */

@font-face {
  font-family: "Andika";
  src: url("../fonts/Andika-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Andika";
  src: url("../fonts/Andika-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --pico-font-family: "Andika", var(--pico-font-family-sans-serif);
}

/* --- Kopfzeile ------------------------------------------------------------ */

body > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
  padding-bottom: 0;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--pico-color);
}

.logo span {
  color: var(--pico-primary);
  margin-left: 0.1em;
}

/* --- Übersichten ---------------------------------------------------------- */

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}

.kachel {
  text-decoration: none;
}

.kachel article {
  margin: 0;
  height: 100%;
  text-align: center;
  font-size: 1.4rem;
  transition: transform 0.1s;
}

.kachel:hover article {
  transform: translateY(-2px);
}

.kachel-icon {
  display: block;
  font-size: 3rem;
}

.uebung {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.uebung h3 {
  margin-bottom: 0.25rem;
}

.uebung p {
  margin-bottom: 0.5rem;
}

.ok {
  color: var(--pico-primary);
}

.woche {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.woche span {
  display: inline-block;
  min-width: 2.1em;
  padding: 0.1em 0.3em;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 1em;
  font-size: 0.75rem;
  text-align: center;
  color: var(--pico-muted-color);
}

.woche .erledigt {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}

.woche .heute {
  border-color: var(--pico-primary);
  font-weight: 700;
}

.start footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.start footer button {
  margin: 0;
}

.ergebnis-zahl {
  font-size: 1.5rem;
}

/* --- Übungsbildschirm ----------------------------------------------------- */

.sitzung {
  /* Pico setzt --pico-color in Buttons auf Weiß um; hier die normale Textfarbe merken. */
  --textfarbe: var(--pico-color);
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
           max(0.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--pico-background-color);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sitzung-kopf,
.sitzung-fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--pico-muted-color);
}

.sitzung-kopf {
  font-size: 1.15rem;
}

.sitzung progress {
  margin: 0.5rem 0 0;
}

.sitzung-kopf button,
.sitzung-fuss button,
.sitzung dialog .weiterueben {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.9rem;
  background: transparent;
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
}

.sitzung-fuss button:disabled {
  visibility: hidden;
}

.hinweis {
  font-size: 0.9rem;
}

.buehne {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  color: var(--pico-color);
  line-height: 1.1;
  text-align: center;
}

.riesig {
  font-size: clamp(6rem, 32vmin, 16rem);
}

.gross {
  font-size: clamp(3rem, 13vmin, 7rem);
}

.satz {
  font-size: clamp(2.4rem, 10vmin, 5.5rem);
}

.lernwort {
  color: var(--pico-muted-color);
}

.bild {
  font-size: 1.25em;
  font-family: var(--pico-font-family-emoji);
}

.rutsche {
  width: min(92vw, 34rem, 75vh);
  color: var(--pico-muted-color);
}

.rutsche-buchstabe {
  font-family: var(--pico-font-family);
  font-size: 58px;
  fill: var(--pico-color);
  transition: opacity 0.2s;
}

.rutsche-wort {
  margin-top: 0.25em;
  transition: opacity 0.2s;
}

.versteckt {
  opacity: 0;
}

.sitzung dialog {
  cursor: default;
}

.sitzung dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.sitzung dialog .fertig {
  width: auto;
  margin: 0;
}

/* --- Mathe: Punkte zählen ------------------------------------------------- */

.sitzung.interaktiv {
  cursor: default;
}

.punktebild {
  width: min(88vw, 26rem);
  max-height: 42vh;
  margin-bottom: 1.5rem;
}

.punktebild .rahmen {
  fill: none;
  stroke: var(--pico-muted-border-color);
  stroke-width: 4;
}

.punktebild .punkt {
  fill: var(--pico-primary);
}

.zahlknoepfe {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  width: min(92vw, 30rem);
}

.zahlknoepfe.zwei-reihen {
  grid-template-columns: repeat(5, 1fr);
}

.zahlknoepfe button {
  width: 100%;
  margin: 0;
  padding: 0.4em 0;
  font-size: clamp(1.6rem, 6vmin, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  background: var(--pico-card-background-color);
  border: 2px solid var(--pico-muted-border-color);
  color: var(--textfarbe);
}

.zahlknoepfe button:disabled {
  opacity: 1;
}

.zahlknoepfe button.richtig {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}

.zahlknoepfe button.falsch {
  border-color: var(--pico-del-color);
  color: var(--pico-del-color);
  opacity: 0.45;
  animation: wackeln 0.35s;
}

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

@media (prefers-reduced-motion: reduce) {
  .zahlknoepfe button.falsch {
    animation: none;
  }
}
