:root {
  --bg: #02030a;
  --ink: #d6e6ee;
  --dim: #7f98a6;
  --accent: #4fd8ff;
  --warn: #ff6b4a;
  --gold: #f3c969;
  --panel: #050d16;
  --line: #4fd8ff33;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --bar-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Formularelemente ---------- */
.form label { display: grid; gap: 5px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
input, select, textarea { background: #030a12; border: 1px solid #2a4a5a; border-radius: 4px; padding: 9px 11px; font-size: 15px; letter-spacing: normal; text-transform: none; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=file] { padding: 7px; font-size: 13px; }
input[type=color] { padding: 2px; height: 40px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--accent); }
.err { margin: 0; min-height: 1.2em; color: var(--warn); font-size: 14px; }

/* ---------- App ---------- */
#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; transition: opacity .35s; }
#stage.fading { opacity: 0; }
.scene-holder { position: absolute; inset: 0; overflow: hidden; }

#topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--bar-h); padding: 0 16px; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; pointer-events: none;
  background: linear-gradient(#02030acc, transparent); }
#topbar > * { pointer-events: auto; }
#scene-chip { position: absolute; left: 50%; transform: translateX(-50%); font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); pointer-events: none; }
#credits { display: flex; align-items: center; gap: 8px; margin-right: 14px; font: 13px var(--mono); color: var(--ink); }
#credits.up { animation: credit-up 1.2s ease-out; }
#credits.down { animation: credit-down 1.2s ease-out; }
@keyframes credit-up { 0% { color: #ffd76a; transform: scale(1.25); } 100% { color: var(--ink); transform: none; } }
@keyframes credit-down { 0% { color: #ff6b6b; transform: scale(.9); } 100% { color: var(--ink); transform: none; } }
#credits img { display: block; width: 34px; height: 34px; }
#presence { display: flex; flex-direction: row-reverse; }
#presence .avatar { margin-left: -8px; }
#presence .avatar.me { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #04101ccc; color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
#conn { width: 8px; height: 8px; border-radius: 50%; background: #4be08a; box-shadow: 0 0 6px #4be08a; }
#conn.off { background: var(--warn); box-shadow: 0 0 6px var(--warn); }

.avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--c, var(--accent)); color: #04131c;
  display: grid; place-items: center; font: 700 13px var(--mono); text-transform: uppercase; border: 2px solid #04101c; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .crown { position: absolute; right: -5px; top: -9px; font-style: normal; font-size: 12px; color: var(--gold); text-shadow: 0 0 4px #000; }

/* ---------- Szenen ---------- */
.scene-image { position: absolute; inset: 0; background: #000; overflow: hidden; }
.scene-image .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(30px) brightness(.55); display: none; }
.scene-image img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.scene-image.fit-cover img { object-fit: cover; }
.scene-image.fit-contain img { object-fit: contain; }
.scene-image.fit-contain .bg { display: block; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-empty { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #07121f, var(--bg) 75%); }
.scene-empty p { position: relative; margin: 0; padding: 0 24px; text-align: center; font: 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* ---------- Spielleiter-Menü ---------- */
#admin, #modal { width: min(760px, calc(100% - 24px)); max-height: calc(100% - 40px); padding: 0; background: #06101bf8; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 30px 80px #000c; }
#admin[open], #modal[open] { display: flex; flex-direction: column; }
#admin::backdrop, #modal::backdrop { background: #000a; backdrop-filter: blur(3px); }
.adm-head { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.adm-head h2 { margin: 0 auto 0 0; font: 700 13px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 6px 14px; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; color: var(--dim); }
.tabs button.on { color: var(--ink); border-color: var(--line); background: #0b1a28; }
.adm-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; scrollbar-width: thin; scrollbar-color: #2a4a5a transparent; }
.muted { color: var(--dim); font-size: 13px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 7px 14px; background: transparent; border: 1px solid #2a4a5a; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #02131c; font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); color: #02131c; }
.btn.danger:hover { border-color: var(--warn); color: var(--warn); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--panel); border: 1px solid #4fd8ff22; border-radius: 6px; }
.card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card .thumb { width: 96px; height: 54px; border-radius: 4px; object-fit: cover; background: #000; flex: none; }
.card .thumb.map { display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle at 40% 40%, #1d3550, #050a14); }
.card .info { display: grid; min-width: 0; flex: 1; }
.card .info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.live { color: #4be08a; font: 12px var(--mono); letter-spacing: .06em; }
.form { display: grid; gap: 14px; }
.form h3 { margin: 0; font-size: 18px; }
.form section { display: grid; gap: 14px; }
.form small { text-transform: none; letter-spacing: normal; font-family: inherit; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.mono { font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.preview { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid #2a4a5a; border-radius: 4px; overflow: hidden; }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview.fit-cover img { object-fit: cover; }
.preview.fit-contain img { object-fit: contain; }
.av-col { display: flex; align-items: center; gap: 12px; padding-top: 18px; }
.av-preview .avatar { width: 48px; height: 48px; font-size: 16px; }

@media (max-width: 820px) {
  :root { --bar-h: 52px; }
  .row { grid-template-columns: 1fr; }
  .card { flex-wrap: wrap; }
  .card .actions { width: 100%; justify-content: flex-start; }
  .adm-head { flex-wrap: wrap; gap: 8px; }
  #scene-chip { display: none; }
}

/* ---------- Intro: Terminal-Login und Kamerafahrt ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: #02080c; transition: opacity .8s; overflow: hidden; }
#intro.out { opacity: 0; pointer-events: none; }
#intro canvas { position: absolute; inset: 0; display: block; }
#intro canvas.desk { z-index: 1; }
#term { cursor: text; }
#term.alarm { filter: saturate(1.5) contrast(1.12); animation: shake .5s; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }
#term-input { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; }
#lens { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,0,0,0) 28%, rgba(255,40,30,.28) 60%, rgba(255,0,0,.8) 100%); }
#lens::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120vmax; height: 120vmax; border-radius: 50%;
  border: 3px solid rgba(255,80,70,.85); box-shadow: 0 0 80px rgba(255,0,0,.55) inset, 0 0 40px rgba(255,0,0,.5);
  transform: translate(-50%, -50%) scale(.05); opacity: 0; }
#lens.on { animation: lens 1.5s ease-out; }
#lens.on::after { animation: lensring 1.2s ease-out; }
@keyframes lens { 0% { opacity: 0; transform: scale(1.3); } 10% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1); } }
@keyframes lensring { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.05); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
#intro-skip { position: absolute; right: 20px; bottom: 18px; z-index: 6; padding: 6px 12px; background: #04101ccc; border: 1px solid var(--line);
  border-radius: 4px; color: var(--dim); font: 11px var(--mono); letter-spacing: .1em; cursor: pointer; }
#intro-skip:hover { color: var(--accent); border-color: var(--accent); }
#intro-hint { position: absolute; left: 0; right: 0; bottom: 7%; z-index: 6; text-align: center; padding: 0 16px; pointer-events: none;
  font: 13px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); text-shadow: 0 0 10px #000, 0 0 4px #000;
  animation: hintblink 1.6s ease-in-out infinite; }
@keyframes hintblink { 50% { opacity: .35; } }

/* ---------- Chat und Würfel ---------- */
#chat { --glass: #0a182a55; --glass-edge: #ffffff22; --glass-shadow: inset 0 1px 0 #ffffff1c, 0 6px 24px #0007;
  position: absolute; left: 16px; bottom: 16px; z-index: 25; width: min(360px, calc(100% - 32px)); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chat-toggle { position: relative; padding: 7px 16px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 20px; cursor: pointer; box-shadow: var(--glass-shadow);
  font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); backdrop-filter: blur(14px) saturate(1.3); }
.chat-toggle:hover, #chat.open .chat-toggle { color: var(--accent); border-color: var(--accent); }
.chat-badge { position: absolute; right: -6px; top: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #1a0500;
  font: 700 11px/18px var(--mono); font-style: normal; text-align: center; }
.chat-body { display: none; width: 100%; flex-direction: column; gap: 6px; order: -1; }   /* Box selbst durchsichtig, nur die Elemente darin sind Glas */
#chat.open .chat-body { display: flex; }
.chat-log { list-style: none; margin: 0; padding: 10px 12px; height: min(38vh, 320px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: #2a4a5a transparent; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-line { padding: 5px 10px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 10px; box-shadow: var(--glass-shadow); backdrop-filter: blur(14px) saturate(1.3); }
.chat-line time { font: 10px var(--mono); color: var(--dim); margin-right: 6px; }
.chat-line .who { font-weight: 600; margin-right: 6px; }
.chat-line .text { color: var(--ink); }
.chat-line.roll .roll { color: var(--dim); }
.chat-line .roll b { font: 700 16px var(--mono); color: var(--gold); }
.chat-line .roll.crit b { color: #ffe58a; text-shadow: 0 0 8px #f3c969; }
.chat-line .roll.crit { color: var(--gold); }
.chat-line .roll.fumble b, .chat-line .roll.fumble { color: var(--warn); }
.chat-err { min-height: 0; padding: 0 12px; color: var(--warn); font-size: 13px; }
.chat-err:not(:empty) { padding-bottom: 4px; }
.chat-form { display: flex; gap: 6px; padding: 6px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 12px; box-shadow: var(--glass-shadow); backdrop-filter: blur(14px) saturate(1.3); }
.chat-input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 14px; background: #ffffff0f; border: 1px solid #ffffff1a; border-radius: 8px; }
.chat-send, .chat-roll { flex: none; padding: 0 11px; background: #ffffff10; border: 1px solid #ffffff22; border-radius: 8px; cursor: pointer; }
.chat-send:hover, .chat-roll:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chat-roll { color: var(--gold); border-color: #f3c96955; font: 700 12px var(--mono); letter-spacing: .06em; }
.chat-roll:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: #f3c9691a; }
.chat-roll:disabled { opacity: .45; cursor: default; }
.chat-roll .ico { font-size: 16px; }

.dice-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 1; }
.dice-layer.off { opacity: 0; transition: opacity .5s; }
.dice-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dice-result { position: absolute; transform: translate(-50%, 0); display: flex; flex-direction: column; align-items: center; gap: 0; opacity: 0; transition: opacity .25s;
  text-shadow: 0 2px 10px #000, 0 0 3px #000; }
.dice-result.show { opacity: 1; }
.dice-result .who { font: 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.dice-result b { font: 700 44px/1.1 var(--mono); color: var(--ink); }
.dice-result.crit b { color: #ffe58a; text-shadow: 0 0 18px #f3c969, 0 2px 10px #000; }
.dice-result.fumble b { color: var(--warn); text-shadow: 0 0 18px #ff3b1a, 0 2px 10px #000; }

@media (max-width: 820px) {
  #chat { left: 10px; bottom: 10px; width: calc(100% - 20px); }
  .chat-log { height: 30vh; }
}

/* ---------- Spielerfenster (Modal), Items, Inventar ---------- */
#pnav { position: absolute; left: 24px; top: 56px; display: flex; gap: 8px; }     /* unter der HUD-Zeile der Karte (Milchstraße › … › Jupiter-System), damit sie lesbar bleibt */
.pill { padding: 6px 14px; background: #04101ccc; border: 1px solid var(--line); border-radius: 18px; cursor: pointer;
  font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); backdrop-filter: blur(6px); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
#modal { z-index: 60; }
#modal.wide { width: min(980px, calc(100% - 24px)); }
.modal-body { min-height: 0; padding: 18px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a4a5a transparent; }
.char-form .stat-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.stat-row { display: grid; grid-template-columns: 1fr 90px 34px; gap: 8px; align-items: center; }
.char-form.sheet { position: relative; padding: 0 0 18px; margin: -18px; gap: 16px; }
.char-form.sheet > :not(.sheet-head) { margin: 0 22px; }
.sheet-head { position: relative; display: flex; flex-direction: column; justify-content: flex-start; aspect-ratio: 16 / 6; min-height: 220px; padding: 22px;   /* Fraktionshintergrund, Figuren als eigene Ebene (anderes Seitenverhältnis als der Hintergrund) */
  background: linear-gradient(90deg, #050b12e6 0%, #050b1299 40%, transparent 75%), var(--sheet-bg, none) center 80% / cover no-repeat;
  border-bottom: 2px solid var(--faction, var(--accent)); overflow: hidden; }
.sheet-head::after { content: ''; position: absolute; right: 3%; bottom: 0; height: 100%; width: 60%; z-index: 0;
  background: var(--sheet-fg, none) right bottom / contain no-repeat; pointer-events: none; }
.sheet-head > * { position: relative; z-index: 1; }
.sheet-name { font: 700 26px var(--mono); letter-spacing: .08em; color: var(--faction, var(--accent)); }
.sheet-sub { margin-top: 4px; font: 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.sheet-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sheet-stat { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; background: #03080fcc; border: 1px solid color-mix(in srgb, var(--faction, var(--accent)) 35%, transparent); border-radius: 6px; backdrop-filter: blur(4px); }
.sheet-val { font: 700 28px var(--mono); color: var(--faction, var(--gold)); }
.sheet-lbl { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.sheet-bio textarea { background: #03080fcc; }
.notes { display: grid; gap: 8px; }
.notes-area { min-height: min(55vh, 460px); resize: vertical; line-height: 1.5; }

.inv { display: grid; grid-template-columns: 250px 1fr; gap: 18px; min-height: min(60vh, 460px); }
.inv-side { display: grid; gap: 10px; align-content: start; }
.inv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.inv-list li.empty { padding: 8px 2px; }
.inv-list li button { width: 100%; text-align: left; display: grid; gap: 0; padding: 8px 12px; background: var(--panel); border: 1px solid #4fd8ff22; border-radius: 6px; cursor: pointer; }
.inv-list li button:hover { border-color: var(--accent); }
.inv-list li.on button { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.inv-list .muted { font-size: 12px; }

.item-detail { display: grid; gap: 16px; align-content: start; }
.item-preview { position: relative; height: 300px; border: 1px solid #2a4a5a; border-radius: 6px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #12263a, #050b12 80%); }
.item-preview canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.item-preview .preview-status { position: absolute; inset: 0; display: grid; place-items: center; font: 12px var(--mono); letter-spacing: .1em; color: var(--dim); }
.item-preview.flat { height: 120px; display: grid; place-items: center; }
.item-preview .glyph { font-size: 48px; color: #4fd8ff55; }
.item-info h3 { margin: 0 0 6px; font-size: 20px; }
.item-info .qty { color: var(--gold); font-family: var(--mono); }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { padding: 1px 10px; border: 1px solid #2a4a5a; border-radius: 10px; font: 11px var(--mono); letter-spacing: .06em; color: var(--dim); }
.chip.cat { color: var(--accent); border-color: var(--line); }
.item-desc { margin: 0 0 14px; white-space: pre-wrap; color: #c9d8e0; }
.qty-input { width: 70px; text-align: center; }
.skills { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 12px; box-shadow: var(--glass-shadow); backdrop-filter: blur(14px) saturate(1.3); }
.skills summary { padding: 7px 12px; cursor: pointer; font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.skills[open] summary { color: var(--accent); }
.skill-tabs { display: flex; gap: 4px; padding: 0 8px 6px; }
.skill-tab { flex: 1; padding: 5px 8px; cursor: pointer; background: #ffffff0c; border: 1px solid #ffffff1c; border-radius: 8px; color: var(--dim); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.skill-tab.on { color: var(--accent); border-color: var(--accent); background: #4fd8ff14; }
.skill-list[hidden] { display: none; }
.skill-empty { padding: 8px 12px; font-size: 13px; }
.lg-tip { position: fixed; z-index: 60; display: flex; gap: 12px; align-items: center; max-width: 300px; padding: 10px 14px 10px 10px; pointer-events: none; animation: lg-tip-in .15s ease-out;
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 12px; box-shadow: var(--glass-shadow); backdrop-filter: blur(14px) saturate(1.3); }
.lg-tip.final { border-color: var(--gold); }
.lg-tip img { flex: none; width: 56px; height: 56px; object-fit: contain; }
.lg-tip strong { display: block; font-size: 14px; color: var(--ink); }
.lg-tip .muted { display: block; font-size: 11px; letter-spacing: .06em; }
.lg-tip p { margin: 4px 0 0; font-size: 13px; color: var(--gold); }
@keyframes lg-tip-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.chat-legacy { display: block; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; color: var(--ink); font: inherit; }
.chat-legacy:hover .nm { color: var(--accent); }
.chat-portrait.legacy img { object-fit: cover; padding: 0; }   /* Knotenbild füllt die ganze Box */
.chat-line .lg-line { display: block; margin-top: 2px; font-size: 13px; }
.chat-line .lg-effect { color: var(--gold); }
.skill-list { list-style: none; margin: 0; padding: 0 8px 8px; max-height: min(30vh, 260px); overflow-y: auto; display: grid; gap: 5px; scrollbar-width: thin; scrollbar-color: #2a4a5a transparent; }
.skill { width: 100%; display: grid; grid-template-columns: 14px 1fr 42px; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #ffffff1c, #ffffff08); border: 1px solid #ffffff26; border-radius: 10px; color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: inset 0 1px 0 #ffffff30, 0 2px 8px #0006; backdrop-filter: blur(10px); transition: background .15s, border-color .15s; }
.skill:hover { border-color: var(--accent); background: linear-gradient(180deg, #ffffff2c, #ffffff12); }
.skill:active { transform: translateY(1px); }
.skill-dot { width: 8px; height: 8px; border: 2px solid var(--ink); border-radius: 50%; }
.skill-stat { font: 11px var(--mono); letter-spacing: .08em; color: var(--dim); }
.skill-mod { text-align: right; font: 700 14px var(--mono); color: var(--gold); }
.skill-mod.neg { color: var(--warn); }
.chat-item { padding: 0 8px; background: #4fd8ff14; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; color: var(--accent); font: inherit; }
.chat-item:hover { background: #4fd8ff2a; border-color: var(--accent); }
#toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 20px); padding: 9px 18px; background: #06101bf2; border: 1px solid var(--accent);
  border-radius: 6px; color: var(--ink); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .inv { grid-template-columns: 1fr; }
  #pnav { gap: 4px; left: 12px; top: 54px; }
  .pill { padding: 6px 9px; letter-spacing: .04em; }
  #topbar { gap: 6px; padding: 0 8px; }
}

/* ---------- Ping (Aussehen wie der pulsierende Marker auf Europa: dünne Ringe wachsen und blenden aus, weicher Glühpunkt) ---------- */
#pings { position: absolute; inset: 0; z-index: 22; pointer-events: none; overflow: hidden; }
#ping-capture { position: absolute; inset: 0; z-index: 15; cursor: crosshair; background: #4fd8ff0a; }
#btn-combat.on { color: #ff6b4a; border-color: #ff6b4a; box-shadow: 0 0 10px #ff6b4a66; }
#btn-ping.on { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px #f3c96966; }
#btn-ping.cooling { opacity: .45; }
#btn-ping:disabled { opacity: .3; cursor: not-allowed; }
.ping { position: absolute; width: 0; height: 0; --size: 120px; --wave: 1.6s; animation: ping-life 3.4s linear both; }
.ping .ring { position: absolute; left: calc(var(--size) / -2); top: calc(var(--size) / -2); width: var(--size); height: var(--size); border-radius: 50%;
  border: 2px solid var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 8px var(--c), 0 0 0 1px #0008;
  opacity: 0; animation: ping-wave var(--wave) linear infinite both; }
.ping .dot { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0, #fff 14%, var(--c) 30%, transparent 70%); filter: drop-shadow(0 0 3px #000); }
.ping .who { position: absolute; left: 0; top: calc(var(--size) / 2 + 2px); transform: translateX(-50%); padding: 2px 10px; white-space: nowrap;
  background: #02060cd9; border: 1px solid var(--c); border-radius: 10px; color: var(--c); font: 700 12px var(--mono); letter-spacing: .08em; text-shadow: 0 0 6px #000; }
@keyframes ping-wave { 0% { opacity: 1; transform: scale(.12); } 100% { opacity: 0; transform: scale(1); } }
@keyframes ping-life { 0% { opacity: 0; } 6% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ping .ring { animation: none; opacity: .6; transform: scale(.5); } }

/* ---------- Klassenwahl ---------- */
#classpick { position: fixed; inset: 0; z-index: 90; display: flex; background: #02030a; opacity: 0; transition: opacity .7s; }
#classpick.in { opacity: 1; }
#classpick.out { opacity: 0; pointer-events: none; }
.cls-title { position: absolute; top: 18px; left: 0; right: 0; z-index: 6; text-align: center; pointer-events: none;
  font: 12px var(--mono); letter-spacing: .32em; text-transform: uppercase; color: var(--ink); text-shadow: 0 0 12px #000, 0 0 4px #000; }
.cls-card { position: relative; isolation: isolate; container-type: size; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; cursor: pointer; outline: none;
  border-left: 1px solid #0008; transition: flex-grow .7s cubic-bezier(.3, .7, .2, 1), filter .5s, opacity .7s; filter: brightness(.82) saturate(.9); }
.cls-title + .cls-card { border-left: 0; }
.cls-card:hover, .cls-card:focus-visible, .cls-card.sel { filter: none; }
#classpick.has-sel .cls-card.sel { flex-grow: 6; }          /* gewählte Karte: 75 % der Fläche, die anderen beiden je 12,5 % */
#classpick.has-sel .cls-card:not(.sel) .cls-text h2 { writing-mode: vertical-rl; font-size: clamp(16px, 1.7vw, 26px); letter-spacing: .2em; }
#classpick.has-sel .cls-card:not(.sel) .cls-hint { display: none; }
#classpick.has-sel .cls-card:not(.sel) { filter: brightness(.55) saturate(.8); }
#classpick.has-sel .cls-card:not(.sel):hover { filter: brightness(.8); }
.cls-bg, .cls-gl, .cls-back, .cls-anim { position: absolute; inset: -4%; width: 108%; height: 108%; will-change: transform; pointer-events: none; }
.cls-bg { background-size: cover; background-position: center; z-index: 0; }
.cls-gl { z-index: 1; opacity: 0; transition: opacity .8s; }
.cls-gl.ready { opacity: 1; }
.cls-back { z-index: 2; }
.cls-anim { z-index: 3; }
.cls-fig { --fig-h: 56cqh; --fig-k: 1; --fig-aspect: 1.1; position: absolute; display: flex; pointer-events: none;
  height: calc(var(--fig-h) * var(--fig-k));
  bottom: calc(var(--drop, 0) * var(--fig-h) * var(--fig-k) * -1 - var(--sink, 24px));            /* --sink: Figur ragt so weit unter den Kartenrand, dass der Parallax den unteren Bildrand nie freilegt */
  right: min(4cqw, calc((100cqw - var(--fig-h) * var(--fig-k) * var(--fig-aspect)) / 2)); }   /* breite Karte: rechts verankert; schmale Karte (Gruppe breiter als die Karte): mittig, damit links und rechts gleich viel angeschnitten wird */
.cls-img { position: relative; z-index: 4; flex: none; height: 100%; width: auto; max-width: none; object-fit: contain;
  will-change: transform; user-select: none; }                                                                   /* z 4: vor Windrädern/Sternen (anim, z 3) */
.cls-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; opacity: .8; transition: opacity .5s; }
.cls-fx.paused { opacity: 0; }
.cls-card::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: linear-gradient(180deg, #02030a99 0, transparent 22%, transparent 55%, #02030a99 100%); }
.cls-card.sel::after { background: linear-gradient(90deg, #02030ae6 0, #02030a99 38%, transparent 70%), linear-gradient(180deg, #02030a99 0, transparent 22%); }
.cls-text { position: absolute; z-index: 7; left: 0; top: 0; bottom: 0; width: 100%; padding: 64px 36px 36px; display: flex; flex-direction: column; justify-content: flex-start; pointer-events: none; }
.cls-text h2 { margin: 0; font: 700 clamp(26px, 3.2vw, 46px)/1.1 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 2px 18px #000, 0 0 4px #000; }
.cls-hint { margin-top: 8px; font: 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); text-shadow: 0 0 6px #000; }
.cls-card.sel .cls-hint { display: none; }
.cls-desc { display: none; margin-top: 16px; width: min(38%, 480px); max-height: calc(100% - 70px); overflow-y: auto; pointer-events: auto; padding-right: 8px;
  scrollbar-width: thin; scrollbar-color: #4fd8ff55 transparent; font-size: 15px; line-height: 1.6; color: #e6eef2; text-shadow: 0 1px 6px #000, 0 0 3px #000; }
.cls-card.sel .cls-desc { display: block; animation: cls-fade .6s .25s both; }
.cls-desc p { margin: 0 0 12px; }
.cls-desc b { color: var(--warn); }
.cls-confirm { margin: 6px 0 4px; padding: 10px 22px; font-size: 15px; }
#classpick > .err { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; z-index: 7; text-shadow: 0 0 6px #000; }
@keyframes cls-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  #classpick { flex-direction: column; }
  .cls-card { border-left: 0; border-top: 1px solid #0008; }
  .cls-title + .cls-card { border-top: 0; }
  .cls-text { padding: 46px 16px 14px; }
  .cls-fig { --fig-h: 30vh; }
  #classpick.has-sel .cls-card:not(.sel) .cls-text h2 { writing-mode: horizontal-tb; font-size: clamp(16px, 4.4vw, 22px); }
  .cls-desc { width: 100%; font-size: 13.5px; max-height: calc(100% - 52px); }
  .cls-card.sel::after { background: linear-gradient(180deg, #02030af0 0, #02030aa0 70%, #02030a66 100%); }
}

/* Klassenwahl: Auswahl aufheben und Merkmale (Infobox) */
.cls-unselect { position: absolute; top: 14px; right: 18px; z-index: 8; padding: 6px 14px; background: #04101ccc; border: 1px solid var(--line); border-radius: 16px;
  cursor: pointer; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); backdrop-filter: blur(6px); }
.cls-unselect:hover { border-color: var(--accent); color: var(--accent); }
#classpick:not(.has-sel) .cls-unselect { display: none; }
.cls-traits { margin: 14px 0 6px; padding: 12px 14px 4px; background: #03080fcc; border: 1px solid color-mix(in srgb, var(--faction, var(--accent)) 35%, transparent); border-left: 3px solid var(--faction, var(--accent)); border-radius: 6px; backdrop-filter: blur(4px); }
.cls-traits-title { margin-bottom: 8px; font: 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faction, var(--accent)); }
.cls-trait { display: grid; grid-template-columns: 28px 1fr; gap: 10px; margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.cls-ico { width: 26px; height: 26px; margin-top: 1px; background: var(--faction, var(--accent));
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.cls-trait b { display: block; margin-bottom: 1px; font: 700 13px var(--mono); letter-spacing: .06em; color: var(--faction, var(--gold)); }
.cls-trait span { color: #dbe6ec; }
.cls-desc .cls-confirm { position: sticky; bottom: 4px; box-shadow: 0 0 18px #000a; }   /* bleibt sichtbar, auch wenn Text und Merkmale scrollen */
.cls-card .cls-confirm.btn.primary { background: var(--faction, var(--accent)); border-color: var(--faction, var(--accent)); color: #05090f; }
.cls-card .cls-confirm.btn.primary:hover:not(:disabled) { filter: brightness(1.12); color: #05090f; }

/* ---------- Lautstärkeregler (immer sichtbar ab der Klassenwahl) ---------- */
#volume { position: fixed; left: 16px; bottom: 16px; z-index: 95; display: flex; align-items: center; height: 32px; border-radius: 20px; overflow: hidden;
  background: #0a182a55; border: 1px solid #ffffff22; box-shadow: inset 0 1px 0 #ffffff1c, 0 6px 24px #0007; backdrop-filter: blur(14px) saturate(1.3); transition: width .22s ease; width: 44px; }
#volume.open { width: 214px; }
.vol-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); }
.vol-main { width: 42px; }
.vol-btn:hover { color: var(--accent); }
.vol-ico { width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.vol-panel { display: flex; align-items: center; gap: 8px; padding-right: 14px; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
#volume.open .vol-panel { opacity: 1; pointer-events: auto; transition-delay: .08s; }
.vol-mute .vol-ico { width: 17px; height: 17px; }
.vol-slider { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; padding: 0; border: 0; border-radius: 2px; cursor: pointer; outline-offset: 6px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), #ffffff33 var(--fill, 50%)); }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid #04101c; }
.vol-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid #04101c; }
.vol-slider:focus-visible { outline: 2px solid var(--accent); }
#volume.muted .vol-btn { color: var(--dim); }
@media (max-width: 820px) { .vol-slider { width: 100px; } }

/* ---------- Charaktererstellung: gewählte Fraktion im Vollbild, links Editor, rechts Beschreibung ---------- */
.cls-fig { transition: right .7s cubic-bezier(.3, .7, .2, 1); }
#classpick.creating .cls-card:not(.sel) { flex-grow: 0; opacity: 0; pointer-events: none; border-width: 0; }
#classpick.creating .cls-card.sel { cursor: default; }
#classpick.creating .cls-card.sel .cls-fig { right: calc((100cqw - var(--fig-h) * var(--fig-k) * var(--fig-aspect)) / 2); }   /* Gruppe in die Mitte */
#classpick.creating .cls-card.sel::after { background: linear-gradient(90deg, #02030af0 0, #02030a99 26%, transparent 42%, transparent 58%, #02030a99 74%, #02030af0 100%), linear-gradient(180deg, #02030a99 0, transparent 22%); }
#classpick.creating .cls-card.sel .cls-text { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr) minmax(300px, 460px); grid-template-rows: auto minmax(0, 1fr); column-gap: 28px; }
#classpick.creating .cls-card.sel .cls-text h2 { grid-column: 1; grid-row: 1; }
#classpick.creating .cls-card.sel .cls-desc { display: block; grid-column: 3; grid-row: 1 / span 2; width: auto; max-height: 100%; margin-top: 0; animation: none; }
#classpick.creating .cls-card.sel .cls-desc .cls-confirm { display: none; }
.cls-editor { display: none; }
#classpick.creating .cls-card.sel .cls-editor { display: block; grid-column: 1; grid-row: 2; margin-top: 14px; overflow-y: auto; min-height: 0; pointer-events: auto;
  animation: cls-fade .6s .35s both; scrollbar-width: thin; scrollbar-color: #4fd8ff55 transparent; }
.cls-editor { padding: 14px 16px 16px; background: #03080fd9; border: 1px solid color-mix(in srgb, var(--faction, var(--accent)) 35%, transparent);
  border-left: 3px solid var(--faction, var(--accent)); border-radius: 6px; backdrop-filter: blur(4px); }
.ce-title { margin-bottom: 10px; font: 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faction, var(--accent)); }
.ce-field { display: grid; gap: 4px; margin-bottom: 12px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.ce-points { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.ce-left { margin-left: auto; font: 700 20px var(--mono); letter-spacing: .04em; color: var(--faction, var(--accent)); }
.ce-reset { padding: 3px 10px; font-size: 12px; }
.ce-stats { display: grid; }
.ce-row.fixed .ce-ctl { opacity: .5; }   /* nicht verteilbare Eigenschaft (Glück) */
.ce-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #ffffff12; }
.ce-label { display: grid; line-height: 1.25; }
.ce-label span { font-weight: 600; }
.ce-label small { font: 11px var(--mono); letter-spacing: .06em; color: var(--faction, var(--accent)); }
.ce-ctl { display: flex; align-items: center; gap: 8px; }
.ce-step { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #2a4a5a; background: transparent; cursor: pointer; color: var(--ink); font-size: 18px; line-height: 1; padding: 0; }
.ce-step:hover:not(:disabled) { border-color: var(--faction, var(--accent)); color: var(--faction, var(--accent)); }
.ce-step:disabled { opacity: .28; cursor: default; }
.ce-pips { display: flex; gap: 3px; }
.ce-pips i { width: 12px; height: 12px; border: 1px solid #ffffff44; border-radius: 2px; }
.ce-pips i.on { background: var(--faction, var(--accent)); border-color: var(--faction, var(--accent)); }
.ce-num { min-width: 30px; text-align: center; font: 700 16px var(--mono); }
.ce-num.neg { color: var(--warn); }
.ce-msg { margin-top: 12px; font-size: 13px; color: var(--dim); min-height: 1.4em; }
.ce-msg.ok { color: #7fe0a8; }
.ce-err { min-height: 1.2em; color: var(--warn); font-size: 13px; }
.ce-submit { width: 100%; margin-top: 4px; }
.ce-submit:disabled { opacity: .4; }
@media (max-width: 820px) {
  #classpick.creating .cls-card.sel .cls-text { display: flex; flex-direction: column; overflow-y: auto; pointer-events: auto; }
  #classpick.creating .cls-card.sel .cls-editor { order: 1; }
  #classpick.creating .cls-card.sel .cls-desc { order: 2; }
  #classpick.creating .cls-card.sel .cls-editor { margin: 10px 0; max-height: none; }
  #classpick.creating .cls-card.sel .cls-desc { max-height: none; margin-bottom: 70px; }
  #classpick.creating .cls-card.sel .cls-fig { display: none; }
  #classpick.creating .cls-card.sel::after { background: #02030acc; }
}

/* ---------- Mitlaufende Lyrics (unten rechts, dezent): Titel, vorherige, aktuelle und nächste Zeile ---------- */
#lyrics { position: fixed; right: 26px; bottom: 20px; z-index: 94; max-width: min(46ch, 40vw); pointer-events: none; text-align: right; display: grid; gap: 8px; justify-items: end; }
.lyr-title { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 8px; background: #03080fb8; border: 1px solid color-mix(in srgb, var(--faction, var(--accent)) 35%, transparent);
  border-radius: 14px; opacity: 0; transition: opacity .5s; backdrop-filter: blur(4px); }
.lyr-title.on { opacity: .95; }
.lyr-ico { width: 16px; height: 16px; background: var(--faction, var(--accent)); -webkit-mask: url(/img/icons/mdi--music.svg) center / contain no-repeat; mask: url(/img/icons/mdi--music.svg) center / contain no-repeat; }
.lyr-title span { font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.lyr-box { display: grid; gap: 1px; justify-items: end; opacity: 0; transition: opacity .35s ease; }
.lyr-box.on { opacity: 1; }
.lyr-line { min-height: 1.45em; padding: 0 12px 0 0; border-right: 2px solid transparent; font: italic 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .02em; color: #e8f0f4;
  text-shadow: 0 1px 8px #000, 0 0 3px #000, 0 0 14px #000a; }
.lyr-line.note { font-style: normal; font-size: 1.3em; line-height: 1.1; letter-spacing: .12em; }      /* Musiknote statt Text */
.lyr-prev, .lyr-next { opacity: .38; }                       /* vorherige und nächste Zeile gleich blass */
.lyr-cur { opacity: .95; border-right-color: var(--faction, var(--accent)); }
#classpick.creating .cls-card.sel .cls-text { padding-bottom: 150px; }          /* Platz für die Lyrics unten */
@media (max-width: 820px) { #lyrics { right: 10px; bottom: 112px; max-width: 72vw; } .lyr-line { font-size: 14px; } }

/* Szenen-Audio im GM-Menü */
.aud h4 { margin: 4px 0 8px; font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.aud-list { display: grid; gap: 8px; margin-bottom: 10px; }
.aud-row { display: grid; gap: 8px; padding: 10px 12px; background: var(--panel); border: 1px solid #4fd8ff22; border-radius: 6px; }
.aud-top { display: flex; gap: 6px; }
.aud-top .aud-name { flex: 1; min-width: 0; }
.aud-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.aud-opts label { display: grid; gap: 5px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.aud-opts .aud-check { display: flex; align-items: center; gap: 8px; align-self: center; }

/* ---------- Einblendung „Neue Mission“ (missionbanner.js) ---------- */
.mb { --mb-c: var(--accent, #7fe3ff); position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .5s; }
.mb.in { opacity: 1; }
.mb.out { opacity: 0; transition: opacity .7s; }
.mb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, #000b 0%, #0006 38%, transparent 70%); }
.mb-frame { position: relative; padding: 18px 22px 14px; max-width: calc(100vw - 32px); font-family: var(--mono); color: var(--mb-c); text-transform: uppercase;
  background: linear-gradient(90deg, transparent, #04101c66 20%, #04101c66 80%, transparent); animation: mb-open .6s ease-out both; }
.mb-canvas { display: block; margin: 6px auto; filter: drop-shadow(0 0 7px var(--mb-c)) drop-shadow(0 0 22px color-mix(in srgb, var(--mb-c) 45%, transparent)); color: var(--mb-c); }
.mb-label, .mb-foot { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .32em; white-space: nowrap; }
.mb-label b { font-weight: 700; letter-spacing: .42em; animation: mb-blink 1.8s steps(1) infinite; }
.mb-label em, .mb-foot em { font-style: normal; font-size: 10px; letter-spacing: .18em; opacity: .55; }
.mb-tick { width: 8px; height: 8px; background: var(--mb-c); box-shadow: 0 0 8px var(--mb-c); }
.mb-rule { flex: 1; height: 7px; min-width: 20px; background: repeating-linear-gradient(90deg, var(--mb-c) 0 1px, transparent 1px 9px) bottom/100% 5px no-repeat, linear-gradient(var(--mb-c), var(--mb-c)) center/100% 1px no-repeat; opacity: .6; }
.mb-faction { display: flex; align-items: center; gap: 8px; }
.mb-faction i { width: 10px; height: 10px; border: 1px solid var(--mb-c); transform: rotate(45deg); background: color-mix(in srgb, var(--mb-c) 50%, transparent); }
.mb-faction b { font-weight: 700; letter-spacing: .3em; }
.mb-faction.none { display: none; }
.mb-corner { position: absolute; width: 22px; height: 22px; border: 0 solid var(--mb-c); opacity: .9; filter: drop-shadow(0 0 4px var(--mb-c)); }
.mb-corner.tl { left: 0; top: 0; border-width: 2px 0 0 2px; } .mb-corner.tr { right: 0; top: 0; border-width: 2px 2px 0 0; }
.mb-corner.bl { left: 0; bottom: 0; border-width: 0 0 2px 2px; } .mb-corner.br { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.mb-scan { position: absolute; left: 0; right: 0; height: 2px; top: 50%; background: linear-gradient(90deg, transparent, var(--mb-c), transparent); opacity: 0; animation: mb-scan 2.4s ease-in-out .3s both; }
@keyframes mb-open { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes mb-blink { 0%, 88% { opacity: 1; } 92% { opacity: .35; } 100% { opacity: 1; } }
@keyframes mb-scan { 0% { top: 28%; opacity: 0; } 15% { opacity: .55; } 85% { opacity: .55; } 100% { top: 72%; opacity: 0; } }
@media (max-width: 600px) { .mb-label em, .mb-foot em { display: none; } .mb-label, .mb-foot { letter-spacing: .2em; } }
@media (prefers-reduced-motion: reduce) { .mb-frame, .mb-scan, .mb-label b { animation: none; } .mb-scan { display: none; } }

/* ---------- Orts-Intro beim Erreichen einer Szene (sceneintro.js): unteres Drittel, linksbündig, ruhiger als die Missionsanzeige ---------- */
.si { --si-c: var(--accent, #7fe3ff); position: fixed; left: 0; right: 0; bottom: 17vh; z-index: 79; display: flex; justify-content: flex-start; padding: 0 clamp(24px, 6vw, 96px); pointer-events: none; opacity: 0; transition: opacity .5s; font-family: var(--mono); }
.si.in { opacity: 1; }
.si.out { opacity: 0; transition: opacity .7s; }
.si::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; bottom: -40px; background: linear-gradient(90deg, #000a 0%, #0006 45%, transparent 85%); }
.si-frame { position: relative; max-width: 100%; padding: 0 0 4px 22px; border-left: 2px solid var(--si-c); box-shadow: -10px 0 24px -14px var(--si-c); animation: si-open .7s ease-out both; }
.si-frame::before, .si-frame::after { content: ""; position: absolute; left: -2px; width: 14px; height: 2px; background: var(--si-c); }
.si-frame::before { top: 0; } .si-frame::after { bottom: 0; }
.si-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--si-c); white-space: nowrap; }
.si-head b { font-weight: 700; }
.si-head em { font-style: normal; font-size: 10px; letter-spacing: .18em; opacity: .55; }
.si-pip { width: 7px; height: 7px; background: var(--si-c); box-shadow: 0 0 8px var(--si-c); animation: si-pip 1.2s steps(1) infinite; }
.si-rule { flex: 0 1 140px; height: 1px; background: linear-gradient(90deg, var(--si-c), transparent); opacity: .7; }
.si-canvas { display: block; max-width: 100%; }
.si::before { transition: opacity .7s; }
.si.dissolve::before { opacity: 0; }
.si.dissolve .si-head { opacity: 0; transition: opacity .7s; }
.si.dissolve .si-frame { border-left-color: transparent; box-shadow: none; transition: border-color .7s, box-shadow .7s; }
.si.dissolve .si-frame::before, .si.dissolve .si-frame::after { opacity: 0; transition: opacity .7s; }
@keyframes si-open { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes si-pip { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }
@media (max-width: 600px) { .si { bottom: 12vh; } .si-head em { display: none; } .si-head { letter-spacing: .2em; } }
@media (prefers-reduced-motion: reduce) { .si-frame, .si-pip { animation: none; } }

/* ---------- Aktive Mission oben links, Missionsliste im Hangar (missionhud.js) ---------- */
.mh { --mh-c: var(--accent); position: absolute; left: 24px; top: 98px; z-index: 15; width: min(300px, calc(100vw - 48px)); padding: 10px 14px 10px; font-family: var(--mono);
  background: linear-gradient(90deg, #04101ccc, #04101c88); border-left: 2px solid var(--mh-c); backdrop-filter: blur(6px); }
.mh.gm { top: 56px; }
.mh[hidden] { display: none; }
.mh.flash { animation: mh-flash 1.4s ease-out; }
@keyframes mh-flash { 0% { box-shadow: 0 0 0 0 var(--mh-c); } 30% { box-shadow: 0 0 22px 2px color-mix(in srgb, var(--mh-c) 60%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.mh-corner { position: absolute; width: 10px; height: 10px; border: 0 solid var(--mh-c); }
.mh-corner.tl { left: -2px; top: 0; border-width: 1px 0 0 0; width: 18px; } .mh-corner.br { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.mh-label { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--mh-c); }
.mh-label em { margin-left: auto; font-style: normal; letter-spacing: .12em; opacity: .8; }
.mh-tick { width: 6px; height: 6px; background: var(--mh-c); box-shadow: 0 0 6px var(--mh-c); }
.mh-title { margin: 6px 0 2px; font: 600 15px system-ui, sans-serif; letter-spacing: .03em; color: var(--ink); }
.mh-short { font: 12px/1.4 system-ui, sans-serif; color: var(--dim); }
.mh-more { margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer; font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mh-c); }
.mh-more:hover { text-decoration: underline; }
.mh-fac { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font: 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mh-c); }
.mh-fac.small { margin: 4px 0 0; font-size: 10px; }
.mh-fac i { width: 8px; height: 8px; border: 1px solid var(--mh-c); transform: rotate(45deg); background: color-mix(in srgb, var(--mh-c) 50%, transparent); }
.mh-details p { margin: 0 0 12px; line-height: 1.5; white-space: pre-wrap; }
.mh-details .mh-lead { color: var(--ink); font-weight: 600; }
.mh-none { color: var(--dim); font-size: 13px; }
.mh-list { display: grid; gap: 12px; margin-top: 18px; }
.mh-item { --mh-c: var(--accent); padding: 12px 14px; background: var(--panel); border: 1px solid #4fd8ff22; border-left: 3px solid var(--mh-c); }
.mh-item.on { background: color-mix(in srgb, var(--mh-c) 10%, var(--panel)); }
.mh-item-head { display: flex; align-items: baseline; gap: 10px; }
.mh-item-head b { font-size: 15px; }
.mh-badge { margin-left: auto; font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mh-c); }
.mh-item .mh-short { margin: 6px 0 0; }
.mh-more-box { margin-top: 10px; padding-top: 10px; border-top: 1px solid #ffffff14; font-size: 13px; }
.mh-actions { display: flex; gap: 8px; margin-top: 10px; }
.mh-go { color: var(--mh-c); border-color: var(--mh-c); }
@media (max-width: 700px) { .mh { left: 12px; top: 92px; } }

/* ---------- Charakter-Einblendung (showcase.js) ---------- */
/* Block am linken Rand, höchstens ein Drittel der Breite, fliegt von links ein. Liegt in #app zwischen Bühne (0) und
   Oberfläche (Mission 15, Leiste 20, Pings 22, Chat 25): alle Bedienelemente liegen darüber. */
.sc { --sc-c: var(--accent, #7fe3ff); position: absolute; left: 0; top: 50%; z-index: 10; width: min(33.333vw, 620px); min-width: min(100%, 340px); transform: translate(-105%, -50%); pointer-events: none; font-family: var(--mono); transition: transform .85s cubic-bezier(.16,.84,.24,1); }
.sc.in { transform: translate(0, -50%); }
.sc.out { transform: translate(-105%, -50%); transition: transform .6s cubic-bezier(.5,0,.8,.3); }
.sc-card { display: flex; align-items: stretch; gap: clamp(12px, 1.6vw, 24px); padding: clamp(10px, 1.4vw, 18px) clamp(14px, 1.8vw, 26px) clamp(10px, 1.4vw, 18px) clamp(12px, 1.4vw, 20px);
  background: linear-gradient(90deg, #04101cf0 0%, #04101ce0 72%, #04101c99 100%); border: 1px solid color-mix(in srgb, var(--sc-c) 40%, transparent); border-left: 0; border-radius: 0 6px 6px 0;
  box-shadow: 0 0 30px #000a, 0 0 28px color-mix(in srgb, var(--sc-c) 18%, transparent); backdrop-filter: blur(6px); }
.sc-portrait { position: relative; margin: 0; flex: none; align-self: center; height: min(34vh, 340px); aspect-ratio: 928 / 1232; max-width: 42%; border: 1px solid color-mix(in srgb, var(--sc-c) 55%, transparent); overflow: hidden; }
.sc-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s .3s; }
.sc-img.on { opacity: 1; }
.sc-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 3px, #00000026 3px 4px); mix-blend-mode: multiply; pointer-events: none; }
.sc-portrait i { position: absolute; width: 12px; height: 12px; border: 2px solid var(--sc-c); }
.sc-portrait .c1 { left: 4px; top: 4px; border-right: 0; border-bottom: 0; } .sc-portrait .c2 { right: 4px; top: 4px; border-left: 0; border-bottom: 0; }
.sc-portrait .c3 { left: 4px; bottom: 4px; border-right: 0; border-top: 0; } .sc-portrait .c4 { right: 4px; bottom: 4px; border-left: 0; border-top: 0; }
.sc-text { flex: 1; min-width: 0; align-self: center; color: var(--sc-c); }
.sc-label { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; white-space: nowrap; }
.sc-label b { font-weight: 700; letter-spacing: .38em; animation: mb-blink 1.8s steps(1) infinite; }
.sc-label em { font-style: normal; font-size: 9px; letter-spacing: .16em; opacity: .55; overflow: hidden; text-overflow: ellipsis; }
.sc-name { margin: 8px 0 3px; font-size: clamp(18px, 2vw, 30px); line-height: 1.1; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px color-mix(in srgb, var(--sc-c) 55%, transparent); overflow-wrap: anywhere; }
.sc-sub { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.sc-rule { height: 1px; margin: 10px 0 9px; background: linear-gradient(90deg, var(--sc-c), transparent); }
.sc-short { margin: 0; min-height: 4.2em; font-size: clamp(12px, 1vw, 15px); line-height: 1.55; color: var(--ink); }
@media (max-width: 760px) { .sc { width: min(100%, 440px); } .sc-portrait { height: 24vh; } }
@media (prefers-reduced-motion: reduce) { .sc, .sc.out { transition: opacity .2s; } .sc { transform: translate(0, -50%); opacity: 0; } .sc.in { opacity: 1; } .sc.out { opacity: 0; transform: translate(0, -50%); } .sc-img { transition-duration: .01s; transition-delay: 0s; } .sc-label b { animation: none; } }

/* ---------- Battlemap (maps/battlemap.js) ---------- */
.bm-root { position: absolute; inset: 0; overflow: hidden; background: #05070a; user-select: none; -webkit-user-select: none; }
.bm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.bm-loadscreen { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(ellipse at center, #0a1626, #04070c 75%); transition: opacity .5s; }
.bm-loadscreen.done { opacity: 0; pointer-events: none; }
.bm-lbox { width: min(360px, 70%); display: flex; flex-direction: column; gap: 14px; font: 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); text-align: center; }
.bm-ltitle { color: var(--ink); font-size: 14px; }
.bm-lbar { height: 6px; border-radius: 3px; background: #14263a; overflow: hidden; }
.bm-lfill { height: 100%; width: 0; background: var(--accent, #4fd8ff); box-shadow: 0 0 10px var(--accent, #4fd8ff); transition: width .25s; }
.bm-llabel { letter-spacing: .12em; font-size: 11px; min-height: 1.2em; }
.bm-readout { position: fixed; z-index: 30; padding: 3px 9px; border: 1px solid var(--line); border-radius: 4px; background: #04101ce6; font: 12px var(--mono); letter-spacing: .08em; color: var(--ink); pointer-events: none; white-space: nowrap; }
.bm-tools { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: grid; gap: 6px; z-index: 5; }
.bm-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #04101ccc; color: var(--ink); cursor: pointer; font-size: 17px; line-height: 1; }
.bm-btn:hover { border-color: var(--accent); color: var(--accent); }
.bm-btn.on { border-color: var(--accent); color: var(--accent); }
.bm-panel { position: absolute; right: 12px; top: 72px; width: 250px; max-height: calc(100% - 140px); overflow: auto; padding: 12px; z-index: 5;
  display: grid; gap: 10px; align-content: start; border: 1px solid var(--line); border-radius: 6px; background: #050d16e6; backdrop-filter: blur(4px); font-size: 13px; }
.bm-panel h3 { margin: 0; font: 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.bm-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-pbtn { padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: #04101c; color: var(--ink); cursor: pointer; font-size: 12px; }
.bm-pbtn:hover { border-color: var(--accent); color: var(--accent); }
.bm-pbtn.danger:hover { border-color: var(--warn); color: var(--warn); }
.bm-pbtn.quiet { opacity: .7; justify-self: start; }
.bm-list { display: grid; gap: 3px; max-height: 190px; overflow: auto; }
.bm-item { text-align: left; padding: 4px 8px; border: 1px solid transparent; border-left: 3px solid var(--c, var(--accent)); background: #04101c; color: var(--ink); cursor: pointer; font-size: 12px; border-radius: 3px; }
.bm-item.sel { border-color: var(--c, var(--accent)); background: #0a1d2e; }
.bm-item.hid { opacity: .6; font-style: italic; }
.bm-edit { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.bm-edit label { display: grid; gap: 3px; font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.bm-edit input, .bm-edit select { padding: 5px 8px; font-size: 13px; }
.bm-edit input[type=color] { height: 30px; padding: 1px; }
.bm-edit .bm-check { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font: 12px system-ui, sans-serif; color: var(--ink); }
.bm-edit .bm-check input { width: auto; }
@media (max-width: 760px) { .bm-panel { top: auto; bottom: 70px; width: min(250px, calc(100% - 70px)); max-height: 45%; } }
.bm-pal { display: grid; gap: 4px; }
.bm-pal > b { font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 400; }
.bm-pbtn.on, .bm-pbtn.done { border-color: var(--accent); color: var(--accent); }
.bm-hint { margin: 0; font-size: 11px; line-height: 1.45; color: var(--dim); }
.bm-edit .bm-lab { display: flex; justify-content: space-between; }
.bm-edit input[type=range] { padding: 0; width: 100%; }
.bm-panel .bm-check { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font: 12px system-ui, sans-serif; color: var(--ink); }
.bm-panel .bm-check input { width: auto; padding: 0; }

/* Battlemap: Objektleiste unten */
.bm-palbar { position: absolute; left: 60px; right: 274px; bottom: 12px; z-index: 6; display: grid; gap: 6px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 6px; background: #04101ce8; }
.bm-paltabs { display: flex; gap: 4px; flex-wrap: wrap; }
.bm-paltab { padding: 3px 10px; border: 1px solid var(--line); border-radius: 3px; background: #04101c; color: var(--dim); cursor: pointer; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.bm-paltab:hover { color: var(--ink); }
.bm-paltab.on { border-color: var(--accent); color: var(--accent); }
.bm-palstrip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.bm-palitem { flex: 0 0 auto; width: 84px; display: grid; gap: 3px; justify-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: #04101c; color: var(--ink); cursor: pointer; }
.bm-palitem:hover { border-color: var(--accent); }
.bm-palitem.on { border-color: var(--accent); background: #0a1d2e; }
.bm-palpic { width: 72px; height: 72px; display: grid; place-items: center; }
.bm-palimg { max-width: 100%; max-height: 100%; object-fit: contain; }
.bm-pallab { font-size: 11px; line-height: 1.2; text-align: center; max-width: 100%; }
@media (max-width: 760px) { .bm-palbar { left: 56px; right: 12px; bottom: 8px; } .bm-panel { bottom: 170px; } }

/* Battlemap: Aufbau-Reiter, Auswahlrahmen, Öffnungen */
.bm-band { position: absolute; z-index: 7; border: 1px dashed var(--accent); background: #4fd8ff22; pointer-events: none; }
.bm-palgap { flex: 1; }
.bm-paltab.struct { border-style: dashed; }
.bm-paltab:disabled { opacity: .35; cursor: default; }
.bm-palicon { font-size: 34px; line-height: 1; color: var(--accent); }
.bm-gap { display: grid; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.bm-gap > b { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 400; }

/* Regler mit −/+ */
.bm-rng { display: flex; align-items: center; gap: 4px; }
.bm-rng input[type=range] { flex: 1; min-width: 0; }
.bm-nudge { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #04101c; color: var(--ink); cursor: pointer; font: 15px/1 system-ui, sans-serif; }
.bm-nudge:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.bm-nudge:disabled { opacity: .35; cursor: default; }

/* Leistungsanzeige der Battlemap (F3 oder ?perf, nur Spielleitung) */
.bm-perf { position: absolute; left: 8px; top: 8px; z-index: 30; margin: 0; padding: 6px 8px; background: #000c; color: #7f7; font: 12px/1.35 monospace; pointer-events: none; white-space: pre; }

/* Battlemap: Aktionsleiste (Angriff mit der ausgerüsteten Waffe) */
.bm-actbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #04101cf0; max-width: calc(100% - 140px); }
.bm-actbar[hidden] { display: none; }
.bm-actname { color: var(--accent); font: 12px system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.bm-acthint { color: var(--ink); opacity: .75; font: 12px system-ui, sans-serif; }
.bm-act { font-size: 13px; border-color: var(--accent); }
.bm-actmod { opacity: .7; font-size: 11px; }

/* Lautstärkeregler links neben dem Chat-Knopf: der Knopf macht Platz (Breite aus --vol-w, gesetzt von music.js) */
#chat .chat-toggle { margin-left: calc(var(--vol-w, 44px) + 6px - 0px); transition: margin-left .22s ease; }

/* Chat: Porträt links neben der Box jeder Zeile, quadratisch (feste Kantenlänge: mit „so hoch wie die Box“ wurde es bei umbrechenden Zeilen riesig) */
.chat-entry { display: flex; align-items: stretch; gap: 6px; }
.chat-entry .chat-line { flex: 1; min-width: 0; }
.chat-portrait { flex: none; align-self: flex-start; width: 66px; height: 66px; overflow: hidden; border-radius: 6px; background: var(--c, var(--accent)); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  display: grid; place-items: center; color: #04131c; font: 700 11px var(--mono); text-transform: uppercase; }
.chat-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-line b.who { font-weight: 700; }
.bm-tgtip { position: absolute; z-index: 8; pointer-events: none; padding: 3px 8px; border: 1px solid #ff4d4d; border-radius: 4px; background: #1a0508e8; color: #ffd7d7; font: 12px system-ui, sans-serif; white-space: nowrap; }
.bm-tgtip[hidden] { display: none; }
.chat-line .nm { font: inherit; font-weight: 700; color: var(--ink); }      /* Namen in Angriffszeilen: fett, aber nicht größer als der Text (b in .roll ist die große Zahl) */

/* Initiative-Leiste der Battlemap (oben Mitte) */
.bm-init { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); z-index: 7; display: flex; align-items: flex-start; gap: 14px; padding: 4px 8px; max-width: calc(100% - 340px); text-shadow: 0 0 5px #000, 0 1px 3px #000; }
.bm-init[hidden] { display: none; }
.bm-icount { margin-top: 18px; display: flex; flex-direction: column; align-items: center; min-width: 46px; line-height: 1.1; }
.bm-icount small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.bm-icount b { font-size: 26px; }
.bm-irow { display: flex; align-items: center; gap: 8px; overflow: hidden; padding: 6px 10px 26px; }
.bm-ip { position: relative; flex: none; width: 46px; height: 46px; opacity: .8; }
.bm-ip.cur { width: 78px; height: 78px; opacity: 1; margin: 0 8px; }
.bm-ip.pend { opacity: .4; }
.bm-ipic { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--c); background: #0a1a2a center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-weight: 700; box-sizing: border-box; }
.bm-ip.cur .bm-ipic { border-width: 3px; box-shadow: 0 0 14px var(--c); }
.bm-ival { text-shadow: none; position: absolute; right: -4px; bottom: -4px; min-width: 20px; padding: 0 4px; border-radius: 9px; background: var(--c); color: #04101c; font-size: 12px; font-weight: 700; text-align: center; line-height: 18px; }
.bm-iname { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 5px; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.bm-ictl { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.bm-ihint { font-size: 12px; opacity: .7; }
.bm-initprompt { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 9; display: flex; flex-direction: column; gap: 10px; }
.bm-initprompt[hidden] { display: none; }
.bm-initprompt-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 26px; border: 1px solid var(--line); border-radius: 8px; background: #04101cf5; box-shadow: 0 10px 40px #000a; text-align: center; max-width: 340px; }
.bm-initprompt-card b { font-size: 18px; letter-spacing: .06em; }

/* Grafik-Optionsmenü (gfx.js) */
.gfx { display: flex; flex-direction: column; gap: 16px; }
.gfx-row { display: flex; flex-direction: column; gap: 6px; }
.gfx-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.gfx-choice { padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; background: #04101c; color: var(--ink); cursor: pointer; font-size: 13px; }
.gfx-choice.on { border-color: var(--accent); background: #0a2a3c; box-shadow: 0 0 0 1px var(--accent) inset; }
.gfx small { color: var(--dim); font-size: 12px; }
.gfx-note { margin: 0; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 4px; font-size: 13px; }
.gfx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Charakterfenster: Reiter und Vermächtnis (legacy.js) */
.char-tabs { padding: 0 22px 10px; }
.char-tabs button.on { border-color: color-mix(in srgb, var(--faction, var(--accent)) 60%, transparent); }
.legacy-pane { padding: 6px 22px 22px; display: grid; gap: 16px; justify-items: start; }
.legacy-intro { padding: 12px 14px 4px; background: #03080fcc; border: 1px solid color-mix(in srgb, var(--faction, var(--accent)) 35%, transparent); border-left: 3px solid var(--faction, var(--accent)); border-radius: 6px; }
.legacy-intro p { margin: 0 0 10px; line-height: 1.5; color: var(--ink); }
.lg-tree { position: fixed; inset: 0; z-index: 60; background: #090c11 var(--lg-bg, none) center / cover no-repeat; display: flex; justify-content: flex-end; }
.lg-tree::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(270deg, #050a10b0 0%, transparent 40%); }
.lg-side { position: relative; z-index: 1; width: min(34vw, 480px); padding: 12vh 4vw 0 0; text-align: right; }
.lg-title { font: 700 clamp(28px, 4vw, 56px) var(--mono); letter-spacing: .08em; color: var(--faction, var(--accent)); text-shadow: 0 2px 18px #000a; }
.lg-sub { margin-top: 4px; font: 13px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 8px #000a; }
.lg-text { margin-top: 24px; font: 14px/1.6 var(--mono); color: var(--ink); text-shadow: 0 1px 8px #000c; }
.lg-close { position: absolute; z-index: 2; top: 16px; right: 18px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #050d16cc; color: var(--ink); font-size: 18px; cursor: pointer; }
.lg-close:hover { border-color: var(--faction, var(--accent)); color: var(--faction, var(--accent)); }
.legacy-pane[hidden], .char-tabs-wrap > [hidden] { display: none !important; }


.lg-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Vermächtnisbaum (legacy.js, mountTree): Entwurfsgröße 900x560 px, per --s auf das Fenster skaliert */
.lg-treebox { position: absolute; z-index: 1; top: 7vh; width: 900px; height: 560px; transform-origin: 50% 0; transform: translateX(-50%) scale(var(--s, 1)); }
.lg-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lg-lines path { fill: none; stroke: var(--lc); stroke-width: var(--lw); stroke-linecap: round; filter: drop-shadow(0 0 5px var(--lg)); }
.lg-node { position: absolute; width: var(--sz); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 8px; cursor: default; }
.lg-node img { width: var(--sz); height: auto; display: block; filter: drop-shadow(0 4px 10px #000b); transition: transform .2s, filter .2s; }
.lg-node:hover img { transform: scale(1.06); filter: drop-shadow(0 4px 12px #000b) brightness(1.1); }
.lg-node span { position: absolute; top: 100%; margin-top: 8px; width: 190px; text-align: center; font: 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 8px #000c; }
.lg-node.kid img { opacity: .8; }
.lg-conn { position: absolute; height: auto; pointer-events: none; filter: drop-shadow(0 2px 6px #000a); }
.lg-node.root span { top: auto; bottom: 100%; margin: 0 0 8px; }

/* Zustände im Baum: freigeschaltet (on), gesperrt (locked) */
.lg-node.root, .lg-node.kid { cursor: pointer; }
.lg-conn:not(.on) { filter: brightness(.55) saturate(.6) drop-shadow(0 2px 6px #000a); }
.lg-conn.on { opacity: 0; transition: opacity .5s; animation: lg-pulse 3.2s ease-in-out infinite; }
@keyframes lg-pulse { 0%, 100% { filter: brightness(1) drop-shadow(0 0 10px #ff8a2a88); } 50% { filter: brightness(1.18) drop-shadow(0 0 18px #ffa04acc); } }
.lg-node { transition: opacity .3s; }
.lg-node.locked { opacity: .3; }
.lg-node.locked img { filter: grayscale(.7) brightness(.7); }
.lg-node.on img { filter: drop-shadow(0 0 10px #ff9a3acc) drop-shadow(0 0 26px #ff7a1a88) brightness(1.08); }
.lg-node.kid.on img { opacity: 1; }
.lg-conn.on { z-index: 1; } .lg-node { z-index: 2; }

/* Stromimpuls durch den leuchtenden Verbinder: heller Streifen läuft von oben nach unten, dann Pause (Dauer: --lg-flow) */
.lg-conn.flow { z-index: 1; opacity: 0; transition: opacity .5s; animation: lg-flow 2.8s linear infinite;
  filter: brightness(2.1) saturate(.55) drop-shadow(0 0 8px #fff8e0aa);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 43%, #000 47%, transparent 51%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, transparent 43%, #000 47%, transparent 51%, transparent 100%);
  -webkit-mask-size: 100% 300%; mask-size: 100% 300%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
@keyframes lg-flow { 0% { -webkit-mask-position: 50% 72%; mask-position: 50% 72%; } 60% { -webkit-mask-position: 50% 20%; mask-position: 50% 20%; } 100% { -webkit-mask-position: 50% 20%; mask-position: 50% 20%; } }
@media (prefers-reduced-motion: reduce) { .lg-conn.flow, .lg-conn.on { animation: none; } }

/* Vermächtnis: Infofenster rechts, Freischalten-Knopf mit lila Rahmen, Zurücksetzen (nur Testseite) */
.lg-side { width: min(30vw, 440px); }
.lg-info { margin-top: 22px; text-align: left; }
.lg-info-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lg-info-head img { width: 56px; height: auto; filter: drop-shadow(0 3px 8px #000b); }
.lg-info-title { font: 700 16px/1.3 var(--mono); letter-spacing: .06em; color: var(--ink); text-shadow: 0 1px 8px #000c; }
.lg-info-sub { margin-top: 2px; font: 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faction, var(--accent)); text-shadow: 0 1px 8px #000c; }
.lg-info-label { margin-top: 14px; font: 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); text-shadow: 0 1px 6px #000c; }
.lg-info .lg-text { margin: 6px 0 0; }
.lg-bonus { margin: 6px 0 0; padding: 10px 12px; font: 14px/1.5 var(--mono); color: var(--ink); background: #050d16b8; border-left: 3px solid var(--faction, var(--accent)); border-radius: 4px; backdrop-filter: blur(3px); }
.lg-unlock { margin-top: 22px; display: grid; gap: 6px; justify-items: start; }
.lg-unlock small { font: 11px var(--mono); letter-spacing: .12em; color: var(--dim); text-shadow: 0 1px 6px #000c; }
.lg-hold { position: relative; padding: 12px 26px; font: 700 14px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); cursor: pointer; user-select: none; touch-action: none;
  background: #0a1220d0; border: 1px solid #ffffff22; border-radius: 8px; backdrop-filter: blur(3px); }
.lg-hold:hover { border-color: #b06cff66; }
.lg-hold-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lg-hold-ring rect { width: calc(100% - 3px); height: calc(100% - 3px); fill: none; stroke: #b06cff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 6px #b06cffcc); }
.lg-hold.holding .lg-hold-ring rect { animation: lg-hold var(--hold-ms, 2.5s) linear forwards; }
.lg-hold.holding { color: #fff; background: #1a1030d8; }
@keyframes lg-hold { to { stroke-dashoffset: 0; } }
.lg-done { margin-top: 22px; font: 700 14px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ffb04a; text-shadow: 0 0 12px #ff8a2a88; }
.lg-blocked { margin-top: 22px; font: 13px/1.5 var(--mono); color: var(--dim); text-shadow: 0 1px 6px #000c; }
.lg-reset { position: absolute; z-index: 2; top: 20px; left: 20px; padding: 8px 14px; font: 12px var(--mono); letter-spacing: .1em; color: var(--warn); background: #050d16cc; border: 1px solid var(--warn); border-radius: 6px; cursor: pointer; }
.lg-node.sel img { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 14px #ffffff88); }
.lg-node.on.sel img { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 14px #ff9a3acc) drop-shadow(0 0 26px #ff7a1a88); }

/* Verbrannte Seite rechts (legacy.js): Bild unter dem Loch, Papier darüber, Text auf dem heilen Papier */
.lg-side { position: absolute; z-index: 2; top: 2.4vh; right: 3.2vw; width: auto; padding: 0; text-align: right; }
.lg-title { font-size: clamp(22px, 2.6vw, 38px); }
@keyframes lg-page-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* Seite ganzflächig im rechten Drittel (Oberkante und Unterkante des Rahmens außerhalb des Bildschirms), Titel links oben */
.lg-side { left: 3.2vw; right: auto; text-align: left; }
.lg-reset { top: auto; bottom: 20px; }
/* neuer Rahmen (9:16, kleineres Loch): mehr Platz für den Text, Schrift wächst mit der Fensterhöhe */

/* ---- Stile der Erbe-Anzeige ---- */
.lg-trim { position: relative; background: #070c13e8; backdrop-filter: blur(4px); border: 2px solid transparent;
  border-image: linear-gradient(135deg, #7a3f18, #dc9458 32%, #a8571f 58%, #e8b080 82%, #8a4a1c) 1;   /* schmaler Bronzerand wie die innere Kontur der Medaillons */
  box-shadow: 0 0 0 1px #000a, 0 6px 22px #0009, inset 0 0 0 1px #ffc89622, inset 0 0 14px #b4642a22; }

/* dissolve */

/* holo */

/* medal */
.lgm { position: absolute; z-index: 1; right: 2vw; top: 3vh; bottom: 3vh; width: 29vw; display: flex; flex-direction: column; align-items: center; gap: 2vh; }
.lgm-medal { position: relative; flex: none; width: min(26vw, 46vh); aspect-ratio: 687 / 691; filter: drop-shadow(0 10px 26px #000c); }
.lgm-art { position: absolute; left: 8.3%; top: 8.4%; width: 83.4%; height: 83.1%; border-radius: 50%; overflow: hidden; background: #0a0d12; }
.lgm-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .55s; }
.lgm-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lgm-medal.pop { animation: lgm-pop .6s ease-out; }
@keyframes lgm-pop { 0% { transform: scale(.94); filter: drop-shadow(0 0 0 #ffb04a00); } 45% { transform: scale(1.02); filter: drop-shadow(0 0 28px #ffb04a88); } 100% { transform: none; } }
.lgm-plate { width: 100%; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px 16px; scrollbar-width: thin; }
.lgm-plate .lg-info { margin-top: 0; }

/* medalburn: verbrannte Seite im Medaillon, Bild nur durchs Loch */
.lgm-art.burn { background: #d9c9a0; }
.lgm-hole { position: absolute; overflow: hidden; background: #0a0d12; }
.lgm-hole img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .55s; }
.lgm-paper { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: lgm-ember 4.2s ease-in-out infinite; }
@keyframes lgm-ember { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.07) saturate(1.08); } }

/* Anzeige rechts erst nach der ersten Auswahl; Medaillon-Stile schmaler */
.lg-reveal { transition: opacity .6s ease, transform .6s ease; }
.lg-away { opacity: 0; transform: translateX(40px); pointer-events: none; }
.lgm { width: 22vw; right: 2.2vw; }
.lgm-medal { width: min(19vw, 40vh); }

/* Titel des Erbes: Füllerschrift auf Pergamentplatte (plaque.webp aus dem Papier der verbrannten Seite, Schrift Pinyon Script, OFL) */
@font-face { font-family: 'NeosPen'; src: url(/fonts/PinyonScript-Regular.ttf) format('truetype'); font-display: swap; }
.lg-plaque { margin: 0 -6px 12px; padding: 22px 30px 24px; text-align: center; background: url(/img/legacy/plaque.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 10px #0009); }
.lg-plaque .lg-info-title { font: 400 clamp(28px, 3.9vh, 48px) / 1.08 'NeosPen', 'Brush Script MT', 'Segoe Script', cursive; letter-spacing: 0; color: #2c1c08; text-shadow: none; }
.lg-plaque .lg-info-sub { margin-top: 6px; font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #7a4a1a; text-shadow: none; }
/* neue Pergamentplatte (Nano Banana, plaque_src.webp): etwas mehr Luft und dunklere Tinte */
.lg-plaque { padding: 30px 38px 32px; margin: 0 -10px 12px; }
.lg-plaque .lg-info-title { color: #1c0f04; }
.lg-plaque .lg-info-sub { color: #5a3410; }

/* Titel direkt auf dem Hintergrund (Caveat, weiß), die Box darunter blendet von oben her ein */
@font-face { font-family: 'NeosCaveat'; src: url(/fonts/Caveat-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
.lg-trim { background: none; border: 0; border-image: none; box-shadow: none; backdrop-filter: none; isolation: isolate; }
.lg-trim::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #070c13e8; backdrop-filter: blur(4px);
  border: 2px solid transparent; border-image: linear-gradient(135deg, #7a3f18, #dc9458 32%, #a8571f 58%, #e8b080 82%, #8a4a1c) 1;
  box-shadow: inset 0 0 0 1px #ffc89622, inset 0 0 14px #b4642a22;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 clamp(90px, 15vh, 150px)); mask-image: linear-gradient(180deg, transparent 0, #000 clamp(90px, 15vh, 150px)); }
.lg-plaque { background: none; filter: none; margin: 0 0 8px; padding: 0 0 6px; }
.lg-plaque .lg-info-title { font: 700 clamp(36px, 5.2vh, 62px) / 1.05 'NeosCaveat', 'Caveat', 'Segoe Script', cursive; color: #fff; text-shadow: 0 2px 14px #000, 0 0 4px #000b; }
.lg-plaque .lg-info-sub { color: #d5dfe8; text-shadow: 0 1px 8px #000, 0 0 3px #000b; margin-top: 4px; }

/* Pergamentplatte (Titel) steht für sich über der Box, ohne Rahmen; die Box beginnt erst darunter. Schrift Caveat, dunkle Tinte auf dem Pergament */
.lg-trim { background: #070c13e8; backdrop-filter: blur(4px); border: 2px solid transparent;
  border-image: linear-gradient(135deg, #7a3f18, #dc9458 32%, #a8571f 58%, #e8b080 82%, #8a4a1c) 1;
  box-shadow: 0 0 0 1px #000a, 0 6px 22px #0009, inset 0 0 0 1px #ffc89622, inset 0 0 14px #b4642a22; isolation: auto; }
.lg-trim::before { content: none; }
.lg-head { flex: none; }
.lg-head:empty { display: none; }
.lg-plaque { margin: 0 -8px 10px; padding: 28px 36px 30px; text-align: center; background: url(/img/legacy/plaque.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 5px 12px #000a); }
.lg-plaque .lg-info-title { font: 700 clamp(32px, 4.6vh, 56px) / 1.05 'NeosCaveat', 'Caveat', 'Segoe Script', cursive; color: #1c0f04; text-shadow: 0 1px 0 #ffffff33; }
.lg-plaque .lg-info-sub { color: #4a2a0c; text-shadow: none; margin-top: 4px; }
.lgm-plate { padding: 0; overflow: visible; display: flex; flex-direction: column; min-height: 0; }
.lgm-box { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px 16px; scrollbar-width: thin; }

/* Buchtitel-Stil (Cinzel + Cormorant kursiv), dunkle Tinte auf dem Pergament; die Platte überlappt den oberen Rand der Box */
@font-face { font-family: 'NeosCinzel'; src: url(/fonts/Cinzel-latin.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'NeosCormorant'; src: url(/fonts/CormorantGaramond-italic-latin.woff2) format('woff2'); font-style: italic; font-weight: 300 700; font-display: swap; }
.lg-plaque { position: relative; z-index: 2; margin: 0 -10px -34px; padding: 30px 40px 34px; }
.lg-ttl { text-align: center; }
.lg-ttl-pre { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 2px; }
.lg-ttl-pre i { flex: none; width: clamp(18px, 2.4vh, 34px); height: 1.5px; background: #3a1f06; opacity: .8; }
.lg-ttl-pre span { font: italic 700 clamp(17px, 2.5vh, 30px) / 1 'NeosCormorant', 'Palatino Linotype', Georgia, serif; color: #3a1f06; text-shadow: 0 1px 0 #ffe9b866; }
.lg-ttl-main { font: 800 clamp(22px, 3.2vh, 40px) / 1.08 'NeosCinzel', 'Trajan Pro', 'Palatino Linotype', Georgia, serif; letter-spacing: .07em; text-transform: uppercase; color: #2c1604; text-shadow: 0 1px 0 #ffe9b877, 0 0 10px #ffd58a33; }
.lg-trim > .lg-info-sub, .lgd-box > .lg-info-sub, .lgm-box > .lg-info-sub { }
.lg-info > .lg-info-sub { margin: 0 0 4px; padding-top: 18px; text-align: center; font: 11px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: #dc9458; text-shadow: none; }
.lg-info > .lg-info-sub { padding-top: 36px; }   /* Platte überlappt den Boxrand um 34 px: Untergruppe beginnt darunter */
/* Textbox: dunkles Pergament mit dem Zeichenfeld darüber (box_bg.webp, nahtlos kachelbar, 1200x1176) */
.lg-trim { background: url(/img/legacy/box_bg.webp) 0 0 / 1200px auto repeat, #070c13; backdrop-filter: none; }
/* Untergruppe statt Artikel; Übergang Pergament -> Box: Papierton und Glut laufen von oben in die Box hinein */
.lg-info { padding-top: 0; }
.lg-info > .lg-info-sub { display: none; }
.lg-ttl-pre span { font-size: clamp(15px, 2.1vh, 26px); letter-spacing: .02em; }
.lg-plaque { filter: drop-shadow(0 6px 10px #b4642a66) drop-shadow(0 2px 4px #000a); }
.lg-trim { isolation: isolate; }
.lg-trim::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: clamp(70px, 11vh, 120px); z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #b0824acc 0, #7a572e88 30%, #4a361d33 65%, transparent 100%); }
.lg-trim::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: -1; pointer-events: none; background: linear-gradient(90deg, transparent, #ff8a2a66 20%, #ffb04a99 50%, #ff8a2a66 80%, transparent); filter: blur(2px); }

/* Fehlerbehebung: das ::before der Box erbte Rand, Maske und Schatten der verworfenen Fassung (ergab eine zweite Box im Kasten) */
.lg-trim::before { inset: auto; border: 0; border-image: none; box-shadow: none; -webkit-mask-image: none; mask-image: none; backdrop-filter: none; border-radius: 0; padding: 0; }
.lg-trim::after { border: 0; border-image: none; box-shadow: none; border-radius: 0; inset: auto; }
/* Rußkante: verkohlte Zacken hängen vom Pergament in die Box (soot.webp aus Nano Banana, weißer Grund -> Deckkraft aus der Dunkelheit) */
.lg-trim::after { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 0; padding-top: 16.4%; z-index: -1; pointer-events: none; filter: none;
  background: url(/img/legacy/soot.webp) center top / 100% 100% no-repeat; }

/* Pergament mit Rußkante als EIN Bild (plaque_soot.webp, Seitenverhältnis 2,63:1, Papier bis ~50-60 % der Höhe): die Box beginnt hinter dem Papier,
   der Ruß hängt über der Box. Das frühere Papierton-Verlauf-/Ruß-Overlay der Box entfällt. */
.lg-trim::before, .lg-trim::after { content: none; }
.lg-plaque { position: relative; z-index: 2; margin: 0 -12px -20.2%; padding: 0; aspect-ratio: 2.6266; filter: none; background: url(/img/legacy/plaque_soot.webp) center / 100% 100% no-repeat; }
.lg-plaque .lg-ttl { position: absolute; left: 8%; right: 8%; top: 5%; height: 42%; display: flex; flex-direction: column; justify-content: center; }
.lg-ttl-pre span { font-size: clamp(13px, 1.8vh, 22px); }
.lg-ttl-main { font-size: clamp(16px, 2.3vh, 30px); letter-spacing: .05em; }

/* medalburn: komplettes Medaillon mit Brandloch (medal_full.webp) */
.lgm-medal.burnfull { aspect-ratio: 1023 / 1024; }
.lgm-full { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: lgm-ember 4.2s ease-in-out infinite; }

/* Glut am Rand des Pergaments glüht unregelmäßig auf: plaque_embers.webp (nur die Glutränder, additiv) in drei Bereichen mit eigenem Takt */
.lg-ember { position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: url(/img/legacy/plaque_embers.webp) center / 100% 100% no-repeat; animation: lg-glow 6s ease-in-out infinite; }
.lg-ember.e1 { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 34%, transparent 46%); mask-image: linear-gradient(90deg, #000 0, #000 34%, transparent 46%); animation-duration: 5.6s; animation-delay: -1.2s; }
.lg-ember.e2 { -webkit-mask-image: linear-gradient(90deg, transparent 24%, #000 38%, #000 62%, transparent 76%); mask-image: linear-gradient(90deg, transparent 24%, #000 38%, #000 62%, transparent 76%); animation-duration: 7.4s; animation-delay: -3.4s; }
.lg-ember.e3 { -webkit-mask-image: linear-gradient(90deg, transparent 54%, #000 66%, #000 100%); mask-image: linear-gradient(90deg, transparent 54%, #000 66%, #000 100%); animation-duration: 6.5s; animation-delay: -2.1s; }
@keyframes lg-glow { 0%, 100% { opacity: .1; } 10% { opacity: .16; } 16% { opacity: .85; } 22% { opacity: .3; } 27% { opacity: .65; } 38% { opacity: .14; } 64% { opacity: .12; } 72% { opacity: .55; } 80% { opacity: .18; } }
@media (prefers-reduced-motion: reduce) { .lg-ember { animation: none; opacity: .2; } }

/* Zitatblock: historische Anekdote je Zweig, direkt unter dem Pergament (füllt die Lücke unter dem Ruß) */
.lg-quote { margin: 0 0 14px; padding: 4px 0 2px 14px; border-left: 2px solid #b4642acc; }
.lg-quote p { margin: 0; font: italic 500 clamp(14px, 1.75vh, 19px) / 1.45 'NeosCormorant', 'Palatino Linotype', Georgia, serif; color: #e3d3b0; text-shadow: 0 1px 6px #000a; }
.lg-quote cite { display: block; margin-top: 6px; font: normal 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #dc9458; }
.lg-quote cite::before { content: '— '; }

/* Text steht vor dem Ruß und der Glut des Pergaments: die Box bildet keinen eigenen Stapel mehr (Hintergrund bleibt unter der Platte), ihr Inhalt liegt darüber */
.lg-trim { isolation: auto; }
.lg-info { position: relative; z-index: 3; }
.lg-quote p, .lg-text, .lg-bonus { text-shadow: 0 1px 8px #000d, 0 0 3px #000b; }

/* Einzelpunkt unter den Folgeknoten, gespiegelter Verbinder, Sprunglinie */
.lg-connwrap { position: absolute; pointer-events: none; }
.lg-connwrap.flip { transform: scaleY(-1); }
.lg-connwrap.flip .lg-conn.flow { animation-direction: reverse; }
.lg-lines { z-index: 1; }
.lg-lines path.lit { stroke: #eaf3ff; stroke-width: 4; filter: drop-shadow(0 0 8px #9cc8ffd0); }   /* freigeschaltete einfache Linie (bei drei Optionen in der zweiten Reihe) */
.lg-lines path.jump { stroke: #ffb04a; stroke-width: 3; stroke-dasharray: 14 10; stroke-linecap: round; filter: drop-shadow(0 0 7px #ff8a2acc); animation: lg-dash 1.1s linear infinite; }
@keyframes lg-dash { to { stroke-dashoffset: -24; } }
.lg-node.third { }
.lg-node.third span { width: 150px; }
.lg-note { margin: 4px 0 10px; padding: 8px 12px; border-left: 2px solid #ffb04a; background: #2a160866; color: #f3d9a8; font: 12px/1.45 var(--mono); }
@media (prefers-reduced-motion: reduce) { .lg-lines path.jump { animation: none; } }
.lg-treebox { height: 720px; }

/* Ring des großen Medaillons dreht sich langsam (eine Umdrehung in --lg-spin) */
.lgm-spin { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform-origin: 50% 50%; }
.lgm-spin, .lgm-ring { animation: lgm-rot var(--lg-spin, 120s) linear infinite; }
.lgm-ring { transform-origin: 50% 50%; }
@keyframes lgm-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lgm-spin, .lgm-ring { animation: none; } }

/* Titel der Medaillen im Baum: kleine Plakette unten über dem Medaillon, Hintergrund und Rahmen wie die Textbox */
.lg-node span, .lg-node.root span, .lg-node.third span { position: absolute; top: auto; bottom: 4px; left: 50%; margin: 0; transform: translateX(-50%); width: max-content; max-width: 96%; box-sizing: border-box; padding: 4px 9px 3px; z-index: 3; text-align: center; white-space: normal;
  font: 10px/1.25 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #e8d6b0; text-shadow: 0 1px 4px #000c;
  background: url(/img/legacy/box_bg.webp) 0 0 / 1200px auto repeat, #070c13; border: 2px solid transparent;
  border-image: linear-gradient(135deg, #7a3f18, #dc9458 32%, #a8571f 58%, #e8b080 82%, #8a4a1c) 1;
  box-shadow: 0 0 0 1px #000a, 0 4px 12px #000a, inset 0 0 0 1px #ffc89622; pointer-events: none; }
/* Plaketten kleiner: überdecken nur den unteren Rand des Medaillons */
.lg-node span, .lg-node.root span, .lg-node.third span { bottom: -7px; max-width: 120%; padding: 2px 6px 1px; font-size: 7.5px; line-height: 1.2; letter-spacing: .06em; border-width: 1px; white-space: nowrap; }
.lg-node span, .lg-node.root span, .lg-node.third span { max-width: none; }

/* Letzte Punkte: großer goldener Schein um die Medaille, pulsiert */
.lgm-medal.final { animation: lg-goldglow 2.8s ease-in-out infinite; }
@keyframes lg-goldglow {
  0%, 100% { filter: drop-shadow(0 0 10px #ffb83a66) drop-shadow(0 0 26px #ff9a2a44); }
  50% { filter: drop-shadow(0 0 20px #ffd36acc) drop-shadow(0 0 56px #ffb83a88); }
}
@media (prefers-reduced-motion: reduce) { .lgm-medal.final { animation: none; filter: drop-shadow(0 0 18px #ffd36a99) drop-shadow(0 0 40px #ffb83a66); } }
.lgm-medal.final.pop { animation: lgm-pop .6s ease-out, lg-goldglow 2.8s ease-in-out infinite; }

/* Blaupausen-Skizze neben dem Startsymbol: nur Linien, wie auf den Hintergrund gezeichnet */
.lg-sketch { position: absolute; z-index: 0; width: auto; transform: translate(-50%, -50%); opacity: .7; pointer-events: none; mix-blend-mode: screen; filter: drop-shadow(0 0 6px #6aa8ff55); }
.lg-sketch.solid { mix-blend-mode: normal; filter: drop-shadow(0 0 2px #0008) drop-shadow(0 0 5px #0005); }   /* auf hellem Hintergrund: ohne Screen-Mischung, mit dunklem Saum */

/* Vermächtnis-Übersicht (legacyboard.js): je Spieler eine waagerechte Leiste, KI-Übergänge zwischen den Medaillons */
.lb { position: fixed; inset: 0; z-index: 60; overflow-y: auto; padding: 4vh 3vw 6vh; background: radial-gradient(ellipse at 50% 0, #121a24 0%, #07090d 70%); color: var(--ink);
  --rh: clamp(120px, 21vh, 200px); --cl: calc(var(--rh) * 487 / 768); --st: calc(var(--rh) * 1225 / 768); --cr: calc(var(--rh) * 484 / 768); --ring: calc(var(--rh) * 720 / 768); }
.lb header h2 { margin: 0; font: 700 clamp(22px, 3vw, 38px) var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.lb header p { margin: 4px 0 0; font: 13px var(--mono); letter-spacing: .2em; text-transform: uppercase; opacity: .6; }
.lb-list { display: flex; flex-direction: column; gap: 18px; margin-top: 3vh; }
.lb-empty { font: 14px var(--mono); opacity: .6; }
.lb-row { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; }
.lb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-who .avatar { flex: none; }
.lb-who b { display: block; font: 700 15px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who small { display: block; font: 11px var(--mono); letter-spacing: .06em; color: var(--faction); }
.lb-who em { font-style: normal; opacity: .5; }
.lb-row.me .lb-who b::after { content: ' (du)'; font-weight: 400; opacity: .6; }
.lb-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 10px; scrollbar-width: thin; }
.lb-strip { position: relative; height: var(--rh); width: calc(var(--cl) + 4 * var(--st) + var(--cr)); min-width: 100%; border-radius: 10px;
  background: linear-gradient(180deg, #0c1219, #090d12); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 0 40px #00000080; }
.lb-piece { position: absolute; z-index: 0; top: 0; height: 100%; width: var(--st); object-fit: cover; pointer-events: none; user-select: none; }
.lb-piece.cap { width: var(--cl); }
.lb-piece.cap.l { left: 0 !important; -webkit-mask-image: linear-gradient(90deg, transparent, #000 75%); mask-image: linear-gradient(90deg, transparent, #000 75%); }
.lb-piece.cap.r { width: var(--cr); -webkit-mask-image: linear-gradient(90deg, #000 25%, transparent); mask-image: linear-gradient(90deg, #000 25%, transparent); }
.lb-link { position: absolute; z-index: 1; top: 50%; width: var(--st); height: 0; border-top: 2px dashed color-mix(in srgb, var(--faction) 55%, transparent); opacity: .7; }
.lb-node { position: absolute; z-index: 2; top: 50%; width: var(--ring); height: var(--ring); transform: translate(-50%, -50%); }
.lb-node img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 10px #000a); user-select: none; }
.lb-node span { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); max-width: 88%; padding: 2px 9px; border-radius: 999px; background: #05080dcc; border: 1px solid color-mix(in srgb, var(--faction) 55%, transparent);
  font: 600 11px var(--mono); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-ghost { position: absolute; top: 50%; width: var(--ring); height: var(--ring); transform: translate(-50%, -50%) scale(.78); border-radius: 50%; border: 2px dashed #ffffff26; display: grid; place-items: center; font: 700 28px var(--mono); color: #ffffff30; }
.lb-break { position: absolute; top: 8%; bottom: 8%; width: 18px; transform: translateX(-50%); display: grid; place-items: center; color: var(--faction); font-size: 22px; text-shadow: 0 0 10px var(--faction);
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--faction) 70%, transparent) 0 6px, transparent 6px 12px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 40% 60%, transparent); mask-image: linear-gradient(90deg, transparent, #000 40% 60%, transparent); }
.lb-break span { background: #090d12; padding: 4px 0; }
@media (max-width: 720px) { .lb-row { grid-template-columns: 1fr; } }

/* Vermächtnis-Übersicht: Klick auf ein Medaillon (Medaillon links, Plakette und Text rechts) */
.lb-node { cursor: pointer; transition: transform .15s; }
.lb-node:hover { transform: translate(-50%, -50%) scale(1.04); }
.lb-modal { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: #04070bd9; backdrop-filter: blur(5px); }
.lb-modal-in { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 4vw, 64px); width: min(1200px, 94vw); max-height: 94vh; overflow-y: auto; padding: 2vh 1vw; }
.lb-modal .lgm-medal { flex: none; width: min(34vw, 56vh); }
.lb-modal .lgm-plate { flex: 1 1 0; min-width: 0; max-width: 560px; display: flex; flex-direction: column; }
@media (max-width: 820px) { .lb-modal-in { flex-direction: column; } .lb-modal .lgm-medal { width: min(70vw, 40vh); } }
