/* Reset, type, links, buttons, the shell (header, footer) and utilities. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms, color 200ms;
}

h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-title);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

strong,
b {
  color: var(--ink);
  font-weight: 600;
}

em {
  font-style: normal;
  color: var(--accent);
}

/* One family everywhere (no monospace): commands and numbers only switch to tabular figures. */
code,
kbd {
  font: inherit;
  font-variant-numeric: tabular-nums;
}

code,
kbd {
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--ink);
  color: var(--on-ink);
}

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ links & buttons */

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--underline);
  text-underline-offset: 0.2em;
  transition: color var(--ease), text-decoration-color var(--ease), background-color var(--ease);
}

a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* Quiet link: no underline until hovered (names in tables and lists). */
.plain {
  text-decoration: none;
  color: var(--ink);
}

.plain:hover {
  text-decoration-line: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease);
}

.btn:hover {
  background: var(--ink-hover);
  border-color: var(--ink-hover);
  color: var(--on-ink);
}

/* Secondary action: a plain underlined text link (also used on <button>). */
.link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 500;
  font-size: inherit;
  line-height: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--underline);
  text-underline-offset: 0.25em;
  transition: color var(--ease), text-decoration-color var(--ease);
}

.link:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.link--muted {
  color: var(--muted);
  font-weight: 400;
}

.link--muted:hover {
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

/* Text links beside a button match the button label (15.2px / 500). */
.actions .link,
.state__actions .link {
  font-size: 0.95rem;
  text-underline-offset: 0.25em;
}

/* Small phones: a button takes the full width (and so its own line); text links stay side by side. */
@media (max-width: 480px) {
  .actions {
    gap: 1.25rem 2rem;
  }

  .actions .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ shell */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.main {
  display: block;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.main:focus {
  outline: none;
}

.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--rule);
}

.section--flush {
  border-top: 0;
}

.page-head {
  padding: 5.5rem 0 3rem;
}

/* Phones: inner pages start near the top, so a board shows its rows in the first screen. */
@media (max-width: 760px) {
  .page-head {
    padding-top: 3rem;
    padding-bottom: 2.25rem;
  }
}

.kicker {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.label {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.lede {
  max-width: var(--measure);
  margin-top: 1.25rem;
  color: var(--body);
  font-size: var(--fs-lede);
  line-height: 1.55;
}

.meta {
  margin-top: 1rem;
  color: var(--muted);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

.sep {
  padding: 0 0.45em;
  color: var(--underline);
}

/* One fact of a "a · b · c" line: wraps as a unit, so "2 h ago" never splits from "last seen". */
.fact-item {
  display: inline-block;
  max-width: 100%;
}

/* Phones: facts wrap as a row with a gap and no dots, so no "·" is left dangling at a line end. */
@media (max-width: 640px) {
  .factline {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1rem;
  }

  .factline > .sep {
    display: none;
  }
}

.section-head {
  margin-bottom: 3rem;
}

@media (max-width: 760px) {
  .section-head {
    margin-bottom: 2rem;
  }
}

.section-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.section-head .lede {
  margin-top: 1.35rem;
  font-size: 1.15rem;
  line-height: 1.55;
}

.section-head .meta {
  margin-top: 0.75rem;
}

/* A section's secondary link ("All 40 players →") stays quieter than its title. */
.section-head__row > .link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.section-head__row > .link:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------------ header */

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--on-ink);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 24px;
  height: 24px;
  flex: none;
}

.brand__name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.header-panel {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  color: var(--muted);
  font-size: var(--fs-small);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--ink);
}

/* The current section is in ink; the accent stays for the active tab inside the page. */
.nav-link[aria-current="page"] {
  text-decoration: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color var(--ease);
}

.icon-btn:hover {
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.menu-btn {
  display: none;
}

.burger {
  position: relative;
  width: 18px;
  height: 1px;
  background: var(--ink);
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1px;
  background: var(--ink);
  transition: transform var(--ease);
}

.burger::before {
  top: -5px;
}

.burger::after {
  top: 5px;
}

.is-open .burger {
  background: transparent;
}

.is-open .burger::before {
  transform: translateY(5px) rotate(45deg);
}

.is-open .burger::after {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 960px) {
  .menu-btn {
    display: inline-flex;
  }

  .header-row {
    gap: 0.5rem;
  }

  .header-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
  }

  .is-open .header-panel {
    display: flex;
  }

  .header-panel .search {
    order: -1;
    width: 100%;
    margin: 0.5rem 0 0.75rem;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    display: block;
    padding: 0.6rem 0;
    font-size: var(--fs-body);
    color: var(--body);
  }

  .nav-link[aria-current="page"] {
    color: var(--ink);
  }
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.footer-row {
  display: grid;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--body);
}

.footer-brand .brand__mark {
  width: 20px;
  height: 20px;
  color: var(--ink);
}

/* The footer only links what the header does not (Discord); the header is the navigation. */
.footer-brand a {
  color: var(--muted);
}

.footer-brand a:hover {
  color: var(--ink);
}

.nowrap {
  white-space: nowrap;
}

.footer-legal {
  font-size: var(--fs-xs);
}

/* ------------------------------------------------------------------ utilities */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.muted {
  color: var(--muted);
}

.noscript {
  max-width: var(--measure);
  margin: 4rem auto;
  padding: 0 var(--gutter);
  color: var(--muted);
}

.page-enter {
  animation: fade-in 180ms ease-out both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Headings and sections focused by the router (after a navigation, a pager click or an in-page
   link): no ring, the page itself is the context. Controls keep their focus ring. */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
section[tabindex="-1"]:focus,
[data-focus-target]:focus {
  outline: none;
}
