:root {
  --bg: #141019;
  --panel: #231c2e;
  --panel-2: #2c2439;
  --line: #3d3250;
  --ink: #f4ebd9;
  --muted: #b8ab95;
  --gold: #e6b84f;
  --gold-d: #a8801f;
  --ok: #6cc47a;
  --bad: #ec7a64;
  --paper: #f3ead3;
  --paper-ink: #2b2219;
  --paper-line: #d6c7a4;
  --px: 'Pixelify Sans', ui-monospace, 'Courier New', monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'IBM Plex Serif', 'Iowan Old Style', Georgia, serif;
  --blue: #7ea6ff;
  --red: #ff8a9b;
  --blue-ink: #2449a0;
  --red-ink: #a3243a;
  --frame: 0 0 0 3px #000, 0 0 0 6px var(--ink), 0 10px 0 6px #000;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--ink);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
a { color: var(--gold); }
.muted { color: var(--muted); }

/* Pixelschrift nur für große Anzeige-Elemente – Fließtext bleibt in Plex Sans */
.brand, .logo, .chapter-title, .shout span, .boom span, .beep, .volk,
.panel h2, .title-screen h1, .end-score .big, .lesson-big, .info h3, .tenor-head {
  font-family: var(--px);
  font-variant-numeric: normal;
}

#app { max-width: 980px; margin: 0 auto; padding: 12px 16px 28px; }

/* ---------- HUD ---------- */

.hud { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 12px; }
.brand { font-weight: 700; font-size: 22px; letter-spacing: .05em; }
.brand span, .logo span { color: var(--gold); }
.case-label { color: var(--muted); font-size: 15px; flex: 1; min-width: 150px; }

.money {
  display: grid;
  grid-template-columns: auto 140px auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  font-size: 15px;
}
.money[hidden] { display: none; }
.money-k { color: var(--muted); }
.money-bar { height: 14px; background: #0c0a10; box-shadow: 0 0 0 2px var(--ink); overflow: hidden; }
.money-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 6px, #f6d57e 6px 8px); }
.money-val { font-weight: 600; min-width: 90px; }
.money.zero .money-val { color: var(--bad); }
.money-label { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }

.hud-right { display: flex; gap: 12px; align-items: center; }
.score-wrap { display: flex; align-items: center; gap: 6px; font-size: 17px; }
#score-icon svg { width: 22px; height: 22px; display: block; }
#akte-count { background: #1b1408; color: var(--gold); padding: 0 6px; }
#akte-btn.pulse { animation: pulse .5s steps(2) 3; }
@keyframes pulse { 50% { transform: scale(1.12); filter: brightness(1.25); } }

/* ---------- Bühne ---------- */

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  box-shadow: var(--frame);
  margin: 6px 6px 0;
  cursor: default;
}
.layer { position: absolute; inset: 0; }
.layer > svg { width: 100%; height: 100%; display: block; }
#bg { z-index: 1; }
#char {
  position: absolute; z-index: 2; bottom: 0; left: 50%;
  height: 78%; aspect-ratio: 40 / 44;
  transform: translateX(-50%);
}
#char svg { width: 100%; height: 100%; display: block; }
#char.enter { animation: enter .3s steps(4); }
@keyframes enter { from { transform: translateX(-50%) translateY(10%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
#fg { z-index: 3; pointer-events: none; }
#fx { z-index: 5; pointer-events: none; }
.black { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, #2a2233, #0b090e 70%); }

.stage.shake { animation: shake .4s steps(5); }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(3px, -2px); }
}

.chapter {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-content: center; gap: 6px; text-align: center;
  background: rgba(12, 9, 16, .9);
  animation: chapIn .35s steps(5);
  padding: 16px;
}
.chapter-kicker { color: var(--gold); letter-spacing: .2em; text-transform: uppercase; font-size: clamp(12px, 2vw, 17px); }
.chapter-title { font-size: clamp(28px, 6.2vw, 58px); font-weight: 700; text-shadow: 4px 4px 0 #000; }
.chapter-sub { color: var(--muted); font-size: clamp(14px, 2.4vw, 21px); }
.chapter.out { animation: chapOut .25s steps(3) forwards; }
@keyframes chapIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes chapOut { to { opacity: 0; } }

.shout { position: absolute; inset: 0; display: grid; place-items: center; }
.shout span, .boom span {
  font-weight: 700;
  font-size: clamp(34px, 9vw, 92px);
  color: #fff;
  background: var(--c);
  padding: .3em .7em .4em;
  clip-path: polygon(0 18%, 10% 0, 30% 12%, 48% 0, 62% 14%, 82% 2%, 92% 20%, 100% 45%, 92% 70%, 100% 100%, 74% 88%, 54% 100%, 36% 86%, 14% 100%, 8% 76%, 0 60%);
  text-shadow: 4px 4px 0 #000;
  transform: rotate(-6deg);
  animation: pop .3s steps(3);
}
.boom { position: absolute; inset: 0; display: grid; place-items: center; }
.boom span { --c: #e2472f; color: #ffe45c; }
@keyframes pop { from { transform: rotate(-6deg) scale(.3); } to { transform: rotate(-6deg) scale(1); } }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .35s steps(3) forwards; }
@keyframes flash { to { opacity: 0; } }
.beep {
  position: absolute; top: 38%;
  font-weight: 700; color: #ffec5c; text-shadow: 2px 2px 0 #000;
  font-size: clamp(14px, 2.8vw, 26px);
  animation: beep .8s steps(4) forwards;
}
@keyframes beep { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-40%); opacity: 0; } }

/* Rastanlage-Animation */
.scene-rast.go .truck { animation: truckBack 2.7s steps(27) forwards; }
.scene-rast.hit .truck { transform: translateX(48px); }
@keyframes truckBack { from { transform: translateX(0); } to { transform: translateX(48px); } }
.scene-rast .hyd { transform-box: fill-box; transform-origin: 50% 100%; }
.scene-rast.hit .hyd { transform: rotate(32deg) translateX(2px); transition: transform .3s steps(3); }
.scene-rast .water { display: none; }
.scene-rast.hit .water { display: inline; }
.drop { animation: spray 1.1s linear infinite; }
@keyframes spray {
  0% { transform: translate(0, 0); opacity: 1; }
  55% { transform: translate(calc(var(--dx) * .6), var(--dy)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) * .15)); opacity: 0; }
}

/* Hammer */
.gavel-wrap { position: absolute; left: 50%; top: 12%; width: 36%; transform: translateX(-50%); }
.gavel-wrap svg { width: 100%; display: block; }
.mallet { transform-box: view-box; transform-origin: 36px 17px; animation: strike .7s steps(5) 3 both; }
@keyframes strike { 0% { transform: rotate(35deg); } 60% { transform: rotate(0); } 80% { transform: rotate(6deg); } 100% { transform: rotate(0); } }
.volk {
  position: absolute; left: 0; right: 0; bottom: 10%;
  text-align: center; font-weight: 700; letter-spacing: .08em;
  font-size: clamp(20px, 4.6vw, 42px); color: var(--gold);
  text-shadow: 3px 3px 0 #000;
  opacity: 0; animation: fadeIn .6s steps(4) 2.2s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Textbox ---------- */

.box {
  position: relative;
  margin: 34px 6px 0;
  background: linear-gradient(#1c2340, #151a2f);
  box-shadow: var(--frame);
  padding: 24px 24px 20px;
  min-height: 150px;
  font-size: 19px;
  line-height: 1.55;
}
.box.can-advance { cursor: pointer; }
.box-name {
  position: absolute; top: -22px; left: 14px;
  background: var(--c, #5b5270); color: #fff;
  padding: 3px 12px 4px; font-weight: 700; font-size: 15px; line-height: 1.25;
  box-shadow: 0 0 0 3px #000;
}
.box-name small { display: block; font-weight: 500; font-size: 12.5px; opacity: .9; }
.box-body p { margin: 0 0 .5em; }
.box-body strong { color: var(--gold); }
.box-next { position: absolute; right: 16px; bottom: 8px; color: var(--gold); animation: bob .8s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.hint { color: var(--muted); font-size: 16px; }

.box[data-mode=info] { background: var(--paper); color: var(--paper-ink); }
.box[data-mode=info] strong { color: #8a4b12; }
.info-kicker { display: inline-block; background: var(--paper-ink); color: var(--paper); padding: 1px 8px; font-size: 14px; letter-spacing: .06em; }
.info h3 { margin: 8px 0 6px; font-size: 24px; }
.info p { font-size: 18px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; font-size: 18px;
  color: #1b1408; background: var(--gold);
  border: 0; padding: 8px 18px;
  box-shadow: 0 0 0 3px #000, inset 0 -4px 0 var(--gold-d);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:focus-visible, .opt:focus-visible, .ev:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-small { font-size: 15px; padding: 5px 12px; }
.btn-big { font-size: 23px; padding: 12px 28px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; justify-content: flex-end; }

/* Auswahl */
.prompt { font-weight: 600; font-size: 21px; }
.opts { display: grid; gap: 10px; margin-top: 12px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  font: inherit; font-size: 18px; line-height: 1.35; color: var(--ink);
  background: #262d4d; border: 0; box-shadow: 0 0 0 2px var(--ink);
  padding: 10px 14px; cursor: pointer;
}
.opt strong { color: var(--gold); }
.opt:hover:not(:disabled) { background: #33406e; box-shadow: 0 0 0 2px var(--gold); }
.opt-key { flex: none; width: 26px; height: 26px; display: grid; place-items: center; background: var(--gold); color: #1b1408; font-weight: 700; }
.opt:disabled { cursor: default; opacity: .5; }
.opt.is-correct { opacity: 1; box-shadow: 0 0 0 3px var(--ok); }
.opt.is-correct .opt-key { background: var(--ok); }
.opt.picked-bad { opacity: 1; box-shadow: 0 0 0 3px var(--bad); }
.opt.picked-bad .opt-key { background: var(--bad); }

.verdict { margin-top: 16px; padding: 10px 14px; border-left: 6px solid; font-size: 18px; }
.verdict.ok { border-color: var(--ok); background: rgba(108, 196, 122, .12); }
.verdict.bad { border-color: var(--bad); background: rgba(236, 122, 100, .12); }
.verdict.ok > strong:first-child { color: var(--ok); }
.verdict.bad > strong:first-child { color: var(--bad); }

.reveal { margin-top: 16px; background: var(--paper); color: var(--paper-ink); padding: 14px 18px; box-shadow: 0 0 0 3px #000; }
.reveal-head { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 18px; }
.reveal-head svg { width: 20px; height: 20px; }
.rn { background: var(--paper-ink); color: var(--paper); padding: 1px 8px; font-size: 14px; }
.reveal blockquote { font-family: var(--serif); font-size: 16.5px; line-height: 1.55; margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--paper-line); font-style: italic; }
.reveal strong { color: #8a4b12; }
.merksatz { font-size: 17px; margin: 8px 0 0; }
.merksatz span { display: inline-block; background: var(--gold); color: #1b1408; padding: 0 6px; margin-right: 8px; font-weight: 700; font-size: 14px; }

/* Waage */
.scale { display: block; width: min(320px, 80%); margin: 6px auto 0; overflow: visible; }
.scale text { font-family: var(--sans); font-size: 4.4px; font-weight: 700; }
.scale text.sub { font-size: 3.3px; font-weight: 500; fill: var(--muted); }
.scale .pan-l text:not(.sub) { fill: var(--blue); }
.scale .pan-r text:not(.sub) { fill: var(--red); }
.scale .beam, .scale .pan { transition: transform .6s steps(6); transform-box: view-box; }
.scale .beam { transform-origin: 40px 8px; }
.scale[data-tilt="-1"] .beam { transform: rotate(-8deg); }
.scale[data-tilt="-1"] .pan-l { transform: translateY(4px); }
.scale[data-tilt="-1"] .pan-r { transform: translateY(-4px); }
.scale[data-tilt="1"] .beam { transform: rotate(8deg); }
.scale[data-tilt="1"] .pan-l { transform: translateY(-4px); }
.scale[data-tilt="1"] .pan-r { transform: translateY(4px); }

/* Urteil */
.tenor { background: var(--paper); color: var(--paper-ink); }
.tenor-head { text-align: center; font-weight: 700; font-size: 22px; letter-spacing: .06em; margin-bottom: 8px; }
.tenor ol { font-family: var(--sans); font-size: 17px; line-height: 1.55; padding-left: 26px; }
.tenor li { margin-bottom: 6px; }
.tenor-note { font-size: 16px; border-top: 2px dashed var(--paper-line); padding-top: 10px; }

/* ---------- Overlay ---------- */

#overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 6, 12, .84);
  display: grid; place-items: center;
  padding: 16px; overflow: auto;
}
#overlay[hidden] { display: none; }
.panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--panel);
  box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--ink);
  padding: 26px;
  line-height: 1.45;
  font-size: 18px;
}
.panel-wide { width: min(880px, 100%); }
.panel h2 { margin: 0 0 8px; font-size: 28px; }
.panel h2 small { font-family: var(--sans); font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.panel strong { color: var(--gold); }
.close {
  position: absolute; top: 10px; right: 10px;
  font: inherit; font-size: 18px; width: 34px; height: 34px;
  background: transparent; color: var(--ink); border: 0; box-shadow: 0 0 0 2px var(--ink); cursor: pointer;
}
.feedback { min-height: 1.4em; margin: 10px 0 0; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

/* Akte */
.akte-prompt { color: var(--muted); }
.akte-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.ev {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  font: inherit; color: var(--ink);
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line);
  padding: 12px;
}
button.ev { cursor: pointer; }
button.ev:hover { box-shadow: 0 0 0 2px var(--gold); }
button.ev.wrong { box-shadow: 0 0 0 2px var(--bad); opacity: .7; }
.ev-icon svg { width: 44px; height: 44px; display: block; }
.ev-text { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.ev-text strong { font-size: 17px; color: var(--ink); }
.ev-text em { color: var(--muted); font-size: 13px; font-style: normal; }

/* Skizze: Stempel */
.stamp { position: absolute; right: 10px; bottom: 8px; color: #ff9d2e; font-family: ui-monospace, monospace; font-size: clamp(11px, 1.8vw, 16px); text-shadow: 0 0 3px #000; pointer-events: none; }
.caption { color: var(--muted); font-size: 14px; margin: 18px 0 0; }

/* Nachgestellte Skizze (ohne Spiel) */
.sketch { position: relative; margin: 16px 8px 8px; box-shadow: 0 0 0 3px #000, 0 0 0 10px #f3ead3, 0 0 0 13px #000; }
.sketch > svg { display: block; width: 100%; height: auto; }
.sk-mark, .sk-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #1b1408; font: 700 13px/1 'IBM Plex Sans', sans-serif; box-shadow: 0 0 0 2px #000; }
.sk-mark { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.sk-legend { list-style: none; margin: 20px 4px 0; padding: 0; display: grid; gap: 8px; font-size: 16px; }
.sk-legend li { display: flex; gap: 10px; align-items: flex-start; }
.sk-legend .sk-num { flex: none; margin-top: 1px; }

/* Minispiel: Regler */
.sl { margin-top: 12px; }
.sl-row { display: grid; gap: 6px; margin-bottom: 14px; }
.sl-row b { color: var(--gold); }
.sl input[type=range] { width: 100%; accent-color: var(--gold); height: 24px; }
.lifebar { display: flex; gap: 2px; height: 26px; margin: 6px 0 10px; padding: 3px; background: #0c0a10; box-shadow: 0 0 0 2px var(--ink); }
.lifebar i { flex: 1; background: var(--ok); }
.lifebar i.used { background: var(--bad); }
.life-legend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.life-legend i { display: inline-block; width: 12px; height: 12px; background: var(--ok); margin-right: 6px; vertical-align: -1px; }
.life-legend i.used { background: var(--bad); }
.calc { font-size: 26px; text-align: center; margin: 6px 0; }
.calc span { color: var(--muted); font-size: 20px; margin-left: 8px; }
.calc b { color: var(--gold); }
.example { color: var(--muted); font-size: 15px; text-align: center; }

/* ---------- Titel & Ende ---------- */

.panel-title { text-align: center; width: min(640px, 100%); }
.logo { font-size: clamp(36px, 8vw, 60px); font-weight: 700; letter-spacing: .04em; text-shadow: 4px 4px 0 #000; }
.title-art svg { width: 84px; height: auto; display: block; margin: 10px auto 4px; }
.case-no { display: inline-block; background: var(--gold); color: #1b1408; padding: 2px 10px; font-weight: 700; margin-top: 6px; }
.title-screen h1 { font-size: clamp(26px, 5vw, 38px); margin: 10px 0 4px; }
.title-screen .meta { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.title-screen .pitch { font-size: 18px; margin: 0 auto 22px; max-width: 520px; }
.controls { color: var(--muted); font-size: 14px; margin-top: 14px; }
.disclaimer { color: var(--muted); font-size: 13px; margin-top: 12px; }

.end { text-align: left; }
.end-kicker { color: var(--gold); letter-spacing: .18em; text-transform: uppercase; font-size: 14px; }
.end h2 { font-size: 34px; }
.end h3 { margin: 24px 0 10px; font-size: 22px; }
.end-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.end-score .big { font-size: 48px; font-weight: 700; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.end-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 16px; }
.end-log li span { display: inline-block; width: 22px; font-weight: 700; }
.end-log li.ok span { color: var(--ok); }
.end-log li.bad span { color: var(--bad); }
.lesson { margin-top: 20px; background: var(--paper); color: var(--paper-ink); padding: 16px 18px; box-shadow: 0 0 0 3px #000; }
.lesson strong { color: #8a4b12; }
.lesson-k { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.lesson-big { font-size: clamp(22px, 4vw, 30px); font-weight: 700; margin: 4px 0 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kp { background: var(--panel-2); padding: 12px; box-shadow: 0 0 0 2px var(--gold); font-size: 15.5px; }
.kp p { margin: 6px 0 0; }
.kp-n { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--gold); color: #1b1408; font-weight: 700; }
.trivia { margin-top: 20px; padding: 12px 14px; border-left: 6px solid var(--gold); background: rgba(230, 184, 79, .08); font-size: 16px; }

/* ---------- Toast & Footer ---------- */

#toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast-item { background: var(--paper); color: var(--paper-ink); padding: 8px 14px; box-shadow: 0 0 0 3px #000; font-size: 16px; animation: toastIn .3s steps(3); transition: opacity .3s; }
.toast-item.out { opacity: 0; }
.toast-k { background: var(--paper-ink); color: var(--paper); padding: 0 6px; margin-right: 6px; font-size: 13px; }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }

.foot { margin-top: 26px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  #app { padding: 10px 12px 24px; }
  .brand { font-size: 19px; }
  .case-label { display: none; }
  .money { grid-template-columns: auto 1fr auto; width: 100%; order: 3; }
  .hud-right { margin-left: auto; }
  .box { font-size: 17px; padding: 22px 14px 16px; min-height: 130px; }
  .prompt { font-size: 18px; }
  .opt { font-size: 16px; }
  .panel { padding: 20px 16px; font-size: 16px; }
  .panel h2 { font-size: 23px; }
  .calc { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Wer ist wer? ---------- */

.parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 0 6px 16px;
}
.party {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); padding: 8px 12px;
  box-shadow: 0 0 0 2px var(--line);
  border-left: 6px solid var(--pc);
  font-size: 15px; line-height: 1.3;
}
.party svg { width: 30px; height: 30px; flex: none; }
.party b { color: var(--pc); font-size: 16px; }
.party span { color: var(--muted); }
.party-k { --pc: var(--blue); }
.party-b { --pc: var(--red); }

/* Waage des Verfahrens */
.parties:has(.balance) { grid-template-columns: 1fr 124px 1fr; }
.balance { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bal-svg { width: 112px; height: auto; display: block; overflow: visible; }
.bal-beam { transform-box: view-box; transform-origin: 40px 8px; transform: rotate(calc(var(--t, 0) * 15deg)); transition: transform .9s steps(9); }
.bal-pan { transition: transform .9s steps(9); }
.bal-l { transform: translateY(calc(var(--t, 0) * -6.5px)); }
.bal-r { transform: translateY(calc(var(--t, 0) * 6.5px)); }
.balance.bump .bal-svg { animation: balbump .5s steps(4); }
@keyframes balbump { 30% { transform: translateY(2px); } 60% { transform: translateY(-1px); } }
.bal-note { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; min-height: 1.2em; }
.bal-note.to-k { color: var(--blue); }
.bal-note.to-b { color: var(--red); }

/* Parteibegriffe im Text farbig markieren */
.pk, .pb { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pk { color: var(--blue); }
.pb { color: var(--red); }
.box[data-mode=info] .pk, .reveal .pk, .lesson .pk, .tenor .pk, .toast-item .pk { color: var(--blue-ink); }
.box[data-mode=info] .pb, .reveal .pb, .lesson .pb, .tenor .pb, .toast-item .pb { color: var(--red-ink); }
.role { color: var(--muted); font-weight: 400; }
.box[data-mode=info] .role, .reveal .role { color: #6b5d45; }

/* ---------- Akte: Abschnitte & Gesetze ---------- */

.akte-section { margin: 18px 0 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.laws { display: grid; gap: 12px; margin-top: 10px; }
.law { background: var(--paper); color: var(--paper-ink); padding: 12px 14px; box-shadow: 0 0 0 3px #000; }
.law-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.law-norm { background: var(--paper-ink); color: var(--paper); padding: 1px 8px; font-weight: 700; font-size: 14px; }
.law-title { font-weight: 700; }
.law blockquote { font-family: var(--serif); font-style: italic; margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--paper-line); font-size: 15.5px; line-height: 1.5; }
.law-plain { margin: 0; font-size: 15px; }
.law-plain b { color: #8a4b12; }

@media (max-width: 640px) {
  .parties, .parties:has(.balance) { grid-template-columns: 1fr; gap: 8px; }
  .balance { flex-direction: row; gap: 10px; }
  .bal-svg { width: 76px; }
  .party { font-size: 14px; padding: 6px 10px; }
  .party svg { width: 24px; height: 24px; }
}
.scale rect { shape-rendering: crispEdges; }

/* ---------- Ton-Schalter ---------- */

#sound-btn { gap: 6px; }
#sound-icon svg { width: 18px; height: 18px; display: block; }
#sound-btn[aria-pressed=false] { color: var(--muted); box-shadow: 0 0 0 2px var(--line); }

/* ---------- Begründung wählen ---------- */

.reasons-hint { color: var(--muted); font-size: 16px; margin: 4px 0 0; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.reason {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  font: inherit; font-size: 16.5px; line-height: 1.4; color: var(--ink);
  background: #262d4d; border: 0; box-shadow: 0 0 0 2px var(--line);
  padding: 12px 14px; cursor: pointer;
}
.reason:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--gold); background: #2e3860; }
.reason:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.reason-check {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  background: #0c0a10; box-shadow: 0 0 0 2px var(--ink);
  display: grid; place-items: center; font-weight: 700; color: #1b1408;
}
.reason[aria-pressed=true] { box-shadow: 0 0 0 3px var(--gold); background: #33406e; }
.reason[aria-pressed=true] .reason-check { background: var(--gold); }
.reason[aria-pressed=true] .reason-check::after { content: "✓"; }
.reason-body { display: flex; flex-direction: column; gap: 6px; }
.reason-fb { font-size: 15px; color: var(--muted); }
.reason-fb:empty { display: none; }
.reason:disabled { cursor: default; }
.reason.r-ok { box-shadow: 0 0 0 3px var(--ok); }
.reason.r-ok .reason-check { background: var(--ok); }
.reason.r-ok .reason-check::after { content: "✓"; }
.reason.r-bad { box-shadow: 0 0 0 3px var(--bad); }
.reason.r-bad .reason-check { background: var(--bad); }
.reason.r-bad .reason-check::after { content: "✗"; }
.reason.r-missed { box-shadow: 0 0 0 2px var(--ok); border: 0; outline: 2px dashed var(--ok); outline-offset: 3px; }
.reason.r-off { opacity: .45; }
.reasons-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.reasons-count { color: var(--muted); font-size: 16px; }
.reasons-count.full { color: var(--gold); font-weight: 600; }
.reasons-count.bump { animation: pulse .3s steps(2) 2; }

@media (max-width: 640px) {
  .reason-grid { grid-template-columns: 1fr; }
  #sound-label { display: none; }
}

.prompt:focus { outline: none; }
.verdict.partial { border-color: var(--gold); background: rgba(230, 184, 79, .12); }
.verdict.partial > strong:first-child { color: var(--gold); }

/* ---------- Fallauswahl ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel-home { width: min(1120px, 100%); padding: 22px 24px 20px; }
.home { display: grid; gap: 20px; text-align: left; }
.home .logo { font-size: clamp(30px, 6vw, 46px); font-weight: 700; letter-spacing: .05em; line-height: 1.1; }
.home .pitch { margin: 8px 0 0; font-size: 18px; color: var(--muted); max-width: 46ch; }

/* Kopf mit Fortschritt */
.home-head { display: flex; gap: 18px 32px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.home-stats { display: grid; grid-template-columns: auto auto; gap: 6px 26px; align-items: end; min-width: 260px; }
.home-stat { display: flex; flex-direction: column; }
.home-stat .num { font-size: 30px; line-height: 1; color: var(--gold); }
.home-stat small { color: var(--muted); font-size: 13px; margin-top: 3px; }
.home-bar { grid-column: 1 / -1; height: 10px; background: #0c0a10; box-shadow: 0 0 0 2px var(--line); }
.home-bar i { display: block; height: 100%; background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-d); }

/* Empfehlung */
.home-next {
  display: grid; grid-template-columns: 132px 1fr; gap: 6px 22px; align-items: center;
  padding: 18px 22px; background: linear-gradient(#3a2f4d, #2c2439); box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--gold);
}
.home-next-art svg { width: 132px; height: auto; display: block; }
.home-next-body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.home-next-k { background: var(--gold); color: #1b1408; font-weight: 700; font-size: 13px; padding: 2px 10px; letter-spacing: .04em; text-transform: uppercase; }
.panel .home-next-title { font-family: var(--px); font-size: clamp(24px, 4vw, 34px); color: var(--ink); line-height: 1.15; font-weight: 700; }
.home-next-teaser { font-size: 17px; line-height: 1.5; max-width: 62ch; }
.home-next-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.home-next-cta .muted { font-size: 14px; }

/* Werkzeugleiste */
.home-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.home-search { flex: 1; min-width: 200px; }
.home-search input, .home-sort select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #0c0a10;
  border: 0; box-shadow: 0 0 0 2px var(--line); padding: 10px 14px;
}
.home-search input:focus, .home-sort select:focus { outline: none; box-shadow: 0 0 0 3px var(--gold); }
.home-search input::placeholder { color: var(--muted); }
.home-sort select { cursor: pointer; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  --tab: var(--gold);
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line); padding: 5px 12px 5px 10px;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip::before { content: ""; width: 10px; height: 10px; background: var(--tab); }
.chip em { font-style: normal; color: var(--muted); font-size: 13px; }
.chip:hover, .chip:focus-visible { box-shadow: 0 0 0 2px var(--tab); outline: none; }
.chip[aria-pressed=true] { background: var(--tab); color: #14101a; box-shadow: 0 0 0 2px #000; }
.chip[aria-pressed=true] em { color: #14101a; opacity: .75; }
.chip[data-topic=""][aria-pressed=true] { background: var(--gold); }
.home-count { color: var(--muted); font-size: 14px; margin: 12px 0 8px; }

/* Aktenschrank: jede Karte ist eine Akte mit Reiter */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 26px 16px; padding-top: 14px; }
.home-card {
  --tab: var(--gold);
  position: relative; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  font: inherit; color: var(--paper-ink); text-align: left; cursor: pointer;
  background: var(--paper); border: 0; padding: 30px 16px 14px; box-shadow: 0 0 0 2px #000;
  border-top: 5px solid var(--tab);
}
.home-card:hover, .home-card:focus-visible { outline: none; transform: translateY(-3px); box-shadow: 0 0 0 3px var(--gold), 0 8px 0 3px #000; }
.home-tab {
  position: absolute; top: -20px; left: 12px; display: flex; gap: 6px; align-items: center;
  background: var(--tab); color: #14101a; font-weight: 700; font-size: 13px; padding: 2px 10px; box-shadow: 0 0 0 2px #000;
}
.home-badge { font-size: 11px; background: #14101a; color: var(--paper); padding: 0 6px; letter-spacing: .03em; }
.home-badge.new { background: #e2472f; color: #fff; }
.home-art { position: absolute; top: 12px; right: 12px; opacity: .95; }
.home-art svg { width: 52px; height: auto; display: block; }
.panel .home-title { font-size: 19px; line-height: 1.25; color: var(--paper-ink); padding-right: 64px; min-height: 2.5em; }
.home-court { color: #6a5b45; font-size: 14px; }
.home-teaser { font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.home-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.home-tags i { font-style: normal; font-size: 12px; font-weight: 600; padding: 1px 8px; border-left: 6px solid var(--tab); background: rgba(20, 16, 26, .09); color: var(--paper-ink); }
.home-next .home-tags i { background: rgba(255, 255, 255, .1); color: var(--ink); }
.home-foot { margin-top: auto; padding-top: 8px; width: 100%; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #6a5b45; border-top: 2px dashed var(--paper-line); }
.home-status { font-weight: 700; font-size: 13px; }
.home-status.open { color: #8a4b12; }
.home-status.good { color: #1e7a37; }
.home-status.mid { color: #9a6a12; }
.home-card.played { background: #e6dfc8; }
.home-empty { grid-column: 1 / -1; color: var(--muted); padding: 24px 0; text-align: center; }

/* Fuß */
.home-foot-note { border-top: 2px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.home-me { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.home-me .avatar-pick { margin: 0; justify-content: flex-start; }
.home-me .avatar { flex-direction: row; min-width: 0; padding: 4px 12px 4px 6px; gap: 8px; }
.home-me .avatar-img svg { width: 36px; height: 40px; }

@media (max-width: 640px) {
  .panel-home { padding: 16px 14px 14px; }
  .home-next { grid-template-columns: 1fr; padding: 14px; }
  .home-next-art svg { width: 84px; }
  .home-stats { min-width: 0; width: 100%; }
  .home-grid { grid-template-columns: 1fr; }
  .panel .home-title { min-height: 0; }
}

/* ---------- Golfplatz-Animation ---------- */

.scene-golf.go .walker { animation: walkDown 2.7s steps(18) forwards; }
.scene-golf.fall .walker { transform: translate(62px, 6px); }
@keyframes walkDown {
  0% { transform: translate(0, 0); }
  45% { transform: translate(34px, 0); }
  100% { transform: translate(62px, 6px); }
}
.scene-golf .golfer, .scene-golf .trolley { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .3s steps(3); }
.scene-golf.fall .golfer { transform: rotate(78deg) translate(4px, 2px); }
.scene-golf.fall .trolley { transform: rotate(35deg) translateX(3px); }

/* ---------- Fußball-Animation (Fall 07) ---------- */

.scene-pitch .pk-in, .scene-pitch .bL-in, .scene-pitch .bR-in { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .3s steps(3); }
.scene-pitch .bR { display: none; }
.scene-pitch.v-pr .bR { display: inline; }
.scene-pitch.v-pr .bL { display: none; }
.scene-pitch .legA { visibility: hidden; }
.scene-pitch.go .legA { animation: legA .3s steps(1) infinite; }
.scene-pitch.go .legB { animation: legB .3s steps(1) infinite; }
.scene-pitch.hit .legA { animation: none; visibility: hidden; }
.scene-pitch.hit .legB { animation: none; visibility: visible; }
@keyframes legA { 0% { visibility: visible; } 50% { visibility: hidden; } }
@keyframes legB { 0% { visibility: hidden; } 50% { visibility: visible; } }
.scene-pitch.hit .pk-in { transform: rotate(-80deg); }

/* Prolog: beide laufen zum Ball */
.scene-pitch.v-s.go .pk { animation: k-s 2.2s steps(22) forwards; }
.scene-pitch.v-s.go .bL { animation: b-s 2.2s steps(22) forwards; }
.scene-pitch.v-s.go .ball { animation: ball-s 2.2s steps(22) forwards; }
@keyframes k-s { to { transform: translateX(-48px); } }
@keyframes b-s { to { transform: translateX(-52px); } }
@keyframes ball-s { 0% { transform: translate(0, 0); } 45% { transform: translate(0, 71px); } 60% { transform: translate(-6px, 63px); } 75% { transform: translate(-12px, 71px); } 100% { transform: translate(-22px, 71px); } }

/* Version des Klägers: Tritt von hinten */
.scene-pitch.v-kl.go .pk { animation: k-kl 2.5s steps(25) forwards; }
.scene-pitch.v-kl.go .bL { animation: b-kl 2.5s steps(25) forwards; }
.scene-pitch.v-kl.go .bL-in { animation: slide-kl 2.5s steps(5) forwards; }
.scene-pitch.v-kl.go .ball { animation: ball-kl 2.5s steps(25) forwards; }
@keyframes k-kl { to { transform: translateX(-52px); } }
@keyframes b-kl { 0% { transform: translateX(0); } 76% { transform: translateX(-56px); } 100% { transform: translateX(-68px); } }
@keyframes slide-kl { 0%, 76% { transform: rotate(0); } 100% { transform: rotate(72deg); } }
@keyframes ball-kl { 0% { transform: translate(0, 0); } 40% { transform: translate(0, 71px); } 52% { transform: translate(0, 62px); } 64% { transform: translate(0, 71px); } 100% { transform: translate(-24px, 71px); } }

/* Version des Beklagten: Ball gespielt, Kläger stürzt */
.scene-pitch.v-bk.go .pk { animation: k-bk 2.3s steps(23) forwards; }
.scene-pitch.v-bk.go .bL { animation: b-bk 2.3s steps(23) forwards; }
.scene-pitch.v-bk.go .bL-in { animation: step-bk 2.3s steps(3) forwards; }
.scene-pitch.v-bk.go .ball { animation: ball-bk 2.3s steps(23) forwards; }
.scene-pitch.v-bk.hit .bL-in { animation: none; transform: rotate(-80deg); }
@keyframes k-bk { to { transform: translateX(-44px); } }
@keyframes b-bk { 0% { transform: translateX(0); } 65% { transform: translateX(-78px); } 100% { transform: translateX(-80px); } }
@keyframes step-bk { 0%, 65% { transform: rotate(0); } 100% { transform: rotate(-25deg); } }
@keyframes ball-bk { 0% { transform: translate(0, 0); } 40% { transform: translate(0, 71px); } 52% { transform: translate(0, 62px); } 60% { transform: translate(0, 71px); } 65% { transform: translate(0, 71px); } 100% { transform: translate(-70px, 20px); } }

/* Pressschlag: beide gegeneinander zum Ball */
.scene-pitch.v-pr.go .pk { animation: k-pr 2s steps(20) forwards; }
.scene-pitch.v-pr.go .bR { animation: b-pr 2s steps(20) forwards; }
.scene-pitch.v-pr.go .ball { animation: ball-pr 2s steps(20) forwards; }
.scene-pitch.v-pr.hit .pk-in { transform: rotate(80deg); }
@keyframes k-pr { to { transform: translateX(-40px); } }
@keyframes b-pr { to { transform: translateX(34px); } }
@keyframes ball-pr { 0% { transform: translate(15px, 0); } 55% { transform: translate(15px, 71px); } 65% { transform: translate(15px, 62px); } 75% { transform: translate(15px, 71px); } 100% { transform: translate(15px, 71px); } }

/* ---------- Fall 08: Wohnzimmer und Spielplan ---------- */

.scene-sofa .screen { opacity: 0; }
.scene-sofa.on .screen { opacity: 1; transition: opacity .2s steps(2); }
.scene-sofa.on .tp1 { animation: tp1 3s steps(30) infinite alternate; }
.scene-sofa.on .tp2 { animation: tp2 3s steps(30) infinite alternate; }
.scene-sofa.on .tball { animation: tball 3s steps(30) infinite alternate; }
@keyframes tp1 { from { transform: translate(0, 0); } to { transform: translate(14px, 3px); } }
@keyframes tp2 { from { transform: translate(0, 2px); } to { transform: translate(-12px, -3px); } }
@keyframes tball { from { transform: translate(-6px, 4px); } to { transform: translate(8px, -3px); } }
.adbanner {
  position: absolute; left: 6%; right: 6%; bottom: 8%; padding: 10px 14px; border-radius: 4px;
  background: rgba(20, 24, 40, .92); color: #fff; box-shadow: 0 0 0 2px #ffe45c;
  animation: adin .5s steps(5) both; font-family: var(--sans); line-height: 1.35;
}
.adbanner small { display: block; color: #ffe45c; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.adbanner span { font-weight: 700; font-size: clamp(14px, 2.6vw, 22px); }
@keyframes adin { from { transform: translateX(60%); opacity: 0; } to { transform: none; opacity: 1; } }

.scene-plan .card { transition: transform 1.2s steps(12); }
.scene-plan.p1 .g1 { transform: translate(-2px, 40px); }
.scene-plan.p1 .g2 { transform: translate(-4px, 40px); }
.scene-plan.p1 .g3 { transform: translate(-24px, 40px); }
.scene-plan.p1 .g4 { transform: translate(46px, 26px); }
.scene-plan.p1 .s4 { transform: translate(0, 40px); }
.scene-plan.p2 .s1 { transform: translate(50px, 40px); }
.scene-plan.p2 .s2 { transform: translate(24px, 40px); }
.scene-plan.p2 .s3 { transform: translate(-22px, 54px); }
.scene-plan.p2 .g5 { transform: translate(24px, 40px); }
.daylabels { position: absolute; left: 0; right: 0; top: 40%; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 5%; text-align: center; font: 700 clamp(12px, 2.2vw, 18px) var(--sans); color: #fff; gap: 2%; }
.daylabels span { text-shadow: 0 1px 0 #000; }
.pickbadge { position: absolute; left: 50%; transform: translateX(-50%); top: 3%; padding: 5px 12px; border-radius: 4px; font: 700 clamp(13px, 2.4vw, 20px) var(--sans); color: #fff; box-shadow: 0 0 0 2px #000; animation: adin .4s steps(4) both; }
.pickbadge.b1 { background: #3f6fc2; }
.pickbadge.b2 { background: #b0394d; }

/* ---------- Fall 09: Ehrung und Onlineshop ---------- */

.scene-ehrung .conf { opacity: 0; }
.scene-ehrung.fire .conf { animation: conf 1.8s steps(18) forwards; }
@keyframes conf { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 42px)); } }
.scene-ehrung.go .cannon { animation: cannon-in .8s steps(8) both; }
.scene-ehrung.fire .cannon { animation: recoil .35s steps(3) both; }
@keyframes cannon-in { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes recoil { 0% { transform: translateX(0); } 40% { transform: translateX(-4px); } 100% { transform: translateX(0); } }
.awardtitle { position: absolute; left: 0; right: 0; top: 10%; text-align: center; font: 700 clamp(20px, 4.4vw, 40px) var(--px); color: #ffe45c; text-shadow: 0 3px 0 #7a1f2a, 0 0 0 #000; animation: adin .5s steps(5) both; }
.shopcard {
  position: absolute; left: 50%; top: 32%; width: 42%; padding: 8px 10px 10px; background: #f9fafc; font-family: var(--sans); color: #1b2333;
  animation: adin .4s steps(4) both;
}
.shopcard b { display: block; font-size: clamp(12px, 2.3vw, 19px); line-height: 1.25; }
.shopcard em { display: block; font-style: normal; color: #4a5568; font-size: clamp(11px, 1.9vw, 15px); margin-top: 4px; }
.shopcard .price { display: block; font-weight: 700; font-size: clamp(18px, 3.4vw, 30px); color: #1e6b32; margin-top: 8px; }

/* ---------- Fälle 10–13: Straße, Bildschirm, Karte, Garten, Praxis ---------- */

.scene-protest .qc { transform: translateX(-160px); }
.scene-protest.go .c1 { animation: qc1 2.2s steps(22) forwards; }
.scene-protest.go .c2 { animation: qc2 2.6s steps(26) forwards; }
.scene-protest.go .c3 { animation: qc3 3s steps(30) forwards; }
@keyframes qc1 { to { transform: translateX(78px); } }
@keyframes qc2 { to { transform: translateX(10px); } }
@keyframes qc3 { to { transform: translateX(-58px); } }
.scene-protest.honk .c1 { animation: jig1 .2s steps(1) infinite; }
.scene-protest.honk .c2 { animation: jig2 .2s steps(1) infinite; }
.scene-protest.honk .c3 { animation: jig3 .2s steps(1) infinite; }
@keyframes jig1 { 0% { transform: translate(78px, 0); } 50% { transform: translate(78px, -1px); } }
@keyframes jig2 { 0% { transform: translate(10px, 0); } 50% { transform: translate(10px, -1px); } }
@keyframes jig3 { 0% { transform: translate(-58px, 0); } 50% { transform: translate(-58px, -1px); } }
.ytcomment {
  position: absolute; left: 6%; right: 6%; bottom: 7%; padding: 10px 14px; background: #ffffff; color: #1b1b22; border-radius: 3px;
  box-shadow: 0 0 0 3px #e53935; font-family: var(--sans); line-height: 1.35; animation: adin .4s steps(4) both;
}
.ytcomment small { display: block; color: #6b6b78; font-size: 12px; margin-bottom: 4px; }
.ytcomment .typed { font-weight: 600; font-size: clamp(14px, 2.6vw, 21px); }
.caret { display: inline-block; width: 2px; height: 1em; background: #1b1b22; margin-left: 2px; vertical-align: text-bottom; animation: blink .8s steps(1) infinite; }

.scene-karte .dot { opacity: 0; }
.scene-karte.r1 .rt1 .dot, .scene-karte.r2 .rt2 .dot, .scene-karte.r3 .rt3 .dot { animation: dotin .01s forwards; animation-delay: var(--d, 0s); }
@keyframes dotin { to { opacity: 1; } }
.scene-karte.r2 .rt1 .dot { opacity: .35; }
.scene-karte.r3 .rt1 .dot, .scene-karte.r3 .rt2 .dot { opacity: .35; }
.mapcap {
  position: absolute; left: 4%; right: 4%; bottom: 5%; padding: 8px 12px; background: rgba(20, 16, 26, .92); color: #fff;
  font: 600 clamp(13px, 2.4vw, 19px)/1.35 var(--sans); box-shadow: 0 0 0 2px #ffe45c; animation: adin .4s steps(4) both;
}
.mapcap b { padding: 0 6px; color: #14101a; }
.mapcap b.g { background: #5fd08a; }
.mapcap b.r { background: #ff8a76; }
.mapcap b.b { background: #7fb0ff; }

.scene-garten .nb { transform-box: fill-box; transform-origin: 50% 100%; }
.scene-garten.go .nb { animation: nbwalk 1.8s steps(18) forwards; }
@keyframes nbwalk { from { transform: translateX(0); } to { transform: translateX(46px); } }
.scene-garten .led { animation: blink 1s steps(1) infinite; }
.scene-garten .cone { opacity: 0; }
.scene-garten.go .cone { opacity: 1; }
.scene-garten .flash { opacity: 0; }
.scene-garten.shot .flash { animation: flashpop .5s steps(5) forwards; }
@keyframes flashpop { 0% { opacity: .95; } 100% { opacity: 0; } }

.scene-tierarzt .catsit { visibility: hidden; }
.scene-tierarzt.up .catsit { visibility: visible; }
.scene-tierarzt.up .catlie { visibility: hidden; }
.scene-tierarzt .beat { animation: none; }
.scene-tierarzt.go .beat { animation: beatrun 2.4s linear infinite; }
.scene-tierarzt.stable .beat { animation-duration: 1.2s; }
@keyframes beatrun { to { transform: translateX(-60px); } }

/* ---------- Figurenwahl ---------- */

.avatar-pick { display: flex; gap: 12px; justify-content: center; margin-bottom: 6px; }
.avatar {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink);
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line);
  padding: 8px 18px 10px; cursor: pointer; min-width: 120px;
}
.avatar:hover, .avatar:focus-visible { box-shadow: 0 0 0 2px var(--gold); outline: none; }
.avatar[aria-pressed=true] { box-shadow: 0 0 0 3px var(--gold); background: #342a44; }
.avatar[aria-pressed=true] span:last-child::before { content: "✓ "; color: var(--gold); }
.avatar-img svg { width: 64px; height: 70px; display: block; }

/* ---------- Minispiel: Rechenweg ---------- */

.steps { margin-top: 12px; display: grid; gap: 14px; }
.ledger { list-style: none; margin: 0; padding: 12px 14px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 0 0 3px #000; display: grid; gap: 6px; font-size: 16px; }
.ledger:empty { display: none; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--paper-line); padding-bottom: 4px; }
.ledger li:last-child { border-bottom: 0; font-weight: 700; }
.ledger b { white-space: nowrap; }
.ledger strong { color: #8a4b12; }
.step-q { font-size: 18px; margin: 0 0 10px; }
.step-n { display: inline-block; background: var(--gold); color: #1b1408; font-weight: 700; font-size: 13px; padding: 1px 8px; margin-right: 6px; }
.step-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.step-opts .btn.chosen-bad { color: var(--bad); box-shadow: 0 0 0 2px var(--bad); text-decoration: line-through; opacity: 1; }

/* ---------- Minispiel: Schätzung ---------- */

.factors { margin: 10px 0 0; padding-left: 20px; font-size: 16px; display: grid; gap: 4px; }
.est { margin-top: 16px; }
.est-val { font-size: 30px; font-weight: 700; text-align: center; color: var(--gold); }
.est input[type=range] { width: 100%; accent-color: var(--gold); height: 26px; }
.est-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.est-track { position: relative; height: 26px; margin-top: 10px; background: #0c0a10; box-shadow: 0 0 0 2px var(--ink); }
.est-track i { position: absolute; top: -6px; width: 6px; height: 38px; margin-left: -3px; }
.est-you { background: var(--blue); }
.est-court { background: var(--gold); }
.est-track i::after { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-size: 12px; font-style: normal; white-space: nowrap; }
.est-you::after { content: "Du"; color: var(--blue); }
.est-court::after { content: "Gericht"; color: var(--gold); }
.est-track + * { margin-top: 26px; }

/* ---------- Szene: Abschleppen ---------- */

.scene-str .tow { transform: translateX(100px); }
.scene-str.arrive .tow { animation: towIn 2.6s steps(26) forwards; }
@keyframes towIn { from { transform: translateX(100px); } to { transform: translateX(0); } }
.scene-str .car { transform-box: fill-box; transform-origin: 0% 100%; }
.scene-str.hooked .car { transform: rotate(-5deg); }
.scene-str.leave .tow { animation: towOut 2s steps(20) forwards; }
.scene-str.leave .car { animation: carOut 2s steps(20) forwards; }
@keyframes towOut { from { transform: translateX(0); } to { transform: translateX(130px); } }
@keyframes carOut { from { transform: rotate(-5deg); } to { transform: translateX(130px) rotate(-5deg); } }
.scene-str .blink { animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.puff { animation: puff 1.8s linear infinite; }
@keyframes puff { from { transform: translate(0, 0); opacity: .9; } to { transform: translate(-3px, -10px); opacity: 0; } }
.scene-str.leave .puff { display: none; }

/* ---------- Szene: Rodelbahn ---------- */

.scene-rodel.go .sled { animation: sledDown 2.8s steps(28) forwards; }
@keyframes sledDown { from { transform: translate(0, 0); } to { transform: translate(92px, 27.6px); } }
.scene-rodel.hit .sled { animation: none; transform: translate(96px, 30px); }
.scene-rodel.go .walker { animation: walkUp 2.8s steps(8) forwards; }
@keyframes walkUp { from { transform: translate(0, 0); } to { transform: translate(-6px, -1.8px); } }
.scene-rodel .walker { transform-box: fill-box; transform-origin: 50% 100%; }
.scene-rodel.hit .walker { animation: none; transform: translate(10px, 6px) rotate(80deg); transition: transform .25s steps(3); }
.scene-rodel .burst { display: none; }
.scene-rodel.hit .burst { display: inline; }
.flake { animation: flake .9s ease-out forwards; }
@keyframes flake { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.beep.warn { animation-duration: 1.4s; color: #fff; font-size: clamp(16px, 3.2vw, 30px); }

/* ---------- Szene: Elefantenrennen ---------- */

.scene-bahn.go .dashes { animation: dashes .32s steps(4) infinite; }
@keyframes dashes { to { transform: translateX(-16px); } }
.scene-bahn.go .posts { animation: posts 6s linear forwards; }
@keyframes posts { to { transform: translateX(-340px); } }
.scene-bahn.go .over { animation: creep 6s linear forwards; }
@keyframes creep { to { transform: translateX(4px); } }
.watch {
  position: absolute; top: 8%; left: 4%;
  background: #0c0a10; color: #ffe45c; font-family: var(--px); font-weight: 700;
  font-size: clamp(18px, 4vw, 34px); padding: 4px 14px; box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Ziffern in Pixel-Überschriften: gut lesbare Schrift */
.num { font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.watch { font-family: var(--sans); }

/* ---------- Szene: Latte Macchiato ---------- */

.scene-cafe .fill { transform-box: fill-box; transform-origin: 50% 100%; }
.scene-cafe.drink .fill { animation: drink 2.5s steps(10) forwards; }
@keyframes drink { to { transform: scaleY(0); } }
.scene-cafe .tongue { transform: translateY(-70px); }
.scene-cafe.lick .tongue { animation: lick .9s steps(6) forwards; }
@keyframes lick { from { transform: translateY(-70px); } to { transform: translateY(0); } }

/* ---------- Recherche (Nachschlagen) ---------- */

#research {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8, 6, 12, .84);
  display: grid; place-items: center;
  padding: 16px; overflow: auto;
}
#research[hidden] { display: none; }
.lookup-row { margin: 2px 0 8px; }
.actions .lookup { margin-left: 10px; }
.lookup { display: inline-flex; align-items: center; gap: 6px; }
.lookup svg, #research-btn svg { width: 18px; height: 18px; flex: none; }
#research-btn { display: inline-flex; align-items: center; gap: 6px; }
.rs-panel { height: min(760px, calc(100vh - 32px)); display: flex; flex-direction: column; }
.rs-panel h2 { display: flex; align-items: center; gap: 10px; flex: none; }
.rs-ico svg { width: 30px; height: 30px; display: block; }
.rs-bar { display: flex; align-items: center; gap: 12px; flex: none; }
#rs-q, #lx-q {
  flex: 1; min-width: 0; font: inherit; font-size: 18px; color: var(--paper-ink); background: var(--paper);
  border: 0; padding: 10px 12px; box-shadow: 0 0 0 3px #000;
}
#rs-q:focus-visible, #lx-q:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#rs-count { font-size: 15px; color: var(--muted); white-space: nowrap; }
.rs-tabs { display: flex; gap: 6px; margin: 14px 0 8px; flex: none; flex-wrap: wrap; }
.rs-tabs button {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--panel-2);
  border: 0; padding: 6px 14px; cursor: pointer; box-shadow: 0 0 0 2px var(--line);
}
.rs-tabs button[aria-selected=true] { background: var(--gold); color: #1a1408; box-shadow: 0 0 0 2px #000; }
.rs-tips { font-size: 15px; color: var(--muted); margin: 2px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: none; }
#rs-results { overflow: auto; flex: 1; min-height: 0; padding: 4px 4px 2px 0; }
.rs-hint { color: var(--ink); font-size: 16px; margin: 8px 0; }
.rs-hint.muted { color: var(--muted); }
.rs-hint.bad { color: var(--bad); }
.rs-hint a { color: var(--gold); }
.rs-card { background: var(--paper); color: var(--paper-ink); padding: 10px 14px; margin: 0 0 10px; box-shadow: 0 0 0 3px #000; }
.rs-card header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-bottom: 4px; font-size: 14px; }
.rs-src { background: var(--paper-ink); color: var(--paper); padding: 1px 8px; font-weight: 700; }
.rs-law .rs-src { background: #8a4b12; }
.rs-akte .rs-src { background: #2f6a8a; }
.rs-rn { font-weight: 700; color: #8a4b12; }
.rs-title { font-weight: 700; }
.rs-text { margin: 0; font-size: 16px; line-height: 1.5; }
.rs-text mark { background: #ffe07a; color: #1a1408; padding: 0 2px; }
.rs-more { font: inherit; font-size: 14px; color: #8a4b12; background: none; border: 0; padding: 4px 0 0; cursor: pointer; text-decoration: underline; }
.end-lookups { color: var(--muted); font-size: 15px; margin: -6px 0 12px; }
@media (max-width: 640px) {
  .rs-panel { padding: 18px 14px; }
  #research-btn span:last-child { display: none; }
  .actions .lookup { margin: 8px 0 0; }
}

/* Minispiel vorzeitig beenden */
.close.skip { font-size: 16px; }
.end-log li.skip { color: var(--muted); }
.end-log li.skip em { font-size: 14px; }

/* ---------- Begriffe (anklickbare Wörter) ---------- */

.gl { cursor: help; text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--gold); }
.gl:hover, .gl:focus-visible { background: rgba(230, 184, 79, .22); outline: none; }
.box[data-mode=info] .gl, .reveal .gl, .lesson .gl, .tenor .gl, .law .gl, .rs-card .gl { text-decoration-color: #8a4b12; }
#gloss {
  position: fixed; z-index: 90; width: min(340px, calc(100vw - 16px));
  background: var(--paper); color: var(--paper-ink); padding: 12px 14px 12px;
  box-shadow: 0 0 0 3px #000, 0 6px 22px rgba(0, 0, 0, .55); font-size: 16px; line-height: 1.45;
}
#gloss[hidden] { display: none; }
#gloss p { margin: 6px 0 8px; }
.gl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gl-head strong { color: #8a4b12; font-size: 17px; }
.gl-x { font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; color: var(--paper-ink); padding: 0 4px; }
.rs-term .rs-src { background: #6d4bb0; }
.rs-term .rs-text { white-space: pre-line; }
.rs-focus { box-shadow: 0 0 0 3px var(--gold); }

/* ---------- Menü, Einstellungen, Verlauf, Einstieg ---------- */

#sheet {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(8, 6, 12, .84);
  display: grid; place-items: center;
  padding: 16px; overflow: auto;
}
#sheet[hidden] { display: none; }
.box, .panel, .parties { zoom: var(--fs, 1); }
#gloss { font-size: calc(16px * var(--fs, 1)); }
body.reduced *, body.reduced *::before, body.reduced *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

#menu-btn { display: inline-flex; align-items: center; gap: 4px; }
.skip-btn {
  position: absolute; right: 12px; top: -18px; display: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: #2c2439;
  border: 0; padding: 4px 12px; cursor: pointer; box-shadow: 0 0 0 3px #000;
}
.skip-btn:hover, .skip-btn:focus-visible { background: var(--gold); color: #1a1408; }
.box[data-mode=say] .skip-btn { display: block; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.set-grid { display: grid; gap: 10px; margin-top: 8px; }
.set-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 12px; align-items: center; font-size: 16px; }
.set-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-row select { font: inherit; font-size: 16px; padding: 6px 8px; background: var(--paper); color: var(--paper-ink); border: 0; box-shadow: 0 0 0 2px #000; max-width: 100%; }
.set-row input[type=range] { width: min(220px, 60vw); accent-color: var(--gold); }
.set-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }
.set-row .btn[aria-pressed=true] { background: var(--gold); color: #1a1408; box-shadow: 0 0 0 2px #000; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 15px; margin: 8px 0 0; }
.keys dt { font-weight: 600; color: var(--gold); }
.keys dd { margin: 0; color: var(--muted); }
.hist { list-style: none; margin: 10px 0 0; padding: 0; max-height: 60vh; overflow: auto; display: grid; gap: 8px; }
.hist li { font-size: 16px; line-height: 1.4; }
.hist b { display: block; color: var(--gold); font-size: 14px; }
.cintro { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.cintro-art { width: 150px; flex: none; }
.cintro-art svg { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.cintro-body { flex: 1; min-width: 240px; }
.cintro-body h2 { margin: 2px 0 8px; }
.cintro-teaser { font-size: 18px; margin: 0 0 10px; }
.cintro-facts { list-style: none; display: flex; gap: 8px 18px; flex-wrap: wrap; padding: 0; margin: 0 0 12px; color: var(--gold); font-weight: 600; font-size: 16px; }
.agenda { margin-top: 12px; font-size: 15px; }
.agenda-k { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.agenda ol { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px 14px; }
.agenda li { color: var(--muted); }
.agenda li span { display: inline-block; width: 20px; }
.agenda li.done { color: var(--ok); }
.agenda li.now { color: var(--ink); font-weight: 700; }
.agenda li em { font-style: normal; opacity: .8; }
.agenda-q { color: var(--muted); font-size: 14px; }
.home-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.lvl { letter-spacing: 1px; color: var(--gold); }
@media (max-width: 640px) {
  .set-row { grid-template-columns: 1fr; gap: 4px; }
  #menu-btn .menu-label { display: none; }
  .cintro-art { width: 110px; }
}

/* Lexikon */
.lx-list { overflow: auto; flex: 1; min-height: 0; padding-right: 4px; margin-top: 8px; }
.lx-var { padding: 6px 0; border-top: 1px dashed var(--paper-line); }
.lx-var:first-of-type { border-top: 0; }
.lx-var details summary { cursor: pointer; color: #8a4b12; font-size: 14px; margin-top: 4px; }
.lx-cases { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.lx-cases .chip { font-size: 13px; padding: 2px 8px; }

/* Hilfe in Stufen im Recherche-Buch */
.rs-ladder { background: var(--panel-2); padding: 8px 12px; margin: 0 0 8px; flex: none; font-size: 15px; box-shadow: 0 0 0 2px var(--line); }
.lad-k { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.lad-step { margin: 4px 0; }
.lad-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.lad-o { color: var(--ink); }
.lad-sol { display: block; background: var(--paper); color: var(--paper-ink); padding: 6px 10px; margin-top: 4px; }
.lad-sol ul { margin: 0; padding-left: 18px; }
.lad-o small { display: block; color: var(--muted); margin-top: 2px; }

.vote { margin: 8px 0; padding: 6px 10px; background: var(--panel-2); font-size: 15px; box-shadow: 0 0 0 2px var(--line); }
.vote b { color: var(--gold); }

/* Kreuzverhör */
.cross { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin: 10px 0; }
.cross-k { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.cross-k small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 13px; }
.cross-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cross-stmt { display: flex; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--panel-2); border: 0; padding: 10px 12px; cursor: pointer; box-shadow: 0 0 0 2px var(--line); }
.cross-stmt span { flex: none; width: 22px; height: 22px; background: var(--gold); color: #1a1408; font-weight: 700; text-align: center; line-height: 22px; font-size: 14px; }
.cross-stmt:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--gold); }
.cross-stmt.bad { opacity: .55; box-shadow: 0 0 0 2px var(--bad); }
.cross-stmt.ok { background: #24402c; box-shadow: 0 0 0 3px var(--ok); }
.cross-card { background: var(--paper); color: var(--paper-ink); padding: 10px 12px; box-shadow: 0 0 0 3px #000; }
.cross-card blockquote { font-family: var(--serif); font-style: italic; margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--paper-line); font-size: 15.5px; line-height: 1.5; }
.cross-card em { font-size: 13px; color: #8a4b12; }
@media (max-width: 720px) { .cross { grid-template-columns: 1fr; } }

/* Fortschritt sichern */
#bk-text { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; background: var(--paper); color: var(--paper-ink); border: 0; box-shadow: 0 0 0 2px #000; resize: vertical; box-sizing: border-box; margin-top: 6px; }
.bk-filebtn { display: inline-block; cursor: pointer; }

/* Fälle 14–16 */
.scene-haus .wk { transform: translateX(50px); }
.scene-haus.go .wk { animation: hauswalk 3.2s steps(32) forwards; }
@keyframes hauswalk { from { transform: translateX(50px); } to { transform: translateX(0); } }
.scene-haus .lit { opacity: 0; }
.scene-haus.lit .lit { opacity: 1; animation: blink 1.2s steps(1) 3; }
.clausecard { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); width: min(360px, 84%); background: var(--paper); color: var(--paper-ink); padding: 12px 16px; box-shadow: 0 0 0 4px #000; text-align: center; animation: popc .3s steps(3); }
.clausecard small { display: block; font-size: 13px; color: #6b5d45; }
.clausecard b { display: block; font-size: 20px; margin: 4px 0; color: #8f2a18; }
.clausecard em { font-size: 14px; }
.chat { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: min(300px, 78%); background: #ece5dd; color: #222; box-shadow: 0 0 0 4px #000; padding-bottom: 10px; animation: popc .3s steps(3); }
.chat-head { background: #075e54; color: #fff; font-weight: 600; padding: 8px 12px; font-size: 15px; }
.chat-day { text-align: center; font-size: 12px; color: #555; margin: 8px 0 6px; }
.bubble { position: relative; margin: 0 10px 0 10px; background: #fff; border-radius: 6px; padding: 8px 12px 18px 10px; display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; align-items: center; }
.bubble .pic { grid-row: span 2; font-size: 28px; background: #d8dde2; text-align: center; line-height: 40px; }
.bubble b { font-size: 14px; }
.bubble em { font-style: normal; font-size: 12px; color: #555; }
.bubble .ticks { position: absolute; right: 8px; bottom: 3px; font-style: normal; font-size: 12px; color: #34b7f1; }
.scene-ausland .dot { opacity: 0; }
.scene-ausland.go .dot { animation: dotin .01s forwards; animation-delay: var(--d, 0s); }
.scene-ausland .lap { }
.scene-ausland.go .lap { animation: laprun 3.6s steps(36) .2s forwards; }
@keyframes laprun { from { transform: translate(40px, 40px); } to { transform: translate(120px, 50px); } }
.stamp-no { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-8deg); border: 5px solid #c9485b; color: #c9485b; background: rgba(255, 255, 255, .92); font-family: var(--px); font-size: clamp(22px, 5vw, 36px); padding: 6px 18px; text-transform: uppercase; animation: stampin .25s steps(3); }
@keyframes popc { from { transform: translateX(-50%) scale(.3); } to { transform: translateX(-50%) scale(1); } }
@keyframes stampin { from { transform: translate(-50%, -50%) rotate(-8deg) scale(2.2); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; } }

/* ---------- Lernpfade & Abzeichen ---------- */
.home-paths { margin: 26px 0 6px; }
.home-h { font-size: 20px; margin: 0 0 12px; color: var(--ink); font-family: inherit; }
.home-h small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.paths { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.path {
  --tab: var(--gold);
  display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: 0; padding: 10px 14px 10px 10px; box-shadow: 0 0 0 2px var(--line), inset 5px 0 0 var(--tab);
}
.path:hover, .path:focus-visible { box-shadow: 0 0 0 2px var(--tab), inset 5px 0 0 var(--tab); outline: none; }
.path[aria-pressed=true] { background: #3a3350; box-shadow: 0 0 0 3px var(--tab), inset 5px 0 0 var(--tab); }
.path-medal { flex: none; width: 42px; margin-left: 6px; }
.path-medal svg { width: 100%; height: auto; display: block; }
.path-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.path-body strong { font-size: 17px; line-height: 1.2; }
.path-body small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.path-dots { display: flex; gap: 4px; margin-top: 3px; }
.path-dots i { width: 14px; height: 8px; background: #0c0a10; box-shadow: 0 0 0 1px var(--line); }
.path-dots i.mid { background: var(--tab); opacity: .7; box-shadow: none; }
.path-dots i.good { background: var(--tab); box-shadow: none; }
.path-state { font-size: 13px; color: var(--muted); }
.path-state b { color: var(--gold); }
.linklike { font: inherit; color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.pathend {
  --tab: var(--gold);
  display: flex; gap: 14px; align-items: center; margin: 14px 0; padding: 12px 16px 12px 12px;
  background: var(--panel-2); box-shadow: 0 0 0 2px var(--line), inset 5px 0 0 var(--tab);
}
.pathend .path-medal { width: 54px; }
.pathend.won { box-shadow: 0 0 0 3px var(--gold), inset 5px 0 0 var(--tab); animation: winpop .5s ease-out both; }
.pathend .btn { margin-top: 8px; }

/* ---------- Weg durch die Instanzen ---------- */
.inst { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 12px; }
.inst-b {
  display: flex; flex-direction: column; gap: 4px; min-width: 240px; max-width: 92%; padding: 12px 18px;
  background: #2c2439; box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--line); text-align: center;
}
.inst-b small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.inst-b b { font-size: 19px; }
.inst-mark { color: var(--gold); font-size: 14px; }
.inst-b.hi { opacity: 0; transform: translateY(16px); transition: opacity .6s .5s, transform .6s .5s; box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--gold); }
.inst-up { height: 46px; width: 4px; background: repeating-linear-gradient(#5a5070 0 6px, transparent 6px 12px); position: relative; margin: 6px 0; }
.inst-up span { position: absolute; left: 14px; top: 10px; white-space: nowrap; font-size: 14px; color: var(--gold); opacity: 0; transition: opacity .4s .3s; }
.inst.go .inst-b.hi { opacity: 1; transform: none; }
.inst.go .inst-up { background: var(--gold); transition: background .3s; }
.inst.go .inst-up span { opacity: 1; }
.inst { flex-direction: column-reverse; }
.inst-mark.q { color: #fff; }
.cintro-inst { margin: 10px 0; padding: 10px 14px; background: #241d31; box-shadow: 0 0 0 2px var(--line); }
.cintro-inst ol { margin: 6px 0 0; padding-left: 0; list-style: none; }
.cintro-inst li { margin: 4px 0; line-height: 1.4; }
.cintro-inst li em { display: block; color: var(--muted); font-style: normal; font-size: 14px; }
@media (max-width: 520px) { .paths { grid-template-columns: 1fr; } .home-h small { display: block; margin: 2px 0 0; } .inst-b { min-width: 0; } }
@keyframes winpop { from { transform: scale(.94); opacity: .4; } to { transform: none; opacity: 1; } }

/* Fall 17: Waldbrand */
.scene-rhodos .fl { opacity: 0; }
.scene-rhodos.go .fl { animation: flin .35s steps(3) forwards, flick .5s steps(2) infinite; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .35s); }
.scene-rhodos .smoke { opacity: 0; }
.scene-rhodos.go .smoke { animation: smokein 1.2s 1s forwards, smokedrift 8s linear 1s infinite; }
.scene-rhodos .glow { opacity: 0; }
.scene-rhodos.lit .glow { opacity: .28; transition: opacity 1.2s; }
.scene-rhodos .dot { opacity: 0; }
.scene-rhodos.lit .dot { animation: dotin .01s forwards; animation-delay: var(--d, 0s); }
@keyframes flin { from { opacity: 0; } to { opacity: 1; } }
@keyframes flick { from { transform-box: fill-box; transform: translateY(0); } to { transform-box: fill-box; transform: translateY(-1px); } }
@keyframes smokein { to { opacity: 1; } }
@keyframes smokedrift { from { transform: translateX(0); } to { transform: translateX(-12px); } }

/* Fall 18: Esche */
.scene-esche .roots .dot { opacity: 0; }
.scene-esche.go .roots .dot { animation: dotin .01s forwards; animation-delay: var(--d, 0s); }
.scene-esche .zaun.lift { transform: translateY(0) rotate(0deg); transform-origin: 44px 20px; }
.scene-esche.go .zaun.lift { animation: zaunlift 3.4s steps(17) .6s forwards; }
@keyframes zaunlift { to { transform: translateY(-3px) rotate(-3deg); } }

/* Fall 19: Testament */
.zettel { position: absolute; left: 50%; top: 5%; transform: translateX(-50%); width: min(380px, 88%); background: #f6efdc; color: #2e3f7a; padding: 16px 20px; box-shadow: 0 0 0 4px #000, 0 6px 0 4px rgba(0, 0, 0, .35); animation: popc .3s steps(3); }
.zettel ol { list-style: none; margin: 0; padding: 0; font-style: italic; font-size: 17px; line-height: 1.5; }
.zettel li { animation: zin .3s steps(3) both; }
.zettel li.sig { color: #1f2d63; margin: 6px 0 4px; }
.zettel li.sig svg { width: 120px; height: 32px; display: block; margin-left: 46px; }
.zettel li.sig.mark { outline: 3px solid #c9485b; outline-offset: 2px; }
.stamp-no.small { top: 84%; font-size: clamp(16px, 3.6vw, 24px); }
@keyframes zin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.scene-stube .lit { opacity: 0; animation: blink 1.2s steps(1) infinite; }

/* Fall 20: Spurwechsel auf der Autobahn */
.scene-dreispur .aud { transform: translateX(0); }
.scene-dreispur.go .aud { animation: audrun 2.4s linear forwards; }
.scene-dreispur .wm { transform: translateY(0); }
.scene-dreispur.go .wm { animation: wmdrift 1.2s steps(6) 1s forwards; }
.scene-dreispur.go .golf { animation: golfslow 2.4s linear forwards; }
.scene-dreispur .crash { opacity: 0; }
.scene-dreispur.hit .crash { opacity: 1; animation: blink .4s steps(1) 3; }
@keyframes audrun { to { transform: translateX(50px); } }
@keyframes wmdrift { to { transform: translateY(-7px); } }
@keyframes golfslow { to { transform: translateX(6px); } }
.dashcam { position: absolute; left: 10px; top: 10px; padding: 4px 10px; background: #14101a; color: #f4f1ea; font-size: 13px; letter-spacing: .03em; box-shadow: 0 0 0 2px #000; }
.dashcam b { color: #e53935; margin-right: 6px; animation: blink 1s steps(1) infinite; }

/* Fall 21: In-App-Käufe */
.scene-kinderzimmer .glow { opacity: .15; }
.scene-kinderzimmer.go .glow { animation: tabflicker 1.4s steps(2) infinite; }
@keyframes tabflicker { 0% { opacity: .1; } 50% { opacity: .35; } 100% { opacity: .1; } }
.buycount { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: min(340px, 84%); background: #14101a; color: #f4f1ea; padding: 12px 16px; box-shadow: 0 0 0 4px #000, 0 0 0 6px var(--gold); text-align: center; }
.buycount small { display: block; font-size: 13px; color: var(--muted); }
.buycount b { display: block; font-size: 26px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.buycount b.sum { color: var(--gold); }
.buycount em { font-style: normal; font-size: 13px; color: var(--muted); }
.coinpop { position: absolute; bottom: 10%; padding: 2px 8px; background: var(--gold); color: #1b1408; font-weight: 700; font-size: 14px; animation: coinrise 1.4s ease-out forwards; }
@keyframes coinrise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-140px); opacity: 0; } }

/* Fall 22: Spielfeld */
.scene-stadion .run { transform: translate(0, 0); }
.scene-stadion .stw { transform: translate(0, 0); }
.scene-stadion.go .r1 { animation: runa 2.4s linear forwards; }
.scene-stadion.go .r2 { animation: runb 2.4s linear forwards; }
.scene-stadion.go .r3 { animation: runc 2.4s linear forwards; }
.scene-stadion.go .s1 { animation: stwa 2.6s linear .3s forwards; }
.scene-stadion.go .s2 { animation: stwb 2.6s linear .3s forwards; }
.scene-stadion.go .s3 { animation: stwc 2.6s linear .3s forwards; }
@keyframes runa { to { transform: translate(40px, 18px); } }
@keyframes runb { to { transform: translate(46px, 26px); } }
@keyframes runc { to { transform: translate(38px, 34px); } }
@keyframes stwa { to { transform: translate(-68px, 18px); } }
@keyframes stwb { to { transform: translate(-72px, 26px); } }
@keyframes stwc { to { transform: translate(-90px, 34px); } }

/* Fall 23: Ticket-Plattform */
.webpage { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); width: min(430px, 90%); background: #f4f6fa; color: #1b1b1f; box-shadow: 0 0 0 4px #000; animation: popc .3s steps(3); }
.wp-bar { display: flex; gap: 5px; align-items: center; background: #1d3a6b; color: #fff; padding: 6px 10px; font-size: 13px; }
.wp-bar i { width: 9px; height: 9px; background: #8fb0dc; border-radius: 50%; display: inline-block; }
.wp-bar span { margin-left: 8px; }
.wp-body { padding: 10px; display: grid; gap: 8px; }
.wp-body > div { animation: zin .3s steps(3) both; font-size: 15px; padding: 7px 10px; }
.wp-line { background: #fff; box-shadow: 0 0 0 1px #d0d4dc; }
.wp-hot { background: #c4262e; color: #fff; font-weight: 700; }
.wp-ok { background: #2e9e57; color: #fff; font-weight: 600; }

/* Fall 24: Parkplatz */
.scene-parkplatz .bk { transform: translate(0, 0); }
.scene-parkplatz.go .bk { animation: bkdrive 2.6s linear forwards; }
.scene-parkplatz .spark { opacity: 0; }
.scene-parkplatz.hit .spark { opacity: 1; animation: blink .35s steps(1) 4; }
@keyframes bkdrive { 0% { transform: translate(0, 0); } 70% { transform: translate(0, -50px); } 100% { transform: translate(14px, -58px); } }

/* Fall 25: Werkvertrag */
.scene-werkstatt .handw { transform: translateY(0); }
.scene-werkstatt.go .handw { animation: bob .5s steps(2) infinite; }
.scene-werkstatt .drop { opacity: 0; }
.scene-werkstatt.go .drop { animation: dripdrop 1s steps(6) infinite; }
@keyframes bob { 50% { transform: translateY(-1px); } }
@keyframes dripdrop { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(8px); } }
.invoices { position: absolute; left: 50%; top: 5%; transform: translateX(-50%); width: min(360px, 88%); display: grid; gap: 10px; }
.inv { position: relative; background: var(--paper); color: var(--paper-ink); padding: 10px 14px; box-shadow: 0 0 0 4px #000; animation: zin .3s steps(3) both; }
.inv small { display: block; font-size: 12px; color: #6b5d45; }
.inv b { display: block; font-size: 17px; margin: 2px 0; }
.inv em { font-style: normal; font-size: 14px; }
.inv em.sum { font-size: 20px; font-weight: 700; color: #8f2a18; display: block; }
.inv i { position: absolute; right: 10px; top: 10px; font-style: normal; font-size: 13px; font-weight: 700; padding: 1px 8px; }
.inv i.paid { background: #2e9e57; color: #fff; }
.inv i.open { background: #c9485b; color: #fff; }

/* Kompakt-Modus: Wahl auf der Fallkarte und erzählte Entscheidungen */
.cintro-mode-k { margin: 16px 0 8px; font-weight: 600; }
.cintro-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cintro-modes .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.cintro-modes .btn strong { color: inherit; font-size: 20px; }
.cintro-modes .btn span { font-size: 14px; font-weight: 400; }
@media (max-width: 520px) { .cintro-modes { grid-template-columns: 1fr; } }
.narr-q { color: #6b6455; font-size: 15px; margin: 0 0 8px; }
.narr-a { margin: 0 0 6px; }
.narr-list { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; }
