:root {
  --bg: #1b1f3b; --panel: #2a2f5a; --panel2: #353b70; --ink: #f4f1de; --mute: #a9a6c9;
  --red: #e63946; --green: #52b788; --yellow: #f4d35e; --blue: #4cc9f0; --orange: #f08a4b;
  --px: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 8px 8px; min-height: 100vh; }
#app { max-width: 760px; margin: 0 auto; padding: 12px 12px 80px; }
h1, h2, h3 { font-weight: 900; letter-spacing: .5px; margin: .4em 0; text-transform: uppercase; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { line-height: 1.45; }
a { color: var(--blue); }
.mute { color: var(--mute); font-size: 14px; }
.box { background: var(--panel); border: var(--px) solid #0d0f22; box-shadow: inset -4px -4px 0 rgba(0,0,0,.25), inset 4px 4px 0 rgba(255,255,255,.08); padding: 12px; margin: 12px 0; image-rendering: pixelated; }
.btn { display: inline-block; font: inherit; font-weight: 900; text-transform: uppercase; color: #101225; background: var(--yellow); border: var(--px) solid #0d0f22; box-shadow: inset -4px -4px 0 rgba(0,0,0,.25), inset 4px 4px 0 rgba(255,255,255,.4); padding: 10px 14px; cursor: pointer; margin: 4px 4px 4px 0; touch-action: manipulation; }
.btn:active { transform: translate(2px, 2px); box-shadow: inset 4px 4px 0 rgba(0,0,0,.25); }
.btn.alt { background: var(--blue); } .btn.red { background: var(--red); color: var(--ink); } .btn.green { background: var(--green); } .btn.ghost { background: var(--panel2); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.small { padding: 6px 10px; font-size: 13px; }
input, select, textarea { font: inherit; width: 100%; background: #101225; color: var(--ink); border: var(--px) solid #0d0f22; padding: 10px; margin: 4px 0 10px; border-radius: 0; }
textarea { min-height: 180px; resize: vertical; }
label { font-size: 14px; color: var(--mute); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.err { background: var(--red); color: var(--ink); padding: 8px; margin: 8px 0; border: var(--px) solid #0d0f22; }
.ok { background: var(--green); color: #101225; padding: 8px; margin: 8px 0; border: var(--px) solid #0d0f22; }
.tabs { display: flex; gap: 0; margin-bottom: 8px; }
.tabs .btn { flex: 1; margin: 0; }
.tabs .btn.off { background: var(--panel2); color: var(--mute); }

/* Kopfzeile */
.top { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border: var(--px) solid #0d0f22; display: grid; place-items: center; font-weight: 900; color: #101225; }
.top .name { font-weight: 900; font-size: 18px; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.stat { background: #101225; border: var(--px) solid #0d0f22; padding: 6px; text-align: center; }
.stat .v { font-weight: 900; font-size: 17px; }
.stat .l { font-size: 11px; color: var(--mute); text-transform: uppercase; }
.bar { height: 8px; background: #2a2f5a; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--green); }
@media (max-width: 420px) { .stat .v { font-size: 14px; } .stat .l { font-size: 9px; } }

/* Karte */
#map { width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; border: var(--px) solid #0d0f22; display: block; background: #3a7d44; }

/* Episoden */
.ep { display: flex; gap: 10px; align-items: center; }
.ep .nr { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 20px; background: var(--orange); color: #101225; border: var(--px) solid #0d0f22; }
.ep.done .nr { background: var(--green); }
.ep.locked { opacity: .55; }
.ep .t { font-weight: 900; text-transform: uppercase; }

/* Dialog */
.scene { display: flex; gap: 10px; margin: 8px 0; align-items: flex-start; }
.avatar { width: 48px; height: 48px; flex: none; image-rendering: pixelated; border: var(--px) solid #0d0f22; background: #101225; }
.bubble { background: var(--ink); color: #101225; padding: 10px; border: var(--px) solid #0d0f22; position: relative; flex: 1; }
.bubble b { display: block; font-size: 12px; text-transform: uppercase; color: #6b2737; }

/* Aufgaben */
.dots { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.dot { width: 28px; height: 28px; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: var(--panel2); border: 3px solid #0d0f22; cursor: pointer; }
.dot.done { background: var(--green); color: #101225; } .dot.cur { outline: 3px solid var(--yellow); } .dot.wait { background: var(--yellow); color: #101225; }
.opt { display: flex; gap: 10px; align-items: flex-start; background: #101225; border: var(--px) solid #0d0f22; padding: 10px; margin: 6px 0; cursor: pointer; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.opt.sel { background: #24406b; }
.opt.right { background: #1f5c3f; } .opt.wrong { background: #6b2430; }
.match { background: #101225; border: var(--px) solid #0d0f22; padding: 8px; margin: 6px 0; }
.match select { margin-bottom: 0; }
.feedback { border-left: 8px solid var(--yellow); padding: 8px 10px; background: #101225; margin: 10px 0; }
.points { font-weight: 900; font-size: 20px; }
.qtitle { color: var(--yellow); }

/* Gantt */
.gantt { overflow-x: auto; border: var(--px) solid #0d0f22; background: #101225; }
.gantt table { border-collapse: collapse; font-size: 12px; }
.gantt table { width: 100%; table-layout: fixed; }
.gantt th, .gantt td { border: 1px solid #2a2f5a; padding: 0; height: 28px; min-width: 15px; text-align: center; }
.gantt th { font-size: 10px; height: 20px; }
.gantt td.lbl { text-align: left; padding: 4px 6px 2px; height: auto; border-bottom: 0; background: #1b1f3b; font-size: 12px; }
.gantt td.c { cursor: pointer; }
.gantt td.on { background: var(--blue); }
.gantt td.dl { border-right: 3px solid var(--red); }
.gantt td.bad { background: var(--red); }

/* Rangliste */
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th, table.rank td { padding: 6px 4px; border-bottom: 2px solid #101225; text-align: left; }
table.rank td.n { text-align: right; }
.sw { display: inline-block; width: 12px; height: 12px; border: 2px solid #0d0f22; vertical-align: middle; margin-right: 4px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { background: #101225; border: var(--px) solid #0d0f22; padding: 6px 8px; font-size: 13px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal .box { max-width: 760px; width: 100%; max-height: 85vh; overflow: auto; margin: 0; }
@media (min-width: 700px) { .modal { align-items: center; } }

.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #0d0f22; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; font: inherit; font-size: 11px; font-weight: 900; text-transform: uppercase; background: none; color: var(--mute); border: 0; padding: 10px 2px; cursor: pointer; }
.nav button.on { color: var(--yellow); }
.nav button span { display: block; font-size: 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; }
.subtext { white-space: pre-wrap; background: var(--ink); color: #101225; padding: 10px; border: var(--px) solid #0d0f22; }
.blink { animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } }
.tbl { overflow-x: auto; background: #101225; border: var(--px) solid #0d0f22; padding: 8px; margin: 10px 0; font-size: 13px; }
.tbl table.rank th, .tbl table.rank td { border-bottom: 1px solid #2a2f5a; vertical-align: top; }
.rules { background: #24406b; border: var(--px) solid #0d0f22; padding: 8px 10px; margin: 10px 0; font-size: 14px; }
.rules ol { margin: 6px 0 0; padding-left: 20px; } .rules li { margin: 4px 0; line-height: 1.4; }
.step { display: flex; gap: 8px; align-items: center; background: #101225; border: var(--px) solid #0d0f22; padding: 8px; margin: 6px 0; }
.step .pos { width: 32px; height: 32px; flex: none; display: grid; place-items: center; font-weight: 900; background: var(--orange); color: #101225; }
.step .mv { display: flex; flex-direction: column; } .step .mv .btn { margin: 1px 0; padding: 4px 10px; }
.quote { background: var(--ink); color: #101225; padding: 8px; margin: 6px 0; border-left: 6px solid var(--orange); }
b.who { color: var(--yellow); }
.merke { background: var(--yellow); color: #101225; font-weight: 900; padding: 8px 10px; border: var(--px) solid #0d0f22; margin: 10px 0; }
.toc { columns: 2; font-size: 14px; } @media (max-width: 500px) { .toc { columns: 1; } }
.box h3 { color: var(--yellow); margin-top: 14px; }
.box ul { padding-left: 20px; } .box li { margin: 3px 0; line-height: 1.4; }
table.vl { font-size: 12px; table-layout: fixed; width: 100%; }
table.vl th, table.vl td { padding: 4px 3px; word-break: break-word; }
table.vl th:nth-child(1), table.vl td:nth-child(1) { width: 26px; }
table.vl th:nth-child(3), table.vl td:nth-child(3) { width: 38px; text-align: center; }
table.vl th:nth-child(4), table.vl td:nth-child(4), table.vl th:nth-child(5), table.vl td:nth-child(5) { width: 70px; }
table.vl th { font-size: 10px; }
