/* DnD-Tisch im Browser – Glut & Pergament auf dunklem Holz */
:root {
  --bg: #0e0b09; --bg2: #16110d; --panel: #1e1813; --panel2: #272019; --line: #3a2f24; --lineGold: rgba(217,164,65,.35);
  --ink: #efe4cf; --muted: #a8977c; --faint: #6e604d; --gold: #d9a441; --goldLight: #f3cf7a; --ember: #e2763a; --arcane: #6fa8dc;
  --danger: #e05a4a; --success: #6bd18a; --warn: #f1c232; --parchment: #e9d8b4; --parchmentInk: #2a1c10;
  --serif: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', Palatino, Georgia, serif;
  --tabs: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font: inherit; }
img { max-width: 100%; }

/* ---------- Grundgerüst ---------- */
#board { position: fixed; inset: 0; width: 100vw; height: 100dvh; touch-action: none; display: block; background: var(--bg); }
#dice3d { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 45; }
#hud { position: fixed; inset: 0 0 calc(var(--tabs) + var(--safe-b)) 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#page { position: fixed; inset: 0 0 calc(var(--tabs) + var(--safe-b)) 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; z-index: 12;
  background: linear-gradient(180deg, #21170f, var(--bg) 60%); padding-top: var(--safe-t); }
#page.show { display: block; }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; z-index: 20;
  background: var(--bg2); border-top: 1px solid var(--line); }
#tabs:empty { display: none; }
#tabs button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; opacity: .7; }
#tabs button .ti { font-size: 20px; }
#tabs button .tl { font-size: 10px; color: var(--muted); font-family: var(--serif); letter-spacing: .03em; }
#tabs button.on { opacity: 1; }
#tabs button.on .tl { color: var(--gold); }
#tabs button.on::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
#offline { position: fixed; top: calc(var(--safe-t) + 6px); left: 50%; transform: translate(-50%, -60px); z-index: 90; background: #3a1714; border: 1px solid var(--danger);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; transition: transform .3s; pointer-events: none; }
#offline.show { transform: translate(-50%, 0); }

.pagec { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.title { font-family: var(--serif); color: var(--gold); font-size: 26px; letter-spacing: .04em; margin: 4px 0; font-weight: 700; }
.h2 { font-family: var(--serif); color: var(--ink); font-size: 17px; letter-spacing: .04em; margin: 18px 0 8px; font-weight: 700; }
.p { margin: 4px 0; }
.p.small, .small { font-size: 13px; line-height: 1.35; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); } .gold-light { color: var(--goldLight); } .arcane { color: var(--arcane); } .ember { color: var(--ember); }
.success { color: var(--success); } .danger { color: var(--danger); }
.big { font-size: 18px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.center-row { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 22px; }
.indent { margin-left: 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.empty { text-align: center; padding: 30px 10px; }
.empty-ic { font-size: 44px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.hscroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; }

/* ---------- Knöpfe, Chips, Karten ---------- */
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #e9a94a, #b9741e); color: #1a120c; transition: transform .1s, filter .15s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .4; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.flex { flex: 1; }
.btn.block { display: flex; width: 100%; }
.btn.subtle { background: linear-gradient(180deg, var(--panel2), var(--panel)); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--lineGold); }
.btn.danger { background: linear-gradient(180deg, #e8705f, #a8352a); }
.btn.arcane { background: linear-gradient(180deg, #7db4e8, #3f6fa3); }
.btn .ic { font-size: 1.05em; }
.chip { border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.small { padding: 5px 10px; font-size: 13px; }
.chip.on { border-color: var(--c, var(--gold)); background: color-mix(in srgb, var(--c, var(--gold)) 22%, transparent); color: var(--ink); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0; position: relative; }
.card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent, transparent); }
.card.tap { cursor: pointer; transition: transform .1s, border-color .2s; }
.card.tap:active { transform: scale(.985); }
.card.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.card.off { opacity: .45; }
.card.inner { background: var(--panel2); }
.card b { font-weight: 800; }
.cname { font-size: 19px; font-weight: 800; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 10px 0; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-weight: 700; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--panel2); color: var(--goldLight); box-shadow: 0 0 0 1px var(--lineGold) inset; }
.stepper { display: inline-flex; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.stepper button { width: 36px; height: 34px; border: 0; background: none; font-size: 18px; font-weight: 800; }
.stepper button:disabled { opacity: .3; }
.stepper span { min-width: 42px; text-align: center; font-weight: 800; }
.field { display: block; margin: 8px 0; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea, .numinput { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 11px 13px; font-size: 16px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 90px; }
.stats { display: flex; gap: 6px; }
.stat { flex: 1; text-align: center; background: var(--bg2); border-radius: 10px; padding: 8px 4px; border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--serif); font-size: 20px; }
.stat small { color: var(--muted); font-size: 11px; }
.hpbar { position: relative; height: 22px; background: var(--bg2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); margin-top: 8px; }
.hpfill { position: absolute; inset: 0 auto 0 0; transition: width .4s; opacity: .85; }
.hpbar span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 800; line-height: 22px; text-shadow: 0 1px 2px #000; }
.progress { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--gold); transition: width .3s; }
.pips { letter-spacing: 2px; color: var(--c, var(--gold)); } .pips i { font-style: normal; opacity: .3; }
.portrait { border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); border: 2px solid #f5ead2; flex: none; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.pp-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pp-wrap.busy { opacity: .5; }
.pp-actions { display: flex; gap: 6px; }
.logo { margin: 8px auto; filter: drop-shadow(0 0 24px rgba(217,164,65,.45)); animation: float 2.4s ease-in-out infinite alternate; }
.logo.spin svg { animation: spin 1.4s linear infinite; }
@keyframes float { to { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sheets ---------- */
#sheets { position: relative; z-index: 60; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 720px; background: var(--panel); border: 1px solid var(--lineGold); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 8px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.9,.3,1); }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grabber { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 8px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sheet-title { flex: 1; font-family: var(--serif); color: var(--gold); font-size: 19px; font-weight: 700; }
.sheet-x { border: 0; background: var(--panel2); border-radius: 50%; width: 32px; height: 32px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.fixed-sheet { z-index: 70; }

/* ---------- Spieltisch ---------- */
.hud-top { position: absolute; left: 10px; right: 10px; top: calc(var(--safe-t) + 8px); display: flex; flex-direction: column; gap: 6px; pointer-events: none !important; }
.hud-top > * { pointer-events: auto; }
.scene-tag, .round-tag { background: rgba(20,16,12,.88); border: 1px solid var(--lineGold); border-radius: 12px; padding: 6px 12px; font-family: var(--serif); color: var(--gold); font-size: 15px;
  max-width: 62vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-top .row { pointer-events: none; } .hud-top .row > * { pointer-events: auto; }
.ini-item { display: flex; align-items: center; gap: 6px; background: rgba(20,16,12,.88); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; max-width: 170px; }
.ini-item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini-item small { color: var(--muted); }
.ini-item.cur { border-color: var(--gold); background: rgba(217,164,65,.25); color: var(--goldLight); font-weight: 800; }
.ini-item.down { opacity: .4; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); flex: none; }
.dmtools .chip { background: rgba(30,24,19,.9); }
.hud-bottom { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-direction: column; pointer-events: none !important; }
.hud-bottom > * { pointer-events: auto; }
.actionbar { display: flex; align-items: center; gap: 8px; background: rgba(24,19,15,.96); border: 1px solid var(--lineGold); border-radius: 18px; padding: 10px 12px; }
.actionbar .info { min-width: 90px; }
.actionbar .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abtns { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-shrink: 1; }
.abtns::-webkit-scrollbar { display: none; }
.abtns .btn { flex: none; }
.zoombtns { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.zoombtns button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--lineGold); background: rgba(20,16,12,.85); font-size: 20px; font-weight: 800; }
.shopfab { position: absolute; right: 14px; bottom: 140px; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--gold); font-size: 28px;
  box-shadow: 0 0 18px rgba(217,164,65,.7); animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-4px) rotate(4deg); } }
.nomap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.rstrip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 6px; cursor: pointer; }
.rstrip::-webkit-scrollbar { display: none; }
.rpill { flex: none; display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--c); background: rgba(14,11,9,.9); border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.rpill .rp { color: var(--c); letter-spacing: 1px; } .rpill .rp i { font-style: normal; color: var(--faint); }
.rpill.empty { opacity: .5; }
.rpanel { display: flex; flex-direction: column; gap: 8px; }
.rgroup { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 10px 12px; }
.rg-head { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--goldLight); }
.ritem { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.ri-ic { width: 26px; text-align: center; font-weight: 800; }
.ri-main { flex: 1; min-width: 0; }
.ri-name { font-weight: 700; }
.ri-sub { font-size: 11px; color: var(--faint); }
.ri-pips { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 200px; align-items: center; }
.pip { border: 0; background: none; font-size: 21px; padding: 0 1px; color: var(--faint); line-height: 1; }
.pip.on { color: var(--c, var(--gold)); }
.pip.arc.on { color: var(--arcane); }
.pip.ok { color: var(--success); } .pip.bad { color: var(--danger); }
.stepb { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); font-weight: 800; font-size: 18px; }
.ri-big { min-width: 34px; text-align: center; font-size: 20px; color: var(--c); }
.slotlbl { width: 70px; font-size: 14px; }

/* Ringmenü (Tablet) */
.radial { position: fixed; width: 270px; height: 270px; z-index: 25; filter: drop-shadow(0 12px 24px rgba(0,0,0,.55)); animation: ringIn .18s ease-out; }
@keyframes ringIn { from { transform: scale(.85); opacity: 0; } }
.radial svg { position: absolute; inset: 0; overflow: visible; }
.radial .seg path { transition: filter .12s; }
.radial .seg { cursor: pointer; }
.radial .seg:active path { filter: brightness(1.35); }
.radial .seg.off { opacity: .38; }
.radial .ic { font-size: 19px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.radial .lb { font-size: 10.5px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; }
.rcenter { position: absolute; left: 81px; top: 81px; width: 108px; height: 108px; border-radius: 50%; background: #16110d; border: 3px solid rgba(255,255,255,.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.rcenter b { font-size: 16px; color: #fff; } .rcenter small { font-size: 11px; color: var(--gold); }
.rcenter span { font-size: 10px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnav { position: absolute; top: 116px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.5); background: #16110d; color: #fff; font-size: 22px; }
.rnav.l { left: -46px; } .rnav.r { right: -46px; }
.rdots { position: absolute; left: 0; right: 0; bottom: -18px; display: flex; justify-content: center; gap: 6px; }
.rdots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }

/* ---------- Einblendungen ---------- */
#overlay { position: relative; z-index: 50; }
#toasts { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: 520px; animation: tin .35s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.error { border-color: var(--danger); background: #3a1714; }
.toast.success { border-color: var(--success); background: #16301f; }
.toast.crit { border-color: var(--gold); background: #3a2a10; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(-30px); } }
.tbanner { position: fixed; top: 22%; left: 50%; transform: translate(-50%, -20px) scale(.7); opacity: 0; z-index: 46; pointer-events: none; padding: 12px 22px; border-radius: 26px;
  background: rgba(30,24,19,.92); border: 1px solid var(--line); font-family: var(--serif); font-size: 20px; color: var(--goldLight); letter-spacing: .05em; transition: all .35s cubic-bezier(.2,1.4,.4,1); white-space: nowrap; }
.tbanner.mine { border-color: var(--gold); background: rgba(80,58,20,.92); }
.tbanner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.reaction { position: fixed; left: 10px; right: 10px; top: calc(var(--safe-t) + 8px); z-index: 80; max-width: 560px; margin: 0 auto; background: rgba(24,19,15,.97); border: 1px solid var(--ember);
  border-radius: 18px; padding: 16px 14px 12px; overflow: hidden; box-shadow: 0 0 24px rgba(226,118,58,.45); }
.reaction .rbar { position: absolute; left: 0; top: 0; height: 4px; background: var(--ember); width: 100%; animation: shrinkw linear forwards; }
@keyframes shrinkw { from { width: var(--w0, 100%); } to { width: 0; } }
.reaction .kicker { color: var(--muted); font-size: 12px; font-weight: 700; }
.reaction .rtitle { font-family: var(--serif); color: var(--goldLight); font-size: 20px; }
.show-bg { position: fixed; inset: 0; z-index: 55; background: rgba(5,4,3,.95); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); gap: 8px; }
.show-bg h1 { font-family: var(--serif); color: var(--goldLight); font-size: 24px; margin: 0; text-align: center; }
.show-frame { max-width: 100%; max-height: 62dvh; overflow: auto; border: 2px solid var(--lineGold); border-radius: 12px; background: #000; line-height: 0; }
.show-frame img { max-width: 92vw; max-height: 62dvh; object-fit: contain; transition: transform .3s; transform-origin: center; animation: reveal 1s cubic-bezier(.2,.9,.3,1); }
.show-frame img.zoomed { max-width: none; max-height: none; }
@keyframes reveal { from { opacity: 0; transform: scale(1.1); filter: blur(6px); } }
.show-cap { max-width: 640px; background: var(--parchment); color: var(--parchmentInk); border-radius: 6px; padding: 10px 14px; font-style: italic; font-family: Georgia, serif; max-height: 22dvh; overflow: auto; margin: 0; }
.show-chip { position: fixed; right: 10px; top: calc(var(--safe-t) + 52px); z-index: 30; display: flex; align-items: center; gap: 8px; background: rgba(20,16,12,.92); border: 1px solid var(--gold); border-radius: 999px; padding: 4px 12px 4px 4px; max-width: 220px; }
.show-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.show-chip span { color: var(--goldLight); font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.narr-bg { position: fixed; inset: 0; z-index: 56; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 18px; }
.narr-bg .scroll { max-width: 680px; max-height: 80dvh; overflow: auto; background: linear-gradient(180deg, #e9d8b4, #d8c08f); color: var(--parchmentInk); border-radius: 6px; padding: 26px 24px; animation: unroll .9s cubic-bezier(.2,.9,.3,1); }
.narr-bg h1 { font-family: var(--serif); color: #5a2d0c; font-size: 22px; margin: 0 0 10px; }
.narr-bg p { font-family: Georgia, serif; font-style: italic; font-size: 17px; line-height: 1.6; margin: 0; white-space: pre-wrap; }
.narr-bg small { display: block; text-align: center; color: #7a5a30; margin-top: 14px; }
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* Echte Würfel */
.dierow { margin-bottom: 12px; }
.dlabel { color: var(--ink); }
.dval { font-family: var(--serif); color: var(--gold); font-size: 24px; }
.dval small { color: var(--muted); font-size: 15px; }
.pad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.num { width: 44px; height: 40px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); font-weight: 800; font-size: 16px; }
.pad.big .num { width: 52px; height: 48px; }
.num.n20 { border-color: var(--gold); } .num.n1 { border-color: var(--danger); }
.num.on { background: var(--gold); border-color: var(--goldLight); color: #1a120c; }
.dtotal { text-align: center; background: var(--panel2); border: 1px solid var(--lineGold); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; }
.dtotal small { color: var(--muted); font-size: 12px; }
.dtotal b { font-family: var(--serif); font-size: 40px; color: var(--goldLight); }

/* Ergebniskarte und 3D-Würfel (aus der Tischansicht) */
.result { position: fixed; left: 50%; transform: translateX(-50%); z-index: 48; min-width: 280px; max-width: min(520px, 92vw); padding: 16px 20px 12px; text-align: center;
  background: linear-gradient(180deg, #fbf6ea, #efe5cf); color: #2a1c10; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.6); transition: opacity .35s, transform .35s; }
body.on-page #result { display: none; }
.result.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
.result.pop { animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pop { from { transform: translate(-50%, 20px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.result .r-title { font-family: var(--serif); font-size: 16px; color: #5a3d1c; }
.result .r-expr { font-size: 13px; color: #8a7458; margin-top: 2px; }
.result .r-total { font-family: var(--serif); font-size: 52px; line-height: 1.05; font-weight: 700; margin: 4px 0; }
.result .r-total.crit { color: #b8860b; } .result .r-total.miss { color: #8d2a1e; }
.result .r-strip { border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 15px; }
.result .r-strip.hit { background: rgba(80,170,100,.18); color: #1f6a31; }
.result .r-strip.crit { background: rgba(217,164,65,.28); color: #7a5208; }
.result .r-strip.miss { background: rgba(224,74,74,.16); color: #9c2a1e; }
.result .r-strip.info { background: rgba(0,0,0,.06); }
.result .r-detail { font-size: 12px; color: #8a7458; margin-top: 6px; }
.result .r-btn { margin-top: 10px; border: 0; border-radius: 999px; padding: 8px 24px; font-size: 15px; font-weight: 700; background: #b9741e; color: #fff; }

/* ---------- Seiten ---------- */
.login { max-width: 460px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 18px 40px; }
.login .btn.block { margin-top: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.abil { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; }
.abil small { color: var(--muted); font-weight: 700; font-size: 11px; }
.abil b { font-family: var(--serif); font-size: 26px; }
.abil span { color: var(--muted); font-size: 12px; }
.skill { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; display: flex; justify-content: space-between; padding: 8px 2px; text-align: left; }
.tabbody { min-height: 200px; }
.dicegrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 10px; }
.diebtn { border: 0; background: none; padding: 2px; transition: transform .12s; }
.diebtn:active { transform: scale(.88) rotate(12deg); }
.diebtn polygon { fill: var(--panel2); stroke: var(--lineGold); stroke-width: 3; }
.diebtn text { fill: var(--ink); font-size: 24px; font-weight: 800; text-anchor: middle; }
.diebtn.on polygon { fill: var(--gold); stroke: var(--goldLight); }
.diebtn.on text { fill: #1a120c; }
.log .chatrow { position: sticky; top: 0; background: var(--bg); z-index: 2; padding: 6px 0; }
.logitem { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.logitem.chat { color: var(--goldLight); }
.thumbs { margin-top: 8px; }
.thumb { width: 110px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel2); padding: 0; text-align: left; }
.thumb img { width: 110px; height: 76px; object-fit: cover; display: block; }
.thumb span { display: block; font-size: 11px; padding: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.live { border: 2px solid var(--success); }
img.mini { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
img.preview { width: 100%; max-height: 240px; object-fit: contain; background: #000; border-radius: 14px; }
.imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.imgcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.imgcard.live { border: 2px solid var(--success); }
.imgcard img { width: 100%; aspect-ratio: 1.3; object-fit: cover; display: block; cursor: pointer; }
.imgmeta { padding: 8px; }
.imgmeta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.mapview { overflow: auto; border-radius: 12px; border: 1px solid var(--lineGold); background: #000; max-height: 62dvh; touch-action: pan-x pan-y; }
.mapview.painting canvas { touch-action: none; }
.mapview canvas { display: block; }
.snap { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.snap img { width: 100%; display: block; }
.tapdot { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--gold); border: 2px solid #000; color: #000; font-weight: 900; display: grid; place-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #0006; }
.swatch.on { border: 3px solid #fff; transform: scale(1.12); }
.create .steps { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--faint); margin-bottom: 10px; }
.create .steps .on { color: var(--gold); font-weight: 800; } .create .steps .done { color: var(--ink); }
.art { width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 400 / 240; max-height: 300px; overflow: hidden; }
.art svg { width: 100%; height: 100%; display: block; }
.art-title { margin-top: -64px; position: relative; padding: 0 4px 12px; }
.art-title b { display: block; font-family: var(--serif); font-size: 32px; color: #fff; text-shadow: 0 0 12px #000; }
.art-title span { color: var(--c); font-weight: 700; text-shadow: 0 0 8px #000; }
.sticky-actions { position: sticky; bottom: 8px; background: rgba(14,11,9,.9); padding: 8px; border-radius: 16px; border: 1px solid var(--line); }
.bigroll { text-align: center; font-family: var(--serif); color: var(--gold); font-size: 32px; }
.pb-budget { background: var(--panel); border: 1px solid var(--lineGold); border-radius: 16px; padding: 14px; margin: 10px 0; }
.pb-bar { display: flex; gap: 2px; height: 14px; margin-top: 8px; }
.pb-bar i { flex: 1; border-radius: 2px; background: var(--panel2); }
.pb-bar i.a { background: var(--goldLight); } .pb-bar i.b { background: var(--gold); } .pb-bar i.c { background: var(--ember); } .pb-bar i.over { background: var(--danger); }
.pb-cost { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.pb-row { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.pb-row.hl { border-color: var(--lineGold); background: rgba(217,164,65,.08); }
.pb-row small { display: block; font-size: 11px; }
.pb-val { width: 34px; text-align: center; font-family: var(--serif); font-size: 22px; }
.round { width: 36px; height: 36px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--lineGold); font-size: 20px; font-weight: 800; }
.round:disabled { opacity: .3; }

@media (min-width: 900px) {
  .actionbar { max-width: 760px; margin: 0 auto; width: 100%; }
  .rstrip { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
}

/* Handy: Aktionsleiste zweizeilig (Werte oben, Knöpfe unten) */
@media (max-width: 599px) {
  .actionbar { flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; }
  .actionbar .info { flex: 1 1 100%; }
  .actionbar .info .muted, .actionbar .info .faint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .abtns { flex: 1 1 100%; }
  .abtns .btn.small { padding: 9px 13px; font-size: 16px; }
  .abtns { flex-wrap: wrap; overflow: visible; }
  .abtns .endturn { flex: 1 1 auto; white-space: nowrap; }
}
/* Ergebniskarte über der Aktionsleiste */
#result[style*="bottom"] { bottom: calc(var(--tabs) + var(--safe-b) + 150px) !important; }

/* PWA: Update-Hinweis und Installieren */
.pwa-update { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 8px); display: flex; align-items: center; gap: 8px;
  background: #241c14; border: 1px solid var(--lineGold); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); white-space: nowrap; max-width: calc(100vw - 24px); }
.pwa-update span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.install-hint { margin-top: 12px; border-color: var(--lineGold); }
.install-hint .sheet-x { width: 32px; height: 32px; font-size: 14px; }

/* Wer ist verbunden? */
.nomap { overflow-y: auto; justify-content: flex-start; padding-top: calc(var(--safe-t) + 48px); padding-bottom: calc(var(--tabs) + var(--safe-b) + 24px); }
.nomap-presence { width: min(440px, 100%); text-align: left; }
.online-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 6px; }
.online-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); }
.online-user .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); flex: none; }
.online-user .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-user .badge { font-size: 13px; color: var(--muted, #a89a86); white-space: nowrap; }
.online-user.dm { border: 1px solid var(--lineGold); }
.online-user.dm .badge { color: var(--gold, #d9a441); font-weight: 700; }
.presence-btn { pointer-events: auto; background: rgba(24,19,15,.92); border: 1px solid var(--line); color: inherit; border-radius: 12px; padding: 6px 10px; font: inherit; font-weight: 700; font-size: 14px; }
.warn { color: var(--warn); }
