@font-face { font-family: 'Pixelify'; src: url('fonts/pixelify.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #121212;
  --panel: #232323;
  --panel-2: #2c2c2c;
  --panel-3: #353535;
  --hi: #4a4a4a;          /* Kante oben/links */
  --lo: #0d0d0d;          /* Kante unten/rechts */
  --text: #ececec;
  --text-2: #b9b9b9;
  --muted: #8a8a8a;
  --green: #5fd35f;
  --green-d: #2f8f2f;
  --gold: #ffcc33;
  --silver: #d0d6dc;
  --bronze: #d8894a;
  --red: #ff6b6b;
  --link: #8fd0ff;
  --chart-grid: #3a3a3a;
  --radius: 0px;
  --pad: 16px;
  --font-px: 'Pixelify', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-image: linear-gradient(rgba(10,10,10,.86), rgba(10,10,10,.93)), url('tex/deepslate.png');
  background-size: auto, 64px 64px; image-rendering: auto;
  min-height: 100vh;
}
img.px, .px img { image-rendering: pixelated; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .px-font { font-family: var(--font-px); font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 30px; margin: 0 0 6px; text-shadow: 3px 3px 0 #000; }
h2 { font-size: 21px; margin: 0 0 12px; text-shadow: 2px 2px 0 #000; }
h3 { font-size: 17px; margin: 0 0 10px; text-shadow: 2px 2px 0 #000; }
.muted { color: var(--muted); }
.sub { color: var(--text-2); font-size: 13px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #000; padding: 8px; z-index: 99; }

/* ---------- Kopf */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55)), url('tex/dirt.png');
  background-size: auto, 48px 48px; image-rendering: pixelated;
  border-bottom: 4px solid #000;
  box-shadow: inset 0 6px 0 0 #5c9e31;
}
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px var(--pad) 10px; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.logo img { width: 36px; height: 36px; }
.logo span { font-family: var(--font-px); font-size: 26px; font-weight: 600; text-shadow: 3px 3px 0 #3f3f3f; color: #fff; line-height: 1; }
.logo small { display: block; font-family: var(--font-px); color: var(--gold); font-size: 12px; text-shadow: 1px 1px 0 #3f2a00; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav.main a {
  font-family: var(--font-px); color: #e0e0e0; padding: 6px 8px; text-shadow: 2px 2px 0 #000; font-size: 15px;
  border: 2px solid transparent;
}
nav.main a:hover { text-decoration: none; background: rgba(255,255,255,.08); }
nav.main a.on { color: #fff; background: rgba(0,0,0,.35); border-color: #000; box-shadow: inset 2px 2px 0 var(--hi); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-px); font-size: 14px;
  padding: 5px 10px; background: rgba(0,0,0,.5); border: 2px solid #000; white-space: nowrap; color: #fff;
}
.dot { width: 10px; height: 10px; background: var(--muted); box-shadow: 0 0 0 2px #000; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }
.burger { display: none; background: rgba(0,0,0,.4); border: 2px solid #000; color: #fff; font-family: var(--font-px);
  font-size: 16px; padding: 6px 10px; cursor: pointer; }

/* ---------- Inhalt */
main { max-width: 1240px; margin: 0 auto; padding: 22px var(--pad) 40px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel {
  background: var(--panel); padding: 16px;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
}
.panel + .panel { margin-top: 16px; }
.grid > .panel, .grid > .panel + .panel { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.mt { margin-top: 16px; }
.mt2 { margin-top: 28px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* Kennzahl-Kacheln */
.tile { display: flex; gap: 12px; align-items: center; }
.tile img { width: 40px; height: 40px; flex: none; }
.tile .v { font-family: var(--font-px); font-size: 24px; line-height: 1.1; color: #fff; text-shadow: 2px 2px 0 #000; }
.tile .l { color: var(--text-2); font-size: 13px; }

/* Icons */
.ic { width: 24px; height: 24px; vertical-align: middle; image-rendering: pixelated; flex: none; }
.ic.s { width: 18px; height: 18px; }
.ic.l { width: 32px; height: 32px; }
.head { width: 28px; height: 28px; image-rendering: pixelated; box-shadow: 0 0 0 2px #000; flex: none; background: #000; }
.head.s { width: 20px; height: 20px; }
.head.l { width: 48px; height: 48px; }

/* Ranglisten */
.board h3 { display: flex; gap: 8px; align-items: center; }
.board .desc { margin: -6px 0 8px; }
ol.rank { list-style: none; margin: 0; padding: 0; }
ol.rank li { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px solid #1a1a1a; }
ol.rank li:last-child { border-bottom: 0; }
ol.rank .pos { font-family: var(--font-px); width: 26px; text-align: right; color: var(--muted); flex: none; }
ol.rank li:nth-child(1) .pos { color: var(--gold); }
ol.rank li:nth-child(2) .pos { color: var(--silver); }
ol.rank li:nth-child(3) .pos { color: var(--bronze); }
ol.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.rank .val { font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
ol.rank .bar { position: relative; flex: 1; min-width: 0; }
ol.rank li.me { background: rgba(95, 211, 95, .08); }
.more summary { cursor: pointer; color: var(--link); padding: 6px; font-size: 13px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { display: none; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font-family: var(--font-px); color: #ddd;
  background: var(--panel-2); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
}
.tabs a:hover { text-decoration: none; background: var(--panel-3); }
.tabs a.on { background: #3b6e2a; color: #fff; box-shadow: inset 2px 2px 0 #6fb34f, inset -2px -2px 0 #1d3a14; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #1a1a1a; }
th { font-family: var(--font-px); font-weight: 400; color: var(--text-2); font-size: 14px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255,255,255,.025); }
.tbl-wrap { overflow-x: auto; }

/* Item-Gitter */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--panel-2); color: var(--text);
  border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); min-width: 0;
}
a.item:hover { text-decoration: none; background: var(--panel-3); }
.item .t { min-width: 0; }
.item .t b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t span { font-size: 12px; color: var(--text-2); }
.slot { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: #8b8b8b;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.slot img { width: 32px; height: 32px; image-rendering: pixelated; }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #1a1a1a; }
.feed li:last-child { border-bottom: 0; }
.feed .when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; padding-left: 8px; }
.feed .txt { min-width: 0; }
.feed .adv-t { color: #6cf06c; }
.feed .adv-t.challenge { color: #d36cf0; }
.feed .adv-t.goal { color: #6cc8f0; }
.feed .death { color: #ffb0b0; }
.day { font-family: var(--font-px); color: var(--gold); margin: 18px 0 6px; text-shadow: 2px 2px 0 #000; }

/* Formulare */
select, input[type=search], input[type=text] {
  font: inherit; font-size: 16px; color: var(--text); background: #111; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #000, inset -1px -1px 0 #3a3a3a; padding: 6px 8px; min-width: 0;
}
.btn {
  display: inline-block; font-family: var(--font-px); font-size: 16px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  padding: 8px 18px; background: #6f6f6f; border: 2px solid #000; cursor: pointer;
  box-shadow: inset 2px 2px 0 #aaa, inset -2px -2px 0 #444;
}
.btn:hover { background: #7b8bc7; box-shadow: inset 2px 2px 0 #bcc8ff, inset -2px -2px 0 #3c4a80; text-decoration: none; }
.copy { display: flex; gap: 0; align-items: stretch; max-width: 520px; }
.copy code { flex: 1; font: 600 20px var(--font-px); background: #000; padding: 10px 14px; color: var(--green); border: 2px solid #000; }

/* Charts */
.chart { position: relative; height: 260px; }
.chart.tall { height: 340px; }
.chart.short { height: 200px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 4px; display: inline-block; border-radius: 2px; }
.seg { display: inline-flex; border: 2px solid #000; }
.seg button { font: inherit; font-size: 13px; color: var(--text-2); background: var(--panel-2); border: 0; padding: 5px 10px; cursor: pointer; }
.seg button + button { border-left: 2px solid #000; }
.seg button.on { background: #3b6e2a; color: #fff; }

/* Profil */
.profile-head { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.skinbox { height: 300px; background: radial-gradient(circle at 50% 40%, #3a3a3a, #161616); border: 2px solid #000;
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); display: grid; place-items: center; }
.skinbox canvas { width: 100% !important; height: 100% !important; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kv div { background: var(--panel-2); padding: 8px 10px; border: 2px solid #000; }
.kv b { display: block; font-family: var(--font-px); font-size: 19px; font-weight: 600; color: #fff; }
.kv span { font-size: 12px; color: var(--text-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 3px 8px 3px 4px; background: var(--panel-2); border: 2px solid #000; }
.badge.g1 { border-color: #6b5200; background: #3a2f0b; }
.badge.g2 { border-color: #5a5f63; }
.badge.g3 { border-color: #6a3c18; }
.badge b { font-family: var(--font-px); }

.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.adv { width: 44px; height: 44px; display: grid; place-items: center; position: relative; cursor: help;
  background: #6b6b6b; box-shadow: inset 2px 2px 0 #9a9a9a, inset -2px -2px 0 #3a3a3a; border: 2px solid #000; }
.adv.done { background: #c9a227; box-shadow: inset 2px 2px 0 #f5d76e, inset -2px -2px 0 #7a5d0d; }
.adv.challenge { clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%); }
.adv.goal { border-radius: 50%; }
.adv img { width: 28px; height: 28px; image-rendering: pixelated; }
.adv:not(.done) img { filter: grayscale(1) brightness(.55); }
.adv.hid:not(.done) img { visibility: hidden; }
.adv .pg { position: absolute; bottom: 1px; right: 2px; font: 10px var(--font-px); color: #fff; text-shadow: 1px 1px 0 #000; }

/* Tooltip (Minecraft-Stil) */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px; padding: 7px 9px; font-size: 13px;
  background: rgba(16, 0, 16, .94); border: 2px solid #25015b; outline: 2px solid rgba(16,0,16,.94);
  box-shadow: inset 0 0 0 1px #5000ff33; color: #fff; display: none;
}
.tip b { display: block; font-family: var(--font-px); font-weight: 600; font-size: 15px; color: #55ff55; }
.tip b.challenge { color: #ff55ff; }
.tip i { display: block; font-style: normal; color: #aaa; margin-top: 3px; }

/* Karte */
.mapframe { width: 100%; height: calc(100vh - 220px); min-height: 420px; border: 2px solid #000; display: block; background: #000; }

/* Patchnotes */
.note h2 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.note .ver { font-family: var(--font-px); color: var(--green); font-size: 16px; }
.note h4 { font-family: var(--font-px); color: var(--gold); margin: 14px 0 4px; font-weight: 400; font-size: 16px; }
.note ul { margin: 0; padding-left: 20px; }
.note li { margin: 3px 0; }

.medal { font-family: var(--font-px); }
.title-card { display: flex; gap: 12px; align-items: center; }
.title-card .slot { width: 48px; height: 48px; }
.title-card .slot img { width: 36px; height: 36px; }
.title-card .t1 { font-family: var(--font-px); font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.title-card .who { display: flex; gap: 6px; align-items: center; }

footer { max-width: 1240px; margin: 0 auto; padding: 18px var(--pad) 30px; color: var(--muted); font-size: 12px; }

/* ---------- Mobil */
@media (max-width: 1230px) {
  .burger { display: inline-block; margin-left: auto; }
  nav.main { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0;
    background: #1a1a1a; border-bottom: 4px solid #000; padding: 6px var(--pad) 12px; }
  nav.main.open { display: flex; }
  nav.main a { padding: 10px 8px; font-size: 17px; }
  .top-in { flex-wrap: nowrap; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .profile-head { grid-template-columns: 1fr; }
  .skinbox { height: 240px; }
  h1 { font-size: 25px; }
  .pill .ptxt { display: none; }
  .logo small { display: none; }
  .panel { padding: 12px; }
  .chart { height: 220px; }
  .chart.tall { height: 260px; }
  .hide-sm { display: none; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .tile .v { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
