:root {
  --bg: #0b0d0a; --bg2: #12150f; --panel: rgba(18, 21, 15, 0.92); --panel2: rgba(27, 31, 23, 0.95); --panel3: #2a2f24;
  --line: rgba(255, 255, 255, 0.07); --line2: rgba(255, 255, 255, 0.13);
  --text: #e9ead8; --muted: #9a9c86; --dim: #66685a;
  --acc: #c8a24a; --acc-rgb: 200, 162, 74; --acc2: #7f9a4a; --red: #c8402a; --blood: #9a1e18; --ok: #6fbf5a; --warn: #e0a030; --blue: #5a9ad0;
  --r: 12px; --rs: 8px; --font: 'Rubik', system-ui, sans-serif; --head: 'Rubik', 'Chakra Petch', system-ui, sans-serif;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; user-select: none; }
input, textarea, select { user-select: text; font-family: inherit; }
button { font-family: inherit; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui > * { pointer-events: auto; }
#ui > .hud-root { pointer-events: none; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; }

#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at 50% 40%, #1d2216, #070806 70%); transition: opacity .6s; }
#boot.out { opacity: 0; pointer-events: none; }
.boot-logo, .logo { font-family: var(--head); font-weight: 900; font-style: italic; letter-spacing: .5px; font-size: 44px; }
.boot-logo span, .logo span { color: var(--acc); }
.boot-sub { color: var(--muted); margin-top: 8px; }
.bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc)); width: 0; transition: width .2s; }

/* ------------------------------------------------ Allgemeine Elemente */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel3); color: var(--text); font-weight: 700; cursor: pointer; transition: transform .1s, background .15s, border-color .15s; }
.btn:hover { background: #343a2c; border-color: rgba(var(--acc-rgb), .45); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #d8b25a, #a8822a); color: #17130a; border: 0; box-shadow: 0 8px 24px rgba(var(--acc-rgb), .2); }
.btn.danger { background: linear-gradient(180deg, #d0503a, #9a2a1e); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn.small { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .35); color: var(--text); font-size: 14px; outline: none; width: 100%; }
.input:focus { border-color: rgba(var(--acc-rgb), .6); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--panel3); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(111, 191, 90, .35); } .pill.bad { color: #ff8a70; border-color: rgba(200, 64, 42, .4); } .pill.acc { color: var(--acc); border-color: rgba(var(--acc-rgb), .4); }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.h1 { font-family: var(--head); font-weight: 900; font-size: 30px; letter-spacing: .3px; margin: 0; }
.h2 { font-family: var(--head); font-weight: 800; font-size: 20px; margin: 0; }
.h3 { font-weight: 800; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0; }
.row { display: flex; gap: 10px; align-items: center; } .col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }

/* ------------------------------------------------ Login / Menü-Bildschirme */
.screen { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(1200px 700px at 20% 0%, rgba(127, 154, 74, .16), transparent 60%), radial-gradient(900px 600px at 100% 100%, rgba(200, 64, 42, .12), transparent 60%), rgba(8, 9, 7, .82); overflow: auto; padding: 24px; }
.auth { width: min(420px, 94vw); display: grid; gap: 14px; }
.auth .tabs { display: flex; gap: 6px; }
.auth .tabs button { flex: 1; }
.err { color: #ff8a70; font-size: 13px; min-height: 18px; }
.creator { width: min(1180px, 96vw); display: grid; grid-template-columns: 300px 1fr 300px; gap: 16px; align-items: start; }
.creator .list { display: grid; gap: 6px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.opt { text-align: left; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; display: grid; gap: 2px; }
.opt:hover { border-color: var(--line2); }
.opt.on { border-color: var(--acc); background: linear-gradient(90deg, rgba(var(--acc-rgb), .14), var(--panel2) 70%); }
.opt.neg.on { border-color: var(--red); background: linear-gradient(90deg, rgba(200, 64, 42, .16), var(--panel2) 70%); }
.opt.off { opacity: .4; }
.opt .t { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.opt .d { font-size: 12px; color: var(--muted); }
.cost { font-weight: 800; font-size: 12px; } .cost.pos { color: #ff9a80; } .cost.neg { color: var(--ok); }
.points { font-family: var(--head); font-weight: 900; font-size: 34px; }
.points.bad { color: var(--red); }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 40vh; overflow: auto; }
.agent-card { border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); padding: 8px; cursor: pointer; font-size: 12px; display: grid; gap: 3px; }
.agent-card.on { border-color: var(--acc); }
.agent-card .sw { height: 6px; border-radius: 3px; }

/* ------------------------------------------------ HUD */
.hud-root { position: fixed; inset: 0; pointer-events: none; }
.hud-root .interactive { pointer-events: auto; }
.cross { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none; }
.cross::before, .cross::after { content: ''; position: absolute; background: rgba(255, 255, 255, .85); box-shadow: 0 0 2px #000; }
.cross::before { left: 10px; top: 4px; width: 2px; height: 14px; } .cross::after { top: 10px; left: 4px; height: 2px; width: 14px; }
.cross.dot::before { left: 9px; top: 9px; width: 4px; height: 4px; border-radius: 2px; } .cross.dot::after { display: none; }
.cross.spread::before { height: var(--sp, 14px); top: calc(11px - var(--sp, 14px) / 2); }
.hitmark { position: fixed; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(45deg); border: 2px solid #fff; border-radius: 3px; opacity: 0; transition: opacity .15s; }
.hitmark.on { opacity: .9; }
.vitals { position: fixed; left: 18px; bottom: 18px; display: grid; gap: 6px; width: 250px; }
.vrow { display: grid; grid-template-columns: 20px 1fr 46px; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.vrow .bar { height: 7px; background: rgba(0, 0, 0, .45); }
.vrow.hp .bar > i { background: linear-gradient(90deg, #a83020, #e05a3a); }
.vrow.blood .bar > i { background: linear-gradient(90deg, #6a0e0a, #b8201a); }
.vrow.food .bar > i { background: linear-gradient(90deg, #8a6a2a, #d8a84a); }
.vrow.water .bar > i { background: linear-gradient(90deg, #2a5a8a, #5aa8e0); }
.vrow.energy .bar > i { background: linear-gradient(90deg, #4a4a7a, #8a8ad0); }
.vrow.stamina .bar > i { background: linear-gradient(90deg, #5a7a3a, #a8d06a); }
.vrow.temp .bar > i { background: linear-gradient(90deg, #3a7ad0, #e0d06a, #e05a3a); }
.moodles { position: fixed; right: 18px; top: 120px; display: grid; gap: 6px; justify-items: end; }
.moodle { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 10px; background: rgba(15, 17, 12, .78); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.moodle .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; }
.moodle.l1 .ic { background: #6a6a3a; } .moodle.l2 .ic { background: #a07a2a; } .moodle.l3 .ic { background: #b84a2a; } .moodle.l4 .ic { background: #c82a1a; animation: pulse 1s infinite; }
.moodle.good .ic { background: #4a8a3a; }
@keyframes pulse { 50% { filter: brightness(1.6); } }
.compass { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); width: 420px; height: 30px; overflow: hidden; border-radius: 8px; background: linear-gradient(90deg, transparent, rgba(10, 12, 9, .7) 15%, rgba(10, 12, 9, .7) 85%, transparent); font-weight: 800; font-size: 12px; }
.compass .strip { position: absolute; top: 0; height: 30px; white-space: nowrap; }
.compass .strip span { position: absolute; top: 7px; transform: translateX(-50%); color: var(--muted); }
.compass .strip span.c { color: var(--acc); font-size: 14px; top: 5px; }
.compass .strip span.m { color: #6fd0ff; }
.compass::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--acc); }
.clock { position: fixed; right: 18px; top: 14px; text-align: right; font-weight: 800; text-shadow: 0 1px 3px #000; line-height: 1.35; }
.clock .s { font-size: 11px; color: var(--muted); font-weight: 600; }
.hotbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; }
.slot { width: 74px; height: 58px; border-radius: 10px; background: rgba(15, 17, 12, .78); border: 1px solid var(--line); position: relative; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
.slot.on { border-color: var(--acc); box-shadow: 0 0 0 2px rgba(var(--acc-rgb), .25); color: var(--text); }
.slot .k { position: absolute; left: 5px; top: 3px; font-size: 10px; color: var(--dim); }
.slot .a { position: absolute; right: 5px; bottom: 3px; font-size: 11px; color: var(--acc); }
.ammo { position: fixed; right: 18px; bottom: 18px; text-align: right; font-family: var(--head); font-weight: 900; text-shadow: 0 2px 4px #000; }
.ammo .n { font-size: 34px; } .ammo .w { font-size: 12px; color: var(--muted); font-weight: 700; }
.prompt { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); display: grid; gap: 4px; justify-items: center; font-weight: 700; text-shadow: 0 1px 3px #000; }
.prompt .key { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: #111; font-size: 12px; margin-right: 6px; }
.progress { position: fixed; left: 50%; top: 64%; transform: translateX(-50%); width: 260px; display: grid; gap: 6px; text-align: center; font-weight: 700; text-shadow: 0 1px 3px #000; }
.progress .bar { height: 8px; background: rgba(0, 0, 0, .5); }
.notes { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; }
.note { padding: 7px 14px; border-radius: 10px; background: rgba(15, 17, 12, .86); border: 1px solid var(--line2); font-weight: 600; animation: noteIn .25s; }
.note.bad { border-color: rgba(200, 64, 42, .6); color: #ffb8a8; } .note.good { border-color: rgba(111, 191, 90, .5); color: #c8f0b8; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-6px); } }
.chat { position: fixed; left: 18px; bottom: 190px; width: 380px; display: grid; gap: 4px; font-size: 13px; }
.chat .line { text-shadow: 0 1px 2px #000; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); }
.chat .line b { color: var(--acc); } .chat .line.party b { color: #6fd0ff; } .chat .line.radio b { color: #9ae07a; } .chat .line.sys { color: var(--muted); }
.chat input { pointer-events: auto; }
.reward { position: fixed; right: 18px; top: 70px; font-weight: 800; color: var(--acc); text-shadow: 0 1px 3px #000; }
.vignette-hurt { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(160, 10, 0, .55)); opacity: 0; transition: opacity .3s; }
.blackout { position: fixed; inset: 0; pointer-events: none; background: #000; opacity: 0; transition: opacity 1.2s; }
.scope-ov { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 32vmin, #000 33vmin); }
.scope-ov::before, .scope-ov::after { content: ''; position: absolute; background: rgba(0, 0, 0, .85); }
.scope-ov::before { left: 50%; top: 18vh; bottom: 18vh; width: 1px; } .scope-ov::after { top: 50%; left: 30vw; right: 30vw; height: 1px; }
.vehicle-hud { position: fixed; right: 18px; bottom: 90px; text-align: right; font-family: var(--head); font-weight: 900; text-shadow: 0 2px 4px #000; }
.vehicle-hud .spd { font-size: 42px; } .vehicle-hud .s { font-size: 12px; color: var(--muted); font-weight: 700; }
.party-hud { position: fixed; left: 18px; top: 18px; display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.party-hud .m { padding: 4px 8px; border-radius: 8px; background: rgba(15, 17, 12, .7); border-left: 3px solid #6fd0ff; }

/* ------------------------------------------------ Fenster (Inventar, Gesundheit, Crafting …) */
.win { position: fixed; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(12px); display: flex; flex-direction: column; max-height: 86vh; }
.win .wh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.win .wh .h2 { font-size: 16px; }
.win .wb { padding: 12px; overflow: auto; }
.win .x, .inv-col .x { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.inv-wrap { position: fixed; inset: 40px 30px 30px; display: grid; grid-template-columns: 300px 1fr 1fr; gap: 14px; pointer-events: auto; }
.inv-col { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; backdrop-filter: blur(12px); }
.inv-col > .wh { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.inv-col > .wb { padding: 10px; overflow: auto; flex: 1; }
.cbox { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: rgba(0, 0, 0, .18); }
.cbox.drop { border-color: var(--acc); background: rgba(var(--acc-rgb), .08); }
.cbox .ch { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.cbox .ch .vol { margin-left: auto; color: var(--muted); font-weight: 600; }
.cbox .ch .bar { width: 70px; height: 5px; }
.cbox .items { display: grid; gap: 2px; padding: 0 6px 6px; min-height: 26px; }
.it { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; cursor: grab; font-size: 13px; }
.it:hover { background: rgba(255, 255, 255, .06); }
.it.sel { background: rgba(var(--acc-rgb), .14); }
.it .ico { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 14px; background: rgba(255, 255, 255, .05); }
.it .meta { font-size: 11px; color: var(--muted); text-align: right; }
.it .cond { display: block; height: 3px; border-radius: 2px; margin-top: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.it .cond i { display: block; height: 100%; }
.eqslots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.eqs { border: 1px dashed var(--line2); border-radius: 9px; padding: 6px 8px; min-height: 44px; font-size: 12px; cursor: pointer; min-width: 0; overflow: hidden; }
.eqs .it { grid-template-columns: 22px minmax(0, 1fr); } .eqs .it .meta { display: none; } .eqs .it .ico { width: 22px; height: 22px; }
.it .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eqs .l { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.eqs.drop { border-color: var(--acc); background: rgba(var(--acc-rgb), .08); }
.weightbar { display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.ctx { position: fixed; z-index: 30; min-width: 190px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 5px; box-shadow: var(--shadow); }
.ctx button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; }
.ctx button:hover { background: rgba(var(--acc-rgb), .16); }
.ctx button:disabled { color: var(--dim); }
.ctx .sep { height: 1px; background: var(--line); margin: 4px 0; }
.tip { position: fixed; z-index: 31; max-width: 280px; padding: 8px 10px; border-radius: 9px; background: rgba(10, 12, 9, .95); border: 1px solid var(--line2); font-size: 12px; pointer-events: none; }
.body-map { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.body-svg path, .body-svg ellipse, .body-svg rect { fill: #3a3f30; stroke: #6a705a; stroke-width: 1.5; cursor: pointer; }
.body-svg .w1 { fill: #8a6a2a; } .body-svg .w2 { fill: #b8401a; } .body-svg .w3 { fill: #e02a1a; } .body-svg .sel { stroke: var(--acc); stroke-width: 3; }
.wound { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; display: grid; gap: 6px; }
.wound .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.recipes { display: grid; gap: 6px; }
.recipe { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; }
.recipe.no { opacity: .55; }
.need { font-size: 12px; color: var(--muted); } .need .have { color: var(--ok); } .need .miss { color: #ff8a70; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; }
.skill .bar { grid-column: 1 / -1; height: 4px; }
.pips { display: flex; gap: 2px; } .pips i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, .1); } .pips i.on { background: var(--acc); }
.map-win { position: fixed; inset: 30px; }
.map-win canvas { width: 100%; height: 100%; display: block; border-radius: 0 0 14px 14px; cursor: grab; }
.actions-menu { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 300px; }
.actions-menu button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); color: var(--text); margin-bottom: 5px; cursor: pointer; font-weight: 600; }
.actions-menu button .k { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #111; font-size: 12px; font-weight: 800; }
.actions-menu button:hover { border-color: var(--acc); }
.build-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.death { text-align: center; display: grid; gap: 14px; width: min(520px, 94vw); }
.death .big { font-family: var(--head); font-weight: 900; font-size: 52px; color: var(--red); letter-spacing: 1px; }
.esc-menu { width: min(460px, 94vw); display: grid; gap: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: center; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 40; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.loading-world { width: min(460px, 92vw); display: grid; gap: 10px; text-align: center; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12px; }
.keys b { color: var(--acc); }
@media (max-width: 1100px) { .creator { grid-template-columns: 1fr; } .inv-wrap { grid-template-columns: 260px 1fr 1fr; inset: 30px 16px 20px; } }
@media (max-width: 820px) { .inv-wrap { grid-template-columns: 1fr; overflow: auto; } }

.svgi { display: inline-flex; width: 16px; height: 16px; flex: none; }
.svgi svg { width: 100%; height: 100%; }
.vrow .svgi { width: 15px; height: 15px; filter: drop-shadow(0 1px 1px #000); }
.vrow.hp .svgi { color: #e05a3a; } .vrow.blood .svgi { color: #c8281e; } .vrow.food .svgi { color: #d8a84a; } .vrow.water .svgi { color: #5aa8e0; }
.vrow.energy .svgi { color: #9a9ae0; } .vrow.stamina .svgi { color: #a8d06a; } .vrow.temp .svgi { color: #e0d06a; }
.moodle .ic .svgi { width: 15px; height: 15px; }
.ico .svgi { width: 15px; height: 15px; color: var(--muted); }
.svgi.tiny { width: 12px; height: 12px; vertical-align: -2px; }
