:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --page: #ede9df;
  --surface: #fffcf6;
  --surface-raised: #f0eadf;
  --ink: #342c23;
  --muted: #6a6154;
  --line: #d9d0c0;
  --accent: #30594b;
  --accent-strong: #30594b;
  --focus: #30594b;
  --max: 76rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 18rem;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible {
  border-radius: 0.2rem;
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.4rem;
  background: var(--ink);
  color: var(--page);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand-logo { display: block; width: 7rem; height: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.2rem;
  aspect-ratio: 1;
  place-items: center;
  border: 0.16rem solid currentColor;
  border-radius: 50%;
}

.brand-mark span {
  width: 0.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: -0.72rem 0 var(--accent), 0.72rem 0 var(--accent);
}

.prototype-label {
  padding: 0.16rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-link {
  margin-inline-start: auto;
  font-weight: 700;
}

.learning-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-inline-start: auto;
}

.learning-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.38fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 7rem) clamp(2.5rem, 6vw, 5rem);
}

.eyebrow,
.step-label,
.callout-label,
.profile-status {
  margin: 0 0 0.55rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 0.65rem;
  font-size: 1.18rem;
}

.lede {
  max-width: 42rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.scope-note,
.profile-warning,
.nonclaim {
  max-width: 52rem;
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border-inline-start: 0.28rem solid var(--accent);
  background: rgba(224, 165, 91, 0.08);
}

.rules-identity {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.rules-identity dl {
  margin: 0;
}

.rules-identity div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.rules-identity div:last-child {
  border-bottom: 0;
}

.rules-identity dt {
  flex: 1 1 9rem;
  min-width: 0;
  color: var(--muted);
}

.rules-identity dd {
  flex-shrink: 0;
  max-width: 100%;
  margin: 0;
  font-weight: 750;
  text-align: end;
}

.section-nav {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  gap: 0.45rem;
  padding: 0.8rem 0;
  overflow-x: auto;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  scrollbar-width: thin;
}

.section-nav a {
  flex: 0 0 auto;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.term-link {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-style: dotted;
  text-decoration-thickness: 0.1em;
}

.rules-article > section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 5rem;
}

.section-heading {
  max-width: 56rem;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
}

.copy-grid,
.rule-callout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 1.2fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.copy-grid.reverse > :first-child {
  order: 2;
}

figure {
  min-width: 0;
  margin: 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #f5ecdf;
}

figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.track {
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  line-height: 1.9;
}

.turn-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0;
  counter-reset: turn;
  list-style: none;
}

.turn-steps li {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.turn-steps li::before {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent-strong);
  content: counter(list-item, decimal-leading-zero);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.wide-figure {
  max-width: 64rem;
  margin: 2rem auto 0;
}

.rule-callout,
.convention-note {
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-raised);
}

.check-list {
  padding-inline-start: 1.2rem;
}

.check-list li + li {
  margin-top: 0.5rem;
}

.ending-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.ending-grid article,
.profile-grid article {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.ending-grid p,
.profile-grid p {
  margin-bottom: 0;
}

.profile-grid {
  margin-top: 2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-status {
  font-size: 0.7rem;
}

.profile-baseline {
  margin-top: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--accent);
  border-radius: 1rem;
  background: rgba(224, 165, 91, 0.08);
}

.profile-baseline dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 0;
}

.profile-baseline dl div,
.profile-facts div {
  min-width: 0;
}

.profile-baseline dt,
.profile-facts dt {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-baseline dd,
.profile-facts dd {
  margin: 0.3rem 0 0;
}

.profile-facts {
  margin: 1rem 0 0;
}

.profile-facts div + div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 2rem;
  padding-inline-start: 1.25rem;
}

.source-list li::marker {
  color: var(--accent);
}

.glossary-intro {
  max-width: 54rem;
  color: var(--muted);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 2rem 0 0;
}

.glossary-grid div {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.glossary-grid dt {
  color: var(--accent-strong);
  font-weight: 800;
}

.glossary-grid dd {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

[id^="term-"] {
  scroll-margin-top: 5rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 58rem) {
  .hero,
  .copy-grid,
  .rule-callout {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
  }

  .rules-identity {
    max-width: 32rem;
  }

  .copy-grid.reverse > :first-child {
    order: initial;
  }

  .turn-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-baseline dl {
    grid-template-columns: 1fr;
  }

  .glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 38rem) {
  .site-header,
  main,
  footer {
    width: min(100% - 1.25rem, var(--max));
  }

  .site-header {
    flex-wrap: wrap;
    padding-block: 0.7rem;
  }

  .prototype-label {
    order: 3;
    width: max-content;
  }

  .turn-steps,
  .ending-grid,
  .glossary-grid,
  .profile-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .rules-identity,
  .section-nav a,
  .turn-steps li,
  .ending-grid article,
  .profile-grid article,
  .glossary-grid div,
  .profile-baseline,
  .rule-callout,
  .convention-note,
  figure img {
    border-color: CanvasText;
  }

  .brand-mark span {
    background: CanvasText;
    box-shadow: -0.72rem 0 CanvasText, 0.72rem 0 CanvasText;
  }
}

@media print {
  :root {
    --page: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --ink: #111;
    --muted: #333;
    --line: #777;
    --accent: #542d0d;
    --accent-strong: #542d0d;
  }

  body {
    background: #fff;
  }

  .site-header,
  .section-nav,
  footer,
  .skip-link {
    display: none;
  }

  .rules-article > section {
    break-inside: avoid;
  }
}

/* The version and fixed house route are notation, not translated prose. */
code { direction: ltr; unicode-bidi: isolate; display: inline-block; }
