* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, sans-serif;
  background: #0f1419;
  color: #e6edf3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 0.75rem 1.25rem;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.nav-pages {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0 auto;
}
.nav-auth {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-login-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
.nav-login-hint {
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: right;
}
.nav-login-hint a { color: #8b949e; }
.nav-login-hint a:hover { color: #58a6ff; }
.nav a {
  color: #58a6ff;
  text-decoration: none;
}
.nav a:hover { text-decoration: underline; }
.brand { font-weight: 700; color: #f0f6fc !important; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-avatar { border-radius: 50%; }
.main { flex: 1; padding: 1.25rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.site-footer {
  padding: 1rem;
  text-align: center;
  color: #8b949e;
  font-size: 0.875rem;
  border-top: 1px solid #30363d;
}
.panel { max-width: 720px; }
.nav-admin { font-weight: 600; color: #d2a8ff !important; }
.panel.narrow { max-width: 420px; margin: 0 auto; }
.legal-doc { max-width: 52rem; line-height: 1.55; }
.legal-doc h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
  color: #f0f6fc;
}
.legal-doc ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.35rem;
}
.legal-doc li { margin-bottom: 0.35rem; }
.legal-doc a { color: #58a6ff; }
.auth-openid-note {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.auth-notice {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.auth-notice a { color: #58a6ff; }
.site-footer a { color: #8b949e; }
.site-footer a:hover { color: #58a6ff; }
h1 { margin-top: 0; }
.muted { color: #8b949e; }
.mono { font-family: ui-monospace, monospace; font-size: 0.9rem; }
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #238636;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.button:hover { filter: brightness(1.1); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
}
.server-name-sub {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.server-id-title {
  margin: 0 0 0.75rem;
}
.card.online { border-left: 4px solid #238636; }
.card.offline { border-left: 4px solid #6e7681; }
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #21262d;
}
.meta { font-size: 0.85rem; color: #8b949e; }

/* Servers layout */
.servers-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.75rem;
  height: calc(100vh - 120px);
  max-width: none;
}
.server-list {
  grid-row: 1 / -1;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.75rem;
  overflow: auto;
}
.server-list-toggle {
  display: none;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.6rem;
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6edf3;
  border-radius: 6px;
  font: 600 0.95rem/1.2 system-ui, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
}
.server-list-toggle:hover { background: #30363d; }
.server-list ul { list-style: none; padding: 0; margin: 0; }
.server-list li { margin-bottom: 0.35rem; }
.server-btn {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6edf3;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.server-btn:hover { background: #30363d; }
.server-btn.active { border-color: #58a6ff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #484f58; }
.dot.on { background: #3fb950; }
.map-panel {
  grid-column: 2;
  min-height: 280px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
}
.bottom-panel {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0.75rem;
  min-height: 140px;
}
.chat-log {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.5rem;
  overflow-y: auto;
  font-size: 0.85rem;
  max-height: 180px;
}
.chat-line { margin-bottom: 0.25rem; word-break: break-word; }
.chat-discord { color: #a371f7; }
.chat-game { color: #79c0ff; }
.player-list {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.5rem;
  overflow-y: auto;
  font-size: 0.85rem;
  max-height: 180px;
}
.player-list h3 { margin: 0 0 0.35rem; font-size: 0.9rem; }
.player-list ul { margin: 0; padding-left: 1.1rem; }

.profile-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.profile-avatar { border-radius: 8px; }
.roles { padding-left: 1.2rem; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th, .table td {
  border: 1px solid #30363d;
  padding: 0.4rem 0.6rem;
  text-align: left;
}
.leaderboard-panel {
  max-width: 980px;
}
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.leaderboard-block {
  margin-top: 1.25rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.75rem;
}
.leaderboard-grid .leaderboard-block {
  margin-top: 0;
}
.leaderboard-block--full {
  margin-top: 1.25rem;
}
.leaderboard-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}
.about-stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.about-stat-card h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #8b949e;
  font-weight: 600;
}
.about-stat-number {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f0f6fc;
}
.about-stat-sub {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: #8b949e;
  text-transform: lowercase;
}
.about-copy {
  margin-top: 1rem;
}
.about-discord-widget {
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}
.about-discord-widget iframe {
  display: block;
  max-width: 100%;
  border: 0;
}
.about-actions {
  margin-top: 0.8rem;
}
.about-discord-btn {
  background: #5865f2;
}
.about-discord-btn:hover {
  filter: brightness(1.08);
}
.ld-player {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #79c0ff;
  text-decoration: none;
}
.ld-player:hover { text-decoration: underline; }
.ld-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
  .about-stats {
    grid-template-columns: 1fr;
  }
  .servers-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
  }
  .server-list { grid-row: auto; overflow: visible; }
  .server-list h2 { display: none; }
  .server-list-toggle { display: block; margin-bottom: 0; }
  .server-list ul { display: none; margin-top: 0.6rem; }
  .server-list.is-open ul { display: block; }
  .map-panel { grid-column: 1; min-height: 240px; }
  .bottom-panel { grid-column: 1; grid-template-columns: 1fr; }
}
