h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

.eyebrow {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--berry);
}

.masthead {
  display: grid;
  gap: 8px;
  max-width: 46em;
  padding-bottom: 28px;
  border-bottom: 3px solid var(--ink);
}

.masthead h1 {
  font-family: var(--pixel);
  font-size: clamp(38px, 6vw, 58px);
}

.lede {
  margin: 0;
  font-size: 19px;
  color: var(--ink-soft);
}

.lede strong { color: var(--ink); }

.hint {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.rulebook {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 0 16px;
  scrollbar-width: thin;
}

.toc h2 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc ol ol {
  margin: 2px 0 6px 12px;
  padding-left: 10px;
  border-left: 2px solid var(--rule);
}

.toc a {
  display: block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}

.toc ol ol a {
  font-size: 14px;
  color: var(--ink-soft);
}

.toc a:hover,
.toc a:focus-visible {
  background: var(--ink);
  color: var(--panel);
  outline: none;
}

.sections { min-width: 0; }

.rules-section {
  display: grid;
  gap: 12px;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 8px;
}

.rules-section > * { margin: 0; }

.rules-section h2 { font-size: clamp(26px, 4vw, 34px); }

.rules-section h3 {
  font-size: 20px;
  margin-top: 10px;
  scroll-margin-top: 16px;
}

.rules-section ul,
.rules-section ol { padding-left: 22px; }

.rules-section li { margin-bottom: 6px; }

.rules-section ol.steps { padding-left: 0; }

.alias {
  display: block;
  height: 0;
}

.tell {
  justify-self: start;
  margin-top: 6px;
  font: 700 15px var(--body);
  color: var(--panel);
  background: var(--berry);
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
}

.tell::before { content: "💬 "; }

.tell:hover { filter: brightness(1.08); }

.tell:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}

.table-wrap.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--panel);
  font-size: 16px;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  background: var(--ink);
  color: var(--panel);
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td code { white-space: nowrap; }

table.types td:first-child,
table.stages td:first-child { font-weight: 700; }

table.types td:nth-child(2) { color: var(--grass); }

table.types { min-width: 560px; }

table.stages { min-width: 620px; }

.rules-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 3px solid var(--ink);
  color: var(--ink-soft);
  font-size: 15px;
  display: grid;
  gap: 8px;
}

.rules-foot p { margin: 0; }

@media (max-width: 900px) {
  .rulebook {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 20px 0 8px;
  }

  .toc > ol {
    display: block;
    columns: 2;
    column-gap: 20px;
  }

  .toc > ol > li { break-inside: avoid; }
}

@media (max-width: 560px) {
  .toc > ol { columns: 1; }

  .table-wrap.two { grid-template-columns: minmax(0, 1fr); }

  th, td { padding: 6px 8px; }

  table { font-size: 15px; }
}
