/* Dungeon Stadt 2.0 · Grundgestaltung
   Farben: Fels und Ruß, Gold der Dukaten, Rot der Runenwacht. */
:root {
  --bg: #120e0b;
  --bg-2: #1a1410;
  --surface: #211a14;
  --surface-2: #2a2119;
  --line: #3b2f24;
  --text: #ece2cc;
  --muted: #a8977c;
  --gold: #d1a94f;
  --gold-2: #f0d48a;
  --rune: #c0392b;
  --rune-glow: rgba(192, 57, 43, .35);
  --ok: #6fae6a;
  --radius: 14px;
  --font-head: "Cinzel", "Times New Roman", serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(209, 169, 79, .08), transparent 70%),
    radial-gradient(800px 500px at 100% 100%, rgba(192, 57, 43, .06), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: .02em; margin: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.loading { display: grid; place-items: center; height: 100vh; font-size: 40px; color: var(--gold); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(420px, 100%); padding: 36px 28px 28px; text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  display: flex; flex-direction: column; gap: 14px;
}
.login-seal { font-size: 42px; color: var(--rune); text-shadow: 0 0 24px var(--rune-glow); line-height: 1; }
.login-title { font-size: 30px; }
.login-title span, .brand-v { color: var(--gold); }
.login-motto { margin: -4px 0 8px; color: var(--muted); font-style: italic; }
.login-hint { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Formulare & Knöpfe ---------- */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field span { font-size: 14px; color: var(--muted); }
input, select {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.btn {
  font: 600 15px var(--font-body); letter-spacing: .03em; cursor: pointer;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #24190c; border-color: #8a6a26; }
.btn-danger { background: #3a1513; border-color: #6d2620; color: #f4c7c1; }
.btn-wide { width: 100%; padding: 13px; font-size: 16px; }
.btn-small { padding: 7px 12px; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 14px; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--gold); background: transparent; color: var(--gold-2); }
.notice { padding: 10px 12px; border-radius: 10px; font-size: 15px; text-align: left; }
.notice-error { background: #3a1513; border: 1px solid #6d2620; color: #f6cfc9; }
.notice-ok { background: #18301a; border: 1px solid #2f5a31; color: #cfeccc; }
.notice-info { background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- Rahmen ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; background: rgba(18, 14, 11, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-head); font-size: 19px; white-space: nowrap; }
.brand-mark { color: var(--rune); }
.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.navlink { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--muted); white-space: nowrap; }
.navlink:hover { color: var(--text); background: var(--surface); }
.navlink.active { color: var(--gold-2); background: var(--surface-2); }
.navlink.locked { opacity: .45; }
.navlink.gm { color: #e4a39b; }
.me { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me:hover, .me.active { background: var(--surface-2); }
.me-name { font-size: 15px; }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; background: var(--surface-2); border: 1px solid var(--gold); color: var(--gold-2);
}
.avatar-gm { border-color: var(--rune); color: #f2b4ac; box-shadow: 0 0 12px var(--rune-glow); }
.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 22px 60px; }
.bottomnav { display: none; }

/* ---------- Seiten ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); }
.page-head .muted { margin: 8px 0 0; max-width: 70ch; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.grid-wide { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}
.card-title { font-size: 17px; margin-bottom: 14px; color: var(--gold-2); }
.card-gm { border-color: #5a2a24; }
.card-clock { text-align: center; }
.clock-face {
  width: 92px; height: 92px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center;
  color: var(--gold); border: 2px solid var(--gold); box-shadow: inset 0 0 20px rgba(209, 169, 79, .2), 0 0 30px rgba(209, 169, 79, .08);
}
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { padding-left: 26px; position: relative; color: var(--muted); }
.checklist li::before { content: "◇"; position: absolute; left: 4px; color: var(--line); }
.checklist li.done { color: var(--text); }
.checklist li.done::before { content: "◆"; color: var(--gold); }
.sealed { text-align: center; padding: 50px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.sealed-rune { font-size: 54px; color: var(--rune); text-shadow: 0 0 26px var(--rune-glow); }

/* ---------- Konten ---------- */
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; }
.acc-main { display: flex; align-items: center; gap: 12px; }
.acc-name { font-weight: 600; }
.acc-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.acc-extra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc-extra input { flex: 1; min-width: 160px; }


/* ---------- Allgemein (Stufe 1a) ---------- */
textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; resize: vertical; }
textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.sub { font-size: 15px; color: var(--gold); margin: 18px 0 8px; }
.tag { display: inline-block; margin-left: 8px; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.chip-on { background: var(--gold); color: #24190c; border-style: solid; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .search { max-width: 280px; }
.toolbar select { width: auto; }
.toolbar .chips { margin: 0; }
.grid-start { grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.6fr) minmax(260px, 1fr); }
.filebtn { display: inline-block; margin: 6px 0 4px; }
.steps { padding-left: 20px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.counts { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.counts li { display: flex; justify-content: space-between; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.counts b { color: var(--gold-2); }
.progress { margin-top: 14px; }
.bar { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--rune), var(--gold)); transition: width .2s; }
.progress .small { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 0 20px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }

/* Uhr & Mond */
.clock { text-align: center; margin-bottom: 10px; }
.clock-time { font-family: var(--font-head); font-size: 46px; line-height: 1.05; color: var(--gold-2); text-shadow: 0 0 24px rgba(209,169,79,.25); }
.clock-date { font-size: 17px; margin-top: 4px; }
.moon { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.moon svg { filter: drop-shadow(0 0 14px rgba(240,212,138,.18)); }
.moon-label { display: flex; flex-direction: column; text-align: left; }
.btn-clock { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; }
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.setdate { display: grid; grid-template-columns: 64px 1fr 84px 60px 60px auto; gap: 6px; }
.setdate input, .setdate select { padding: 8px; }

/* Dungeontafel */
.board { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.board-next { margin: -6px 0 10px; }
.portal { display: grid; grid-template-columns: 30px 26px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.portal.empty { opacity: .5; }
.portal-no { font-family: var(--font-head); color: var(--muted); font-size: 14px; padding-top: 2px; }
.portal-rank { font-family: var(--font-head); font-weight: 700; text-align: center; border-radius: 6px; padding: 1px 0; font-size: 14px; background: #2d241b; }
.rank-F .portal-rank { color: #b9b0a0; } .rank-D .portal-rank { color: #8fc28a; } .rank-C .portal-rank { color: #7fb3d9; }
.rank-B .portal-rank { color: #c79be0; } .rank-A .portal-rank { color: #f0a35b; background: #3a2414; } .rank-S .portal-rank { color: #ff7a6b; background: #3d1612; box-shadow: 0 0 10px var(--rune-glow); }
.portal-title { font-weight: 700; }
a.portal-title { color: var(--gold-2); }
.portal-info { font-size: 14px; color: var(--muted); margin-top: 2px; }
.portal-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.portal-note { color: #f0a35b; }
.tafel-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tafel-row { display: grid; grid-template-columns: 34px 1.3fr 1.1fr 54px 1fr 2fr 64px 1.1fr auto; gap: 6px; align-items: center; }
.tafel-row input, .tafel-row select { padding: 7px 9px; font-size: 14px; }
.tafel-no { font-family: var(--font-head); color: var(--gold); text-align: center; }

/* Neu für dich */
.newlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.newlist li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.newlist a:hover b { color: var(--gold-2); }

/* Personen */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--gold); transform: translateY(-1px); }
.pcard-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pcard-title { font-weight: 700; line-height: 1.25; }
.pcard-sub { font-size: 14px; color: var(--text); opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-grp { font-size: 12px; color: var(--muted); }
.portrait { object-fit: cover; object-position: center 20%; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); flex: none; }
.portrait-md { width: 72px; height: 88px; }
.portrait-lg { width: 160px; height: 200px; border-radius: 16px; border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.portrait-empty { display: grid; place-items: center; font-family: var(--font-head); color: var(--gold); background: radial-gradient(circle at 50% 35%, #2e241b, #18120d); }
.portrait-md.portrait-empty { font-size: 24px; }
.portrait-lg.portrait-empty { font-size: 54px; }

/* Sichtbarkeit */
.vis { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 999px; border: 1px solid; width: fit-content; }
.vis-none { color: #a8977c; border-color: #4a3c2e; }
.vis-all { color: #a9dca4; border-color: #2f5a31; background: #15261a; }
.vis-some { color: #f0d48a; border-color: #6b5524; background: #2a2112; }
.uchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.uchip { font: inherit; font-size: 13px; cursor: pointer; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); }
.uchip.on { background: #1f3a22; border-color: #3f7a43; color: #d4f1d0; }
.uchip.implied { border-style: dashed; color: #a9dca4; }

/* Eintrag */
.entry-head { display: flex; gap: 22px; align-items: flex-end; margin-bottom: 22px; }
.entry-head h1 { font-size: clamp(26px, 4vw, 38px); }
.entry-sub { margin: 8px 0 0; color: var(--muted); font-size: 17px; }
.bigimg { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 18px; }
.gmbar { margin-bottom: 18px; border-color: #5a2a24; background: linear-gradient(180deg, #2a1a16, var(--surface)); }
.gmbar-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-start; }
.gmbar-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.preview { display: flex; align-items: center; gap: 6px; }
.preview select { width: auto; padding: 6px 8px; }
.sections { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-head h2 { font-size: 19px; color: var(--gold-2); }
.sec-secret { border-left: 3px solid var(--rune); }
.sec-hidden { opacity: .78; }
.note-card { margin-top: 18px; }

/* Markdown */
.md { margin-top: 8px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h3 { font-size: 16px; margin: 16px 0 6px; color: var(--gold); }
.md h4 { font-size: 15px; margin: 12px 0 4px; }
.md strong { color: #f5ead2; }
.md em { color: #d8caa9; }
.md blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--gold); background: var(--bg-2); border-radius: 0 10px 10px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; font-size: 15px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--bg-2); color: var(--gold); }
.md code { font-size: 14px; }
.md a, a.mdlink { color: var(--gold-2); text-decoration: underline; text-decoration-color: rgba(240,212,138,.4); }

/* Tabellen (Admin) */
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 12px; }
.bulk select { width: auto; padding: 6px 8px; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; color: var(--gold); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-2); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid #2c231b; }
.tbl tr.sel td { background: #2a2112; }
.tbl a:hover { color: var(--gold-2); }
.wgroup { margin-top: 6px; }
.wlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.wlist li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* Notizen */
.notelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.notelist li { padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.note-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.note-body { white-space: pre-wrap; margin: 6px 0 0; color: var(--text); }

@media (max-width: 1100px) {
  .grid-start { grid-template-columns: 1fr 1fr; }
  .grid-start .card-board { grid-column: 1 / -1; grid-row: 2; }
  .tafel-row { grid-template-columns: 34px 1fr 1fr 54px; }
  .tafel-row .w-l { grid-column: 2 / -1; }
}


/* ---------- Korrekturen 1a: Einzelinfos, Kategorien, Splitscreen ---------- */
.secctl { margin: 6px 0 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.partlist { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.partlist > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 10px; background: var(--bg-2); border-radius: 8px; border-left: 3px solid transparent; }
.partlist > li.part-on { border-left-color: #3f7a43; }
.partmd .md { margin: 0; font-size: 15px; }
.partmd .md p, .partmd .md ul, .partmd .md ol { margin: 0; }
.partmd .md ul, .partmd .md ol { padding-left: 18px; }
.partlabel { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uchips-small { margin: 0; justify-content: flex-end; }
.uchips-small .uchip { font-size: 12px; padding: 2px 9px; }
.catrows { display: flex; flex-direction: column; gap: 8px; margin: -6px 0 20px; }
.catrow { margin: 0; }
.catrow + .catrow { padding-left: 14px; border-left: 2px solid var(--line); }
.pgroup { margin-bottom: 26px; }
.pgroup-title { font-size: 17px; color: var(--gold); margin-bottom: 10px; }
.pcard { position: relative; padding: 0; }
.pcard-link { display: flex; gap: 12px; align-items: center; padding: 12px 40px 12px 12px; width: 100%; }
.pcard.pinned { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.pinchip { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.pinchip:hover { color: var(--gold-2); border-color: var(--gold); }
.pinchip.on { color: var(--gold-2); border-color: var(--gold); background: #2a2112; }
.pinbtn { margin-top: 10px; }
.pinbar { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #24190c; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 15px; }
.pinbar-mark { color: var(--rune); }
.content-wide { max-width: none; padding-left: 14px; padding-right: 14px; }
.split-tabs { display: none; }
.split { display: grid; gap: 12px; height: calc(100vh - 96px); }
.split.cols-1 { grid-template-columns: minmax(0, 900px); justify-content: center; }
.split.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split.cols-4 { grid-template-columns: repeat(4, minmax(300px, 1fr)); overflow-x: auto; }
.split-col { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(26,20,16,.6); }
.split-bar { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.split-bar .btn-danger { margin-left: auto; }
.split-scroll { overflow-y: auto; padding: 12px; min-height: 0; flex: 1; }
.entry-compact .entry-head { gap: 12px; margin-bottom: 12px; align-items: center; }
.entry-compact .entry-head h1 { font-size: 21px; }
.entry-compact .entry-sub { font-size: 14px; }
.entry-compact .sections { gap: 10px; }
.entry-compact .card { padding: 14px; }
.entry-compact .sec-head h2 { font-size: 16px; }
.entry-compact .md { font-size: 15px; }


/* ---------- Stufe 1b ---------- */
.tabs-top { max-width: 1180px; margin: 0 auto 14px; }
.embedbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.tag-gold { color: #24190c; background: var(--gold); border-color: var(--gold); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.kcard { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); font-weight: 600; }
.kcard:hover { border-color: var(--gold); color: var(--gold-2); }

/* Stadtkarte */
.stadt { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; margin-bottom: 26px; }
.mapwrap { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.5); background: #0d0a08; }
.mapimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mapload { display: grid; place-items: center; color: var(--muted); }
.mapsvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.maplabel { font-family: var(--font-head); font-size: 22px; font-weight: 700; fill: #f3e2b5; letter-spacing: .06em; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 5px; pointer-events: none; }
.maplabel.small { font-size: 16px; font-weight: 600; letter-spacing: 0; fill: #e8d8b4; }
.placemark { cursor: pointer; }
.placemark circle { stroke: #fff4d6; stroke-width: 2.5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.placemark text { font: 700 14px var(--font-body); fill: #fff; pointer-events: none; }
.placemark.unknown circle { opacity: .45; stroke-dasharray: 4 3; }
.placemark.unknown text { opacity: .6; }
.placemark:hover circle, .placemark.sel circle { stroke: var(--gold-2); stroke-width: 4; }
.placemark.sel circle { r: 19; }
.portalmark circle { fill: rgba(20, 12, 30, .75); stroke: #d9c8ff; stroke-width: 1.5; }
.portalmark text { font: 700 10px var(--font-head); fill: #e9dcff; pointer-events: none; }
.portalmark.link { cursor: pointer; }
.portalmark.link:hover circle { stroke: var(--gold-2); stroke-width: 3; }
.mappanel { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 76px; }
.placelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.placelist button { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: center; width: 100%; padding: 5px 6px; border-radius: 8px; box-sizing: border-box; }
.placelist button:hover { background: var(--bg-2); }
.placelist li.unknown { opacity: .5; }
.dot { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; border: 1.5px solid #fff4d6; }
.placepeople { margin: 10px 0 0; }

/* Gilden */
.gildengrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gildecard { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 18px; border-radius: 16px; border: 1px solid var(--line); border-top: 4px solid var(--gc); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.gildecard:hover { border-color: var(--gc); }
.gildecrest { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-head); font-size: 24px; font-weight: 700; color: #fff; background: var(--gc); box-shadow: 0 0 18px color-mix(in srgb, var(--gc) 50%, transparent); }

/* Dungeons */
.rangbadge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-family: var(--font-head); font-weight: 700; background: #2d241b; margin-right: 6px; }
.rangbadge.rank-F { color: #b9b0a0; } .rangbadge.rank-D { color: #8fc28a; } .rangbadge.rank-C { color: #7fb3d9; }
.rangbadge.rank-B { color: #c79be0; } .rangbadge.rank-A { color: #f0a35b; background: #3a2414; } .rangbadge.rank-S { color: #ff7a6b; background: #3d1612; box-shadow: 0 0 10px var(--rune-glow); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dcard { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.dcard:hover { border-color: var(--gold); }
.dcard-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dcard-rumor .md { font-size: 15px; font-style: italic; color: #e3d5b6; margin: 0; }

/* Archiv */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.acard { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); display: flex; flex-direction: column; gap: 6px; }
.acard header { display: flex; flex-direction: column; gap: 2px; }
.acard header b { font-family: var(--font-head); color: var(--gold-2); font-size: 17px; }
.acard .md { font-size: 15px; margin-top: 4px; }

/* Beziehungsnetz */
.netz .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.netz .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.netz-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
.netz-svg { width: 100%; height: 72vh; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 50%, #1d1611, #0e0b08); touch-action: none; cursor: grab; }
.nl { stroke: #5b4a38; stroke-width: 1.2; }
.nl.on { stroke: var(--gold-2); stroke-width: 2.5; }
.nl.dim { opacity: .15; }
.nn { cursor: pointer; }
.nn circle { stroke: #1a130e; stroke-width: 2; }
.nn text { font: 600 11px var(--font-body); fill: var(--text); paint-order: stroke; stroke: #0e0b08; stroke-width: 3px; pointer-events: none; }
.nn.dim { opacity: .2; }
.nn.sel circle, .nn.hit circle { stroke: var(--gold-2); stroke-width: 4; }
.netz-panel { max-height: 72vh; overflow-y: auto; }
.netz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.linkbtn { all: unset; cursor: pointer; font-weight: 700; color: var(--gold-2); }

/* Mehr-Menü (Handy) */
.moresheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.moresheet-inner { width: 100%; background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.morelink { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg-2); }
.morelink.locked { opacity: .45; }

@media (max-width: 1400px) { .navlink.locked span { display: none; } .navlink.locked { padding: 8px 9px; } }

/* ---------- Handy ---------- */
@media (max-width: 820px) {
  .topnav, .me-name { display: none; }
  .topbar { justify-content: space-between; padding: 10px 16px; }
  .content { padding: 20px 16px 96px; }
  .grid-wide { grid-template-columns: 1fr; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    background: rgba(18, 14, 11, .95); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .bnav.active { color: var(--gold-2); }
  .bnav.locked { opacity: .45; }
  .acc-main { flex-wrap: wrap; }
  .grid-start { grid-template-columns: 1fr; }
  .grid-start .card-board { grid-row: auto; }
  .entry-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .portrait-lg { width: 130px; height: 162px; }
  .pgrid { grid-template-columns: 1fr; }
  .setdate { grid-template-columns: 1fr 1fr 1fr; }
  .tafel-row { grid-template-columns: 30px 1fr 1fr; }
  .tafel-row > * { grid-column: auto !important; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }
  .clock-time { font-size: 40px; }
  .stadt, .netz-body { grid-template-columns: 1fr; }
  .mappanel { position: static; }
  .netz-svg { height: 60vh; }
  .bottomnav button.bnav { background: none; border: 0; font: inherit; font-size: 11px; color: var(--muted); }
  .bottomnav button.bnav.active { color: var(--gold-2); }
  .split-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .split, .split.cols-2, .split.cols-3, .split.cols-4 { grid-template-columns: 1fr; height: auto; }
  .split-col { display: none; }
  .split-col.current { display: flex; }
  .split-scroll { overflow: visible; }
  .pinbar { bottom: 84px; right: 12px; }
  .partlist > li { grid-template-columns: 1fr; }
  .uchips-small { justify-content: flex-start; }
}
.stack { display: flex; flex-direction: column; gap: 18px; }
.md table { display: block; max-width: 100%; overflow-x: auto; }

.netz-note { margin: 4px 0 8px; }
.netz-note .md { font-size: 14px; }
.netz-note .md p { margin: 2px 0; }
.placeinfo { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 10px; }
.placeinfo dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
.placeinfo dd { margin: 0; }
.placeinfo .chips { margin: 0; }
.slnote { border-left: 3px solid var(--rune, #b3261e); padding: 6px 10px; background: rgba(179,38,30,.08); border-radius: 6px; margin: 8px 0; font-size: 14px; }
.slnote .md p { margin: 2px 0; }

/* Testmodus & Sicherung */
.testbar { position: sticky; top: 0; z-index: 30; background: repeating-linear-gradient(135deg, #5b1712, #5b1712 14px, #6b1d16 14px, #6b1d16 28px); color: #ffe9d6; text-align: center; padding: 8px 14px; font-size: 14px; border-bottom: 1px solid #a3432a; }
.testbar a { color: #ffd27a; font-weight: 700; margin-left: 6px; }
.tag-test { background: #8d2a1e; color: #fff; border-color: #c0392b; margin-right: 6px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gmrow { margin-bottom: 12px; }
.confirm { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid #a3432a; border-radius: 10px; background: rgba(163,67,42,.12); }
.formrow { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.formrow label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.formrow select { min-width: 240px; }
.backuplist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.backuplist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.sicherung { grid-template-columns: 1fr; }

/* ---------- Stufe 2: Helden ---------- */
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.slot { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 150px; }
.slot.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.slot-new { justify-content: center; align-items: center; color: var(--gold-2); border-style: dashed; }
.tag-ok { color: #cfe8c9; background: #23401f; border-color: #3f6b39; }
.tag-warn { color: #ffe0b8; background: #4a2a12; border-color: #8a4f20; }
.tag-dark { color: #d9cbb3; background: #2b2b2b; border-color: #555; }
.heropage { display: flex; flex-direction: column; gap: 16px; }
.herohead { display: flex; gap: 18px; align-items: flex-start; }
.herohead h2 { margin: 0; font-family: var(--font-head); color: var(--gold-2); font-size: 28px; }
.herohead-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.herohead-body p { margin: 0; }
.hero-portrait { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.portrait-lg { width: 132px; height: 132px; border-radius: 16px; object-fit: cover; object-position: top; font-size: 40px; }
.gmtools select { max-width: 220px; }
.archform { flex-wrap: wrap; }
.archform input { flex: 1; min-width: 220px; }
.herogrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.hero-main, .hero-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tabs-small { margin-bottom: 12px; }
.tabs-small .tab { all: unset; cursor: pointer; padding: 6px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 15px; }
.tabs-small .tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.bogen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bogen-box { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18); }
.bogen-box h3 { margin: 0 0 8px; font-family: var(--font-head); font-size: 15px; color: var(--gold); letter-spacing: .03em; }
.bogen-wide { grid-column: 1 / -1; }
.ewrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ew { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.ew span { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.ew b { font-family: var(--font-head); font-size: 22px; color: var(--gold-2); }
.ew-small b { font-size: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 15px; }
table.mini td, table.mini th { padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
table.mini th { color: var(--muted); font-weight: 600; font-size: 12px; text-align: right; }
table.mini th:first-child { text-align: left; }
td.num { text-align: right; font-weight: 700; color: var(--gold-2); width: 40px; }
.waffe { margin-bottom: 8px; }
.check { display: inline-flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.chip-static { cursor: default; }
.chip-warn { border-color: #8a4f20; color: #ffd0a0; }
.bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.hbar-head { display: flex; justify-content: space-between; font-size: 14px; }
.hbar-track { height: 10px; border-radius: 6px; background: #2a1f18; overflow: hidden; border: 1px solid var(--line); }
.hbar-fill { height: 100%; background: var(--gold); transition: width .3s; }
.bar-le .hbar-fill { background: linear-gradient(90deg, #8d2a1e, #d4493a); }
.bar-ae .hbar-fill { background: linear-gradient(90deg, #2d4f99, #5f8be0); }
.bar-ke .hbar-fill { background: linear-gradient(90deg, #8a7020, #e0c050); }
.bar-schip .hbar-fill { background: linear-gradient(90deg, #5a3f80, #9a7ad0); }
.geld { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.inventar ul { margin: 6px 0 0; padding-left: 18px; font-size: 15px; }
.liveform h4 { margin: 12px 0 6px; font-size: 14px; color: var(--gold); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.formgrid label, .field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.field { margin: 8px 0; }
.formgrid input, .formgrid select, .field input, .field textarea, .invrow input, .btnrow input, .btnrow select, .gmtools select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 15px; }
.invedit { display: flex; flex-direction: column; gap: 6px; }
.invrow { display: grid; grid-template-columns: 56px 1fr 90px auto; gap: 6px; }
.secret-card { border-color: #6b2620; background: linear-gradient(180deg, #2a1614, var(--surface)); }
table.log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.log th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px; }
table.log td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.uploadbox { display: flex; flex-direction: column; gap: 8px; }
.filebtn { display: inline-flex; align-self: flex-start; cursor: pointer; }
.uploadpreview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; }
.difflist { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.diffgroup h4 { margin: 0 0 4px; font-size: 14px; color: var(--gold); }
.diffgroup ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.diffgroup li { display: flex; gap: 8px; align-items: baseline; font-size: 15px; flex-wrap: wrap; }
.diff-label { font-weight: 600; min-width: 160px; }
.diff-new { color: #9fd49a; }
.diff-gone { color: #e59a8f; text-decoration: line-through; }
.diff-detail { opacity: .7; }
.review { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.review:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.review-card { border-color: var(--gold); }
.quote { font-style: italic; color: #e3d5b6; }
.uplist { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.uplist li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pendlist { margin: 0; padding-left: 18px; }
.herocards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.herocard { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); align-items: flex-start; }
.herocard:hover { border-color: var(--gold); }
.pcard-fallen { filter: grayscale(.6); border-color: #444; }
@media (max-width: 900px) {
  .herogrid { grid-template-columns: 1fr; }
  .herohead { flex-direction: column; align-items: center; text-align: center; }
  .herohead-body .btnrow { justify-content: center; }
  .ewrow { grid-template-columns: repeat(4, 1fr); }
  .diff-label { min-width: 0; }
  .invrow { grid-template-columns: 48px 1fr 70px auto; }
}

.hbar { display: flex; flex-direction: column; gap: 3px; }
.difflist input[type=checkbox], .check input, .live-card input[type=checkbox] { width: auto; flex: none; margin: 0; }
.formgrid input, .formgrid select { width: 100%; }
.tabs-small { display: flex; flex-wrap: wrap; }
@media (max-width: 900px) { .hero-side { order: -1; } }
