:root {
    --bg: #14171c;
    --card: #1c2027;
    --card2: #232832;
    --line: #2e3440;
    --text: #e6e9ef;
    --muted: #8b93a3;
    --accent: #5cb85c;
    --accent-d: #4a9a4a;
    --danger: #d9534f;
    --warn: #e0a83a;
    --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
code { background: var(--card2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Buttons & Felder */
.btn {
    background: var(--card2); color: var(--text); border: 1px solid var(--line);
    border-radius: 6px; padding: 7px 12px; font: inherit; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: #444c5c; background: #2a303b; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0d1a0d; font-weight: 600; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { color: #ff8a86; }
.btn.danger:hover { background: #3a2223; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.active { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
input, select, textarea {
    background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
    padding: 7px 9px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.field-row label { min-width: 80px; }
.field-row label.grow { flex: 1; min-width: 180px; }
.field-row input[type=number] { width: 95px; }

/* Grundlayout */
.topbar {
    display: flex; align-items: center; gap: 16px; padding: 10px 16px;
    background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 16px; }
.status { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.on .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status.off .dot { background: var(--danger); }
.clock { margin-left: auto; color: var(--muted); }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; padding: 14px; max-width: 1400px; margin: 0 auto; }
main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head p { margin: 0; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.alert { background: #3a2223; border: 1px solid var(--danger); color: #ffb3b0; padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; }

/* Spielerliste */
.players { align-self: start; position: sticky; top: 62px; }
.count { color: var(--muted); font-weight: 400; }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.player-list li {
    display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer;
    border: 1px solid transparent;
}
.player-list li:hover { background: var(--card2); }
.player-list li.sel { background: var(--card2); border-color: var(--accent); }
.player-list .none { color: var(--muted); cursor: default; }
.pl-info { min-width: 0; line-height: 1.25; }
.pl-sub { display: block; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-list .none:hover { background: none; }
.head { width: 28px; height: 28px; border-radius: 4px; image-rendering: pixelated; background: var(--card2); flex: none; }
.head.big { width: 56px; height: 56px; }
.initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button {
    background: none; border: 1px solid transparent; color: var(--muted); padding: 7px 14px;
    border-radius: 6px; cursor: pointer; font: inherit;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--card); border-color: var(--line); color: var(--text); }

/* Übersicht */
.ov-opt { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.ov-opt input { width: auto; }
.ov-map-wrap { position: relative; background: #0e1013; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; }
#ovMap { display: block; width: 100%; height: auto; }
#ovMap .grid { stroke: #1f242c; stroke-width: 1; }
#ovMap .grid-label { fill: #4f5766; font-size: 10px; font-family: ui-monospace, Consolas, monospace; }
#ovMap .origin { stroke: #39404d; stroke-width: 1; stroke-dasharray: 4 4; }
#ovMap .pl-dot { stroke: #0e1013; stroke-width: 2; cursor: pointer; }
#ovMap .pl-name { font-size: 13px; font-weight: 600; paint-order: stroke; stroke: #0e1013; stroke-width: 4px; cursor: pointer; }
#ovMap .pl-coord { fill: var(--muted); font-size: 10px; font-family: ui-monospace, Consolas, monospace; paint-order: stroke; stroke: #0e1013; stroke-width: 3px; }
#ovMap .place { fill: none; stroke: var(--warn); stroke-width: 1.5; }
#ovMap .place-name { fill: var(--warn); font-size: 11px; paint-order: stroke; stroke: #0e1013; stroke-width: 3px; }
#ovMap .empty-msg { fill: var(--muted); font-size: 14px; }
.ov-compass { position: absolute; top: 8px; right: 10px; color: var(--muted); font-size: 11px; }
.ov-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.ov-card {
    background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--accent));
    border-radius: 6px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.ov-card:hover { border-color: #444c5c; border-left-color: var(--pc, var(--accent)); }
.ov-card .top { display: flex; align-items: center; gap: 8px; }
.ov-card .top b { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ov-card .badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; }
.ov-card .coords { font: 600 15px ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.ov-card .meta { color: var(--muted); font-size: 12px; }
.bar { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.bar span:first-child { width: 44px; }
.bar .track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 3px; transition: width .4s; }
.bar .val { width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

/* Spielerdetail */
.pd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.pd-head h2 { font-size: 20px; }
.pd-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); margin-top: 4px; font-size: 13px; }
.pd-stats b { color: var(--text); font-weight: 600; }
.tp-grid .field-row label { min-width: 0; }

/* Items */
.counts { margin-top: -2px; }
.item-cats { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; }
.item {
    text-align: left; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
    padding: 7px 9px; cursor: pointer; font: inherit;
}
.item:hover { border-color: var(--accent); }
.item small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Spielregeln */
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card2); border-radius: 6px; padding: 7px 10px; }
.rule.na { opacity: .45; }
.rule input[type=number] { width: 80px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table td.act { text-align: right; white-space: nowrap; }

/* Schnellbefehle */
.quick-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.quick-row textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 58px; resize: vertical; }

/* Konsole */
.log {
    background: #0e1013; border: 1px solid var(--line); border-radius: 6px; height: 230px; overflow-y: auto;
    padding: 8px 10px; font: 12px/1.5 ui-monospace, Consolas, monospace;
}
.log .l-cmd { color: var(--accent); }
.log .l-out { color: #c8ccd4; white-space: pre-wrap; margin: 0 0 6px 12px; }
.log .l-err { color: #ff8a86; margin: 0 0 6px 12px; }
.log .l-time { color: var(--muted); margin-right: 6px; }
.console-input { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.console-input span { color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.console-input input { font-family: ui-monospace, Consolas, monospace; }

/* Toast */
.toast {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: 90vw;
    background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
    padding: 10px 14px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 20;
}
.toast.err { border-left-color: var(--danger); }

/* Login */
body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login-card .btn { justify-content: center; }

@media (max-width: 820px) {
    .layout { grid-template-columns: 1fr; padding: 10px; }
    .players { position: static; }
    .clock { display: none; }
    .quick-row { grid-template-columns: 1fr; }
}

/* Übersicht: Optionen, Spuren, Richtungen */
.ov-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.small-select { width: auto; padding: 3px 6px; font-size: 12px; }
#ovMap .trail { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dirs, .pd-dirs { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.pd-dirs { margin: -8px 0 6px; }
.dir-row { display: flex; align-items: center; gap: 6px; }
.dir-arrow { display: inline-block; width: 14px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1; }

/* Inventar */
.inv-box { display: flex; flex-direction: column; gap: 4px; }
.inv-sum { margin-bottom: 4px; }
.inv-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.inv-row, .inv-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; max-width: 620px; }
.inv-eq { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 345px; }
.inv-grid.hotbar { padding-top: 2px; }
.inv-slot {
    position: relative; aspect-ratio: 1; min-width: 0; padding: 3px; border-radius: 5px; cursor: pointer;
    background: var(--card2); border: 1px solid var(--line); color: var(--text); font: inherit;
    display: flex; align-items: flex-start; justify-content: flex-start; overflow: hidden; text-align: left;
}
.inv-slot:hover:not(.empty) { border-color: #556070; }
.inv-slot.empty { background: #191d23; cursor: default; }
.inv-slot.ench { border-color: #7d5bd6; box-shadow: inset 0 0 10px rgba(125, 91, 214, .35); }
.inv-slot.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.inv-slot.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.inv-name { font-size: 10px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.inv-ph { font-size: 9px; color: #4f5766; }
.inv-count { position: absolute; right: 4px; bottom: 2px; font: 700 12px ui-monospace, Consolas, monospace; text-shadow: 0 1px 2px #000; }
.inv-dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: #0e1013; border-radius: 2px; overflow: hidden; }
.inv-dur span { display: block; height: 100%; }
.inv-ender { margin-top: 8px; }
.inv-ender summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.inv-detail { margin-top: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.inv-detail-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.inv-ench { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: #2b2440; color: #c9b8ff; border-radius: 10px; padding: 2px 8px; font-size: 12px; }

/* Pakete & Verzauberungen */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-bottom: 8px; }
.kit {
    text-align: left; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
    padding: 8px 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px;
}
.kit:hover { border-color: var(--accent); }
.kit small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.ench-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px; margin: 4px 0 10px; }
.ench-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card2); border-radius: 6px; padding: 4px 8px; }
.ench-name { flex-direction: row; align-items: center; gap: 7px; color: var(--text); font-size: 13px; cursor: pointer; flex: 1; }
.ench-name input { width: auto; }
.ench-row select { width: auto; padding: 2px 4px; font-size: 12px; }
.en-preview { background: #0e1013; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; margin-bottom: 8px; overflow-x: auto; }
.en-preview code { background: none; padding: 0; white-space: nowrap; color: #9fd49f; }

/* Chronik */
.chr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.chr-card {
    background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--accent));
    border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.chr-card .top { display: flex; align-items: center; gap: 8px; }
.chr-card .top b { flex: 1; }
.chr-card .meta { color: var(--muted); font-size: 12px; }
.badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; }
.badge.on { color: var(--accent); border-color: var(--accent); }
.chr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chr-stats div { background: var(--bg); border-radius: 5px; padding: 5px 7px; display: flex; flex-direction: column; }
.chr-stats small { color: var(--muted); font-size: 11px; }
.chr-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.chr-timeline { display: flex; flex-direction: column; gap: 4px; }
.chr-axis, .chr-day { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.chr-ticks { position: relative; height: 14px; }
.chr-ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.chr-date { font-size: 12px; color: var(--muted); }
.chr-track {
    position: relative; height: calc(var(--lanes, 1) * 8px + 6px); min-height: 14px; background: var(--bg); border-radius: 4px;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 8 - 1px), #222832 calc(100% / 8 - 1px), #222832 calc(100% / 8));
}
.chr-seg { position: absolute; border-radius: 2px; opacity: .9; box-sizing: border-box; border: 1px solid #0e1013; }
.chr-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--danger); }
.chr-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 0 98px; font-size: 12px; color: var(--muted); }
.chr-legend span { display: flex; align-items: center; gap: 5px; }
.chr-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Zeitplan */
.sch-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sch-row { display: flex; align-items: center; gap: 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.sch-row.off { opacity: .55; }
.sch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sch-info small { color: var(--muted); }
.sch-cmds { background: none; padding: 0; color: #8b93a3; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-form { background: var(--card2); margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.sch-form textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.sf-opts { gap: 16px; }
.sch-log { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow-y: auto; }
.sch-log-row { display: grid; grid-template-columns: 130px 200px 1fr; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 820px) {
    .sch-row { flex-wrap: wrap; }
    .sch-log-row { grid-template-columns: 1fr; gap: 0; }
    .chr-axis, .chr-day { grid-template-columns: 56px 1fr; }
    .chr-legend { margin-left: 64px; }
}

/* Item-Bilder */
.item-icon { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.item { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.item small { grid-column: 2; }
.item .item-icon { grid-row: span 2; }
.item:not(:has(.item-icon)) small { grid-column: 1 / -1; }
.inv-slot .item-icon { position: absolute; inset: 0; margin: auto; width: 70%; height: 70%; }
.inv-slot.has-icon .inv-name { display: none; }

/* Statistik */
.st-pick { margin: 0; text-transform: none; letter-spacing: 0; }
.st-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.st-rank { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.st-rank > b { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.st-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.st-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; display: block; }
.st-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.st-bar.thin { height: 4px; }
.st-val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-size: 12px; }
.st-head { border-left: 4px solid var(--pc, var(--accent)); background: var(--card2); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; }
.st-head-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.st-head-top h2 { font-size: 18px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.st-kpi { background: var(--bg); border-radius: 5px; padding: 6px 9px; display: flex; flex-direction: column; }
.st-kpi small { color: var(--muted); font-size: 11px; }
.st-kpi b { font-size: 15px; font-variant-numeric: tabular-nums; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.st-box { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; }
.st-box h4 { margin: 0 0 4px; font-size: 13px; }
.st-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.st-item .item-icon.ph { display: block; width: 24px; height: 24px; }
.st-item-mid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-item-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-more { margin-top: 2px; }
.st-misc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.st-misc-row span { color: var(--muted); }
.st-misc-row b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Karte */
#ovMap .map-tile { image-rendering: pixelated; opacity: .9; }
#ovMap .grid { stroke: rgba(255, 255, 255, .08); }
#ovMap .grid-label { fill: rgba(255, 255, 255, .55); paint-order: stroke; stroke: #0e1013; stroke-width: 3px; }
.tab-map { display: flex; flex-direction: column; }
.tab-map .card-head { flex-wrap: wrap; }
.map-frame-wrap { position: relative; height: 72vh; min-height: 380px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #0e1013; }
.map-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#mapPlayers .btn .head { width: 18px; height: 18px; }
.tab-map a { color: var(--accent); }

.tab[hidden] { display: none !important; }

/* Leaflet-Karte */
#leafMap { position: absolute; inset: 0; background: #0e1013; }
.leaflet-container { font: inherit; }
.lm-tiles img, .leaflet-tile { image-rendering: pixelated; }
.lm-coords { background: rgba(14, 16, 19, .85); color: var(--text); padding: 3px 8px; border-radius: 4px; font: 12px ui-monospace, Consolas, monospace; }
.lm-place, .lm-player { background: none; border: 0; }
.lm-pin { display: block; width: 14px; height: 14px; margin: 1px; background: var(--c); border: 2px solid #0e1013; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.lm-label {
    position: absolute; left: 50%; top: -20px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600;
    color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; pointer-events: none;
}
.lm-head { display: block; width: 28px; height: 28px; border-radius: 5px; border: 2px solid var(--c); overflow: hidden; background: #0e1013; box-shadow: 0 1px 6px rgba(0,0,0,.7); }
.lm-head img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.lm-head b { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--c); }
.lm-player .lm-label { top: -19px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 12px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.lm-pop { display: flex; flex-direction: column; gap: 6px; }
.lm-pop-title { font-weight: 700; font-size: 14px; }
.lm-pop-row { display: flex; gap: 6px; align-items: center; }
.lm-pop-row select { flex: 1; padding: 4px 6px; font-size: 12px; }
.lm-pop input { padding: 5px 7px; font-size: 13px; }
.lm-sep { border-top: 1px solid var(--line); margin: 2px 0; }
.lm-colors { display: flex; gap: 5px; }
.lm-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.lm-color.on { border-color: var(--text); box-shadow: 0 0 0 2px #0e1013 inset; }
.leaflet-tooltip { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.leaflet-bar a { background: var(--card); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--card2); }
.map-opts { align-items: center; gap: 14px; }

/* Anzeigetafel */
.sb-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 10px 0; }
.sb-slot { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sb-slot small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.sb-card { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; }
.sb-card.on { border-color: var(--accent); }
.sb-card-head { display: flex; align-items: center; gap: 6px; }
.sb-title { text-shadow: 1px 1px 0 #3f3f3f; font-size: 14px; flex: 1; }
.sb-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sb-card .btn-row { margin: 0; }
.grow-text { flex: 1; min-width: 200px; align-self: center; }
body.sb-busy #tab-scoreboard { opacity: .6; pointer-events: none; cursor: progress; }

/* Chat-Meldungen */
.notify-row { align-items: flex-start; max-width: 620px; padding: 10px 12px; }
.mc-chat { margin-top: 6px; background: rgba(0, 0, 0, .55); padding: 4px 8px; border-radius: 3px; font: 13px ui-monospace, Consolas, monospace; display: inline-block; text-shadow: 1px 1px 0 #1a1a1a; }

/* Schnellbefehle mit Chat-Befehl */
.quick-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.qr-main { display: flex; flex-direction: column; gap: 6px; }
.qr-chat { display: flex; flex-direction: column; gap: 6px; }
.qr-chat.off .qr-allowed, .qr-chat.off .qr-cd { opacity: .4; }
.qr-chat-top { display: flex; gap: 8px; }
.qr-chat-top label { flex: 1; }
.qr-chat-top label:last-child { flex: 0 0 90px; }
.qr-bang { display: flex; align-items: center; }
.qr-bang span { padding: 0 6px; color: var(--accent); font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.qr-bang input { font-family: ui-monospace, Consolas, monospace; }
.qr-allowed { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.qr-badge { margin-left: 8px; font: 11px ui-monospace, Consolas, monospace; color: var(--accent); background: rgba(92, 184, 92, .12); border-radius: 4px; padding: 1px 5px; }
@media (max-width: 820px) { .quick-row { grid-template-columns: 1fr; } }
