/* ============================================================
   Design-Tokens. Ecken: --radius-card gilt für alle grossen
   Felder (Karten, Panels, Kopfbereich) und ist absichtlich 0.
   ============================================================ */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eceee8;
  --border: #d5d9cf;
  --text: #1c1f1a;
  --muted: #5d6458;
  --accent: #3f8a2e;
  --accent-ink: #ffffff;
  --accent-soft: #e1efdb;
  --online: #2f9e44;
  --offline: #c92a2a;
  --pending: #a1a79b;
  --hero-bg: #22301d;
  --hero-text: #f2f5ef;
  --hero-muted: #b9c4b2;

  --radius-card: 0;
  --radius-small: 0;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121510;
    --surface: #1b1f18;
    --surface-2: #232820;
    --border: #323a2d;
    --text: #e8ece4;
    --muted: #9aa393;
    --accent: #5fb84a;
    --accent-ink: #0f140d;
    --accent-soft: #24331f;
    --online: #51cf66;
    --offline: #ff6b6b;
    --pending: #6b7365;
    --hero-bg: #0c0f0a;
    --hero-text: #eef2ea;
    --hero-muted: #9aa393;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Kopfbereich ---------- */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 48px 0 40px;
  border-bottom: 4px solid var(--accent);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.tagline {
  margin: 10px 0 0;
  max-width: 60ch;
  color: var(--hero-muted);
}
.summary {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--hero-text);
  font-variant-numeric: tabular-nums;
}
.summary:empty { display: none; }

main.wrap { padding-top: 32px; padding-bottom: 16px; }

.section-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Server-Karten ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.empty { color: var(--muted); margin: 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--pending);
  border-radius: var(--radius-card);
}
.card[data-state="online"]  { border-top-color: var(--online); }
.card[data-state="offline"] { border-top-color: var(--offline); }

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.icon {
  flex: none;
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0;
  object-fit: cover;
}
.icon.placeholder {
  background:
    linear-gradient(var(--accent) 0 30%, transparent 30%),
    repeating-linear-gradient(90deg, #8a5a33 0 14px, #7a4e2b 14px 28px);
}
.head-text { min-width: 0; flex: 1; }
.card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}
.dot {
  width: 9px;
  height: 9px;
  background: var(--pending);
}
.card[data-state="online"]  .dot { background: var(--online); }
.card[data-state="offline"] .dot { background: var(--offline); }
.card[data-state="loading"] .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.players {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.players strong { display: block; font-size: 22px; line-height: 1; }
.players span { font-size: 12px; color: var(--muted); }

.motd {
  margin: 0;
  padding: 10px 12px;
  background: #1a1a1a;
  color: #d8d8d8;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-card);
}
.motd:empty { display: none; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tag {
  padding: 2px 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}
.tag-open {
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.tag-wl {
  font-weight: 600;
  color: var(--text);
  border-color: var(--muted);
}
.tag-wl a { color: inherit; text-decoration: none; }
.tag-wl a:hover { text-decoration: underline; }

.desc { margin: 0; color: var(--muted); }
.desc:empty { display: none; }

.ip-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  min-width: 0;
}
.ip-row code {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--surface-2);
  white-space: nowrap;
  overflow-x: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.btn-copy {
  border: 0;
  border-left: 1px solid var(--border);
  font-size: 14px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.modpack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.modpack .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.modpack .note { font-size: 13px; color: var(--muted); }
.modpack .btn { align-self: flex-start; }

.player-list { font-size: 14px; }
.player-list summary { cursor: pointer; color: var(--muted); }
.player-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.player-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.player-list img { width: 18px; height: 18px; image-rendering: pixelated; }

/* ---------- Info-Panels ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-top: 32px;
}
.panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.panel h2 { margin: 0 0 10px; font-size: 20px; }
.panel p { margin: 0 0 12px; }

.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  position: relative;
  padding: 0 0 12px 40px;
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
}

.rules { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 6px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- News ---------- */
.news { margin-bottom: 32px; }
.news-list { display: grid; gap: 16px; }
.news-item { border-left: 4px solid var(--accent); }
.news-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.news-item h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.news-date {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.news-body p { margin: 10px 0 0; }
.news-body p:first-child { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .card[data-state="loading"] .dot { animation: none; }
}
