/* kommaretter/styles.css
   Komma-Retter - Zeichensetzung üben (MS St. Andrä, jupi)
   Standard: GUI 3.13 Typ 2 (kleines Lernspiel), PWA 6.1 autark

   EIGENE SPIELOPTIK seit 27.10.2026 (AGENTS.md 3.13.6 / 3.13.7):
   Welt = "Korrektur-Schreibtisch einer kleinen Setzerei".
   - Kulisse: kulisse.svg, EINE gestreckte Szene (Setzkasten-Regal links,
     hängende Korrekturfahnen in der Mitte, Pinnwand rechts, Werkbank unten).
     Generator: .zcode/kommaretter-kulisse.cjs
   - Leiste: Bleisatz-Konsole aus Graphit mit Messingkante (drei Zonen bleiben).
   - Bühne: Satzspiegel-Blatt (Korrekturfahne) auf der Werkbank, kein weißer Kasten.
   - HUD: Punktezettel ("Setzkasten"-Etikett), Aufgabe auf der Fahne,
     Ergebnis als Korrekturbogen, Hilfe als Handbuch-Blatt.
   - Dark Mode = Abendlicht über dem Schreibtisch: Kulisse gedimmt, Lampe an,
     Papiere bleiben hell (Muster Fake-News/Zelllabor).

   Alle Regeln hängen an body.jupi.kr_body, damit sie nur dieses Spiel treffen.
   Die Paket-Kopie jupi.css wird NICHT verändert, nur überschrieben. */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- Materialwerte der Setzerei ---------- */
body.jupi.kr_body {
  --kr-tinte: #232a30;
  --kr-tinte-soft: #4a4235;
  --kr-papier: #f7f0dd;
  --kr-papier-hell: #fdf8ec;
  --kr-kraft: #e8dabc;
  --kr-rot: #a8281f;
  --kr-rot-hell: #c9483c;
  --kr-gruen: #2f6b46;
  --kr-graphit: #2e3338;
  --kr-graphit-2: #1d2126;
  --kr-messing: #b08a3e;
  --kr-messing-hell: #d8b978;
  --kr-holz: #6d4c31;
  --kr-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --kr-mono: "Courier New", ui-monospace, "Consolas", monospace;

  /* Seite: EINE Szene, gestreckt, kein Kachelmuster (3.13.7 Weg A) */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background-color: #c9b795;
  background-image: url("kulisse.svg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
  color: var(--kr-tinte);
  overflow-x: hidden;
}

/* Dark Mode: dieselbe Welt bei Nacht - Kulisse gedimmt, Lampe über dem Tisch an */
html[data-theme="dark"] body.jupi.kr_body {
  background-color: #201914;
  background-image:
    radial-gradient(1150px 640px at 50% -6%, rgba(255,196,104,0.42), rgba(255,196,104,0) 62%),
    radial-gradient(900px 520px at 50% 88%, rgba(255,182,86,0.22), rgba(255,182,86,0) 66%),
    linear-gradient(180deg, rgba(22,14,9,0.44) 0%, rgba(20,13,8,0.58) 55%, rgba(16,11,7,0.72) 100%),
    url("kulisse.svg");
  background-size: cover, cover, cover, cover;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: center top, center bottom, center top, center top;
  background-attachment: fixed, fixed, fixed, fixed;
  color: #f2e8d5;
}

/* ---------- Gerüst: Leiste oben, Fuß unten (3.13.2a) ---------- */
body.jupi.kr_body .jupi_container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}
body.jupi.kr_body .jupi_main {
  flex: 1 0 auto;
  grid-area: auto;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.9rem clamp(0.7rem, 2vw, 1.6rem) 1.4rem;
  background: transparent;
  min-width: 0;
}
body.jupi.kr_body .koma_footer { margin-top: auto; }

/* ---------- JUPI-Leiste im Spielmaterial: Bleisatz-Konsole ---------- */
body.jupi.kr_body .koma_header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.9rem;
  min-height: 58px;
  margin: 0;
  padding: 0.4rem clamp(0.7rem, 1.6vw, 1.15rem);
  border: 0;
  border-bottom: 3px solid var(--kr-messing);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 2px, rgba(255,255,255,0) 2px 27px),
    linear-gradient(180deg, #3d454b 0%, #2c3237 52%, #232830 100%);
  color: #f6edd9;
  box-shadow: 0 6px 22px rgba(20,14,8,0.34), inset 0 1px 0 rgba(255,255,255,0.10);
}
body.jupi.kr_body .koma_header .jupi_nav_back {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.4rem 0.95rem;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf6, #f1e7d1);
  color: #2a2f34;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 2px 9px rgba(0,0,0,0.34), inset 0 -2px 0 rgba(90,70,40,0.10);
}
body.jupi.kr_body .koma_header .jupi_nav_back:hover,
body.jupi.kr_body .koma_header .jupi_nav_back:focus-visible {
  background: #ffffff;
  color: #1b2228;
}
body.jupi.kr_body .koma_brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
body.jupi.kr_body .koma_brand img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--kr-papier-hell);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 0 0 2px rgba(216,185,120,0.55);
}
body.jupi.kr_body .koma_brand h1 {
  margin: 0;
  font-family: var(--kr-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fbf3e0;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
body.jupi.kr_body .koma_header .jupi_werkzeuge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}
body.jupi.kr_body .koma_header #jupi_sprachen_wahl { flex: 0 0 auto; }
body.jupi.kr_body .koma_header .jupi_sprachen_select {
  width: auto;
  max-width: 11rem;
  min-height: 40px;
  padding: 0.3rem 0.55rem;
  border: 1px solid #ffffff;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf6, #f1e7d1);
  color: #242a30;
  font-size: 0.86rem;
  font-weight: 700;
}
body.jupi.kr_body .koma_header #jupi_theme_toggle {
  min-height: 40px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
body.jupi.kr_body .koma_header #jupi_theme_toggle:hover { background: rgba(255,255,255,0.26); }
body.jupi.kr_body .koma_header #jupi_theme_toggle .jts_thumb {
  background: #fdf6e6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
body.jupi.kr_body .koma_header :focus-visible {
  outline: 3px solid #ffd88a;
  outline-offset: 2px;
}
html[data-theme="dark"] body.jupi.kr_body .koma_header {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 2px, rgba(255,255,255,0) 2px 27px),
    linear-gradient(180deg, #262b30 0%, #1a1e22 55%, #12161a 100%);
  border-bottom-color: #8a6a2c;
}

/* Drei Zonen exakt: Zurück links, Logo+Name in der Mitte, Werkzeuge rechts */
@media (min-width: 641px) {
  body.jupi.kr_body .koma_header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }
  body.jupi.kr_body .koma_header .jupi_nav_back { justify-self: start; }
  body.jupi.kr_body .koma_brand { justify-self: center; }
  body.jupi.kr_body .koma_header .jupi_werkzeuge { justify-self: end; margin-left: 0; }
}

/* ---------- HUD: Punktezettel mit Setzkasten-Etikett ---------- */
body.jupi.kr_body .koma_panel {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.25rem;
  margin: 1.5rem 0 1rem;
  padding: 1.05rem 1.15rem 0.85rem;
  border: 1px solid #d9c9a5;
  border-radius: 5px 11px 6px 12px;
  background:
    radial-gradient(140% 130% at 12% 0%, #fffdf7 0%, #f8f1de 58%, #f2e8cf 100%);
  box-shadow: 0 10px 20px rgba(38,26,14,0.22), inset 0 0 0 1px rgba(255,255,255,0.65);
  color: var(--kr-tinte);
  transform: rotate(-0.3deg);
}
/* Klebestreifen oben links */
body.jupi.kr_body .koma_panel::before {
  content: "";
  position: absolute;
  top: -0.65rem;
  left: 1.4rem;
  width: 5.2rem;
  height: 1.35rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(226,208,170,0.75));
  border: 1px solid rgba(180,160,120,0.45);
  transform: rotate(-2.5deg);
  box-shadow: 0 2px 4px rgba(60,44,24,0.14);
  pointer-events: none;
}
body.jupi.kr_body .koma_kasten_tab {
  position: absolute;
  top: -0.8rem;
  right: 1.1rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid #b49a70;
  border-radius: 3px;
  background: linear-gradient(180deg, #ddc9a2, #c8b183);
  color: #3b3228;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(1.2deg);
  box-shadow: 0 2px 3px rgba(60,44,24,0.2);
}
body.jupi.kr_body .koma_stat {
  display: flex;
  flex-direction: column;
  min-width: 4.4rem;
}
body.jupi.kr_body .koma_stat label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #7d6a4d;
}
body.jupi.kr_body .koma_stat span {
  font-family: var(--kr-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--kr-tinte);
  line-height: 1.25;
}
body.jupi.kr_body #koma_score { color: var(--kr-rot); }
body.jupi.kr_body .koma_controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
body.jupi.kr_body .koma_controls label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f4536;
}
body.jupi.kr_body .koma_controls .jupi_select,
body.jupi.kr_body #koma_level {
  min-height: 42px;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid #c3ae86;
  border-radius: 6px;
  background: #fffdf6;
  color: #232a30;
  font-size: 0.92rem;
  font-weight: 700;
}
body.jupi.kr_body #koma_hilfe_btn,
body.jupi.kr_body #koma_ton_knopf {
  min-height: 42px;
  min-width: 42px;
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
}

/* ---------- Knöpfe: Stempel und Papier ---------- */
body.jupi.kr_body .jupi_btn {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid #12161a;
  border-radius: 7px;
  background: linear-gradient(180deg, #3b444b 0%, #2a3136 60%, #22282d 100%);
  color: #f8f0dc;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  box-shadow: 0 3px 0 #14181c, 0 7px 14px rgba(24,16,9,0.28);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}
body.jupi.kr_body .jupi_btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #14181c, 0 10px 18px rgba(24,16,9,0.3);
}
body.jupi.kr_body .jupi_btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #14181c, 0 3px 8px rgba(24,16,9,0.25);
}
body.jupi.kr_body .jupi_btn:focus-visible {
  outline: 3px solid var(--kr-rot);
  outline-offset: 2px;
}
body.jupi.kr_body .jupi_btn:disabled {
  filter: grayscale(0.5) brightness(0.85);
  cursor: default;
}
body.jupi.kr_body .jupi_btn_alt {
  border: 1.5px solid #c8b48c;
  background: linear-gradient(180deg, #fffdf6 0%, #f5ecd6 100%);
  color: #2b3238;
  box-shadow: 0 3px 0 #d3c19c, 0 7px 14px rgba(24,16,9,0.16);
}
body.jupi.kr_body .jupi_btn_alt:hover {
  filter: brightness(1.02);
  background: #fffef9;
  box-shadow: 0 4px 0 #d3c19c, 0 10px 18px rgba(24,16,9,0.2);
}
body.jupi.kr_body .jupi_btn_alt:active { box-shadow: 0 1px 0 #d3c19c; }
body.jupi.kr_body #koma_pruefen,
body.jupi.kr_body #koma_next { color: #fff6e2; }

/* ---------- Bühne: Satzspiegel-Blatt (Korrekturfahne) ---------- */
body.jupi.kr_body .koma_stage {
  position: relative;
  margin: 1.1rem 0 0;
  padding: 1.45rem 1.35rem 1.1rem 1.75rem;
  border: 1px solid #ded0b2;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #fbf5e6 55%, #f4ecd8 100%);
  box-shadow: 0 16px 32px rgba(38,26,14,0.30), 0 1px 0 rgba(255,255,255,0.85) inset;
  color: var(--kr-tinte);
}
/* Satzspiegel-Rahmen (Doppellinie) als gezeichneter Bleisatz-Rahmen */
body.jupi.kr_body .koma_stage::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(96,78,50,0.22);
  border-radius: 2px;
  pointer-events: none;
}
/* rote Randlinie des Korrekturbogens */
body.jupi.kr_body .koma_stage::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  left: 1.05rem;
  width: 1px;
  background: rgba(168,40,31,0.30);
  pointer-events: none;
}
/* Messing-Klammer oben rechts */
body.jupi.kr_body .koma_klemme {
  position: absolute;
  top: -0.55rem;
  right: 2.1rem;
  width: 1.05rem;
  height: 2.35rem;
  border: 2px solid var(--kr-messing);
  border-radius: 0.6rem;
  background: linear-gradient(100deg, rgba(255,255,255,0.55), rgba(176,138,62,0.25));
  box-shadow: 0 2px 5px rgba(40,28,14,0.3);
  transform: rotate(4deg);
  z-index: 7;
  pointer-events: none;
}
body.jupi.kr_body .koma_klemme::before {
  content: "";
  position: absolute;
  inset: 0.28rem 0.22rem 0.85rem;
  border: 1.5px solid var(--kr-messing-hell);
  border-radius: 0.45rem;
}
body.jupi.kr_body .koma_fahne_kopf {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.45rem;
}
body.jupi.kr_body .koma_fahne_label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8a6b3f;
}
body.jupi.kr_body .koma_fahne_linie {
  flex: 1 1 auto;
  height: 1px;
  background: repeating-linear-gradient(90deg, #c9b48c 0 6px, rgba(201,180,140,0) 6px 11px);
}
body.jupi.kr_body .koma_task_label {
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dotted rgba(120,100,70,0.45);
  font-family: var(--kr-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5a4a33;
}
body.jupi.kr_body .koma_aufgabe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 5.4rem;
  padding: 0.15rem 0 0.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--kr-serif);
  font-size: clamp(1.1rem, 2.3vw, 1.42rem);
  line-height: 2.2;
  font-weight: 600;
  color: #22282d;
}
body.jupi.kr_body .koma_wort { margin: 0.08rem 0.14rem; }

/* Lücken: gesetzte Blätter mit rotem Korrektur-Punkt */
body.jupi.kr_body .koma_luecke {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7rem;
  min-height: 2.7rem;
  height: auto;
  margin: 0.05rem 0.16rem;
  padding: 0 0.18rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: transparent;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  vertical-align: middle;
}
body.jupi.kr_body .koma_luecke::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  width: 1.2rem;
  height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg,
    rgba(168,40,31,0.55) 0 3px, rgba(168,40,31,0) 3px 6px);
  transform: translateX(-50%);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
body.jupi.kr_body .koma_luecke:hover { background: rgba(168,40,31,0.08); }
body.jupi.kr_body .koma_luecke:hover::before {
  background: var(--kr-rot);
  box-shadow: 0 0 0 2px rgba(168,40,31,0.12);
}
body.jupi.kr_body .koma_luecke:focus-visible {
  outline: 3px solid var(--kr-rot);
  outline-offset: 1px;
  background: rgba(168,40,31,0.07);
}
body.jupi.kr_body .koma_luecke[disabled] { cursor: default; }
body.jupi.kr_body .koma_gewaehlt {
  color: var(--kr-rot);
  background: rgba(168,40,31,0.09);
  border-bottom: 3px solid var(--kr-rot);
}
body.jupi.kr_body .koma_gewaehlt::before {
  background: var(--kr-rot);
  box-shadow: 0 0 0 3px rgba(168,40,31,0.16);
}
body.jupi.kr_body .koma_richtig::before { background: var(--kr-gruen); }
body.jupi.kr_body .koma_falsch::before { background: var(--kr-rot); }
body.jupi.kr_body .koma_verpasst::before { background: #b07b1e; }
body.jupi.kr_body .koma_richtig {
  color: var(--kr-gruen);
  background: rgba(47,107,70,0.10);
  border-bottom: 3px solid rgba(47,107,70,0.75);
}
body.jupi.kr_body .koma_richtig::before { background: var(--kr-gruen); }
body.jupi.kr_body .koma_falsch {
  color: var(--kr-rot);
  background: rgba(168,40,31,0.12);
  border-bottom: 3px solid var(--kr-rot);
}
body.jupi.kr_body .koma_falsch::before { background: var(--kr-rot); }
/* falsche Lücke wird wie mit dem Rotstift durchgestrichen */
body.jupi.kr_body .koma_falsch::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 48%;
  height: 2px;
  background: var(--kr-rot);
  transform: rotate(-13deg);
}
body.jupi.kr_body .koma_verpasst {
  color: #8a5a12;
  background: rgba(214,160,40,0.14);
  border: 2px dashed #b07b1e;
  border-radius: 6px;
}
body.jupi.kr_body .koma_verpasst::before { background: #b07b1e; }

body.jupi.kr_body .koma_btns_row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
body.jupi.kr_body .koma_btns_row .jupi_btn {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
}
body.jupi.kr_body .koma_msg {
  min-height: 2.6rem;
  margin-top: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #cfa93f;
  border-radius: 0 4px 4px 0;
  background: #fffdf4;
  font-family: var(--kr-mono);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  color: #3a3226;
}
body.jupi.kr_body .koma_msg:empty {
  padding: 0;
  border-left: 0;
  background: transparent;
}
body.jupi.kr_body .koma_msg_ok {
  border-left-color: var(--kr-gruen);
  background: #f2f7ee;
  color: #24503a;
}
body.jupi.kr_body .koma_msg_err {
  border-left-color: var(--kr-rot);
  background: #fbf0ec;
  color: #8e231b;
}

/* ---------- Start: Auftrag auf Kraftpapier-Umschlag ---------- */
body.jupi.kr_body .jupi_startoverlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.6rem 1.2rem;
  border: 1px solid #d3c19c;
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #f7eed8 0%, #ecdfc2 100%);
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.35);
  color: #2b3238;
  text-align: center;
}
/* Satzspiegel-Doppelrahmen auf dem Auftragsblatt */
body.jupi.kr_body .jupi_startoverlay::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border: 1px solid rgba(96,78,50,0.28);
  outline: 1px solid rgba(168,40,31,0.16);
  outline-offset: 3px;
  border-radius: 2px;
  pointer-events: none;
}
/* Stempelring unten rechts (ohne Text - sprachneutral) */
body.jupi.kr_body .jupi_startoverlay::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  bottom: 1rem;
  width: 3.4rem;
  height: 3.4rem;
  border: 2.5px solid rgba(168,40,31,0.30);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}
body.jupi.kr_body .jupi_startoverlay[hidden] { display: none; }
body.jupi.kr_body .jupi_startoverlay h3 {
  margin: 0;
  font-family: var(--kr-serif);
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  font-weight: 700;
  color: #20262b;
}
body.jupi.kr_body .jupi_startoverlay h3::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 3px;
  margin: 0.45rem auto 0;
  background: var(--kr-rot);
  opacity: 0.75;
}
body.jupi.kr_body .jupi_startoverlay p {
  max-width: 26rem;
  margin: 0.2rem 0 0.8rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #4c4335;
}
body.jupi.kr_body #koma_start_btn {
  min-height: 48px;
  padding: 0.6rem 1.9rem;
  border-color: #6d1712;
  background: linear-gradient(180deg, #bb3a2f 0%, #992218 100%);
  color: #fff6e6;
  box-shadow: 0 3px 0 #6d1712, 0 8px 16px rgba(80,20,14,0.35);
}

/* ---------- Rundenende: Korrekturbogen ---------- */
body.jupi.kr_body .koma_done {
  position: relative;
  margin-top: 1.1rem;
  padding: 1.7rem 1.3rem 1.35rem;
  border: 1px solid #ded0b2;
  border-radius: 3px;
  background: linear-gradient(180deg, #fffdf7 0%, #f6efdb 60%, #f1e7cf 100%);
  box-shadow: 0 16px 32px rgba(38,26,14,0.30), 0 1px 0 rgba(255,255,255,0.85) inset;
  color: var(--kr-tinte);
  text-align: center;
  transform: rotate(0.35deg);
}
body.jupi.kr_body .koma_done[hidden] { display: none; }
body.jupi.kr_body .koma_done h3 {
  margin: 0.2rem 0 0.5rem;
  font-family: var(--kr-serif);
  font-size: clamp(1.25rem, 3.2vw, 1.55rem);
  color: #20262b;
}
body.jupi.kr_body .koma_done p {
  max-width: 31rem;
  margin: 0.3rem auto 0.85rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #4b4337;
}
body.jupi.kr_body .koma_sterne {
  margin-bottom: 0.9rem;
  font-size: 2.1rem;
  letter-spacing: 0.15rem;
  color: #c99a2e;
}
body.jupi.kr_body .koma_done .jupi_btn { min-height: 44px; }
/* Stempel-Ring (ohne Text - sprachneutral) */
body.jupi.kr_body .koma_done::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  width: 4.2rem;
  height: 4.2rem;
  border: 3px solid rgba(168,40,31,0.45);
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
}

/* ---------- ❓-Hilfe: Handbuch-Blatt ---------- */
body.jupi.kr_body dialog.koma_modal {
  width: 92%;
  max-width: 38rem;
  max-height: 88vh;
  margin: auto;
  padding: 0;
  border: 1px solid #cbb892;
  border-radius: 4px;
  background: linear-gradient(180deg, #fffdf7 0%, #f6eeda 100%);
  color: #2b3238;
  box-shadow: 0 24px 60px rgba(10,7,4,0.55);
}
body.jupi.kr_body dialog.koma_modal::backdrop {
  background: rgba(12,9,6,0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
body.jupi.kr_body .koma_modal_kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 3px solid var(--kr-messing);
  background: linear-gradient(180deg, #efe3c7 0%, #e4d5b6 100%);
}
body.jupi.kr_body .koma_modal_kopf h2 {
  margin: 0;
  font-family: var(--kr-serif);
  font-size: 1.22rem;
  font-weight: 700;
  color: #232a30;
}
body.jupi.kr_body .koma_modal_zu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1.5px solid #b9a37c;
  border-radius: 6px;
  background: #fffdf6;
  color: #3a3226;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}
body.jupi.kr_body .koma_modal_zu:hover { background: #ffffff; }
body.jupi.kr_body .koma_modal_zu:focus-visible { outline: 3px solid var(--kr-rot); outline-offset: 2px; }
body.jupi.kr_body .koma_modal_body {
  max-height: calc(88vh - 132px);
  padding: 1.05rem 1.25rem;
  overflow-y: auto;
  color: #2b3238;
  line-height: 1.55;
}
body.jupi.kr_body .koma_modal_body h3 {
  margin: 0.9rem 0 0.35rem;
  padding-bottom: 0.22rem;
  border-bottom: 1px solid rgba(168,40,31,0.3);
  font-family: var(--kr-serif);
  font-size: 1.05rem;
  color: #7a1f18;
}
body.jupi.kr_body .koma_modal_body h3:first-child { margin-top: 0.1rem; }
body.jupi.kr_body .koma_modal_body ul { margin: 0.4rem 0 0.9rem; padding-left: 1.3rem; }
body.jupi.kr_body .koma_modal_body li { margin: 0.35rem 0; }
body.jupi.kr_body .koma_modal_body p { margin: 0.4rem 0 0.6rem; }
body.jupi.kr_body .koma_lernziel {
  margin: 0.9rem 0 0.3rem;
  padding: 0.75rem 0.95rem;
  border-left: 4px solid var(--kr-rot);
  border-radius: 0 5px 5px 0;
  background: #f3ecdb;
  font-size: 0.95rem;
}
body.jupi.kr_body .koma_modal_fuss {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid #cdb992;
  background: linear-gradient(180deg, #efe3c7 0%, #e4d5b6 100%);
}
body.jupi.kr_body #koma_modal_ok { min-height: 44px; min-width: 104px; }

/* ---------- Fußzeile: Werkbank-Sockel ---------- */
body.jupi.kr_body .koma_footer {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding: 0.95rem 1rem 1.1rem;
  border-top: 3px solid var(--kr-messing);
  border-radius: 0;
  background: linear-gradient(180deg, #2c3237 0%, #20252a 100%);
  color: #c6b89f;
  text-align: center;
  font-size: 0.86rem;
}
body.jupi.kr_body .koma_footer .jupi_footer_text {
  color: #c6b89f;
  line-height: 1.6;
}
body.jupi.kr_body .koma_footer a { color: #e8cf9c; font-weight: 700; }
body.jupi.kr_body .koma_footer a:hover { color: #ffe9bb; }
body.jupi.kr_body .koma_footer img { filter: sepia(0.4) saturate(0.8) brightness(1.15); }

/* ---------- Dark Mode: Papiere bleiben hell und lesbar ---------- */
html[data-theme="dark"] body.jupi.kr_body .koma_panel {
  background: radial-gradient(140% 130% at 12% 0%, #f6eeda 0%, #eadfc4 60%, #e2d5b6 100%);
  border-color: #9a8560;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.35);
}
html[data-theme="dark"] body.jupi.kr_body .koma_stat label { color: #6d5b3f; }
html[data-theme="dark"] body.jupi.kr_body .koma_stat span,
html[data-theme="dark"] body.jupi.kr_body .koma_task_label,
html[data-theme="dark"] body.jupi.kr_body .koma_aufgabe { color: #22282d; }
html[data-theme="dark"] body.jupi.kr_body .koma_controls label { color: #4a4030; }
html[data-theme="dark"] body.jupi.kr_body .koma_msg {
  border-left-color: #b5912f;
  background: #fdf8e8;
  color: #3a3226;
}
html[data-theme="dark"] body.jupi.kr_body .koma_msg_ok {
  border-left-color: #2f6b46;
  background: #eef5e9;
  color: #22513a;
}
html[data-theme="dark"] body.jupi.kr_body .koma_msg_err {
  border-left-color: var(--kr-rot);
  background: #faeee9;
  color: #8b211a;
}
html[data-theme="dark"] body.jupi.kr_body .koma_footer {
  background: linear-gradient(180deg, #1b2024 0%, #12161a 100%);
  border-top-color: #6d5322;
  color: #b3a68e;
}
html[data-theme="dark"] body.jupi.kr_body .koma_footer .jupi_footer_text { color: #b3a68e; }

/* ---------- Kleine Fenster ---------- */
@media (max-width: 640px) {
  body.jupi.kr_body .koma_header { min-height: 54px; padding: 0.35rem 0.6rem; gap: 0.45rem 0.6rem; }
  body.jupi.kr_body .koma_brand { margin-inline: auto; }
  body.jupi.kr_body .koma_brand img { width: 32px; height: 32px; }
  body.jupi.kr_body .koma_brand h1 { font-size: 1.05rem; }
  body.jupi.kr_body .koma_header .jupi_nav_back { min-height: 44px; padding: 0.35rem 0.7rem; font-size: 0.86rem; }
  body.jupi.kr_body .koma_panel {
    gap: 0.45rem 0.9rem;
    padding: 1.1rem 0.85rem 0.8rem;
    transform: none;
  }
  body.jupi.kr_body .koma_kasten_tab { right: 0.7rem; }
  body.jupi.kr_body .koma_stat { min-width: 3.7rem; }
  body.jupi.kr_body .koma_stat span { font-size: 1.2rem; }
  body.jupi.kr_body .koma_controls {
    margin-left: 0;
    width: 100%;
    gap: 0.4rem;
  }
  body.jupi.kr_body .koma_controls label { flex: 0 0 auto; }
  body.jupi.kr_body #koma_level { flex: 1 1 8rem; min-width: 0; }
  body.jupi.kr_body .koma_stage {
    padding: 1.35rem 0.85rem 0.95rem 1.35rem;
    transform: none;
  }
  body.jupi.kr_body .koma_klemme { right: 1.1rem; }
  body.jupi.kr_body .koma_aufgabe {
    font-size: 1.05rem;
    line-height: 2.35;
    min-height: 5rem;
  }
  body.jupi.kr_body .koma_luecke { min-width: 2.6rem; min-height: 2.6rem; }
  body.jupi.kr_body .koma_btns_row { gap: 0.45rem; }
  body.jupi.kr_body .koma_btns_row { gap: 0.4rem; }
  body.jupi.kr_body .koma_btns_row .jupi_btn {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
    min-height: 44px;
    padding: 0.42rem 0.5rem;
    font-size: 0.84rem;
    white-space: normal;
    text-align: center;
  }
  body.jupi.kr_body .koma_footer { padding: 0.75rem 0.8rem 0.85rem; font-size: 0.8rem; }
  body.jupi.kr_body .koma_done { padding: 1.5rem 1rem 1.2rem; transform: none; }
  body.jupi.kr_body .koma_done::after { width: 3.4rem; height: 3.4rem; top: 0.6rem; right: 0.6rem; }
  body.jupi.kr_body dialog.koma_modal { width: 96%; max-height: 92vh; }
  body.jupi.kr_body .koma_modal_body { max-height: calc(92vh - 132px); padding: 0.95rem 1rem; }
}

@media (max-width: 430px) {
  body.jupi.kr_body .koma_brand h1 { font-size: 0.98rem; }
  body.jupi.kr_body .koma_header .jupi_sprachen_select { font-size: 0.78rem; max-width: 9.5rem; }
  body.jupi.kr_body .koma_aufgabe { font-size: 1rem; }
}

/* Längere Texte in der Leiste dürfen die drei Zonen nicht sprengen */
body.jupi.kr_body .koma_brand h1 { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  body.jupi.kr_body .jupi_btn,
  body.jupi.kr_body .koma_panel,
  body.jupi.kr_body .koma_done,
  body.jupi.kr_body .koma_luecke { transition: none; }
  body.jupi.kr_body .jupi_btn:hover { transform: none; }
}
