:root {
  color-scheme: dark;
  --nacht: #14121f;
  --nacht-2: #1f1b30;
  --pergament: #f3e7c9;
  --pergament-2: #e6d4a8;
  --tinte: #2b2116;
  --tinte-2: #5a4632;
  --gold: #d9a441;
  --gold-dunkel: #a8741d;
  --gruen: #3f8f4f;
  --rot: #b23a3a;
  --blau: #3d6fb6;
  --rand: #7a5a2e;
  --schrift: "Segoe UI", system-ui, -apple-system, sans-serif;
  --titel: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--nacht);
  color: var(--pergament);
  font-family: var(--schrift);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; }

/* ---------- HUD ---------- */
#hud {
  display: flex; align-items: center; gap: 16px;
  padding: 6px 12px;
  background: linear-gradient(#2a2440, #1d1930);
  border-bottom: 2px solid var(--rand);
  flex-wrap: wrap;
}
#hud[hidden] { display: none; }
.hud-held { display: flex; align-items: center; gap: 8px; min-width: 180px; }
#hud-bild { width: 32px; height: 32px; image-rendering: pixelated; background: #0003; border-radius: 4px; }
#hud-name { font-family: var(--titel); font-weight: bold; color: var(--gold); }
#hud-stufe { font-size: 12px; opacity: .85; }
.hud-xp { flex: 1; min-width: 160px; max-width: 360px; }
.xp-balken { height: 10px; background: #0006; border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; }
#hud-xp-fuellung { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-dunkel), var(--gold)); transition: width .4s; }
#hud-xp-text { font-size: 11px; opacity: .8; margin-top: 2px; }
#hud-reich { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; margin-left: auto; padding: 0 6px; }
.hud-knoepfe { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.hud-knoepfe button {
  background: #3a3356; color: var(--pergament); border: 1px solid var(--rand);
  border-radius: 6px; padding: 5px 10px; font-size: 13px;
}
.hud-knoepfe button:hover { background: #4a4270; }

/* ---------- Bühne ---------- */
#buehne { flex: 1; position: relative; min-height: 0; }
#spiel { position: absolute; inset: 0; }
#spiel canvas { image-rendering: pixelated; }
#hinweis {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: #000a; border: 1px solid var(--gold); color: var(--pergament);
  padding: 6px 14px; border-radius: 6px; font-size: 14px; pointer-events: none;
}
#hinweis kbd {
  display: inline-block; background: var(--pergament); color: var(--tinte);
  border-radius: 3px; padding: 0 6px; font-weight: bold; margin-right: 6px;
}

/* ---------- Overlay / Fenster ---------- */
#overlay {
  position: fixed; inset: 0; background: #0009;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 10;
}
#overlay[hidden] { display: none; }
#fenster {
  background: var(--pergament); color: var(--tinte);
  border: 3px solid var(--rand); border-radius: 10px;
  box-shadow: 0 0 0 3px var(--tinte), 0 12px 40px #000c;
  width: min(760px, 100%); max-height: calc(100vh - 32px);
  overflow-y: auto; padding: 20px 24px;
}
#fenster h2 { font-family: var(--titel); margin: 0 0 4px; color: var(--tinte); }
#fenster h3 { font-family: var(--titel); margin: 16px 0 6px; }
.untertitel { color: var(--tinte-2); font-size: 14px; margin-bottom: 12px; }
.knopfleiste { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.knopf {
  background: var(--gold); color: var(--tinte); border: 2px solid var(--gold-dunkel);
  border-radius: 6px; padding: 8px 18px; font-weight: bold;
}
.knopf:hover, .knopf:focus-visible { background: #e8b858; outline: 2px solid var(--tinte); outline-offset: 1px; }
.knopf.zweitrangig { background: transparent; border-color: var(--tinte-2); color: var(--tinte-2); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopfzeile { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.knopfzeile .knopfleiste { margin-top: 0; margin-left: auto; }
.knopfzeile .knopfmitte { flex: 1; display: flex; justify-content: center; }
.knopfzeile .knopfmitte:empty { flex: 0; }
.xp-abzug { color: var(--text-leise, #6a6680); font-size: 14px; margin-top: -4px; }
.knopf.abbrechen { font-weight: normal; font-size: 14px; padding: 6px 12px; }

/* Dialog */
.dialog { display: flex; gap: 16px; align-items: flex-start; }
.portrait {
  width: 72px; height: 72px; flex: none; image-rendering: pixelated;
  background: var(--pergament-2); border: 2px solid var(--rand); border-radius: 8px;
}
.sprecher { font-family: var(--titel); font-weight: bold; color: var(--gold-dunkel); font-size: 18px; margin-bottom: 4px; }
.rede { font-size: 17px; line-height: 1.5; white-space: pre-line; }
.auswahl-liste { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.auswahl-liste .knopf { text-align: left; }

/* Aufgaben */
.fortschritt { font-size: 13px; color: var(--tinte-2); }
.lesetext {
  background: #fffaf0; border: 1px solid var(--pergament-2); border-left: 4px solid var(--gold);
  padding: 12px 16px; margin: 10px 0 14px; line-height: 1.55; font-size: 15px;
  max-height: 280px; overflow-y: auto; white-space: pre-line;
}
.lesetext .quelle { display: block; font-size: 12px; color: var(--tinte-2); margin-top: 8px; font-style: italic; }
.frage { font-size: 17px; font-weight: 600; margin: 8px 0 12px; }
.optionen { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex; gap: 10px; align-items: center; text-align: left;
  background: #fffaf0; border: 2px solid var(--pergament-2); border-radius: 8px;
  padding: 10px 12px; color: var(--tinte); font-size: 15px;
}
.option:hover { border-color: var(--gold); }
.option.gewaehlt { border-color: var(--blau); background: #e9f0fb; }
.option.richtig { border-color: var(--gruen); background: #e4f3e6; }
.option.falsch { border-color: var(--rot); background: #f8e3e3; }
.option .buchstabe {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pergament-2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: bold;
}
.lueckentext { font-size: 17px; line-height: 2.3; white-space: pre-line; }
#fenster input, #fenster select, #fenster textarea { color: var(--tinte); }
.lueckentext input, .lueckentext select {
  font: inherit; font-size: 16px; padding: 2px 6px; min-width: 90px;
  border: none; border-bottom: 2px solid var(--tinte-2); background: #fffaf0; color: var(--tinte);
}
.lueckentext .richtig { border-bottom-color: var(--gruen); background: #e4f3e6; }
.lueckentext .falsch { border-bottom-color: var(--rot); background: #f8e3e3; }
.tipp-buchstabe { font-size: 12px; color: var(--blau); margin-left: 2px; }
.umlaute { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.umlaute button {
  background: #fffaf0; border: 1px solid var(--tinte-2); border-radius: 4px; padding: 2px 9px; color: var(--tinte);
}
.ordnen-ziel, .ordnen-quelle {
  min-height: 48px; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  border-radius: 8px;
}
.ordnen-ziel { background: #fffaf0; border: 2px dashed var(--tinte-2); margin-bottom: 10px; }
.ordnen-ziel.richtig { border-color: var(--gruen); background: #e4f3e6; }
.ordnen-ziel.falsch { border-color: var(--rot); background: #f8e3e3; }
.baustein {
  background: var(--pergament-2); border: 1px solid var(--rand); border-radius: 6px;
  padding: 6px 10px; color: var(--tinte); font-size: 15px;
}
.baustein:hover { background: #dcc48c; }
.zuordnen-tabelle { width: 100%; border-collapse: collapse; }
.zuordnen-tabelle td { padding: 6px 4px; border-bottom: 1px solid var(--pergament-2); }
.zuordnen-tabelle select { font: inherit; padding: 4px; width: 100%; background: #fffaf0; }
.zuordnen-beispiel td { font-style: italic; opacity: 0.75; }
.zuordnen-liste { list-style: none; padding: 0; margin: 0 0 10px; }
.zuordnen-liste li { padding: 4px 6px; border-bottom: 1px dashed var(--pergament-2); }
.zuordnen-liste li b { display: inline-block; min-width: 1.6em; }
.zuordnen-liste li.zuordnen-beispiel { font-style: italic; opacity: 0.75; }
.zuordnen-tabelle.mit-liste select { width: auto; min-width: 4.5em; }
.block-teil { padding: 8px 10px; margin: 8px 0; border-left: 3px solid var(--pergament-2); border-radius: 4px; }
.block-teil.richtig { border-left-color: var(--gruen); }
.block-teil.falsch { border-left-color: var(--rot); }
.block-frage { margin-bottom: 6px; font-weight: 600; }
.block-frage b { display: inline-block; min-width: 1.6em; }
.zuordnen-tabelle select.richtig { outline: 2px solid var(--gruen); }
.zuordnen-tabelle select.falsch { outline: 2px solid var(--rot); }
.rf-zeile { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--pergament-2); }
.rf-zeile span { flex: 1; }
.rf-zeile button { min-width: 72px; }
.rf-zeile button.gewaehlt { background: var(--blau); color: white; }
.rf-zeile.richtig span { color: var(--gruen); font-weight: 600; }
.rf-zeile.falsch span { color: var(--rot); font-weight: 600; }
textarea.freitext {
  width: 100%; min-height: 180px; font: inherit; font-size: 16px; line-height: 1.5;
  padding: 10px; border: 2px solid var(--pergament-2); border-radius: 8px; background: #fffaf0; color: var(--tinte);
}
.wortzahl { font-size: 13px; color: var(--tinte-2); text-align: right; }
.checkliste label { display: block; padding: 3px 0; }
.analyse { margin-top: 10px; font-size: 14px; }
.analyse li.ok { color: var(--gruen); }
.analyse li.fehlt { color: var(--rot); }
.analyse li.halb { color: #b5740a; }
.stichpunkte { font-size: 14px; background: #fffaf0; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; }

.feedback { margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-size: 15px; line-height: 1.45; }
.feedback[hidden] { display: none; }
.feedback.gut { background: #e4f3e6; border: 1px solid var(--gruen); }
.feedback.schlecht { background: #f8e3e3; border: 1px solid var(--rot); }
.feedback.info { background: #e9f0fb; border: 1px solid var(--blau); }

/* Kampf */
.kampf-kopf { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.kampf-kopf .portrait { width: 96px; height: 96px; }
.ton-schalter { align-self: flex-start; flex: none; font: inherit; font-size: .85em; padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--tinte); background: #fff6; color: var(--tinte); cursor: pointer; white-space: nowrap; }
.ton-schalter:hover { background: #fffa; }
.ton-schalter[aria-pressed="true"] { opacity: .7; }
.kampf-kopf .portrait.treffer { animation: wackeln .35s; }
.boss-phase { padding-bottom: 10px; border-bottom: 2px solid #8e1f1f55; }
.boss-phase .portrait { width: 64px; height: 64px; }
.boss-phase h2 { margin: 0; font-size: 1.15em; }
.boss-phase .lp-balken > div { transition: width 1.6s ease-in; }
@keyframes wackeln { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lp-balken { height: 16px; background: #0002; border: 2px solid var(--tinte); border-radius: 8px; overflow: hidden; }
.lp-balken > div { height: 100%; background: linear-gradient(90deg, #8e1f1f, #d24a4a); transition: width .4s; }
.herzen { font-size: 22px; letter-spacing: 2px; margin-top: 6px; }
.spott { font-style: italic; color: var(--tinte-2); margin-bottom: 6px; }

/* Inventar / Listen */
.gegenstaende { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gegenstand { background: #fffaf0; border: 1px solid var(--pergament-2); border-radius: 8px; padding: 10px; }
.gegenstand .icon { font-size: 26px; }
.gegenstand b { display: block; font-family: var(--titel); }
.gegenstand small { color: var(--tinte-2); }
.gegenstand .knopf { margin-top: 8px; padding: 4px 10px; font-size: 13px; }
.ziel-liste { list-style: none; padding: 0; margin: 0; }
.ziel-liste li { padding: 8px 0; border-bottom: 1px solid var(--pergament-2); }
.ziel-liste li.erledigt { color: var(--tinte-2); text-decoration: line-through; }
.formular { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.formular label { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; gap: 4px; }
.formular input, .formular select {
  font: inherit; font-weight: normal; padding: 6px 8px; border: 1px solid var(--tinte-2); border-radius: 6px; background: #fffaf0;
}
.formular .breit { grid-column: 1 / -1; }
.klassen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.klasse { background: #fffaf0; border: 2px solid var(--pergament-2); border-radius: 8px; padding: 8px; text-align: center; color: var(--tinte); }
.klasse img { width: 48px; height: 48px; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
.klasse.gewaehlt { border-color: var(--blau); background: #e9f0fb; }
.pass-ansicht dt { font-weight: bold; color: var(--tinte-2); font-size: 13px; }
.pass-ansicht dd { margin: 0 0 8px; font-size: 16px; }
.pass-ansicht { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
input.code-eingabe { font: inherit; font-size: 20px; letter-spacing: 2px; text-transform: uppercase; padding: 8px; width: 100%; text-align: center; }

/* Titel */
.titelbild { text-align: center; }
.titelbild h1 { font-family: var(--titel); font-size: 34px; margin: 0; color: var(--tinte); }
.titelbild p { color: var(--tinte-2); }

/* Toasts */
#toasts { position: fixed; top: 64px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast {
  background: var(--nacht-2); border: 1px solid var(--gold); color: var(--pergament);
  padding: 8px 14px; border-radius: 8px; box-shadow: 0 4px 16px #0008; font-size: 14px;
  animation: rein .25s ease-out;
}
@keyframes rein { from { transform: translateX(30px); opacity: 0; } }

@media (max-width: 1280px) {
  #hud-reich .reich-lang { display: none; }
}
@media (max-width: 640px) {
  .formular, .pass-ansicht { grid-template-columns: 1fr; }
  .klassen { grid-template-columns: repeat(2, 1fr); }
  #fenster { padding: 14px; }
  .hud-knoepfe button { padding: 4px 7px; font-size: 12px; }
}

.titel-version { font-weight: bold; color: var(--gold-dunkel); }
.titel-steuerung { text-align: center; font-size: 13px; color: var(--tinte-2); margin-top: 16px; }

/* ---------- Gespräche: Fenster unten, die Szene bleibt sichtbar ---------- */
#overlay.gespraech { align-items: flex-end; background: linear-gradient(transparent 45%, #0007); }
#overlay.gespraech #fenster { max-height: 48vh; }

/* Spielstand: alter Code */

/* ---------- Überblende beim Kartenwechsel, Treffer-Blitz ---------- */
#blende { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s; z-index: 2; }
#blende.an { opacity: 1; }
#buehne.schaden::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px #d02020a0; z-index: 3; }

/* ---------- Touch-Steuerung ---------- */
#joystick, #aktion-knopf { display: none; }
body.touch #joystick {
  display: block; position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom));
  width: 128px; height: 128px; border-radius: 50%; z-index: 4;
  background: radial-gradient(#ffffff18, #ffffff08); border: 2px solid #ffffff40; touch-action: none;
}
body.touch #joystick i {
  position: absolute; left: 39px; top: 39px; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9, #ffffff40); border: 2px solid #fff8; pointer-events: none;
}
body.touch #aktion-knopf:not([hidden]) {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(28px, env(safe-area-inset-bottom));
  width: 96px; height: 96px; border-radius: 50%; z-index: 4; touch-action: manipulation;
  background: radial-gradient(circle at 40% 35%, #f6d27a, #c98e2a); color: #2b2116;
  border: 3px solid #fff6; box-shadow: 0 6px 20px #0008; animation: pulsieren 1.6s ease-in-out infinite;
}
#aktion-knopf span { font-size: 30px; line-height: 1; }
#aktion-knopf small { font-size: 11px; font-weight: bold; max-width: 84px; text-align: center; line-height: 1.1; overflow: hidden; max-height: 2.3em; }
@keyframes pulsieren { 50% { transform: scale(1.06); } }
body.touch #hinweis { display: none !important; }
body.touch:not(.im-spiel) #joystick { display: none; }

/* ---------- Kleine Bildschirme (Handy hoch und quer) ---------- */
@media (max-width: 760px), (max-height: 500px) {
  #hud { gap: 8px; padding: 4px 8px; }
  .hud-held { min-width: 0; }
  #hud-stufe, #hud-xp-text, #hud-reich .reich-lang { display: none; }
  .hud-xp { min-width: 60px; }
  .hud-knoepfe { gap: 4px; }
  .hud-knoepfe button { font-size: 18px; padding: 3px 7px; }
  .hud-knoepfe button span { display: none; }
  #fenster { padding: 12px 14px; max-height: calc(100vh - 16px); }
  #overlay { padding: 8px; }
  .dialog { gap: 10px; }
  .rede { font-size: 16px; }
  #toasts { top: 58px; right: 8px; left: 8px; align-items: flex-end; }
  .hud-xp { max-width: none; }
  #hud { flex-wrap: nowrap; }
  #hud-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
}
@media (max-height: 500px) {
  #overlay.gespraech #fenster { max-height: 50vh; padding: 8px 12px; }
  #overlay.gespraech .portrait { width: 64px; height: 64px; }
  #overlay.gespraech .rede { font-size: 15px; }
  #overlay.gespraech .knopfleiste { margin-top: 8px; }
  body.touch #joystick { width: 104px; height: 104px; }
  body.touch #joystick i { left: 28px; top: 28px; }
  body.touch #aktion-knopf:not([hidden]) { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
  #hud-name, #hud-stufe { display: none; }
  .hud-knoepfe button { font-size: 16px; padding: 3px 6px; }
  .hud-knoepfe { gap: 3px; flex-wrap: nowrap; }
}

/* Titelbildschirm: Code eingeben (für Lehrercodes und Sprungcodes) */
.titel-code { text-align: center; margin-top: 6px; }
.link-knopf { background: none; border: none; color: inherit; opacity: 0.75; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px 8px; }
.link-knopf:hover, .link-knopf:focus-visible { opacity: 1; }
.sprung-liste { max-height: min(52vh, 460px); overflow-y: auto; padding-right: 4px; }
.sprung-liste .knopf { font-size: 14px; padding: 8px 12px; }

/* Hörtexte */
.hoertext { border: 1px solid var(--pergament-2); border-left: 4px solid #4a8ad8; border-radius: 6px; padding: 10px 14px; margin: 10px 0 14px; }
.hoer-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hoer-zaehler { font-size: 13px; opacity: 0.75; }
.hoer-knoepfe { justify-content: flex-start; margin-top: 8px; }
.hoer-text { margin-bottom: 0; }

/* ---------- Sprechaufgaben (Vocantia) ---------- */
.sprechen .partner-karte { background: #eaf4ff; border-left: 4px solid #4a8ad8; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; color: #1a2a3a; }
.sprechen .partner-karte > div { margin-top: 4px; }
.sprech-ziel { margin: 10px 0 6px; font-weight: 600; }
.sprech-wahl { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sprech-wahl .gewaehlt { outline: 2px solid #4a8ad8; background: #dcecff; color: #1a2a3a; }
.sprech-modus { margin: 6px 0; }
.sprech-info { font-size: 14px; opacity: 0.85; margin-bottom: 6px; }
.sprech-anzeige { display: flex; gap: 14px; align-items: center; margin: 8px 0; }
.sprech-anzeige > div:last-child { flex: 1; }
.sprech-zeit { font-size: 18px; font-weight: 700; }
.sprech-balken { height: 10px; background: rgba(0,0,0,0.12); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.sprech-balken-fuellung { height: 100%; width: 0; background: linear-gradient(90deg, #7fd8ff, #3a7ad8); transition: width 0.2s; }
.sprech-hinweis { font-size: 14px; min-height: 1.2em; margin-top: 4px; opacity: 0.85; }
.kristall { width: 64px; height: 104px; flex: none; --pegel: 0; transition: filter 0.2s; }
.kristall .kristall-svg { width: 100%; height: 100%; }
.kristall-fuellung { transition: y 0.15s; }
.kristall.spricht { filter: drop-shadow(0 0 calc(4px + var(--pegel) * 14px) #7fd8ff); }
.kristall.voll { filter: drop-shadow(0 0 14px #bff0ff); }
.kristall.flackert { animation: kristallFlackern 0.35s steps(2) infinite; }
@keyframes kristallFlackern { 0% { opacity: 1; } 100% { opacity: 0.45; } }
.sprech-aufnahme audio { width: 100%; margin-top: 6px; }

/* Credits */
.credits { text-align: center; margin: 18px 0 8px; }
.credit { margin-top: 18px; }
.credit-bild { display: block; width: 96px; height: 96px; margin: 0 auto 8px; image-rendering: pixelated; }
.credit-rolle { font-size: 0.85em; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.06em; }
.credit-name { margin-top: 4px; font-size: 1.25em; font-weight: 600; }

/* Auswertung der Probeprüfung */
.auswertung { width: 100%; border-collapse: collapse; margin: 10px 0; font-variant-numeric: tabular-nums; }
.auswertung td { padding: 6px 8px; border-bottom: 1px solid rgba(201, 162, 78, .35); }
.auswertung td:last-child { text-align: right; white-space: nowrap; }
.auswertung .summe td { font-weight: bold; border-bottom: none; }
.ehrentitel { font-weight: bold; color: var(--gold, #e0b040); margin-top: 2px; }
#standbild { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; z-index: 1; }
.sprech-ziel-zeile { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }

/* ---------- Hilfsmittel in Aufgaben ---------- */
.hilfsmittel { position: relative; }
.hilfsmittel-menue { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  min-width: 260px; background: var(--papier, #fffaf0); color: inherit; border: 1px solid var(--gold-dunkel, #9a7420);
  border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 6px; }
.hilfsmittel-menue[hidden] { display: none; }
.hilfsmittel-menue small { opacity: .75; font-size: 12px; }
.hilfsmittel-eintrag { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,.12); background: rgba(255,255,255,.6); color: inherit; font: inherit; cursor: pointer; }
.hilfsmittel-eintrag span:nth-child(2) { flex: 1; }
.hilfsmittel-eintrag .icon { font-size: 20px; }
.hilfsmittel-eintrag:disabled { opacity: .45; cursor: default; }
.option.gestrichen { text-decoration: line-through; opacity: .45; }
.geholfen { outline: 2px dashed var(--gold, #e0b448); outline-offset: 2px; }

/* ---------- Herzen in der Kopfleiste ---------- */
#hud-herzen { display: flex; gap: 0; font-size: 15px; line-height: 1; letter-spacing: -2px; white-space: nowrap; }
#hud-herzen.viele { font-size: 12px; }
#hud-herzen.schaden { animation: herzSchlag .4s; }
@keyframes herzSchlag { 30% { transform: scale(1.35); filter: drop-shadow(0 0 6px #ff3040); } }
.gegenstand.leer { opacity: .5; }
#angriff-knopf { display: none; }
body.touch #angriff-knopf:not([hidden]) {
  display: flex; flex-direction: column; align-items: center; justify-content: center; position: absolute;
  right: 118px; bottom: 34px; width: 70px; height: 70px; border-radius: 50%; z-index: 4;
  background: rgba(150, 30, 40, .78); color: #fff; border: 2px solid rgba(255, 220, 160, .8); font: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); touch-action: manipulation;
}
#angriff-knopf span { font-size: 28px; line-height: 1; }
#angriff-knopf small { font-size: 10px; font-weight: bold; }
body.kino #angriff-knopf { opacity: 0; pointer-events: none; }

/* Hinweis zum Bezug auf die DSD-Prüfung über den Aufgaben */
.dsd-bezug {
  display: inline-block; margin: 6px 0 2px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; background: #f3e4c0; color: var(--tinte); border: 1px solid var(--gold-dunkel);
}

/* Aussehen der eigenen Figur */
.aussehen { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 10px; }
.aussehen-vorschau { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 132px; }
.aussehen-portrait { width: 128px; height: 128px; image-rendering: pixelated; border-radius: 10px; border: 2px solid var(--gold-dunkel); }
.aussehen-figur { width: 132px; height: 190px; cursor: grab; }
.aussehen-name { font-weight: bold; font-size: 14px; text-align: center; }
.aussehen-auswahl { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.aussehen-zeile { display: flex; gap: 8px; align-items: center; }
.aussehen-titel { width: 72px; flex: none; font-size: 14px; font-weight: bold; }
.aussehen-knoepfe { display: flex; flex-wrap: wrap; gap: 5px; }
.aussehen .farbfeld { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #0004; padding: 0; cursor: pointer; }
.aussehen .farbfeld.gewaehlt { outline: 3px solid var(--blau); outline-offset: 1px; }
.aussehen .wahl { font: inherit; font-size: 13px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--pergament-2); background: #fffaf0; color: var(--tinte); cursor: pointer; }
.aussehen .wahl.gewaehlt { border-color: var(--blau); background: #e9f0fb; font-weight: bold; }
.knopf.klein { font-size: 13px; padding: 4px 10px; }
@media (max-width: 480px) {
  .aussehen-vorschau { flex-direction: row; flex-wrap: wrap; justify-content: center; width: 100%; }
  .aussehen-portrait { width: 96px; height: 96px; }
  .aussehen-figur { width: 96px; height: 138px; }
  .aussehen-name { width: 100%; }
  .aussehen-titel { width: 100%; }
  .aussehen-zeile { flex-wrap: wrap; gap: 4px; }
}

/* Bildrate (Menü → Grafik → „Bildrate anzeigen“) */
#bildrate { position: fixed; left: 8px; bottom: 8px; z-index: 50; padding: 4px 8px; border-radius: 6px;
  background: rgba(10, 14, 30, .72); color: #e8f0ff; font: 600 12px/1.3 ui-monospace, monospace; pointer-events: none; }
#bildrate[hidden] { display: none; }
.bildrate-wahl { display: flex; gap: 8px; align-items: center; margin-top: 10px; cursor: pointer; }

/* Namen aus der Spielwelt (src/ui/weltwoerter.js): kursiv, damit Lernende sie als Namen erkennen */
i.weltwort { font-style: italic; font-synthesis: style; }
