:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1d232c;
  --line: #2a323d;
  --text: #e8ecf1;
  --muted: #97a1af;
  --accent: #3ddc97;
  --accent-ink: #06281a;
  --danger: #ff6b6b;
  --warn: #f5b041;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .7rem; }
.card > h2:first-child, form.card > h2:first-of-type { margin-top: 0; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }

/* Kopf und Fuß */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: inset -6px -6px 0 rgba(0,0,0,.18); }
.top nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.top nav > a:not(.btn) { color: var(--muted); }
.top nav > a:not(.btn):hover { color: var(--text); text-decoration: none; }
.who { display: flex; align-items: center; gap: .5rem; }
.who img { border-radius: 50%; }
.top form { margin: 0; }
footer {
  margin-top: auto; padding: 1.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
}
main { width: 100%; max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
main.wide { max-width: 1180px; }

/* Buttons */
.btn {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 650; padding: .65rem 1.2rem; border-radius: 10px; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: .4rem .85rem; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
button.link:hover { color: var(--text); }
button.link.danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Startseite */
.hero { padding: 3.5rem 0 2.5rem; max-width: 720px; }
.eyebrow { color: var(--accent); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; margin: 0 0 .8rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.lead.small { font-size: 1rem; margin-top: -.4rem; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0 1.2rem; }
.stats { color: var(--muted); font-size: .95rem; }
.stats strong { color: var(--text); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; padding: 1rem 0 2rem; }
.features article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.features h2 { margin: 0 0 .4rem; }
.features p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.steps ol { padding-left: 1.2rem; color: var(--muted); }
.steps li { margin: .4rem 0; }
.steps strong { color: var(--text); }

/* Karten, Meldungen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }
.card.center { text-align: center; max-width: 520px; margin: 4rem auto; }
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; border: 1px solid; }
.flash.ok { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.45); }
.flash.error { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.45); }
.hint { color: var(--muted); font-size: .85rem; margin: .35rem 0 0; }
.hint.warn { color: var(--warn); }

/* Serverliste */
.icon { width: 40px; height: 40px; border-radius: 12px; flex: none; object-fit: cover; }
.icon-fallback { display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin: 1.2rem 0 .6rem; }
.server-card { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.server-card strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dashboard */
.dash { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
.dash aside { position: sticky; top: 1rem; }
.guild-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.guild-head strong, .guild-head small { display: block; }
.guild-head small { color: var(--muted); font-size: .85rem; }
.guild-head.big h1 { margin: 0; }
.guild-head.big { margin-bottom: 1.5rem; }
.side { display: flex; flex-direction: column; gap: .15rem; }
.side a { color: var(--muted); padding: .5rem .8rem; border-radius: 9px; }
.side a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.back { display: inline-block; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; padding-left: .8rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.tile small { display: block; color: var(--muted); font-size: .8rem; }
.tile strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.modules { list-style: none; margin: 0; padding: 0; }
.modules li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.modules li:first-child { border-top: 0; }
.modules .state { color: var(--muted); margin-left: auto; font-size: .9rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--accent); }

/* Formulare */
.field { margin: .9rem 0; }
.field > label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: .55rem .7rem; font: inherit;
}
input.short { width: 6rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.2rem; }
.toggle { display: flex; gap: .7rem; align-items: flex-start; margin: .8rem 0; cursor: pointer; }
.toggle input, .checklist input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; margin-top: .2rem; flex: none; }
.toggle small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.checklist { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: .4rem .7rem; background: var(--bg); }
.checklist label { display: flex; gap: .55rem; padding: .22rem 0; font-weight: 400; cursor: pointer; }
.checklist label.disabled { color: var(--muted); cursor: not-allowed; }
form.inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
form.inline .field { margin: .6rem 0 0; flex: 1; min-width: 140px; }
form.card.inline .field { flex: none; }
form .btn { margin-top: .8rem; }
form.inline .btn { margin: 0 0 .1rem; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td.right { text-align: right; white-space: nowrap; }
td.right form { margin: 0; }
td.pre { white-space: pre-wrap; word-break: break-word; }
.card { overflow-x: auto; }
.tag { font-size: .8rem; padding: .12rem .5rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.tag.ban, .tag.kick { border-color: var(--danger); color: var(--danger); }

/* Rangliste */
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .5rem; }
.board .pos { width: 2rem; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.board li:nth-child(-n+3) .pos { color: var(--accent); }
.board img { border-radius: 50%; }
.board .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board progress { display: block; width: 100%; max-width: 320px; height: 6px; margin-top: .35rem; appearance: none; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.board progress::-webkit-progress-bar { background: var(--surface-2); }
.board progress::-webkit-progress-value { background: var(--accent); }
.board progress::-moz-progress-bar { background: var(--accent); }
.board .num { text-align: right; min-width: 5.5rem; }
.board .num strong, .board .num small { display: block; }
.board .num small { color: var(--muted); font-size: .75rem; }
.board .lvl { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .75rem; font-weight: 650; white-space: nowrap; }

@media (max-width: 800px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .dash aside { position: static; }
  .side { flex-direction: row; overflow-x: auto; padding-bottom: .3rem; }
  .side a { white-space: nowrap; }
  .side a.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .back { display: none; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .board .num { display: none; }
}
