:root {
  --bg: #0b0d10;
  --panel: #13171c;
  --panel-2: #191e25;
  --line: #262c35;
  --line-soft: #1d222a;
  --text: #d6e6ec;
  --muted: #7d8b96;
  --gold: #d2b670;
  --gold-dim: #6b5220;
  --teal: #9fd6e2;
  --teal-2: #357f90;
  --green: #5fd06a;
  --red: #e04a5e;
  --orange: #e8a23c;
  --yellow: #e6cf5a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: .01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; }

/* ---------------------------------------------------------------- Kopf */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: #07090b;
  border-bottom: 1px solid var(--gold-dim);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand em { font-style: normal; color: var(--gold); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 5px;
  background: linear-gradient(135deg, var(--teal) 0 50%, var(--teal-2) 50% 100%);
  border: 2px solid var(--gold);
}
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 7px; white-space: nowrap; font-weight: 550;
}
nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--gold); }
nav .count { background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.me { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--muted); }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

/* ---------------------------------------------------------------- Bausteine */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.panel > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.panel > h2 .grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12px; }
.tile.green .value { color: var(--green); }
.tile.red .value { color: var(--red); }
.tile.orange .value { color: var(--orange); }
.tile.teal .value { color: var(--teal); }
.tile.gold .value { color: var(--gold); }

button, .btn {
  font: inherit; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
}
button:hover { border-color: var(--teal-2); }
button.primary { background: var(--teal-2); border-color: var(--teal-2); color: #fff; }
button.danger { background: #8a2f40; border-color: #a83a4e; color: #fff; }
button.good { background: #2c6b34; border-color: #3d7d3b; color: #fff; }
button.ghost { background: transparent; }
button.small { padding: 3px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 4px 12px; font-size: 13px; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }

input, select, textarea {
  font: inherit; color: var(--text); background: #0d1014; border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 1px; }
textarea { resize: vertical; min-height: 64px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 650;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.green { color: var(--green); border-color: #2c6b34; }
.badge.red { color: var(--red); border-color: #8a2f40; }
.badge.orange { color: var(--orange); border-color: #7a5520; }
.badge.yellow { color: var(--yellow); border-color: #6b5f20; }
.badge.teal { color: var(--teal); border-color: var(--teal-2); }
.badge.gray { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #161b21; }
.table-wrap { overflow-x: auto; }
td.nowrap, th.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

.player { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.player img, .avatar {
  width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; background: var(--panel-2); flex: none;
}
.avatar.big { width: 64px; height: 64px; border-radius: 8px; border: 2px solid var(--gold-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--green); }

.list { display: flex; flex-direction: column; }
.list .item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.list .item:last-child { border-bottom: 0; }
.list .item .main { flex: 1; min-width: 0; }
.list .item .main .title { font-weight: 600; }
.list .item .main .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- Diagramme */
.chart { position: relative; height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .hover-line { stroke: var(--gold-dim); stroke-width: 1; }
.chart .tip {
  position: absolute; pointer-events: none; background: #07090b; border: 1px solid var(--gold-dim);
  border-radius: 7px; padding: 6px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%);
}
.chart .tip b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------------- Spieler */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.profile-head .info { flex: 1; min-width: 200px; }
.profile-head .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.reason {
  text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: #0f1317; border: 1px solid var(--line); border-radius: 8px;
}
.reason:hover { border-color: var(--gold-dim); }
.reason .name { font-weight: 650; }
.reason .what { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.reason.BAN .name { color: #f08a98; }
.reason.MUTE .name { color: #f0c07a; }
.reason.KICK .name { color: var(--teal); }
.reason.WARN .name { color: var(--yellow); }
.custom-form { display: grid; grid-template-columns: 130px 120px 1fr auto; gap: 8px; margin-top: 12px; }

.flag { color: var(--red); }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: #07090b; border: 1px solid var(--gold-dim); border-radius: 9px; padding: 10px 16px; max-width: calc(100% - 32px);
}
.toast.err { border-color: var(--red); color: #f4b4bd; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--gold-dim); border-radius: 12px;
  padding: 20px; width: min(440px, calc(100% - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h3 { margin-bottom: 10px; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
dialog p { margin: 0 0 10px; color: var(--muted); }

.login-box { max-width: 460px; margin: 80px auto; text-align: center; }
.login-box code { color: var(--gold); }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  nav { order: 3; flex-basis: 100%; }
  main { padding: 16px; }
  .custom-form { grid-template-columns: 1fr 1fr; }
  .custom-form input[name=reason] { grid-column: span 2; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .value { font-size: 24px; }
  .hide-sm { display: none; }
}

/* ---------------------------------------------------------------- Templates, Team, Erklärung */
.mt0 { margin-top: 0; }
.mt8 { margin-top: 8px; }
.tiny { font-size: 11px; }
.btn.discord {
  display: inline-block; background: #5865f2; border-color: #5865f2; color: #fff; padding: 10px 22px; font-size: 15px;
  text-decoration: none; margin-top: 6px;
}
.btn.discord:hover { background: #4752c4; text-decoration: none; }
.me .avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.me #me-name { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.reason:disabled { opacity: .45; cursor: not-allowed; }
.reason .warn-text { color: var(--orange); }
.reason b { color: var(--text); font-weight: 650; }
.ladder { display: flex; gap: 3px; margin-top: 6px; }
.ladder i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.ladder i.done { background: var(--muted); }
.ladder i.now.t-WARN { background: var(--yellow); }
.ladder i.now.t-KICK { background: var(--teal); }
.ladder i.now.t-MUTE { background: var(--orange); }
.ladder i.now.t-BAN { background: var(--red); }
.sub-head { font-size: 14px; margin: 18px 0 0; color: var(--text); }
.step { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--line); margin: 2px 0; white-space: nowrap; }
.step.t-WARN { color: var(--yellow); border-color: #6b5f20; }
.step.t-KICK { color: var(--teal); border-color: var(--teal-2); }
.step.t-MUTE { color: var(--orange); border-color: #7a5520; }
.step.t-BAN { color: #f08a98; border-color: #8a2f40; }
.arrow { color: var(--muted); margin: 0 4px; }
.step-row { flex-wrap: nowrap; }
.step-row select { width: 130px; }
.step-row input { width: 110px; }
.step-no { color: var(--muted); width: 22px; font-variant-numeric: tabular-nums; }
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; }
.perm-group legend { color: var(--gold); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.perm { padding: 3px 0; flex-wrap: nowrap; }
.perm input { flex: none; }
input[type=color] { padding: 2px; height: 36px; }
.help p { margin: 0 0 10px; }
.help p:last-child { margin-bottom: 0; }
.help ul { margin: 0 0 10px; padding-left: 20px; }
.help code { color: var(--gold); }
.steps-demo { display: flex; flex-wrap: wrap; align-items: center; }
