/* VOLTSCAPE – Oberfläche. Schrift: Barlow (lokal eingebunden, SIL OFL). */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); }

:root {
  --bg: #0d1620; --panel: #131f2b; --panel2: #1a2937; --panel3: #223445;
  --line: rgba(190, 215, 235, .14); --line2: rgba(190, 215, 235, .28);
  --text: #e6edf4; --muted: #93a5b6; --brass: #e3b25a; --brass-d: #b98a35; --ink: #1d1403;
  --ok: #57d08d; --bad: #ff6a59; --lo: #4a90ff; --hi: #ffa53a; --r: 6px;
  --f-ui: "Barlow Semi Condensed", "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-ui); font-weight: 600; margin: 0; line-height: 1.15; }
h2 { font-size: 1.75rem; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.ic { width: 22px; height: 22px; flex: none; }
.sym { width: 48px; height: 32px; flex: none; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#app { position: fixed; inset: 0; pointer-events: none; }
#boot { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: var(--bg); z-index: 90; font-family: var(--f-ui); }
#boot b { font-size: 2rem; letter-spacing: .08em; }
#boot span { color: var(--muted); }

/* ── Knöpfe ── */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line2); border-radius: var(--r); font: 600 1rem var(--f-ui); letter-spacing: .01em; background: var(--panel2); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel3); border-color: rgba(190, 215, 235, .45); }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.btn.primary:hover { background: #efc270; }
.btn.ghost { background: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.danger { border-color: rgba(255, 106, 89, .6); color: var(--bad); }
.btn:disabled { opacity: .45; }
.ib { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r); color: var(--text); flex: none; }
.ib:hover { background: rgba(190, 215, 235, .1); }
.ib.on { color: var(--brass); background: rgba(227, 178, 90, .14); }
.ib.sm { width: 34px; height: 34px; }
.ib.danger { color: var(--bad); }
.ib:disabled { opacity: .3; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 12px; font: 500 .95rem var(--f-ui); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brass); color: var(--ink); }
input[type=range] { accent-color: var(--brass); height: 28px; }
input:not([type=range]), select { background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r); min-height: 44px; padding: 0 12px; width: 100%; user-select: text; -webkit-user-select: text; }

/* ── Spieloberfläche ── */
.hud { position: absolute; inset: 0; display: grid; grid-template: "top top" auto "mission main" minmax(0, 1fr) "dock dock" auto / auto minmax(0, 1fr); pointer-events: none; }
.hud > * { pointer-events: auto; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 6px; min-height: 52px; padding: var(--sat) 8px 0; background: rgba(13, 22, 32, .88); border-bottom: 1px solid var(--line); }
.lvl { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-family: var(--f-ui); }
.lvl-id { color: var(--brass); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lvl-title { font-weight: 600; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase { display: flex; align-items: center; gap: 10px; margin-left: 18px; min-width: 0; font: 500 .95rem var(--f-ui); color: var(--brass); }
.phase-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-bar { width: 110px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.phase-bar i { display: block; height: 100%; width: 0; background: var(--brass); }
.top-actions { margin-left: auto; display: flex; }

.mission { grid-area: mission; width: 316px; margin: 12px 0 12px 12px; align-self: start; max-height: calc(100% - 24px); overflow: auto; background: rgba(19, 31, 43, .95); border: 1px solid var(--line); border-radius: var(--r); }
.mission-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px 0 16px; font: 600 1.05rem var(--f-ui); text-align: left; }
.mh-count { margin-left: auto; color: var(--brass); font-variant-numeric: tabular-nums; }
.mh-chev .ic { width: 18px; height: 18px; transform: rotate(90deg); transition: transform .15s; color: var(--muted); }
.mission-open .mh-chev .ic { transform: rotate(-90deg); }
.mission-body { display: none; padding: 2px 16px 14px; border-top: 1px solid var(--line); }
.mission-open .mission-body { display: block; }
.goal { margin: 12px 0; font-weight: 500; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.checks li, .res-checks li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .93rem; line-height: 1.3; }
.ck { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 50%; align-self: center; position: relative; }
li.live .ck { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(227, 178, 90, .2); }
li.ok .ck { border-color: var(--ok); background: var(--ok); }
li.bad .ck { border-color: var(--bad); background: var(--bad); }
li.ok .ck::after { content: ""; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #062014; border-width: 0 2px 2px 0; transform: rotate(40deg); }
li.bad .ck::after { content: ""; position: absolute; left: 2.5px; top: 5px; width: 6px; height: 2px; background: #2b0803; }
.ck-v, .res-checks b { font: 500 .93rem var(--f-ui); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
li.ok .ck-v { color: var(--ok); } li.bad .ck-v { color: var(--bad); } li.live .ck-v { color: var(--brass); }
.budget { display: flex; justify-content: space-between; font: 500 .95rem var(--f-ui); padding: 2px 0 10px; }
.budget b.ok { color: var(--ok); } .budget b.over { color: var(--hi); }
.dmg { display: flex; gap: 8px; font-size: .88rem; color: var(--hi); margin-bottom: 10px; line-height: 1.35; }
.dmg .ic { width: 18px; height: 18px; margin-top: 1px; }
.mission-actions { display: flex; gap: 8px; }
.mission-actions .btn { flex: 1; justify-content: center; min-height: 40px; padding: 0 8px; font-size: .92rem; }
.mission-actions .ic { width: 18px; height: 18px; }
.hintbox { margin-top: 12px; padding: 10px 12px; background: rgba(227, 178, 90, .09); border-left: 3px solid var(--brass); font-size: .92rem; }
.hintbox p { margin: 0 0 8px; } .hintbox p:last-child { margin: 0; } .hintbox b { font-family: var(--f-ui); display: block; color: var(--brass); }

.dock { grid-area: dock; display: flex; align-items: stretch; gap: 12px; padding: 8px 12px calc(8px + var(--sab)); background: rgba(19, 31, 43, .97); border-top: 1px solid var(--line); min-width: 0; }
.tools, .edit { display: flex; gap: 4px; align-items: center; flex: none; }
.tool { width: 66px; height: 62px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); font: 500 .78rem var(--f-ui); color: var(--muted); }
.tool:hover { color: var(--text); border-color: var(--line2); }
.tool.on { color: var(--ink); background: var(--brass); border-color: var(--brass); }
.parts { flex: 1; display: flex; gap: 14px; overflow-x: auto; min-width: 0; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; align-items: center; }
.pgroup { display: flex; gap: 4px; flex: none; }
.pgroup + .pgroup { padding-left: 14px; border-left: 1px solid var(--line); }
.parts-empty { color: var(--muted); font-size: .92rem; padding: 0 6px; }
.chip { position: relative; width: 78px; height: 62px; display: grid; place-items: center; align-content: center; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); flex: none; }
.chip:hover:not(:disabled) { border-color: var(--line2); background: var(--panel3); }
.chip.on { border-color: var(--brass); background: rgba(227, 178, 90, .16); color: var(--brass); }
.chip:disabled { opacity: .35; }
.chip .sym { width: 42px; height: 28px; }
.chip-name { font: 500 .72rem/1.1 var(--f-ui); max-width: 74px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chip.on .chip-name { color: var(--brass); }
.chip-n { position: absolute; top: 2px; right: 5px; font: 600 .72rem var(--f-ui); color: var(--brass); }
.power { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px 0 8px; height: 62px; border-radius: 31px; background: var(--brass); color: var(--ink); font: 600 1.05rem var(--f-ui); box-shadow: 0 0 0 1px var(--brass-d) inset; transition: background .15s; }
.power:hover { background: #efc270; }
.power-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--brass); }
.running .power { background: #2b1512; color: #ffb4a8; box-shadow: 0 0 0 1px var(--bad) inset, 0 0 22px rgba(255, 106, 89, .35); }
.running .power-ic { background: var(--bad); color: #2b0803; }
.running .tools, .running .parts, .running .edit { opacity: .32; pointer-events: none; }

.selbar { grid-area: main; align-self: end; justify-self: center; margin: 0 10px 10px; max-width: min(760px, calc(100% - 20px)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 8px 8px 14px; background: rgba(26, 41, 55, .97); border: 1px solid var(--line2); border-radius: var(--r); z-index: 3; }
.sel-name { display: flex; align-items: center; gap: 8px; font: 600 1rem var(--f-ui); }
.sel-name .sym { width: 36px; height: 24px; color: var(--brass); }
.sel-name i { font-style: normal; color: var(--brass); }
.sel-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sel-lab { font: 500 .85rem var(--f-ui); color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: var(--r); }
.stepper button { width: 44px; height: 42px; display: grid; place-items: center; }
.stepper button:hover { background: rgba(190, 215, 235, .1); }
.stepper output { min-width: 86px; text-align: center; font: 600 1.05rem var(--f-ui); font-variant-numeric: tabular-nums; }
.sel-edit input[type=range] { width: 130px; }
.sel-range { display: flex; align-items: center; gap: 10px; font: 500 .85rem var(--f-ui); color: var(--muted); }
.sel-range input { width: 150px; }
.sel-note { color: var(--muted); font-size: .9rem; }
.sel-actions { display: flex; margin-left: auto; }
.sel-live { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--f-ui); flex: 1; }
.sel-live span { display: inline-flex; align-items: baseline; gap: 6px; }
.sel-live em { font-style: normal; color: var(--muted); font-size: .88rem; }
.sel-live b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 4.6em; }
.sel-live .bad { color: var(--bad); font-weight: 600; }
.load i { width: 72px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; align-self: center; }
.load u { display: block; height: 100%; background: var(--ok); }
.load i.warn u { background: var(--hi); } .load i.over u { background: var(--bad); }

.tut { grid-area: main; align-self: start; justify-self: center; margin: 12px; max-width: 470px; padding: 14px 16px 12px; background: rgba(26, 41, 55, .98); border: 1px solid var(--brass-d); border-left: 4px solid var(--brass); border-radius: var(--r); z-index: 4; }
.tut-text b { color: var(--brass); font-weight: 600; }
.tut-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tut-dots { display: flex; gap: 5px; margin-right: auto; }
.tut-dots i { width: 14px; height: 3px; background: var(--line2); }
.tut-dots i.on { background: var(--brass); } .tut-dots i.done { background: var(--brass-d); }
.tut-target { outline: 2px solid var(--brass) !important; outline-offset: 3px; animation: tutpulse 1.2s ease-in-out infinite; position: relative; z-index: 2; }
@keyframes tutpulse { 50% { box-shadow: 0 0 0 9px rgba(227, 178, 90, .22); } }

.scope { grid-area: main; align-self: start; justify-self: end; margin: 12px; width: 292px; padding: 8px; background: rgba(13, 22, 32, .9); border: 1px solid var(--line); border-radius: var(--r); }
.scope canvas { width: 100%; display: block; }
.scope-legend { display: flex; gap: 12px; font: 500 .8rem var(--f-ui); margin-bottom: 4px; }
.scope-legend span::before { content: ""; display: inline-block; width: 12px; height: 3px; background: var(--c); margin-right: 5px; vertical-align: middle; }
.env { grid-area: main; align-self: end; justify-self: end; margin: 0 12px 12px; padding: 10px 12px; display: grid; gap: 6px; background: rgba(19, 31, 43, .95); border: 1px solid var(--line); border-radius: var(--r); font: 500 .88rem var(--f-ui); }
.env label { display: grid; grid-template-columns: 82px 130px 52px; align-items: center; gap: 8px; }
.env output { text-align: right; font-variant-numeric: tabular-nums; color: var(--brass); }
.duelbar { grid-area: main; align-self: start; justify-self: center; margin: 10px; display: flex; gap: 14px; align-items: center; padding: 6px 14px; background: rgba(13, 22, 32, .92); border: 1px solid var(--line2); border-radius: var(--r); font-family: var(--f-ui); z-index: 2; flex-wrap: wrap; }
.duel-time { font-weight: 600; font-size: 1.3rem; color: var(--brass); font-variant-numeric: tabular-nums; }
.duel-p { display: grid; line-height: 1.2; } .duel-p em { font-style: normal; font-size: .8rem; color: var(--muted); }
.duel-p.me b { color: var(--brass); } .duel-p.solved em { color: var(--ok); }

/* ── Dialoge ── */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; background: rgba(5, 10, 15, .68); }
.modal { width: min(580px, 100%); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.modal-body { padding: 24px 26px 18px; overflow: auto; min-height: 0; user-select: text; -webkit-user-select: text; }
.modal-body h2 { margin-bottom: 10px; }
.modal-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 26px calc(16px + var(--sab)); border-top: 1px solid var(--line); }
.brief-id, .res-kicker, .lx-kind { font: 600 .95rem var(--f-ui); color: var(--brass); margin-bottom: 2px; }
.brief-goal { font-weight: 500; font-size: 1.08rem; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brief p b { color: #fff; font-weight: 600; }
.brief-sub { font: 600 .95rem var(--f-ui); color: var(--muted); margin: 16px 0 8px; }
.newpart { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 6px; font: 600 1rem var(--f-ui); text-align: left; }
.newpart:hover { border-color: var(--brass-d); } .newpart .sym { color: var(--brass); } .newpart .ic { margin-left: auto; color: var(--muted); width: 18px; }
.brief-rules { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font: 500 .9rem var(--f-ui); color: var(--muted); }
.brief-rules span { display: inline-flex; align-items: center; gap: 6px; } .brief-rules .ic { width: 18px; height: 18px; color: var(--brass); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.badge { display: grid; justify-items: center; gap: 2px; padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: var(--r); text-align: center; color: var(--muted); }
.badge .ic { width: 30px; height: 30px; } .badge b { font: 600 1rem var(--f-ui); } .badge span { font-size: .8rem; line-height: 1.25; }
.badge.on { border-color: var(--brass-d); background: rgba(227, 178, 90, .1); color: var(--text); } .badge.on .ic { color: var(--brass); }
.res-score { display: flex; align-items: baseline; gap: 12px; font-family: var(--f-ui); margin-bottom: 8px; }
.res-score b { font-size: 2.2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; } .res-score span { color: var(--muted); } .res-score em { font-style: normal; color: var(--ok); font-weight: 500; }
.res-checks { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--line); }
.dm { padding: 12px 14px; border: 1px solid rgba(255, 106, 89, .45); border-left: 4px solid var(--bad); border-radius: var(--r); margin: 10px 0; background: rgba(255, 106, 89, .06); }
.dm-h { display: flex; align-items: center; gap: 10px; font-family: var(--f-ui); font-size: 1.05rem; margin-bottom: 4px; } .dm-h .sym { width: 40px; height: 26px; color: var(--bad); } .dm p { margin: 0; }
.res-note { color: var(--muted); font-size: .92rem; margin-top: 12px; }
.diag ul { margin: 0; padding-left: 20px; } .diag li { margin-bottom: 6px; }
.ach-new { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--brass-d); border-radius: var(--r); display: grid; gap: 6px; }
.ach-new div { display: flex; gap: 10px; align-items: center; } .ach-new .ic { color: var(--brass); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 12px 0; } .help h3 { font-size: 1.05rem; color: var(--brass); margin-bottom: 6px; }
.help ul { margin: 0; padding-left: 18px; font-size: .93rem; } .help li { margin-bottom: 5px; } .help-note { padding-top: 12px; border-top: 1px solid var(--line); margin: 0; }
.auth label, .de-join label, .dl-pick { display: grid; gap: 4px; margin: 12px 0; font: 500 .9rem var(--f-ui); color: var(--muted); }
.auth-hint { font-size: .85rem; color: var(--muted); } .auth-err { color: var(--bad); margin: 10px 0; font-weight: 500; }
.auth-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 12px 0; }
.pf-stats div { display: grid; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); } .pf-stats b { font: 600 1.25rem var(--f-ui); } .pf-stats span { font-size: .8rem; color: var(--muted); }
.ach-grid { display: grid; gap: 6px; } .ach { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); opacity: .6; }
.ach.on { opacity: 1; color: var(--text); border-color: var(--brass-d); } .ach.on .ic { color: var(--brass); } .ach span { display: grid; line-height: 1.25; } .ach small { color: var(--muted); }
.lb-sel { margin: 6px 0 12px; } .lb table, .dl-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb th, .lb td, .dl-table th, .dl-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); } .lb th, .dl-table th { font: 500 .85rem var(--f-ui); color: var(--muted); }
tr.me td { color: var(--brass); font-weight: 600; } .lb-me { margin-top: 10px; color: var(--brass); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row > div:first-child { display: grid; } .set-row small { color: var(--muted); } .set-about { margin-top: 14px; font-size: .88rem; }
.de-opts { display: grid; gap: 8px; margin: 14px 0; } .de-join { display: flex; align-items: end; gap: 8px; } .de-join label { flex: 1; margin: 0; }
.dl-code { display: grid; padding: 12px 14px; border: 1px solid var(--brass-d); border-radius: var(--r); margin: 10px 0; } .dl-code b { font: 600 2.2rem var(--f-ui); letter-spacing: .18em; color: var(--brass); user-select: all; -webkit-user-select: all; } .dl-code span, .dl-code small { color: var(--muted); font-size: .88rem; }
.dl-players { list-style: none; padding: 0; margin: 0 0 10px; } .dl-players li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); } .dl-players span { color: var(--brass); font-size: .88rem; } .dl-players em { margin-left: auto; font-style: normal; color: var(--muted); } .dl-players li.me b { color: var(--brass); }
.duel-count { text-align: center; } .dc-n { font: 600 6rem/1 var(--f-ui); color: var(--brass); margin: 14px 0 6px; font-variant-numeric: tabular-nums; }

/* ── Menü ── */
.screen { position: absolute; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
.menu-col { position: absolute; left: 0; top: 0; bottom: 0; width: min(440px, 100%); padding: 52px 28px 24px 44px; display: flex; flex-direction: column; background: linear-gradient(90deg, rgba(13, 22, 32, .96) 55%, rgba(13, 22, 32, 0)); overflow-y: auto; }
.logo { font-size: 3.5rem; letter-spacing: .06em; line-height: 1; position: relative; padding-bottom: 18px; }
.logo span { color: inherit; }
.logo::after { content: ""; position: absolute; left: 2px; bottom: 0; width: 210px; height: 12px; background: linear-gradient(90deg, var(--lo), #b56cff 55%, var(--hi)); clip-path: polygon(0 100%, 0 75%, 22% 75%, 22% 0, 58% 0, 58% 42%, 80% 42%, 100% 75%, 100% 100%, 98% 100%, 79% 58%, 56% 58%, 56% 16%, 24% 16%, 24% 91%, 2% 91%, 2% 100%); }
.tagline { color: var(--muted); max-width: 30ch; margin: 14px 0 0; }
.menu-nav { display: grid; gap: 2px; margin: 34px 0 20px; max-width: 330px; }
.mbtn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 14px; text-align: left; border-radius: var(--r); border: 1px solid transparent; }
.mbtn span { display: grid; line-height: 1.25; } .mbtn b { font: 600 1.12rem var(--f-ui); } .mbtn small { color: var(--muted); font-size: .84rem; }
.mbtn .ic { color: var(--brass); }
.mbtn:hover { background: rgba(190, 215, 235, .08); border-color: var(--line); }
.mbtn.primary { background: var(--brass); color: var(--ink); margin-bottom: 8px; } .mbtn.primary small { color: rgba(29, 20, 3, .72); } .mbtn.primary .ic { color: var(--ink); } .mbtn.primary:hover { background: #efc270; }
.menu-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; max-width: 330px; padding-top: 12px; border-top: 1px solid var(--line); }
.acct { display: flex; align-items: center; gap: 12px; flex: 1; min-height: 52px; text-align: left; border-radius: var(--r); padding: 4px 8px; } .acct:hover { background: rgba(190, 215, 235, .08); }
.acct span { display: grid; line-height: 1.25; } .acct b { font: 600 1rem var(--f-ui); } .acct small { color: var(--muted); font-size: .82rem; }

/* ── Kampagne / Seiten ── */
.screen.campaign, .overlay { background: var(--bg); overflow: hidden; display: flex; flex-direction: column; pointer-events: auto; }
.overlay { position: fixed; inset: 0; z-index: 40; }
.page-head { display: flex; align-items: center; gap: 12px; padding: calc(8px + var(--sat)) 16px 8px 8px; border-bottom: 1px solid var(--line); flex: none; }
.rank { margin-left: auto; display: grid; gap: 4px; text-align: right; font-size: .88rem; color: var(--muted); } .rank b { color: var(--brass); font-family: var(--f-ui); font-size: 1rem; }
.rank i { height: 3px; background: var(--line); } .rank u { display: block; height: 100%; background: var(--brass); }
.page-body { overflow-y: auto; padding: 8px 24px 40px; flex: 1; -webkit-overflow-scrolling: touch; }
.chapter { max-width: 1180px; margin: 0 auto; padding: 22px 0 6px; }
.ch-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.ch-no { font: 600 2.6rem/1 var(--f-ui); color: var(--brass); width: 34px; text-align: center; }
.ch-head h3 { font-size: 1.35rem; } .ch-head p { margin: 0; color: var(--muted); font-size: .93rem; }
.ch-stars { margin-left: auto; font: 500 .95rem var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 8px; }
.lv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-content: start; text-align: left; padding: 12px 14px; min-height: 118px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line2); border-radius: var(--r); transition: border-color .12s, background .12s; }
.lv:hover:not(:disabled) { background: var(--panel2); border-color: var(--line2); border-left-color: var(--brass); }
.lv.done { border-left-color: var(--brass); }
.lv.locked { opacity: .45; }
.lv-id { font: 600 1rem var(--f-ui); color: var(--brass); font-variant-numeric: tabular-nums; }
.lv-t { font: 600 1.05rem var(--f-ui); }
.lv-g { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); line-height: 1.35; }
.lv-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; align-self: end; } .lv-foot em { font-style: normal; font: 500 .82rem var(--f-ui); color: var(--muted); margin-left: auto; } .lv-foot .ic { width: 16px; height: 16px; color: var(--muted); }
.pips { display: inline-flex; gap: 6px; } .pips i { width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid var(--line2); } .pips i.on { background: var(--brass); border-color: var(--brass); }

/* ── Lexikon ── */
.lx { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lx-toc { display: none; margin-left: auto; }
.lx-main { display: grid; grid-template-columns: 290px minmax(0, 1fr); flex: 1; min-height: 0; }
.lx-nav { overflow-y: auto; padding: 10px 10px 30px; border-right: 1px solid var(--line); }
.lx-gt { font: 600 .9rem var(--f-ui); color: var(--muted); padding: 12px 10px 4px; }
.lx-nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 4px 10px; text-align: left; border-radius: var(--r); font-size: .96rem; }
.lx-nav button:hover { background: rgba(190, 215, 235, .08); } .lx-nav button.on { background: rgba(227, 178, 90, .15); color: var(--brass); }
.lx-nav .sym { width: 30px; height: 20px; color: var(--muted); } .lx-nav button.on .sym { color: var(--brass); }
.lx-art { overflow-y: auto; padding: 26px 34px 60px; user-select: text; -webkit-user-select: text; }
.lx-art > * { max-width: 66ch; } .lx-art h3 { font-size: 1.9rem; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lx-sym .sym { width: 66px; height: 44px; color: var(--brass); }
.lx-ana { padding: 12px 16px; border-left: 4px solid var(--brass); background: rgba(227, 178, 90, .08); margin-bottom: 16px; } .lx-ana b, .lx-f b, .lx-lim b { display: block; font: 600 .92rem var(--f-ui); color: var(--brass); margin-bottom: 2px; } .lx-ana p { margin: 0; }
.lx-art figure { margin: 0 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.lx-f, .lx-lim { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); } .lx-f code { display: block; font: 500 1.08rem var(--f-ui); padding: 2px 0; } .lx-lim ul { margin: 0; padding-left: 20px; }
.ill { width: 100%; height: auto; display: block; }
.ill .pipe { stroke: #25475f; stroke-width: 16; fill: none; stroke-linejoin: round; } .ill .pipe.wide { stroke-width: 26; } .ill .pipe.thin { stroke-width: 8; }
.ill .flow { stroke: #62c6ff; stroke-width: 3; fill: none; stroke-dasharray: 3 11; stroke-linecap: round; animation: flow 1s linear infinite; } .ill .flow.fine { stroke-width: 2; stroke-dasharray: 2 14; animation-duration: 2.4s; }
.ill .part { stroke: var(--brass); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; } .ill .part.fill { fill: var(--bg); }
.ill .membrane { stroke: var(--hi); stroke-width: 3; fill: none; } .ill .flap, .ill .gate { stroke: var(--hi); stroke-width: 4; stroke-linecap: round; } .ill .gauge { stroke: var(--muted); stroke-width: 2; }
.ill text { fill: var(--muted); font: 500 11px var(--f-ui); }
.ill .spin { transform-box: fill-box; transform-origin: center; animation: spin 3s linear infinite; } .ill .spin.slow { animation-duration: 6s; }
@keyframes flow { to { stroke-dashoffset: -14; } } @keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); z-index: 70; display: grid; gap: 6px; width: min(480px, calc(100% - 24px)); pointer-events: none; }
.toast { padding: 10px 14px; background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--brass); border-radius: var(--r); font-size: .93rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: tin .2s ease-out; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ── Schmale Bildschirme ── */
@media (max-width: 860px) {
  .hud { grid-template: "top" auto "main" minmax(0, 1fr) "dock" auto / minmax(0, 1fr); }
  .mission { grid-area: main; width: auto; margin: 6px 8px 0; max-height: 62%; z-index: 5; }
  .mission-head { min-height: 42px; }
  .lvl-title { font-size: 1.02rem; }
  .phase { position: absolute; left: 8px; right: 8px; top: calc(52px + var(--sat) + 54px); margin: 0; padding: 2px 4px 2px 12px; background: rgba(13, 22, 32, .9); border: 1px solid var(--brass-d); border-radius: var(--r); z-index: 4; }
  .phase-name { flex: 1; font-size: .9rem; } .phase-bar { width: 70px; }
  .top-actions .ib { width: 40px; }
  .dock { display: grid; grid-template: "tools edit power" auto "parts parts parts" auto / auto 1fr auto; gap: 8px; padding: 8px 8px calc(8px + var(--sab)); }
  .tools { grid-area: tools; } .edit { grid-area: edit; justify-self: end; } .parts { grid-area: parts; } .power { grid-area: power; }
  .tool { width: 60px; height: 50px; } .chip { width: 70px; height: 56px; } .chip-name { max-width: 66px; }
  .power { height: 50px; padding: 0 14px 0 5px; font-size: .95rem; } .power-ic { width: 40px; height: 40px; }
  .tut { margin: 56px 8px 0; font-size: .95rem; padding: 12px 14px 10px; }
  .scope { width: 172px; margin: 56px 8px 0; padding: 5px; } .scope-legend { font-size: .7rem; gap: 8px; }
  .selbar { margin: 0 6px 6px; gap: 6px 10px; padding: 6px 6px 6px 10px; } .sel-edit input[type=range] { width: 96px; } .stepper output { min-width: 74px; }
  .env { margin: 0 6px 6px; } .env label { grid-template-columns: 74px 100px 48px; }
  .duelbar { margin-top: 56px; }
  .menu-col { width: 100%; padding: calc(22px + var(--sat)) 18px calc(12px + var(--sab)); background: linear-gradient(180deg, rgba(13, 22, 32, .96) 0, rgba(13, 22, 32, 0) 30%, rgba(13, 22, 32, 0) 46%, rgba(13, 22, 32, .97) 62%); overflow: hidden; }
  .logo { font-size: 2.5rem; padding-bottom: 14px; } .logo::after { width: 150px; height: 9px; } .tagline { font-size: .92rem; margin-top: 10px; }
  .menu-nav { margin: auto 0 10px; max-width: none; grid-template-columns: 1fr 1fr; gap: 6px; }
  .mbtn { min-height: 50px; padding: 6px 10px; gap: 10px; border-color: var(--line); background: rgba(19, 31, 43, .9); } .mbtn small { display: none; } .mbtn b { font-size: 1rem; }
  .mbtn.primary, .mbtn:last-child { grid-column: 1 / -1; margin: 0; } .mbtn.primary small { display: block; }
  .menu-foot { margin-top: 0; max-width: none; }
  .page-body { padding: 4px 12px 30px; } .lv-grid { grid-template-columns: 1fr 1fr; } .lv { min-height: 104px; padding: 10px; } .lv-g { display: none; }
  .ch-no { font-size: 2rem; width: 26px; } .ch-head { gap: 12px; } .rank span { display: none; } .rank { width: 90px; }
  .modal-body { padding: 18px 18px 14px; } .modal-btns { padding: 12px 18px calc(14px + var(--sab)); } .modal-btns .btn { flex: 1; justify-content: center; }
  .help-grid { grid-template-columns: 1fr; gap: 10px; } h2 { font-size: 1.5rem; }
  .lx-main { grid-template-columns: 1fr; } .lx-toc { display: inline-grid; } .lx-art { display: none; padding: 18px 18px 50px; } .lx.show-art .lx-art { display: block; } .lx.show-art .lx-nav { display: none; }
  .lx-art h3 { font-size: 1.5rem; }
  .toasts { bottom: calc(150px + var(--sab)); }
}
@media (max-width: 520px) {
  .power-label { display: none; } .power { padding: 0 5px; } .tool { width: 56px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { min-height: 44px; } .tool, .chip, .power { height: 46px; } .chip .sym { height: 22px; } .mission { max-height: calc(100% - 12px); margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
