:root {
  --bg: #15171c;
  --surface: #1e2128;
  --surface-2: #272b34;
  --border: #323743;
  --text: #e8eaf0;
  --muted: #9097a6;
  --accent: #5fbf3a;
  --accent-dark: #3f8f22;
  --discord: #5865f2;
  --danger: #e05252;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* --- nagłówek --- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { margin: 0; font-size: 1.3rem; }
.version {
  font-size: .75rem;
  color: var(--accent);
  border: 1px solid var(--accent-dark);
  padding: 1px 7px;
  border-radius: 99px;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.btn {
  font: inherit;
  font-size: .9rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}
.btn--ghost { background: var(--surface-2); border-color: var(--border); font-family: ui-monospace, Consolas, monospace; }
.btn--ghost:hover { border-color: var(--accent); }
.btn--discord { background: var(--discord); }
.btn--discord:hover { filter: brightness(1.1); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--muted); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status--online .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status--offline .dot { background: var(--danger); }

/* --- zakładki --- */
.tabs { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.tab {
  font: inherit;
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.count { font-size: .8em; color: var(--muted); }

/* --- panele --- */
main { flex: 1; display: flex; min-height: 0; }
.panel { flex: 1; padding: 20px; overflow: auto; }
.panel--map { padding: 0; position: relative; display: flex; }
#map-frame { flex: 1; border: 0; width: 100%; min-height: 70vh; }
.map-updated {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  font-size: .8rem;
  background: rgba(0, 0, 0, .65);
  padding: 4px 10px;
  border-radius: 6px;
}
.empty { margin: auto; text-align: center; padding: 40px 16px; color: var(--muted); }

/* --- lista graczy --- */
.players-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.players-head p { margin: 0; font-size: .9rem; }
#search {
  font: inherit;
  padding: 8px 12px;
  width: min(320px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
#search:focus { outline: none; border-color: var(--accent); }

.players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.player img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  image-rendering: pixelated;
  background: var(--surface-2);
  flex-shrink: 0;
}
.player .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.player .tag { font-size: .75rem; color: var(--accent); }
.player.is-online { border-color: var(--accent-dark); }

@media (max-width: 600px) {
  .top, .tabs { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 16px; }
  .players { grid-template-columns: 1fr 1fr; }
}
