:root {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e232b;
  --border: #2a313b;
  --text: #e8ebef;
  --muted: #9aa4b1;
  --accent: #c8a45a;
  --accent-soft: rgba(200, 164, 90, 0.12);
  --link: #d9b872;
  --radius: 12px;
  --max: 980px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --surface-2: #f0eee9;
    --border: #dedad2;
    --text: #1b1e22;
    --muted: #5d6570;
    --accent: #7a5c1c;
    --accent-soft: rgba(138, 106, 36, 0.10);
    --link: #7a5c1c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.92em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: 0.01em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
nav.site a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 0.95rem; }
nav.site a:first-child { margin-left: 0; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--text); }

.hero { padding-top: 64px; padding-bottom: 40px; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.15; margin: 0 0 16px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; margin: 0 0 24px; }
.pill { display: inline-block; font-size: 0.85rem; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px; margin-bottom: 18px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 14px; font-size: 0.9rem; color: var(--muted); }

section { padding: 36px 0; border-top: 1px solid var(--border); }
section h2 { font-size: 1.6rem; margin: 0 0 12px; }
section h3 { font-size: 1.1rem; margin: 24px 0 6px; }
section p { max-width: 760px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); }

.flow { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: step; display: grid; gap: 12px; }
.flow li { counter-increment: step; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px 14px 58px; position: relative; }
.flow li::before { content: counter(step); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700;
  display: grid; place-items: center; font-size: 0.9rem; }
.flow strong { display: block; }
.flow span { color: var(--muted); }

.table-scroll { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

ul.checks { padding-left: 1.2em; max-width: 760px; }
ul.checks li { margin: 6px 0; }

.gallery { display: grid; gap: 20px; margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery figure { max-width: 100%; }
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption { padding: 10px 16px; color: var(--muted); font-size: 0.92rem; }

.note { background: var(--accent-soft); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 16px; max-width: 760px; }

.doc { padding-top: 48px; padding-bottom: 48px; }
.doc h1 { font-size: 2rem; margin: 0 0 4px; }
.doc .updated { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.doc p, .doc ul { max-width: 760px; }

footer.site { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0 36px;
  color: var(--muted); font-size: 0.88rem; margin-top: 40px; }
footer.site p { margin: 6px 0; max-width: 820px; }
footer.site a { color: var(--muted); }

/* --- Startseite: Hero, Buttons, Funktionsabschnitte, Discord-Einladung --- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { display: block; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.hero-text { min-width: 0; }
.hero-shot { margin: 0; }
.hero-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.hero-shot figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.button { display: inline-block; padding: 12px 22px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.button:hover { border-color: var(--accent); }
.button.primary { background: #5865F2; border-color: #5865F2; color: #ffffff; }
.button.primary:hover { background: #4752c4; border-color: #4752c4; }

.why-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.note-inline { color: var(--muted); }
.eyebrow { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px; }

.feature { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px; align-items: center;
  padding: 36px 0; border-top: 1px solid var(--border); }
.feature:first-of-type { border-top: 0; }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature-text h3 { font-size: 1.45rem; margin: 0 0 10px; }
.feature-text p { margin: 0 0 12px; }
.feature-text .checks { margin: 0; }
.feature-media { display: grid; gap: 16px; min-width: 0; }
.feature-media img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.join { background: var(--accent-soft); text-align: center; }
.join .wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.join h2, .join p { margin: 0; }
.join p { max-width: 640px; }
.join-logo { display: block; }
.small { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .feature { grid-template-columns: 1fr; gap: 20px; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  nav.site a { margin-left: 12px; }
}

/* --- Community-Seite: Live-Zahlen (vom Worker eingesetzt, sonst hidden) --- */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.stats[hidden] { display: none; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; min-width: 120px; }
.stats dt { font-size: 0.8rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* --- Capy als Maskottchen (Sticker aus src/main/resources/img/stickers/mood) --- */
.mascot { display: block; width: auto; height: 128px; flex: none; }
.mascot-lg { height: 220px; }
.muted { color: var(--muted); font-weight: 400; }

/* --- Museum --- */
.museum-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center;
  padding-top: 56px; padding-bottom: 32px; }
.museum-hero h1 { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.15; margin: 12px 0 16px; }
.museum-hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 0 20px; }
.year-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.year-nav a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.year-nav a:hover { border-color: var(--accent); }
.next-exhibit { background: var(--surface); border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.exhibit-row { display: flex; gap: 24px; align-items: center; }
.exhibit-row h2 { margin: 4px 0 8px; }
.exhibit-row p { margin: 0; max-width: 700px; }
.year-label { font-size: 3rem; line-height: 1; margin: 0 0 24px; color: var(--accent); font-variant-numeric: tabular-nums;
  border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
.exhibit h4 { font-size: 1.15rem; margin: 32px 0 8px; }
.plaque { display: flex; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 22px 24px; }
.plaque h3 { font-size: 1.8rem; margin: 4px 0 8px; }
.plaque p { margin: 0 0 14px; color: var(--muted); max-width: 640px; }
.quest-grid { display: grid; gap: 12px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.quest { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.quest-icon { grid-row: 1 / span 4; font-size: 1.5rem; line-height: 1.2; }
.quest strong + span { color: var(--muted); font-size: 0.92rem; }
.split { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.split p { max-width: 640px; }

@media (max-width: 640px) {
  .museum-hero { grid-template-columns: 1fr; }
  .mascot-lg { height: 150px; }
  .exhibit-row, .plaque, .split { flex-direction: column; align-items: flex-start; }
  .mascot { height: 104px; }
  .year-label { font-size: 2.4rem; }
}

/* --- Museum: Kennzahlen, Rekorde, Quest-Werte --- */
.stats-wide { margin-top: 12px; }
.stats-wide dd { font-size: 1.25rem; }
.record-grid { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.record { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.record strong { display: block; font-size: 1.6rem; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.record span { color: var(--muted); font-size: 0.9rem; }
.quest .quest-value { grid-column: 2; margin-top: 6px; color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.quest .quest-date { grid-column: 2; color: var(--muted); font-size: 0.8rem; }
.quest-locked { border-style: dashed; background: transparent; }
.quest-locked .quest-value { color: var(--muted); font-weight: 600; }
.two-tables { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.two-tables .table-scroll { margin-top: 12px; }

/* --- Startseite: Capy guckt über die Ergebnis-Karte, kleine Capys an Abschnitten --- */
.hero-shot { position: relative; }
.hero-shot .hero-peek { position: absolute; top: -76px; right: 28px; width: 72px; height: auto; border: 0; border-radius: 0;
  box-shadow: none; pointer-events: none; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head h2 { margin-bottom: 12px; }
.mascot-sm { height: 76px; }
@media (max-width: 820px) {
  .hero-shot { margin-top: 60px; }
  .hero-shot .hero-peek { top: -64px; width: 60px; }
}

/* --- <picture> mit WebP (scripts/site_webp.py): verhält sich wie das Bild darin --- */
picture { display: block; min-width: 0; }
.cta-top { margin-top: 20px; }

/* --- What's new --- */
ul.changes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 820px; }
ul.changes li { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 12px 16px; }
ul.changes strong { display: block; }

/* --- Discord-Serverkarte (Zahlen live über worker/index.js) --- */
.server-card { display: block; position: relative; width: 100%; max-width: 380px; margin: 4px 0 20px; text-align: left;
  background: #232428; color: #f2f3f5; border: 1px solid #3f4147; border-radius: 16px; overflow: hidden;
  text-decoration: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); transition: transform .15s ease; }
.server-card:hover { transform: translateY(-2px); border-color: #5865F2; }
.server-banner { display: block; height: 84px; background: radial-gradient(ellipse at 50% 120%, #d9956a 0%, #9a5a34 45%, #6e3f22 100%); }
.server-icon { position: absolute; left: 20px; top: 44px; width: 84px; height: 84px; border-radius: 22px;
  background: #1e1f22; border: 5px solid #232428; display: flex; align-items: center; justify-content: center; }
.server-icon img { height: 64px; width: auto; }
.server-body { display: flex; flex-direction: column; gap: 4px; padding: 52px 20px 18px; }
.server-name { font-size: 1.25rem; }
.server-counts { display: flex; align-items: center; gap: 6px; color: #b5bac1; font-size: 0.95rem; }
.server-counts[hidden] { display: none; }
.server-counts .dot { width: 9px; height: 9px; border-radius: 50%; background: #80848e; display: inline-block; margin-left: 6px; }
.server-counts .dot-on { background: #23a55a; margin-left: 0; }
.server-meta, .server-players { color: #b5bac1; font-size: 0.9rem; }
.join .server-card { margin: 4px auto 8px; }
