/* United San Andreas · Team-Website. Farben aus dem Logo: Navy #1e3a4c, Orange #d4622b, Creme #efe4cc, Gold #c49a44 */

@font-face { font-family: 'Cinzel'; font-weight: 600; font-display: swap; src: url('/fonts/cinzel-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 700; font-display: swap; src: url('/fonts/cinzel-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
    color-scheme: dark;
    --bg: #0e1b24;
    --bg-2: #122330;
    --panel: #15293a;
    --panel-2: #1a3244;
    --panel-3: #213c50;
    --line: rgba(239, 228, 204, 0.09);
    --line-2: rgba(239, 228, 204, 0.16);
    --text: #efe4cc;
    --text-2: #c9c1ad;
    --muted: #8d9aa0;
    --accent: #d4622b;
    --accent-2: #e9824e;
    --accent-soft: rgba(212, 98, 43, 0.14);
    --gold: #c49a44;
    --gold-soft: rgba(196, 154, 68, 0.16);
    --navy: #1e3a4c;
    --ok: #5cb87a;
    --ok-soft: rgba(92, 184, 122, 0.14);
    --warn: #e2a93b;
    --warn-soft: rgba(226, 169, 59, 0.15);
    --bad: #e1594d;
    --bad-soft: rgba(225, 89, 77, 0.15);
    --info: #69a8d9;
    --info-soft: rgba(105, 168, 217, 0.15);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    --radius: 10px;
    --radius-sm: 6px;
    --sidebar: 236px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head: 'Cinzel', Georgia, serif;
    --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

:root[data-theme='light'] {
    color-scheme: light;
    --bg: #f3eee3;
    --bg-2: #ebe4d5;
    --panel: #fffdf8;
    --panel-2: #f8f3e9;
    --panel-3: #efe7d8;
    --line: rgba(30, 58, 76, 0.11);
    --line-2: rgba(30, 58, 76, 0.2);
    --text: #18303f;
    --text-2: #34495a;
    --muted: #66757d;
    --accent: #c0541e;
    --accent-2: #a9481a;
    --accent-soft: rgba(192, 84, 30, 0.1);
    --gold: #9c7629;
    --gold-soft: rgba(156, 118, 41, 0.12);
    --ok: #2f8a4f;
    --ok-soft: rgba(47, 138, 79, 0.11);
    --warn: #a86f0c;
    --warn-soft: rgba(168, 111, 12, 0.12);
    --bad: #b93a30;
    --bad-soft: rgba(185, 58, 48, 0.1);
    --info: #2f6f9f;
    --info-soft: rgba(47, 111, 159, 0.1);
    --shadow: 0 8px 24px rgba(30, 58, 76, 0.1);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
/* :where() ohne Gewicht, damit Kacheln und Listen mit eigener Klasse ihre Schriftfarbe behalten */
:where(:root[data-theme='light']) a { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 600; }

h1 {
    font-family: var(--font-head);
    font-size: 22px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

h2 {
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
}

h3 { font-size: 14px; font-weight: 600; }

.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* --- Gerüst ---------------------------------------------------------------------------------------------- */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px;
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
    color: var(--text);
}

.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; }

.brand strong {
    display: block;
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: 0.1em;
    line-height: 1.25;
}

.brand span { font-size: 11.5px; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-label {
    margin: 10px 8px 4px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
}

.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }

.nav a.active {
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }

.sidebar-foot { margin-top: auto; padding: 0 8px; font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 28px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar .crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.topbar .crumbs a { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }

.menu-button { display: none; }

.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); max-width: 820px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Bausteine ------------------------------------------------------------------------------------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    min-width: 0;
}

.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 18px 0; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.sidebar-right { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
}

a.stat:hover { border-color: var(--line-2); text-decoration: none; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.2; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .value.long { font-size: 18px; overflow-wrap: anywhere; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    background: var(--panel-3);
    color: var(--text-2);
}

.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
:root[data-theme='light'] .badge.accent { color: var(--accent); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel); border-color: var(--line); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
}

.icon-btn:hover { background: var(--panel); border-color: var(--line); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

input[type='text'], input[type='search'], input[type='password'], select {
    height: 34px;
    padding: 0 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--text);
    min-width: 0;
}

input:focus, select:focus, .btn:focus-visible, a:focus-visible, .icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type='search'] { width: 260px; }
.toolbar .count { color: var(--muted); font-size: 12.5px; margin-left: auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

.tabs button {
    background: none;
    border: 0;
    padding: 9px 14px;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .badge { margin-left: 6px; }

/* --- Tabellen -------------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    background: var(--panel);
    position: sticky;
    top: 0;
}

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { color: var(--accent); margin-left: 4px; }
tbody tr:hover td { background: var(--panel-2); }
tbody tr.link { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
td > .mono:only-child, td > .mono:first-child { white-space: nowrap; }
td.wide { min-width: 230px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }

.db-table td { font-family: var(--mono); font-size: 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-table td.null { color: var(--muted); font-style: italic; }
.db-table th { text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 12px; }

.pager { display: flex; align-items: center; gap: 8px 14px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.pager .page-size { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 12.5px; color: var(--muted); }
.pager .page-size select { width: auto; height: 28px; padding: 0 26px 0 10px; font-size: 12.5px; }
.pager .pages { display: inline-flex; align-items: center; gap: 4px; }
.pager .pages .btn { min-width: 30px; justify-content: center; padding: 0 8px; }
.pager .pages .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.pager .pages .gap { padding: 0 2px; color: var(--muted); }

/* --- Charakter: Reiter, Polizeifoto, Fotos --------------------------------------------------------------- */

.tab-body { display: grid; gap: 16px; margin-top: 16px; }
.identity { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.identity .kv { flex: 1; min-width: 220px; }
.mugshot { width: 130px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel-2); cursor: zoom-in; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel-2); cursor: zoom-in; }

/* --- Listen und Details ---------------------------------------------------------------------------------- */

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.list { display: flex; flex-direction: column; }

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.list-row:last-child { border-bottom: 0; }
a.list-row:hover { text-decoration: none; background: var(--panel-2); margin: 0 -18px; padding: 9px 18px; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { font-size: 12px; color: var(--muted); }

.notice {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--warn-soft);
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}

.notice.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--warn); }
.notice.info svg { color: var(--info); }
.notice.bad svg { color: var(--bad); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.meter { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; min-width: 60px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.ok > i { background: var(--ok); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }

.inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }

.slot {
    position: relative;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 6px 6px;
    text-align: center;
    min-height: 98px;
}

.slot img { width: 46px; height: 46px; object-fit: contain; display: block; margin: 0 auto 4px; }
.slot .name { font-size: 11.5px; line-height: 1.25; }
.slot .count { position: absolute; top: 4px; right: 6px; font-size: 11px; font-weight: 600; color: var(--gold); }
.slot .meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.code {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 560px;
    overflow: auto;
}

.code .err { color: var(--bad); }
.code .warn { color: var(--warn); }

.cmd { font-family: var(--mono); font-size: 12.5px; color: var(--accent-2); font-weight: 600; }
:root[data-theme='light'] .cmd { color: var(--accent); }
.param { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tool { display: flex; flex-direction: column; gap: 6px; }
.tool .how { font-size: 12.5px; color: var(--muted); }
.tool .how svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.tool .who { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }

/* --- Eingriffe ------------------------------------------------------------------------------------------- */

textarea {
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--text);
    resize: vertical;
    font: inherit;
}

textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.form.wide-form { max-width: none; }

.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--bad) 85%, #000); border-color: var(--bad); }

.matrix td, .matrix th { white-space: nowrap; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* Vorschau des Banners im Spiel (wie usav2_teamweb/web/announce.css) */
.banner-preview { margin-top: 14px; padding: 22px 16px; border-radius: var(--radius-sm); background: radial-gradient(500px 160px at 50% 0, #3b5a6c, #0b1820); display: flex; justify-content: center; }

.announce-demo {
    position: relative;
    width: min(520px, 100%);
    padding: 12px 18px 14px 22px;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(30, 58, 76, 0.97), rgba(18, 35, 47, 0.97));
    border: 1px solid rgba(196, 154, 68, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color: #efe4cc;
}

.announce-demo::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #c49a44; border-radius: 7px 0 0 7px; }
.announce-demo.warning { border-color: rgba(212, 98, 43, 0.8); }
.announce-demo.warning::before { background: #d4622b; }
.announce-demo .head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #c49a44; }
.announce-demo.warning .head { color: #d4622b; }
.announce-demo .head .from { margin-left: auto; font-family: var(--font); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; color: rgba(239, 228, 204, 0.6); }
.announce-demo .message { font-size: 16px; font-weight: 600; line-height: 1.38; overflow-wrap: anywhere; }

/* --- Bilder ---------------------------------------------------------------------------------------------- */

.photo {
    position: relative;
    flex: none;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background-color: var(--panel-2);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 42%;
}

.photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo.missing img { display: none; }
.photo[data-zoom], .photo[data-aerial] { cursor: zoom-in; }
.photo.missing[data-zoom] { cursor: default; }

.photo.sm { width: 96px; height: 54px; }
.photo.md { width: 100%; aspect-ratio: 16 / 9; }
.photo.lg { width: 100%; aspect-ratio: 16 / 9; max-height: 340px; }
.photo.item.sm { width: 48px; height: 48px; }
.photo.item.md { aspect-ratio: 4 / 3; background-size: 30%; }
.photo.item img { object-fit: contain; padding: 4px; }
.photo.house img { object-fit: cover; }
.photo.vehicle img { padding: 2px 4px; }

/* Platzhalter: Linienzeichnungen in der Textfarbe gedämpft */
.photo.vehicle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9aa0' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 16v-4l2-5h12l2 5v4'/%3E%3Cpath d='M3 16h18v3H3z'/%3E%3Ccircle cx='7.5' cy='16' r='1.4'/%3E%3Ccircle cx='16.5' cy='16' r='1.4'/%3E%3C/svg%3E"); }
.photo.item, .photo.box { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9aa0' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E"); }
.photo.house { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9aa0' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V9l8-5 8 5v11'/%3E%3Cpath d='M9.5 20v-6h5v6'/%3E%3C/svg%3E"); }
.photo.vehicle:not(.missing):has(img) { background-image: none; background-color: color-mix(in srgb, var(--panel-2) 70%, #ffffff 6%); }
.photo.item:not(.missing):has(img) { background-image: none; }
.photo.house:not(.missing):has(img) { background-image: none; }

.photo.aerial { background: #0b1820; }
.photo.aerial img { position: absolute; width: 256px; height: 256px; max-width: none; object-fit: fill; padding: 0; }
.aerial-dot { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(212, 98, 43, 0.35); }

td .photo { margin: -4px 0; }
.cell-with-photo { display: flex; align-items: center; gap: 12px; min-width: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 0 18px 18px; }

.tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    min-width: 0;
}

.tile:hover { border-color: var(--accent); }
.tile .name { font-weight: 600; line-height: 1.3; }
.tile .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tile .meta .mono { font-size: 11.5px; }
.tile .price { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.zoom-dialog { width: min(780px, calc(100vw - 32px)); }
.zoom { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.zoom-image { max-width: 100%; max-height: 70vh; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--panel-2) 70%, #ffffff 6%); }
.zoom .photo.aerial { max-width: 100%; }
.zoom-caption { font-weight: 600; }
.zoom .row { align-self: stretch; }

.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-dialog { width: min(820px, calc(100vw - 32px)); }

@media (max-width: 700px) {
    .detail { grid-template-columns: minmax(0, 1fr); }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0 12px 12px; }
}

/* --- Anmeldung ------------------------------------------------------------------------------------------- */

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        var(--bg);
}

.login-box {
    width: min(400px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 30px 28px 26px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-box .logo { width: 112px; height: 112px; margin: 0 auto 2px; display: block; }
.login-box h1 { text-align: center; font-size: 19px; }
.login-box .tagline { text-align: center; color: var(--gold); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: -8px; }
.login-box label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.login-box input { height: 40px; }
.login-box .btn { height: 40px; margin-top: 4px; }
.login-box .hint { font-size: 12.5px; color: var(--muted); text-align: center; }

.form-error { color: var(--bad); font-size: 13px; min-height: 18px; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }

.secret {
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px dashed var(--gold);
    border-radius: var(--radius-sm);
    user-select: all;
}

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

.map-wrap { position: relative; height: calc(100vh - 210px); min-height: 460px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: #0b1820; }
.map-credit { position: absolute; right: 8px; bottom: 6px; z-index: 450; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(14, 27, 36, 0.78); color: #efe4cc; pointer-events: none; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.map-legend label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255, 255, 255, 0.85); }

.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; line-height: 1.45; }
.leaflet-popup-content a { color: var(--accent-2); }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line-2); }
.leaflet-bar a:hover { background: var(--panel-2); }
.leaflet-control-scale-line { background: rgba(14, 27, 36, 0.7); color: #efe4cc; border-color: #efe4cc; }

.pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.pin.player { width: 16px; height: 16px; background: var(--ok); }
.pin.last { background: #8d9aa0; width: 11px; height: 11px; }
.pin.house-free { background: #d4622b; width: 11px; height: 11px; }
.pin.house-taken { background: #69a8d9; width: 11px; height: 11px; }
.pin.building { background: #c49a44; border-radius: 3px; width: 13px; height: 13px; }

.pin-label {
    position: absolute;
    left: 50%;
    top: -22px;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(14, 27, 36, 0.85);
    padding: 1px 6px;
    border-radius: 4px;
}

/* --- Sonstiges ------------------------------------------------------------------------------------------- */

.loading { padding: 40px; text-align: center; color: var(--muted); }

.loading::before {
    content: '';
    display: block;
    width: 26px;
    height: 26px;
    margin: 0 auto 10px;
    border: 3px solid var(--panel-3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2000;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    background: var(--panel-3);
    color: var(--text);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow);
    max-width: 420px;
}

.toast.bad { border-color: var(--bad); }

dialog {
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    padding: 22px;
    width: min(460px, calc(100vw - 32px));
    box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(5, 12, 17, 0.6); }
dialog h2 { margin-bottom: 14px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.user-menu { position: relative; }

.user-menu .panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 210px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.user-menu .panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu .panel button, .user-menu .panel a {
    text-align: left;
    background: none;
    border: 0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
}

.user-menu .panel button:hover, .user-menu .panel a:hover { background: var(--panel-2); text-decoration: none; }

/* --- Schmale Bildschirme --------------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.sidebar-right { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .layout { grid-template-columns: minmax(0, 1fr); }

    .sidebar {
        position: fixed;
        z-index: 1000;
        left: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }

    body.nav-open .sidebar { transform: none; }
    .menu-button { display: inline-grid; }
    .topbar { padding: 10px 16px; }
    .content { padding: 18px 16px 40px; }
    .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
    .toolbar input[type='search'] { width: 100%; }
    .toolbar .count { margin-left: 0; }
    .status-pill .text { display: none; }
    .map-wrap { height: calc(100vh - 230px); }
}

/* --- Moderation: Tickets und Server-Protokoll --------------------------------------------------------------- */

.badge.cat { background: color-mix(in srgb, var(--c) 20%, transparent); color: color-mix(in srgb, var(--c) 55%, var(--text)); }
.kv .sub { display: block; font-size: 12px; color: var(--muted); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-row .chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12.5px;
    border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer;
}
.chip-row .chip:hover { background: var(--panel-2); color: var(--text); }
.chip-row .chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.chat-line { max-width: 78%; display: flex; flex-direction: column; gap: 3px; }
.chat-line .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.chat-line .bubble { padding: 9px 12px; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-line.player { align-self: flex-start; }
.chat-line.player .bubble { background: var(--panel-2); border-top-left-radius: 3px; }
.chat-line.staff { align-self: flex-end; align-items: flex-end; }
.chat-line.staff .bubble { background: var(--accent-soft); border-top-right-radius: 3px; }
.chat-line.internal .bubble { background: var(--gold-soft); border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); }
.chat-line.system { align-self: center; max-width: 92%; font-size: 12px; color: var(--muted); padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; text-align: center; }
.chat-line.system.internal { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); }

.log-table td { vertical-align: top; }

/* --- Testliste ------------------------------------------------------------------------------------------- */

.test-stats .value { color: var(--text); }
.test-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--panel-3); margin-top: -8px; }
.test-bar i { display: block; height: 100%; transition: width 0.3s ease; }
.test-bar .ok { background: var(--ok); }
.test-bar .bad { background: var(--bad); }
.test-bar .retest { background: var(--accent); }

.test-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.test-step { display: grid; gap: 8px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.test-step h3 { font-size: 14px; }
.test-step p { margin: 0; font-size: 13px; color: var(--text-2); }

.chip-row.static .chip { cursor: default; font-family: var(--mono); font-size: 12px; }
.chip-row.static .chip:hover { background: transparent; color: var(--text-2); }

.test-toolbar {
    position: sticky;
    top: 58px;
    z-index: 400;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: -6px -28px;
    padding: 10px 28px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.test-toolbar input[type='search'] { width: 260px; }
.test-toolbar .test-sync { margin-left: auto; }
.test-chip-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.active .test-chip-count { color: var(--text-2); }

.test-areas { display: flex; flex-direction: column; gap: 20px; }
.test-area { scroll-margin-top: 130px; }
.test-area .card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.test-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.bad-text { color: var(--bad); }
.accent-text { color: var(--accent-2); }
:root[data-theme='light'] .accent-text { color: var(--accent); }
.test-summary { margin: 0 0 10px; color: var(--muted); max-width: 820px; }
.test-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.test-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
}

.test-row.s-ok { border-left-color: var(--ok); }
.test-row.s-fail { border-left-color: var(--bad); }
.test-row.s-retest { border-left-color: var(--accent); }
.test-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14.5px; line-height: 1.35; }
.test-row .two { color: var(--accent-2); font-weight: 600; }
:root[data-theme='light'] .test-row .two { color: var(--accent); }
.test-body { min-width: 0; display: grid; gap: 6px; }
.test-kv { gap: 3px 14px; font-size: 13.5px; }
.test-kv dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.fixnote { margin: 0; padding: 6px 10px; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--accent-soft); font-size: 13.5px; }
.fixnote b { font-weight: 600; }

.test-status { display: inline-flex; align-self: start; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.test-status button { min-width: 60px; padding: 6px 12px; border: 0; background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.test-status button + button { border-left: 1px solid var(--line-2); }
.test-status button:hover:not(:disabled) { color: var(--text); }
.test-status button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.test-status button:disabled { cursor: default; opacity: 0.6; }
.test-status button[aria-pressed='true'][data-set='ok'] { background: var(--ok-soft); color: var(--ok); }
.test-status button[aria-pressed='true'][data-set='fail'] { background: var(--bad-soft); color: var(--bad); }
.test-status button[aria-pressed='true'][data-set='open'] { background: var(--panel-3); color: var(--text); }

.test-note { grid-column: 1 / -1; display: grid; gap: 4px; }
.test-note textarea { min-height: 36px; padding: 7px 10px; font-size: 13.5px; }
.test-row.s-fail textarea { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.test-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px; color: var(--muted); }
.test-meta .saving { color: var(--accent-2); }
.test-history summary { cursor: pointer; }
.test-history ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; }

.test-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.test-notes h3 { font-size: 14px; margin-bottom: 6px; }
.test-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }

@media (max-width: 860px) {
    .test-toolbar { margin: -6px -16px; padding: 10px 16px; }
    .test-toolbar input[type='search'] { width: 100%; order: 2; }
    .test-toolbar select { order: 3; }
    .test-toolbar .test-sync { order: 4; margin-left: 0; }
}

@media (max-width: 700px) {
    .test-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { .test-bar i { transition: none; } }
