/* A dark brand bar in both light and dark mode, so the white logo always shows. */
.site-head {
  background: #1b1e21;
  color: #eef0ec;
  padding-top: env(safe-area-inset-top, 0px);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding-top: 10px; padding-bottom: 10px; }
.brand { margin: 0; line-height: 0; }
.brand img { display: block; height: 52px; width: auto; }
.site-head .link { color: #eef0ec; }

.site-main { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }

/* Announcements: a yellow edge, like the tape on a whiteboard note */
.news {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--yellow);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.note img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; background: var(--bg); }
.note-text { padding: 16px 18px 18px; }
.note h3 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.note p { margin: 0; white-space: pre-line; max-width: 65ch; }

/* Controls */
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 12px; }
.tools input[type='search'] { flex: 1 1 280px; width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button {
  font: 600 14px var(--body);
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  font: 500 14px var(--body);
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Leaderboards */
.cat { margin: 32px 0 12px; font-size: 30px; font-weight: 600; color: var(--muted); }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px 14px; }
.board h3 { font-size: 32px; font-weight: 800; }
.board header p { margin: 4px 0 0; font-size: 14px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 24px; margin-top: 14px; }
.col h4 { font: 600 14px var(--body); color: var(--muted); margin-bottom: 4px; }

.ranks { list-style: none; margin: 0; padding: 0; }
.ranks li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.ranks li:first-child { border-top: 0; }
.ranks .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .score { font: 800 21px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranks .score small { font: 500 12px var(--body); color: var(--muted); margin-left: 4px; }
.ranks li.hit { background: color-mix(in srgb, var(--yellow) 24%, transparent); border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* Roster: names only, in the order entered */
.roster {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0 24px;
}
.roster li { padding: 7px 0; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster li.hit { background: color-mix(in srgb, var(--yellow) 24%, transparent); border-radius: 6px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.none { padding: 32px 0; color: var(--muted); }

@media (max-width: 520px) {
  .brand img { height: 42px; }
  .board { padding: 16px; }
  .board h3 { font-size: 28px; }
}
