:root {
  --bg: #0f1117; --flaeche: #171a22; --flaeche2: #1e222c; --rand: #2a2f3b; --text: #e6e8ee; --leise: #8b93a7;
  --akzent: #8e2de2; --akzent2: #b56cff; --neon: #7dff3a; --gruen: #2ecc71; --rot: #ff5c6c; --gelb: #f5b942; --blau: #4aa3ff;
  --radius: 12px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--akzent2); }
.versteckt { display: none !important; }
.leise { color: var(--leise); }
.klein { font-size: 12px; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 16px; } h3 { font-size: 14px; }

/* Knöpfe & Felder */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 8px 14px;
  background: var(--akzent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf:hover { filter: brightness(1.1); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.leise { background: var(--flaeche2); color: var(--text); border: 1px solid var(--rand); }
.knopf.rot { background: var(--rot); } .knopf.gruen { background: #23a55a; } .knopf.gelb { background: #c98b14; }
.klein-knopf { padding: 5px 9px; font-size: 13px; }
input, select, textarea { width: 100%; background: var(--flaeche2); border: 1px solid var(--rand); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; margin: 10px 0; color: var(--leise); font-size: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-size: 14px; }
input[type=checkbox] { width: auto; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 500px at 15% 0%, #3a1366 0%, transparent 60%), radial-gradient(700px 400px at 100% 100%, #16381a 0%, transparent 60%), var(--bg); }
.login-box { width: min(380px, 100%); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 18px; padding: 28px; text-align: center; }
.login-box form { text-align: left; }
.login-box .knopf { width: 100%; margin-top: 6px; padding: 11px; }
.logo { width: 56px; height: 56px; border-radius: 14px; background: var(--akzent); display: grid; place-items: center; font-weight: 800; font-size: 22px; margin: 0 auto 12px; }
.klein-logo { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; margin: 0; }
.discord { background: #5865f2; }
.oder { display: flex; align-items: center; gap: 10px; color: var(--leise); font-size: 12px; margin: 16px 0 4px; }
.oder::before, .oder::after { content: ""; flex: 1; height: 1px; background: var(--rand); }
.fehlerbox { background: #3a1820; border: 1px solid #6b2433; color: #ffb3bd; padding: 9px 12px; border-radius: 9px; margin: 12px 0; text-align: left; }
.hinweisbox { background: #2b2410; border: 1px solid #5c4a14; color: #ffd98a; padding: 10px 14px; border-radius: 10px; margin: 0 20px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
aside { background: var(--flaeche); border-right: 1px solid var(--rand); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marke { display: flex; gap: 10px; align-items: center; padding: 16px; }
.server-wahl { display: flex; align-items: center; gap: 8px; padding: 0 16px 10px; }
.punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--leise); flex-shrink: 0; }
.punkt.an { background: var(--gruen); box-shadow: 0 0 8px var(--gruen); } .punkt.aus { background: var(--rot); }
nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
nav .gruppe { color: var(--leise); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 8px 6px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; }
nav a:hover { background: var(--flaeche2); }
nav a.aktiv { background: #2a2350; color: #fff; }
nav a span.i { width: 20px; text-align: center; }
.ich { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--rand); }
.ich > div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ich img { width: 32px; height: 32px; border-radius: 50%; }
main { min-width: 0; }
.kopf { display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.kopf h1 { font-size: 20px; flex: 1; }
#menue-knopf { display: none; }
#inhalt { padding: 0 20px 40px; }

/* Bausteine */
.raster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 16px; min-width: 0; }
.karte + .karte { margin-top: 14px; }
.raster .karte + .karte { margin-top: 0; }
.karte h2 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.zahl { font-size: 26px; font-weight: 700; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zeile > * { flex: 1; min-width: 140px; }
.zeile > .knopf { flex: 0 0 auto; min-width: 0; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.leer { color: var(--leise); padding: 20px; text-align: center; }
.marke-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--flaeche2); border: 1px solid var(--rand); }
.marke-tag.gruen { background: #143323; border-color: #1f5a3a; color: #7be0a8; }
.marke-tag.rot { background: #3a1820; border-color: #6b2433; color: #ffb3bd; }
.marke-tag.gelb { background: #33290f; border-color: #5c4a14; color: #ffd98a; }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rand); vertical-align: middle; }
th { color: var(--leise); font-weight: 600; font-size: 12px; background: var(--flaeche2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1b1f29; }
tr.klickbar { cursor: pointer; }
td .knoepfe { margin: 0; flex-wrap: nowrap; }

/* Konsole */
.konsole { background: #0a0c10; border: 1px solid var(--rand); border-radius: var(--radius); height: calc(100vh - 230px); min-height: 300px;
  overflow: auto; padding: 10px 12px; font: 12.5px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.konsole .f { color: #ff8f9b; } .konsole .w { color: #ffd98a; } .konsole .ich { color: #9b85ff; }
.konsole-eingabe { display: flex; gap: 8px; margin-top: 10px; }
.konsole-eingabe input { font-family: ui-monospace, Consolas, monospace; }

/* Schalter */
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rand); }
.schalter-zeile:last-child { border-bottom: 0; }
.schalter-zeile .t { min-width: 0; }
.sw { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #3a3f4d; border-radius: 99px; cursor: pointer; transition: .15s; }
.sw span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.sw input:checked + span { background: var(--akzent); }
.sw input:checked + span::before { transform: translateX(18px); }
.regler { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.regler input[type=range] { flex: 1; padding: 0; accent-color: var(--akzent); }
.regler output { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* Reiter */
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.reiter button { background: var(--flaeche); border: 1px solid var(--rand); color: var(--text); padding: 7px 12px; border-radius: 9px; cursor: pointer; font: inherit; }
.reiter button.aktiv { background: #2a2350; border-color: var(--akzent); }

/* Wetter */
.zone { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rand); }
.zone:last-child { border-bottom: 0; }

/* Dialog & Toasts */
.dialog { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog-box { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; padding: 20px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--flaeche2); border: 1px solid var(--rand); border-left: 4px solid var(--akzent); padding: 10px 14px; border-radius: 9px; max-width: 360px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast.ok { border-left-color: var(--gruen); } .toast.fehler { border-left-color: var(--rot); }

.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.inv div { background: var(--flaeche2); border: 1px solid var(--rand); border-radius: 9px; padding: 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }

/* Handy */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  aside { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  aside.offen { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  #menue-knopf { display: inline-flex; }
  .kopf { padding: 14px 16px; } #inhalt { padding: 0 16px 32px; } .hinweisbox { margin: 0 16px 12px; }
  .zwei { grid-template-columns: 1fr; }
  .zone { grid-template-columns: 1fr 1fr; }
  .konsole { height: calc(100vh - 260px); }
}

.cfx { background: #f40552; }

/* Logo */
.logo-bild { width: 96px; height: auto; display: block; margin: -6px auto 6px; filter: drop-shadow(0 0 18px rgba(142,45,226,.45)); }
.logo-klein { width: 30px; height: auto; filter: drop-shadow(0 0 8px rgba(142,45,226,.5)); }
.login-box h1 { font-size: 20px; letter-spacing: .02em; }
nav a.aktiv { background: linear-gradient(90deg, #3a1a63, #2a2350); box-shadow: inset 3px 0 0 var(--neon); }
.marke b { background: linear-gradient(90deg, #d08bff, var(--neon)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 16px; }
