:root {
  --bg: #0f1a14;
  --bg2: #16261d;
  --card: #1c3025;
  --line: #2d4a39;
  --text: #eef5ec;
  --muted: #9db8a6;
  --red: #e2463c;
  --gold: #f2c14e;
  --silver: #c9d3d8;
  --bronze: #d08a4f;
  --green: #5fd38a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, #2c5a3e 0%, transparent 70%),
    linear-gradient(var(--bg), var(--bg2));
}

h1, h2, h3, .brand, .stat-value { font-family: "Fredoka", "Nunito", sans-serif; }

a { color: var(--gold); }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: rgba(15, 26, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.hat {
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 26px solid var(--red);
}

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

nav a:hover { color: var(--text); background: var(--card); }
nav a.active { color: var(--bg); background: var(--gold); }
nav a.soon { opacity: 0.55; }

.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.3rem;
  padding: 4px 10px;
}

main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(3rem, 9vw, 5rem); margin: 0; letter-spacing: 1px; text-shadow: 0 6px 0 #0a120d; }
.tag { color: var(--muted); font-size: 1.2rem; margin: 8px 0 20px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.button {
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button.ghost { background: transparent; border: 2px solid var(--line); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
}

.stat-label { color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 3.4rem; font-weight: 700; line-height: 1.1; margin: 6px 0; }
.stat-note { color: var(--muted); font-size: 0.85rem; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #566; }
.dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(95, 211, 138, 0.6); animation: pulse 2s infinite; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(95, 211, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 211, 138, 0); }
}

.card { margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.more { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none; }

.board { list-style: none; margin: 0; padding: 0; }

.board li {
  display: grid;
  grid-template-columns: 36px 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.board li:last-child { border-bottom: none; }
.rank { font-family: "Fredoka", sans-serif; font-size: 1.2rem; text-align: center; color: var(--muted); }
.place-1 .rank { color: var(--gold); }
.place-2 .rank { color: var(--silver); }
.place-3 .rank { color: var(--bronze); }
.name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members { color: var(--muted); font-size: 0.9rem; }
.rating { font-family: "Fredoka", sans-serif; font-weight: 700; min-width: 60px; text-align: right; }

.logo {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: var(--bg);
}

.logo.empty { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, var(--bg2) 4px, var(--bg2) 8px); }

.news + .news { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }
.news h3 { display: flex; align-items: center; gap: 10px; }
.version { font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; background: var(--red); }

.card.soon { text-align: center; padding: 48px 24px; }

.bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

nav a[hidden] { display: none; }
nav a.account-link { border: 1px solid var(--line); }

button.button { border: none; cursor: pointer; font: inherit; font-weight: 700; }
button.button:disabled { opacity: 0.6; cursor: default; }
.button.danger { background: #b3261e; }
.small-button { padding: 6px 12px; font-size: 0.85rem; }
.button.ghost { color: var(--text); }

.text-input, .code-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.code-input {
  font-family: "Fredoka", monospace;
  font-size: 1.6rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  width: 11ch;
  text-align: center;
}

.login-form, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row.tight { margin: 0; gap: 6px; flex-wrap: nowrap; }
.row .text-input { flex: 1; min-width: 140px; }
.steps { color: var(--muted); padding-left: 20px; line-height: 1.7; }
.status { min-height: 1.2em; }
.bad { color: #ff8a80; }
.good { color: var(--green); }
.card.banned { border-color: #b3261e; }
.card h3 { margin: 16px 0 8px; }
.card h3:first-child { margin-top: 0; }

.badge { font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; vertical-align: middle; font-family: "Nunito", sans-serif; }
.badge.moderator { background: var(--red); color: #fff; }
.badge.helper { background: #3b6fd8; color: #fff; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.fact { background: var(--bg2); border-radius: 12px; padding: 10px 14px; }
.fact-label { color: var(--muted); font-size: 0.85rem; }
.fact-value { font-family: "Fredoka", sans-serif; font-size: 1.4rem; font-weight: 700; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }
.chip.gold { border-color: var(--gold); color: var(--gold); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.tab.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; max-width: 260px; }
td .button { white-space: nowrap; }

@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .top { flex-wrap: wrap; gap: 12px; }
  nav { display: none; width: 100%; flex-direction: column; }
  nav.open { display: flex; }
  .board li { grid-template-columns: 28px 36px 1fr auto; }
  .members { display: none; }
}
