@font-face {
  font-family: Kalaha;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/optimized/roboto-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: Kalaha;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/optimized/roboto-latin-700.woff2) format("woff2");
}
@font-face {
  font-family: Kalaha;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/optimized/roboto-latin-800.woff2) format("woff2");
}

:root {
  --paper: #faf7ef;
  --ink: #203b32;
  --text: #36483f;
  --muted: #55665e;
  --primary: #2e5b46;
  --primary-dark: #234a38;
  --terra: #b76944;
  --terra-text: #965130;
  --sage: #e8ede1;
  --sage-deep: #dbe4d3;
  --line: #e2dbca;
  --card: #fffdf8;
  --radius: 14px;
  --shadow: 0 1px 2px #20302810, 0 10px 26px #2030280d;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Kalaha, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3 {
  margin: 0 0 0.45em;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(31px, 4.4vw, 54px);
}
h2 {
  font-size: clamp(24px, 2.7vw, 34px);
}
h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.012em;
}
p {
  margin: 0 0 1em;
}
ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}
li {
  margin-bottom: 0.4em;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--primary-dark);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.4em;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
thead th {
  color: var(--ink);
  font-size: 15px;
}
:focus-visible {
  outline: 3px solid #c08a2c;
  outline-offset: 3px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
  color: #fff;
}
.container {
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.nowrap {
  white-space: nowrap;
}
.center {
  text-align: center;
}
.lead {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--muted);
}
.eyebrow {
  margin-bottom: 8px;
  color: var(--terra-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.handnote {
  margin: 0;
  color: var(--muted);
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 15px;
  line-height: 1.3;
}
.leaf {
  position: absolute;
  width: 120px;
  opacity: 0.55;
  pointer-events: none;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
}
.button:hover {
  background: var(--primary-dark);
  color: #fff;
}
.button:active {
  transform: scale(0.99);
}
.button.secondary {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
.button.secondary:hover {
  background: var(--sage);
  color: var(--ink);
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.button.wide {
  width: 100%;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Header and footer */
.site-header {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 74px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand .logo {
  width: 56px;
  height: 35px;
}
.site-nav {
  margin-inline: auto;
}
.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav li {
  margin: 0;
}
.site-nav a {
  display: block;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--primary);
}
.site-nav a[aria-current] {
  border-bottom-color: var(--terra);
  color: var(--primary);
}
.header-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.site-footer {
  margin-top: 60px;
  padding: 28px 0;
  background: var(--primary);
  color: #eef3ea;
}
.site-footer a {
  color: #eef3ea;
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand .brand {
  color: #fff;
  font-size: 25px;
}
.footer-brand p {
  margin: 2px 0 0;
  font-size: 14px;
  opacity: 0.85;
}
.site-footer nav ul {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.site-footer nav li {
  margin: 0;
}
.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  font-size: 14px;
  opacity: 0.9;
}

/* Sections and cards */
.section {
  margin: 56px 0;
}
.section-head {
  margin-bottom: 22px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
}
.head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.head-row h2 {
  margin: 0;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}
.home-intro {
  position: relative;
  padding: 34px 0 10px;
  text-align: center;
}
.home-intro h1 {
  margin-bottom: 6px;
}
.home-intro .lead {
  margin: 0;
}
.note-left,
.note-right {
  position: absolute;
  top: 46px;
  max-width: 190px;
}
.note-left {
  left: 6%;
  transform: rotate(-6deg);
}
.note-right {
  right: 6%;
  transform: rotate(5deg);
  text-align: right;
}
.leaf-left {
  top: -10px;
  left: -40px;
  transform: scaleX(-1);
}
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px 26px;
  margin: 22px 0 10px;
  padding: 16px 22px;
  border-radius: var(--radius);
  background: var(--sage);
}
.trust-strip > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.trust-strip .icon {
  width: 24px;
  height: 24px;
  margin-top: 3px;
  color: var(--primary);
}
.trust-strip b {
  display: block;
  color: var(--ink);
}
.trust-strip span {
  font-size: 15px;
  color: var(--muted);
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-card {
  padding: 18px;
}
.step-card .num,
.tip-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}
.step-card img,
.tip-card img {
  margin-top: 14px;
  border-radius: 10px;
  height: 150px;
  object-fit: cover;
  width: 100%;
}
.mode-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--sage);
  border: 1px solid var(--sage-deep);
}
.mode-card .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: var(--card);
  color: var(--primary);
}
.mode-card p {
  color: var(--muted);
}
.feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sage);
  overflow: hidden;
}
.feature img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}
.feature-body {
  padding: 28px;
  align-self: center;
}
.guide-card {
  display: flex;
  flex-direction: column;
}
.guide-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}
.guide-body {
  padding: 16px 18px 20px;
}
.guide-body h3 {
  margin-bottom: 6px;
}
.guide-body h3 a {
  color: var(--ink);
  text-decoration: none;
}
.guide-body h3 a:hover {
  color: var(--primary);
}
.guide-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.faq {
  display: grid;
  gap: 10px;
}
.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 12px 18px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
}
.faq details[open] summary::after {
  content: "−";
}
.faq .answer {
  padding: 0 18px 16px;
  margin: 0;
  color: var(--muted);
}
.cta-band {
  margin: 48px 0 0;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--sage);
  text-align: center;
}
.cta-band p {
  color: var(--muted);
  max-width: 60ch;
  margin-inline: auto;
}

/* Editorial pages */
.crumbs {
  padding: 16px 0 6px;
  font-size: 14px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}
.page-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  align-items: center;
  margin: 10px 0 30px;
}
.page-hero img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  min-height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
}
.facts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.facts .icon {
  color: var(--terra);
}
.with-sidebar {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--sage);
}
.toc p {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc a {
  display: block;
  padding: 7px 0;
  font-size: 15px;
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}
.callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 26px 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--sage);
}
.callout .icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
  flex: none;
}
.callout h3 {
  margin-bottom: 4px;
}
.callout p:last-child {
  margin-bottom: 0;
}
.mini-board {
  width: 260px;
  max-width: 100%;
  margin-top: 10px;
}
.resource-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 26px 0;
}
.resource-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
}
.resource-card img {
  width: 120px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}
.resource-card h3 {
  margin-bottom: 4px;
}
.resource-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
}
.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.checklist .icon {
  color: var(--primary);
  margin-top: 3px;
}
.note-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 15px;
}
.note-box .icon {
  color: var(--terra);
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}
.tip-card {
  padding: 18px;
}
.tip-card p {
  margin: 0;
  color: var(--muted);
}
.related-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.related-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}
.related-card .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 10px;
  background: var(--sage);
  color: var(--primary);
}
.related-card h3 {
  margin-bottom: 2px;
}
.related-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
}

/* Guides index */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 22px 0 26px;
}
.filters button {
  min-height: 46px;
  padding: 8px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}
.filters button[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sage);
  margin-bottom: 26px;
}
.featured img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}
.featured-body {
  padding: 30px;
  align-self: center;
}
.filter-empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

/* Game modes */
.mode-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}
.mode-panel {
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.mode-panel.is-primary {
  background: var(--sage);
  border-color: var(--primary);
}
.mode-panel img {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 14px;
}
.mode-panel .mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mode-panel .icon {
  color: var(--primary);
  width: 24px;
  height: 24px;
}
.mode-panel p {
  color: var(--muted);
}
.mode-panel form {
  margin-top: auto;
}
.segmented {
  display: flex;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}
.segmented label {
  flex: 1;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 6px 10px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--line);
}
.segmented label:last-child span {
  border-right: 0;
}
.segmented input:checked + span {
  background: var(--primary);
  color: #fff;
}
.segmented input:focus-visible + span {
  outline: 3px solid #c08a2c;
  outline-offset: -3px;
}
.name-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.name-fields label {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.name-fields input {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.customize {
  padding: 22px;
  margin-bottom: 26px;
}
.customize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.customize h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.customize fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.customize legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.customize .hint {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  font-weight: 600;
  color: var(--ink);
}
.switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

/* Article pages */
.article-page {
  max-width: 820px;
}
.article-hero {
  width: 100%;
  height: clamp(200px, 34vw, 340px);
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 26px;
}
.prose h2 {
  margin-top: 1.6em;
}
.prose h3 {
  margin-top: 1.4em;
}
.prose li strong {
  color: var(--ink);
}
.diagram {
  margin: 26px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.diagram img {
  width: 100%;
  border-radius: 10px;
}
.diagram figcaption {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}
.diagram figcaption strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}
.diagram ol {
  margin-bottom: 0;
}

/* Game */
.game {
  margin: 18px 0 8px;
  min-height: 430px;
}
.game-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "settings actions"
    "board board"
    "status status"
    "strip strip"
    "controls controls"
    "note note";
  gap: 12px 18px;
  align-items: center;
  padding: 16px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.game-settings {
  grid-area: settings;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-title {
  margin: 0 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.game-settings .field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.select-field .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.field-label {
  font-size: 13px;
  color: var(--muted);
}
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.select-wrap .icon {
  position: absolute;
  left: 11px;
  color: var(--ink);
  pointer-events: none;
}
.select-wrap .icon + select + .icon {
  left: auto;
  right: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.select-wrap select {
  appearance: none;
  min-height: 46px;
  padding: 8px 34px 8px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
}
.game-settings .names {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.game-settings .names input {
  width: 170px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.toggles {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  color: var(--ink);
  font-size: 15px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.game-actions {
  grid-area: actions;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.tool:hover {
  background: var(--sage);
  color: var(--ink);
}
.settings-toggle,
.back-link {
  display: none;
}
.game-status {
  grid-area: status;
  text-align: center;
}
.status-title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
}
.status-sub {
  margin: 2px 0 0;
  color: var(--muted);
}
.board-wrap {
  grid-area: board;
  container-type: inline-size;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: 1.14fr repeat(6, 1fr) 1.14fr;
  grid-template-rows: auto auto;
  gap: clamp(3px, 1.1cqi, 13px) clamp(4px, 1.3cqi, 16px);
  padding: clamp(20px, 3.4cqi, 38px) clamp(8px, 2cqi, 26px);
  border-radius: clamp(14px, 3cqi, 34px);
  background:
    linear-gradient(180deg, #ffffff18, #0000002e),
    url(/assets/optimized/walnut-board-texture-1916.webp) center / cover,
    #8a5a34;
  box-shadow:
    inset 0 2px 0 #ffffff33,
    inset 0 -3px 0 #00000033,
    0 12px 26px #3a221230;
}
.pit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.6cqi, 7px);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff6e6;
  cursor: default;
}
.pit-top {
  grid-row: 1;
  flex-direction: column-reverse;
}
.pit-bottom {
  grid-row: 2;
}
.pit-hole,
.store-hole {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #2b170b70, #2b170b1f 60%, #ffffff14 100%);
  box-shadow:
    inset 0 clamp(2px, 0.9cqi, 9px) clamp(4px, 1.5cqi, 15px) #2211069e,
    inset 0 -1px 0 #ffffff33,
    0 1px 0 #ffffff26;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.store {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(2px, 0.6cqi, 7px);
  grid-row: 1 / span 2;
  justify-items: center;
  align-self: stretch;
  color: #fff6e6;
}
.store-left {
  grid-column: 1;
}
.store-right {
  grid-column: 8;
}
.store-hole {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 999px;
}
.count {
  min-width: 1.9em;
  padding: 0.2em 0.42em;
  border-radius: 999px;
  background: #fff8ecec;
  color: var(--ink);
  font-size: clamp(11px, 1.9cqi, 19px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px #00000040;
}
.hide-counts .count {
  visibility: hidden;
}
.stones {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stone {
  position: absolute;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 2px 3px #1d0f0577,
    inset 0 -2px 3px #00000030;
}
.store .stone {
  width: 34%;
}
.s0 {
  background:
    radial-gradient(circle at 34% 28%, #ffffffd9 0 9%, #ffffff00 17%),
    radial-gradient(circle at 50% 60%, #74a052, #2f5a2a 72%);
}
.s1 {
  background:
    radial-gradient(circle at 34% 28%, #ffffffd9 0 9%, #ffffff00 17%),
    radial-gradient(circle at 50% 60%, #eba64c, #9a5a17 74%);
}
.s2 {
  background:
    radial-gradient(circle at 34% 28%, #ffffffe6 0 10%, #ffffff00 18%),
    radial-gradient(circle at 50% 55%, #fcf6e6, #d5c7a4 76%);
}
.pit.is-legal {
  cursor: pointer;
}
.pit.is-legal .pit-hole {
  box-shadow:
    inset 0 clamp(2px, 0.9cqi, 9px) clamp(4px, 1.5cqi, 15px) #2211069e,
    0 0 0 clamp(2px, 0.34cqi, 3px) #cfe6c2;
}
@media (hover: hover) {
  .pit.is-legal:hover .pit-hole {
    transform: translateY(-2px);
    box-shadow:
      inset 0 6px 12px #2211069e,
      0 0 0 3px #eef7e6;
  }
}
.pit.is-hint .pit-hole {
  box-shadow:
    inset 0 6px 12px #2211069e,
    0 0 0 4px #f0a878;
}
.pit.is-active .pit-hole,
.store.is-active .store-hole {
  box-shadow:
    inset 0 6px 12px #2211069e,
    0 0 0 3px #fff0cc;
}
.pit.is-last .count {
  background: #fff;
  box-shadow: 0 0 0 2px var(--terra);
}
.row-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #fff4df;
  font-size: clamp(11px, 1.7cqi, 17px);
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 2px #00000099;
}
.row-name-top {
  top: clamp(3px, 0.7cqi, 9px);
}
.row-name-bottom {
  bottom: clamp(3px, 0.7cqi, 9px);
}
.board[data-turn="top"] .row-name-top,
.board[data-turn="bottom"] .row-name-bottom {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.move-strip {
  grid-area: strip;
  display: none;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.strip-move {
  min-height: 48px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.strip-move:disabled {
  opacity: 0.42;
}
.game-controls {
  grid-area: controls;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.icon-button {
  padding-inline: 14px;
}
.game-note {
  grid-area: note;
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}
.game.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
  overflow: auto;
  background: var(--paper);
}
.game.is-fullscreen {
  background: var(--paper);
}
.game.is-fullscreen .game-panel {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  align-content: center;
}
.game.is-fullscreen .board-wrap {
  width: min(100%, calc((100dvh - 250px) * 3));
  justify-self: center;
}
html.game-expanded {
  overflow: hidden;
}
.noscript {
  padding: 20px;
  text-align: center;
  color: var(--muted);
}
dialog {
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  max-width: min(520px, calc(100vw - 32px));
  box-shadow: 0 24px 60px #00000040;
}
dialog::backdrop {
  background: #1b2a2470;
}
.dialog-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.diagram-dialog {
  max-width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 30px);
  overflow: auto;
}
.dialog-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  float: right;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.mobile-only {
  display: none;
}

@media (min-width: 701px) {
  /* Sekundära inställningar ligger i menyn, som i skisserna. */
  .game-settings .toggles,
  .game-settings .names,
  .game-settings [data-field="first"] {
    display: none;
  }
  .settings-open .game-settings .toggles,
  .settings-open .game-settings .names,
  .settings-open .game-settings [data-field="first"] {
    display: flex;
  }
  .settings-toggle {
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  .header-note {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    margin: 0;
    padding: 4px 16px 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px #2030281a;
  }
  .site-nav.is-open {
    display: block;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .site-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
  }
  .with-sidebar {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .toc {
    position: static;
  }
}

@media (max-width: 700px) {
  .note-left,
  .note-right,
  .leaf {
    display: none;
  }
  .home-intro {
    padding-top: 22px;
    text-align: left;
  }
  .mobile-only {
    display: inline-flex;
  }
  .section {
    margin: 42px 0;
  }
  .feature img,
  .featured img {
    min-height: 200px;
  }
  .feature-body,
  .featured-body {
    padding: 22px;
  }
  .resource-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .resource-card img {
    width: 100%;
    height: 150px;
  }
  .site-footer .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .footer-note {
    margin: 0;
  }
  .game {
    margin-inline: -8px;
    min-height: 520px;
  }
  .game-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "status"
      "board"
      "strip"
      "controls"
      "actions"
      "settings"
      "note";
    padding: 12px;
    border-radius: 14px;
  }
  .game-settings {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: 12px;
    background: var(--sage);
  }
  .settings-open .game-settings {
    display: flex;
  }
  .settings-title {
    display: none;
  }
  .select-field .field-label {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }
  .select-wrap select,
  .game-settings .names input {
    width: 100%;
  }
  .settings-toggle {
    display: inline-flex;
  }
  .game-actions {
    justify-content: center;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }
  .tool {
    font-size: 14px;
    padding-inline: 8px;
  }
  .move-strip {
    display: grid;
  }
  .game-controls .button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 8px;
    gap: 6px;
  }
  .game-controls .icon-button {
    flex: 0 0 54px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .play-page .site-header,
  .play-page .play-intro,
  .play-page .trust-strip,
  .play-page .site-footer,
  .play-page .game-note {
    display: none;
  }
  .play-page .container {
    width: 100%;
  }
  .play-page .game {
    margin: 0;
    min-height: 0;
  }
  .play-page .game-panel {
    min-height: 100dvh;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back status actions"
      "board board board"
      "controls controls controls"
      "settings settings settings";
    gap: 4px 10px;
    padding: 6px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .play-page .back-link {
    display: inline-flex;
    grid-area: back;
  }
  .play-page .game-settings {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 10px;
    background: var(--sage);
  }
  .play-page .settings-open .game-settings {
    display: flex;
  }
  .play-page .settings-title {
    display: none;
  }
  .play-page .settings-toggle {
    display: inline-flex;
  }
  .play-page .move-strip {
    display: none;
  }
  .play-page .game-actions {
    border: 0;
    padding: 0;
  }
  .play-page .board-wrap {
    width: min(100%, calc((100dvh - 150px) * 3.2));
    justify-self: center;
  }
  .play-page .status-title {
    font-size: 20px;
  }
  .play-page .status-sub {
    font-size: 14px;
  }
  .play-page .game-controls .button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
