/* Blockheim – modernes Glas-Design */
:root {
  --ui-scale: 1;
  --accent: #6ad48a;
  --accent-2: #f2c95b;
  --text: #eef2f7;
  --muted: rgba(230, 236, 245, 0.62);
  --glass: rgba(18, 22, 30, 0.55);
  --glass-strong: rgba(14, 17, 24, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --radius: 14px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; user-select: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.pad { padding: 12px; }

#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }

/* ---------- Glas-Bausteine ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.btn {
  appearance: none; border: 1px solid var(--line); color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  padding: 12px 20px; border-radius: 11px; font: 600 15px/1.1 inherit; font-family: inherit;
  cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(106, 212, 138, 0.18); border-color: rgba(106, 212, 138, 0.6); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #74dc93, #4fb873); color: #08210f; border-color: transparent; box-shadow: 0 6px 20px rgba(79, 184, 115, 0.35); }
.btn.primary:hover { background: linear-gradient(180deg, #86e6a3, #5cc580); }
.btn.ghost { background: transparent; }
.btn.big { padding: 16px 22px; font-size: 17px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn .tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: rgba(242, 201, 91, 0.2); color: var(--accent-2); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .btn { flex: 1; }
.row.end { justify-content: flex-end; margin-top: 6px; }
.row.end > .btn, .row.between .btn { flex: 0 0 auto; }
.row.between { justify-content: space-between; }
kbd { font-family: inherit; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line); }

/* ---------- Menü-Hintergrund ---------- */
#menuBg { position: fixed; inset: 0; overflow: hidden; background: #2b4a75; }
#menuBgCanvas { position: absolute; top: 0; left: 0; height: 100%; width: auto; image-rendering: pixelated; animation: pan 140s linear infinite; }
#menuBgImage { position: absolute; inset: 0; background-size: cover; background-position: center; }
#menuBgShade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0.35), #000); opacity: .35; pointer-events: none; }
@keyframes pan { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Bildschirme ---------- */
.screen { position: fixed; inset: 0; z-index: 10; }
.screen.overlay { background: rgba(5, 8, 12, 0.45); backdrop-filter: blur(3px); }
.screen:not(#mainMenu) { display: flex; align-items: center; justify-content: center; }
/* nach Esc aus Inventar/Menü: der Browser lässt die Maus erst nach einem Klick wieder einfangen – nur ein dezenter Hinweis */
#clickToPlay.soft { background: transparent; backdrop-filter: none; pointer-events: auto; cursor: pointer; }
#clickToPlay.soft h2 { display: none; }
#clickToPlay.soft .card { padding: 10px 18px; font-size: 14px; }
.panel { width: min(720px, 92vw); max-height: 88vh; overflow: auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 12px; animation: pop .18s ease-out; }
.panel.narrow { width: min(440px, 92vw); }
.panel h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: .3px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.card { padding: 18px 20px; }
.card.center { text-align: center; padding: 26px 40px; cursor: pointer; }
.card.center p { margin: 4px 0 0; color: var(--muted); }

/* Hauptmenü */
#logo { position: absolute; left: 50%; top: 11vh; transform: translateX(-50%); text-align: center; }
#logo h1 {
  margin: 0; font-size: clamp(48px, 8vw, 104px); font-weight: 900; letter-spacing: 6px; line-height: 1;
  background: linear-gradient(180deg, #b9f2c6 0%, #6ad48a 45%, #3f9d5c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)) drop-shadow(0 18px 30px rgba(0,0,0,.35));
}
#logo p { margin: 10px 0 0; color: #fff; opacity: .85; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
#menuButtons { position: absolute; left: 50%; top: 46vh; transform: translateX(-50%); width: min(400px, 90vw); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
#menuNews { position: absolute; right: 28px; bottom: 28px; width: 330px; font-size: 13.5px; }
#menuNews h3 { margin: 0 0 8px; font-size: 15px; }
#menuNews ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 7px; color: var(--muted); }
#menuFooter { position: absolute; left: 24px; bottom: 20px; font-size: 13px; color: rgba(255,255,255,.75); text-shadow: 0 2px 6px rgba(0,0,0,.6); }

/* Welten */
.world-list { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.world-card { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); transition: background .15s; }
.world-card:hover { background: rgba(255,255,255,.09); }
.world-icon img { width: 44px; height: 44px; image-rendering: pixelated; display: block; }
.world-meta { flex: 1; min-width: 0; }
.world-card.active { border-color: rgba(106, 212, 138, .55); background: rgba(106, 212, 138, .08); }
.world-card .tag.on { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(106, 212, 138, .2); color: var(--accent); }
.world-card .tag.warn { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(242, 201, 91, .18); color: var(--accent-2); }
.world-card .tag.bad { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(224, 67, 75, .22); color: #ff8a8f; }
.world-card .tag.off { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .55); }
.world-card.off { opacity: .62; }
.world-card .world-meta .err { color: #ff8a8f; white-space: normal; }
.note { display: flex; align-items: center; gap: 12px; justify-content: space-between; font-size: 13px; line-height: 1.45; padding: 10px 12px; margin: 4px 0 10px; border-radius: 10px; background: rgba(106, 212, 138, .1); border: 1px solid rgba(106, 212, 138, .3); }
.note.warn { display: block; background: rgba(242, 201, 91, .08); border-color: rgba(242, 201, 91, .3); }
.note.hidden { display: none; }
.panel code { font-size: 12px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; }
.world-name { font-weight: 700; font-size: 16px; }
.world-meta .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field em { font-style: normal; opacity: .7; }
input:not([type]), input[type=text], input[type=password], select, #invSearch {
  font: inherit; color: var(--text); background: rgba(0,0,0,.3); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; outline: none; font-size: 15px;
}
input:focus, select:focus { border-color: rgba(106,212,138,.7); }
select option { background: #1a1f29; }

/* Einstellungen */
.settings { display: grid; gap: 4px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14.5px; }
.set-head { margin: 16px 4px 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); opacity: .85; }
.setting.locked { opacity: .6; }
.range { display: flex; align-items: center; gap: 10px; }
.range b { min-width: 74px; text-align: right; font-weight: 600; color: var(--accent); font-size: 13.5px; }
.range .snd-test { padding: 2px 9px; min-width: 0; }
.snd-hint { display: block; font-size: 11.5px; margin-top: 2px; }
input[type=range] { width: 200px; accent-color: var(--accent); }
.switch { appearance: none; width: 44px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.18); position: relative; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* Laden */
.loading { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.loading .bar { width: 320px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ad48a, #f2c95b); transition: width .2s; }
.spinner { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.in-game #loadingScreen { background: #0d1117; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud.hud-off .hud-el, #hud.hud-off #crosshair { display: none; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); mix-blend-mode: difference; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; }
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after { top: 10px; left: 0; height: 2px; width: 22px; }
.hud-el { position: absolute; }
.hud-el.off { display: none; }
#hud-hotbar { left: 50%; bottom: 14px; transform: translateX(-50%) scale(var(--ui-scale)); transform-origin: bottom center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#hotbar { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(10, 12, 18, 0.55); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.slot { width: 50px; height: 50px; border-radius: 9px; background: rgba(255,255,255,.06); border: 2px solid transparent; position: relative; display: flex; align-items: center; justify-content: center; }
.slot img { width: 38px; height: 38px; image-rendering: pixelated; pointer-events: none; }
.slot .count { position: absolute; right: 4px; bottom: 1px; font-weight: 800; font-size: 14px; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
.slot .key { position: absolute; left: 4px; top: 1px; font-size: 10px; opacity: .45; font-weight: 700; }
.slot.sel { border-color: #fff; background: rgba(255,255,255,.16); box-shadow: 0 0 14px rgba(255,255,255,.35); }
#itemName { font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 99px; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .3s; min-height: 1px; }
#itemName.show { animation: fadeName 1.8s forwards; }
@keyframes fadeName { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
#hud-info { left: 14px; top: 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; transform: scale(var(--ui-scale)); transform-origin: top left; border-radius: 12px; }
#hud-look { left: 50%; top: 14px; transform: translateX(-50%) scale(var(--ui-scale)); transform-origin: top center; padding: 8px 14px 10px 10px; display: flex; gap: 10px; align-items: center; font-size: 13px; border-radius: 12px; overflow: hidden; min-width: 170px; }
#hud-look.empty { opacity: 0; }
#hud-look img { width: 32px; height: 32px; image-rendering: pixelated; }
#hud-look .look-name { font-weight: 700; font-size: 14.5px; }
#hud-look .look-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 0; }
#hud-debug { right: 14px; top: 14px; margin: 0; padding: 10px 14px; font: 12.5px/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre; border-radius: 12px; }
#underwater { position: absolute; inset: 0; background: rgba(20, 60, 140, 0.22); opacity: 0; transition: opacity .2s; }
#underwater.on { opacity: 1; }
#wallFx { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(28, 22, 16, 0.9), rgba(6, 5, 4, 0.98)); opacity: 0; transition: opacity .1s; }
#wallFx.on { opacity: 1; }

/* Gesundheit, Hunger, Luft (über der Hotbar) */
#vitals { width: 100%; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 4px; gap: 18px; }
#vitals.hidden { display: none; }
.vit-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.vit-left { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.vit-row { display: flex; gap: 1px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.vit-row.rev { flex-direction: row-reverse; }
.vit-row.hidden { display: none; }
.vit-row img { width: 18px; height: 18px; image-rendering: pixelated; }
#vitals.low #vitHearts img { animation: jiggle .35s steps(2) infinite; }
#vitals.low #vitHearts img:nth-child(odd) { animation-delay: -.17s; }
#vitals.hungry #vitFood img { animation: jiggle .5s steps(2) infinite; }
#vitals.hungry #vitFood img:nth-child(even) { animation-delay: -.25s; }
@keyframes jiggle { 0% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Treffer-, Feuer- und Essens-Effekte */
#hurtFx { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(180, 0, 0, 0) 45%, rgba(170, 0, 0, 0.55) 100%); }
#hurtFx.low { animation: lowPulse 1.6s ease-in-out infinite; }
#hurtFx.hit { animation: hurtFlash .45s ease-out; }
#hurtFx.low.hit { animation: hurtFlash .45s ease-out, lowPulse 1.6s ease-in-out .45s infinite; }
@keyframes hurtFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lowPulse { 0%, 100% { opacity: .25; } 50% { opacity: .6; } }
#fireFx { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; opacity: 0; transition: opacity .25s; mix-blend-mode: screen;
  background: radial-gradient(ellipse 60% 90% at 25% 100%, rgba(255,140,20,.75), transparent 70%), radial-gradient(ellipse 55% 80% at 75% 100%, rgba(255,90,10,.7), transparent 70%), linear-gradient(to top, rgba(255,120,20,.5), transparent); }
#fireFx.on { opacity: 1; animation: flicker .18s steps(3) infinite alternate; }
@keyframes flicker { 0% { filter: brightness(1); transform: scaleY(1); } 100% { filter: brightness(1.25); transform: scaleY(1.08); } }
#eatBar { position: absolute; left: 50%; top: calc(50% + 22px); width: 64px; height: 6px; transform: translateX(-50%); border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; opacity: 0; transition: opacity .15s; }
#eatBar.on { opacity: 1; }
#eatBar i { display: block; height: 100%; width: 0; background: var(--accent-2); }
#hud-look .look-bar.hp { background: #e0434b; }
#hud-look img.pix { width: 22px; height: 22px; margin: 0 5px; }
#hud-look .tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; margin-left: 4px; border-radius: 99px; background: rgba(106, 212, 138, .2); color: var(--accent); vertical-align: 2px; }
#hud-look .tag.bad { background: rgba(224, 67, 75, .22); color: #ff8a8f; }

/* Todesbildschirm */
#deathScreen { background: radial-gradient(ellipse at center, rgba(90, 0, 0, .45), rgba(40, 0, 0, .78)); backdrop-filter: blur(2px) saturate(.6); z-index: 20; }
.death { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; animation: deathIn .8s ease-out; }
.death h1 { margin: 0; font-size: 56px; letter-spacing: 1px; color: #fff; text-shadow: 0 3px 0 #5a0b0b, 0 0 30px rgba(255, 60, 60, .45); }
.death p { margin: 0; font-size: 18px; }
#deathCause { font-size: 20px; font-weight: 600; margin-top: 6px; }
.death-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; width: 300px; }
.btn:disabled { opacity: .5; pointer-events: none; }
@keyframes deathIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* Toasts */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--glass-strong); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px; transform: translateY(-6px); opacity: 0; transition: all .25s; backdrop-filter: blur(10px); max-width: 360px; }
.toast.show { transform: none; opacity: 1; }

/* Inventar */
.panel.inv { width: min(640px, 94vw); }
.grid { display: grid; grid-template-columns: repeat(9, 50px); gap: 5px; justify-content: center; }
.grid.palette { max-height: 46vh; overflow: auto; padding: 4px; }
.grid .slot { background: rgba(255,255,255,.08); cursor: pointer; border-color: rgba(255,255,255,.06); }
.grid .slot:hover { background: rgba(255,255,255,.2); }
.sep { height: 1px; background: var(--line); margin: 4px 0; }
.hint { margin: 2px 0 0; font-size: 12px; text-align: center; }
#invSearch { padding: 8px 12px; font-size: 14px; width: 180px; }
#cursorStack { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }
#cursorStack img { width: 40px; height: 40px; image-rendering: pixelated; }
#cursorStack .count { position: absolute; right: 2px; bottom: 0; font-weight: 800; text-shadow: 0 1px 2px #000; }

/* Werkzeug-Abnutzung (kleiner Balken unten im Feld) */
.slot .dur { position: absolute; left: 7px; right: 7px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(0,0,0,.75); pointer-events: none; }
.slot .dur i { display: block; height: 100%; border-radius: 2px; }
.slot .dur.hidden { display: none; }

/* Crafting, Werkbank, Ofen, Rezeptbuch */
.panel.inv.with-book { width: min(960px, 97vw); }
.inv-body { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; }
.inv-main { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
/* der Tipp soll umbrechen statt die Spalte zu verbreitern */
#invHint, .station-note { width: 0; min-width: 100%; }
.station { display: flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.station.hidden, .recipes.hidden { display: none; }
.station .slot { background: rgba(255,255,255,.08); cursor: pointer; border-color: rgba(255,255,255,.06); }
.station .slot:hover { background: rgba(255,255,255,.2); }
.craft, .furnace { display: flex; align-items: center; gap: 20px; padding: 12px 22px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.06); }
.craft-grid { display: grid; gap: 5px; }
.craft-grid.g2 { grid-template-columns: repeat(2, 50px); }
.craft-grid.g3 { grid-template-columns: repeat(3, 50px); }
.slot.result { width: 64px; height: 64px; border-color: rgba(255,255,255,.22) !important; }
.slot.result img { width: 46px; height: 46px; }
.slot.result.ready { border-color: rgba(106, 212, 138, .8) !important; box-shadow: 0 0 16px rgba(106, 212, 138, .3); }
.slot img.ghost { opacity: .28; filter: grayscale(.5); }
.arrow { width: 48px; height: 20px; position: relative; background: rgba(255,255,255,.16); clip-path: polygon(0 32%, 62% 32%, 62% 0, 100% 50%, 62% 100%, 62% 68%, 0 68%); }
.arrow i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #fff; }
.furnace-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flame { width: 24px; height: 24px; position: relative; background: rgba(255,255,255,.14); clip-path: polygon(50% 0, 66% 28%, 84% 22%, 92% 58%, 78% 92%, 50% 100%, 22% 92%, 8% 58%, 18% 30%, 34% 38%); }
.flame i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#ffe27a, #ff7a1a 60%, #d8401a); }
.station-note { font-size: 12px; text-align: center; margin-top: 6px; }
.station-row { display: flex; align-items: center; gap: 16px; }
.armor-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.armor-col .slot { width: 44px; height: 44px; }
.armor-col .slot img { width: 34px; height: 34px; }
.armor-info { font-size: 11.5px; font-weight: 700; }
.chest-grid { margin-bottom: 4px; }
/* Große Truhe: 6 Reihen – auf niedrigen Bildschirmen etwas kleinere Felder, gleiche Breite wie das Inventar darunter */
.chest-grid.big { row-gap: 3px; }
@media (max-height: 860px) {
  .chest-grid.big { grid-template-columns: repeat(9, 42px); gap: 3px 14px; }
  .chest-grid.big .slot { width: 42px; height: 42px; }
  .chest-grid.big .slot img { width: 32px; height: 32px; }
}
.chest-bar { justify-content: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.chest-bar .btn { padding: 5px 10px; font-size: 12.5px; white-space: nowrap; flex: 0 0 auto; }
.recipes { flex: 1 1 210px; min-width: 210px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); padding-left: 18px; min-height: 0; }
.recipes h3 { margin: 0; font-size: 16px; }
.recipes .check { font-size: 12.5px; display: flex; gap: 6px; align-items: center; color: var(--muted); cursor: pointer; }
#recipeSearch { padding: 8px 12px; font-size: 14px; }
#recipeList { flex: 1 1 0; min-height: 200px; max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.recipe { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid transparent; cursor: pointer; }
.recipe:hover { background: rgba(255,255,255,.12); }
.recipe img { width: 30px; height: 30px; image-rendering: pixelated; flex: none; }
.recipe .r-text { min-width: 0; }
.recipe .r-name { font-weight: 700; font-size: 13.5px; }
.recipe .r-need { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe .tag { font-size: 10px; font-weight: 700; padding: 1px 6px; margin-left: 5px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--muted); vertical-align: 1px; }
.recipe.ok { border-color: rgba(106, 212, 138, .45); background: rgba(106, 212, 138, .1); }
.recipe.ok .tag.go { background: rgba(106, 212, 138, .25); color: var(--accent); }
.recipe.no { opacity: .55; }
.recipe-head { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 8px 2px 2px; }

/* ---------- Layout-Editor ---------- */
#editBar { position: fixed; top: 38%; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; gap: 12px; align-items: center; padding: 10px 12px 10px 18px; font-size: 14px; }
body.editing [data-drag] { cursor: grab; outline: 2px dashed rgba(106, 212, 138, 0.85); outline-offset: 4px; }
body.editing [data-drag] * { pointer-events: none !important; }
body.editing-hud #hud .hud-el { pointer-events: auto; }
body.editing-hud #hud-look.empty { opacity: .6; }
body.editing-hud #hud-look.empty::after { content: "Block-Info"; font-weight: 600; padding: 6px 4px; }
body.editing-hud #hud-info:empty::after { content: "Info-Anzeige"; }
body.editing-hud #hud .hud-el.off { display: block; opacity: .55; }
body.editing-menu #mainMenu [data-drag] { pointer-events: auto; }
[data-drag].dragging { cursor: grabbing; outline-color: var(--accent-2); }

#fatal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: #0d1117; }

/* Erfahrung: dünne Leiste zwischen Herzen und Hotbar, Stufe als grüne Zahl darüber */
#xpBar { width: 100%; position: relative; padding: 0 6px; margin: -4px 0 -4px; }
#xpBar.hidden { display: none; }
#xpBar .xp-track { height: 7px; border-radius: 4px; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
#xpBar .xp-track i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #d8ff8c, #7ad83e 55%, #3f9a1c); box-shadow: 0 0 6px rgba(150,255,90,.55); transition: width .15s; }
#xpLevel { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 16px; font-weight: 800; color: #a6ff62; line-height: 1;
  text-shadow: 1px 0 0 #143006, -1px 0 0 #143006, 0 1px 0 #143006, 0 -1px 0 #143006, 0 0 6px rgba(0,0,0,.8); }
#xpBar.up #xpLevel { animation: lvlPop .7s ease-out; }
@keyframes lvlPop { 0% { transform: translateX(-50%) scale(1.8); color: #fff; } 100% { transform: translateX(-50%) scale(1); } }

/* Verzauberte Gegenstände: ein Schimmer läuft über das Bild (nur innerhalb der Umrisse) */
.slot .glint, #cursorStack .glint { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%); pointer-events: none;
  background: linear-gradient(110deg, transparent 28%, rgba(210, 170, 255, .95) 44%, rgba(150, 240, 255, .9) 56%, transparent 72%) 0 0 / 250% 100%,
    linear-gradient(rgba(150, 100, 255, .32), rgba(150, 100, 255, .32));
  -webkit-mask: var(--icon) center / 100% 100% no-repeat; mask: var(--icon) center / 100% 100% no-repeat;
  mix-blend-mode: screen; animation: glint 2.8s linear infinite; }
.slot .glint.hidden { display: none; }
#cursorStack .glint { width: 40px; height: 40px; }
.slot.result .glint { width: 46px; height: 46px; }
.armor-col .slot .glint { width: 34px; height: 34px; }
@media (max-height: 860px) { .chest-grid.big .slot .glint { width: 32px; height: 32px; } }
@keyframes glint { from { background-position: 110% 0; } to { background-position: -40% 0; } }
#itemName.ench { color: #c9a8ff; text-shadow: 0 0 8px rgba(160, 110, 255, .6); }

/* Runentisch: links Teil und Schattenstaub, rechts drei Angebote */
.rune { display: flex; align-items: stretch; gap: 18px; padding: 12px 18px; border-radius: 14px;
  background: radial-gradient(ellipse at 20% 30%, rgba(110, 70, 190, .22), rgba(0,0,0,.25) 70%); border: 1px solid rgba(170, 130, 255, .18); }
.rune-col { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.rune-offers { display: flex; flex-direction: column; gap: 6px; width: 330px; }
.rune-offer { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 10px; min-height: 44px; border-radius: 10px; cursor: pointer; color: #e9e2ff;
  background: linear-gradient(90deg, rgba(120, 80, 200, .35), rgba(60, 40, 110, .3)); border: 1px solid rgba(190, 150, 255, .35); font: inherit; }
.rune-offer:hover:not(:disabled) { background: linear-gradient(90deg, rgba(150, 100, 240, .55), rgba(80, 50, 150, .45)); box-shadow: 0 0 14px rgba(170, 120, 255, .35); }
.rune-offer:disabled { cursor: default; opacity: .45; filter: grayscale(.5); }
.rune-offer .lv { flex: 0 0 34px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; font-size: 16px;
  color: #a6ff62; background: rgba(0,0,0,.35); text-shadow: 0 0 4px rgba(0,0,0,.9); }
.rune-offer .txt { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.rune-offer .runes { font-family: "Segoe UI Historic", "Noto Sans Runic", serif; font-size: 12px; letter-spacing: 2px; opacity: .55; white-space: nowrap; overflow: hidden; }
.rune-offer b { font-size: 13.5px; }
.rune-offer .cost { flex: 0 0 auto; font-size: 11px; line-height: 1.25; text-align: right; opacity: .8; }

/* ===== Mehrspieler ===== */
.mp-lead { margin: -4px 0 2px; font-size: 14px; }
.mp-info { min-height: 20px; font-size: 13px; color: var(--muted); padding: 2px 2px 0; line-height: 1.45; }
.mp-info b { color: var(--text); }
.mp-info .on { color: var(--accent); font-weight: 600; }
.mp-info .lock { color: var(--accent-2); }
.mp-status { min-height: 18px; font-size: 13.5px; color: var(--muted); }
.mp-status.bad { color: #ff8a8f; }
.panel > .check { font-size: 13px; display: flex; gap: 8px; align-items: center; color: var(--muted); cursor: pointer; }
.panel > .check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Chat */
#chat { position: absolute; left: 14px; bottom: 132px; width: min(560px, 46vw); display: flex; flex-direction: column; gap: 6px; transform: scale(var(--ui-scale)); transform-origin: bottom left; }
#chatLog { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-height: 42vh; overflow: hidden; font-size: 14.5px; line-height: 1.35; }
#chatLog .line { background: rgba(8, 11, 16, .55); padding: 3px 10px; border-radius: 7px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); max-width: 100%; overflow-wrap: anywhere; user-select: text; animation: chatFade 12s forwards; }
#chatLog .line b { color: var(--accent); margin-right: 7px; font-weight: 700; }
#chatLog .line.sys { color: var(--accent-2); }
#chat:not(.open) #chatLog .line:nth-last-child(n+11) { display: none; }
#chat.open #chatLog { overflow-y: auto; pointer-events: auto; }
#chat.open #chatLog .line { animation: none; opacity: 1; }
@keyframes chatFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#chatInput { display: none; pointer-events: auto; width: 100%; font: inherit; font-size: 15px; color: var(--text); background: rgba(8, 11, 16, .78); border: 1px solid rgba(106, 212, 138, .55); border-radius: 9px; padding: 9px 12px; outline: none; }
#chat.open #chatInput { display: block; }

/* Namen über den Mitspielern */
#nameTags { position: absolute; inset: 0; overflow: hidden; }
.nametag { position: absolute; left: 0; top: 0; padding: 2px 9px 3px; background: rgba(0, 0, 0, .42); color: #fff; font-size: 15px; font-weight: 600; border-radius: 6px; white-space: nowrap; transform-origin: 50% 100%; will-change: transform; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }

/* Dorfbewohner: Reden und Handeln */
.villager { display: flex; flex-direction: column; gap: 10px; width: 470px; max-width: 100%; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(120, 86, 48, .28), rgba(60, 42, 24, .28)); border: 1px solid rgba(242, 201, 91, .22); }
.villager > .btn { align-self: flex-start; }
.vil-head { display: flex; align-items: center; gap: 10px; }
.vil-head > div:first-child { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.vil-head b { font-size: 15px; }
.vil-head .muted { font-size: 12px; }
.vil-tabs { display: flex; gap: 6px; }
.vil-mood { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(106, 212, 138, .18); color: var(--accent); white-space: nowrap; }
.vil-mood.m2 { background: rgba(160, 170, 255, .16); color: #b9c0ff; }
.vil-mood.m3 { background: rgba(242, 201, 91, .18); color: var(--accent-2); }
.vil-mood.m4 { background: rgba(224, 67, 75, .22); color: #ff8a8f; }
.vil-say { position: relative; padding: 10px 14px; border-radius: 12px; background: rgba(255, 250, 235, .1); font-style: italic; font-size: 14px; line-height: 1.4; min-height: 42px; }
.vil-offers { display: flex; flex-direction: column; gap: 5px; }
.vil-offer { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.vil-offer.out { opacity: .5; }
.vil-item { position: relative; flex: 0 0 34px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 7px; background: rgba(0, 0, 0, .25); }
.vil-item img { width: 26px; height: 26px; image-rendering: pixelated; }
.vil-item b { position: absolute; right: 2px; bottom: 0; font-size: 11px; text-shadow: 0 1px 2px #000; }
.vil-arrow { opacity: .6; }
.vil-name { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.vil-name .muted { font-size: 11px; }
.vil-offer .btn:disabled { opacity: .45; cursor: default; transform: none; }
.vil-purse { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.vil-purse img { width: 18px; height: 18px; image-rendering: pixelated; }
/* Dorf-Reiter: Überblick, Baustelle, Spenden, Lager */
.vil-town { display: flex; flex-direction: column; gap: 8px; }
.vil-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.vil-build { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .14); }
.vil-build-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.vil-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.vil-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.vil-sub { font-size: 12px; font-weight: 700; opacity: .8; }
.vil-wait { font-size: 12px; }
.vil-work-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.vil-food { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.vil-food > span:nth-child(2) { flex: 1 1 auto; }
.vil-food .muted { font-size: 11px; }
.vil-store { display: flex; flex-wrap: wrap; gap: 4px; }
/* Dörfer Phase 3/4: Familie, Ansehen, Dorfplan */
.vil-head .vil-fam { display: block; font-size: 12px; margin-top: 1px; }
.vil-rep { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.vil-rep.r0 .vil-bar i { background: #c0504a; }
.vil-rep.r3 .vil-bar i, .vil-rep.r4 .vil-bar i { background: #e3b341; }
.vil-offer.sel { outline: 2px solid rgba(255, 220, 120, .55); }
/* Ofen: Restzeiten unter dem Pfeil */
.furnace-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.furnace-times { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: rgba(255,255,255,.78); min-width: 96px; text-align: center; line-height: 1.35; }
.furnace-times .ft-burn { color: #ffcf7a; }
/* Nebenhand: eigenes Feld links neben der Schnellleiste */
#hotbar .slot.offhand { margin-right: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset; }
#hotbar .slot.offhand.hidden { display: none; }

/* Inventar: Felder beim Verteilen durch Ziehen */
.slot.drag { outline: 2px solid rgba(255, 230, 140, 0.85); outline-offset: -2px; }
/* Steuerung */
.setting.bind .bind-key { min-width: 130px; }
.setting.bind .bind-key.wait { background: rgba(255, 210, 90, 0.35); }
.setting.bind.dup span, .setting.bind.dup .bind-key { color: #ff6b5e; }
.setting.bind.dup .bind-key { border-color: #ff6b5e; }
.bind-warn { color: #ff8a7e; margin: 4px 0 8px; }
.controls-head { gap: 10px; margin-bottom: 8px; }

/* Signatur-Leiste der Kampfwaffen: über der Schnellleiste, füllt sich durch Treffer */
#sigBar { width: 100%; padding: 0 6px; margin: 0 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
#sigBar.hidden { display: none; }
#sigBar span { font-size: 12px; font-weight: 700; color: #ffe0a8; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,.8); }
#sigBar .sig-track { width: 60%; height: 6px; border-radius: 4px; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
#sigBar .sig-track i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #ffe7a0, #ff9a2e 55%, #c2541a); transition: width .12s; }
#sigBar.full .sig-track i { background: linear-gradient(180deg, #fff6c4, #ffd23a 55%, #ff8a1a); box-shadow: 0 0 10px rgba(255,200,60,.9); animation: sigPulse .8s ease-in-out infinite alternate; }
#sigBar.full span { color: #fff3b0; }
#sigBar.charging .sig-track { border-color: rgba(255,210,120,.7); }
@keyframes sigPulse { from { filter: brightness(1); } to { filter: brightness(1.45); } }

/* ===== Berufe, Magie, Rucksäcke, Tagebuch (Alpha 0.12) ===== */
#fxOverlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; }
#xpPops { position: fixed; right: 18px; top: 42%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; z-index: 6; }
.xp-pop { font-weight: 800; font-size: 16px; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0,0,0,.8); animation: xpup 1.6s ease-out forwards; }
@keyframes xpup { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
#levelBanner { position: fixed; left: 50%; top: 18%; transform: translate(-50%, -20px); display: flex; gap: 14px; align-items: center; padding: 14px 26px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(20,24,30,.92), rgba(10,12,16,.92)); border: 2px solid var(--pc, #f2c95b); box-shadow: 0 0 40px color-mix(in srgb, var(--pc, #f2c95b) 55%, transparent);
  opacity: 0; pointer-events: none; z-index: 7; }
#levelBanner.show { animation: lvban 3.6s ease-out forwards; }
@keyframes lvban { 0% { opacity: 0; transform: translate(-50%, -20px) scale(.8); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 14% { transform: translate(-50%, 0) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }
#levelBanner .lb-ic { font-size: 40px; }
#levelBanner .lb-t { font-size: 26px; font-weight: 900; color: var(--pc, #f2c95b); letter-spacing: .5px; }
#levelBanner .lb-s { font-size: 14px; opacity: .85; }
#magicHud { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); padding: 6px 14px; border-radius: 10px; background: rgba(10,12,18,.62); font-size: 13.5px; white-space: pre; text-align: center; pointer-events: none; z-index: 5; text-shadow: 0 1px 2px #000; }
#cdBar { position: fixed; right: 14px; bottom: 90px; display: flex; gap: 6px; flex-direction: row-reverse; pointer-events: none; z-index: 5; }
#cdBar .cd { position: relative; width: 38px; height: 38px; border-radius: 8px; background: rgba(10,12,18,.7); border: 1px solid rgba(255,255,255,.18); overflow: hidden; }
#cdBar .cd.pot { border-color: rgba(140,200,255,.6); }
#cdBar .cd img { width: 30px; height: 30px; margin: 3px; image-rendering: pixelated; opacity: .75; }
#cdBar .cd i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); }
#cdBar .cd b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; text-shadow: 0 1px 2px #000; }

/* Seltenheit: Leuchten im Inventar */
.slot.rar { box-shadow: inset 0 0 12px var(--glow), 0 0 6px var(--glow); }
.slot.rar3, .slot.rar4 { animation: rarpulse 2.4s ease-in-out infinite; }
@keyframes rarpulse { 50% { box-shadow: inset 0 0 18px var(--glow), 0 0 12px var(--glow); } }

/* Schmuckleiste */
.acc-col { display: grid; grid-template-columns: repeat(2, 50px); gap: 6px; align-content: start; }
.acc-col .acc-lbl { font-size: 9.5px; opacity: .5; text-align: center; line-height: 1.1; pointer-events: none; }

/* Rucksäcke: eigener Rahmen je Stufe */
.bag-head { margin-bottom: 8px; font-weight: 700; }
.bag-grid { padding: 8px; border-radius: 12px; border: 2px solid rgba(255,255,255,.12); }
.bag-grid.bag-bag_leather { background: rgba(120, 78, 40, .25); border-color: #8a5a30; }
.bag-grid.bag-bag_travel { background: rgba(90, 110, 60, .25); border-color: #6f8a45; }
.bag-grid.bag-bag_iron { background: rgba(160, 170, 180, .18); border-color: #b9c2cc; }
.bag-grid.bag-bag_gold { background: rgba(230, 190, 60, .16); border-color: #e3b341; }
.bag-grid.bag-bag_diamond { background: rgba(80, 220, 230, .14); border-color: #5ee0e8; }
.bag-grid.bag-bag_magic { background: rgba(170, 90, 255, .16); border-color: #b06bff; box-shadow: 0 0 18px rgba(176,107,255,.45); }

/* Große Menüs */
#menuScreen { z-index: 12; }
#menuScreen .big-menu { width: min(1080px, 95vw); max-height: 90vh; }
.prof-wrap { display: grid; grid-template-columns: 330px 1fr; gap: 16px; min-height: 0; }
.prof-list { display: flex; flex-direction: column; gap: 5px; max-height: 66vh; overflow: auto; padding-right: 4px; }
.prof-row { display: grid; grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto auto; gap: 1px 8px; text-align: left; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); color: inherit; cursor: pointer; font: inherit; }
.prof-row:hover { background: rgba(255,255,255,.08); }
.prof-row.sel { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, transparent); }
.prof-ic { grid-row: 1 / 4; font-size: 22px; align-self: center; }
.prof-nm { font-weight: 700; }
.prof-nm .pts { color: #f2c95b; }
.prof-lv { font-weight: 700; color: var(--pc); }
.prof-bar { grid-column: 2 / 4; height: 7px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.prof-bar i { display: block; height: 100%; background: var(--pc); }
.prof-xp { grid-column: 2 / 4; font-size: 11px; opacity: .7; }
.prof-detail { max-height: 66vh; overflow: auto; padding-right: 4px; }
.prof-detail h3 { margin: 0 0 4px; color: var(--pc); }
.prof-detail h4 { margin: 14px 0 6px; }
.prof-sum { font-size: 13px; opacity: .85; margin-bottom: 10px; }
.sk-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; margin-bottom: 8px; align-items: stretch; }
.sk-row.locked .sk { opacity: .45; }
.sk-need { font-size: 12px; opacity: .7; align-self: center; }
.sk { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 4px; }
.sk.full { border-color: var(--pc); }
.sk-top { display: flex; justify-content: space-between; gap: 6px; }
.sk-top .pips { color: var(--pc); letter-spacing: 1px; font-size: 12px; }
.sk-txt { font-size: 12px; opacity: .8; flex: 1; }
.sk-add { align-self: flex-start; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--pc); background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 12px; }
.sk-add:disabled { opacity: .4; cursor: default; }
.ms { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.ms li.got { opacity: .55; }
.ms li b { display: inline-block; min-width: 30px; }
.lore-head { font-weight: 700; margin-bottom: 8px; }
.lore-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; max-height: 68vh; overflow: auto; }
.lore { padding: 10px 14px; border-radius: 10px; background: rgba(240, 220, 170, .08); border: 1px solid rgba(240,220,170,.25); }
.lore.miss { background: rgba(255,255,255,.02); border-style: dashed; opacity: .55; }
.lore-n { font-size: 11px; opacity: .6; }
.lore h4 { margin: 2px 0 4px; color: #f0dca8; }
.lore p { margin: 0; font-size: 13.5px; line-height: 1.5; font-style: italic; }
.star-list { display: flex; flex-direction: column; gap: 6px; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.rules .toggle, details.rules-box .toggle { display: flex; gap: 8px; align-items: center; }

/* ---------- Orientierung: Kompassleiste, Minikarte, Tageszeit-Uhr, große Karte (mapview.js) ---------- */
#compass { position: fixed; left: 50%; top: 8px; width: min(520px, 44vw); height: 30px; transform: translateX(-50%) scale(var(--ui-scale)); transform-origin: top center; pointer-events: none; z-index: 4; }
#hud-look { top: 46px; }
#magicHud { top: 104px; }
#minimap { position: fixed; right: 14px; top: 14px; width: 190px; height: 190px; border-radius: 50%; transform: scale(var(--ui-scale)); transform-origin: top right;
  box-shadow: 0 0 0 3px rgba(20, 22, 30, .85), 0 0 0 5px rgba(214, 190, 130, .55), 0 6px 18px rgba(0, 0, 0, .45); pointer-events: none; z-index: 4; overflow: hidden; }
#minimapCanvas { width: 100%; height: 100%; display: block; }
#dayClock { position: fixed; right: 14px; top: 14px; width: 150px; padding: 6px 10px 8px; border-radius: 12px; transform: scale(var(--ui-scale)); transform-origin: top right; pointer-events: none; z-index: 4; text-align: center; }
#dayClock.beside { right: calc(14px + 200px * var(--ui-scale)); }
#dayClock .clk-arc { width: 100%; height: 42px; display: block; }
#dayClock .clk-path { fill: none; stroke-width: 3; stroke-dasharray: 3 3; }
#dayClock .clk-path.day { stroke: rgba(255, 214, 110, .55); }
#dayClock .clk-path.night { stroke: rgba(150, 170, 255, .5); }
#dayClock .sun { fill: #ffd24a; filter: drop-shadow(0 0 4px #ffb300); }
#dayClock .moon { fill: #dfe6ff; filter: drop-shadow(0 0 4px #8fa4ff); }
#dayClock .clk-txt { display: flex; flex-direction: column; line-height: 1.3; font-size: 12px; }
#dayClock .clk-txt b { font-size: 16px; letter-spacing: .5px; }
#hud-debug { top: 220px; }
.bigmap { position: relative; width: min(1100px, 86vw); height: min(680px, 68vh); }
#bigMapCv { width: 100%; height: 100%; display: block; border-radius: 10px; cursor: grab; image-rendering: pixelated; }
#bigMapCv:active { cursor: grabbing; }
.bigmap-bar { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; }
.bigmap-bar .muted { background: rgba(10, 12, 18, .7); padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.bigmap-legend { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 10px; background: rgba(10, 12, 18, .7); padding: 5px 10px; border-radius: 8px; font-size: 12px; }
.bigmap-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
/* Meldungen rutschen unter Uhr bzw. Minikarte */
body:has(#dayClock:not(.hidden)) #toasts { top: calc(18px + 120px * var(--ui-scale)); }
body:has(#minimap:not(.hidden)) #toasts { top: calc(18px + 210px * var(--ui-scale)); }
body:has(#hud.hidden) #toasts { top: 18px; }
.bigmap-bar .muted:empty { display: none; }
/* Kompass weicht Uhr und Minikarte aus (beide oben rechts); auf schmalen Bildschirmen steht die Uhr unter der Minikarte */
body:has(#dayClock:not(.hidden)) #compass { width: clamp(200px, calc(100vw - 2 * (32px + 160px * var(--ui-scale))), 520px); }
body:has(#minimap:not(.hidden)) #compass { width: clamp(200px, calc(100vw - 2 * (32px + 200px * var(--ui-scale))), 520px); }
body:has(#minimap:not(.hidden)):has(#dayClock.beside:not(.hidden)) #compass { width: clamp(200px, calc(100vw - 2 * (40px + 360px * var(--ui-scale))), 520px); }
@media (max-width: 1280px) {
  #dayClock.beside { right: 14px; top: calc(14px + 200px * var(--ui-scale)); }
  body:has(#minimap:not(.hidden)):has(#dayClock.beside:not(.hidden)) #compass { width: clamp(200px, calc(100vw - 2 * (32px + 200px * var(--ui-scale))), 520px); }
  body:has(#minimap:not(.hidden)):has(#dayClock:not(.hidden)) #toasts { top: calc(18px + 330px * var(--ui-scale)); }
}

/* ---------- Spielfigur in 3D (Inventar) und Aussehen-Editor ---------- */
.fig-col { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 6px; }
.avatar-view.inv { width: calc(112px * var(--ui-scale, 1)); height: calc(196px * var(--ui-scale, 1)); border-radius: 10px; cursor: grab;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,255,255,0.10), rgba(0,0,0,0.18) 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.avatar-view:active { cursor: grabbing; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.av-editor { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; min-height: 60vh; }
.av-left { display: flex; flex-direction: column; gap: 8px; }
.avatar-view.big { width: 100%; height: 52vh; border-radius: 14px; cursor: grab;
  background: radial-gradient(ellipse at 50% 88%, rgba(255,255,255,0.14), rgba(0,0,0,0.22) 72%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.av-tools .row { gap: 6px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.av-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.av-body h4 { margin: 6px 0 3px; font-size: 13px; opacity: 0.85; }
.av-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.av-sw .sw { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.15); padding: 0; cursor: pointer; }
.av-sw .sw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
.av-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.av-tab { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: inherit; border-radius: 8px; padding: 4px 9px; cursor: pointer; font: inherit; font-size: 13px; }
.av-tab span { margin-left: 6px; opacity: 0.55; font-size: 11px; }
.av-tab.on { background: rgba(120,170,255,0.28); border-color: rgba(150,190,255,0.6); }
.av-cur { display: flex; align-items: center; gap: 8px; }
.av-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; max-height: 34vh; overflow-y: auto; padding-right: 4px; }
.av-item { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: inherit; border-radius: 7px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.av-item i { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.av-tab.face { font-weight: 600; }
.av-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; max-height: 34vh; overflow-y: auto; padding-right: 4px; }
.av-sl { display: grid; grid-template-columns: 92px 44px 1fr 44px; align-items: center; gap: 6px; font-size: 12.5px; }
.av-sl small { opacity: 0.55; font-size: 11px; text-align: center; }
.av-sl input[type=range] { width: 100%; accent-color: #7fb0ff; cursor: pointer; }
.av-item.on { background: rgba(120,170,255,0.25); border-color: rgba(150,190,255,0.6); }
@media (max-width: 900px) { .av-editor { grid-template-columns: 1fr; } .avatar-view.big { height: 38vh; } }
