/* Dämmerung: flacher Pixel-Turm im Abendlicht, runde Schrift, weiche Karten. Upgrades als Liste. */
:root {
  color-scheme: dark;
  --page: #1A1430; --page-ink: #F6F0FF; --page-line: #3B3163;
  --bg: #231B3A; --surface: #2E2550; --surface-2: #3B3163; --tile: #2E2550; --tile-2: #3B3163; --line: #463B72; --ink: #F6F0FF; --muted: #BDB2DD;
  --accent: #FF8A6B; --accent-ink: #3A1A12; --radius: 20px;
  --coral: #FF8A6B; --mint: #7FE0C4; --butter: #FFD98A; --focus: #FFD98A;
  --font: 'Nunito', 'Segoe UI', sans-serif; --mono: 'Nunito', 'Segoe UI', sans-serif; --display: 'Fredoka', 'Nunito', sans-serif;
}
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.menu-title { font-family: var(--display); font-weight: 600; }
.menu-head .chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; background: var(--tile); border-radius: 999px; font-family: var(--display); font-weight: 600; }
.mpage, .home { padding-bottom: 110px; }
.lvl { border: 0; }
.lvl.locked { box-shadow: inset 0 0 0 1.5px var(--line); }
.lvl-no { border-radius: 50%; background: var(--butter); color: #3A2A08; font-family: var(--display); }
.lvl-txt b, .perk-n { font-family: var(--display); font-weight: 600; }
.lvl-btn, .sum-btn { font-family: var(--display); font-weight: 600; border-radius: 999px; }
.lvl-mile i.on { background: var(--butter); }
.perk { padding: 12px 14px; border: 0; margin-bottom: 8px; border-radius: 20px; background: var(--tile); }
.perk-btn { border: 0; border-radius: 999px; background: var(--coral); color: var(--accent-ink); font-family: var(--display); font-weight: 600; }
.perk-btn .gem { background: var(--accent-ink); }
.perk-v em { color: var(--mint); font-weight: 700; }
.ptab { border: 0; background: var(--tile); font-family: var(--display); font-weight: 500; }
.ptab.on { background: var(--ink); color: var(--bg); }
.presets { border-radius: 999px; background: var(--tile); }
.presets button { border-radius: 999px; font-family: var(--display); }
.presets button.on { background: var(--butter); color: #3A2A08; }

.hud { display: flex; align-items: center; gap: 8px; padding: 18px 14px 8px; flex: none; }
.hud-wave { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; background: var(--tile); border-radius: 999px; }
.hud-wave .badge { min-width: 40px; height: 40px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #3A1A12; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 16px; }
.hud-wave span { font-family: var(--display); font-weight: 600; font-size: 15px; }
.hud-cur { margin-left: auto; display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; background: var(--tile); border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 14px; }
.coin { background: var(--butter); border-radius: 50%; width: 10px; height: 10px; }
.gem { display: inline-block; width: 9px; height: 9px; background: var(--mint); transform: rotate(45deg); border-radius: 2px; }
.wavebar { height: 6px; margin: 2px 16px 0; background: var(--tile); border-radius: 3px; flex: none; }
.wavebar i { display: block; height: 100%; border-radius: 3px; background: var(--coral); transition: width 0.3s; }

.arena { --arena-h: 320px; }
#overlay { font-family: var(--display); font-weight: 600; font-size: 15px; padding: 8px 16px; border-radius: 999px; background: var(--butter); color: #3A2A08; }
#speed { position: absolute; right: 14px; bottom: 12px; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--tile-2); font-family: var(--display); font-weight: 700; color: var(--butter); }
.alive { position: absolute; left: 16px; bottom: 22px; font-size: 12px; color: var(--muted); font-weight: 600; }

.hpbar i { display: block; height: 100%; border-radius: 3px; background: var(--mint); }

.sheet { flex: 1; background: var(--tile); border-radius: 30px 30px 0 0; padding: 14px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.uptabs { display: flex; gap: 6px; padding: 0 14px; }
.uptabs button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 500; font-size: 14px; }
.uptabs button.on { background: var(--ink); color: var(--bg); }
#ups { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 4px; }
.up { padding: 12px 14px; border-radius: 20px; background: var(--tile-2); }
.up-n { font-family: var(--display); font-weight: 600; font-size: 16px; }
.up-lv { font-size: 12px; color: var(--butter); font-weight: 700; }
.up-v { font-size: 12px; color: var(--muted); }
.up-v em { color: var(--mint); font-weight: 700; }
.up-btn { border: 0; border-radius: 16px; background: var(--coral); color: #3A1A12; font-family: var(--display); font-weight: 600; font-size: 14px; }
.up-btn .coin { background: #3A1A12; }
.runbar { margin: 0 14px 14px; border: 0; border-radius: 26px; background: var(--tile-2); padding: 8px 8px 8px 16px; }
#endrun { border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 600; }

.ws { padding: 0 14px 110px; display: flex; flex-direction: column; gap: 12px; }
.ws-head { display: flex; gap: 10px; align-items: stretch; }
.ws-title { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 22px; background: var(--tile); }
.budget { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.budget b { color: var(--ink); font-family: var(--display); font-size: 16px; }
.pv { width: 140px; height: 110px; border-radius: 22px; background: var(--tile); position: relative; flex: none; }
.pv canvas { display: block; }
.pv span { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 10px; color: var(--muted); font-weight: 700; }
.ed-wrap { padding: 8px; border-radius: 24px; background: var(--tile); max-width: 100%; }
.tools { display: flex; gap: 6px; justify-content: space-between; }
.tools button { flex: 1; height: 48px; border: 0; border-radius: 50%; aspect-ratio: 1; max-width: 48px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
.tools button.on { background: var(--butter); color: #3A2A08; }
.tools svg { width: 20px; height: 20px; }
.grp { display: flex; flex-direction: column; gap: 8px; }
.pal { border: 0; border-radius: 20px; background: var(--tile); font-family: var(--display); font-size: 13px; font-weight: 500; }
.pal-c { font-size: 10px; color: var(--muted); }
.pal.on, .shp.on { background: var(--tile-2); box-shadow: inset 0 0 0 2px var(--butter); }
.shp { border: 0; border-radius: 50%; background: var(--tile); }
.sw { border: 0; border-radius: 50%; width: 34px; height: 34px; }
.sw.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--butter); }
#info { padding: 12px 16px; border-radius: 22px; background: var(--tile); }
.info-txt b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.info-txt span { font-size: 12px; color: var(--muted); }

.beast { background: var(--tile); border-radius: 22px; }
.beast b { font-family: var(--display); font-weight: 600; }
.beast span:last-child { font-size: 10px; color: var(--muted); }
.beast.locked { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.sum-card h3 { font-family: var(--display); font-weight: 600; }

.tabs { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 6px; border-radius: 28px; background: rgba(59, 49, 99, 0.94); backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(10, 6, 24, 0.5); z-index: 3; }
.tabs button { border-radius: 22px; color: var(--muted); font-family: var(--display); font-size: 11px; font-weight: 500; }
.tabs button.on { background: var(--coral); color: #3A1A12; }

.sheet { padding-bottom: 16px; }
.tabs button { min-width: 0; }
#stats { display: flex; flex-direction: column; gap: 10px; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-tile { padding: 12px 14px; border-radius: 18px; background: var(--tile); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-tile span { font-size: 12px; color: var(--muted); font-weight: 600; }
.st-tile b { font-family: var(--display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-h { margin: 10px 0 0; font-family: var(--display); font-size: 16px; font-weight: 600; }
.st-list { display: flex; flex-direction: column; gap: 6px; }
.st-lvl { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--tile); font-size: 13px; }
.st-lvl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-lvl i { display: block; height: 6px; border-radius: 3px; background: var(--tile-2); }
.st-lvl i b { display: block; height: 100%; border-radius: 3px; background: var(--butter); }
.st-lvl em { font-style: normal; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--tile); font-size: 13px; }
.st-row b { margin-left: auto; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-dim { color: var(--muted); }
.st-ic { width: 16px; height: 16px; flex: none; }
.st-ic svg { width: 100%; height: 100%; display: block; }
.st-set { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--tile); font-size: 14px; }
.st-set b { font-family: var(--display); font-weight: 600; color: var(--mint); }
.st-set[aria-pressed="false"] b { color: var(--muted); }
.st-set.danger b { color: var(--coral); }

.head-r { display: flex; align-items: center; gap: 8px; }
.gear { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--tile); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gear.on { background: var(--butter); color: #3A2A08; }
.gear svg { width: 20px; height: 20px; }
#settings { display: flex; flex-direction: column; gap: 10px; }
.st-slider { display: grid; grid-template-columns: 70px minmax(0, 1fr) 48px; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 16px; background: var(--tile); font-size: 14px; }
.st-slider b { text-align: right; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-slider input { width: 100%; accent-color: var(--coral); }
.snd-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; border-radius: 16px; background: var(--tile); }
.snd-row.off .snd-name, .snd-row.off .snd-v { opacity: 0.45; }
.snd-name { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 0; background: transparent; text-align: left; font-size: 14px; }
.snd-arr { width: 36px; height: 44px; border: 0; border-radius: 12px; background: var(--tile-2); font-size: 18px; }
.snd-v { width: 64px; text-align: center; font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--butter); }
.snd-tog { min-width: 52px; height: 36px; margin-left: 4px; border: 0; border-radius: 999px; background: var(--tile-2); font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--muted); }
.snd-tog[aria-pressed="true"] { background: var(--mint); color: #12352B; }
#bestiary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.beast { gap: 6px; padding: 14px 10px; }
.beast-d { font-size: 11px; line-height: 1.35; color: var(--muted); }
.beast-t { font-size: 10px; font-weight: 700; color: var(--butter); }
.beast.boss { box-shadow: inset 0 0 0 1.5px var(--coral); }
.beast.locked .beast-t { color: var(--muted); }

/* Run: Level-Abzeichen oben links öffnet die Run-Übersicht */
button.hud-wave { border: 0; color: var(--ink); text-align: left; padding-right: 12px; }
.hud-lv { display: flex; flex-direction: column; line-height: 1.15; }
.hud-lv b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.hud-lv > span { font-size: 11px; color: var(--muted); font-weight: 600; }
button.hud-wave svg { width: 18px; height: 18px; color: var(--muted); }
#runpanel { position: absolute; inset: 0; z-index: 6; background: rgba(10, 6, 24, 0.4); }
.rp-card { position: absolute; left: 12px; top: 72px; width: min(340px, calc(100% - 24px)); padding: 16px; border-radius: 24px; background: var(--tile); box-shadow: 0 20px 50px rgba(10, 6, 24, 0.55); display: flex; flex-direction: column; gap: 12px; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rp-head b { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; }
.rp-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--tile-2); font-size: 22px; line-height: 1; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rp-grid div { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 14px; background: var(--tile-2); }
.rp-grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
.rp-grid b { font-family: var(--display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
#endrun.rp-end { min-height: 50px; border: 0; border-radius: 16px; background: var(--coral); color: #3A1A12; font-family: var(--display); font-weight: 600; font-size: 16px; }
.shield-txt { font-size: 11px; font-weight: 700; color: #7FD1FF; }
.shield-txt:empty { display: none; }
.pal-h { grid-column: 1 / -1; margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pal-h:first-child { margin-top: 0; }

#mats { display: flex; flex-wrap: wrap; gap: 6px; }
.mat { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--tile); font-size: 12px; font-weight: 600; color: var(--muted); }
.mat.on { background: var(--butter); color: #3A2A08; }
.mat.locked { opacity: 0.4; }

.home-msg { min-height: 48px; padding: 10px 16px; border: 0; border-radius: 18px; background: var(--butter); color: #3A2A08; font-family: var(--display); font-weight: 600; font-size: 14px; text-align: left; }
#plans { display: flex; align-items: center; gap: 6px; }
#plans .lbl { margin-right: 4px; }
.plan { width: 44px; height: 40px; border: 0; border-radius: 14px; background: var(--tile); font-family: var(--display); font-weight: 600; }
.plan.on { background: var(--butter); color: #3A2A08; }
.plan.locked { opacity: 0.35; }
.sum-auto { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.sum-auto b { color: var(--ink); }
#rptoggles .st-set { background: var(--tile-2); min-height: 46px; }

.lvl-rule { font-size: 12px; font-weight: 600; color: var(--butter); line-height: 1.35; }
.lvl-rule:empty { display: none; }

.ev-chip { position: absolute; left: 12px; right: 76px; top: 52px; font-size: 12px; font-weight: 700; color: var(--butter); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: none; }
.ev-chip:empty { display: none; }
#offline { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 6, 24, 0.6); backdrop-filter: blur(4px); }
.off-txt { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* Forschung & Herausforderungen */
.res-head { margin: 0 0 10px; }
.perk.researching { box-shadow: inset 0 0 0 2px var(--mint, #7FE0C4); }
.perk-btn.res-run { background: var(--tile-2, rgba(255,255,255,.08)); color: var(--ink); font-variant-numeric: tabular-nums; }
.res-auto { margin-left: 8px; padding: 2px 9px; border: 0; border-radius: 999px; background: var(--tile-2, rgba(255,255,255,.08)); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.res-auto.on { background: var(--mint, #7FE0C4); color: #1F1A33; }
.wc-aim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 4px 0; font-size: 12px; color: var(--muted); }
.wc-aim .res-auto { margin-left: 0; min-height: 30px; padding: 2px 12px; }
.st-row.ch > span:nth-child(2) { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.st-row.ch > span:nth-child(2) b { margin-left: 0; }
.ch-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--line, rgba(255,255,255,.12)); font-size: 12px; }
.st-row.ch.done .ch-ic { background: var(--mint, #7FE0C4); color: var(--accent-ink); }
.st-row.ch.done { opacity: .85; }

/* Labor-Stufen, Waffen-Karten, Tagesaufgaben, Deko-Reparatur */
.head-r .gear { width: 40px; height: 40px; }
.head-r { gap: 6px; }
.tier-h { display: block; margin: 14px 4px 8px; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--muted); }
.perk.unlock { box-shadow: inset 0 0 0 2px var(--butter); }
.perk.unlock .perk-v { display: block; }
.wcard { margin-bottom: 12px; padding: 10px; border-radius: 22px; background: var(--surface-2); }
.wcard .perk { background: var(--tile); margin: 8px 0 0; }
.wc-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.wc-head .pal-ic { width: 28px; height: 28px; flex: none; }
.wc-head .pal-ic svg { width: 100%; height: 100%; }
.wc-head b { font-family: var(--display); font-weight: 600; }
.wc-st { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.wc-st svg { width: 14px; height: 14px; }
.wcard.locked { opacity: .6; }
.dbar { display: block; width: 100%; height: 6px; margin: 6px 0 2px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dbar b { display: block; height: 100%; border-radius: 999px; background: var(--mint); margin: 0 !important; }
.st-row.ch > span:nth-child(2) { flex: 1; min-width: 0; }
.st-row.ch .gem { display: inline-block; vertical-align: middle; }
.repair { width: 100%; min-height: 44px; margin: 8px 0 0; border: 0; border-radius: 999px; background: var(--butter); color: #3A2A08; font-family: var(--display); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.repair:disabled { opacity: .5; }
.repair .gem { background: #3A2A08; }

/* Muster (v1.3) */
#patinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#patinfo[hidden] { display: none; }
.pat-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tile); color: var(--mint); }
.pat-chip.bad { color: var(--coral); }
.pat-chip.q { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
#patterns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--tile); }
.pat.bad { box-shadow: inset 0 0 0 1.5px rgba(255, 138, 107, 0.5); }
.pat.locked { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.pat-fig { display: grid; gap: 2px; flex: none; min-width: 52px; justify-content: center; }
.pat-fig svg, .pat-fig i { width: 16px; height: 16px; display: block; }
.pat-fig.q { width: 52px; height: 52px; display: grid; place-items: center; font-family: var(--display); font-size: 22px; border-radius: 12px; background: var(--tile-2); }
.pat-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pat-t b { font-family: var(--display); font-weight: 600; }
.pat-t span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.pat-t em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--butter); }

/* Grundstein (v1.3) */
#stone { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 6, 24, 0.6); backdrop-filter: blur(4px); overflow-y: auto; }
#stone[hidden] { display: none; }
.stone-card { max-width: 360px; }
.stones { display: flex; flex-direction: column; gap: 8px; }
.stone { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 0; border-radius: 18px; background: var(--tile); color: var(--ink); font: inherit; cursor: pointer; }
.stone[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--butter); background: var(--tile-2); }
.stone .pal-ic { width: 34px; height: 34px; flex: none; }
.stone .pal-ic svg { width: 100%; height: 100%; }
.stone-t { display: flex; flex-direction: column; gap: 2px; }
.stone-t b { font-family: var(--display); font-weight: 600; }
.stone-t .plus { font-size: 12px; color: var(--mint); }
.stone-t .minus { font-size: 12px; color: var(--coral); }
.sum-btn:disabled { opacity: 0.5; }

/* Schaden je Pixel (v1.6) */
#rppix, .sum-pix { display: flex; flex-direction: column; gap: 6px; }
.pix-row { display: grid; grid-template-columns: 18px minmax(0, 7.5em) 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.pix-row .pal-ic { width: 18px; height: 18px; }
.pix-n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pix-n em { font-style: normal; color: var(--butter); }
.pix-row i { height: 6px; border-radius: 3px; background: var(--tile-2); overflow: hidden; }
.pix-row i b { display: block; height: 100%; background: var(--coral); border-radius: 3px; }
.pix-v { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Erste Schritte (v1.7) */
.first-step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-radius: 18px; background: var(--tile); color: var(--ink); font: inherit; cursor: pointer; }
.first-step[hidden] { display: none; }
.first-step b { font-family: var(--display); font-weight: 600; font-size: 14px; }
.first-step span:last-child { font-size: 12px; font-weight: 700; color: var(--mint); white-space: nowrap; }

/* Trophäen (v1.8) */
#trophies { display: flex; flex-wrap: wrap; gap: 6px; }
#trophygrp[hidden] { display: none; }
#trophylist { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tro-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; background: var(--tile); text-align: center; }
.tro-card b { font-family: var(--display); font-weight: 600; font-size: 11px; line-height: 1.2; }
.tro-card.locked { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.tro-card.locked b { font-family: var(--font); font-size: 10px; font-weight: 700; }
.tro-ic { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--display); font-size: 18px; }
.tro-ic svg { width: 100%; height: 100%; }

/* Prestige (v1.9) */
.urp { display: inline-block; width: 9px; height: 9px; background: var(--butter); border-radius: 2px; box-shadow: 0 0 0 2px rgba(255, 217, 138, 0.25); margin-right: 6px; vertical-align: 1px; }
.perk-btn .urp { background: var(--accent-ink); box-shadow: none; }
.prest-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; background: var(--tile); margin-bottom: 10px; }
.prest-top { display: flex; align-items: center; gap: 10px; }
.prest-top b { font-family: var(--display); font-weight: 600; font-size: 26px; margin-right: auto; display: inline-flex; align-items: center; }
.prest-top b .urp { width: 14px; height: 14px; }
.prest-btn { background: var(--coral); color: var(--accent-ink); font-family: var(--display); font-weight: 600; border: 0; }
.prest-btn:disabled { opacity: 0.45; }
.perk-btn.off { background: var(--tile-2); color: var(--muted); }
.drone-ic { width: 26px; height: 26px; flex: none; margin-right: 10px; }
.drone-ic svg { width: 100%; height: 100%; }
#pact { margin-bottom: 12px; padding: 12px; border-radius: 20px; background: var(--tile); box-shadow: inset 0 0 0 2px var(--butter); }
#pact[hidden] { display: none; }
.pact-head { display: flex; justify-content: space-between; align-items: baseline; }
.pact-head b { font-family: var(--display); font-weight: 600; }
.pact-head span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pact-bar { height: 4px; margin: 6px 0 10px; border-radius: 2px; background: var(--tile-2); overflow: hidden; }
.pact-bar i { display: block; width: 100%; height: 100%; background: var(--butter); }
.pacts { display: flex; flex-direction: column; gap: 8px; }
.pacts .stone { background: var(--tile-2); }
.pact-no { display: block; margin: 8px auto 0; padding: 8px 16px; border: 0; background: none; color: var(--muted); font-size: 13px; }
#rppact:empty { display: none; }
.rp-pact { display: flex; flex-direction: column; margin-top: 6px; font-size: 12px; color: var(--muted); }
.rp-pact b { color: var(--ink); }
.heart-chip { position: absolute; left: 16px; bottom: 40px; font-size: 12px; font-weight: 700; color: #FF7FA8; pointer-events: none; }
.heart-chip:empty { display: none; }
#lackbar[hidden] { display: none; }
.lack-note { display: block; padding: 6px 4px 0; font-size: 12px; color: var(--muted); }
.lack-tog { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 0 4px; font-size: 13px; color: var(--muted); border: 0; background: none; }
.lack-tog b { color: var(--ink); font-family: var(--display); font-weight: 600; }
.lack-tog b::after { content: ' ▾'; color: var(--muted); }
.lack-tog[aria-expanded="true"] b::after { content: ' ▴'; }
.wc-lock { margin: 8px 4px 2px; font-size: 12px; color: var(--muted); }
/* Run: schlanke Werte, Shop zuklappbar */
#shoptog { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--tile-2); color: var(--ink); display: grid; place-items: center; }
#shoptog svg { width: 20px; height: 20px; transition: transform .15s; }
.shop-min #shoptog svg { transform: rotate(180deg); }
.shop-min .arena { flex: 1; height: auto; min-height: 0; }
.shop-min #ups, .shop-min .uptabs { display: none; }
#speed { width: 44px; height: 44px; }
.alive { bottom: 16px; }
.heart-chip { bottom: 32px; }
/* Pakte oben in der Mitte */
#pact { position: absolute; z-index: 6; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; padding: 0; width: calc(100% - 24px); max-width: 340px; background: none; box-shadow: none; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
#pact > * { pointer-events: auto; }
.pact-pill { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--butter); color: #3A2A08; font-family: var(--display); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.pact-pill.lucky { background: var(--mint); color: #12352B; }
#pact .pacts { width: 100%; padding: 8px; border-radius: 18px; background: var(--tile); }
#pact .stone { width: 100%; background: var(--tile-2); }
#pact .stone.lucky { box-shadow: inset 0 0 0 2px var(--mint); }
#pact .minus:empty { display: none; }
.arena.pacting #overlay { top: 54px; }
.arena.pacting .ev-chip { top: 56px; }
/* Quests: drei Bahnen mit eigener XP, drei Währungen */
.cur { display: inline-block; flex: none; width: 12px; height: 12px; }
.cur.f { background: var(--coral); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.cur.s { background: #C9A3FF; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.cur.m { border-radius: 50%; background: radial-gradient(circle at 68% 34%, transparent 42%, #9FD8FF 44%); }
.perk-btn .cur.f, .perk-btn .cur.s, .perk-btn .cur.m { background: var(--accent-ink); }
.perk-btn .cur.m { background: radial-gradient(circle at 68% 34%, transparent 42%, var(--accent-ink) 44%); }
#tasks { display: flex; flex-direction: column; gap: 10px; }
.q-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#perks .q-bal { margin-bottom: 10px; }
.q-cur { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 7px; padding: 8px 10px; border-radius: 16px; background: var(--tile); min-width: 0; }
.q-cur b { font-family: var(--display); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.q-cur small { grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--muted); }
.q-boost { color: var(--mint); font-weight: 700; }
.q-seg { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--tile); }
.q-seg button { flex: 1; min-width: 0; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 500; font-size: 14px; }
.q-seg button.on { background: var(--butter); color: #3A2A08; font-weight: 600; }
.q-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 22px; background: var(--tile); }
.q-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); }
.q-top > b { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); }
.q-top span b { color: var(--ink); font-variant-numeric: tabular-nums; }
.q-bar { height: 10px; background: var(--tile-2); }
.q-bar b { background: var(--butter); }
.q-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; margin: 6px 0 4px; }
.q-node { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 66px; padding: 5px 2px 6px; border-radius: 14px; background: var(--tile-2); font-size: 11px; font-weight: 700; color: var(--ink); text-align: center; }
.q-node em { font-style: normal; font-family: var(--display); font-size: 11px; font-weight: 600; color: var(--muted); }
.q-node span { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-node .cur, .q-node .gem { width: 10px; height: 10px; }
.q-node .gem { width: 8px; height: 8px; }
.q-node .urp { margin-right: 0; }
.q-node.bonus { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.q-node.on { background: var(--butter); color: #3A2A08; box-shadow: none; }
.q-node.on em { color: #3A2A08; }
.q-node.on .gem { background: #3A2A08; }
.q-node.on .cur.f, .q-node.on .cur.s { background: #3A2A08; }
.q-node.on .cur.m { background: radial-gradient(circle at 68% 34%, transparent 42%, #3A2A08 44%); }
.q-row .st-dim { display: block; font-size: 12px; line-height: 1.35; }
.q-row > span:nth-child(2) > b { margin: 0; }
.q-xp { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.q-xp b { font-family: var(--display); font-weight: 600; color: var(--butter); margin: 0; }
.q-xp small { font-size: 10px; font-weight: 700; color: var(--muted); }
.q-row.t2 .q-xp small { color: var(--mint); }
.q-row.t3 .q-xp small { color: var(--coral); }
.q-row.done .q-xp b { color: var(--muted); }
.wcard.legend { box-shadow: inset 0 0 0 2px var(--butter); }
.wcard.legend.locked { box-shadow: inset 0 0 0 1.5px var(--line); }
.wcard.legend > .perk .perk-v { display: block; }
.q-card > .st-dim { font-size: 12px; font-weight: 600; }
/* Run-Shop: Kacheln statt hoher Zeilen, die ganze Kachel kauft */
#ups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
button.up { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; min-height: 76px; padding: 9px 11px; border: 0; border-radius: 16px; background: var(--tile-2); color: var(--ink); font: inherit; text-align: left; }
button.up:disabled { opacity: 1; color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
button.up:not(:disabled):active { background: var(--line); }
.up-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
button.up .up-n { font-size: 13px; line-height: 1.2; min-width: 0; }
button.up .up-lv { flex: none; font-size: 11px; font-variant-numeric: tabular-nums; }
button.up .up-v { flex-basis: auto; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-c { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 3px; font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--butter); font-variant-numeric: tabular-nums; }
button.up:disabled .up-c { color: var(--muted); }
button.up:disabled .coin { background: var(--muted); }
button.up { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; min-height: 60px; padding: 8px 11px; }
.up-top { grid-column: 1 / -1; }
.up-c { margin-top: 0; padding-top: 0; }
/* Labor: drei Bereiche, Kategorien auf einen Blick, Kacheln wie im Run-Shop, Waffen klappen einzeln auf */
#perktabs { display: flex; flex-direction: column; gap: 8px; overflow: visible; padding-bottom: 6px; }
.lab-sub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lab-sub .ptab { min-width: 0; padding: 0 4px; }
.lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.lab-grid button.up { grid-template-rows: auto 1fr auto; min-height: 88px; background: var(--tile); }
.lab-grid button.up:disabled { background: transparent; }
.lab-grid button.up.max { background: var(--tile); color: var(--ink); box-shadow: none; }
.lab-grid .up-v { grid-column: 1 / -1; white-space: normal; line-height: 1.3; }
.lab-grid .up-c { grid-column: 1 / -1; margin-top: 3px; }
.lab-grid .up-c .gem { background: var(--mint); }
.lab-grid .up.max .up-c { color: var(--mint); }
.wcard .lab-grid { margin: 8px 0 0; }
.wcard { margin-bottom: 8px; padding: 8px; }
.w-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 2px 6px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
.w-row .pal-ic { width: 28px; height: 28px; flex: none; }
.w-row .pal-ic svg { width: 100%; height: 100%; }
.w-row b { font-family: var(--display); font-weight: 600; }
.w-sum { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.w-chev { flex: none; width: 8px; height: 8px; margin: 0 4px 3px 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.w-row[aria-expanded="true"] .w-chev { transform: rotate(225deg); margin-bottom: -3px; }
.w-shut { display: flex; flex-direction: column; background: var(--tile); }
.w-row.off { color: var(--muted); min-height: 40px; }
.wc-head .perk-btn { margin-left: auto; min-height: 40px; }
.lab-grid button.up .up-v { white-space: normal; overflow: visible; }

/* Run: Werte sitzen im Menü, zugeklappt bleibt eine Statusleiste */
.arena { flex: none; }
.sheet { position: relative; z-index: 2; margin-top: -18px; padding: 10px 0 12px; border-radius: 22px 22px 0 0; gap: 8px; box-shadow: 0 -8px 20px rgba(10, 6, 24, 0.35); }
.alive { bottom: 30px; }
.heart-chip { bottom: 46px; }
#speed { bottom: 28px; }
.stats { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; }
.stats > div { flex: none; display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.stats .st-hp { flex: 1; min-width: 0; }
.st-hp > span { display: flex; align-items: baseline; gap: 6px; }
.stats b { font-family: var(--display); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats .lbl { font-size: 11px; }
.hpbar { height: 5px; border-radius: 3px; background: var(--tile-2); overflow: hidden; margin-top: 3px; }
#shoptog { width: 40px; height: 40px; }
.uptabs { padding: 0 14px; }
.shop-min .sheet { flex: none; }
.shop-min #ups, .shop-min .uptabs { display: none; }
.shop-min .alive, .shop-min .heart-chip, .shop-min #speed { transform: none; }

/* Kopf */
.menu-head.nogem .chip { display: none; }
.menu-title { white-space: nowrap; }

/* Kacheln: lange Namen brechen um, statt an die Stufe zu stoßen */
.lab-grid .up-top { flex-wrap: wrap; gap: 0 6px; }
.lab-grid .up-n { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.lab-grid .up-lv { margin-left: auto; }

/* Startseite */
.show-stats { flex-wrap: nowrap; gap: 4px; left: 6px; right: 6px; }
.show-stats span { padding: 5px 8px; white-space: nowrap; }

/* Prestige */
.prest-btn { min-height: 50px; border-radius: 16px; font-size: 16px; }
.prest-card .lack-tog { min-height: 36px; }

/* Forschung */
.res-tog .res-n { display: inline; }
.res-tog .res-n::after { content: none; }
.res-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.res-cell button.up { flex: 1; }
.res-cell .res-auto { margin: 0; align-self: flex-start; }
#research > .perk.researching { margin-bottom: 8px; }

/* Werkstatt: alles auf einem Bildschirm, nur die Auswahl scrollt */
section[data-view="turm"] { overflow: hidden; }
.ws { flex: 1; min-height: 0; padding: 0 14px; gap: 8px; }
.ws-title { flex: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 18px; }
.ws-title .budget { flex: 1; justify-content: flex-start; gap: 12px; white-space: nowrap; }
#plans { flex: none; gap: 3px; }
#plans .lbl { display: none; }
.plan { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; }
.ed-wrap { flex: none; width: min(100%, 358px, calc(100dvh - 500px)); min-width: 180px; align-self: center; padding: 5px; border-radius: 16px; }
.tools { flex: none; }
.tools button { height: 40px; max-width: 40px; }
#info { flex: none; padding: 7px 12px; border-radius: 14px; min-height: 48px; }
#info .info-txt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.3; }
.ws-tabs { flex: none; }
.ws-tabs button { min-height: 34px; padding: 0 2px; font-size: 12px; }
.ws-pick { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 8px; padding-bottom: 100px; }
.ws-pick::-webkit-scrollbar { display: none; }
.ws-pick .repair { margin: 0; min-height: 38px; flex: none; }
.ws-pick:not(.showlock) .locked { display: none; }
.ws-pick .grp[hidden] { display: none; }
#palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pal { min-width: 0; padding: 6px 3px; }
.pal-n { max-width: 100%; font-size: 12px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.pal.legend { box-shadow: inset 0 0 0 1.5px var(--butter); }
#picklock { flex: none; min-height: 36px; }

/* Lexikon */
.lex-find { display: block; margin-bottom: 6px; }
.lex-find input { width: 100%; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--tile); color: var(--ink); font: inherit; }
#stats .q-seg button, #settings .q-seg button { font-size: 13px; }

/* Run-Ende */
.sum-q { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--tile); font-size: 12px; color: var(--muted); }
.sum-q b { color: var(--butter); font-family: var(--display); font-weight: 600; }
.ed-wrap { width: min(100%, 358px, calc(100dvh - 556px)); }
.ws { gap: 6px; }
#info { min-height: 44px; padding: 5px 12px; }
#patinfo { flex: none; }
.arena { flex: 1; height: auto; min-height: 320px; }
.sheet { flex: none; min-height: 336px; }
.shop-min .sheet { min-height: 0; }

/* Lexikon: Kapitel, aufklappbare Einträge, Unbekanntes nur als Anzahl */
#lex { display: flex; flex-direction: column; gap: 8px; }
.lex-find[hidden] { display: none; }
.lex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lex-ch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 8px; min-height: 66px; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--tile); color: var(--ink); font: inherit; text-align: left; }
.lex-ch b { font-family: var(--display); font-weight: 600; font-size: 14px; }
.lex-ch span { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lex-ch .dbar { grid-column: 1 / -1; margin: 4px 0 0; }
.lex-ch .dbar b { background: var(--butter); }
.lex-back { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 18px; text-align: left; }
.lex-back .w-chev { transform: rotate(135deg); margin: 0 2px 0 4px; }
.lex-back span { margin-left: auto; font-size: 12px; color: var(--muted); }
.lex-list { display: flex; flex-direction: column; gap: 5px; }
.lex-item { border-radius: 16px; background: var(--tile); }
.lex-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 12px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
.lex-row > b { min-width: 0; font-family: var(--display); font-weight: 600; font-size: 14px; }
.lex-sub { margin-left: auto; flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.lex-row .w-chev { flex: none; }
.lex-row[aria-expanded="true"] .w-chev { transform: rotate(225deg); margin-bottom: -3px; }
.lex-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.lex-ic svg { width: 100%; height: 100%; }
.lex-fig { display: grid; gap: 1px; }
.lex-fig i { width: 6px; height: 6px; border-radius: 1px; }
.lex-body { display: flex; flex-direction: column; gap: 7px; padding: 0 12px 12px; font-size: 13px; line-height: 1.4; }
.lex-body p { margin: 0; }
.lex-dim { color: var(--muted); font-size: 12px; }
.lex-tip { padding: 8px 10px; border-radius: 12px; background: var(--tile-2); }
.lex-tip b { display: block; font-family: var(--display); font-weight: 600; color: var(--butter); }
.lex-ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.lex-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.lex-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lex-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.lex-rel > span:first-child:not(.lex-chip):not(.lex-tag) { width: 100%; font-size: 11px; font-weight: 700; color: var(--muted); }
.lex-rel > .good { color: var(--mint) !important; }
.lex-rel > .bad { color: var(--coral) !important; }
.lex-tag { padding: 2px 8px; border-radius: 999px; background: var(--tile-2); font-size: 11px; font-weight: 700; color: var(--butter); }
.lex-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 2px 9px 2px 5px; border: 0; border-radius: 999px; background: var(--tile-2); color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; }
.lex-chip i { width: 16px; height: 16px; display: grid; place-items: center; }
.lex-chip i svg { width: 100%; height: 100%; }
.lex-chip.q { padding: 2px 9px; color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.lex-hint { margin: 0; padding: 8px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 12px; color: var(--muted); }

/* Lexikon 2: Themen, Beispiel-Szenen, eigene Detailseite */
.lexfig { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--bg); font-family: var(--font); }
.lex-top { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; padding: 12px 14px; border-radius: 18px; background: var(--tile); }
.lex-top > b { font-family: var(--display); font-weight: 600; font-size: 24px; }
.lex-top > span { font-size: 12px; color: var(--muted); }
.lex-top .dbar { grid-column: 1 / -1; margin-top: 4px; }
.lex-top .dbar b { background: var(--butter); }
.lex-ch { grid-template-columns: 26px minmax(0, 1fr); align-items: center; min-height: 56px; padding: 8px 10px; }
.lex-ch .lex-ic { grid-row: 1 / 3; width: 24px; height: 24px; }
.lex-ch .lex-n { grid-column: 2; }
.lex-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lex-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; min-height: 84px; padding: 10px 4px; border: 0; border-radius: 16px; background: var(--tile); color: var(--ink); font: inherit; text-align: center; }
.lex-tile .lex-ic { width: 32px; height: 32px; }
.lex-tile b { max-width: 100%; font-family: var(--display); font-weight: 600; font-size: 12px; line-height: 1.15; overflow-wrap: anywhere; }
.lex-row { border-radius: 16px; background: var(--tile); }
.lex-row .w-chev { transform: rotate(-45deg); }
.lex-read { display: flex; flex-direction: column; gap: 10px; }
.lex-page { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 20px; background: var(--tile); font-size: 14px; line-height: 1.45; }
.lex-page p { margin: 0; }
.lex-page h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 18px; }
.lex-page header { display: flex; align-items: center; gap: 12px; }
.lex-page header span { font-size: 12px; color: var(--muted); }
.lex-hero { flex: none; display: grid; place-items: center; min-width: 56px; min-height: 56px; padding: 6px; border-radius: 16px; background: var(--bg); }
.lex-hero > svg { width: 44px; height: 44px; }
.lex-pat { display: grid; gap: 2px; justify-content: center; }
.lex-pat svg, .lex-pat i { display: block; width: 100%; aspect-ratio: 1; }
.lex-ic .lex-pat { gap: 1px; }
.lex-fighead { margin-bottom: 2px; }

/* Waffen: Pixelkiste, Lager, Verschmelzen, Katalog */
.tabs button.has { position: relative; }
.tabs button.has::after { content: ''; position: absolute; top: 8px; right: 22%; width: 8px; height: 8px; background: var(--butter); }
#armory .q-seg { margin: 10px 0 12px; }
#armory .q-seg button { font-size: 12px; }
.chest { display: block; width: 128px; height: auto; }
.box-shop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 14px 6px; border-radius: 22px; background: var(--surface-2); text-align: center; }
.box-shop .sum-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.arm-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.arm { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--tile); color: var(--ink); font: inherit; text-align: left; box-shadow: inset 4px 0 0 var(--rar); }
.arm.pick { cursor: pointer; }
.arm.pick.on { background: var(--tile-2); box-shadow: inset 0 0 0 2px var(--rar); }
.arm-head { display: flex; align-items: center; gap: 10px; }
.arm-head .pal-ic { width: 30px; height: 30px; flex: none; }
.arm-head .pal-ic svg { width: 100%; height: 100%; }
.arm-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.arm-n b { font-family: var(--display); font-weight: 600; }
.arm-n small { font-size: 12px; color: var(--rar, var(--muted)); font-weight: 700; }
.arm-on { flex: none; font-size: 11px; font-weight: 700; color: var(--butter); }
.arm-ls { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.arm-ls .minus { color: #FF9FB5; }
.arm-ls .dim { opacity: .7; }
.wcard.kat .arm-head + .arm-ls { padding: 0 2px 2px; }
.arm-pal { box-shadow: inset 0 -3px 0 var(--rar); }
.arm-pal .pal-c { color: var(--rar); }
#boxov { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 6, 24, 0.78); }
#boxov[hidden] { display: none; }
.box-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; height: 100%; justify-content: center; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.box-stage b { font-family: var(--display); font-weight: 600; font-size: 22px; }
.box-stage .chest { width: 190px; animation: chestIdle 1s steps(4) infinite; }
.box-stage.jump .chest { animation: chestJump .4s steps(5) 1, chestIdle 1s steps(4) .4s infinite; }
@keyframes chestIdle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes chestJump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-34px) scale(1.12); } 100% { transform: translateY(0) scale(1); } }
.box-won { position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 340px; }
.box-won .arm { position: relative; animation: armPop .3s steps(4) 1; }
.arm.big { padding: 16px; box-shadow: inset 0 0 0 3px var(--rar); background: var(--surface-2); }
@keyframes armPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.box-burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.box-burst i { position: absolute; width: 10px; height: 10px; transform: rotate(var(--a)) translateY(0); animation: pxBurst .6s steps(7) forwards; }
@keyframes pxBurst { to { transform: rotate(var(--a)) translateY(-170px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .box-stage .chest, .box-stage.jump .chest, .box-won .arm, .box-burst i { animation: none; } .box-burst { display: none; } }

/* Pixel-Szenen: jedes Menü ist ein Ort */
canvas.scene, .showbox canvas { image-rendering: pixelated; }
canvas.scene { display: block; width: 100%; height: auto; border-radius: 16px; margin-bottom: 10px; }
canvas.scene[hidden] { display: none; }
.showbox canvas { width: 100%; height: 100%; }
.scene-box { position: relative; }
.scene-box canvas.scene { margin-bottom: 10px; }
#labflask button { position: absolute; top: 38%; width: 15.5%; height: 46%; background: none; border: 0; padding: 0; cursor: pointer; }
#resstars button { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; background: none; border: 0; padding: 0; cursor: pointer; }
.lab-cat { display: block; margin: 10px 2px 8px; font-family: var(--display); font-weight: 600; font-size: 16px; }
#perks .lab-grid { grid-template-columns: 1fr; }
.nav-ic { width: 26px; height: 26px; image-rendering: pixelated; display: block; }
.tabs { background: #1C1631; border-radius: 0; left: 0; right: 0; bottom: 0; padding: 5px 6px; box-shadow: none; border-top: 2px solid #0F0B1E; backdrop-filter: none; }
.tabs button { border-radius: 12px; font-size: 11px; font-weight: 700; }
.tabs button.on { background: var(--surface-2); color: var(--ink, #F6F0FF); transform: translateY(-3px); box-shadow: 0 3px 0 #120D22; }
.up { position: relative; border-radius: 13px; box-shadow: inset 0 0 0 2px #463B72; }
button.up:has(.up-ic) { padding-left: 66px !important; min-height: 74px; }
.up-ic { position: absolute; left: 10px; top: 50%; width: 44px; height: 44px; margin-top: -22px; padding: 7px; box-sizing: border-box; border-radius: 9px; background: var(--coral); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); image-rendering: pixelated; object-fit: contain; }
.up:disabled .up-ic { filter: saturate(.45); }
.up:active:not(:disabled) { transform: scale(1.02) rotate(-.5deg); }
#ups button.up:has(.up-ic) { padding-left: 48px !important; min-height: 56px; }
#ups .up-ic { left: 7px; width: 34px; height: 34px; margin-top: -17px; padding: 5px; }
.picker { padding: 6px 10px; border-radius: 8px; background: repeating-linear-gradient(0deg, #8A5A3C 0 9px, #7D5035 9px 10px); box-shadow: 0 3px 0 #3B2519; }
.picker .pick-mid, .picker .pick-mid .lbl { color: #FBEFD8; }
.pick-arrow { background: #5F3D2E; color: #F2E6CF; border-radius: 9px; box-shadow: 0 3px 0 #3B2519; }
.start-btn, .sum-btn { box-shadow: 0 5px 0 #B8563F; }
.start-btn:active, .sum-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #B8563F; }
/* Werkbank */
.ed-wrap { border-radius: 10px; padding: 12px; background: repeating-linear-gradient(0deg, #9A6846 0 24px, #5F3D2E 24px 25px, #8A5A3C 25px 49px, #5F3D2E 49px 50px); box-shadow: 0 4px 0 #3B2519; }
#editor { border-radius: 3px; background: #2E2550; box-shadow: 0 0 0 2px #1A1430; }
/* Sternwarte */
.res-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 10px; align-items: center; padding: 12px; border-radius: 13px; background: #191334; box-shadow: inset 0 0 0 2px #39306A; }
.res-card .up-ic { position: static; margin: 0; }
.res-info { display: flex; flex-direction: column; min-width: 0; }
.res-info b { font-family: var(--display); font-weight: 600; font-size: 18px; }
.res-card p { grid-column: 1 / -1; margin: 6px 0 8px; font-size: 13px; color: var(--mint); font-weight: 700; }
.res-card .sum-btn { grid-column: 1 / -1; width: 100%; }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.res-chip { min-height: 38px; padding: 0 11px; border: 0; border-left: 4px solid var(--c); border-radius: 7px; background: var(--tile); color: var(--muted); font-size: 12px; font-weight: 800; }
.res-chip.on { background: var(--surface-2); color: var(--ink, #F6F0FF); }
/* Quests als Zettel an der Pinnwand */
.q-row { position: relative; margin: 10px 2px; padding: 12px 11px 10px; border-radius: 0; background: #F2E6CF; color: #3C2C25; box-shadow: 0 3px 0 rgba(0,0,0,.35); border: 0; }
.q-row:nth-child(odd) { transform: rotate(-.6deg); } .q-row:nth-child(even) { transform: rotate(.5deg); }
.q-row::before { content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; background: #FF5D73; box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.q-row .st-dim, .q-row small { color: #7A6355; }
.q-row b { color: #3C2C25; }
.q-row .ch-ic { display: none; }
.q-row.done .ch-ic { display: block; position: absolute; right: 8px; top: 8px; width: auto; height: auto; padding: 3px 6px; border: 3px solid #B9412F; border-radius: 5px; background: none; color: #B9412F; font-family: var(--display); font-size: 12px; font-weight: 700; transform: rotate(-11deg); }
.q-row.done { opacity: 1; }
.q-row .dbar { background: #D9C8A8; }
.st-list:has(.q-row) { padding: 10px 10px 12px; border-radius: 12px; background-color: #7A5238; background-image: radial-gradient(#694429 1px, transparent 1.5px); background-size: 6px 6px; box-shadow: inset 0 0 0 5px #5F3D2E; }
#palette .lack-tog { grid-column: 1 / -1; }

/* ---------- Pixel-Oberfläche: alles im selben Stil wie die Spielwelt ---------- */
:root { --radius: 8px; }
.gem, .coin, .urp, .cur { display: inline-block; width: 15px; height: 15px; border-radius: 0 !important; transform: none !important; box-shadow: none !important; background-color: transparent !important; background-repeat: no-repeat !important; background-position: center !important; background-size: contain !important; image-rendering: pixelated; vertical-align: -2px; }
.gem { background-image: var(--px-gem) !important; } .coin { background-image: var(--px-coin) !important; } .urp { background-image: var(--px-urp) !important; }
.cur.f { background-image: var(--px-cur-f) !important; } .cur.s { background-image: var(--px-cur-s) !important; } .cur.m { background-image: var(--px-cur-m) !important; }
.cur::before, .cur::after { display: none !important; }
.q-node .cur, .q-node .gem { width: 13px; height: 13px; }
img.px-ic { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
img.px-ic.locked { filter: grayscale(1) brightness(.55); }
#arena { image-rendering: pixelated; }
/* Kopfzeile liegt als Schild über der Szene */
.mode[data-mode="menu"] { position: relative; }
.mode.scened .menu-head { position: absolute; left: 0; right: 0; top: 0; z-index: 6; padding: 10px 12px; pointer-events: none; }
.mode.scened .menu-head > * { pointer-events: auto; }
.mode.scened .menu-head > div:first-child { padding: 3px 10px 5px; border-radius: 5px; background: rgba(26,20,48,.82); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.mode.scened .menu-title { font-size: 19px; }
.chip, .gear { border-radius: 7px !important; background: rgba(26,20,48,.82) !important; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.gear { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; }
.gear .nav-ic { width: 22px; height: 22px; }
.mode.scened .mpage, .mode.scened .home, .mode.scened .ws { padding-top: 0; }
.mpage > canvas.scene, .mpage > .scene-box { margin: 0 -16px; width: calc(100% + 32px); max-width: none; }
canvas.scene { border-radius: 0; margin-bottom: 0; }
.scene-box canvas.scene { width: 100%; margin: 0; }
#labflask button { top: 50%; height: 34%; }
/* Basis */
.home { padding-left: 14px; padding-right: 14px; gap: 9px; }
.showbox { flex: none; min-height: 0; margin: 0 -14px; border-radius: 0; background: none; overflow: visible; }
.showbox canvas { position: relative; display: block; height: auto; width: 100%; aspect-ratio: 200 / 196; }
.show-stats { position: static; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 9px 14px 0; }
.show-stats span { padding: 6px 2px; border-radius: 7px; background: var(--tile); text-align: center; font-weight: 800; box-shadow: 0 2px 0 #171129; }
.show-stats b { display: block; font-family: var(--display); font-size: 14px; }
.lvl-mile { gap: 6px; }
.lvl-mile i { height: 26px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 900; color: var(--muted); border-radius: 5px; background: var(--tile); }
.lvl-mile i.on { background: var(--butter); color: #3A2A08; }
.start-btn { border-radius: 12px; }
/* Navigation unten bündig, Karten kantig */
.up, .wcard, .perk, .st-row, .arm, .q-card, .box-shop, .q-cur, .res-card, .lack-tog, .first-step, .home-msg, .res-chip, .rp-card, .perk-btn, .sum-btn, .rp-end, .up-c, .res-auto { border-radius: 8px !important; }
.q-seg { border-radius: 9px; padding: 3px; } .q-seg button { border-radius: 7px; }
.perk, .wcard, .q-card, .box-shop, .q-cur, .st-row, .arm, .lack-tog, .first-step { box-shadow: 0 3px 0 #171129; }
.st-list { gap: 6px; }
.perk-btn, .sum-btn, .rp-end { box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.perk-btn:active, .sum-btn:active, .rp-end:active, .first-step:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.tier-h, .st-h { font-family: var(--display); font-weight: 600; color: var(--ink, #F6F0FF); }
/* Fenster wie Holzschilder */
.rp-card, #summary > *, #offline > *, #stone > *, #boxov > * { border-radius: 10px; }
#stone > div, #offline > div, #summary > div { box-shadow: 0 0 0 3px #1A1430, 0 0 0 6px #5F3D2E, 0 6px 0 6px #3B2519; }
/* Werkbank */
.ws { padding: 0 0 110px; gap: 9px; }
.ws > * { margin-left: 14px; margin-right: 14px; }
.ws-title { order: 2; }
.ed-wrap { order: 1; position: relative; margin: 0; max-width: none; aspect-ratio: auto; padding: 58px 26px 22px; border-radius: 0; background: #8A5A3C; box-shadow: 0 3px 0 #3B2519; }
#wsscene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: default; }
#editor { position: relative; image-rendering: pixelated; border-radius: 0; background: none; box-shadow: 0 0 0 3px #1A1430, 0 4px 0 3px #3B2519; }
.ws > .tools, .ws > #info, .ws > .ws-pick, .ws > .ws-tabs { order: 3; }
.pal-ic svg, .pal-ic img { width: 100%; height: 100%; }
/* Run: Anzeigen schweben als Schilder über der Welt */
.mode[data-mode="run"] .hud { position: absolute; left: 0; right: 0; top: 0; z-index: 5; padding: 8px 9px; }
.mode[data-mode="run"] .wavebar { position: absolute; left: 9px; right: 9px; top: 58px; z-index: 5; height: 6px; margin: 0; border-radius: 0; background: #1A1430; }
.mode[data-mode="run"] .wavebar i { border-radius: 0; }
.mode[data-mode="run"] { position: relative; }
.hud-wave { border-radius: 8px; background: rgba(20,15,36,.82); padding: 4px 10px 4px 4px; }
.hud-wave .badge { min-width: 34px; height: 34px; border-radius: 6px; }
.hud .chip { background: rgba(20,15,36,.82) !important; }
#overlay { border-radius: 6px; background: rgba(20,15,36,.88); color: #F6F0FF; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.sheet { border-radius: 0; border-top: 3px solid #0F0B1E; background: #231B3A; }
.hpbar { height: 13px; padding: 2px; border-radius: 3px; background: #0F0B1E; box-sizing: border-box; }
.hpbar i { border-radius: 0 !important; background: repeating-linear-gradient(90deg, #7FE0C4 0 6px, transparent 6px 7px) !important; }
.dbar, .dbar b { border-radius: 2px; }
#speed { border-radius: 8px; }
.uptabs button { border-radius: 7px; }
.alive, .ev-chip, .heart-chip { border-radius: 5px; background: rgba(20,15,36,.8); padding: 2px 6px; }
/* überall kantig, wie die Spielwelt */
.phone :not(.gem):not(.coin):not(.urp):not(.cur):not(.mode):not(.ch-ic):not(.round):not(.flat) { border-radius: 6px !important; }
.ws > .tools button { box-shadow: 0 3px 0 #171129; }
.mode.scened canvas, .showbox { border-radius: 0 !important; }
.lex-find input { box-shadow: inset 0 0 0 2px #463B72; }
/* Handbuch: Buchrücken in der Übersicht, Papierseiten beim Lesen */
.lex-find { margin-top: 8px; }
.lex-top { padding: 9px 12px; background: var(--tile); box-shadow: 0 3px 0 #171129; }
.lex-ch { position: relative; grid-template-columns: 42px minmax(0, 1fr); padding: 7px 8px 7px 13px; min-height: 58px; align-items: center; background: var(--tile); box-shadow: inset 5px 0 0 var(--c), 0 3px 0 #171129; }
.lex-ch .lex-ic { grid-row: 1 / 3; width: 34px; height: 34px; padding: 5px; box-sizing: border-box; background: #1A1430; }
.lex-ch b { align-self: end; } .lex-ch .lex-n { align-self: start; }
.lex-tile, .lex-row { background: var(--tile); box-shadow: 0 3px 0 #171129; }
.lex-tile .lex-ic, .lex-row .lex-ic { background: #1A1430; padding: 3px; box-sizing: border-box; }
.lex-back { padding: 0 10px; background: var(--tile); box-shadow: 0 3px 0 #171129; }
.lex-page { padding: 14px 13px; background: #F2E6CF; color: #3C2C25; box-shadow: inset 0 0 0 2px #D9C8A8, 0 4px 0 #A99678; line-height: 1.45; }
.lex-page h3 { margin: 0 0 4px; color: #3C2C25; font-family: var(--display); font-weight: 600; font-size: 18px; }
.lex-page header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 2px dashed #CDB991; }
.lex-page header span { color: #7A6355; }
.lex-page p, .lex-page li, .lex-page .lex-ul { color: #3C2C25; }
.lex-page b { color: #3C2C25; }
.lex-page .mnote, .lex-page .st-dim, .lex-page .lex-sub { color: #7A6355; }
.lex-hero { width: 62px; height: 62px; flex: none; padding: 5px; box-sizing: border-box; background: #1A1430 !important; box-shadow: 0 3px 0 #A99678; }
.lexfig { display: block; width: 100%; margin: 8px 0 10px; padding: 8px; box-sizing: border-box; background: #231B3A; box-shadow: inset 0 0 0 3px #5F3D2E; shape-rendering: crispEdges; }
.lex-read { display: flex; flex-direction: column; gap: 12px; }
.lex-fighead .lexfig { margin-top: 0; }
.lex-rel { color: #3C2C25; }
.lex-chip { background: #E4D5B7; color: #3C2C25; border: 0; box-shadow: 0 2px 0 #B7A68E; }
.lex-chip i { display: inline-block; width: 16px; height: 16px; }
.lex-chip.q { background: #D9C8A8; color: #7A6355; }
.lex-hint { background: #F2E6CF; color: #5A4638; padding: 8px 10px; box-shadow: 0 2px 0 #A99678; }
.lex-page span, .lex-page small, .lex-page dt, .lex-page dd { color: #6A5446; }
.lex-page span b, .lex-page dd b { color: #3C2C25; }
.lex-hero img.px-ic { width: 100%; height: 100%; }
.lex-tile .lex-ic img.px-ic, .lex-row .lex-ic img.px-ic { transform: scale(1.35); }
.lex-tip { background: #E4D5B7; color: #3C2C25; box-shadow: inset 4px 0 0 #B9412F; padding-left: 13px; }
.lex-tip, .lex-tip span { color: #3C2C25; }
.lex-tip b { color: #B9412F; }
.lex-rel > span:first-child:not(.lex-chip):not(.lex-tag) { color: #6A5446; }
.lex-rel > .good { color: #2E7D5B !important; }
.lex-rel > .bad { color: #B9412F !important; }
.lex-facts, .lex-facts span { color: #6A5446; }
.lex-facts b { color: #3C2C25; }
.lex-dim { color: #7A6355 !important; }
.lex-tag { background: #D9C8A8; color: #3C2C25; }
/* Werkstatt: das Raster bekommt die volle Breite, die Auswahl bleibt ohne Scrollen erreichbar */
.ws { height: 100%; min-height: 0; padding-bottom: 76px; gap: 6px; overflow: hidden; }
.ed-wrap { flex: none; width: 100%; min-width: 0; align-self: stretch; padding: 52px max(8px, calc((100% - (100dvh - 400px)) / 2)) 10px; }
.ws-title { flex: none; padding: 4px 8px 4px 12px; }
.ws > .tools { flex: none; }
.tools button { height: 42px; max-width: none; aspect-ratio: auto; }
#info { flex: none; padding-top: 4px; padding-bottom: 4px; }
#info .info-txt span { -webkit-line-clamp: 1; }
.ws-pick { flex: 1; min-height: 70px; padding-bottom: 6px; }
/* Kiste */
#boxov { padding: 10px; background: rgba(10, 6, 24, .9); }
.box-scene { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto; }
.box-cv { display: block; width: 100%; padding: 0; border: 0; background: none; }
#boxcv { display: block; width: 100%; height: auto; image-rendering: pixelated; }
#boxlab { font-family: var(--display); font-weight: 600; font-size: 24px; }
#boxlab.pop { animation: boxPop .25s steps(4) 1; }
@keyframes boxPop { 40% { transform: scale(1.3); } }
#boxcard { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.box-tip { text-align: center; font-size: 13px; color: var(--muted); }
#boxcard .arm { animation: armPop .3s steps(4) 1; }
#boxcard .sum-btn { width: 100%; }
/* Run-Menü als Holztafel */
#runpanel { background: rgba(10, 6, 24, .62); }
.rp-card { left: 10px; right: 10px; top: 10px; width: auto; max-height: calc(100% - 20px); overflow-y: auto; padding: 0 12px 12px; background: #231B3A; box-shadow: 0 0 0 3px #1A1430, 0 0 0 6px #5F3D2E, 0 6px 0 6px #3B2519; }
.rp-head { margin: 0 -12px 10px; padding: 10px 12px; color: #FBEFD8; background: repeating-linear-gradient(0deg, #8A5A3C 0 9px, #7D5035 9px 10px); box-shadow: 0 3px 0 #3B2519; }
.rp-head .lbl { color: #F2E6CF; }
.rp-x { width: 42px; height: 42px; background: #5F3D2E; color: #F2E6CF; box-shadow: 0 3px 0 #3B2519; font-weight: 800; }
.rp-grid { gap: 6px; margin-bottom: 8px; }
.rp-grid div { padding: 7px 10px; background: var(--tile); box-shadow: 0 2px 0 #171129; }
.rp-grid b { font-size: 16px; }
.pix-row i { height: 8px; padding: 1px; background: #0F0B1E; }
.pix-row i b { background: repeating-linear-gradient(90deg, #FF8A6B 0 4px, transparent 4px 5px); }
.rp-card .mnote { margin: 8px 0; }
#endrun.rp-end { width: 100%; min-height: 54px; background: #FF5D73; color: #3A0F16; box-shadow: 0 5px 0 #B9412F; }
#endrun.rp-end:active { transform: translateY(4px); box-shadow: 0 1px 0 #B9412F; }
#summary .sum-btn { width: 100%; }
/* Quest-Seite */
#tasks { gap: 8px; padding-top: 8px; }
.q-bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.q-cur { display: grid; grid-template-columns: 22px 1fr; column-gap: 7px; align-items: center; padding: 6px 8px; border: 0; color: inherit; font: inherit; text-align: left; background: var(--tile); }
.q-cur .cur { grid-row: 1 / 3; width: 20px; height: 20px; }
.q-cur b { font-family: var(--display); font-size: 15px; line-height: 1; } .q-cur small { font-size: 10px; color: var(--muted); }
#tasks .q-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
#tasks .q-seg button { position: relative; min-height: 40px; padding: 0 2px; font-size: 12px; }
.q-seg .w-dot { position: absolute; right: 3px; top: 3px; }
.w-dot { display: inline-block; width: 8px; height: 8px; background: #FF5D73; box-shadow: 0 0 0 2px #1A1430; }
.tabs button.has-dot { position: relative; }
.tabs button.has-dot::after { content: ''; position: absolute; right: 22%; top: 5px; width: 9px; height: 9px; background: #FF5D73; box-shadow: 0 0 0 2px #1A1430; }
.q-card { gap: 5px; padding: 9px 11px 10px; color: #FBEFD8; background: repeating-linear-gradient(0deg, #8A5A3C 0 9px, #7D5035 9px 10px); box-shadow: 0 3px 0 #3B2519; }
.q-card .st-dim, .q-card span { color: #F2E6CF; }
.q-card .q-top b { color: #fff; }
.q-card .q-bar { height: 12px; padding: 2px; background: #1A1430; }
.q-card .q-bar b { background: repeating-linear-gradient(90deg, #FFD98A 0 6px, transparent 6px 7px); }
.q-card .mnote { display: none; }
.q-steps { display: flex; gap: 5px; margin-top: 3px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.q-steps::-webkit-scrollbar { display: none; }
.q-node { flex: none; width: 56px; min-height: 58px; background: #3C2619; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); color: #FBEFD8; }
.q-node span { color: #FBEFD8; font-size: 11px; }
.q-node em { color: #E7D2B4; }
.q-node.bonus { background: #5F3D2E; box-shadow: inset 0 0 0 2px #FFD98A; }
.q-node.on { background: #FFD98A; color: #3A2A08; } .q-node.on span, .q-node.on em { color: #3A2A08; }
.st-h { margin: 6px 2px 0; }
.st-list:has(.q-row) { gap: 4px; }
.q-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin: 7px 1px; padding: 13px 11px 9px; }
.q-row.t1::before { background: #3FA98F; } .q-row.t2::before { background: #FFD24A; } .q-row.t3::before { background: #FF5D73; }
.q-row > span:nth-child(2) { grid-column: 1; min-width: 0; }
.q-row .q-xp { grid-column: 2; grid-row: 1; padding: 3px 7px; background: #E4D5B7; }
.q-row .q-xp b { color: #B9412F; font-family: var(--display); }
.q-row.done .q-xp { visibility: hidden; }
.q-row.done > span:nth-child(2) { opacity: .6; }
.q-row .dbar { display: block; height: 7px; margin: 5px 0 2px; }
.q-row .dbar b { background: repeating-linear-gradient(90deg, #6E8F5A 0 5px, transparent 5px 6px); }
/* Läden */
.stand { padding: 0 9px 9px; background: var(--tile); box-shadow: 0 3px 0 #171129; }
.stand header { display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center; margin: 0 -9px 8px; padding: 7px 10px; color: #FBEFD8; background: repeating-linear-gradient(0deg, #8A5A3C 0 9px, #7D5035 9px 10px); box-shadow: 0 3px 0 #3B2519; }
.stand header .cur, .stand header .gem, .stand header .urp { width: 24px; height: 24px; margin: 0; }
.stand header b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; }
.stand header span { display: block; font-size: 11px; color: #F2E6CF; }
.stand header em { padding: 3px 9px; background: #1A1430; color: #FFD98A; font-style: normal; font-family: var(--display); font-weight: 600; }
.stand .lab-grid { grid-template-columns: 1fr; margin-bottom: 6px; }
.shop-go { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border: 0; color: inherit; font: inherit; font-size: 13px; font-weight: 800; text-align: left; background: var(--tile-2); box-shadow: 0 3px 0 #171129; }
.shop-go b { flex: none; padding: 4px 9px; background: var(--butter); color: #3A2A08; }
/* Statistik */
.st-tile { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; box-shadow: 0 3px 0 #171129; }
.st-pic { grid-row: 1 / 3; width: 26px; height: 26px; padding: 3px; box-sizing: border-box; object-fit: contain; image-rendering: pixelated; background: #1A1430; }
.st-tile span { grid-column: 2; font-size: 11px; } .st-tile b { grid-column: 2; font-size: 15px; }
#stats { padding-top: 8px; }
.st-lvl { padding: 8px 10px; background: var(--tile); box-shadow: 0 3px 0 #171129; }
.st-lvl i { height: 9px; padding: 1px; background: #0F0B1E; }
.st-lvl i b { background: repeating-linear-gradient(90deg, #FFD98A 0 5px, transparent 5px 6px); }
.st-ic { width: 26px; height: 26px; background: #1A1430; }
/* Einstellungen als Schaltpult */
#settings { padding-top: 8px; }
.st-set, .st-slider, .snd-row { background: var(--tile); box-shadow: 0 3px 0 #171129; }
.st-set { position: relative; }
.st-set[aria-pressed="true"] b, .snd-tog[aria-pressed="true"] { background: #7FE0C4; color: #123A30; }
.st-set b { padding: 4px 9px; background: #1A1430; color: var(--muted); }
.snd-tog { background: #1A1430; color: var(--muted); }
.st-slider { display: grid; grid-template-columns: 70px 1fr 48px; gap: 8px; align-items: center; padding: 8px 12px; }
.st-slider input[type=range] { -webkit-appearance: none; appearance: none; height: 28px; width: 100%; background: none; }
.st-slider input[type=range]::-webkit-slider-runnable-track { height: 10px; background: #0F0B1E; }
.st-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; margin-top: -8px; background: #FFD98A; box-shadow: inset 0 -5px 0 #BD9A55, 0 0 0 2px #1A1430; }
.snd-arr { background: #1A1430; }
.mode.scened.scrolled .menu-head { padding: 6px 12px; background: #231B3A; box-shadow: 0 3px 0 #0F0B1E; }
.mode.scened.scrolled .menu-head > div:first-child { background: none; box-shadow: none; padding: 0; }
.mode.scened.scrolled .menu-head .lbl { display: none; }
.st-set b:empty { display: none; }
.q-row .q-xp small { color: #7A6355 !important; }
/* Waffen-Bereich: Szene bleibt immer sichtbar, außerhalb der Kisten nur als schmales Regal */
#armscene.short { aspect-ratio: 200 / 84; object-fit: cover; object-position: top; height: auto; }
#armory { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
#armory .q-bal { grid-template-columns: repeat(4, 1fr); gap: 4px; }
#armory .q-cur { grid-template-columns: 1fr; justify-items: center; padding: 5px 2px; text-align: center; }
#armory .q-cur .gem, #armory .q-cur .cur { grid-row: auto; }
#armory .q-seg { display: flex; gap: 2px; }
#armory .q-seg button { flex: 1 1 auto; min-height: 40px; padding: 0 4px; font-size: 11px; white-space: nowrap; }
#armory .arm.pick { width: 100%; }
.res-line { margin: 8px 2px 6px; font-size: 13px; color: var(--muted); }
.res-ups { grid-template-columns: 1fr; }
.res-ups button.up:has(.up-ic) { min-height: 64px; }
#prestgo { flex: none; background: #4A3A7A; }
#armscene.short { aspect-ratio: 200 / 66; }
.wcard .lab-grid { grid-template-columns: 1fr; }
/* Shop */
.tabs button { font-size: 10px; padding-left: 0; padding-right: 0; }
#shop { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.shop-bal { grid-template-columns: repeat(5, 1fr) !important; gap: 3px !important; }
.shop-bal .q-cur { grid-template-columns: 1fr; justify-items: center; padding: 5px 1px; text-align: center; }
.shop-bal .q-cur .gem, .shop-bal .q-cur .cur, .shop-bal .q-cur .urp { grid-row: auto; margin: 0; }
.shop-bal .q-cur small { font-size: 9px; }
.shop-bal .q-cur b { font-size: 13px; }
#shop .q-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
#shop .q-seg button { min-height: 42px; font-size: 13px; }
.stand .sum-btn { width: 100%; margin-bottom: 9px; }
.odds { display: flex; height: 12px; gap: 2px; margin: 2px 0 8px; }
.odds i { display: block; min-width: 6px; }
.stand .st-list { gap: 4px; }
.stand .st-row { padding: 6px 10px; background: var(--tile-2); box-shadow: none; }
.stand .perk { margin-bottom: 6px; background: var(--tile-2); box-shadow: none; }
.stand .mnote { margin: 6px 2px 0; }
.stand header { grid-template-columns: 26px 1fr; }
/* Schilder an den Kolben */
#labflask button { top: 50%; height: 49%; width: 15.5%; }
#labflask span { position: absolute; left: 0; right: 0; bottom: 4px; padding: 2px 0 3px; color: #FBEFD8; background: #5F3D2E; box-shadow: inset 0 0 0 1px #3B2519, 0 2px 0 #3B2519; font-size: 10px; font-weight: 800; line-height: 1.1; text-align: center; white-space: nowrap; }
#labflask button.on span { background: #FFD98A; color: #3A2A08; box-shadow: inset 0 0 0 1px #BD9A55, 0 2px 0 #BD9A55; }
/* Die Schilder zeichnet die Szene selbst, der Text bleibt nur für Vorlesehilfen */
#labflask span { opacity: 0; }
#overlay { top: 72px; z-index: 6; }

/* Musikkiste */
.mu-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--rar); }
.mu-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mu-odds { flex-direction: column; align-items: flex-start; gap: 2px; }
.mu-odds b { display: inline-block; min-width: 46px; }
.st-set > span { text-align: left; }
.st-set:has(.mu-sub) { padding-block: 8px; }
.st-set .mu-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.st-set span .round { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: middle; }
