:root {
  --bg: #0e1116;
  --bg-2: #131820;
  --panel: #181e27;
  --panel-2: #1f2732;
  --panel-3: #263040;
  --border: #2a3441;
  --text: #e8edf3;
  --muted: #8d9aab;
  --faint: #5d6a7b;
  --accent: #6cc04a;
  --accent-strong: #84d65f;
  --accent-dim: rgba(108, 192, 74, .14);
  --dirt: #866043;
  --gold: #f4cd4a;
  --iron: #d6dde6;
  --copper: #d98a56;
  --danger: #ef6a5e;
  --diamond: #5ee3ee;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 -3px 0 rgba(0, 0, 0, .25) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(108, 192, 74, .10), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 17, 22, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: ""; display: block; height: 4px;
  background: repeating-linear-gradient(90deg, #5d9c31 0 8px, #6cc04a 8px 12px, #4a7f27 12px 20px, #79c04a 20px 24px);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { image-rendering: pixelated; border-radius: 4px; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }

.status-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse 2s infinite; }
.dot.off { background: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Generic ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { color: var(--accent); font-size: 14px; font-weight: 600; }
.section-head a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.page-head { margin-bottom: 22px; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.num { font-variant-numeric: tabular-nums; }

.avatar { width: 40px; height: 40px; border-radius: 6px; image-rendering: pixelated; background: var(--panel-3); flex: none; }
.avatar.sm { width: 28px; height: 28px; border-radius: 4px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 8px; }

.notice {
  border: 1px solid rgba(244, 205, 74, .35); background: rgba(244, 205, 74, .08);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
}
.notice strong { color: var(--gold); }

.loading { display: grid; place-items: center; padding: 100px 0; color: var(--muted); gap: 14px; }
.loader {
  width: 32px; height: 32px; image-rendering: pixelated;
  background: url(/favicon.svg) center / contain no-repeat;
  animation: bob 1s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px) rotate(8deg); } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.active { color: var(--text); background: var(--accent-dim); border-color: var(--accent); }

.input, .select {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 14px; outline: none;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; }
.server-card { display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.server-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: repeating-linear-gradient(90deg, #5d9c31 0 6px, #6cc04a 6px 10px, #4a7f27 10px 16px);
}
.server-top { display: flex; gap: 14px; align-items: center; }
.server-icon { width: 56px; height: 56px; border-radius: 8px; image-rendering: pixelated; background: var(--panel-3); flex: none; }
.server-top h1 { font-size: 22px; }
.motd { color: var(--muted); font-size: 14px; margin-top: 2px; }
.server-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.fact span { display: block; color: var(--muted); font-size: 12px; }
.fact b { font-size: 17px; }
.address {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-2); border: 1px dashed var(--faint); border-radius: 8px; padding: 9px 12px;
  font-family: var(--mono); cursor: pointer;
}
.address:hover { border-color: var(--accent); }
.address small { color: var(--muted); font-family: inherit; }
.online-list { display: flex; flex-wrap: wrap; gap: 6px; }
.online-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; font-size: 13px;
}
.online-chip img { width: 22px; height: 22px; border-radius: 50%; image-rendering: pixelated; }
.online-chip:hover { border-color: var(--accent); }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.total {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.total .icon { font-size: 24px; line-height: 1; }
.total .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.total .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.total::after {
  content: ""; position: absolute; right: -20px; bottom: -20px; width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-dim); filter: blur(10px);
}

/* ---------- Hall of Fame ---------- */
.fame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.fame {
  display: block; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; transition: transform .15s, border-color .15s;
}
.fame:hover { transform: translateY(-2px); border-color: var(--faint); }
.fame-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fame-title .icon { font-size: 18px; }
.fame-top { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; }
.fame-top .avatar { width: 52px; height: 52px; box-shadow: 0 0 0 2px var(--gold); }
.fame-top .who { min-width: 0; }
.fame-top .who b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fame-top .who span { color: var(--gold); font-weight: 700; }
.crown { margin-left: auto; font-size: 22px; }
.fame-rest { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 6px; }
.fame-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fame-row .pos { width: 18px; color: var(--faint); font-weight: 700; }
.fame-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fame-row .v { color: var(--muted); }

/* ---------- Ranking ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 26px; scrollbar-width: thin; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 14px; max-width: 720px; margin: 0 auto 30px; }
.podium-spot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
.podium-spot .avatar { width: 64px; height: 64px; }
.podium-spot.p1 .avatar { width: 84px; height: 84px; }
.podium-spot .pname { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-spot .pval { color: var(--muted); font-size: 14px; }
.podium-block {
  width: 100%; border-radius: 8px 8px 0 0; display: grid; place-items: center;
  font-size: 32px; font-weight: 900; color: rgba(0, 0, 0, .45); image-rendering: pixelated;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .25);
}
.p1 .podium-block { height: 130px; background: repeating-linear-gradient(45deg, #f7d757 0 10px, #eec23a 10px 20px); }
.p2 .podium-block { height: 96px; background: repeating-linear-gradient(45deg, #e2e7ee 0 10px, #c9d0da 10px 20px); }
.p3 .podium-block { height: 72px; background: repeating-linear-gradient(45deg, #e39a68 0 10px, #c97a48 10px 20px); }

.rank-table { width: 100%; border-collapse: collapse; }
.rank-table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.rank-table tr:first-child td { border-top: 0; }
.rank-table tr { cursor: pointer; transition: background .12s; }
.rank-table tbody tr:hover { background: var(--panel-2); }
.rank-table .pos { width: 52px; font-weight: 800; color: var(--muted); text-align: center; }
.rank-table .who { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.rank-table .val { text-align: right; font-weight: 700; white-space: nowrap; width: 1%; }
.rank-table .barcell { width: 40%; }
.bar { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }
.medal-1 { color: var(--gold) !important; }
.medal-2 { color: var(--iron) !important; }
.medal-3 { color: var(--copper) !important; }

/* ---------- Spieler ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .input { flex: 1; min-width: 200px; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.player-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.player-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.player-card .avatar { width: 48px; height: 48px; }
.player-card .info { min-width: 0; flex: 1; }
.player-card b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.player-card b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card small { display: block; color: var(--muted); font-size: 13px; }

.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* ---------- Profil ---------- */
.back { display: inline-block; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.profile-head { display: flex; gap: 28px; align-items: flex-end; padding: 24px 28px 0; overflow: hidden; position: relative; }
.profile-head::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 220px at 10% 100%, var(--accent-dim), transparent 70%);
  pointer-events: none;
}
.profile-skin { width: 140px; flex: none; align-self: flex-end; position: relative; }
.profile-skin img { width: 100%; display: block; image-rendering: pixelated; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .5)); }
.profile-info { flex: 1; min-width: 0; padding-bottom: 24px; position: relative; }
.profile-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-name h1 { font-size: 34px; overflow-wrap: anywhere; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--panel-3); color: var(--muted);
}
.badge.online { background: var(--accent-dim); color: var(--accent-strong); }
.profile-meta { color: var(--muted); font-size: 14px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.profile-meta code { cursor: pointer; }
.profile-meta code:hover { color: var(--text); }
.highlights { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.highlight {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.highlight:hover { border-color: var(--faint); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; }
.tile {
  display: block; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; transition: border-color .15s;
}
.tile:hover { border-color: var(--faint); }
.tile .top { display: flex; justify-content: space-between; align-items: center; }
.tile .icon { font-size: 20px; }
.tile .rank { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg-2); padding: 2px 8px; border-radius: 999px; }
.tile .value { font-size: 22px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.tile .label { color: var(--muted); font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 20px; }
.detail-grid .panel h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.bar-list { display: grid; gap: 9px; }
.bar-item .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 4px; }
.bar-item .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .row span:last-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.bar-item .bar { height: 6px; }
.bar.red > i { background: linear-gradient(90deg, #c94b41, var(--danger)); }
.bar.blue > i { background: linear-gradient(90deg, #2fb4c0, var(--diamond)); }
.bar.gold > i { background: linear-gradient(90deg, #d9a92c, var(--gold)); }

.adv-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.adv-count b { font-size: 32px; font-weight: 800; color: var(--gold); }
.adv-list { display: grid; gap: 6px; }
.adv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 7px 10px; background: var(--bg-2); border-radius: 6px; }
.adv span:last-child { color: var(--muted); white-space: nowrap; font-size: 13px; }

.all-stats { margin-top: 20px; }
.all-stats .chips { margin: 14px 0 12px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table td { padding: 8px 10px; border-top: 1px solid var(--border); }
.stat-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.stat-table td code { color: var(--faint); font-size: 12px; margin-left: 8px; }
.stat-scroll { max-height: 520px; overflow-y: auto; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--faint); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .totals { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .brand { flex: 1; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav a { flex: 1; text-align: center; padding: 8px 6px; }
  .status-pill { margin-left: auto; }
  h1 { font-size: 24px; }
  .total .value { font-size: 20px; }
  .rank-table .barcell { display: none; }
  .profile-head { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px 0; gap: 10px; }
  .profile-skin { width: 110px; order: 2; align-self: center; }
  .profile-info { padding-bottom: 0; width: 100%; }
  .profile-meta code { overflow-wrap: anywhere; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile .value { font-size: 18px; }
  .tile .rank { font-size: 11px; padding: 2px 6px; }
  .fame-grid, .player-grid, .recent-list { grid-template-columns: minmax(0, 1fr); }
  .stat-table td code { display: none; }
  .profile-name, .profile-meta, .highlights { justify-content: center; }
  .profile-name h1 { font-size: 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .podium-spot .avatar { width: 48px; height: 48px; }
  .podium-spot.p1 .avatar { width: 60px; height: 60px; }
  .podium-spot .pname { font-size: 13px; }
  .podium-spot .pval { font-size: 12px; }
}
