/* ===== Fonts =====
   Self-hosted so that no visitor data reaches a third party. SIL OFL 1.1. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-400-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-400-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Oswald;
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Oswald;
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/fonts/oswald-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== Design tokens ===== */
:root {
  --wall: #F5EFE3;
  --wall-deep: #ECE2CF;
  --paper: #FFFDF8;
  --wood: #8B5A2B;
  --wood-light: #A8733F;
  --wood-top: #B9844E;
  --wood-dark: #5C3A1E;
  --felt: #2F5D46;
  --felt-dark: #234836;
  --accent: #A63D2F;
  --accent-dark: #85301F;
  --text: #2A2A2A;
  --text-muted: #5A5248;
  --text-on-dark: #FBF6EC;
  --line: #D6C7AC;
  --line-strong: #B9A88A;
  --highlight: #F6E3A1;
  --highlight-strong: #F2CD6B;
  --peer: #F1E8D4;
  --error: #B3261E;
  --error-bg: #F9DAD5;
  --focus: #1D4E89;

  --font-body: "Atkinson Hyperlegible", "Segoe UI", Verdana, system-ui, sans-serif;
  --font-display: Oswald, "Arial Narrow", "Roboto Condensed", sans-serif;

  --radius: 10px;
  --gutter: 16px;
  --container: 1120px;
  --shadow-soft: 0 2px 6px rgb(60 40 20 / 0.12);
}

/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wall);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.75rem);
  margin-top: 0.4em;
}

h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
}

h3 {
  font-size: 1.25rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--text);
  border: 2px solid var(--focus);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 8px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 20px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  border-color: var(--wood);
  background: #FFF8EA;
  color: var(--text);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #FFFFFF;
}

.btn--small {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ===== Header ===== */
.site-header {
  background: var(--wall);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}

.site-logo {
  display: block;
  flex: 0 1 auto;
  width: clamp(136px, 38vw, 230px);
  line-height: 0;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--wall-deep);
  color: var(--text);
}

.site-nav a[aria-current] {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.35em;
}

@media (max-width: 359px) {
  .site-nav a {
    padding: 0 8px;
  }
}

/* ===== Breadcrumbs ===== */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 14px 0 0;
  list-style: none;
  font-size: 1rem;
  color: var(--text-muted);
}

.breadcrumbs li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent-dark);
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 48px;
  background: var(--wall-deep);
  border-top: 10px solid var(--wood);
  box-shadow: inset 0 3px 0 var(--wood-top);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px;
  font-size: 1rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--text);
}

.site-footer__copy {
  margin: 0;
  color: var(--text-muted);
}

/* ===== Page intro and text content ===== */
.page-intro {
  padding-top: 8px;
}

.page-intro h1 {
  margin-bottom: 0.3em;
}

.lead {
  max-width: 46em;
  font-size: 1.2rem;
}

.content-area {
  padding-top: 16px;
}

.prose {
  max-width: 46em;
}

.prose h2 {
  padding-top: 0.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-scroll {
  overflow-x: auto;
}

.callout {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--paper);
  border-left: 6px solid var(--felt);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-soft);
}

.callout > :last-child {
  margin-bottom: 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1em 0 1.5em;
}

.play-now {
  margin: 2em 0;
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
}

.play-now h2 {
  margin-top: 0;
}

/* ===== FAQ ===== */
.faq {
  max-width: 46em;
  margin-top: 40px;
}

.faq__item {
  padding: 4px 0 8px;
  border-top: 1px solid var(--line);
}

.faq__item h3 {
  margin-top: 0.9em;
}

/* ===== Home hero on green felt ===== */
.hero {
  position: relative;
  color: var(--text-on-dark);
  background-color: var(--felt);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 40%, rgb(255 255 255 / 0.07), rgb(0 0 0 / 0.16) 75%);
  border-bottom: 12px solid var(--wood);
  box-shadow: inset 0 -3px 0 var(--wood-top), 0 6px 10px -6px rgb(60 40 20 / 0.5);
}

.hero__inner {
  padding-block: 40px 44px;
}

.hero h1 {
  margin: 0 0 12px;
  color: var(--text-on-dark);
}

.hero p {
  max-width: 38em;
  margin: 0;
  font-size: 1.2rem;
}

@media (min-width: 900px) {
  .hero__inner {
    padding-block: 56px 60px;
  }
}

/* ===== Shelf with game boxes =====
   Every row of boxes stands on its own plank: the plank, its shadow and the
   brackets are background tiles repeated once per row height. */
.shelf {
  --box-width: 220px;
  --box-height: 292px;
  --slot-top: 28px;
  --plank: 22px;
  --plank-shadow: 14px;
  --row: calc(var(--slot-top) + var(--box-height) + var(--plank) + var(--plank-shadow));
  margin-top: 36px;
}

.shelf__title {
  display: inline-block;
  margin: 0;
  padding: 4px 16px;
  background: var(--paper);
  border: 2px solid var(--wood);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shelf__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
  margin: 0;
  padding: 0 clamp(16px, 5vw, 48px);
  list-style: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='356'%3E%3Cpath d='M0 342h20v4L4 356H0z' fill='%235C3A1E'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='356'%3E%3Cpath d='M0 342h20v14h-4L0 346z' fill='%235C3A1E'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='356'%3E%3Cdefs%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%235C3A1E' stop-opacity='.35'/%3E%3Cstop offset='1' stop-color='%235C3A1E' stop-opacity='0'/%3E%3C/linearGradient%3E%3ClinearGradient id='w' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23A8733F'/%3E%3Cstop offset='.4' stop-color='%238B5A2B'/%3E%3Cstop offset='1' stop-color='%23744822'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect y='320' width='400' height='22' fill='url(%23w)'/%3E%3Crect y='320' width='400' height='4' fill='%23B9844E'/%3E%3Cpath d='M0 329c60-2 120 2 200 0s140-2 200 0M0 335c80 1 140-2 200-1s120 2 200 1' fill='none' stroke='%236E431F' stroke-opacity='.5'/%3E%3Crect y='340' width='400' height='2' fill='%235C3A1E' opacity='.6'/%3E%3Crect y='342' width='400' height='14' fill='url(%23s)'/%3E%3C/svg%3E");
  background-size: 20px var(--row), 20px var(--row), 400px var(--row);
  background-position: 18px 0, calc(100% - 18px) 0, 0 0;
  background-repeat: repeat-y, repeat-y, repeat;
}

.shelf__slot {
  display: flex;
  align-items: flex-end;
  height: var(--row);
  padding: var(--slot-top) 0 calc(var(--plank) + var(--plank-shadow));
}

/* ===== Game box (a board game lid standing on the shelf) ===== */
.game-box {
  --box-color: var(--accent);
  --box-edge: #7D2C20;
  position: relative;
  width: var(--box-width);
  height: var(--box-height);
  border-radius: 6px 6px 3px 3px;
  background: var(--box-color);
  box-shadow:
    inset 0 -10px 0 var(--box-edge),
    inset 0 0 0 3px rgb(0 0 0 / 0.08),
    0 4px 8px rgb(60 30 10 / 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-box--felt {
  --box-color: var(--felt);
  --box-edge: var(--felt-dark);
}

.game-box:hover,
.game-box:focus-within {
  transform: translateY(-8px);
  box-shadow:
    inset 0 -10px 0 var(--box-edge),
    inset 0 0 0 3px rgb(0 0 0 / 0.08),
    0 16px 22px rgb(60 30 10 / 0.3);
}

.game-box__lid {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 14px 14px 22px;
  text-align: center;
  color: var(--text-on-dark);
}

.game-box__art {
  width: 120px;
  height: 120px;
  padding: 6px;
  background: var(--wall);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.2);
  transform: rotate(-3deg);
}

.game-box__art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.game-box__title {
  margin: 12px 0 2px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.game-box__link {
  color: var(--text-on-dark);
  text-decoration: none;
}

.game-box__link:hover {
  color: var(--text-on-dark);
}

.game-box__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.game-box__link:focus-visible {
  outline: none;
}

.game-box:has(.game-box__link:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.game-box__tagline {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.game-box__extra {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.game-box__extra:hover {
  background: var(--highlight);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .game-box,
  .btn {
    transition: none;
  }
}

/* ===== Sudoku illustrations in articles ===== */
.sgrid-figure {
  margin: 1.4em 0 1.8em;
}

.sgrid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  border: 3px solid var(--wood-dark);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  container-type: inline-size;
}

.sgrid--wide {
  width: min(100%, 432px);
}

.sgrid--narrow {
  width: min(100%, 216px);
}

.sgrid__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem;
  font-size: calc(100cqi / var(--cols) * 0.55);
  font-weight: 700;
  line-height: 1;
}

.sgrid__cell.b-r {
  border-right: 3px solid var(--wood-dark);
}

.sgrid__cell.b-b {
  border-bottom: 3px solid var(--wood-dark);
}

.sgrid__cell.e-r {
  border-right: 0;
}

.sgrid__cell.e-b {
  border-bottom: 0;
}

.sgrid__cell.is-shaded {
  background: var(--peer);
}

.sgrid__cell.is-key {
  background: var(--highlight);
}

.sgrid__cell.is-answer {
  background: #DCEBDF;
  color: var(--felt);
}

.sgrid__cell.is-out {
  background: var(--error-bg);
}

.sgrid__cands {
  position: absolute;
  inset: 1px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  font-size: calc(100cqi / var(--cols) * 0.3);
  font-weight: 400;
  color: var(--text-muted);
}

.sgrid__cands .is-key {
  font-weight: 700;
  color: var(--felt);
  background: #C9E2CF;
  border-radius: 3px;
}

.sgrid__cands .is-x {
  color: var(--error);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.sgrid-figure figcaption {
  margin-top: 8px;
  max-width: 34em;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ===== 404 ===== */
.not-found {
  padding-block: 32px 16px;
  text-align: center;
}

.not-found .lead {
  margin-inline: auto;
}

.not-found .cta-row {
  justify-content: center;
}

.not-found__art {
  width: min(100%, 360px);
  margin: 0 auto 8px;
}
