/* Dungeonslayers 4 — Digitaler Charakterbogen */

:root {
    --bg: #14100c;
    --bg-alt: #1c1712;
    --panel: rgba(32, 26, 20, 0.88);
    --panel-border: rgba(180, 140, 80, 0.28);
    --panel-border-strong: rgba(200, 160, 90, 0.55);
    --text: #ede3d4;
    --text-dim: #a89880;
    --accent: #d4a24c;
    --accent-bright: #f0c069;
    --blood: #a8342c;
    --success: #6fa84a;
    --fail: #b8462f;
    --crit: #f0c069;
    --patzer: #8c2b22;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', 'Trebuchet MS', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(120, 80, 30, 0.16), transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(70, 40, 20, 0.2), transparent 55%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

h1, h2, h3, h4 { font-family: 'Georgia', 'Times New Roman', serif; font-weight: 600; letter-spacing: 0.02em; }

button { font-family: inherit; cursor: pointer; }

input, select, textarea {
    font-family: inherit;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 0.4rem 0.55rem;
    border-radius: 4px;
    outline: none;
    font-size: 0.92rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=number] { width: 100%; }
select option { background: #1c1712; }

/* ---------- Layout ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.2rem;
    background: linear-gradient(180deg, rgba(40, 30, 18, 0.95), rgba(24, 19, 13, 0.9));
    border-bottom: 1px solid var(--panel-border-strong);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
}
.topbar h1 {
    font-size: 1.25rem;
    color: var(--accent-bright);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}
.topbar h1 small { display: block; font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; font-family: 'Segoe UI', sans-serif; font-weight: normal; }
.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn {
    background: linear-gradient(180deg, rgba(90, 68, 34, 0.9), rgba(60, 44, 22, 0.9));
    border: 1px solid var(--panel-border-strong);
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { background: linear-gradient(180deg, rgba(120, 92, 46, 0.95), rgba(80, 60, 30, 0.95)); border-color: var(--accent); }
.btn-primary { background: linear-gradient(180deg, #a8762c, #7d5620); border-color: var(--accent-bright); color: #fff8ea; font-weight: 600; }
.btn-primary:hover { background: linear-gradient(180deg, #c68f38, #96662a); }
.btn-danger { background: linear-gradient(180deg, #8e3229, #63221c); border-color: #b8462f; }
.btn-danger:hover { background: linear-gradient(180deg, #a83c31, #7a2b22); }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.78rem; }
.btn-ghost { background: transparent; border-color: var(--panel-border); }

.app { max-width: 1500px; margin: 0 auto; padding: 1.2rem; display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: start; }
.col-main { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 4.5rem; }

@media (max-width: 1100px) {
    .app { grid-template-columns: 1fr; }
    .col-side { position: static; }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(180deg, rgba(70, 52, 26, 0.6), rgba(40, 30, 18, 0.4));
    border-bottom: 1px solid var(--panel-border);
}
.panel-head h2, .panel-head h3 { font-size: 1rem; color: var(--accent-bright); }
.panel-head .panel-actions { margin-left: auto; display: flex; gap: 0.4rem; }
.panel-body { padding: 0.9rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.7rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; }

.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }

/* ---------- Attribute & Eigenschaften ---------- */

.attr-block {
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.25);
}
.attr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.attr-name { font-family: Georgia, serif; font-size: 1.05rem; color: var(--accent-bright); }
.attr-value-wrap { display: flex; align-items: center; gap: 0.35rem; }
.attr-value {
    width: 3rem; text-align: center; font-size: 1.3rem; font-weight: bold;
    background: rgba(0, 0, 0, 0.5); border: 1px solid var(--panel-border-strong);
    padding: 0.15rem; border-radius: 4px; color: var(--accent-bright);
}
.eig-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.28rem 0; }
.eig-name { flex: 1; font-size: 0.88rem; }
.eig-abbr { font-size: 0.68rem; color: var(--text-dim); margin-left: 0.3rem; }
.eig-value {
    width: 3.4rem; text-align: center; font-weight: bold;
    display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1;
}
/* Herkunft des Wertes, z.B. "4+1" — bewusst klein und unter dem Zahlenwert,
   damit die große Zahl eindeutig der Rechenwert bleibt. */
.eig-herkunft { font-size: 0.62rem; font-weight: normal; color: var(--accent); opacity: 0.9; }
.eig-cap { font-size: 0.7rem; color: var(--text-dim); width: 2.4rem; text-align: right; }

.stepper { display: inline-flex; }
.stepper button {
    width: 1.5rem; height: 1.5rem; line-height: 1;
    background: rgba(70, 52, 26, 0.7); border: 1px solid var(--panel-border);
    color: var(--text); font-size: 0.95rem; border-radius: 3px;
}
.stepper button:hover:not(:disabled) { background: rgba(120, 92, 46, 0.9); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }

.budget {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.82rem; padding: 0.35rem 0.6rem; border-radius: 4px;
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--panel-border);
}
.budget strong { color: var(--accent-bright); font-size: 1rem; }
.budget.over { border-color: var(--fail); color: #ffb4a0; }
.budget.over strong { color: var(--fail); }
.budget.done { border-color: var(--success); }
.budget.done strong { color: var(--success); }

/* ---------- Kampfwerte ---------- */

.kampfwerte { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
.kw-card {
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 0.6rem;
    text-align: center;
    transition: all 0.15s;
}
.kw-card.rollable { cursor: pointer; }
.kw-card.rollable:hover { border-color: var(--accent); background: rgba(90, 68, 34, 0.35); transform: translateY(-2px); }
.kw-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.kw-value { font-size: 1.7rem; font-weight: bold; color: var(--accent-bright); font-family: Georgia, serif; line-height: 1.2; }
.kw-formula { font-size: 0.65rem; color: var(--text-dim); opacity: 0.75; }
.kw-talent { color: var(--accent); opacity: 1; font-weight: 600; }

/* Lebenskraft */
.lk-panel { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.lk-bar-wrap { flex: 1; min-width: 160px; }
.lk-bar-track { height: 16px; background: rgba(0, 0, 0, 0.6); border-radius: 8px; overflow: hidden; border: 1px solid var(--panel-border); }
.lk-bar-fill { height: 100%; background: linear-gradient(90deg, #8e2b22, #c0392b); transition: width 0.35s ease, background 0.35s ease; }
.lk-numbers { display: flex; align-items: center; gap: 0.3rem; }
.lk-numbers input { width: 3.6rem; text-align: center; font-size: 1.15rem; font-weight: bold; }
.lk-danger .lk-bar-fill { animation: pulse-danger 1s infinite; }
@keyframes pulse-danger { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- Würfel ---------- */

.dice-display {
    text-align: center;
    padding: 1rem 0.8rem;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    transition: all 0.25s;
}
.dice-result-number { font-size: 3.2rem; font-weight: bold; font-family: Georgia, serif; line-height: 1; color: var(--accent-bright); }
.dice-result-label { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.2rem; }
.dice-result-status { font-size: 1rem; font-weight: bold; margin-top: 0.4rem; }
.dice-detail { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }
.dice-display.erfolg { border-color: var(--success); box-shadow: 0 0 18px rgba(111, 168, 74, 0.25); }
.dice-display.erfolg .dice-result-number { color: var(--success); }
.dice-display.fehlschlag { border-color: var(--fail); }
.dice-display.fehlschlag .dice-result-number { color: var(--fail); }
.dice-display.immersieg { border-color: var(--crit); box-shadow: 0 0 26px rgba(240, 192, 105, 0.4); }
.dice-display.immersieg .dice-result-number { color: var(--crit); text-shadow: 0 0 18px rgba(240, 192, 105, 0.7); }
.dice-display.patzer { border-color: var(--patzer); box-shadow: 0 0 22px rgba(140, 43, 34, 0.45); }
.dice-display.patzer .dice-result-number { color: var(--patzer); }
.status-erfolg { color: var(--success); }
.status-fehlschlag { color: var(--fail); }
.status-immersieg { color: var(--crit); }
.status-patzer { color: var(--patzer); }

.quick-probe { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; align-items: end; }

.log-list { list-style: none; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; }
.log-list li {
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid var(--panel-border-strong);
    padding: 0.4rem 0.6rem;
    border-radius: 3px;
    font-size: 0.82rem;
}
.log-list li.immersieg { border-left-color: var(--crit); }
.log-list li.patzer { border-left-color: var(--patzer); }
.log-list li.erfolg { border-left-color: var(--success); }
.log-list li.fehlschlag { border-left-color: var(--fail); }
.log-time { font-size: 0.7rem; color: var(--text-dim); }

/* ---------- Listen (Inventar, Talente, Zauber) ---------- */

.list-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.5rem; border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
}
.list-row + .list-row { margin-top: 0.35rem; }
.list-row:hover { border-color: var(--panel-border); }
.list-row input[type=text] { flex: 1; min-width: 0; }
.list-row .row-sub { font-size: 0.75rem; color: var(--text-dim); }
.icon-btn {
    background: transparent; border: none; color: var(--text-dim);
    padding: 0.2rem 0.4rem; border-radius: 3px; font-size: 0.9rem;
}
.icon-btn:hover { color: var(--fail); background: rgba(184, 70, 47, 0.15); }

.empty-hint { color: var(--text-dim); font-style: italic; font-size: 0.85rem; text-align: center; padding: 0.8rem; }

.tag {
    display: inline-block; padding: 0.12rem 0.5rem; border-radius: 10px;
    font-size: 0.72rem; background: rgba(90, 68, 34, 0.5);
    border: 1px solid var(--panel-border); color: var(--text);
}
.tag-warn { background: rgba(168, 52, 44, 0.3); border-color: var(--fail); color: #ffbcae; }

.hint { font-size: 0.78rem; color: var(--text-dim); }
.hint-rule { font-size: 0.75rem; color: var(--text-dim); font-style: italic; border-left: 2px solid var(--panel-border); padding-left: 0.5rem; }

/* ---------- Modal ---------- */

.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    align-items: center; justify-content: center; padding: 1rem;
    opacity: 0; transition: opacity 0.25s;
}
.modal-overlay.active { opacity: 1; }
.modal {
    background: var(--bg-alt);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto;
}
.modal-lg { max-width: 900px; }

/* ---------- GM Dashboard ---------- */

#gm-dashboard { display: none; padding: 1.2rem; max-width: 1700px; margin: 0 auto; }
.gm-grid { display: grid; grid-template-columns: 1fr 360px; gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .gm-grid { grid-template-columns: 1fr; } }
.gm-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.gm-player-card { border-top: 4px solid var(--accent); }
.gm-stat-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.gm-stat {
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--panel-border);
    border-radius: 4px; padding: 0.25rem 0.5rem; font-size: 0.78rem; text-align: center; flex: 1; min-width: 62px;
}
.gm-stat span { display: block; font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; }
.gm-stat strong { font-size: 1rem; color: var(--accent-bright); }
.room-code {
    font-family: 'Consolas', monospace; font-size: 1.6rem; letter-spacing: 0.35em;
    color: var(--accent-bright); background: rgba(0, 0, 0, 0.45);
    padding: 0.3rem 0.9rem; border-radius: 4px; border: 1px solid var(--panel-border-strong);
}
.status-dot { font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- Wizard ---------- */

.wizard-steps { display: flex; gap: 0.3rem; padding: 0.7rem 0.9rem; flex-wrap: wrap; border-bottom: 1px solid var(--panel-border); }
.wizard-step {
    font-size: 0.72rem; padding: 0.22rem 0.6rem; border-radius: 12px;
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--panel-border); color: var(--text-dim);
}
.wizard-step.active { background: rgba(168, 118, 44, 0.55); border-color: var(--accent-bright); color: #fff8ea; }
.wizard-step.done { border-color: var(--success); color: var(--success); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.7rem; }
.choice-card {
    border: 1px solid var(--panel-border); border-radius: var(--radius);
    padding: 0.8rem; background: rgba(0, 0, 0, 0.3); cursor: pointer; transition: all 0.15s;
}
.choice-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice-card.selected { border-color: var(--accent-bright); background: rgba(168, 118, 44, 0.25); box-shadow: 0 0 14px rgba(212, 162, 76, 0.2); }
.choice-card h4 { color: var(--accent-bright); font-size: 1rem; margin-bottom: 0.25rem; }
.choice-card p { font-size: 0.78rem; color: var(--text-dim); }
.choice-card ul { font-size: 0.75rem; color: var(--text-dim); margin: 0.4rem 0 0 1rem; }

.radio-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-pill {
    padding: 0.3rem 0.7rem; border-radius: 14px; font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-border); cursor: pointer; transition: all 0.15s;
}
.radio-pill:hover { border-color: var(--accent); }
.radio-pill.selected { background: rgba(168, 118, 44, 0.5); border-color: var(--accent-bright); color: #fff8ea; }

/* ---------- Multiplayer-Statusanzeige ---------- */

/* Standardmäßig unsichtbar — erst ein Zustandsklassenname blendet sie ein. */
.mp-badge { display: none; }
.mp-badge.visible {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s, background 0.2s;
}
.mp-badge.visible:hover { background: rgba(0, 0, 0, 0.5); }
.mp-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mp-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--text-dim);
    flex: none;
}

.mp-badge.connected { border-color: rgba(111, 168, 74, 0.6); color: #b9dfa0; }
.mp-badge.connected .mp-dot { background: var(--success); box-shadow: 0 0 8px rgba(111, 168, 74, 0.9); }

.mp-badge.connecting { border-color: rgba(212, 162, 76, 0.6); color: var(--accent-bright); }
.mp-badge.connecting .mp-dot { background: var(--accent); animation: mp-pulse 1.1s infinite; }

.mp-badge.lost { border-color: rgba(184, 70, 47, 0.7); color: #ffb4a0; }
.mp-badge.lost .mp-dot { background: var(--fail); animation: mp-pulse 1.1s infinite; }

@keyframes mp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (max-width: 620px) {
    /* Auf schmalen Schirmen bleibt nur der Punkt, der Text würde die Zeile sprengen */
    .mp-badge.visible { padding: 0.32rem 0.5rem; }
    #mp-badge-text { display: none; }
}

/* ---------- Talente ---------- */

.talent-entry {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
}
.talent-entry + .talent-entry { margin-top: 0.45rem; }
.talent-entry-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.talent-rank { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.talent-rank .rank-value { font-size: 0.85rem; color: var(--accent-bright); min-width: 5.5rem; text-align: center; }
.talent-effect { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.35rem; }
.talent-perrank { font-size: 0.76rem; color: var(--accent); margin-top: 0.2rem; }

.talent-picker-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; padding-right: 0.3rem; }
.talent-option {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    transition: border-color 0.15s;
}
.talent-option:hover { border-color: var(--accent); }
.talent-option.locked { opacity: 0.5; }

/* ---------- Kampf-Tracker ---------- */

.combat-row {
    display: flex; gap: 0.7rem; align-items: stretch;
    padding: 0.55rem 0.6rem; border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--panel-border);
    transition: all 0.2s;
}
.combat-row + .combat-row { margin-top: 0.45rem; }
.combat-row.active-turn {
    border-color: var(--accent-bright);
    background: rgba(168, 118, 44, 0.22);
    box-shadow: 0 0 16px rgba(212, 162, 76, 0.2);
}
.combat-row.defeated { opacity: 0.45; }
.combat-row.defeated .combat-name { text-decoration: line-through; }
.combat-init {
    min-width: 2.6rem; display: flex; align-items: center; justify-content: center;
    font-family: Georgia, serif; font-size: 1.4rem; font-weight: bold;
    color: var(--accent-bright); background: rgba(0, 0, 0, 0.35);
    border-radius: 4px; border: 1px solid var(--panel-border);
}
.combat-main { flex: 1; min-width: 0; }
.combat-name { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; flex-wrap: wrap; }
.combat-stats { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.35rem; display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.combat-stats input { padding: 0.1rem 0.3rem; font-size: 0.78rem; }
.combat-actions { display: flex; gap: 0.3rem; margin-top: 0.4rem; flex-wrap: wrap; align-items: center; }

/* ---------- Einblendungen ---------- */

.gm-toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 140%);
    z-index: 300; max-width: min(460px, 92vw);
    background: linear-gradient(180deg, rgba(60, 44, 22, 0.98), rgba(32, 26, 20, 0.98));
    border: 1px solid var(--accent-bright);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    padding: 0.8rem 1.1rem;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.3s;
    opacity: 0;
}
.gm-toast.visible { transform: translate(-50%, 0); opacity: 1; }
.gm-toast-head {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--accent-bright); margin-bottom: 0.3rem;
}

.round-indicator {
    position: fixed; top: 4.2rem; right: 1.2rem; z-index: 120;
    background: rgba(32, 26, 20, 0.95);
    border: 1px solid var(--accent);
    border-radius: 20px; padding: 0.3rem 0.9rem;
    font-size: 0.85rem; color: var(--accent-bright);
    box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.round-indicator.visible { opacity: 1; transform: translateY(0); }

/* ---------- Charakterbild ---------- */

.portrait-row { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.portrait-frame {
    width: 84px; height: 84px; flex: none;
    border-radius: 50%;
    border: 2px solid var(--panel-border-strong);
    background: rgba(0, 0, 0, 0.35);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; cursor: pointer;
    color: var(--text-dim); text-align: center; font-size: 1.3rem; line-height: 1.1;
    transition: border-color 0.15s;
}
.portrait-frame:hover { border-color: var(--accent); color: var(--accent); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-frame small { font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* Bild auf der Spielerkarte im Dashboard */
.gm-portrait {
    width: 34px; height: 34px; flex: none;
    border-radius: 50%; border: 2px solid var(--accent);
    object-fit: cover;
}
.gm-portrait-leer {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.75rem; font-weight: bold;
}

/* ---------- Karte ---------- */

#map-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: var(--bg);
    flex-direction: column;
}

/* Einhängepunkte: eingebettet feste Höhe, im Vollbild der ganze Rest */
.map-host { padding: 0; height: 420px; overflow: hidden; transition: height 0.2s ease; }
.map-host.zugeklappt { height: 0; }
#map-host-overlay { flex: 1; height: auto; padding: 0; }

#map-widget { display: flex; flex-direction: column; height: 100%; }

@media (max-width: 700px) { .map-host { height: 300px; } }

.map-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(180deg, rgba(70, 52, 26, 0.6), rgba(40, 30, 18, 0.4));
    border-bottom: 1px solid var(--panel-border-strong);
    flex: none;
}
.map-head h3 { font-size: 1rem; color: var(--accent-bright); white-space: nowrap; }
.map-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex: none;
    min-width: 0;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.25);
}
.map-tools .radio-pill { padding: 0.22rem 0.6rem; font-size: 0.78rem; }
.map-tools input[type=number] { padding: 0.2rem 0.35rem; font-size: 0.8rem; }
.map-tools .hint { white-space: nowrap; }

#map-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: block;
    cursor: grab;
    touch-action: none;
}
#map-canvas:active { cursor: grabbing; }

.werkzeug-gruppe {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.25);
}
.mal-farbe {
    width: 17px; height: 17px; border-radius: 50%;
    cursor: pointer; border: 2px solid transparent;
    transition: transform 0.12s;
}
.mal-farbe:hover { transform: scale(1.15); }
.mal-farbe.aktiv { border-color: var(--text); }

/* Angebot, eine frühere Sitzung wiederherzustellen */
#gm-sitzung:empty { display: none; }
.sitzung-hinweis {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    max-width: 1700px; margin: 0 auto 1.2rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.87rem;
    background: rgba(168, 118, 44, 0.18);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius);
}

/* Vorgemerkte Nebelbereiche, die noch freigegeben werden müssen */
#map-nebel:empty { display: none; }
.nebel-freigabe {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    background: rgba(111, 168, 74, 0.16);
    border-bottom: 1px solid var(--panel-border);
}

/* Offene Zugvorschläge beim Spielleiter */
.map-zuege { flex: none; }
.map-zuege:empty { display: none; }
.zug-vorschlag {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    background: rgba(168, 118, 44, 0.18);
    border-bottom: 1px solid var(--panel-border);
}
.zug-vorschlag.zu-weit { background: rgba(168, 52, 44, 0.22); }

.map-status {
    flex: none;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.3);
    min-height: 1.9rem;
}

/* ---------- Fußbereich ---------- */

.site-footer {
    border-top: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.3);
    margin-top: 2rem;
    padding: 2rem 1.2rem 2.5rem;
}
.footer-inner {
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.site-footer h2 {
    font-size: 1rem;
    color: var(--accent-bright);
    margin-bottom: 0.5rem;
}
.site-footer p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    max-width: 62ch;
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-bright); }

.footer-disclaimer {
    max-width: 1500px;
    margin: 1.8rem auto 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--panel-border);
    font-size: 0.76rem;
    line-height: 1.7;
    color: var(--text-dim);
    text-align: center;
}

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(140, 106, 52, 0.6); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(180, 140, 80, 0.8); }
