:root {
  --bg: #0b0d10; --flaeche: #14171c; --flaeche2: #1b1f26; --rand: #262b33;
  --text: #e8eaed; --text2: #a3aab5; --leise: #6f7783;
  --linie: #7aa7ff;
  --gut: #3fb950; --warn: #e3b341; --schlimm: #f85149;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.leise { color: var(--leise); font-weight: 400; }
.klein { font-size: 13px; }
.fehler { color: var(--schlimm); min-height: 1.2em; margin: 0; }

/* Login */
#login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.login-box img { border-radius: 16px; }
.login-box h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: .04em; }
.login-box p { margin: 0; }
.login-box input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); font-size: 16px; }
.login-box button, .knoepfe button, #abmelden { width: 100%; padding: 13px; border: 0; border-radius: 12px;
  background: #fff; color: #000; font-weight: 600; cursor: pointer; }
button.zweit { background: var(--flaeche2) !important; color: var(--text) !important; border: 1px solid var(--rand) !important; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11,13,16,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rand); }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .05em; }
.marke img { border-radius: 7px; }
.pille { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--flaeche2); border: 1px solid var(--rand);
  display: flex; align-items: center; gap: 6px; }
.pille::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leise); }
.pille.gut::before { background: var(--gut); } .pille.warn::before { background: var(--warn); } .pille.schlimm::before { background: var(--schlimm); }

.banner { margin: 10px 12px 0; padding: 12px 14px; border-radius: var(--r); border: 1px solid; font-size: 14px; }
.banner.warn { background: #2a2311; border-color: #5c4a14; }
.banner.schlimm { background: #2c1314; border-color: #6b2023; }
.banner a { color: #fff; font-weight: 600; }

main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.seite { display: grid; gap: 12px; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); padding: 12px 14px; }
.k-titel { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.k-wert { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.k-unter { font-size: 12.5px; color: var(--text2); min-height: 1.2em; display: flex; align-items: center; gap: 5px; }
.punkt { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.punkt.gut { background: var(--gut); } .punkt.warn { background: var(--warn); } .punkt.schlimm { background: var(--schlimm); }

/* Karten */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); padding: 14px; }
.karte h2 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.karte-kopf h2 { margin: 0; }
.zahl { background: var(--flaeche2); border: 1px solid var(--rand); border-radius: 99px; padding: 0 8px; font-size: 12.5px; color: var(--text2); }
.segment { display: flex; background: var(--flaeche2); border-radius: 10px; padding: 2px; border: 1px solid var(--rand); }
.segment button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 13px; color: var(--text2); cursor: pointer; }
.segment button.an { background: #fff; color: #000; font-weight: 600; }

.diagramm { position: relative; margin-top: 10px; }
.d-titel { font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.diagramm canvas { width: 100%; height: 110px; display: block; touch-action: pan-y; }
.tip { position: absolute; top: 22px; pointer-events: none; background: #000; border: 1px solid var(--rand); border-radius: 8px;
  padding: 4px 8px; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.liste li { padding: 8px 2px; border-bottom: 1px solid var(--rand); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.liste li:last-child { border-bottom: 0; }
.liste .zeit { color: var(--leise); font-variant-numeric: tabular-nums; font-size: 12.5px; flex: none; }
.liste .rechts { margin-left: auto; color: var(--leise); font-size: 12.5px; }
.liste .leer { color: var(--leise); }
.liste a { color: var(--linie); text-decoration: none; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--flaeche2); border: 1px solid var(--rand); color: var(--text2); }
.tag.join { color: var(--gut); } .tag.quit { color: var(--text2); } .tag.warn { color: var(--warn); border-color: #5c4a14; }
.tag.schlimm { color: var(--schlimm); border-color: #6b2023; }
.echt { color: var(--warn); font-size: 12px; }

/* Chat */
.chat-leiste { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.schalter { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.schalter input { width: 18px; height: 18px; accent-color: #fff; }
.chat { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); overflow: hidden; }
.chat li { padding: 8px 12px; border-bottom: 1px solid var(--rand); word-wrap: break-word; }
.chat li:last-child { border-bottom: 0; }
.chat .zeit { color: var(--leise); font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.chat .name { font-weight: 600; }
.chat .rang { font-size: 11px; color: var(--text2); margin-right: 4px; letter-spacing: .04em; }
.chat li.markiert { background: #2a2311; box-shadow: inset 3px 0 0 var(--warn); }
.chat mark { background: none; color: var(--warn); font-weight: 700; }

/* Server-Werte */
.werte { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.werte dt { color: var(--text2); }
.werte dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.balken { height: 6px; border-radius: 3px; background: var(--flaeche2); margin-top: 4px; overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--linie); border-radius: 3px; }
.knoepfe { display: grid; gap: 8px; margin-top: 8px; }

/* Reiter unten */
.reiter { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(14,16,20,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom); }
.reiter button { position: relative; background: none; border: 0; padding: 8px 0 10px; display: grid; justify-items: center; gap: 2px;
  font-size: 11.5px; color: var(--leise); cursor: pointer; }
.reiter .ico { font-size: 19px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.reiter button.an { color: #fff; }
.reiter button.an .ico { opacity: 1; }
.reiter b { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--schlimm); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
