:root {
  --bg: #0d1321; --panel: #151d30; --panel2: #1c2640; --line: rgba(255,255,255,.08);
  --text: #e9eefb; --muted: #94a1c4; --accent: #f5b301; --pos: #3ddc97; --neg: #ff6b81;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: clamp(22px, 4vw, 30px); margin: 18px 0 4px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; font-weight: normal; }
.pad { padding: 14px 0; }
.ok { color: var(--pos); font-weight: 600; } .err { color: var(--neg); font-weight: 600; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .zero { color: var(--muted); }

/* Login / Setup */
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.narrow { width: min(440px, 100%); text-align: center; }
.logo { font-size: 46px; }
.form { display: grid; gap: 12px; text-align: left; margin-top: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 8px; }
input, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { font-family: ui-monospace, monospace; font-size: 14px; }
.code { font: 700 30px ui-monospace, monospace; letter-spacing: 4px; color: var(--accent); }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700;
  background: var(--accent); color: #1a1300; cursor: pointer; text-decoration: none; text-align: center; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.danger { background: #b4233c; color: #fff; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: rgba(13,19,33,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; white-space: nowrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs a { padding: 8px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; color: var(--muted); font-weight: 600; font-size: 15px; }
.tabs a.active { background: var(--accent); color: #1a1300; }
.logout { text-decoration: none; font-size: 22px; color: var(--muted); }
@media (max-width: 560px) { .brand { display: none; } }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 12px 40px; }

/* Tabellen */
.tablewrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead th { background: var(--panel2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
.num { text-align: right; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
tbody tr:hover { background: rgba(245,179,1,.06); }
table.rank td.name { font-weight: 700; }
table.rank td.stand { font-weight: 800; font-size: 17px; }
table.rank td.rankpos { width: 44px; text-align: center; }
table.rank td.today { font-size: 14px; }
table.rank td.joker { font-weight: 700; color: var(--accent); }
tr.inactive td.name { color: var(--muted); font-style: italic; }
table.rank th:nth-child(2), table.rank td.name { position: sticky; left: 0; background: var(--panel); }
table.rank thead th:nth-child(2) { background: var(--panel2); z-index: 1; }

.daytable th.time, .daytable td.time { position: sticky; left: 0; background: var(--panel); text-align: left; }
.daytable thead th.time { background: var(--panel2); z-index: 1; }
.daytable tr.total th { font-size: 17px; font-weight: 800; background: #222d4a; text-transform: none; letter-spacing: 0; }
.daytable td.num { font-weight: 600; }
.tag { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-left: 4px; font-weight: 700; vertical-align: middle; }
.t-super { background: rgba(245,179,1,.15); color: var(--accent); }
.t-pinikaer { background: rgba(130,160,255,.18); color: #a9bcff; }
.day { margin-bottom: 8px; }
.daynav { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
table.admin td { white-space: normal; font-size: 14px; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chips a { padding: 7px 13px; border-radius: 999px; background: var(--panel2); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); border: 1px solid var(--line); }
.chips a.active { background: var(--text); color: var(--bg); }
.form.inline { grid-template-columns: 1fr auto; }
@media (max-width: 560px) { .form.inline { grid-template-columns: 1fr; } }
