/* engine.css — Leistungstest-Engine. Alles unter .lt gekapselt, damit das
   WordPress-Theme nichts durchreicht und wir nichts nach draussen lecken. */

.lt {
  --lt-petrol: #1f3a4d;
  --lt-petrol-hell: #2f556f;
  --lt-orange: #e8730c;
  --lt-text: #1c2833;
  --lt-grau: #5d6b78;
  --lt-linie: #d4dae0;
  --lt-flaeche: #f4f6f8;
  --lt-weiss: #fff;

  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--lt-text);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
  padding: 4px;
  -webkit-text-size-adjust: 100%;
}
.lt * { box-sizing: border-box; }
.lt h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 12px; color: var(--lt-petrol); font-weight: 600; }
.lt h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--lt-petrol); font-weight: 600; }
.lt p { margin: 0 0 12px; }
.lt strong { font-weight: 600; }

/* --- Pflicht-Kennzeichnung. Steht auf JEDEM Schirm, nicht nur im Intro. --- */
.lt-hinweis {
  background: var(--lt-flaeche);
  border-left: 3px solid var(--lt-petrol);
  padding: 10px 14px;
  font-size: .84rem;
  color: var(--lt-grau);
  margin: 0 0 18px;
}

/* --- Buehne ---------------------------------------------------------------
   Die drei Ebenen liegen von Anfang an dauerhaft drin und werden NUR ueber
   visibility geschaltet. Nie einfuegen/entfernen: kein Reflow im kritischen Frame. */
.lt-buehne {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0e1418;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 16px;
  contain: layout paint;
}
.lt-ebene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.lt-kreuz { display: flex; align-items: center; justify-content: center; }
.lt-kreuz::before {
  content: "+";
  color: #e8eef2;
  font-size: 42px;
  line-height: 1;
  font-weight: 300;
}
.lt-buehne.lt-gesperrt { cursor: none; }

/* --- Kategorie-Knoepfe ----------------------------------------------------
   Immer eine Spalte, volle Breite, alle Felder gleich gross — auf jeder
   Bildschirmbreite. Zwei Gruende:
   1. Daumen-Fehlklicks sind bei Alles-oder-nichts-Wertung teuer: ein falsch
      getroffener Schalter macht das ganze Bild falsch.
   2. Die fuenf Kategorien sind gleichrangig. Ein Raster mit fuenf Feldern laesst
      zwangslaeufig eines anders aussehen — das ist eine Bedeutung, die keine ist. */
.lt-kats { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
/* Wort rechtsbuendig, Kaestchen rechts daneben — wie im Original (ATAVT). Dadurch stehen
   alle fuenf Kaestchen genau untereinander: Das Auge springt an einer Kante entlang und
   muss nicht bei jeder Zeile die Wortlaenge ablaufen. Die Zeile bleibt trotzdem 60 px
   hoch und volle Breite anklickbar — ein Fehlklick ist hier teuer. */
.lt-kat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  border: 2px solid var(--lt-linie);
  border-radius: 8px;
  background: var(--lt-weiss);
  color: var(--lt-text);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  touch-action: manipulation;    /* kein 300-ms-Delay, kein Doppeltipp-Zoom */
  transition: background .12s, border-color .12s;
}
.lt-kat:hover { border-color: var(--lt-petrol-hell); }
/* Zustand nicht nur ueber Farbe: gefuellt PLUS Haekchen. */
.lt-kat[aria-pressed="true"] {
  background: var(--lt-petrol);
  border-color: var(--lt-petrol);
  color: var(--lt-weiss);
}
.lt-haken {
  width: 24px; height: 24px; flex: 0 0 24px;
  border: 2px solid var(--lt-linie);
  border-radius: 4px;
  background: var(--lt-weiss);
  position: relative;
}
.lt-kat[aria-pressed="true"] .lt-haken { background: var(--lt-weiss); border-color: var(--lt-weiss); }
.lt-kat[aria-pressed="true"] .lt-haken::after {
  content: "";
  position: absolute; left: 6px; top: 1px;
  width: 6px; height: 12px;
  border: solid var(--lt-petrol);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.lt-kat:focus-visible { outline: 3px solid var(--lt-orange); outline-offset: 2px; }

/* Auswahl-Variante (Testlänge): gleiche Knopfform, aber zweizeilig mit Erklärung.
   Hier steht das Kästchen VOR dem Text — es ist eine Auswahl aus einer Liste, keine
   Antwort auf eine Frage. Deshalb die Spalten andersherum als oben. */
.lt-kat--wahl {
  min-height: 68px; padding: 12px 16px;
  align-items: flex-start;
  grid-template-columns: auto 1fr;
  text-align: left;
}
.lt-kat--wahl .lt-haken { margin-top: 2px; }
.lt-wahl-text { display: flex; flex-direction: column; gap: 2px; }
.lt-wahl-text small { font-size: .82rem; font-weight: 400; opacity: .78; line-height: 1.4; }

.lt-knopf:disabled { background: var(--lt-linie); color: var(--lt-grau); cursor: default; }
.lt-knopf:disabled:hover { filter: none; }

/* --- Knoepfe --- */
.lt-knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 8px;
  background: var(--lt-orange); color: var(--lt-weiss);
  font: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.lt-knopf:hover { filter: brightness(1.06); }
.lt-knopf:focus-visible { outline: 3px solid var(--lt-petrol); outline-offset: 2px; }
.lt-knopf--breit { width: 100%; }
.lt-knopf--still { background: transparent; color: var(--lt-petrol); border: 2px solid var(--lt-linie); }
.lt-knopf--still:hover { border-color: var(--lt-petrol); filter: none; }

/* "Weiter" in der Daumenzone. Immer aktiv — auch bei null Auswahl:
   die leere Menge ist eine korrekte Antwort. */
.lt-weiter { position: sticky; bottom: 8px; z-index: 5; width: 100%; }

/* Der Abwähl-Hinweis steht im Original mit auf dem Schirm. Ruhig gesetzt: Er richtet
   sich an die wenigen, die danebengetippt haben, und darf den anderen nicht im Weg
   stehen. */
.lt-abwaehl {
  font-size: .84rem;
  color: var(--lt-grau);
  text-align: center;
  margin: -6px 0 16px;
}

/* Übungs-Kenntlichmachung, geteilt von allen Tests (Test 3 und 4 tragen eigene, gleich
   aussehende Klassen). Ein deutlicher grüner Streifen ÜBER der Aufgabe sagt, dass es noch
   die Übung ist — nicht nur klein in der Kopfzeile, die man mitten in der Aufgabe nicht
   liest (Martin, 21.07.). */
.lt-uebungsband {
  background: #2f9e44; color: #fff; border-radius: 6px;
  padding: 9px 14px; margin: 0 0 14px;
  font-size: .9rem; text-align: center; line-height: 1.4;
}
.lt-uebungsband strong { font-weight: 700; }

/* Der Übergang von Übung zu Test: ein farbiger Balken oben signalisiert den Wechsel, bevor
   man den Text liest — grün (Übung) läuft in Petrol (Test). */
.lt-uebergang {
  height: 6px; border-radius: 3px; margin: 0 0 18px;
  background: linear-gradient(90deg, #2f9e44 0 50%, var(--lt-petrol) 50% 100%);
}

/* 3 – 2 – 1 – Start vor dem ersten Reiz: groß und mittig, damit klar ist, wann die Uhr
   losläuft (Martin, 21.07.). Geteilt; Test 3 und 4 tragen eigene, gleich aussehende. */
.lt-countdown {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; margin: 12px 0; letter-spacing: 1px;
  font: 700 84px/1 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--lt-petrol);
}
.lt-countdown--start { color: #2f9e44; font-size: 60px; }

/* Beispielbild/-grafik auf dem Intro: ein bündiges, gerundetes Vorschaubild mit Bildunterschrift.
   Begrenzt in der Höhe, damit es Vorschau bleibt und den Text nicht wegdrückt. */
.lt-beispiel { margin: 4px 0 16px; text-align: center; }
.lt-beispielbild {
  display: block; margin: 0 auto; max-width: 100%; max-height: 260px;
  width: auto; height: auto; border-radius: 10px;
  border: 1px solid var(--lt-linie, #e3e6ea); box-shadow: 0 3px 10px rgba(0,0,0,.10);
}
.lt-beispiel-text {
  margin: 8px 0 0; font-size: .84rem; line-height: 1.45; color: var(--lt-grau);
}

/* Im Original sitzt "Next" klein unten rechts, abgesetzt durch eine Linie. Auf dem Handy
   wäre genau dort die schlechteste Stelle — deshalb erst ab 560 px. Darunter bleibt der
   Knopf über die volle Breite in der Daumenzone. */
.lt-weiterzeile { display: flex; }
@media (min-width: 560px) {
  .lt-weiterzeile {
    justify-content: flex-end;
    border-top: 1px solid var(--lt-linie);
    padding-top: 12px;
    margin-top: 4px;
  }
  .lt-weiterzeile .lt-weiter { width: auto; min-width: 160px; position: static; }
}

/* --- Fortschritt --- */
.lt-kopf {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .84rem; color: var(--lt-grau); margin: 0 0 8px;
}
.lt-balken { height: 4px; background: var(--lt-linie); border-radius: 2px; overflow: hidden; margin: 0 0 14px; }
.lt-balken > i { display: block; height: 100%; background: var(--lt-petrol); transition: width .25s; }

/* --- Rueckmeldung in der Uebung --- */
.lt-feedback { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; font-size: .92rem; }
.lt-feedback--gut { background: #eaf4ee; border-left: 3px solid #2f7d4f; }
.lt-feedback--daneben { background: #fdf1e7; border-left: 3px solid var(--lt-orange); }
.lt-feedback ul { margin: 6px 0 0; padding-left: 18px; }

/* --- Ergebnis --- */
.lt-zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.lt-zahl { background: var(--lt-flaeche); border-radius: 8px; padding: 14px; }
.lt-zahl b { display: block; font-size: 1.6rem; font-weight: 600; color: var(--lt-petrol); line-height: 1.15; }
/* Titel und Untertitel je auf eigene Zeile. Vorher waren beide inline und klebten ohne
   Leerzeichen aneinander ("Leistungsmenge18 von ~25 …") — Martin, 21.07. */
.lt-zahl span { display: block; margin-top: 2px; font-size: .8rem; color: var(--lt-grau); }
.lt-zahl small { display: block; margin-top: 3px; font-size: .72rem; line-height: 1.35; color: var(--lt-grau); opacity: .9; }
.lt-profil { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 18px; }
.lt-profil th, .lt-profil td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--lt-linie); }
.lt-profil th { color: var(--lt-grau); font-weight: 500; font-size: .8rem; }
/* Zahlenspalten: Kopf UND Zelle rechtsbuendig. Standen sie unterschiedlich, klebte die
   Ueberschrift links und die Zahl rechts - sie schienen nicht zusammenzugehoeren. */
.lt-profil th:not(:first-child),
.lt-profil td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.lt-verlauf { width: 100%; height: 90px; display: block; margin: 0 0 18px; }

/* --- QA-Modus (?qa=1) — nie fuer Nutzer sichtbar --- */
.lt-qa {
  position: fixed; right: 8px; top: 8px; z-index: 9999;
  background: rgba(12, 18, 24, .92); color: #7dffa5;
  font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
  padding: 8px 10px; border-radius: 6px; white-space: pre; pointer-events: none;
  max-width: 45vw;
}
.lt-qa .warn { color: #ffb44d; }
.lt-qa .fehl { color: #ff7a7a; }

.lt-schirm[hidden] { display: none; }
.lt-fuss { font-size: .84rem; color: var(--lt-grau); margin-top: 22px; }
.lt-fuss a { color: var(--lt-petrol); }

@media (min-width: 560px) {
  .lt { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .lt * { transition: none !important; }
}
