/* Dunkel, Monospace, blaue Akzente -- dieselbe Familie wie die Landing Page
   unter welcome/index.html, ohne sie zu kopieren. */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  --bg:      #0a0a0a;
  --panel:   rgba(255,255,255,0.035);
  --line:    rgba(255,255,255,0.08);
  --fg:      #e0e0e0;
  --dim:     rgba(255,255,255,0.42);
  --faint:   rgba(255,255,255,0.22);
  --accent:  #60a5fa;
  --ok:      #4ade80;
  --warn:    #fbbf24;
  --bad:     #f87171;
  --red:     #f87171;
  --blue:    #60a5fa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  /* Ein sehr flacher Farbverlauf nach oben, damit die Seite nicht wie ein
     schwarzes Rechteck wirkt. */
  background-image: radial-gradient(1200px 500px at 50% -200px, rgba(96,165,250,0.10), transparent 70%);
  background-attachment: fixed;
}

.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px);
}

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 1rem; }

/* ── Kopf ──────────────────────────────────────────────────────────────── */
.head {
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0 1.1rem;
  margin-bottom: 1.5rem;
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(12px);
}
.head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.prompt { color: var(--accent); font-weight: 700; }
h1 { font-size: clamp(1.05rem, 3.6vw, 1.5rem); font-weight: 700; letter-spacing: -0.01em; }

.state { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--dim); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot.on  { background: var(--ok);  box-shadow: 0 0 10px rgba(74,222,128,0.6); animation: pulse 2.4s ease-in-out infinite; }
.dot.off { background: var(--bad); box-shadow: 0 0 10px rgba(248,113,113,0.5); }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ── Karten ────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
}
.card h3 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dim); margin: 1.3rem 0 0.5rem;
}
.card p + p { margin-top: 0.7rem; }
.card p { font-size: 0.88rem; }
.meta  { font-size: 0.78rem !important; color: var(--dim); }
.note  { font-size: 0.78rem !important; color: var(--warn); border-left: 2px solid var(--warn);
         padding-left: 0.7rem; margin-top: 0.9rem; }
.empty { font-size: 0.8rem; color: var(--faint); }
code {
  background: rgba(96,165,250,0.09); border: 1px solid rgba(96,165,250,0.14);
  border-radius: 4px; padding: 0.05em 0.35em; font-size: 0.85em; color: #bfdbfe;
}
a { color: var(--accent); }

/* ── Kacheln ───────────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; }
.tile {
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 9px; padding: 0.75rem 0.85rem;
}
.tile-val { font-size: 1.15rem; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.tile-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); margin-top: 0.15rem; }
#live-meta { margin-top: 0.9rem; font-size: 0.78rem; color: var(--dim); }

/* ── Spielerliste ──────────────────────────────────────────────────────── */
.players { width: 100%; border-collapse: collapse; margin-top: 1.1rem; font-size: 0.85rem; }
.players th {
  text-align: left; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--faint); font-weight: 500; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line);
}
.players th.num, .players td.num { text-align: right; width: 4.5rem; }
.players td { padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.players tr:last-child td { border-bottom: none; }
.pname { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.pname .nick { overflow-wrap: anywhere; }
.badge {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em;
  border-radius: 3px; padding: 0.1em 0.35em; border: 1px solid currentColor; flex-shrink: 0;
}
.badge.bot  { color: var(--faint); }
.badge.red  { color: var(--red); }
.badge.blue { color: var(--blue); }
.ping-good { color: var(--ok); } .ping-ok { color: var(--warn); } .ping-bad { color: var(--bad); }

/* ── Verbinden ─────────────────────────────────────────────────────────── */
.connect { display: flex; gap: 0.6rem; align-items: stretch; flex-wrap: wrap; }
.connect code {
  flex: 1 1 14rem; font-size: 1rem; padding: 0.6rem 0.8rem; color: #fff;
  background: rgba(96,165,250,0.10); border: 1px solid rgba(96,165,250,0.25);
}
button {
  font-family: inherit; font-size: 0.8rem; color: var(--fg); cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.55rem 1rem; transition: border-color .2s, background .2s;
}
button:hover { background: rgba(255,255,255,0.11); border-color: rgba(96,165,250,0.4); }
button.done { color: var(--ok); border-color: rgba(74,222,128,0.4); }

.downloads { list-style: none; display: grid; gap: 0.5rem; margin-top: 0.4rem; }
.downloads li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem;
  background: rgba(255,255,255,0.02);
}
.downloads a { font-weight: 700; text-decoration: none; }
.downloads a:hover { text-decoration: underline; }
.dl-meta { font-size: 0.68rem; color: var(--faint); overflow-wrap: anywhere; }

/* ── Statistik ─────────────────────────────────────────────────────────── */
.range { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; }
.range button { padding: 0.3rem 0.8rem; font-size: 0.72rem; }
.range button.active { color: var(--accent); border-color: rgba(96,165,250,0.45); background: rgba(96,165,250,0.10); }

.chart { width: 100%; height: 120px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .grid { stroke: rgba(255,255,255,0.07); stroke-width: 1; }
.chart .bar-bots  { fill: rgba(96,165,250,0.22); }
.chart .bar-human { fill: var(--accent); }
.chart .lbl { fill: var(--faint); font-size: 9px; font-family: inherit; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 0.5rem; }
.list { list-style: none; font-size: 0.8rem; }
.list li { display: flex; justify-content: space-between; gap: 0.7rem; padding: 0.3rem 0;
           border-bottom: 1px solid rgba(255,255,255,0.04); }
.list li:last-child { border-bottom: none; }
.list .when { color: var(--faint); font-size: 0.72rem; white-space: nowrap; }

.foot { padding: 1.5rem 1rem 2.5rem; font-size: 0.68rem; color: var(--faint); text-align: center; }

@media (max-width: 620px) {
  body { font-size: 14px; }
  .card { padding: 1rem; }
  .cols { grid-template-columns: 1fr; gap: 1rem; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .players th.num, .players td.num { width: 3.5rem; }
}
