/* Tokens nach DESIGN.md 4.5 bis 4.8 */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #18181B;
  --text-muted: #52525B;
  --border: rgba(0, 0, 0, .10);
  --accent: #8583e0;
  --accent-text: #5B58C4;
  --on-accent: #141416;
  --dot-rand: rgba(0, 0, 0, .35);
  --rang-moderator: #1D4ED8;
  --rang-premium: #8A5A00;
  --eintrag-bg: #1C1C20;
  --an: #1f8a3b;
  --aus: #8a8a92;
  --akzent-flaeche: rgba(133, 131, 224, .12);
  --gelaende-erde: .42;
  --gelaende-stein: .10;
  --survival: #22863a; --bedwars: #c92a2a; --nordpol: #ffffff;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-klein: 6px;
  --r-flaeche: 10px;
  --rand: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --surface: #1C1C20;
    --text: #F2F2F5;
    --text-muted: #A1A1AA;
    --border: rgba(255, 255, 255, .12);
    --accent-text: #8583e0;
    --dot-rand: rgba(255, 255, 255, .35);
    --rang-moderator: #7aa2ff;
    --rang-premium: #f0b84a;
    --an: #55ff55;
    --akzent-flaeche: rgba(133, 131, 224, .18);
    --gelaende-stein: .14;
    --survival: #55ff55; --bedwars: #ff5555;
  }
}
@media (min-width: 600px) { :root { --rand: 32px; } }
@media (min-width: 1024px) { :root { --rand: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100vh; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font);
}
@media (min-width: 768px) { body { font-size: 17px; } }

.breite { width: 100%; max-width: calc(1040px + 2 * var(--rand)); margin-inline: auto; padding-inline: var(--rand); }
main { flex: 1; padding-block: var(--s7) var(--s8); }
.lesen { max-width: 680px; }

h1, h2 { font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 19px; margin-bottom: var(--s4); }
@media (min-width: 768px) { h1 { font-size: 28px; } h2 { font-size: 21px; } }
.lesen h1 { margin-bottom: var(--s5); }
.lesen h2 { margin: var(--s6) 0 var(--s2); }
p { margin: 0 0 var(--s3); }
section + section { margin-top: var(--s7); }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-klein); }

.sr-nur {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header und Footer */
.kopf { border-bottom: 1px solid var(--border); }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s2); flex-wrap: wrap; }
.logo-block { display: flex; flex-direction: column; gap: 2px; }
.marke { min-height: 40px; display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--text); text-decoration: none; line-height: 1.1; }
.marke b { font-weight: 800; color: var(--accent-text); }
.marke img { display: block; border-radius: 6px; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.marke:hover img { transform: translateY(-3px) rotate(-6deg); }
.online { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.2; }
.online .punkt { color: var(--aus); }
.online[data-zustand="an"] .punkt { color: var(--an); }
.kopf nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); }
.kopf nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: var(--s3);
  color: var(--text-muted); text-decoration: none; font-size: 16px; border-radius: var(--r-klein);
  transition: color .15s ease, background-color .15s ease;
}
.kopf nav a:hover, .kopf nav a[aria-current] { color: var(--text); }
.kopf nav a[aria-current]:not(.anmelden) { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; text-decoration-thickness: 2px; }
.kopf nav a.anmelden { color: var(--accent-text); border: 1px solid var(--accent); font-weight: 600; }
.kopf nav a.anmelden:hover { background: var(--akzent-flaeche); color: var(--accent-text); }
@media (max-width: 459px) {
  .kopf-innen { gap: var(--s1); padding-bottom: 0; }
  .kopf nav { flex-basis: 100%; }
  .kopf nav ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); padding-block: var(--s2) var(--s3); }
}
.fuss { border-top: 1px solid var(--border); padding-block: var(--s4); font-size: 14px; color: var(--text-muted); }
.fuss-innen { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); }
.fuss a { display: inline-flex; align-items: center; min-height: 44px; }

/* Label */
.label {
  display: inline-block; font-size: 14px; line-height: 1.2; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-klein); padding: var(--s1) var(--s2);
}
.titelzeile { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s6); }

/* Startseite */
.eintrag {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); align-items: start; width: 100%;
  padding: var(--s3); background: var(--eintrag-bg); color: #fff; text-align: left; font: inherit;
  border: 1px solid var(--border); border-radius: var(--r-flaeche); cursor: pointer;
  transition: border-color .15s ease;
}
.eintrag:hover { border-color: var(--accent); }
.eintrag-icon { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.eintrag-text { min-width: 0; display: block; }
.eintrag-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.eintrag-name { font-weight: 600; font-size: 17px; }
.eintrag-rechts { display: inline-flex; align-items: center; gap: var(--s2); flex: none; }
.eintrag-spieler { font-size: 14px; color: #A1A1AA; font-variant-numeric: tabular-nums; user-select: text; }
.eintrag-spieler.rueckmeldung { color: var(--accent); }
.motd { display: block; font-size: 15px; line-height: 1.35; margin-top: var(--s1); overflow-wrap: anywhere; color: #fff; }
.motd .zeile { display: block; }
.ping { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.ping i { width: 3px; background: #3f3f46; }
.ping i:nth-child(1) { height: 4px; } .ping i:nth-child(2) { height: 6px; } .ping i:nth-child(3) { height: 9px; }
.ping i:nth-child(4) { height: 11px; } .ping i:nth-child(5) { height: 14px; }
.ping[data-stufe="1"] i:nth-child(-n+1), .ping[data-stufe="2"] i:nth-child(-n+2), .ping[data-stufe="3"] i:nth-child(-n+3),
.ping[data-stufe="4"] i:nth-child(-n+4), .ping[data-stufe="5"] i { background: #55FF55; }
.offline .eintrag-icon { opacity: .9; }

/* MOTD-Farben (Minecraft) */
.mc-0 { color: #000; } .mc-1 { color: #0000AA; } .mc-2 { color: #00AA00; } .mc-3 { color: #00AAAA; }
.mc-4 { color: #AA0000; } .mc-5 { color: #AA00AA; } .mc-6 { color: #FFAA00; } .mc-7 { color: #AAAAAA; }
.mc-8 { color: #555555; } .mc-9 { color: #5555FF; } .mc-a { color: #55FF55; } .mc-b { color: #55FFFF; }
.mc-c { color: #FF5555; } .mc-d { color: #FF55FF; } .mc-e { color: #FFFF55; } .mc-f { color: #FFFFFF; }
.mc-brand { color: #8583e0; }
.motd .mc-fett { font-weight: 700; }
.motd .mc-kursiv { font-style: italic; }
.motd .mc-unter { text-decoration: underline; }
.motd .mc-durch { text-decoration: line-through; }
.motd .mc-unter.mc-durch { text-decoration: underline line-through; }


/* Pixelbilder, Gelände */
.pix { display: block; flex: none; image-rendering: pixelated; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.pix-s { width: 20px; height: 20px; } .pix-m { width: 40px; height: 40px; } .pix-l { width: 56px; height: 56px; } .pix-xl { width: 72px; height: 72px; }
.gelaende { display: block; width: 100%; height: 64px; }
.gelaende .g { fill: var(--accent); }
.gelaende .e { fill: var(--accent); fill-opacity: var(--gelaende-erde); }
.gelaende .s { fill: var(--text); fill-opacity: var(--gelaende-stein); }
.gelaende-band { margin-bottom: var(--s5); overflow: hidden; border-radius: var(--r-flaeche); }

/* Startseite: vier Felder, Spielmodi tief links */
.start { display: grid; gap: var(--s4); grid-template-columns: 1fr 1fr; grid-template-areas: "server server" "modi modi" "forum profil"; }
.start-server { grid-area: server; min-width: 0; }
.kachel-modi { grid-area: modi; justify-content: flex-start; }
.kachel-modi .kachel-name { margin-top: auto; } .kachel-forum { grid-area: forum; } .kachel-profil { grid-area: profil; }
@media (min-width: 768px) {
  .start { grid-template-columns: 3fr 2fr; grid-template-areas: "server server" "modi forum" "modi profil"; gap: var(--s5); }
}
.kachel {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s5); min-height: 132px; padding: var(--s5);
  background: var(--surface); color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: var(--r-flaeche);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .15s ease;
}
.kachel:hover { transform: translateY(-2px); border-color: var(--accent); }
.kachel:active { transform: scale(.98); }
.kachel:hover .pix { transform: translateY(-4px); }
.kachel-icons { display: flex; gap: var(--s3); }
.kachel-modi .kachel-icons { flex-direction: column; gap: var(--s4); }
.kachel-modus { display: flex; align-items: center; gap: var(--s4); font-size: 17px; color: var(--text-muted); }
.kachel-name { font-size: 19px; font-weight: 600; }
@media (min-width: 768px) { .kachel { min-height: 160px; } }
@media (prefers-reduced-motion: no-preference) {
  .start > *, .gelaende-band { animation: rein .5s cubic-bezier(.16, 1, .3, 1) backwards; }
  .start > :nth-child(2) { animation-delay: 60ms; } .start > :nth-child(3) { animation-delay: 120ms; } .start > :nth-child(4) { animation-delay: 180ms; }
}
@keyframes rein { from { opacity: 0; transform: translateY(8px); } }

/* Spielmodi */
.modiliste { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s4); max-width: 680px; }
.modiliste li { display: flex; align-items: center; gap: var(--s5); padding: var(--s4) var(--s5); border: 1px solid var(--border); border-radius: var(--r-flaeche); background: var(--surface); transition: border-color .15s ease; }
.modiliste li:hover { border-color: var(--accent); }
.modiliste li:hover .pix { transform: translateY(-4px); }
.modiliste h2 { margin: 0; }
.modiliste p { margin: var(--s1) 0 0; color: var(--text-muted); font-size: 15px; }

/* Forum */
.forum { display: grid; gap: var(--s7); }
.forum > section + section { margin-top: 0; }
@media (min-width: 900px) { .forum { grid-template-columns: 2fr 1fr; align-items: start; gap: var(--s8); } }
.beitraege, .kategorien { list-style: none; margin: 0; padding: 0; }
.beitraege li { display: flex; align-items: center; gap: var(--s3); padding-block: var(--s3); border-top: 1px solid var(--border); }
.beitraege li:first-child { border-top: 0; padding-top: 0; }
.beitrag { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.beitrag-titel { color: var(--text); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.beitrag-titel:hover { color: var(--accent-text); text-decoration: underline; }
.beitrag-rechts { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.meta { font-size: 14px; color: var(--text-muted); }
.kategorien a { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding-inline: var(--s3); margin-inline: calc(-1 * var(--s3)); color: var(--text); text-decoration: none; border-radius: var(--r-klein); transition: background-color .15s ease; }
.kategorien a:hover { background: var(--akzent-flaeche); }
.kategorien .zahl, .beitrag-rechts .zahl { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.kopfbild { image-rendering: pixelated; display: block; flex: none; border-radius: 2px; background: var(--border); }
.kopfbild.gross { width: 96px; height: 96px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .95em; padding: 2px 6px; background: var(--akzent-flaeche); border-radius: 4px; }
.anlegen { max-width: 560px; margin-top: var(--s6); }
.hinweis { margin-top: var(--s5); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s5); font: inherit; font-weight: 600; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--r-klein); cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.knopf:hover { transform: translateY(-1px); }
.knopf:active { transform: scale(.98); }

/* Verbinden */
.verbinden { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); max-width: 420px; padding: var(--s6); border: 1px solid var(--border); border-radius: var(--r-flaeche); background: var(--surface); }
.verbinden .titelzeile { margin: 0; }
.verbinden h1 { margin: 0; }

/* Profil */
.profil-spalten { display: grid; gap: var(--s7); }
@media (min-width: 900px) { .profil-spalten { grid-template-columns: 1.2fr 1fr; gap: var(--s8); align-items: start; } }
.profil-spalten > section + section { margin-top: 0; }
.banner { overflow: hidden; border-radius: var(--r-flaeche) var(--r-flaeche) 0 0; border: 1px solid var(--border); border-bottom: 0; background: var(--surface); }
.gelaende-banner { height: 80px; }
.profilkopf { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4) var(--s5); padding: 0 var(--s5) var(--s5); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-flaeche) var(--r-flaeche); background: var(--surface); margin-bottom: var(--s6); }
.profilkopf .kopfbild.gross { margin-top: -40px; border: 4px solid var(--surface); box-sizing: content-box; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.profilkopf .kopfbild.gross:hover { transform: translateY(-4px); }
.profilname { flex: 1; min-width: 160px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding-top: var(--s3); }
.profilname h1 { overflow-wrap: anywhere; }
.profilname .meta { margin: 0; }
.profilaktion { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); }
.rang { display: inline-block; font-size: 14px; line-height: 1.2; padding: var(--s1) var(--s2); border-radius: var(--r-klein); border: 1px solid currentColor; color: var(--text-muted); }
.rang-owner, .rang-admin { color: var(--accent-text); }
.rang-moderator { color: var(--rang-moderator); }
.rang-premium { color: var(--rang-premium); }
.bio { font-size: 19px; margin-bottom: var(--s6); max-width: 560px; overflow-wrap: anywhere; }
.privat, .leer { color: var(--text-muted); }
.gross-zahl { font-size: 32px; font-weight: 600; margin: 0 0 var(--s5); font-variant-numeric: tabular-nums; }
.balkenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); max-width: 480px; }
.balkenliste li { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: center; }
.modus { display: inline-flex; align-items: center; gap: var(--s2); }
.anteil { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.balken { grid-column: 1 / -1; display: block; width: 100%; height: 8px; overflow: visible; }
.balken-survival rect { fill: var(--survival); } .balken-bedwars rect { fill: var(--bedwars); }
.balken-nordpol rect { fill: var(--nordpol); stroke: var(--text-muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.freunde { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3); }
.freunde a { display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 72px; padding: var(--s2); color: var(--text); text-decoration: none; font-size: 14px; border-radius: var(--r-klein); transition: background-color .15s ease; }
.freunde a:hover { background: var(--akzent-flaeche); }
.freunde a:hover .kopfbild { transform: translateY(-3px); }
.freunde .kopfbild { transition: transform .2s cubic-bezier(.16, 1, .3, 1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
