:root {
  --grund: #040509;
  --tafel: #0e1019;
  --tafel2: #151827;
  --rand: #2a3048;
  --rand-hell: #454e72;
  --schwarz: #010103;
  --text: #dfe1f0;
  --text-matt: #8f95b4;
  --akzent: #74f2d0;
  --akzent-dunkel: #1b6b5c;
  --akzent-glut: rgba(116, 242, 208, 0.35);
  --rot: #ff4d5e;
  --bernstein: #ffb347;
  --violett: #b65ae6;
  --app-h: 100vh;
  --schrift: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--grund); overscroll-behavior: none;
}
body {
  position: fixed; inset: 0;
  color: var(--text); font-family: var(--schrift); font-size: 14px; line-height: 1.35;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background:
    radial-gradient(ellipse at 50% 40%, #0d1220 0%, #05060b 60%, #020204 100%);
}
button { font-family: inherit; color: inherit; touch-action: manipulation; }
canvas.pix { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

#app {
  position: relative; margin: 0 auto; width: 100%; max-width: 520px;
  height: var(--app-h); height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: #000;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  box-shadow: 0 0 0 1px #141827, 0 0 80px rgba(0, 0, 0, 0.9);
}
@supports not (height: 100dvh) { #app { height: var(--app-h); } }

/* ---------- Kopfleiste ---------- */
#kopf {
  flex: 0 0 auto; display: flex; align-items: stretch; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 5px) 6px 5px;
  background: linear-gradient(#171a2b, #0b0d15);
  border-bottom: 2px solid var(--rand); box-shadow: 0 2px 0 #000; position: relative; z-index: 5;
}
.feld {
  background: var(--tafel); border: 2px solid var(--rand);
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 0 rgba(255, 255, 255, 0.05);
  min-height: 42px; display: flex; align-items: center; gap: 5px; padding: 0 6px;
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
}
#mondAnzeige { flex: 0 0 auto; min-width: 64px; }
#mondZahl { font-weight: 700; font-size: 17px; color: var(--akzent); text-shadow: 0 0 6px var(--akzent-glut); transition: transform .15s; display: inline-block; }
#mondZahl.plopp { transform: scale(1.18); }
#herzAnzeige { flex: 1 1 auto; min-width: 0; }
.balken { position: relative; flex: 1 1 auto; height: 16px; background: #160a12; border: 1px solid #000; box-shadow: inset 0 0 0 1px #3a1a2a; overflow: hidden; }
#herzBalken { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(#ff6b8a, #c2185b 55%, #7a0f3a); transition: width .25s; }
#herzBalken::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(0,0,0,.35) 7px 8px); }
#herzZahl { position: absolute; inset: 0; text-align: center; font-size: 12px; font-weight: 700; line-height: 14px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
#herzAnzeige.getroffen { animation: herzRuck .3s; border-color: var(--rot); }
@keyframes herzRuck { 0%,100% { transform: none; } 30% { transform: translateX(-2px); } 60% { transform: translateX(2px); } }

#welleKnopf {
  flex: 0 0 auto; width: 124px; flex-direction: column; align-items: stretch; justify-content: center; gap: 1px;
  padding: 2px 6px; cursor: pointer; text-align: left; background: #151223; border-color: #4a3a6e;
}
#welleKnopf .z1 { font-size: 12px; font-weight: 700; color: #e9dcff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#welleKnopf .z2 { font-size: 12px; color: var(--bernstein); white-space: nowrap; overflow: hidden; }
#welleKnopf:active { transform: translateY(1px); }
#welleKnopf.aktiv { background: #2a0e18; border-color: #8a2438; cursor: default; }
#welleKnopf.aktiv .z2 { color: #ff9aa6; }
#welleKnopf.naht { animation: wellePuls 1s infinite; }
@keyframes wellePuls { 50% { border-color: var(--bernstein); box-shadow: inset 0 0 12px rgba(255,179,71,.35); } }
.symbolKnopf { flex: 0 0 auto; width: 42px; justify-content: center; padding: 0; cursor: pointer; font-size: 18px; font-weight: 700; color: var(--text); }
.symbolKnopf:active { transform: translateY(1px); }
.symbolKnopf.an { border-color: var(--akzent); color: var(--akzent); }

/* ---------- Bühne mit Karte ---------- */
#buehne { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #020305; }
#karte { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#karte.ziehen { cursor: grabbing; }
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 85%, rgba(0,0,0,.85) 100%);
}
.versteckt { display: none !important; }

/* Erzähler */
#erzaehler {
  position: absolute; left: 8px; right: 8px; top: 8px; z-index: 6;
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px 10px 9px;
  background: rgba(9, 8, 16, 0.94); border: 2px solid #4b3a6a;
  box-shadow: 0 0 0 2px #000, 0 6px 18px rgba(0,0,0,.6), inset 0 0 18px rgba(120, 60, 180, .15);
  cursor: pointer; transition: opacity .25s, transform .25s;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
#erzaehler.weg { opacity: 0; transform: translateY(-8px); pointer-events: none; }
#rabe { width: 48px; height: 48px; flex: 0 0 48px; background: #120f1e; border: 2px solid #2d2442; }
.erzText { flex: 1 1 auto; min-width: 0; }
.erzName { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--violett); margin-bottom: 2px; }
#erzSpruch { font-size: 14.5px; line-height: 1.4; color: #eee8f8; min-height: 2.8em; }
#erzSpruch .rest { color: transparent; }

/* Kreaturen-Sprechblasen */
#kblasen { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.kblase {
  position: absolute; left: 0; top: 0; max-width: 190px; padding: 5px 8px;
  font-size: 13px; line-height: 1.3; color: #f2ecd9; background: rgba(14, 12, 10, .92);
  border: 2px solid #6b5a3a; box-shadow: 0 0 0 1px #000; will-change: transform; transition: opacity .3s;
}
.kblase::after { content: ""; position: absolute; left: calc(50% - 5px); bottom: -8px; border: 5px solid transparent; border-top-color: #6b5a3a; }
.kblase.wolf { border-color: #8a2b35; }
.kblase.wolf::after { border-top-color: #8a2b35; }
.kblase.irrlicht { border-color: #4f86d8; color: #e3efff; }
.kblase.irrlicht::after { border-top-color: #4f86d8; }
.kblase.aus { opacity: 0; }

/* Meldung */
#meldung {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 7;
  max-width: calc(100% - 24px); padding: 8px 12px; font-size: 14px; text-align: center;
  background: rgba(40, 6, 14, .94); color: #ffd6db; border: 2px solid var(--rot); box-shadow: 0 0 0 2px #000;
  pointer-events: none; transition: opacity .3s;
}
#meldung.gut { background: rgba(6, 30, 26, .94); color: #d8fff3; border-color: var(--akzent); }
#meldung.aus { opacity: 0; }

#pausenSchild {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  padding: 10px 22px; font-size: 20px; font-weight: 700; letter-spacing: 6px; color: var(--akzent);
  background: rgba(4, 6, 10, .8); border: 2px solid var(--akzent-dunkel); text-shadow: 0 0 8px var(--akzent-glut);
  cursor: pointer;
}

/* Infokarte */
#infokarte {
  position: absolute; left: 8px; bottom: 8px; z-index: 6; width: 230px; max-width: calc(100% - 16px);
  padding: 8px 10px 9px; background: rgba(10, 12, 20, .95); border: 2px solid var(--rand-hell);
  box-shadow: 0 0 0 2px #000, 0 4px 14px rgba(0,0,0,.6); font-size: 13px; cursor: pointer;
}
#infokarte h3 { margin: 0 0 4px; font-size: 15px; color: #fff; display: flex; align-items: center; gap: 6px; }
#infokarte h3 canvas { width: 24px; height: 24px; }
#infokarte .zustand { color: var(--bernstein); margin-bottom: 5px; }
#infokarte .hinweis { color: var(--text-matt); margin-top: 4px; }
.wert { display: grid; grid-template-columns: 74px 1fr 30px; gap: 6px; align-items: center; margin: 3px 0; }
.wert .b { height: 8px; background: #1a1c28; border: 1px solid #000; position: relative; overflow: hidden; }
.wert .b i { position: absolute; left: 0; top: 0; bottom: 0; }
.wert .zahl { text-align: right; color: var(--text-matt); font-size: 12px; }

/* ---------- Werkzeugleiste ---------- */
#werkzeuge {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 5px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: linear-gradient(#0b0d15, #151827); border-top: 2px solid var(--rand); box-shadow: 0 -2px 0 #000;
  position: relative; z-index: 5;
}
.wz {
  position: relative; min-height: 52px; min-width: 48px; padding: 3px 2px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--tafel2); border: 2px solid var(--rand); color: var(--text);
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 0 rgba(255,255,255,.05);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
  overflow: hidden;
}
.wz canvas { width: 24px; height: 24px; }
.wz .name { font-size: 12px; line-height: 14px; white-space: nowrap; }
.wz .kosten { position: absolute; top: 2px; right: 4px; font-size: 11px; font-weight: 700; color: var(--akzent); }
.wz.zauber { background: #17122a; border-color: #3d3263; }
.wz.zauber .kosten { color: #d7a8ff; }
.wz.gewaehlt {
  border-color: var(--akzent); background: #0f2a27; color: #fff;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(116, 242, 208, .35);
}
.wz.gewaehlt .name { color: var(--akzent); font-weight: 700; }
.wz.gewaehlt::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--akzent); box-shadow: 0 0 8px var(--akzent); }
.wz.teuer canvas, .wz.teuer .name { opacity: .38; }
.wz.teuer .kosten { color: var(--rot); }
.wz .abkling { position: absolute; left: 0; right: 0; top: 0; background: rgba(0, 0, 0, .62); pointer-events: none; height: 0; }
.wz .abklingZahl { position: absolute; left: 4px; top: 2px; font-size: 11px; font-weight: 700; color: #fff; }
.wz:active { transform: translateY(1px); }

/* ---------- Dialoge ---------- */
.schicht {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(2, 3, 7, .78); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.dialog {
  width: 100%; max-width: 380px; max-height: 100%; overflow: auto; padding: 18px 18px 16px;
  background: linear-gradient(#141726, #0b0d16); border: 3px solid var(--rand-hell);
  box-shadow: 0 0 0 3px #000, 0 0 40px rgba(116, 242, 208, .08), inset 0 0 0 2px #080a12;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  touch-action: pan-y; overscroll-behavior: contain;
}
.dialog h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: 2px; color: var(--akzent); text-shadow: 0 0 10px var(--akzent-glut); text-align: center; }
.dialog p { margin: 0 0 10px; font-size: 14px; }
.dialog .matt { color: var(--text-matt); font-size: 13px; }
.knoepfe { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.knopf {
  min-height: 48px; padding: 10px 14px; font-size: 16px; font-weight: 700; letter-spacing: .5px; cursor: pointer;
  background: #1a1e30; border: 2px solid #3d4566; color: var(--text);
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 0 rgba(255,255,255,.06);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.knopf:active { transform: translateY(1px); }
.knopf.haupt { border-color: var(--akzent); color: var(--akzent); background: #0e2622; text-shadow: 0 0 8px var(--akzent-glut); }
.knopf.gefahr { border-color: #a52a3c; color: #ffb3bd; background: #2a0c14; }
.knopf.klein { min-height: 40px; font-size: 14px; }
.zeilen { display: flex; gap: 8px; }
.zeilen .knopf { flex: 1 1 0; }
.version { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-matt); }
#updateHinweis { margin-top: 12px; padding: 8px 10px; border: 2px dashed #6b5a2a; color: #ffd98a; font-size: 13px; text-align: center; }
#updateHinweis .knopf { margin-top: 8px; width: 100%; }
.anleitung { font-size: 13.5px; line-height: 1.45; }
.anleitung ul { margin: 0 0 10px; padding-left: 18px; }
.anleitung li { margin: 3px 0; }
.anleitung b { color: var(--akzent); }

/* Titel */
#titel { background: radial-gradient(ellipse at 50% 35%, rgba(20, 12, 36, .55), rgba(2, 2, 6, .92) 75%); flex-direction: column; }
#titel .kasten { text-align: center; max-width: 360px; }
#titel h1 {
  margin: 0; font-size: 42px; letter-spacing: 6px; color: #e8fff7; font-weight: 800;
  text-shadow: 0 0 2px #fff, 0 0 12px rgba(116, 242, 208, .8), 0 0 30px rgba(182, 90, 230, .6), 3px 3px 0 #2a0b3a;
}
#titel .unter { margin: 8px 0 22px; color: #c9a8ff; letter-spacing: 2px; font-size: 14px; }
#titel .text { margin: 0 auto 22px; font-size: 14px; line-height: 1.5; color: #cfd3ea; max-width: 330px; }
#titel .knopf { min-width: 220px; font-size: 18px; }
#titelRabe { width: 96px; height: 96px; margin: 0 auto 12px; }

/* Spielende */
#spielende .dialog { border-color: #7a2438; box-shadow: 0 0 0 3px #000, 0 0 50px rgba(255, 50, 80, .15); }
#spielende h2 { color: #ff8a9a; text-shadow: 0 0 10px rgba(255, 60, 90, .6); }
.statistik { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 12px; font-size: 14px; }
.statistik b { color: var(--akzent); text-align: right; }
.zitat { display: flex; gap: 10px; align-items: flex-start; padding: 8px; background: #0a0810; border: 2px solid #3a2a50; font-size: 14px; line-height: 1.4; color: #eee8f8; }
.zitat canvas { width: 48px; height: 48px; flex: 0 0 48px; }

#updateSchicht .dialog { text-align: center; }
.laden { display: inline-block; width: 12px; height: 12px; background: var(--akzent); margin-left: 6px; animation: blinken .6s steps(2) infinite; }
@keyframes blinken { 50% { opacity: 0; } }

/* ---------- 0.2: Tempo, Zoom, Spielstand ---------- */
.symbolKnopf { width: 40px; }
.tempoKnopf { font-size: 15px; letter-spacing: -0.5px; }
#zoomKnoepfe {
  position: absolute; right: 8px; bottom: 12px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
}
.zoomKnopf {
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  font-size: 24px; font-weight: 700; line-height: 1; color: var(--text);
  background: rgba(14, 16, 26, 0.55); border: 2px solid rgba(69, 78, 114, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
  opacity: 0.8; touch-action: manipulation;
}
.zoomKnopf:active { transform: translateY(1px); background: rgba(15, 42, 39, 0.8); border-color: var(--akzent); }
@media (hover: hover) { .zoomKnopf:hover { opacity: 1; } }
#infokarte { max-width: calc(100% - 70px); }
.textfeld {
  width: 100%; min-height: 84px; resize: vertical; padding: 8px;
  font-family: var(--schrift); font-size: 13px; color: var(--text);
  background: #080a12; border: 2px solid var(--rand); outline: none;
  -webkit-user-select: text; user-select: text;
}
.textfeld:focus { border-color: var(--akzent-dunkel); }
.trenner {
  margin: 16px 0 6px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--violett);
  border-top: 1px solid var(--rand); padding-top: 10px;
}
.standMeldung { padding: 8px 10px; font-size: 13.5px; border: 2px solid var(--rot); background: rgba(40, 6, 14, .9); color: #ffd6db; }
.standMeldung.gut { border-color: var(--akzent); background: rgba(6, 30, 26, .9); color: #d8fff3; }
.knopf.leise { margin-top: 12px; min-width: 0; font-size: 14px; background: transparent; border-color: #2e3450; color: var(--text-matt); }
#titel .knopf.leise { min-width: 220px; font-size: 14px; }

/* schmale Handys (bis 400 px): Kopfleiste verdichten */
@media (max-width: 440px) {
  #herzAnzeige canvas { display: none; }
}
@media (max-width: 400px) {
  #kopf { gap: 3px; padding-left: 4px; padding-right: 4px; }
  .feld { padding: 0 4px; gap: 3px; }
  #mondAnzeige { min-width: 52px; }
  #mondAnzeige canvas { width: 18px !important; height: 18px !important; }
  #mondZahl { font-size: 15px; }
  #welleKnopf { width: 104px; padding: 2px 4px; }
  #welleKnopf .z1, #welleKnopf .z2 { font-size: 11px; }
  .symbolKnopf { width: 36px; font-size: 16px; }
  .tempoKnopf { font-size: 13px; }
  #herzAnzeige { min-width: 40px; }
}
#welleKnopf { width: 134px; }
#welleKnopf .z1 { letter-spacing: -0.3px; }
@media (max-width: 400px) {
  #welleKnopf { width: 112px; }
  #welleKnopf .z1 { letter-spacing: -0.5px; }
}

/* ---------- 0.2 B2: Werkzeugleiste in zwei Reihen ---------- */
#werkzeuge { display: flex; flex-direction: column; gap: 4px; grid-template-columns: none; }
.wzReihe { display: grid; gap: 4px; }
.bauReihe { grid-template-columns: repeat(6, minmax(48px, 1fr)); }
.zauberReihe { grid-template-columns: repeat(3, minmax(48px, 1fr)); }
.bauReihe .wz { min-height: 52px; padding: 4px 1px 2px; }
.bauReihe .wz .name { font-size: 11px; }
.bauReihe .wz .kosten { top: 1px; right: 3px; font-size: 10px; }
.zauberReihe .wz { min-height: 48px; flex-direction: row; justify-content: flex-start; gap: 6px; padding: 2px 8px; }
.zauberReihe .wz .name { font-size: 12.5px; }
.zauberReihe .wz .kosten { top: auto; bottom: 3px; right: 6px; font-size: 11px; }
.wz .zaehler { position: absolute; top: 2px; right: 6px; font-size: 11px; font-weight: 700; color: #d8ff6a; }
.wz .schloss { display: none; position: absolute; left: 3px; top: 3px; width: 14px !important; height: 14px !important; }
.wz.gesperrt .schloss { display: block; }
.wz.gesperrt canvas:not(.schloss), .wz.gesperrt .name { opacity: .35; }
.wz.gesperrt .kosten { color: var(--text-matt); }
.wz.empfohlen { animation: empfohlen 1.1s ease-in-out infinite; }
@keyframes empfohlen { 50% { border-color: #ffd84a; box-shadow: inset 0 0 0 1px #000, inset 0 0 16px rgba(255, 216, 74, .45), 0 0 0 1px #ffd84a; } }
#welleKnopf.empfohlen, .zoomKnopf.empfohlen { animation: empfohlen 1.1s ease-in-out infinite; }
.bauZeile {
  flex: 0 0 auto; padding: 5px 10px; font-size: 13px; line-height: 1.3; text-align: center;
  background: #0d1a18; color: #cfeee6; border-top: 2px solid var(--akzent-dunkel);
}
.bauZeile.warn { background: #2a0c14; color: #ffd6db; border-top-color: var(--rot); }
@media (max-width: 400px) {
  .bauReihe .wz .name { font-size: 10.5px; }
  .zauberReihe .wz { padding: 2px 5px; gap: 4px; }
  .zauberReihe .wz .name { font-size: 12px; }
}
.bauZeile { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none; }
#meldung { bottom: 42px; }
#infokarte { bottom: 40px; }
#zoomKnoepfe { bottom: 40px; }

/* ---------- Tutorial ---------- */
.aufgabe {
  position: absolute; left: 8px; right: 8px; top: 8px; z-index: 7;
  background: rgba(12, 16, 12, .95); border: 2px solid #8a7a2a; color: var(--text);
  box-shadow: 0 0 0 2px #000, 0 6px 16px rgba(0,0,0,.55); padding: 6px 8px 7px;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  cursor: pointer;
}
.aufgabeKopf { display: flex; align-items: center; gap: 8px; }
.aufgabeSchritt { font-size: 11px; letter-spacing: 1px; color: #ffd84a; white-space: nowrap; }
.aufgabeTitel { flex: 1 1 auto; font-size: 14px; font-weight: 700; color: #fff4c0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aufgabeLohn { font-size: 12px; font-weight: 700; color: var(--akzent); white-space: nowrap; }
.aufgabeKlapp { width: 36px; height: 32px; margin: -4px -4px -4px 0; border: 0; background: transparent; color: #ffd84a; font-size: 16px; cursor: pointer; }
.aufgabeKurz { font-size: 13.5px; margin-top: 4px; color: #eee8d0; }
.aufgabeFortschritt { font-size: 12.5px; margin-top: 2px; color: var(--bernstein); }
.aufgabeFortschritt:empty { display: none; }
.aufgabeAktion { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 13px; }
.aufgabeAktion .knopf { min-height: 36px; padding: 4px 10px; font-size: 13px; }
.knopf.leise2 { background: transparent; border-color: #3a3f55; color: var(--text-matt); }
.aufgabe.zu .aufgabeInhalt { display: none; }
.feier {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 9; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 16px; font-weight: 700; color: #eaffd0; text-shadow: 0 0 6px #000, 0 0 12px rgba(116,242,208,.8);
  animation: feierAuf 1.6s ease-out forwards;
}
.feier .haken { font-size: 56px; color: #8aff7a; text-shadow: 0 0 16px rgba(138,255,122,.9), 0 0 3px #000; }
@keyframes feierAuf { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }
.flugMond {
  position: fixed; z-index: 30; pointer-events: none; font-weight: 700; font-size: 15px; color: var(--akzent);
  text-shadow: 0 0 8px var(--akzent-glut), 0 1px 0 #000; transition: transform .9s cubic-bezier(.5,-0.3,.6,1), opacity .9s;
}
#erzaehler { top: var(--erz-oben, 8px); }
.zielPfeil { display: none; }
.kblase.helfer { border-color: #6a8a2a; color: #f0ffd8; }
.kblase.helfer::after { border-top-color: #6a8a2a; }
.raumZahlen { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; margin: 4px 0; font-size: 13px; }
.raumZahlen b { color: var(--akzent); text-align: right; }
.wirkungen { margin: 4px 0; padding-left: 16px; font-size: 12.5px; color: #cfe8d8; }
.wirkungen li { margin: 1px 0; }
#infokarte .hinweis.warn { color: #ffb3bd; }
#infokarte .hinweis.klein { font-size: 11.5px; }
#infokarte { max-height: calc(100% - 120px); overflow: auto; }
/* Aufgabenleiste unten ueber der Werkzeugleiste, standardmaessig kompakt */
.aufgabe { top: auto; bottom: 6px; padding: 5px 8px 6px; }
.aufgabe .aufgabeInhalt { display: none; }
.aufgabe.offen .aufgabeInhalt { display: block; }
.aufgabeKurz { margin-top: 2px; }
#buehne { --unten: 0px; }
.bauZeile { bottom: var(--unten); }
#meldung { bottom: calc(var(--unten) + 42px); }
#infokarte { bottom: calc(var(--unten) + 40px); }
#zoomKnoepfe { bottom: calc(var(--unten) + 40px); }
/* Lange Erzaehltexte (Tutorial) duerfen die Karte nicht zudecken */
#erzaehler { max-height: 34%; }
#erzaehler .erzText { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
#erzSpruch { overflow-y: auto; min-height: 0; scrollbar-width: none; }
#erzSpruch::-webkit-scrollbar { display: none; }

/* Mondlicht-Speicher und Unterhalt */
.mondWerte { display: inline-flex; align-items: baseline; gap: 1px; white-space: nowrap; }
.mondMax { font-size: 11px; font-weight: 700; color: var(--text-matt); }
#mondAnzeige.voll #mondZahl { color: var(--bernstein); text-shadow: 0 0 8px rgba(255,179,71,.6); }
#mondAnzeige.voll { border-color: #8a6a2a; }
#mondAnzeige.mangel { animation: mangel .9s ease-out; }
@keyframes mangel { 0%, 60% { border-color: var(--rot); box-shadow: inset 0 0 14px rgba(255,77,94,.6); } 100% { border-color: var(--rand); } }
@media (max-width: 400px) { #mondZahl { font-size: 14px; } .mondMax { font-size: 10px; } }
#infokarte { max-height: 46%; }
