/* =================================================================
   D&D Plattform — Hi-Fi Prototyp · "Dark Fantasy (grau)"
   Design-System + Komponenten. Tokens kommen aus themes.css
   (.aes-dark-grey, gesetzt auf <body>). Hier nur App-Chrome & Screens.
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Dichte-Variablen (Komfortabel = Standard; Kompakt via data-density) ---- */
body {
  --d-pad: 16px;        /* Panel-Innenabstand (.pad) */
  --d-col-gap: 18px;    /* Spaltenabstand (.play-cols) */
  --d-stack-gap: 14px;  /* vertikaler Panel-Abstand (.play-col) */
  --d-panelh-mb: 10px;  /* Abstand unter Sektionsköpfen (.panel-h) */
  --d-screen-px: 34px;  /* Screen-Polster horizontal */
  --d-screen-py: 30px;  /* Screen-Polster vertikal */
  --d-banner-mb: 18px;  /* Abstand unter der Rollen-Kopfzeile */
}
::selection { background: rgba(200,160,70,.3); color: var(--head-ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--head-ink); margin: 0; letter-spacing: .015em; }
a { color: inherit; }

/* ---------------- shared atoms ---------------- */
.btn {
  font-family: var(--display); font-weight: 600;
  font-size: 14px; letter-spacing: .03em;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2); color: var(--head-ink);
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 18px rgba(200,160,70,.22); }
.btn.primary:hover { box-shadow: 0 0 26px rgba(200,160,70,.4); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--head-ink); }
.btn.danger { background: #a33b3b; color: #f6e6e3; border-color: #a33b3b; box-shadow: 0 0 18px rgba(163,59,59,.24); }
.btn.danger:hover { border-color: #c25151; box-shadow: 0 0 26px rgba(163,59,59,.42); }
.btn.sm { font-size: 12.5px; padding: 6px 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover { transform: none; border-color: var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 4px 11px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  letter-spacing: .02em; white-space: nowrap;
}
.chip.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.chip.muted { color: var(--muted); border-color: var(--line-faint); }
.chip.ok { color: #7fc08a; border-color: rgba(127,192,138,.45); background: rgba(127,192,138,.08); }
.chip.dim { color: var(--muted); border-color: var(--line-faint); opacity: .8; }

.eyebrow { font-family: var(--display); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.xs { font-size: 11.5px; }

.surf {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,.32);
}

.fld {
  display: flex; flex-direction: column; gap: 6px;
}
.fld > label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fld > .inp {
  background: rgba(0,0,0,.22); border: 1px solid var(--line-faint); border-radius: 6px;
  padding: 11px 13px; font-size: 14px; color: var(--head-ink); min-height: 42px;
  display: flex; align-items: center;
}
.fld > .inp.ph-txt { color: var(--muted); }
.fld > .inp:focus-within, .fld > .inp.active { border-color: var(--accent); }

/* art / image placeholder */
.art {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 10px, transparent 10px 20px),
    radial-gradient(120% 90% at 30% 20%, rgba(200,160,70,.10), transparent 60%),
    var(--panel-2);
  display: grid; place-items: center;
  color: var(--muted); font-family: var(--mono, "Courier Prime", monospace);
  font-size: 12px; letter-spacing: .08em; text-align: center; padding: 16px;
}
.art .art-label { opacity: .85; }

/* ---------------- screen router ---------------- */
.screen { display: none; min-height: 100vh; padding: var(--d-screen-py, 30px) var(--d-screen-px, 34px) 110px; }
.screen.active { display: block; }
/* Reiter-Hintergrund (alle Screens außer Anmeldung; Willkommen ist ein eigenes Overlay) */
.screen:not(#login) {
  background:
    url("img/screen-bg.png") center / cover no-repeat fixed,
    var(--bg) fixed;
}
.screen-wide { max-width: 1320px; margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  .screen.active.entering { animation: fade .28s ease both; }
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- product top nav (inside app) ---------------- */
.appbar { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }
.appbar .alogo {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(140deg, #cda64f, #a07e2c); color: #1a1c1e;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 16px;
  box-shadow: 0 0 18px rgba(200,160,70,.25);
}
.appbar .awordmark { font-family: var(--display); font-size: 17px; color: var(--head-ink); letter-spacing: .05em; }
.appbar nav { display: flex; gap: 20px; margin-left: 14px; font-size: 14px; }
.appbar nav a { color: var(--muted); text-decoration: none; padding-bottom: 3px; cursor: pointer; }
.appbar nav a:hover { color: var(--ink); }
.appbar nav a.on { color: var(--head-ink); border-bottom: 2px solid var(--accent); }
.appbar .avatar { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); background: var(--panel-2); display: grid; place-items: center; font-size: 13px; color: var(--accent); box-shadow: 0 0 14px rgba(200,160,70,.2); }

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title h1 { font-size: 30px; }
.page-title .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ================= 01 LOGIN ================= */
#login { padding: 0; display: none; }
#login.active { display: grid; }
.login-grid { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100vh; }
.login-art { position: relative; }
.login-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
}
/* Abdunkeln zu den Rändern, damit Wortmarke + Tagline lesbar bleiben */
.login-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,11,13,.55), transparent 30%, transparent 55%, rgba(10,11,13,.78)),
    linear-gradient(90deg, transparent 70%, rgba(10,11,13,.45));
}
.login-art .brand-mark, .login-art .tagline { z-index: 1; }
.login-art .brand-mark {
  position: absolute; top: 34px; left: 38px; display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 19px; color: var(--head-ink); letter-spacing: .06em;
}
.login-art .tagline {
  position: absolute; left: 38px; bottom: 44px; right: 38px;
  font-family: var(--display); font-size: clamp(24px, 2.6vw, 33px); line-height: 1.25; color: var(--head-ink);
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.login-art .tagline span { color: var(--accent); }
.login-form { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: clamp(62px, 8vh, 76px) 40px clamp(36px, 6vh, 56px); gap: 14px; max-height: 100vh; overflow-y: auto; }
/* Forminhalt auf eine ruhige, feste Lesebreite begrenzen — verhindert das „Mitskalieren" der Felder */
.login-form > * { width: 100%; max-width: 360px; }
.login-form > .seg { width: auto; max-width: none; left: auto; }
.login-form .seg { position: absolute; top: 24px; right: 24px; z-index: 2; display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.login-form .seg button { font-family: var(--display); font-size: 11px; letter-spacing: .03em; padding: 5px 13px; border: none; background: transparent; color: var(--muted); cursor: pointer; }
.login-form .seg button.on { background: var(--accent); color: var(--on-accent); }
.login-form h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.1; text-align: center; margin: 0 0 20px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-faint); }

/* ---- funktionsfähige Anmeldung ---- */
.login-form form { display: flex; flex-direction: column; gap: 13px; }
.fld > input.inp { width: 100%; font-family: inherit; font-size: 14px; color: var(--head-ink); outline: none; }
.fld > input.inp::placeholder { color: var(--muted); opacity: .65; }
.fld > input.inp:focus { border-color: var(--accent); }
.fld.err > .inp { border-color: #b05656; }
.fld .fld-err { font-size: 12px; color: #cc7a7a; }
.fld .fld-err:empty { display: none; }
.auth-link { color: var(--accent); cursor: pointer; }
.auth-banner { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 6px; padding: 10px 13px; font-size: 13px; color: var(--head-ink); line-height: 1.5; }
.auth-banner.info { border-color: var(--accent); }
.auth-banner.err { border-color: #9c5a5a; background: rgba(160,70,70,.14); color: #e0a0a0; }
.auth-session { display: flex; flex-direction: column; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.18); }
.auth-session .as-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.auth-session .as-meta { flex: 1; min-width: 0; }
.auth-session .as-name { font-family: var(--display); color: var(--head-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-session .as-mail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-session .as-actions { display: flex; gap: 8px; }
.auth-session .as-actions .btn { flex: 1; }
.auth-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
/* ---- Willkommens-Fenster nach dem Login ---- */
.welcome-overlay { position: fixed; inset: 0; z-index: 200; display: none; }
.welcome-overlay.on { display: block; }
.welcome-stage {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(12,13,15,.36) 0%, rgba(12,13,15,.24) 34%, rgba(12,13,15,.54) 72%, rgba(12,13,15,.82) 100%),
    radial-gradient(78% 56% at 50% 44%, rgba(10,11,13,.42), rgba(10,11,13,.06) 64%, transparent 80%),
    radial-gradient(120% 80% at 50% 16%, rgba(200,160,70,.10), transparent 58%),
    url("img/welcome-bg.png") center / cover no-repeat,
    linear-gradient(180deg, #16181b 0%, #0e0f11 100%);
  animation: welcomeFade .26s ease;
}
@keyframes welcomeFade { from { opacity: 0; } to { opacity: 1; } }
.welcome-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(58% 48% at 50% 44%, rgba(200,160,70,.06), transparent 70%); }
.welcome-topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px 30px; }
.welcome-brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-size: 17px; letter-spacing: .04em; color: var(--head-ink); }
.wb-logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #1a1c1e; background: linear-gradient(140deg,#cda64f,#a07e2c); }
.welcome-user { display: flex; align-items: center; gap: 12px; }
.welcome-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 13px; color: var(--accent); background: var(--panel-2); border: 1px solid var(--accent); }
.welcome-hero { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 30px; }
.welcome-hero .eyebrow { margin-bottom: 14px; }
.welcome-hero h1 { font-family: var(--display); font-size: clamp(30px, 4.6vw, 50px); line-height: 1.08; color: var(--head-ink); margin: 0 0 14px; text-shadow: 0 0 40px rgba(200,160,70,.18); }
.welcome-hero .welcome-sub { color: rgba(236,228,210,.82); font-size: 15px; margin-bottom: 40px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.welcome-hero .eyebrow { text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.welcome-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 240px)); gap: 18px; width: 100%; max-width: 800px; }
.welcome-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px; text-align: left; min-width: 0;
  padding: 26px 22px 22px; border: 1px solid rgba(200,160,70,.18); border-radius: 14px;
  background: linear-gradient(180deg, rgba(26,24,20,.74), rgba(14,13,11,.82));
  -webkit-backdrop-filter: blur(9px) saturate(1.08); backdrop-filter: blur(9px) saturate(1.08);
  box-shadow: 0 14px 36px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05);
  color: var(--ink); cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
  animation: welcomeRise .4s cubic-bezier(.2,.7,.3,1) both;
}
.welcome-choice:nth-child(2) { animation-delay: .06s; }
.welcome-choice:nth-child(3) { animation-delay: .12s; }
@keyframes welcomeRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.welcome-choice:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 20px 48px rgba(0,0,0,.55), 0 0 0 1px var(--accent-wash); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, rgba(26,24,20,.78)), rgba(14,13,11,.86)); }
.wc-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 23px; color: var(--accent); line-height: 1; margin-bottom: 6px; background: radial-gradient(120% 120% at 30% 20%, rgba(200,160,70,.20), rgba(200,160,70,.06)); border: 1px solid rgba(200,160,70,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); transition: border-color .18s, background .18s; }
.welcome-choice:hover .wc-icon { border-color: var(--accent); background: radial-gradient(120% 120% at 30% 20%, rgba(200,160,70,.34), rgba(200,160,70,.12)); }
.wc-title { font-family: var(--display); font-size: 19px; color: var(--head-ink); }
.wc-sub { font-size: 12.5px; color: rgba(218,210,192,.74); line-height: 1.5; }
.wc-go { margin-top: 10px; font-family: var(--display); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
.wc-arr { transition: transform .18s; }
.welcome-choice:hover .wc-arr { transform: translateX(4px); }
.welcome-foot { position: relative; z-index: 2; text-align: center; padding: 18px; font-family: var(--display); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); opacity: .6; }
@media (max-width: 720px) { .welcome-grid { grid-template-columns: 1fr; max-width: 380px; } .welcome-hero { justify-content: flex-start; padding-top: 36px; } }
/* ---- Avatar-Menü (Support / Abmelden) ---- */
.avatar { cursor: pointer; }
.avatar-menu {
  position: fixed; z-index: 240; min-width: 196px;
  /* --pop-bg ist in allen Themes OPAK — --panel hat Alpha und ließe das Menü
     über dem Hintergrundbild durchscheinen (Nutzer-Feedback 07.07.2026). */
  background: var(--pop-bg, #25272b); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5); overflow: hidden;
  animation: amIn .14s ease both;
}
@keyframes amIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.am-head { padding: 12px 14px; border-bottom: 1px solid var(--line-faint); }
.am-name { font-family: var(--display); font-size: 14px; color: var(--head-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-mail { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--ink); transition: background .12s, color .12s;
}
.am-item:hover { background: var(--accent-wash); color: var(--head-ink); }
.am-ic { width: 18px; text-align: center; color: var(--accent); }
/* ---- Support-Fenster ---- */
.support-modal { position: fixed; inset: 0; z-index: 250; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(10,11,12,.72); backdrop-filter: blur(6px); }
.support-modal.on { display: flex; animation: welcomeFade .2s ease; }
.support-card { position: relative; width: min(440px, 100%); padding: 28px 28px 24px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: welcomeRise .24s cubic-bezier(.2,.7,.3,1) both; }
.support-card h2 { font-size: 21px; margin: 6px 0 8px; color: var(--head-ink); }
.support-text { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }
.support-rows { display: flex; flex-direction: column; gap: 8px; }
.support-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line-faint); border-radius: 9px; background: rgba(0,0,0,.18); color: var(--ink); font-size: 13.5px; text-decoration: none; }
a.support-row:hover { border-color: var(--accent); color: var(--head-ink); }
.sr-ic { color: var(--accent); width: 18px; text-align: center; }
/* ---- Auth-Modal: Schließen-Button, Formulare, Discord-Verbindung, Erfolg ---- */
.welcome-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 14px; line-height: 1; transition: .15s; }
.welcome-x:hover { color: var(--head-ink); border-color: var(--accent); }
.support-card form { display: flex; flex-direction: column; gap: 13px; margin-top: 4px; }
.support-card form .btn.block { margin-top: 4px; }
.support-card .fld > label { font-size: 12px; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; display: block; }
.discord-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.2); margin-bottom: 14px; }
.discord-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--display); font-size: 16px; color: #e8e6ff; background: linear-gradient(140deg, #5b62d6, #3f3f9e); box-shadow: 0 0 0 1px rgba(120,128,230,.4); }
.discord-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #57b87a; box-shadow: 0 0 10px rgba(87,184,122,.7); }
.discord-scopes { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.ds-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); }
.ds-ic { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: var(--on-accent); background: var(--accent); }
.auth-ok-badge { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: var(--on-accent); background: linear-gradient(140deg, #cda64f, #a07e2c); box-shadow: 0 0 0 6px var(--accent-wash); }
/* ---- Externe Anmeldung: Anbieter-Buttons (Google / Discord / Microsoft) ---- */
.oauth-row { display: flex; gap: 8px; margin-top: 12px; }
.oauth-btn { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px; border: 1px solid var(--line-faint); border-radius: 8px; background: transparent; color: var(--muted); font-family: inherit; font-size: 12.5px; cursor: pointer; transition: .15s; }
.oauth-btn:hover { border-color: var(--line); color: var(--head-ink); background: rgba(255,255,255,.025); }
.oauth-btn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oauth-glyph { width: 17px; height: 17px; flex: none; display: grid; place-items: center; }
.oauth-glyph svg { display: block; width: 17px; height: 17px; }
/* Konsens-Karte: Avatar je Anbieter eingefärbt (Discord = Standard-Lila) */
.discord-av.av-google { background: linear-gradient(140deg,#4285f4,#2a64c8); box-shadow: 0 0 0 1px rgba(66,133,244,.4); }
.discord-av.av-ms { background: linear-gradient(140deg,#00a4ef,#0078d4); box-shadow: 0 0 0 1px rgba(0,164,239,.4); }
/* ---- Zugangscode (im Formular-Stil, dezent) ---- */
.access-code { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-faint); }
.code-redeem { display: flex; gap: 8px; align-items: stretch; }
.code-redeem .inp {
  flex: 1; min-width: 0; font-family: inherit;
  background: rgba(0,0,0,.22); border: 1px solid var(--line-faint); border-radius: 6px;
  padding: 11px 13px; font-size: 14px; color: var(--head-ink); min-height: 42px; outline: none;
  letter-spacing: .06em; text-transform: uppercase;
}
.code-redeem .inp::placeholder { color: var(--muted); opacity: .65; letter-spacing: .03em; text-transform: none; }
.code-redeem .inp:focus { border-color: var(--accent); }
.code-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; font-size: 12px; letter-spacing: .04em; color: var(--muted); transition: color .15s; }
.code-toggle:hover { color: var(--head-ink); }
.code-caret { font-size: 11px; line-height: 1; transition: transform .2s; }
.code-toggle[aria-expanded="true"] .code-caret { transform: rotate(180deg); }
.code-body { margin-top: 12px; }
.access-code .code-redeem .inp { padding: 8px 11px; font-size: 12.5px; min-height: 34px; }
.access-code .code-redeem .btn { padding: 7px 14px; font-size: 12.5px; min-height: 34px; }
.fld.err .code-redeem .inp { border-color: #b05656; }
.code-redeem .btn { flex: none; }
.auth-note code { font-family: var(--mono, monospace); color: var(--head-ink); background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 4px; }
.appbar .avatar[data-logout] { cursor: pointer; }
@keyframes authShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
#authForm.shake { animation: authShake .35s ease; }

/* ================= 02 ROSTER ================= */
.roster-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
.hero-card { display: flex; gap: 22px; padding: 24px; }
.hero-portrait {
  width: 170px; flex: none; align-self: stretch; min-height: 230px; border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px),
    radial-gradient(120% 80% at 50% 10%, rgba(200,160,70,.16), transparent 60%),
    var(--panel-2);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--display); font-size: 46px; color: var(--accent);
  box-shadow: inset 0 0 40px rgba(0,0,0,.4);
}
.hero-meta { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hero-meta h2 { font-size: 30px; }
.hero-statline { display: flex; gap: 10px; flex-wrap: wrap; }
.bio { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 46ch; }
.rail { display: flex; flex-direction: column; gap: 12px; }
.rail-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; cursor: pointer; transition: border-color .2s, transform .12s; }
.rail-item:hover { transform: translateX(2px); border-color: var(--accent); }
.rail-item.on { border-color: var(--accent); background: var(--accent-wash); }
.rail-portrait { width: 42px; height: 42px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--display); color: var(--accent); flex: none; }
.rail-item .nm { flex: 1; }
.rail-add { border-style: dashed !important; color: var(--muted); justify-content: center; }
.rail-del {
  width: 24px; height: 24px; flex: none; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1;
  display: grid; place-items: center; transition: .15s; margin-left: -4px;
}
.rail-del:hover { color: var(--head-ink); border-color: var(--line); background: var(--panel-2); }

/* ================= 04 LOBBY ================= */
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.code-input { display: flex; gap: 10px; }
.code-cell {
  width: 52px; height: 60px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(0,0,0,.22); display: grid; place-items: center;
  font-family: var(--display); font-size: 26px; color: var(--head-ink);
}
input.code-cell { text-align: center; text-transform: uppercase; outline: none; padding: 0; caret-color: var(--accent); }
input.code-cell:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-wash); }
button.chip { font-family: inherit; cursor: pointer; }
.fld > select.inp { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.fld > select.inp:focus { border-color: var(--accent); }
.fld > select.inp option { background-color: var(--panel); color: var(--head-ink); }
.lobby-list-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.lobby-thumb { width: 46px; height: 46px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.lobby-list-item [data-lobby-del] { flex: none; }
.lobby-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 20px; border-style: dashed; }
.lobby-empty .le-icon { font-size: 28px; color: var(--accent); opacity: .8; }
.lobby-empty .le-title { font-family: var(--display); color: var(--head-ink); font-size: 15px; }

/* ================= 05 READY ================= */
.ready-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.player-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 20px 16px; text-align: center; min-height: 272px; }
.player-card.is-gm { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-wash), 0 10px 26px rgba(0,0,0,.32); }
.player-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--accent); }
.player-card.is-gm .player-avatar { border-color: var(--accent); box-shadow: 0 0 16px rgba(200,160,70,.3); }
.select-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-2); color: var(--ink); cursor: pointer; }
.player-empty { border-style: dashed !important; color: var(--muted); justify-content: center; }
.ready-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 8px 20px; }
.ready-bar .btn { padding: 6px 12px; min-height: 0; }
.progress { flex: 1; max-width: 320px; height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; border: 1px solid var(--line-faint); }
.progress > i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px rgba(200,160,70,.4); transition: width .4s; }
.toggle { width: 42px; height: 24px; border-radius: 14px; background: var(--track); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle.on { background: var(--accent-wash); border-color: var(--accent); }
.toggle.on::after { left: 21px; background: var(--accent); box-shadow: 0 0 10px rgba(200,160,70,.5); }

/* ================= MAP + CHAT (06/07) ================= */
.map {
  position: relative; border-radius: 8px; border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(200,160,70,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(200,160,70,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px),
    radial-gradient(130% 100% at 50% 0%, #2b2e31, #191b1d 75%);
  box-shadow: inset 0 0 70px rgba(0,0,0,.55);
  overflow: hidden;
}
.map.tokens-hidden .tok { display: none; }
/* ---- Rasterbeschriftung: Lineal AUSSERHALB der Karte (Spalten A–Z oben, Reihen 1–10 links) ---- */
.map-frame { position: relative; --gc-gut: 20px; }
.map-frame.coords-on { padding-top: var(--gc-gut); padding-left: var(--gc-gut); }
.gc-ruler { position: absolute; display: none; overflow: hidden; z-index: 8; font-family: var(--mono, ui-monospace, monospace); }
.map-frame.coords-on .gc-ruler { display: block; }
.gc-top  { top: 0; left: var(--gc-gut); right: 0; height: var(--gc-gut); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line-faint); }
.gc-left { top: var(--gc-gut); left: 0; bottom: 0; width: var(--gc-gut); background: linear-gradient(90deg, var(--panel-2), var(--panel)); border-right: 1px solid var(--line-faint); }
.gc-corner { position: absolute; display: none; top: 0; left: 0; width: var(--gc-gut); height: var(--gc-gut); z-index: 9; background: var(--panel-2); border-right: 1px solid var(--line-faint); border-bottom: 1px solid var(--line-faint); }
.map-frame.coords-on .gc-corner { display: block; }
.gc-track { position: absolute; inset: 0; }
.gc-lab { position: absolute; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); white-space: nowrap; }
.gc-top  .gc-lab { top: 50%; transform: translate(-50%, -50%); }
.gc-left .gc-lab { left: 50%; transform: translate(-50%, -50%); }
/* Gegner-Sichtbarkeit: vom GM gesteuert — Standard: für Spieler unsichtbar */
.map.foes-hidden .tok.foe { display: none; }
/* GM-Ansicht („Gegner verwalten“): Gegner immer sichtbar — halbtransparent
   gestrichelt, solange die Spieler sie nicht sehen */
.map.gm-view .tok.foe { display: grid; }
.map.gm-view.foes-hidden .tok.foe { opacity: .6; border-style: dashed; }
.mapgen.gmfoes { width: min(880px, 100%); }
.gmf-slot { position: relative; }
.gmf-slot .map-viewport { height: 430px; }

/* GM: editierbare geheime Notizen */
.gm-notes {
  width: 100%; min-height: 150px; resize: vertical;
  background: transparent; border: none; outline: none;
  color: var(--muted); font-family: var(--body); font-size: 13.5px; line-height: 1.55;
  padding: 0;
}
.gm-notes:focus { color: var(--ink); }

/* GM: KI-Vorschlag für geheime Notizen (zur Szene) */
.notes-ai {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-wash); border-radius: 8px;
  padding: 11px 12px; margin-bottom: 11px;
}
.notes-ai-head {
  color: var(--accent); letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 7px; font-weight: 600;
}
.notes-ai-text { color: var(--ink); line-height: 1.55; }
.notes-ai-actions { margin-top: 10px; }

/* GM: Mini-Kartenvorschau */
.gm-map-preview {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin-bottom: 10px; cursor: pointer; line-height: 0;
  transition: border-color .15s;
}
.gm-map-preview:hover { border-color: var(--accent); }
.gm-map-preview canvas { width: 100%; height: auto; display: block; }
/* Gegner direkt auf der Mini-Karte positionieren */
#foes .gm-map-preview { position: relative; cursor: default; }
.foe-pos-layer { position: absolute; inset: 0; pointer-events: none; line-height: 1; }
.foe-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 12.5px; font-weight: 600;
  color: #fff; background: #b34a3f; border: 1px solid #c2564a;
  box-shadow: 0 2px 7px rgba(0,0,0,.55);
  cursor: grab; pointer-events: auto; user-select: none; touch-action: none;
  transition: transform .08s, box-shadow .12s;
}
.foe-pin:hover { transform: translate(-50%, -50%) scale(1.14); box-shadow: 0 3px 11px rgba(0,0,0,.6); }
.foe-pin.dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.18); z-index: 6; }
.foe-pin.invis { opacity: .5; }
.foe-pin.selected { box-shadow: 0 0 0 2px var(--accent), 0 3px 11px rgba(0,0,0,.6); }
.foe-pin { z-index: 2; }
/* Positionier-Pins spiegeln die Token-Größe (Boden = 26px) */
.foe-pin[data-size] { transition: width .15s ease, height .15s ease, font-size .15s ease; }
.foe-pin[data-size="large"]      { width: 36px; height: 36px; font-size: 13px; }
.foe-pin[data-size="huge"]       { width: 46px; height: 46px; font-size: 15px; }
.foe-pin[data-size="gargantuan"] { width: 56px; height: 56px; font-size: 18px; }
/* zweistellige Badges (z. B. S2) etwas kleiner */
.foe-pin { letter-spacing: -.02em; }
/* Positionier-Pins zeigen jetzt die Gegner-Silhouette/das Bild (wie die Karten-Tokens) + kleines Nummern-Badge */
.foe-pin .pin-art { position: absolute; inset: 1px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; pointer-events: none; }
.foe-pin .pin-art .foe-sil { width: 100%; height: 100%; display: grid; place-items: center; }
.foe-pin .pin-art .foe-sil-svg { width: 90%; height: 90%; fill: #fff; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.65)); }
.foe-pin .pin-art .foe-art-img { width: 100%; height: 100%; object-fit: cover; }
.foe-pin .pin-num { position: absolute; top: -4px; right: -4px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; font-family: var(--display); font-size: 9px; line-height: 14px; text-align: center; background: #c2564a; color: #fff; border: 1px solid rgba(0,0,0,.45); box-sizing: border-box; pointer-events: none; }
.foe-move-ring {
  position: absolute; transform: translate(-50%, -50%);
  border: 2px dashed #d98b7e; border-radius: 50%;
  background: rgba(194,86,74,.12); pointer-events: none; z-index: 1;
}
.foe-move-label {
  position: absolute; transform: translate(-50%, 9px);
  font-family: var(--display); font-size: 9.5px; letter-spacing: .03em; color: #f0c4c0;
  background: rgba(0,0,0,.62); padding: 1px 6px; border-radius: 5px;
  white-space: nowrap; pointer-events: none; z-index: 3;
}

/* GM: Initiative-Kopfzeile — Buttons dürfen umbrechen, nie überlaufen */
.init-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.init-head .btn { padding: 3px 9px; flex: none; }

/* GM: aktiver Zug in der Initiative */
.party-row.init-on {
  border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent-wash);
}

/* GM: "Am Zug"-Banner im Party-Panel */
.turn-banner {
  display: flex; align-items: center; gap: 9px;
  margin: 9px 0 4px; padding: 8px 12px; border-radius: 9px;
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.turn-banner b { color: var(--accent); }
.turn-banner .turn-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent);
  animation: turn-pulse 1.8s ease-in-out infinite;
}
@keyframes turn-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 6%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .turn-banner .turn-dot { animation: none; } }

/* ---- Dedizierte Initiative-Leiste (GM + Spieler) ---- */
.init-tracker {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 14px; padding: 9px 14px;
  border: 1px solid var(--line-faint); border-radius: 11px;
  background: color-mix(in srgb, var(--surf, #15171a) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.init-tracker[hidden] { display: none; }
.init-tracker .it-label {
  flex: none; display: flex; align-items: center; gap: 9px;
  font-family: var(--display); font-size: 14px; letter-spacing: .03em; color: var(--head-ink);
}
.init-tracker .it-round {
  font-family: var(--display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); padding: 2px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-wash);
}
.init-tracker .it-track {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; gap: 7px;
  overflow-x: auto; padding: 2px 2px 4px; scroll-behavior: smooth;
}
.init-tracker .it-track::-webkit-scrollbar { height: 6px; }
.init-tracker .it-track::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 34%, transparent); border-radius: 4px; }
.init-tracker .it-track::-webkit-scrollbar-track { background: transparent; }
.it-ent {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 6px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel-2);
  transition: border-color .15s, background .15s, transform .15s;
}
.it-ent .it-val {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px;
  font-family: var(--display); font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.it-ent .it-name { font-size: 13px; color: var(--ink); }
.it-ent.foe .it-val { color: #d08a80; background: color-mix(in srgb, #c2564a 16%, transparent); }
.it-ent.foe .it-name { color: #d8b3ac; }
.it-ent.active {
  border-color: var(--accent); background: var(--accent-wash); transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-wash), 0 6px 16px rgba(0,0,0,.3);
}
.it-ent.active .it-val { color: var(--head-ink); background: color-mix(in srgb, var(--accent) 28%, transparent); }
.it-ent.active .it-name { color: var(--head-ink); }
.it-ent.dead { opacity: .42; }
.it-ent.dead .it-name { text-decoration: line-through; }
.init-tracker .it-ctrls { flex: none; display: flex; align-items: center; gap: 7px; }
.init-tracker .it-ctrls .btn { padding: 4px 10px; }

/* ---- Spieler-Initiative: prominente Karten (Porträt · Name · TP · Held/Gegner) ---- */
.init-tracker.it-rich { align-items: stretch; gap: 12px; padding: 4px 14px; border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.init-tracker.it-rich .it-label { align-self: center; }
.init-tracker.it-rich .it-track { gap: 8px; align-items: stretch; padding: 9px 2px 3px; }
.it-card {
  position: relative; flex: none; display: flex; align-items: center; gap: 8px;
  min-width: 132px; padding: 2px 10px 2px 7px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 9px; background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  transition: transform .16s, border-color .16s, box-shadow .16s, background .16s;
}
.it-card.foe { border-left-color: #c2564a; }
.it-pos {
  position: absolute; top: -6px; left: -6px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 9px;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
}
.it-av {
  flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--panel);
  border: 2px solid var(--accent); box-shadow: 0 1px 6px rgba(0,0,0,.45);
}
.it-card.foe .it-av { border-color: #c2564a; }
.it-pimg { width: 100%; height: 100%; object-fit: cover; }
.it-pini { font-family: var(--display); font-size: 11px; color: var(--head-ink); line-height: 1; }
.it-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.it-top { display: flex; align-items: baseline; gap: 6px; }
.it-nm { font-family: var(--display); font-size: 12.5px; color: var(--head-ink); white-space: nowrap; }
.it-kind { flex: none; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.it-card.foe .it-kind { color: #d08a80; }
.it-hp { display: block; width: 92px; max-width: 100%; height: 4px; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.36); }
.it-hp-fill { display: block; height: 100%; background: #7fae6a; transition: width .3s; }
.it-hp-fill.mid { background: #d9b86a; }
.it-hp-fill.low { background: #c2564a; }
.it-hp-txt { font-size: 10px; color: var(--ink); margin-top: -1px; }
.it-hp-txt.muted { color: var(--muted); }
.it-hp-max { color: var(--muted); }
.it-now {
  position: absolute; top: -8px; right: 7px; font-family: var(--display);
  font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); padding: 1px 7px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.it-card.active { border-color: var(--accent); background: var(--accent-wash); transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent-wash), 0 6px 18px rgba(0,0,0,.4); }
.it-card.active.foe { border-color: #c2564a; }
.it-card.dead { opacity: .45; }
.it-card.dead .it-nm { text-decoration: line-through; }
/* Undo-Button für Schaden/Heilung */
.hp-undo[hidden] { display: none !important; }
.hp-undo { display: inline-flex; align-items: center; gap: 5px; }
.hp-undo .hpu-label { font-family: var(--display); font-size: 11px; color: var(--muted); }
.hp-undo:hover .hpu-label { color: var(--accent); }

/* ---- Karten-Szenen (✦ Karte generieren) ---- */
.map.scene-cave {
  background:
    repeating-linear-gradient(0deg, rgba(110,180,190,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(110,180,190,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px),
    radial-gradient(130% 100% at 50% 0%, #24343b, #121b1f 75%);
}
.map.scene-forest {
  background:
    repeating-linear-gradient(0deg, rgba(130,190,120,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(130,190,120,.10) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px),
    radial-gradient(130% 100% at 50% 0%, #243227, #131a13 75%);
}
.map.scene-ruin {
  background:
    repeating-linear-gradient(0deg, rgba(215,170,115,.12) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(215,170,115,.12) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px),
    radial-gradient(130% 100% at 50% 0%, #362e26, #1c1712 75%);
}

/* ---- KI-Kartengenerator (Dialog) ---- */
.mapgen-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8,8,10,.62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mapgen-overlay[hidden] { display: none; }
.mapgen {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--panel); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.mg-head { display: flex; align-items: center; justify-content: space-between; }
.mg-input {
  resize: vertical; min-height: 58px; max-height: 160px;
  background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.45;
  outline: none;
}
.mg-input:focus { border-color: var(--accent); }
.mg-input::placeholder { color: var(--muted); }
.mg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mg-options[hidden] { display: none; }
/* Kartograf-Bericht + Weltkarte */
.mg-report {
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 9px 12px; display: flex; flex-direction: column; gap: 5px;
  background: var(--accent-wash); color: var(--ink); line-height: 1.5;
}
.mg-report[hidden] { display: none; }
.mg-report-h { font-family: var(--display); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.mg-world { border-top: 1px dashed var(--line-faint); padding-top: 10px; }
.mg-world[hidden] { display: none; }
.mg-world summary, .mg-archive summary { font-size: 12px; color: var(--muted); cursor: pointer; letter-spacing: .03em; }
.mg-world summary:hover, .mg-archive summary:hover { color: var(--head-ink); }
/* Karten-Archiv */
.mg-archive { border-top: 1px dashed var(--line-faint); padding-top: 10px; }
.mg-archive[hidden] { display: none; }
.mg-arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.mg-arch-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px; background: rgba(0,0,0,.18);
}
.mg-arch-card canvas { width: 100%; height: auto; border-radius: 5px; display: block; }
.mg-arch-name { font-family: var(--display); font-size: 12.5px; color: var(--head-ink); }
.mg-arch-editrow { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.mg-arch-editrow .mg-input { font-size: 12px; }
@media (max-width: 560px) { .mg-arch-grid { grid-template-columns: 1fr 1fr; } }
.mg-world-text {
  font-size: 12px; color: var(--muted); line-height: 1.6; margin: 9px 0;
  max-height: 180px; overflow-y: auto; padding: 9px 11px;
  border: 1px solid var(--line-faint); border-radius: 8px; background: rgba(0,0,0,.15);
}
.mg-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; background: rgba(0,0,0,.18);
}
.mg-canvas { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
/* prozedural gerenderte Tile-Map im Spieler-Viewport */
.map-tiles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 8px; }
.mg-name { font-family: var(--display); font-size: 14.5px; color: var(--head-ink); }
@media (max-width: 560px) { .mg-options { grid-template-columns: 1fr; } }

/* GM: XP-Freigabe-Zeile — Buttons umbrechen sauber */
.xp-queue-row { flex-wrap: wrap; gap: 6px; }

/* ===== Politur-Runde: Scrollbars, Fokus-Ringe, Detailfixes ===== */
/* dezente, schmale Scrollbalken passend zum dunklen Thema */
* { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.35) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(127,127,127,.3); border-radius: 5px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(127,127,127,.5); }

/* sichtbarer Tastatur-Fokus */
button:focus-visible, .btn:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Login: echte Checkbox */
.login-chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.login-chk input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* Heldenportrait: Zierrahmen, bis echtes Artwork da ist */
.hero-portrait { position: relative; }
.hero-portrait::after {
  content: ''; position: absolute; inset: 7px; pointer-events: none;
  border: 1px solid var(--line); border-radius: 5px;
}
.hero-portrait::before {
  content: '❧'; position: absolute; right: 12px; bottom: 8px; z-index: 1;
  font-size: 15px; color: var(--accent); opacity: .55;
}

/* GM: Party-HP nicht umbrechen */
.party-row > .xs { white-space: nowrap; }

/* GM: KI-Vorschlag-Buttons in einer Reihe */
.ai-card .flex { flex-wrap: nowrap; }
.ai-card .flex > .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 8px; }
.ai-card .flex > .btn.ghost { flex: 0 0 auto; }
/* KI-Vorschlag: Pin + „aktualisiert"-Hinweis */
.ai-pin { flex: 0 0 auto; padding: 3px 8px; line-height: 1; filter: grayscale(1); opacity: .6; }
.ai-pin:hover { opacity: 1; }
.ai-pin.on { filter: none; opacity: 1; border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.ai-updated {
  font-family: var(--body); font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 1px 7px; border-radius: 999px; margin-left: 6px; opacity: 0; transition: opacity .2s;
}
.ai-updated.show { opacity: 1; animation: stPulse 1.6s ease-in-out 1; }

/* Spieler: Schnellaktionen-Titel darf auf zwei Zeilen umbrechen statt abzuschneiden */
.qa-head .qa-title { white-space: normal; min-width: 0; font-size: 11px; letter-spacing: .04em; line-height: 1.2; }

/* ================= KOMPENDIUM ================= */
.comp-tabs { margin-bottom: 18px; align-self: flex-start; display: inline-flex; }
.comp-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.comp-side { display: flex; flex-direction: column; gap: 10px; }
.comp-search {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.comp-search:focus { outline: none; border-color: var(--accent); }
.comp-search::placeholder { color: var(--muted); }
.comp-list { display: flex; flex-direction: column; gap: 7px; max-height: 62vh; overflow-y: auto; padding-right: 3px; }
.comp-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  font: inherit; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); transition: border-color .15s, transform .12s;
}
.comp-item:hover { border-color: var(--accent); transform: translateX(2px); }
.comp-item.on { border-color: var(--accent); background: var(--accent-wash); }
.comp-item .ci-name { font-family: var(--display); font-size: 14.5px; color: var(--head-ink); letter-spacing: .02em; }
.comp-item .ci-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }
.comp-detail { padding: 24px 28px; min-height: 320px; position: sticky; top: 24px; }
.comp-h { font-family: var(--display); font-size: 26px; color: var(--head-ink); margin: 4px 0 12px; }
.comp-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.comp-chips .cc-l { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-right: 2px; }
.comp-desc { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin: 0 0 8px; max-width: 62ch; text-wrap: pretty; }
/* Gegner-Reiter: kompakte Detailkarte, damit die Karte nicht nach unten rutscht */
#foes .comp-detail { min-height: 0; padding: 14px 16px; position: static; }
#foes .comp-detail .eyebrow { font-size: 10.5px; margin-bottom: 2px; }
#foes .comp-detail .comp-h { font-size: 18px; margin: 2px 0 8px; }
#foes .comp-detail .comp-chips { gap: 6px; margin-bottom: 9px; }
#foes .comp-detail .comp-chips .chip { font-size: 11.5px; padding: 3px 9px; }
#foes .comp-detail .comp-desc { font-size: 12.5px; line-height: 1.45; margin: 0 0 6px; }
#foes .comp-detail .flex { margin-top: 10px !important; }
#foes .comp-detail .btn.sm { font-size: 12px; padding: 5px 11px; }
.comp-empty { padding: 18px 4px; }
.comp-rar { text-transform: capitalize; font-weight: 600; }
.comp-rar.r-common { color: var(--muted); }
.comp-rar.r-uncommon { color: #7fc08a; }
.comp-rar.r-rare { color: #6fa8d8; }
.comp-rar.r-vrare { color: #b08ad8; }
.comp-rar.r-legendary { color: #d8a05a; }
@media (max-width: 900px) { .comp-grid { grid-template-columns: 1fr; } .comp-detail { position: static; } }

/* ================= GEGNER VERWALTEN (eigener Screen) ================= */
.foes-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.foes-left { display: flex; flex-direction: column; gap: 14px; align-self: start; min-width: 0; }
.foes-lib { display: flex; flex-direction: column; }
.foes-lib .comp-search { margin-bottom: 0; }
.foes-list { max-height: 56vh; }
.foes-hg button { font-size: 11.5px; }
.foe-del { color: var(--muted); }
.foe-del:hover { color: #e08378; border-color: #c2564a; }
.foes-grid .comp-detail { min-height: 0; position: static; padding: 20px 22px; }
/* Kartenvorschau: größer (Bestiarium schmaler ⇒ mehr Platz), Obergrenze 880px (816:476) */
.foes-grid .gm-map-preview { margin-bottom: 4px; cursor: pointer; max-width: 880px; }
/* Szene: Gegner-Roster wieder UNTER der Karte (einspaltig gestapelt) */
.foes-scene-split { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.foes-map-side { min-width: 0; }
/* Szenen-Roster: automatisches Raster — Karten ~halbe Breite, packen 2–3 nebeneinander, fallen eng auf 1 Spalte zurück */
.foes-scene-list.col { min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 5px 10px; align-items: start; }
/* Begegnungshärte-Ampel über dem Szenen-Roster */
.enc-diff { display: flex; align-items: center; gap: 9px; padding: 7px 12px; margin-bottom: 3px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.12); }
.enc-diff .ed-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.enc-diff .ed-lbl { font-size: 13.5px; color: var(--ink); }
.enc-diff .ed-lbl b { font-family: var(--display); letter-spacing: .02em; }
.enc-diff .ed-meta { margin-left: auto; white-space: nowrap; }
.enc-diff.lvl-leicht   { border-color: color-mix(in oklab, #4aa874 45%, var(--line)); }
.enc-diff.lvl-leicht   .ed-dot { background: #4aa874; }
.enc-diff.lvl-leicht   .ed-lbl b { color: #6fc294; }
.enc-diff.lvl-mittel   { border-color: color-mix(in oklab, #c8a046 50%, var(--line)); }
.enc-diff.lvl-mittel   .ed-dot { background: #c8a046; }
.enc-diff.lvl-mittel   .ed-lbl b { color: #d8b765; }
.enc-diff.lvl-schwer   { border-color: color-mix(in oklab, #cc7a3a 55%, var(--line)); }
.enc-diff.lvl-schwer   .ed-dot { background: #d68641; }
.enc-diff.lvl-schwer   .ed-lbl b { color: #e0975a; }
.enc-diff.lvl-toedlich { border-color: color-mix(in oklab, #c1453f 60%, var(--line)); background: rgba(193,69,63,.1); }
.enc-diff.lvl-toedlich .ed-dot { background: #d2564f; animation: stPulse 1.8s ease-in-out infinite; }
.enc-diff.lvl-toedlich .ed-lbl b { color: #e06b64; }

/* ---- KI-Transparenz: dezentes „✦ KI"-Badge an KI-Nachrichten ---- */
.msg.ki .who::after {
  content: '✦ KI'; margin-left: 7px; font-size: 8.5px; letter-spacing: .1em; font-weight: 600;
  color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 42%, transparent);
  border-radius: 9px; padding: 1px 5px; vertical-align: middle; opacity: .82; white-space: nowrap;
}
/* ---- Einmaliger KI-Nutzungshinweis (nicht blockierend) ---- */
.ai-notice {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 160%); z-index: 10400;
  display: flex; align-items: center; gap: 12px; width: min(620px, 92vw);
  background: var(--panel, #212329); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 11px; box-shadow: 0 16px 44px rgba(0,0,0,.46); padding: 11px 14px;
  transition: transform .34s cubic-bezier(.2,.8,.2,1);
}
.ai-notice.show { transform: translate(-50%, 0); }
.ai-notice .ain-ic { color: var(--accent); font-size: 16px; flex: none; }
.ai-notice .ain-txt { font-family: var(--body); font-size: 12.5px; line-height: 1.5; color: var(--ink); flex: 1; }
.ai-notice .ain-txt a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; cursor: pointer; }
.ai-notice .ain-txt a:hover { border-bottom-color: var(--accent); }
.ai-notice .ain-ok {
  flex: none; cursor: pointer; font-family: var(--body); font-size: 12.5px; color: var(--head-ink);
  background: var(--accent-wash, rgba(200,160,70,.14)); border: 1px solid var(--accent);
  border-radius: 7px; padding: 6px 12px; white-space: nowrap;
}
.ai-notice .ain-ok:hover { background: var(--accent); color: var(--on-accent, #1a1c1e); }
@media (max-width: 900px) { .foes-grid { grid-template-columns: 1fr; } }

/* Toggle-Button aktiv (Tokens sichtbar) */
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

.tok {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 13px;
  border: 2px solid var(--head-ink); background: var(--panel); color: var(--head-ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: grab;
}
.tok.draggable { cursor: grab; }
.tok.draggable:active { cursor: grabbing; }
.tok.dragging { opacity: 0.8; z-index: 1000; box-shadow: 0 4px 16px rgba(0,0,0,.7); }
.tok.ally { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(200,160,70,.4); }
.tok.me { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 16px rgba(200,160,70,.55); }
.tok.foe { border-color: #c2564a; color: #e08378; box-shadow: 0 0 12px rgba(194,86,74,.4); }
/* Gegner-Token nach Kreaturengröße (D&D). Boden = bisherige Standardgröße 30px:
   Winzig/Klein/Mittelgroß bleiben gleich, größere Kreaturen skalieren hoch.
   Übergang animiert, damit Größenwechsel nicht springt. */
.tok.foe[data-size] { transition: width .18s ease, height .18s ease, font-size .18s ease; }
.tok.foe[data-size="large"]      { width: 40px; height: 40px; font-size: 15px; }
.tok.foe[data-size="huge"]       { width: 50px; height: 50px; font-size: 18px; }
.tok.foe[data-size="gargantuan"] { width: 62px; height: 62px; font-size: 22px; }
/* Token mit Charakterbild */
.tok .tok-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; pointer-events: none; user-select: none; }
/* Gegner-Token: Typ-Silhouette / hochgeladenes Bild + Nummern-Badge */
.tok .tok-art { position: absolute; inset: 3px; display: grid; place-items: center; pointer-events: none; }
/* Hochgeladenes Gegnerbild füllt bündig bis an den (roten) Ring — kein Spalt */
.tok .tok-art:has(.foe-art-img) { inset: 0; }
.tok .foe-sil-svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.6)); display: block; }
.tok .foe-art-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.tok .tok-num { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; font-family: var(--display); font-size: 9px; line-height: 1; display: grid; place-items: center; background: #c2564a; color: #fff; border: 1px solid rgba(0,0,0,.45); }
/* Gegner-Avatare: Roster, Bestiarium-Kopf, Initiative-Kugel (Silhouette oder Bild) */
.foe-sil-svg { fill: currentColor; display: block; }
.foe-avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; background: var(--panel-2); border: 1.5px solid #c2564a; color: #e08378; }
.foe-avatar .foe-sil { width: 100%; height: 100%; display: grid; place-items: center; }
.foe-avatar .foe-sil-svg { width: 72%; height: 72%; }
.foe-avatar .foe-art-img { width: 100%; height: 100%; object-fit: cover; }
.foe-avatar.xs { width: 26px; height: 26px; }
.foe-avatar.sm { width: 32px; height: 32px; }
.foe-avatar.lg { width: 62px; height: 62px; border-width: 2px; box-shadow: 0 3px 12px rgba(0,0,0,.4); }
.foe-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
/* Kompendium-Monster: größeres Porträt über den Werten */
.foe-avatar.comp-foe-art { width: 132px; height: 132px; border-radius: 14px; margin: 0 0 14px; box-shadow: 0 4px 16px rgba(0,0,0,.45); }
.foe-avatar.comp-foe-art .foe-sil-svg { width: 60%; height: 60%; }
.foe-detail-head .min0 { min-width: 0; }
.it-card.foe .it-av { color: #e08378; }
.it-av .foe-sil { width: 100%; height: 100%; display: grid; place-items: center; }
.it-av .foe-sil-svg { width: 88%; height: 88%; fill: #fff; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.6)); }
.it-av .foe-art-img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Zoom-Controls für die Karte (jetzt in der Werkzeugzeile unter der Karte) ---- */
.zoom-level {
  font-family: var(--display); font-size: 12px; letter-spacing: .06em;
  color: var(--muted); min-width: 42px; text-align: center;
}
[data-zoom] {
  font-size: 16px; font-weight: 700; padding: 6px 10px; min-width: 36px; text-align: center;
}
.map-tools { flex: 1 1 100%; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }

/* Map-Tools Button Active State */
.btn[data-map-measure].active,
.btn[data-map-center].active {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Bewegungsradius-Ring ---- */
.move-ring {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 2;
  border: 2px dashed; transition: opacity .2s;
  animation: ring-in .2s ease-out both;
}
@keyframes ring-in {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
.move-ring-label {
  position: absolute; transform: translateX(-50%);
  font-family: var(--display); font-size: 11px; letter-spacing: .05em; white-space: nowrap;
  color: var(--head-ink); background: rgba(20,22,24,.9);
  border: 1px solid var(--accent); border-radius: 5px; padding: 2px 8px;
  pointer-events: none; z-index: 7;
}
.tok.selected { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Messwerkzeug ---- */
.map.measuring, .map.measuring .tok { cursor: crosshair; }
.measure-dot {
  position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(200,160,70,.8);
  pointer-events: none; z-index: 5;
}
.measure-line {
  position: absolute; height: 2px; background: var(--accent); opacity: .85;
  transform-origin: 0 50%; box-shadow: 0 0 6px rgba(200,160,70,.5);
  pointer-events: none; z-index: 4;
}
.measure-label {
  position: absolute; transform: translate(-50%, -135%);
  font-family: var(--display); font-size: 11px; letter-spacing: .05em; white-space: nowrap;
  color: var(--head-ink); background: rgba(20,22,24,.92);
  border: 1px solid var(--accent); border-radius: 5px; padding: 3px 8px;
  pointer-events: none; z-index: 6;
}

/* Viewport für die Map — feste Größe, scrollbar bei Zoom */
.map-viewport {
  position: relative;
  width: 100%;
  min-height: 430px;
  max-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(0,0,0,.32);
}

.map-viewport .map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  transform-origin: top left;
  transition: transform .2s ease-out;
}

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 8px; }
/* In den Play-Spalten füllt der Chat die Höhe, damit der Composer unten am Panel sitzt */
.play-col .chat.grow { max-height: none; min-height: 0; }
/* GM-Erzählung: Höhe deckeln, damit der Chat selbst scrollt (nicht die ganze Seite) */
/* GM-Erzählung: Chat füllt die Spaltenhöhe (an Party+Karte ausgerichtet) und scrollt intern,
   ohne die Spalte selbst zu verlängern (flex-basis 0) → schließt mit der Karte ab */
#gm .chat.grow { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; }
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.chat::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.msg { border-radius: 10px; padding: 9px 12px; font-size: 13.5px; line-height: 1.5; max-width: 92%; border: 1px solid var(--line-faint); background: var(--panel-2); }
.msg .who { font-family: var(--display); font-size: 11.5px; letter-spacing: .04em; color: var(--accent); margin-bottom: 3px; }
.msg.narr { background: rgba(0,0,0,.22); border-color: var(--line-faint); }
.msg.narr .who { color: var(--muted); }
.msg.me { margin-left: auto; background: var(--accent-wash); border-color: var(--accent); }
.msg.me .who { color: var(--accent); }
.msg.roll { font-family: var(--display); color: var(--head-ink); }
.msg.roll.hidden { border-style: dashed; opacity: .8; }
.msg.rollin { animation: msgIn .28s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* interactive dice tray */
.action-chip { cursor: pointer; }
.action-chip.save-prof { border-color: var(--accent); }
.action-chip.save-prof::before { content: '\25CF'; color: var(--accent); font-size: 7px; margin-right: 5px; vertical-align: middle; }
.action-chip:hover { border-color: var(--accent); color: var(--accent); }
.action-chip .grade {
  display: inline-grid; place-items: center; margin-left: 6px;
  width: 15px; height: 15px; border-radius: 50%; font-size: 9.5px;
  background: var(--accent); color: var(--on-accent); font-family: var(--display);
}
.quick-slots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.quick-slots .slot {
  display: inline-flex; align-items: center; gap: 5px; cursor: default;
  font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--line-faint); border-radius: 6px; background: var(--panel-2);
}
.quick-slots .slot b { font-family: var(--display); color: var(--accent); }
.quick-slots .pips { letter-spacing: 1px; color: var(--accent); }
.quick-slots .pips .off { color: var(--line); }

/* ---- Schnellaktionen: umschaltbare Kopfzeile (Zauber ↔ Angriff) ---- */
.qa-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.qa-head .qa-title { flex: 1; text-align: center; margin: 0; padding-bottom: 0; border-bottom: none; }
.qa-arrow {
  width: 24px; height: 24px; flex: none; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  font-size: 15px; line-height: 1; display: grid; place-items: center; transition: .15s;
}
.qa-arrow:hover { border-color: var(--accent); color: var(--accent); }
.qa-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 10px; }
.qa-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: .2s; }
.qa-dot.on { background: var(--accent); box-shadow: 0 0 8px rgba(200,160,70,.5); }
.action-chip .atk-hit { font-family: var(--display); color: var(--accent); margin-left: 2px; }
.action-chip .atk-kind {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  margin-left: 6px; padding: 1px 6px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--muted);
}
.die-type { cursor: pointer; }
.die-stage { display: flex; justify-content: center; align-items: center; padding: 4px 0 12px; }
.die-face {
  width: 82px; height: 82px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--display); font-size: 36px; color: var(--head-ink);
  background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: inset 0 0 18px rgba(0,0,0,.4), 0 8px 20px rgba(0,0,0,.32);
  transition: color .15s, border-color .15s, box-shadow .2s;
}
.die-face.rolling { color: var(--accent); animation: dieRoll .12s linear infinite; }
@keyframes dieRoll { 0% { transform: rotate(-9deg) scale(.95); } 50% { transform: rotate(9deg) scale(1.05); } 100% { transform: rotate(-9deg) scale(.95); } }
.die-face.settled { animation: diePop .38s ease; }
@keyframes diePop { 0% { transform: scale(1.28); } 55% { transform: scale(.93); } 100% { transform: scale(1); } }
.die-face.crit { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 28px rgba(200,160,70,.55), inset 0 0 16px rgba(200,160,70,.22); }
.die-face.fail { color: #cc7a7a; border-color: #9c5a5a; box-shadow: inset 0 0 16px rgba(160,70,70,.3); }
.die-result { text-align: center; }
.dice-tray .seg-row button { padding: 7px 4px; }

/* ---- frei verschiebbares Würfel-Popup ---- */
.dice-popup {
  position: fixed; right: 20px; bottom: 84px; z-index: 120; width: 300px;
  background: rgba(22,24,26,.97); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0,0,0,.6);
  display: none; overflow: hidden;
}
.dice-popup.on { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .dice-popup.on { animation: dpIn .2s ease both; }
}
@keyframes dpIn { from { transform: translateY(10px) scale(.98); } to { transform: none; } }
.dp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; cursor: grab; user-select: none; touch-action: none;
  background: rgba(0,0,0,.28); border-bottom: 1px solid var(--line-faint);
}
.dp-head:active { cursor: grabbing; }
.dp-title { font-family: var(--display); font-size: 13px; letter-spacing: .06em; color: var(--head-ink); }
.dp-x { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.dp-x:hover { color: var(--head-ink); border-color: var(--accent); }
.dp-body { padding: 16px; }
.dice-popup .dp-gm { display: none; }
.dice-popup.gm-mode .dp-gm { display: flex; }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.composer .grow { flex: 1; color: var(--muted); font-size: 13.5px; }
.chat-input {
  flex: 1; resize: none; min-height: 36px; max-height: 120px; overflow-y: auto;
  background: transparent; border: none; outline: none;
  padding: 4px 2px; font-size: 13.5px; color: var(--head-ink); font-family: var(--body);
  line-height: 1.45;
}
.chat-input::placeholder { color: var(--muted); }
/* KI-Chip aktiv */
[data-chat-composer="gm"] .chip.accent.on {
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 12px rgba(200,160,70,.3);
}
/* GM: Nachricht freigeben */
.pub-row { margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line-faint); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pub-btn.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.msg.map-marked { border-color: var(--accent); }
.pub-btn {
  font-family: var(--display); font-size: 11px; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  transition: .15s;
}
.pub-btn:hover { background: var(--accent); color: var(--on-accent); }
.pub-done { font-size: 11px; color: #7fc08a; letter-spacing: .04em; }
.msg.published { border-color: rgba(127,192,138,.35); }

/* GM / Player columns */
.play-cols { display: grid; gap: var(--d-col-gap, 18px); }
.gm-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 0.85fr); }
.pl-cols { grid-template-columns: 224px 1fr 278px; }

/* Spieler-Chat: getrennte Logs — Geschichte (Erzählung + Aktionen) ⇄ Würfe & Aktionen.
   Karte bleibt groß, Geschichte sitzt darunter im Center, Würfel-Log rechts über die volle Höhe. */
.pl-grid {
  display: grid; gap: 18px;
  grid-template-columns: 224px 1fr 278px;
  grid-template-areas:
    "sheet map   dice"
    "sheet story dice";
}
.pl-grid .pl-sheet     { grid-area: sheet; align-self: start; }

/* Schlanke Identitätskarte — gibt dem Zauber-Panel oben Raum */
.pl-id-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 11px; }
.pl-id-head { display: flex; align-items: center; gap: 11px; }
.pl-id-meta { min-width: 0; text-align: left; }
.pl-id-name { font-family: var(--display); font-size: 16px; color: var(--head-ink); line-height: 1.15; }
.pl-mini .ms { padding: 6px 4px; }
.pl-mini .ms .v { font-size: 17px; }

/* Zauber/Schnellaktionen optisch in den Vordergrund */
.pl-qa { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-wash), 0 8px 22px rgba(0,0,0,.28); }
.pl-qa .qa-head .qa-title { font-size: 12.5px; color: var(--accent); }

/* Aktions-Ökonomie-Tracker (Spieler) — pro Zug abhakbar */
.econ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.econ-chip {
  display: flex; align-items: center; justify-content: center; min-width: 0;
  box-sizing: border-box; white-space: nowrap;
  font-family: var(--display); font-size: 11px; letter-spacing: .01em;
  padding: 8px 7px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent-wash); color: var(--head-ink); cursor: pointer;
  text-align: center; transition: .15s;
}
.econ-chip:hover { box-shadow: 0 0 0 1px var(--accent); }
.econ-chip.used {
  color: var(--muted); border-color: var(--line); border-style: dashed;
  background: transparent; text-decoration: line-through; box-shadow: none;
}
.pl-grid .pl-map-col   { grid-area: map; }
.pl-grid .pl-story-col { grid-area: story; }
.pl-grid .pl-dice-col  { grid-area: dice; }
/* Beide Logs unabhängig scrollbar, Höhe gedeckelt */
.pl-grid .pl-story-col .chat { max-height: 300px; overflow-y: auto; }
.pl-grid .pl-dice-col .chat { max-height: 620px; overflow-y: auto; }
.play-col { display: flex; flex-direction: column; gap: var(--d-stack-gap, 14px); min-width: 0; }
.panel-h { font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--d-panelh-mb, 10px); padding-bottom: 6px; border-bottom: 1px solid var(--line-faint); display: flex; align-items: center; justify-content: space-between; }
.party-row { display: flex; align-items: center; gap: 7px; padding: 7px 8px; }

/* GM: Party-Liste scrollt, wenn viele Mitglieder dabei sind */
#gm [data-party-list] {
  max-height: 42vh; overflow-y: auto; overscroll-behavior: contain;
  margin-right: -6px; padding-right: 6px;
}
#gm [data-party-list]::-webkit-scrollbar { width: 7px; }
#gm [data-party-list]::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 38%, transparent); border-radius: 4px;
}
#gm [data-party-list]::-webkit-scrollbar-track { background: transparent; }
.party-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-size: 12px; color: var(--accent); font-family: var(--display); }
.ai-card { border: none; background: none; border-radius: 0; padding: 0; box-shadow: none; }
.skel { height: 9px; border-radius: 5px; background: var(--line-faint); }
.skel.t { background: rgba(210,205,190,.3); height: 11px; }
.queue-row { display: flex; align-items: center; gap: 8px; padding: 9px 11px; }

.mini-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-auto-rows: 1fr; }
.mini-stat .ms { text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.mini-stat .ms .l { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mini-stat .ms .v { font-family: var(--display); font-size: 20px; color: var(--head-ink); }

/* ---------------- prototype nav (review aid) ---------------- */
.proto-nav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 4px; padding: 6px;
  max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none;
  background: rgba(20,22,24,.86); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 30px;
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
.proto-nav .pn {
  font-family: var(--display); font-size: 12px; letter-spacing: .03em;
  padding: 7px 13px; border-radius: 20px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: .15s;
}
.proto-nav .pn:hover { color: var(--head-ink); }
.proto-nav .pn.on { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 14px rgba(200,160,70,.4); }
.proto-nav .pn .num { opacity: .6; margin-right: 5px; font-size: 10.5px; }
.proto-nav::-webkit-scrollbar { display: none; }
.proto-nav .pn, .proto-nav .proto-arrow, .proto-nav .proto-tag, .proto-nav .proto-hide { flex: none; }
.proto-arrow { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--head-ink); cursor: pointer; display: grid; place-items: center; }
.proto-arrow:hover { border-color: var(--accent); }

/* Kennzeichnung: Demo-Werkzeug, nicht Teil des Produkts */
.proto-tag {
  font-family: var(--mono, "Courier Prime", monospace); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--line); border-radius: 14px;
  padding: 4px 10px; margin-right: 4px; cursor: help; white-space: nowrap; user-select: none;
}
.proto-hide {
  width: 24px; height: 24px; margin-left: 4px; border: none; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 11px;
  display: grid; place-items: center;
}
.proto-hide:hover { color: var(--head-ink); background: var(--panel-2); }
.proto-nav { transition: transform .25s ease, opacity .25s ease; }
body.proto-hidden .proto-nav { transform: translateX(-50%) translateY(80px); opacity: 0; pointer-events: none; }
.proto-restore {
  position: fixed; right: 14px; bottom: 14px; z-index: 80;
  font-family: var(--mono, "Courier Prime", monospace); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); background: var(--panel-2); border: 1px dashed var(--line); border-radius: 14px;
  padding: 5px 11px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.proto-restore:hover { color: var(--head-ink); border-color: var(--accent); }
body.proto-hidden .proto-restore { opacity: .85; pointer-events: auto; }
/* Live-Betrieb (DEMO aus): Prototyp-Leiste ist Admins vorbehalten.
   data-admin pflegt s-auth bei jeder Auth-Änderung → Login/Logout wirken sofort. */
body[data-demo="off"]:not([data-admin="1"]) .proto-nav,
body[data-demo="off"]:not([data-admin="1"]) .proto-restore { display: none !important; }

/* Demo-Perspektivwechsel GM ⇄ Spieler (Review-Werkzeug, gestrichelt wie .proto-tag) */
.persp-switch {
  display: inline-flex; gap: 2px; padding: 3px; margin-left: 12px;
  border: 1px dashed var(--line); border-radius: 16px; flex: none;
}
.persp-switch button {
  font-family: var(--display); font-size: 11px; letter-spacing: .04em;
  padding: 4px 11px; border: none; border-radius: 12px; background: transparent;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: .15s;
}
.persp-switch button:hover { color: var(--head-ink); }
.persp-switch button.on { background: var(--accent); color: var(--on-accent); cursor: default; }

/* ---- Inline-Icon-Set (ersetzt funktionale Emoji) ---- */
.ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05em; height: 1.05em; flex: none;
  vertical-align: -0.16em; line-height: 1;
}
.ic svg { width: 100%; height: 100%; display: block; }
/* Icon-Halter im Avatar-/Support-Menü zentrieren die Glyphe ohnehin */
.am-ic .ic, .sr-ic .ic, .le-icon .ic, .ac-icon .ic { width: 1em; height: 1em; vertical-align: -0.12em; }
.le-icon .ic { width: 1.4em; height: 1.4em; }
.ac-icon .ic { width: 1.3em; height: 1.3em; }

/* GM-only Kennzeichnung & Zugriffsschutz für die Gegner-Verwaltung */
.chip.gm-only { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); white-space: nowrap; }
body[data-persp="player"] .proto-nav .pn-gm { display: none; }
body[data-persp="player"] #ready [data-gm-only] { display: none; }
.proto-nav .pn-gm .num { filter: grayscale(1); }
.gm-only-toast {
  position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 12px);
  z-index: 200; padding: 11px 18px; border-radius: 24px;
  background: var(--surf, #23262b); color: var(--head-ink, #eee);
  border: 1px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  font-size: 13.5px; letter-spacing: .01em; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.gm-only-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* role banner for play screens */
.role-banner { display: flex; align-items: center; gap: 12px; margin-bottom: var(--d-banner-mb, 18px); }
.role-banner .tag { font-family: var(--display); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 5px 13px; border-radius: 20px; border: 1px solid var(--accent); color: var(--accent); background: var(--accent-wash); white-space: nowrap; flex: none; }

.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.col { display: flex; flex-direction: column; }
.pad { padding: var(--d-pad, 16px); }
.padl { padding: 22px; }

/* =================================================================
   CHARACTER CREATION WIZARD (screen #create)
   ================================================================= */
.wz { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; }
.wz-rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.wz-stepitem {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 9px;
  cursor: pointer; color: var(--muted); border: 1px solid transparent; transition: .18s;
}
.wz-stepitem:hover { color: var(--ink); }
.wz-stepitem.on { color: var(--head-ink); background: var(--accent-wash); border-color: var(--accent); }
.wz-stepitem.done { color: var(--ink); }
.wz-num {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-family: var(--display); font-size: 13px;
  color: var(--muted); background: var(--panel-2);
}
.wz-stepitem.on .wz-num { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(200,160,70,.4); }
.wz-stepitem.done .wz-num { border-color: var(--accent); color: var(--accent); }
.wz-stepitem .lbl { font-family: var(--display); font-size: 14px; letter-spacing: .02em; }
.wz-stepitem .sub { font-size: 11px; color: var(--muted); }

.wz-body { min-height: 440px; }
.wz-step { display: none; }
.wz-step.on { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .wz-step.on.wz-anim { animation: fade .25s ease both; }
}
.wz-step .wz-head { margin-bottom: 18px; }
.wz-step .wz-head h2 { font-size: 24px; }
.wz-step .wz-head .hint { color: var(--muted); font-size: 14px; margin-top: 4px; }

.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .pick-grid, #raceParents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pick-card {
  position: relative; padding: 16px; cursor: pointer; transition: transform .12s, border-color .2s, box-shadow .2s; min-width: 0;
  border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: var(--panel);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.pick-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.pick-card.sel { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 0 0 1px var(--accent), 0 0 26px rgba(200,160,70,.18); }
.pick-card.sel::after { content: "✦"; position: absolute; top: 11px; right: 13px; color: var(--accent); font-size: 14px; }
.pick-icon {
  width: 46px; height: 46px; border-radius: 10px; margin-bottom: 11px;
  background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--display); font-size: 22px; color: var(--accent);
}
.pick-card h3 { font-size: 17px; }
.pick-card .blurb { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 5px 0 10px; }
.pick-card .traits { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Volk-Karten mit Drehung: Untervolk auf der Rückseite ---- */
#raceParents { perspective: 1400px; grid-auto-rows: 1fr; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#raceParents .pick-card { padding: 0; background: transparent; border: none; box-shadow: none !important; display: grid; min-width: 0; }
#raceParents .pick-card.sel::after { content: none; }
.flip-inner { display: grid; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4, .2, .2, 1); height: 100%; }
.pick-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; min-width: 0;
  border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: var(--panel);
  box-shadow: 0 8px 22px rgba(0,0,0,.28); padding: 16px;
  display: flex; flex-direction: column;
}
.flip-back { transform: rotateY(180deg); }
#raceParents .pick-card:hover .flip-face { border-color: var(--accent); }
#raceParents .pick-card.sel .flip-face { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 26px rgba(200,160,70,.18); }
#raceParents .pick-card.sel .flip-front { background: var(--accent-wash); position: relative; }
#raceParents .pick-card.sel .flip-front::after { content: "✦"; position: absolute; top: 11px; right: 13px; color: var(--accent); font-size: 14px; }
.flip-subnote { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-faint); font-size: 12px; color: var(--muted); }
.flip-subnote b { color: var(--accent); font-family: var(--display); }
.flip-front .traits { margin-bottom: 12px; }
.flip-front .blurb { min-height: 2.9em; }
.flip-back-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.flip-back-head h3 { font-size: 16px; }
.flip-back-eyebrow { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.flip-return { width: 28px; height: 28px; flex: none; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.flip-return:hover { color: var(--head-ink); border-color: var(--accent); }
.sub-list { display: flex; flex-direction: column; gap: 7px; }
.sub-opt { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-faint); border-radius: 8px; cursor: pointer; background: rgba(0,0,0,.14); transition: border-color .15s, background .15s; }
.sub-opt:hover { border-color: var(--accent); }
.sub-opt.on { border-color: var(--accent); background: var(--accent-wash); }
.sub-icon { width: 28px; height: 28px; flex: none; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--display); font-size: 13px; color: var(--accent); }
.sub-name { flex: 1; min-width: 0; font-family: var(--display); font-size: 13.5px; color: var(--head-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-opt .chip { flex: none; font-size: 10px; padding: 2px 7px; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* ability allocator */
.alloc { display: flex; flex-direction: column; gap: 10px; max-width: 540px; }
.alloc-row { display: flex; align-items: center; gap: 14px; padding: 11px 16px; }
.alloc-row .nm { width: 120px; font-family: var(--display); font-size: 15px; color: var(--head-ink); }
.alloc-row .ctrl { display: flex; align-items: center; gap: 12px; }
.alloc-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--head-ink); font-size: 18px; cursor: pointer; line-height: 1;
  display: grid; place-items: center;
}
.alloc-btn:hover { border-color: var(--accent); color: var(--accent); }
.alloc-btn[disabled] { opacity: .3; cursor: not-allowed; }
.alloc-row .score { width: 30px; text-align: center; font-family: var(--display); font-size: 22px; color: var(--head-ink); }
.alloc-row .mod { width: 64px; text-align: center; }
.alloc-row .mod b { color: var(--accent); font-family: var(--display); }
.alloc-row .race { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.points { display: flex; align-items: center; gap: 10px; }
.points .big { font-family: var(--display); font-size: 24px; color: var(--accent); }

.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; max-width: 620px; }
.skill-chip {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--line-faint); border-radius: 8px; background: var(--panel-2); font-size: 13.5px;
  transition: .15s;
}
.skill-chip:hover { border-color: var(--accent); }
.skill-chip .box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-size: 11px; color: var(--on-accent); }
.skill-chip.on { border-color: var(--accent); background: var(--accent-wash); color: var(--head-ink); }
.skill-chip.on .box { background: var(--accent); border-color: var(--accent); }
.skill-chip.lock { opacity: .45; cursor: not-allowed; }
.skill-chip.granted { cursor: default; }
.skill-chip.granted:hover { border-color: var(--accent); }

.align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; }
.align-cell { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 6px; border: 1px solid var(--line-faint); border-radius: 7px; background: var(--panel-2); font-size: 12px; line-height: 1.2; cursor: pointer; }
.align-cell:hover { border-color: var(--accent); }
.align-cell.on { border-color: var(--accent); background: var(--accent-wash); color: var(--head-ink); }
/* Feinschliff (Schritt 5): Portrait & Name größer, Gesinnung etwas tiefer */
.wz-step[data-step="5"] .portrait-slot { width: 146px; height: 146px; font-size: 11px; }
.wz-step[data-step="5"] .fld.grow > label { font-size: 13.5px; }
.wz-step[data-step="5"] #heroName { font-size: 15px; padding: 11px 13px; }
.wz-step[data-step="5"] .fld.grow { width: 100%; max-width: 248px; }
.wz-step[data-step="5"] .fld:has(.align-grid) { margin-top: 14px; }

.summary { display: flex; flex-direction: column; gap: 9px; }
.summary .srow { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dotted var(--line-faint); font-size: 14px; }
.summary .srow .k { color: var(--muted); }
.summary .srow .v { font-family: var(--display); color: var(--head-ink); }

/* Footer klebt am unteren Rand, damit „Weiter“ ohne Scrollen erreichbar ist */
.wz-footer {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; bottom: 64px; z-index: 20;
  margin: 22px 0 0 276px; padding: 6px 14px;
  background: color-mix(in srgb, var(--pop-bg) 62%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-faint); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
body.proto-hidden .wz-footer { bottom: 14px; }
.wz-footer .btn { padding: 6px 13px; font-size: 12.5px; min-height: 0; }
.wz-footer .stepdots { display: flex; gap: 7px; }
.wz-footer .stepdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.wz-footer .stepdots i.on { background: var(--accent); box-shadow: 0 0 8px rgba(200,160,70,.5); }
.portrait-slot {
  width: 110px; height: 110px; border-radius: 12px; border: 1px dashed var(--line);
  background: var(--panel-2); display: grid; place-items: center; text-align: center;
  cursor: pointer; transition: border-color .15s; background-size: cover; background-position: center;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding: 8px;
}
.portrait-slot:hover, .portrait-slot.drag { border-color: var(--accent); color: var(--head-ink); }
.portrait-slot { position: relative; }
.portrait-slot .portrait-x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s, color .15s, border-color .15s;
}
.portrait-slot.has-img:hover .portrait-x { opacity: 1; }
.portrait-slot .portrait-x:hover { color: #e08378; border-color: #c2564a; }
.portrait-slot.has-img { border-style: solid; }
.portrait-slot .portrait-swap { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 5px; opacity: 0; transition: opacity .15s; }
.portrait-slot.has-img:hover .portrait-swap { opacity: 1; }
.rail-portrait, .hero-portrait, .sheet-head .portrait { overflow: hidden; }
/* Basisregel: ein Porträt-Bild füllt IMMER seinen Rahmen (Avatar, Token, Rail …)
   — ohne diese Regel rendert <img class="pimg"> in Originalgröße (z. B. im
   Spieler-Avatar und auf dem eigenen Karten-Token). */
.pimg { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.rail-portrait .pimg, .hero-portrait .pimg, .sheet-head .portrait .pimg { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.party-dot { overflow: hidden; }
.party-dot .pimg { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* Drachenerbe: kompakte 2-Spalten-Liste auf der Kartenrückseite */
.sub-list.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sub-list.cols2 .sub-opt { padding: 6px 8px; gap: 7px; }
.sub-list.cols2 .sub-opt .chip { display: none; }

/* GM: Gegner-Liste mit TP-Leiste */
.foe-hpbar { width: 54px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; flex: none; }
.foe-hpbar i { display: block; height: 100%; background: #c2564a; transition: width .2s; }
.foe-row.dead { opacity: .55; }
.tok.tok-dead { opacity: .35; filter: grayscale(.8); }
.party-row .alloc-btn { width: 20px; height: 20px; font-size: 12px; flex: none; }
.foe-atk { color: #d98b7e; font-size: 11px; }
.foe-atk:hover { color: #fff; background: #b34a3f; border-color: #b34a3f; }
/* Angriffsziel-Zuweisung im Gegner-Reiter */
.foe-target-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.foe-target-tools .xs { margin-right: 2px; }
.foe-entry { display: flex; flex-direction: column; gap: 3px; padding: 4px 6px; border-radius: 8px; min-width: 0; }
.foe-entry:hover { background: rgba(0,0,0,.14); }
.foe-entry.dead { opacity: .6; }
.foe-target-row { display: flex; align-items: center; gap: 8px; padding: 0 2px 2px 10px; }
.foe-target-row .ftr-ic { font-size: 11.5px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.foe-target-row.set .ftr-ic { color: #e0978a; }
.foe-target-sel {
  flex: 1; min-width: 0; font-family: var(--body); font-size: 13.5px; font-weight: 500;
  color: var(--head-ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; cursor: pointer; outline: none; min-height: 36px;
}
.foe-target-sel:hover { border-color: var(--accent); }
.foe-target-sel:focus { border-color: var(--accent); }
/* geöffnete Options-Liste lesbar machen (sonst erbt sie teils Systemfarben) */
.foe-target-sel option { background: var(--pop-bg); color: var(--head-ink); }
.foe-target-sel option[value=""] { color: var(--muted); }
.foe-target-row.set .foe-target-sel { border-color: rgba(217,139,126,.7); background: rgba(194,86,74,.14); color: #fff; }

/* Szenen-Roster (unter der Karte) minimal größer */
.foes-scene-list .party-row.foe-row { gap: 9px; padding: 8px 9px; flex-wrap: wrap; }
.foes-scene-list .foe-avatar.xs { width: 30px; height: 30px; }
.foes-scene-list .foe-row .sm { font-size: 14px; }
.foes-scene-list .foe-hpbar { width: 60px; height: 7px; }
.foes-scene-list .party-row .alloc-btn { width: 24px; height: 24px; font-size: 13px; }
.foes-scene-list .foe-target-sel { min-height: 30px; padding: 4px 10px; }


/* GM: Party-Name öffnet das Charakter-Sheet */
.party-name {
  flex: 1 1 auto; min-width: 0; text-align: left;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; color: var(--head-ink);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.party-name:hover::after { content: '↗'; font-size: 11px; opacity: .8; }

/* GM: Gegner-Zeilen in der Party-Initiative */
.party-dot.foe {
  color: #d98b7e; font-size: 13px;
  background: color-mix(in srgb, #c2564a 16%, var(--panel-2));
  border-color: color-mix(in srgb, #c2564a 42%, var(--line));
}
.foe-name {
  flex: 1 1 auto; min-width: 0; color: var(--head-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.init-chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-family: var(--display); font-size: 13px; color: var(--muted);
}
.init-chip.on { color: var(--head-ink); }
.party-row.foe-line.dead { opacity: .5; }
.party-row.foe-line.dead .foe-name { text-decoration: line-through; }

/* GM: Initiative pro Held direkt im Party-Panel würfeln */
.init-btn {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1;
}
.init-btn:hover { border-color: var(--accent); color: var(--accent); }
.init-btn .init-val { font-family: var(--display); font-size: 13px; min-width: 11px; text-align: center; color: var(--muted); }
.init-btn .init-val.on { color: var(--head-ink); }
.init-btn:hover .init-val { color: var(--accent); }

/* Sheet: Inspiration als an-/abschaltbarer Stern */
.insp-chip {
  cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.insp-chip .star { color: var(--muted); opacity: .55; transition: color .15s, opacity .15s; }
.insp-chip:hover { border-color: var(--accent); }
.insp-chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.insp-chip.on .star { color: var(--accent); opacity: 1; }

/* Spieler: HP direkt anpassen */
.ms-adj { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.ms-adj button { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; }
.ms-adj button:hover { color: var(--head-ink); border-color: var(--accent); }

/* Rüstungs-Eigenschaften (5e) am RK-Wert */
.bigstat .sub.warn { color: #cc7a7a; }

/* Level-Up-Box */
.xp-pending.levelup .btn { margin: 4px 3px 0 0; }

/* =================================================================
   TWEAKS PANEL + expressive feel controls
   ================================================================= */
#tweaks {
  position: fixed; right: 18px; bottom: 78px; z-index: 95; width: 264px; display: none;
  background: rgba(22,24,26,.94); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
#tweaks.on { display: block; }
#tweaks h3 { font-family: var(--display); font-size: 16px; color: var(--head-ink); margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
#tweaks .tw-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
#tweaks .tw { margin-bottom: 15px; }
#tweaks .tw > label { display: block; font-family: var(--display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
#tweaks .tw-x { cursor: pointer; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 13px; background: transparent; }
#tweaks .tw-x:hover { color: var(--head-ink); border-color: var(--accent); }
.seg-row { display: flex; gap: 6px; }
.seg-row button {
  flex: 1; font-family: var(--display); font-size: 12px; padding: 8px 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); transition: .15s;
}
.seg-row button:hover { color: var(--head-ink); }
.seg-row button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(0,0,0,.2); }

/* ---- Status-Chips: Zustände/Konzentration in Spieler- & GM-Ansicht ---- */
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 0 4px; }
#gm .status-strip { padding: 0 9px 6px 48px; margin-top: -2px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .03em; padding: 3px 9px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.status-chip.cond { background: rgba(160,70,70,.14); border-color: #9c5a5a; color: #d99090; }
.status-chip.clearable { cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.status-chip.clearable:hover, .status-chip.clearable:focus-visible { background: rgba(160,70,70,.28); border-color: #c46b6b; color: #f0b9b9; outline: none; }
.status-chip .sc-x { font-size: 9px; opacity: .55; margin-left: 1px; }
.status-chip.clearable:hover .sc-x, .status-chip.clearable:focus-visible .sc-x { opacity: 1; }
.status-chip.conc { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.status-chip .conc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); animation: stPulse 1.8s ease-in-out infinite; }
@keyframes stPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- Zustands-Tags: kompakte Chips (Statuskarten) + Punkte (Token) ---- */
.party-entry { margin-bottom: 2px; }
/* Name + Zustands-Wort gestapelt — zweite Zeile bei ALLEN Zeilen vorhanden (gleiche Höhe) */
.party-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; }
.party-id .party-name, .party-id .foe-name { flex: none; max-width: 100%; line-height: 1.2; }
.party-cond {
  max-width: 100%; font-size: 10px; line-height: 1.2; letter-spacing: .01em;
  color: #d99090; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-cond.none { color: var(--muted); opacity: .55; font-style: italic; }
.cond-strip { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 4px 5px 48px; }
.cond-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; letter-spacing: .02em; line-height: 1; padding: 3px 7px;
  border-radius: 999px; border: 1px solid #9c5a5a; background: rgba(160,70,70,.14); color: #d99090;
}
.cond-tag.c-konz { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.cond-tag.c-konz .conc-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--accent); animation: stPulse 1.8s ease-in-out infinite; }
.cond-tag.c-exh { border-color: #9a7d3e; background: color-mix(in srgb, #caa64f 14%, transparent); color: #d9b86a; }
.cond-tagbtn {
  flex: none; width: 22px; height: 22px; border-radius: 6px; line-height: 1;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.cond-tagbtn:hover { border-color: var(--accent); }
/* Zustands-Menü: Mehrfachauswahl mit Häkchen-Box */
.cond-menu .cond-pm { display: flex; align-items: center; gap: 9px; }
.cond-menu .cond-pm.on::after { content: none; }
.cond-menu .cm-box {
  flex: none; width: 16px; height: 16px; border-radius: 4px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px;
  border: 1px solid var(--line); color: var(--accent);
}
.cond-menu .cond-pm.on .cm-box { border-color: var(--accent); background: var(--accent-wash); }
/* Punkte direkt auf den Karten-Tokens */
.tok-conds { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); display: flex; gap: 2px; pointer-events: none; }
.tok-cdot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(0,0,0,.45); background: #d99090; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.tok-cdot.c-vergiftet { background: #7fc46b; }
.tok-cdot.c-betaeubt, .tok-cdot.c-gelaehmt { background: #b884e0; }
.tok-cdot.c-liegend { background: #d9b86a; }
.tok-cdot.c-verzaubert { background: #e589c0; }
.tok-cdot.c-geblendet { background: #9aa3ad; }
.tok-cdot.c-veraengstigt { background: #e0934f; }
.tok-cdot.c-gefesselt, .tok-cdot.c-ergriffen { background: #b08a5a; }
.tok-cdot.c-unsichtbar { background: #6fcfe0; }
.tok-cdot.c-versteinert { background: #8a93a0; }
.tok-cdot.c-bewusstlos { background: #d05a52; }
.tok-cdot.c-konz { background: var(--accent); animation: stPulse 1.8s ease-in-out infinite; }

/* ---- Konzentrations-Alarm: ausstehender Rettungswurf (inline & dauerhaft) ---- */
.conc-alert {
  width: 100%; flex: 0 0 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 2px; padding: 9px 11px;
  border: 1px solid #9c5a5a; border-left: 3px solid #c46a6a;
  border-radius: 9px; background: rgba(160,70,70,.13);
  animation: concAlertIn .22s ease both;
}
@keyframes concAlertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.conc-alert .ca-ico { font-size: 16px; line-height: 1; color: #e0a0a0; flex: none; animation: stPulse 1.6s ease-in-out infinite; }
.conc-alert .ca-txt { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; min-width: 0; margin-right: auto; }
.conc-alert .ca-txt > b { font-family: var(--display); font-size: 12.5px; letter-spacing: .02em; color: #e7b4b4; }
.conc-alert .ca-txt small { font-size: 11px; color: var(--muted); }
.conc-alert .ca-txt small b { color: var(--head-ink); font-size: 11px; }
.conc-alert .ca-roll {
  flex: none; font-family: var(--display); font-size: 12px; letter-spacing: .03em;
  padding: 6px 14px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: var(--on-accent); cursor: pointer; transition: .14s;
}
.conc-alert .ca-roll:hover { filter: brightness(1.08); box-shadow: var(--glow-accent); }
.conc-alert .ca-x {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: .14s;
}
.conc-alert .ca-x:hover { color: #cc7a7a; border-color: #9c5a5a; }

.ess-row { display: flex; gap: 9px; }
.ess { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.ess.on { border-color: #fff; box-shadow: 0 0 0 2px var(--panel), 0 0 12px currentColor; }

/* PRUNK — feel intensity. Driven by [data-prunk] on <body>. */
body[data-prunk="plain"] { --pk-glow: 0; --pk-round: .35; }
body[data-prunk="ornate"] { --pk-glow: 1.6; --pk-round: 1.5; }
body[data-prunk="plain"] .btn.primary,
body[data-prunk="plain"] .tok.me,
body[data-prunk="plain"] .ai-card { box-shadow: none !important; }
body[data-prunk="plain"] h1, body[data-prunk="plain"] h2, body[data-prunk="plain"] h3 { text-shadow: none !important; }
body[data-prunk="plain"] .surf, body[data-prunk="plain"] .pick-card, body[data-prunk="plain"] .player-card { box-shadow: 0 2px 8px rgba(0,0,0,.25) !important; }
body[data-prunk="plain"] .allogo, body[data-prunk="plain"] .avatar, body[data-prunk="plain"] .player-avatar { box-shadow: none !important; }
body[data-prunk="plain"] .surf, body[data-prunk="plain"] .pick-card, body[data-prunk="plain"] .player-card, body[data-prunk="plain"] .ai-card { border-radius: 4px !important; }

body[data-prunk="ornate"] h1, body[data-prunk="ornate"] h2 { text-shadow: 0 0 26px rgba(200,160,70,.35); }
body[data-prunk="ornate"] .btn.primary { box-shadow: 0 0 32px rgba(200,160,70,.55) !important; }
body[data-prunk="ornate"] .surf, body[data-prunk="ornate"] .pick-card, body[data-prunk="ornate"] .player-card { box-shadow: 0 0 0 1px var(--accent-wash), 0 14px 40px rgba(0,0,0,.5) !important; }
body[data-prunk="ornate"] .page-title h1::after,
body[data-prunk="ornate"] .wz-step .wz-head h2::after { content: " ❧"; color: var(--accent); opacity: .6; }
body[data-prunk="ornate"] .eyebrow::before { content: "✦ "; }

/* ---- In-App-Bestätigung (ersetzt window.confirm) ---- */
.app-confirm { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(8,9,10,.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .16s ease; }
.app-confirm.show { opacity: 1; }
.app-confirm .ac-card { width: min(420px, 100%); padding: 26px 26px 22px; text-align: center; border-radius: 14px; transform: translateY(10px) scale(.985); transition: transform .2s cubic-bezier(.2,.7,.3,1); }
.app-confirm.show .ac-card { transform: none; }
.ac-icon { font-size: 30px; line-height: 1; margin-bottom: 12px; color: var(--accent); }
.ac-title { font-family: var(--display); font-size: 19px; color: var(--head-ink); margin-bottom: 7px; }
.ac-msg { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.ac-actions { display: flex; gap: 10px; justify-content: center; }
.ac-actions .btn { min-width: 120px; justify-content: center; }

/* ---- Toast ---- */
.app-toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px); z-index: 500; display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.5); color: var(--head-ink); font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-toast .at-ic { font-size: 15px; }

/* ---- Popup-Menü (Pills) ---- */
.pill-menu { position: fixed; z-index: 500; padding: 5px; border-radius: 10px; box-shadow: 0 16px 44px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 2px; opacity: 0; transform: translateY(-5px); transition: opacity .13s ease, transform .13s ease; max-height: 280px; overflow-y: auto; }
.pill-menu.show { opacity: 1; transform: none; }
.pm-item { font-family: inherit; text-align: left; padding: 8px 12px; border-radius: 6px; background: transparent; border: 0; color: var(--ink); font-size: 13px; cursor: pointer; white-space: nowrap; }
.pm-item:hover { background: var(--accent-wash); color: var(--head-ink); }
.pm-item.on { color: var(--accent); }
.pm-item.on::after { content: " ✓"; }
/* Aktions-Menü Gegner (Angriff/Zauber): Abschnittsüberschriften + Scroll */
.pm-head { font-family: var(--display); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 7px 12px 3px; }
.pm-head:first-child { padding-top: 3px; }
.foe-atk-menu { max-height: 60vh; overflow-y: auto; }
.foe-atk-menu .pm-item .xs { margin-left: 6px; }
/* Rider-Rettungswurf-Zeile in der Würfelanzeige */
.foe-save-row { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-faint); font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; line-height: 1.5; }
.foe-save-row .btn.sm { padding: 3px 8px; }
.foe-save-row .btn.sm.on { color: #7bbf7b; border-color: #7bbf7b; }
.foe-save-out { flex-basis: 100%; }

/* GM-Chat: Leerzustand (neue Sitzung) */
.chat-empty { font-size: 13px; color: var(--muted); line-height: 1.6; padding: 18px 16px; margin: auto 0; border: 1px dashed var(--line-faint); border-radius: 10px; text-align: center; }

/* =================================================================
   Admin-Bereich (#admin) — Analyse & Moderation (nur Admins)
   ================================================================= */
/* versteckter Review-Einstieg: nur sichtbar, wenn das Konto Admin ist */
.proto-nav .pn-admin { display: none; }
body[data-admin="1"] .proto-nav .pn-admin { display: inline-flex; }

.admin-tabs { display: flex; gap: 8px; margin: 4px 0 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line-faint); }
.admin-tabs button {
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .03em;
  background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  padding: 10px 14px; cursor: pointer; transition: .15s; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.admin-tabs button:hover { color: var(--head-ink); }
.admin-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.admin-stat { padding: 18px 18px 16px; border-radius: 12px; display: flex; flex-direction: column; }
.admin-stat.accent { border-color: var(--accent); background: var(--accent-wash); }
.admin-stat .as-val { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--head-ink); }
.admin-stat.accent .as-val { color: var(--accent); text-shadow: var(--glow-soft); }
.admin-stat .as-label { font-size: 13px; color: var(--ink); margin-top: 7px; letter-spacing: .02em; }
.admin-stat .as-sub { margin-top: 2px; }

.activity-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 6px; }
.activity-chart .ac-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.activity-chart .ac-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.activity-chart .ac-bar { width: 100%; max-width: 38px; background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 55%, transparent), var(--accent)); border-radius: 5px 5px 0 0; min-height: 4px; transition: height .3s ease; }
.activity-chart .ac-bar.today { box-shadow: var(--glow-accent); }
.activity-chart .ac-cnt { font-size: 11px; color: var(--muted); font-family: var(--display); min-height: 13px; }
.activity-chart .ac-day { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* ============================================================
   Mitgliedschaft / Abo (s-billing.js)
   ============================================================ */
/* ---- Beta-Banner (oben) ---- */
.beta-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 240;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 18px; font-size: 13px; color: var(--head-ink);
  background: color-mix(in srgb, var(--surf, #15171a) 88%, var(--accent) 12%);
  border-bottom: 1px solid var(--accent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.beta-banner .bb-tag {
  font-family: var(--display); font-size: 10px; letter-spacing: .14em; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
}
.beta-banner .bb-txt { color: var(--ink); }
.beta-banner .bb-txt b { color: var(--head-ink); }
.beta-banner .bb-link {
  background: none; border: none; color: var(--accent); font-family: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.beta-banner .bb-link:hover { filter: brightness(1.15); }
.beta-banner .bb-x {
  background: none; border: none; color: var(--muted); font-size: 15px; line-height: 1;
  cursor: pointer; padding: 4px 6px; margin-left: 2px; border-radius: 6px; transition: .15s;
}
.beta-banner .bb-x:hover { color: var(--head-ink); background: rgba(255,255,255,.08); }
body.has-beta-banner #app { padding-top: 37px; }

/* ---- Bezahlschranke (Paywall) ---- */
.paywall {
  position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(8,9,11,.82); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.paywall-card { width: min(560px, 96vw); padding: 34px 34px 26px; border-radius: 16px; text-align: center; }
.pw-logo { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 18px; }
.paywall-card .eyebrow { margin-top: 4px; }
.paywall-card h2 { font-size: 27px; margin: 4px 0 10px; }
.pw-lead { color: var(--ink); font-size: 14.5px; line-height: 1.55; max-width: 420px; margin: 0 auto 22px; }
.pw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* ---- Tarif-Karten ---- */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.plan-card {
  position: relative; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); cursor: pointer; transition: .15s; font-family: inherit; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-card.sel { border-color: var(--accent); background: var(--accent-wash); }
.plan-badge {
  position: absolute; top: -9px; right: 12px; font-family: var(--display); font-size: 9.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--on-accent); background: var(--accent); padding: 2px 9px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.plan-label { font-family: var(--display); font-size: 13px; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.plan-price { display: flex; align-items: baseline; gap: 5px; }
.plan-price .pp-amt { font-family: var(--display); font-size: 30px; color: var(--head-ink); line-height: 1; }
.plan-price .pp-per { font-size: 13px; color: var(--muted); }
.plan-sub { font-size: 12px; color: var(--muted); }

/* ---- Checkout / Mitgliedschaft (nutzen .support-modal-Hülle) ---- */
.checkout-card, .membership-card { width: min(440px, 96vw); text-align: left; }
.co-rows { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 18px; }
.co-fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.co-fld .inp { width: 100%; }
.co-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ms-status {
  display: flex; align-items: flex-start; gap: 11px; padding: 14px 15px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel-2); margin: 14px 0 16px;
}
.ms-status .ms-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }
.ms-status.ok { border-color: rgba(127,192,138,.4); } .ms-status.ok .ms-dot { background: #7fc08a; box-shadow: 0 0 8px rgba(127,192,138,.6); }
.ms-status.beta .ms-dot { background: var(--accent); box-shadow: 0 0 8px rgba(200,160,70,.6); } .ms-status.beta { border-color: var(--accent); }
.ms-status.warn .ms-dot { background: #d9a441; } .ms-status.warn { border-color: rgba(217,164,65,.4); }
.ms-st-t { font-family: var(--display); font-size: 15px; color: var(--head-ink); margin-bottom: 2px; }
.ms-preview-h { font-family: var(--display); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.btn.block { width: 100%; display: block; text-align: center; }

/* ============================================================
   Handlungsfäden-Tracker (NSC / Quest / Plot) — GM-Screen
   ============================================================ */
[data-threads] [data-threads-list] { display: flex; flex-direction: column; gap: 6px; max-height: 188px; overflow-y: auto; }
.style-tone { font-size: 10.5px; padding: 2px 7px; }
.threads-toggle {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: none; border: 0; padding: 0; color: inherit; font: inherit;
  letter-spacing: inherit; text-transform: inherit;
  flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.threads-toggle .th-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads-toggle .th-caret { font-size: 10px; opacity: .7; flex: none; }
.threads-toggle [data-threads-count] { flex: none; }
.btn.sm.threads-add { flex: none; padding: 4px 9px; }

.thread-row {
  display: flex; flex-direction: column; gap: 5px;
  padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--line-faint); background: var(--panel-2);
}
.thread-row.done { opacity: .6; }
.thread-row.done .thread-name { text-decoration: line-through; }
.thread-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.thread-kind {
  flex: none; cursor: pointer; font-family: var(--display);
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; text-align: center;
  border: 1px solid; background: transparent; line-height: 1.4;
  transition: filter .15s;
}
.thread-kind:hover { filter: brightness(1.15); }
.thread-kind.tk-nsc   { color: #5aa0c4; border-color: rgba(90,160,196,.5);  background: rgba(90,160,196,.10); }
.thread-kind.tk-quest { color: #6aa86a; border-color: rgba(106,168,106,.5); background: rgba(106,168,106,.10); }
.thread-kind.tk-plot  { color: #a587d6; border-color: rgba(165,135,214,.5); background: rgba(165,135,214,.10); }

.thread-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thread-name { font-size: 13px; color: var(--ink); line-height: 1.35; outline: none; border-radius: 3px; padding: 1px 3px; }
.thread-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; outline: none; border-radius: 3px; padding: 1px 3px; }
.thread-name:focus, .thread-note:focus { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--line); }
.thread-name:empty:before, .thread-note:empty:before { content: attr(data-ph); color: var(--muted); opacity: .6; }

.thread-acts { display: flex; gap: 3px; flex: none; }
.thread-st, .thread-del {
  width: 22px; height: 22px; flex: none; cursor: pointer;
  border: 1px solid var(--line-faint); background: transparent; color: var(--muted);
  border-radius: 5px; font-size: 13px; line-height: 1; display: grid; place-items: center;
  transition: color .15s, border-color .15s, background .15s;
}
.thread-st:hover { color: #6aa86a; border-color: rgba(106,168,106,.5); }
.thread-st[aria-pressed="true"] { color: #6aa86a; border-color: rgba(106,168,106,.5); background: rgba(106,168,106,.10); }
.thread-del:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }


/* Konto-Ansicht (Avatar-Menü → Konto) — SYNC-HANDOFF #1 (aus app.local.css) */
.acct-rows { display: flex; flex-direction: column; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.18); overflow: hidden; }
.acct-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 13px; border-bottom: 1px solid var(--line-faint, rgba(127,127,127,.15)); font-size: 13px; }
.acct-row:last-child { border-bottom: none; }
.acct-row span { color: var(--muted); flex: none; }
.acct-row b { color: var(--head-ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.acct-danger { border: 1px solid #9c5a5a; border-radius: 10px; background: rgba(160,70,70,.1); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.acct-danger-t { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #e0a0a0; font-weight: 600; }
.acct-danger p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.acct-danger .btn { align-self: flex-start; margin-top: 4px; }
.btn.ghost.danger { background: transparent; color: #e0a0a0; border-color: #9c5a5a; box-shadow: none; }
.btn.ghost.danger:hover { color: #f0b9b9; border-color: #c25151; box-shadow: 0 0 18px rgba(163,59,59,.24); }
.acct-del-list { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.acct-del-list li { margin-bottom: 2px; }

/* ============ Direktnachrichten / Postfach ============ */
.avatar { position: relative; }
.avatar[data-unread="1"]::after { content: ''; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: #d9534f; border: 2px solid var(--bg, #1a1c1e); }
.am-count { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: auto; font-size: 10px; line-height: 16px; text-align: center; border-radius: 8px; background: #d9534f; color: #fff; font-weight: 700; }
.am-item { display: flex; align-items: center; gap: 8px; }

/* Modal-Karte (Sende-Fenster / Postfach) */
.msg-card { max-width: 440px; width: 100%; }
.msg-card.msg-wide { max-width: 560px; }
.msg-mailrow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-faint); font-size: 12px; color: var(--muted); }
.msg-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.msg-inbox-head h2 { margin: 0; }

/* Kategorie-Auswahl */
.msg-catrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.msg-catbtn { font-family: var(--display); font-size: 12px; letter-spacing: .03em; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--muted); cursor: pointer; }
.msg-catbtn:hover { color: var(--head-ink); border-color: var(--muted); }
.msg-catbtn.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

/* Kategorie-Chip */
.msg-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; letter-spacing: .03em; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line-faint); color: var(--muted); white-space: nowrap; }
.msg-cat-meldung { color: #e0a0a0; border-color: #9c5a5a; }
.msg-cat-broadcast { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }

/* Anhang */
.msg-attachrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.msg-attachbtn { font-family: var(--display); font-size: 12px; padding: 6px 11px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); cursor: pointer; }
.msg-attachbtn.sm { padding: 5px 9px; font-size: 13px; }
.msg-attachbtn:hover { color: var(--head-ink); border-color: var(--muted); }
.msg-imgchip { position: relative; display: inline-block; margin: 8px 0; }
.msg-imgchip img { max-width: 130px; max-height: 100px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.msg-imgchip button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: none; background: #d9534f; color: #fff; cursor: pointer; font-size: 12px; }

/* Listen (Postfach / Admin) */
.msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.msg-list-admin { max-height: none; }
.msg-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-faint); background: var(--panel-2); cursor: pointer; color: var(--ink); }
.msg-row:hover { border-color: var(--muted); }
.msg-row.unread { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 7%, var(--panel-2)); }
.msg-row.is-bc { background: rgba(0,0,0,.14); }
.msg-row-ic { font-size: 18px; flex: none; }
.msg-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.msg-row-subj { font-family: var(--display); font-size: 13.5px; color: var(--head-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-snip { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.msg-row-time { font-size: 10.5px; color: var(--muted); }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.msg-empty { text-align: center; color: var(--muted); padding: 30px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.msg-empty .me-ico { font-size: 26px; margin-bottom: 8px; opacity: .7; }

/* Filterleiste (Admin) */
.msg-filterbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.msg-filter { font-family: var(--display); font-size: 12px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--muted); cursor: pointer; }
.msg-filter:hover { color: var(--head-ink); }
.msg-filter.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

/* Thread */
.msg-back { background: none; border: none; color: var(--muted); font-family: var(--display); font-size: 13px; cursor: pointer; padding: 4px 0; margin-bottom: 10px; }
.msg-back:hover { color: var(--head-ink); }
.msg-thread-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.msg-thread-head h2 { margin: 0; font-size: 19px; }
.msg-thread-wrap { margin-top: 4px; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.msg-bubble { max-width: 85%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-faint); background: var(--panel-2); }
.msg-bubble.from-me { align-self: flex-end; background: var(--accent-wash); border-color: var(--accent); }
.msg-bubble.from-them { align-self: flex-start; }
.mb-who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.mb-body { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.mb-img { display: block; margin-top: 6px; }
.mb-img img { max-width: 200px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* Antwortleiste */
.msg-replybar { margin-top: 12px; border-top: 1px solid var(--line-faint); padding-top: 12px; }
.msg-replybar textarea { width: 100%; resize: vertical; }
.msg-replybar-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.msg-replybar-foot .btn { margin-left: auto; }

/* „Melden"-Knopf an Chat-Nachrichten */
.msg.narr, .msg.roll { position: relative; }
.msg-report { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: none; background: transparent; color: var(--muted); font-size: 12px; line-height: 22px; text-align: center; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-report { opacity: .55; }
.msg-report:hover { opacity: 1; background: rgba(160,70,70,.16); }
