/* uebersetzen.css — der Übersetzungstrainer (SPIEL-10), uebersetzen.html.

   Drei Spalten auf einer eigenen Seite: links die eigene Übersetzung,
   in der Mitte der Text, rechts das Vokabelblatt. Die Grundfarben kommen aus
   style.css; die Kulisse (body::before) bleibt aus - hier wird gelesen und
   geschrieben, dafür braucht es keine Bühne, genau wie auf den Kontoseiten. */

body.uebersetzen-seite::before {
  content: none;
}

body.uebersetzen-seite {
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}

#uebersetzen-kopf {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 4px 6px;
}

#uebersetzen-kopf h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #ffd23f;
}

.uebersetzen-zurueck {
  color: #9a9aa8;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.uebersetzen-zurueck:hover {
  text-decoration: underline;
}

#uebersetzen-seite {
  max-width: 1500px;
  margin: 0 auto;
}

/* --- Leiste: Textwahl und Knöpfe ---------------------------------------- */

#uebersetzen-leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 12px;
  background: rgba(22, 22, 29, 0.95);
  border: 1px solid #2c2c36;
  border-radius: 6px;
}

#text-wahl-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
  color: #9090a4;
  font-size: 0.9rem;
}

#text-wahl {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #3a3a46;
  background: #1b1b24;
  color: #e0e0e6;
  font-size: 0.95rem;
}

#uebersetzen-knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#uebersetzen-knoepfe button {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #4a4a58;
  background: #20202a;
  color: #e0e0e6;
  cursor: pointer;
}

#uebersetzen-knoepfe button:hover {
  background: #2a2a38;
  border-color: #ffd23f;
}

#pruefen-knopf {
  border-color: #e8d5a0;
  color: #e8d5a0;
  font-weight: bold;
}

#vokabeln-schalter[aria-pressed="true"] {
  border-color: #4da6ff;
  color: #e0e0e6;
}

#vokabeln-schalter[aria-pressed="false"] {
  color: #7a7a88;
}

#leeren-knopf.nachfrage {
  border-color: #ff5a5a;
  color: #ff5a5a;
}

#uebersetzen-status {
  margin: 8px 4px;
}

#uebersetzen-status.fehler {
  color: #ff5a5a;
}

/* --- Gesamtergebnis ------------------------------------------------------ */

#uebersetzen-ergebnis {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #3a3a46;
  background: #16161d;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

#uebersetzen-ergebnis .ergebnis-gesamt {
  font-size: 1.3rem;
  font-weight: bold;
}

#uebersetzen-ergebnis .ergebnis-text {
  color: #c0c0cc;
}

#uebersetzen-ergebnis .hinweis {
  flex-basis: 100%;
}

/* --- Die drei Spalten ----------------------------------------------------- */

#uebersetzen-spalten {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.85fr;
  gap: 12px;
  margin-top: 8px;
  align-items: start;
}

#uebersetzen-spalten.ohne-vokabeln {
  grid-template-columns: 1.15fr 1fr;
}

#uebersetzen-spalten.ohne-vokabeln #spalte-vokabeln {
  display: none;
}

.uebersetzen-spalte {
  background: rgba(22, 22, 29, 0.95);
  border: 1px solid #2c2c36;
  border-radius: 6px;
  padding: 12px 14px;
  /* Jede Spalte scrollt für sich: der Text bleibt neben den Eingaben
     stehen, auch wenn man beim fünfzehnten Satz ist. */
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
}

.uebersetzen-spalte h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9090a4;
}

#text-titel {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.1rem;
  color: #ffd23f;
}

.uebersetzen-spalte > .hinweis {
  margin-bottom: 10px;
}

/* Satznummer - in allen drei Spalten dieselbe Marke, damit das Auge die
   Zeile wiederfindet. */
.satz-nr {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  margin-right: 6px;
  border-radius: 10px;
  background: #2a2a38;
  color: #ffd23f;
  font-size: 0.75rem;
  font-weight: bold;
  text-align: center;
  line-height: 1.5;
  vertical-align: middle;
}

/* --- Mitte: der Text ------------------------------------------------------ */

.text-satz {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 1.02rem;
  color: #e6e6ec;
  border-left: 3px solid transparent;
  padding-left: 8px;
}

.text-satz .satz-nr {
  cursor: pointer;
}

.text-satz.gut { border-left-color: #5ed36e; }
.text-satz.fast { border-left-color: #ffd23f; }
.text-satz.daneben { border-left-color: #ff5a5a; }

.text-wort {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 1px;
}

.text-wort:hover {
  background: #2a2a38;
}

.text-wort.hervorgehoben {
  background: #3a3520;
  color: #ffd23f;
}

.text-wort.ohne-vokabel {
  cursor: default;
}

/* --- Links: die Eingaben ------------------------------------------------- */

.eingabe-block {
  margin-bottom: 10px;
  padding: 8px 8px 8px 10px;
  border-left: 3px solid #2c2c36;
  border-radius: 4px;
  background: #14141b;
}

.eingabe-block.gut { border-left-color: #5ed36e; }
.eingabe-block.fast { border-left-color: #ffd23f; }
.eingabe-block.daneben { border-left-color: #ff5a5a; }
.eingabe-block.leer { border-left-color: #4a4a58; }

.eingabe-kopf {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #9090a4;
}

.eingabe-kopf .eingabe-latein {
  flex: 1;
  color: #7a7a88;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eingabe-kopf .loesung-knopf {
  background: none;
  border: 1px solid transparent;
  color: #7a7a88;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.95rem;
}

.eingabe-kopf .loesung-knopf:hover {
  border-color: #4a4a58;
  color: #ffd23f;
}

.eingabe-block textarea {
  width: 100%;
  min-height: 2.6em;
  padding: 7px 9px;
  border-radius: 5px;
  border: 1px solid #3a3a46;
  background: #1b1b24;
  color: #f0f0f5;
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
}

.eingabe-block textarea:focus {
  outline: 2px solid #ffd23f;
  outline-offset: 1px;
}

.eingabe-ergebnis {
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #b8b8c4;
}

.prozent {
  display: inline-block;
  min-width: 3.4em;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: bold;
  text-align: center;
  font-size: 0.8rem;
  margin-right: 6px;
  color: #0d0d12;
  background: #4a4a58;
}

.prozent.gut { background: #5ed36e; }
.prozent.fast { background: #ffd23f; }
.prozent.daneben { background: #ff5a5a; color: #fff; }
.prozent.leer { background: #4a4a58; color: #e0e0e6; }

.eingabe-ergebnis .musterloesung {
  color: #e6e6ec;
}

.eingabe-ergebnis .auch-moeglich {
  color: #8a8a9b;
}

.eingabe-ergebnis .diff-fehlt {
  color: #ff9a9a;
}

.eingabe-ergebnis .diff-zuviel {
  color: #f0c060;
}

/* --- Rechts: das Vokabelblatt ------------------------------------------- */

.vokabel {
  padding: 5px 4px;
  border-bottom: 1px solid #23232c;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.vokabel:hover {
  background: #1b1b24;
}

.vokabel.hervorgehoben {
  background: #3a3520;
}

.vokabel-kopf {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.vokabel-lemma {
  color: #e0e0e6;
}

.vokabel-form {
  color: #7a7a88;
  font-size: 0.82rem;
}

.vokabel-de {
  color: #9b9ba9;
  text-align: right;
}

.vokabel-im-text {
  color: #6a6a78;
  font-size: 0.78rem;
  font-style: italic;
}

#vokabel-unbekannt {
  margin-top: 10px;
}

/* --- Schmale Bildschirme: untereinander, Text zuerst -------------------- */

@media (max-width: 980px) {
  #uebersetzen-spalten,
  #uebersetzen-spalten.ohne-vokabeln {
    grid-template-columns: 1fr;
  }

  .uebersetzen-spalte {
    position: static;
    max-height: none;
    overflow: visible;
  }

  #spalte-text { order: 1; }
  #spalte-eingabe { order: 2; }
  #spalte-vokabeln { order: 3; }

  #uebersetzen-kopf {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
}
