/* Der Satz in einfacher Sprache (#satz). Breit: weißer Balken oben im Bild. Schmal: eigener Block zwischen Bild und Maske. */

#satz:empty { display: none; }
#satz {
  position: absolute; left: 16px; right: 16px; top: 16px; z-index: 6;
  container: satz / inline-size;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 6px 20px rgba(15, 27, 45, .07);
  color: var(--text); font-family: Manrope, system-ui, -apple-system, sans-serif;
  pointer-events: auto;
}

.satz-innen {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kopf knoepfe" "text text";
  column-gap: 12px; row-gap: 2px; align-items: center; padding: 8px 10px 10px 16px;
}

/* Kopfzeile: Pfeil, Ware, Pfeil, „1 von 4“ */
.satz-kopf { grid-area: kopf; display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; min-width: 0; margin-left: -6px; font-size: 13px; color: var(--grau); }
.satz-pfeil { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--grau); cursor: pointer; }
.satz-pfeil[aria-disabled="true"] { opacity: .3; cursor: default; }
.satz-pfeil:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--blau); }
.satz-ware { font-weight: 700; color: var(--text); padding: 0 3px; white-space: nowrap; }
.satz-zahl { margin-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.satz-status { display: inline-flex; align-items: center; gap: 5px; margin-left: 14px; color: var(--tinte); font-weight: 700; white-space: nowrap; }
.satz-status .satz-haken { color: var(--blau); }
.satz-status small { font-size: 12px; font-weight: 500; color: var(--grau); font-variant-numeric: tabular-nums; }

/* Knöpfe rechts oben */
.satz-knoepfe { grid-area: knoepfe; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.satz-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 92px; height: 30px; padding: 0 15px;
  font: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap; color: var(--tinte);
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 999px; cursor: pointer;
}
.satz-knopf.satz-ok.an { color: var(--blau); border-color: rgba(27, 102, 245, .35); background: #f3f7ff; }
.satz-knopf.satz-haupt { color: #fff; background: var(--blau); border-color: var(--blau); }
.satz-knopf[aria-disabled="true"] { color: #9aa6b6; background: var(--weiss); border-color: var(--linie); cursor: default; }
.satz-knopf.satz-haupt[aria-disabled="true"] { color: #95a2b4; background: #eef2f7; border-color: #eef2f7; }
.satz-knopf:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--weiss), 0 0 0 4px var(--blau); }

/* Der Satz */
.satz-text { grid-area: text; margin: 0; font-size: 17px; line-height: 1.45; font-weight: 500; color: var(--text); text-wrap: pretty; }
.satz-zus { white-space: nowrap; }
.satz-text b { font-weight: 700; color: var(--tinte); }
.satz-leise { color: var(--grau); }

/* Die Entscheidungen: blaue Wörter mit feiner gepunkteter Linie */
.satz-wort {
  display: inline-block; margin: 0 -2px; padding: 0 2px; border: 0; border-radius: 5px; background: transparent;
  font: inherit; font-weight: 700; line-height: inherit; color: var(--blau); cursor: pointer;
  text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: rgba(27, 102, 245, .6);
}
.satz-wort[aria-expanded="true"] { background: rgba(27, 102, 245, .08); text-decoration-color: var(--blau); }
.satz-wort:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--blau), 0 0 0 6px rgba(27, 102, 245, .18); }

/* Noch offen: „Wohin damit?“ wie mit dem Textmarker angestrichen */
.satz-wort.satz-frage {
  font-weight: 800; text-decoration: none;
  background: linear-gradient(transparent 52%, rgba(27, 102, 245, .17) 52%, rgba(27, 102, 245, .17) 94%, transparent 94%);
}

/* Andere zeigen darauf (Maske oder Bild): dieselbe Hervorhebung wie dort */
.satz-gezeigt { box-shadow: 0 0 0 2px var(--blau), 0 0 0 6px rgba(27, 102, 245, .18); }

/* Hier fehlt noch etwas (nach „Eintragen“ oder „Prüfen“ mit Fehler) */
.satz-offen { box-shadow: 0 0 0 2px var(--rot), 0 0 0 6px rgba(217, 65, 43, .16); }
.satz-anstoss { animation: satz-anstoss .9s ease-out 1; }
@keyframes satz-anstoss {
  0% { box-shadow: 0 0 0 2px var(--rot), 0 0 0 14px rgba(217, 65, 43, .28); }
  100% { box-shadow: 0 0 0 2px var(--rot), 0 0 0 6px rgba(217, 65, 43, .16); }
}

/* Drüben geändert: das Wort blitzt kurz auf */
.satz-blitz { animation: satz-blitz 1.2s ease-out 1; }
@keyframes satz-blitz {
  0%, 30% { background-color: rgba(27, 102, 245, .2); box-shadow: 0 0 0 2px var(--blau), 0 0 0 6px rgba(27, 102, 245, .18); }
  100% { background-color: rgba(27, 102, 245, 0); box-shadow: 0 0 0 2px rgba(27, 102, 245, 0), 0 0 0 6px rgba(27, 102, 245, 0); }
}

@media (hover: hover) {
  .satz-pfeil:not([aria-disabled="true"]):hover { color: var(--blau); background: #f1f5fb; }
  .satz-wort:hover { background: rgba(27, 102, 245, .08); text-decoration-color: var(--blau); }
  .satz-wort.satz-frage:hover { background: linear-gradient(transparent 52%, rgba(27, 102, 245, .26) 52%, rgba(27, 102, 245, .26) 94%, transparent 94%); }
  .satz-knopf:not([aria-disabled="true"]):hover { border-color: var(--blau); color: var(--blau); }
  .satz-knopf.satz-haupt:not([aria-disabled="true"]):hover { color: #fff; background: #1556d4; border-color: #1556d4; }
}

/* Auswahl-Fenster direkt unter dem Wort */
.satz-wahl {
  position: absolute; z-index: 10; min-width: 190px; padding: 6px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 27, 45, .14), 0 2px 6px rgba(15, 27, 45, .06);
}
.satz-wahl[hidden] { display: none; }
.satz-wahl-frage { padding: 5px 10px 4px; font-size: 12.5px; font-weight: 600; color: var(--grau); white-space: nowrap; }
.satz-antwort {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px 7px 9px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 15px; font-weight: 600; text-align: left; white-space: nowrap; color: var(--tinte); cursor: pointer;
}
.satz-antwort .satz-haken { flex: none; color: var(--blau); visibility: hidden; }
.satz-antwort[aria-selected="true"] { color: var(--blau); font-weight: 700; }
.satz-antwort[aria-selected="true"] .satz-haken { visibility: visible; }
.satz-antwort:focus-visible { outline: none; background: #f0f5ff; }
@media (hover: hover) { .satz-antwort:hover { background: #f0f5ff; color: var(--blau); } }

/* Menge: Minus, Zahl, Plus */
.satz-zaehler { display: flex; align-items: center; gap: 6px; padding: 4px 6px 6px; }
.satz-schritt {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--linie); border-radius: 10px;
  background: var(--weiss); font: inherit; font-size: 20px; font-weight: 600; line-height: 1; color: var(--tinte); cursor: pointer;
}
.satz-schritt:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--blau); }
@media (hover: hover) { .satz-schritt:hover { border-color: var(--blau); color: var(--blau); } }
.satz-zahlfeld {
  width: 64px; height: 36px; padding: 0; border: 1px solid var(--linie); border-radius: 10px; background: var(--weiss);
  font: inherit; font-size: 18px; font-weight: 700; color: var(--tinte); text-align: center; font-variant-numeric: tabular-nums;
}
.satz-zahlfeld:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(27, 102, 245, .18); }

/* Wird die 3D-Hälfte schmal, etwas kleinere Schrift, damit der Satz bei zwei Zeilen bleibt */
@container satz (max-width: 600px) {
  .satz-text { font-size: 15.5px; line-height: 1.45; }
  .satz-knopf { min-width: 0; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) { .satz-anstoss { animation: none; } }

/* Schmal (Handy): eigener Block direkt unter dem Bild, Knöpfe unter dem Satz */
@media (max-width: 960px) {
  #satz { position: relative; left: auto; right: auto; top: auto; order: -1; box-shadow: none; }
  .satz-innen { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kopf" "text" "knoepfe"; row-gap: 6px; padding: 10px 14px 14px; }
  .satz-text { font-size: 17px; line-height: 1.5; }
  .satz-pfeil { width: 34px; height: 34px; }
  .satz-knoepfe { justify-content: stretch; margin-top: 6px; }
  .satz-knopf { flex: 1; height: 42px; font-size: 15px; }
  .satz-status { flex-basis: 100%; margin: 2px 0 0 6px; }
}
