:root {
    --bg: #0f1216;
    --bg2: #161b22;
    --card: #1b222c;
    --line: #283140;
    --text: #e6edf3;
    --muted: #8b97a7;
    --accent: #f08c00;
    --accent2: #ffa726;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(1200px 600px at 70% -10%, #1d2530 0%, var(--bg) 60%);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.warn { color: #ffb454; }

.topbar { background: rgba(13,17,22,.85); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand span { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); margin-right: 6px; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; font-size: .95rem; }
.btn:hover { text-decoration: none; border-color: #3a475a; }
.btn.primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); border: none; color: #1a1205; font-weight: 700; width: 100%; padding: 12px; font-size: 1rem; }
.btn.ghost { background: transparent; }

main.wrap { padding-top: 26px; padding-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.count { font-size: .8rem; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 10px; }

/* Auth */
.auth { max-width: 420px; margin: 6vh auto; }
.auth h1 { margin: 0 0 4px; }
.auth form { margin-top: 16px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input { width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 1rem; }
input:focus { outline: none; border-color: var(--accent); }
.alert { padding: 11px 14px; border-radius: 9px; margin: 14px 0; font-size: .92rem; }
.alert.err { background: #2a1517; border: 1px solid #5b2a2e; color: #ffb3b3; }
.steps { color: var(--muted); padding-left: 18px; }
.steps code, code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--accent2); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between; }
.hero-id { display: flex; gap: 16px; align-items: center; }
.avatar { width: 72px; height: 72px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.hero h1 { margin: 0; font-size: 1.5rem; }
.sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.chip { font-size: .8rem; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.big-chip { display: inline-block; font-weight: 700; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); margin-bottom: 12px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat { text-align: right; }
.stat span { display: block; color: var(--muted); font-size: .8rem; }
.stat b { font-size: 1.25rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .stats { width: 100%; justify-content: space-between; } .stat { text-align: left; } }

table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
table.kv td:first-child { color: var(--muted); width: 45%; }
table.kv tr:last-child td { border-bottom: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.plate { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.bar { height: 8px; background: #0c0f13; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar-label { font-size: .78rem; color: var(--muted); margin: 4px 0 8px; }
.meta { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.meta li { padding: 3px 0; border-bottom: 1px solid rgba(40,49,64,.5); }
.meta li:last-child { border-bottom: none; }

footer.wrap { padding: 24px 18px 40px; font-size: .82rem; }

/* ===== Panel-Layout mit Sidebar ===== */
.panel { display: flex; gap: 22px; align-items: flex-start; }
.content { flex: 1; min-width: 0; }
.side { width: 240px; flex: none; position: sticky; top: 78px; }
.side-id { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 14px; }
.side-id .body { height: 130px; image-rendering: pixelated; }
.side-name { margin-top: 8px; font-weight: 600; }
.side-nav { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-size: .94rem; }
.side-nav a:hover { background: var(--bg2); text-decoration: none; }
.side-nav a.active { background: linear-gradient(180deg, var(--accent2), var(--accent)); color: #1a1205; font-weight: 700; }
.side-nav a.active .ic { color: #1a1205; }
.side-nav .ic { width: 18px; text-align: center; color: var(--accent); opacity: .9; }
.side-nav a span:nth-child(2) { flex: 1; }
.badge { background: #0c0f13; border: 1px solid var(--line); color: var(--muted); border-radius: 20px; font-size: .72rem; padding: 1px 8px; }
.side-nav a.active .badge { background: rgba(0,0,0,.18); color: #1a1205; border-color: transparent; }

.crumbs { color: var(--muted); font-size: .85rem; margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text); font-weight: 600; }

.sec { text-align: center; text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; color: var(--muted); margin: 26px 0 14px; position: relative; }
.sec::after { content: ""; display: block; width: 40px; height: 3px; border-radius: 3px; background: var(--accent); margin: 8px auto 0; }

/* Finanz-Karten */
.fin { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .fin { grid-template-columns: 1fr; } }
.fin-card { border-radius: 16px; padding: 20px; color: #fff; display: flex; align-items: center; gap: 16px; }
.fin-card.green { background: linear-gradient(135deg, #2f9e44, #40c057); }
.fin-card.blue { background: linear-gradient(135deg, #1971c2, #339af0); }
.fin-ic { font-size: 1.8rem; background: rgba(255,255,255,.18); width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.fin-card span { display: block; font-size: .72rem; letter-spacing: .1em; opacity: .85; }
.fin-card b { font-size: 1.7rem; display: block; line-height: 1.1; }
.fin-card small { opacity: .8; font-size: .76rem; }

/* Lizenz-/Verifikations-Kacheln */
.tile.lic { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; }
.lic-ic { width: 52px; height: 52px; border-radius: 50%; background: #37b24d; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.tile.lic b { font-size: 1rem; }
.tile.lic .ok { color: #51cf66; font-weight: 600; font-size: .85rem; }
.tile.lic .pending { color: #ffb454; font-weight: 600; font-size: .85rem; }

/* KV zweispaltig */
table.kv.two td:nth-child(3) { color: var(--muted); width: 22%; padding-left: 16px; }
table.kv.two td:nth-child(1) { width: 22%; }
table.kv.tx td { font-size: .9rem; }
.nowrap { white-space: nowrap; }

/* Inventar-Mini-Kacheln */
.tile.mini { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tile.mini .amount { color: var(--accent2); font-weight: 700; white-space: nowrap; }

@media (max-width: 820px) {
    .panel { flex-direction: column; }
    .side { width: 100%; position: static; }
    .side-id .body { height: 90px; }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .side-nav a { flex: 1 1 auto; }
}

/* fehlende Lizenzen */
.tile.lic.gone { opacity: .55; }
.tile.lic .miss { color: #ff8787; font-weight: 600; font-size: .85rem; }

/* Footer-Links */
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent2); }

/* Rechtsseiten */
.legal { max-width: 820px; margin: 0 auto; }
.legal h1 { margin: 0 0 16px; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--accent2); }
.legal p, .legal li { color: #c5cfdb; font-size: .95rem; }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }

/* ===== Startseite (Home) ===== */
.home-hero { text-align: center; padding: 40px 0 10px; }
.home-hero h1 { font-size: 2.2rem; margin: 0; font-weight: 800; }
.home-hero h1 span { color: var(--accent); }
.home-hero p { color: var(--muted); margin-top: 8px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0 10px; }
.home-card { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: var(--text); transition: border-color .15s, transform .15s; }
.home-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.hc-ic { font-size: 1.7rem; width: 50px; height: 50px; flex: none; border-radius: 12px; background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.hc-txt { display: flex; flex-direction: column; }
.hc-txt b { font-size: 1.05rem; }
.hc-txt span { color: var(--muted); font-size: .85rem; }

/* Muster-Widerrufsformular */
.muster { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 10px; }
.muster p { margin: 8px 0; }

/* News */
.news h3 { margin: 0 0 4px; }
.news-meta { color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
.news p { color: #c5cfdb; }

/* Leaderboard */
ol.lb { list-style: none; margin: 0; padding: 0; counter-reset: lb; }
ol.lb li { counter-increment: lb; display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
ol.lb li:last-child { border-bottom: none; }
ol.lb li::before { content: counter(lb); width: 22px; text-align: center; color: var(--accent2); font-weight: 700; }
ol.lb li:nth-child(1)::before { color: #ffd43b; }
ol.lb img { width: 26px; height: 26px; border-radius: 5px; }
.lb-name { flex: 1; }
ol.lb b { color: var(--text); }

/* Freunde */
.tile.friend { display: flex; align-items: center; gap: 12px; }
.tile.friend img { width: 44px; height: 44px; border-radius: 8px; }
.tile.friend b { display: block; }
.tile.friend span { font-size: .82rem; }

/* Achievements */
.tile.ach { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; }
.tile.ach.gone { opacity: .5; }
.tile.ach .muted { font-size: .8rem; }
.tile.ach .ok { color: #ffd43b; font-weight: 600; font-size: .82rem; }
.tile.ach .miss { color: var(--muted); font-size: .82rem; }

/* Guide */
.guide-grp { margin: 20px 0 8px; color: var(--accent2); font-size: 1rem; }
.tile.mini.guide { gap: 8px; }
.tile.mini.guide.gone { opacity: .55; }
.tile.mini.guide .g-ic { color: #51cf66; font-weight: 700; }
.tile.mini.guide.gone .g-ic { color: var(--muted); }
.tile.mini.guide b { flex: 1; }
.tile.mini.guide .ok { color: #51cf66; font-size: .8rem; }
.tile.mini.guide .miss { color: var(--muted); font-size: .8rem; }

/* Vertrags-Status-Plate */
.plate.ok { color: #51cf66; border-color: #2b6a3a; }
.plate.pending { color: #ffb454; border-color: #6a4e1f; }
.plate.miss { color: #ff8787; border-color: #6a2b2b; }

/* Admin */
.home-card.admin { border-color: #c0392b55; }
.home-card.admin:hover { border-color: #e74c3c; }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { flex: 1; }
.searchbar .btn { width: auto; }
.btn.small { padding: 5px 10px; font-size: .82rem; }
table.admin-list { width: 100%; border-collapse: collapse; }
table.admin-list th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.admin-list td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
table.admin-list tr:hover td { background: var(--bg2); }
.mini-head { width: 26px; height: 26px; border-radius: 5px; display: block; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.dot.on { background: #37b24d; box-shadow: 0 0 6px #37b24d; }
.logh { font-size: .95rem; margin: 18px 0 8px; color: var(--accent2); border-top: 1px solid var(--line); padding-top: 12px; }
.logh:first-child { border-top: none; padding-top: 0; }

/* Punish */
.alert.ok { background: #14241a; border: 1px solid #2b6a3a; color: #b2f2bb; }
.punish-form { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.punish-form select { flex: 1; min-width: 220px; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: .95rem; }
.punish-form .btn.primary { width: auto; padding: 11px 22px; }

/* ChatLog */
.chatlog { max-height: 460px; overflow-y: auto; font-family: ui-monospace, "Cascadia Code", monospace; font-size: .85rem; }
.cl { display: flex; gap: 10px; padding: 4px 6px; border-bottom: 1px solid rgba(40,49,64,.4); align-items: baseline; }
.cl:hover { background: var(--bg2); }
.cl-t { color: var(--muted); white-space: nowrap; font-size: .75rem; min-width: 78px; }
.cl-k { font-size: .68rem; padding: 1px 6px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.cl.chat .cl-k { background: #1e3a2a; color: #69db7c; }
.cl.cmd .cl-k { background: #3a2a1e; color: #ffc078; }
.cl.cmd .cl-m { color: #ffd8a8; }
.cl-m { word-break: break-word; }
.punish-form input[type=text] { flex: 1; min-width: 200px; }

/* Fraktions-Übersicht */
.fhero .fhero-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fhero h1 { margin: 0; font-size: 1.7rem; }
.fhero .btn { width: auto; }
.tile.fmember { display: flex; align-items: center; gap: 12px; }
.tile.fmember img { width: 42px; height: 42px; border-radius: 8px; flex: none; }
.fm-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fm-info .muted { font-size: .78rem; }
.fm-rank { font-size: .78rem; color: var(--accent2); margin-top: 2px; font-weight: 600; }
a.fcard { cursor: pointer; }
