:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --tray: #e2eae2;
  --ink: #16241d;
  --ink-soft: #4a5d52;
  --line: #d5dfd6;
  --line-strong: #bac9bc;
  --accent: #245e47;
  --accent-strong: #184433;
  --accent-wash: #e6f0e8;
  --gold: #9a5b0c;
  --gold-wash: #fbf2e3;
  --bad: #9f2d24;
  --bad-wash: #fbeceb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(22, 36, 29, 0.06);
  --shadow-md: 0 12px 32px rgba(22, 36, 29, 0.08);
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-wash); color: var(--ink); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.container { padding-top: 8px; padding-bottom: 64px; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}
a:hover { color: var(--accent-strong); text-decoration-color: var(--accent); }

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 2.5vw, 1.95rem); }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.015em; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--accent-wash);
  color: var(--accent-strong);
  padding: 2px 6px;
  border-radius: 6px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 246, 242, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.brand:hover { color: var(--accent-strong); }
.brand-mark { display: block; border-radius: 7px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 140ms ease, color 140ms ease;
}
.site-nav a:hover { background: var(--accent-wash); color: var(--ink); }
.site-nav a[aria-current="page"] {
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-weight: 700;
}

/* Buttons */
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 90ms ease, box-shadow 140ms ease;
}
.button:hover:not(:disabled), .btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-strong);
}
.button:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.98); }
.button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.button--primary, .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.button--primary:hover:not(:disabled), .btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.button--secondary, .btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.button--invert {
  background: #fff;
  border-color: #fff;
  color: var(--accent-strong);
}
.button--invert:hover { background: var(--accent-wash); border-color: var(--accent-wash); color: var(--accent-strong); }
.button--invert-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: #fff;
}
.button--invert-ghost:hover { background: var(--accent); border-color: #fff; color: #fff; }

/* Footer */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 36px;
}
.footer-brand p { margin: 12px 0 0; max-width: 34ch; line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 4px;
}
.footer-col a { color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  padding-bottom: 24px;
  font-size: 0.82rem;
}
.footer-bottom p { margin: 0; }


/* Homepage Hero & Tactile Game Board */
.home-hero {
  display: grid;
  max-width: 980px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 390px);
  align-items: center;
  gap: 48px;
  padding: 40px 0 56px;
}
.hero-copy h1 {
  font-size: clamp(2.5rem, 5vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 14px 0 20px;
  max-width: 11ch;
}
.hero-lede {
  margin: 0 0 28px;
  max-width: 44ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}
.hero-rule {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.rule-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.hero-actions { margin-top: 28px; }
.hero-link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.hero-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.hero-link-label { font-size: 0.82rem; color: var(--ink-soft); }
.hero-link-cta { font-size: 0.95rem; font-weight: 700; color: var(--accent-strong); }

.hero-game { min-width: 0; }
.game-wrap { max-width: 390px; margin: 0 auto; }
.game-board-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.game-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker-badge {
  color: var(--accent-strong);
  background: var(--accent-wash);
  padding: 4px 10px;
  border-radius: 999px;
}
.kicker-finishes { color: var(--ink-soft); }

.game-board-area, .board-frame { position: relative; width: 100%; }
.board {
  --size: 3;
  --gap: 8px;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--tray);
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 2px 6px rgba(22, 36, 29, 0.1), inset 0 0 0 1px var(--line-strong);
  touch-action: manipulation;
  outline: none;
}
.board:focus-visible { box-shadow: inset 0 2px 6px rgba(22, 36, 29, 0.1), 0 0 0 2px var(--accent); }
.board-grid {
  position: relative;
  width: 100%;
  height: 100%;
  --tile-w: calc((100% - (var(--size) - 1) * var(--gap)) / var(--size));
}
.tile {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tile-w);
  height: var(--tile-w);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  transform: translate(
    calc(var(--col) * (100% + var(--gap))),
    calc(var(--row) * (100% + var(--gap)))
  );
  transition: transform 165ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.tile--movable { cursor: pointer; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 2; }

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line-strong), 0 4px 10px rgba(22, 36, 29, 0.08);
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.tile--movable:hover .tile-inner {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-strong);
  box-shadow: 0 5px 0 var(--line-strong), 0 8px 16px rgba(22, 36, 29, 0.12);
}
.tile--movable:active .tile-inner { transform: translateY(1px); box-shadow: 0 1px 0 var(--line-strong); }
.tile--correct .tile-inner::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
.tile-inner--pic {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.6);
}
.tile-pic-num {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(22, 36, 29, 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Victory Overlay */
.board-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 14px;
  background: rgba(244, 246, 242, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.board-overlay-card {
  width: 100%;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.overlay-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-strong);
}
.overlay-badge--gold { background: var(--gold-wash); color: var(--gold); }
.board-overlay-card strong { font-size: 1.7rem; letter-spacing: -0.03em; color: var(--ink); }
.overlay-meta {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Stats & Controls */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 12px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}
.board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.mode-thumbs { display: flex; gap: 4px; flex: 1; min-width: 0; }
.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.mode-option:hover { background: var(--accent-wash); color: var(--ink); }
.mode-option[aria-pressed="true"] {
  background: var(--bg);
  border-color: var(--line-strong);
  color: var(--ink);
}
.mode-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
  background-size: cover;
  background-position: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.mode-swatch--numbers { background: var(--accent-wash); }
.shuffle-btn { min-height: 40px; padding: 0 14px; font-size: 0.84rem; }
.hint-line {
  margin: 12px 4px 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
}


/* Homepage Editorial Sections */
.home-info {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: start;
}
.info-heading h2 { margin-top: 12px; font-size: clamp(1.85rem, 3.2vw, 2.55rem); max-width: 14ch; }
.info-copy p { margin: 0 0 14px; color: var(--ink-soft); }
.info-copy p:last-child { margin-bottom: 0; }

.home-article { max-width: 980px; margin: 0 auto; }
.home-section {
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}
.home-section h2 { margin: 10px 0 16px; }
.home-section > p { max-width: 68ch; margin: 0 0 14px; color: var(--ink-soft); }
.home-section > p:last-child { margin-bottom: 0; }
.home-section strong { color: var(--ink); }

.step-list {
  max-width: 68ch;
  margin: 16px 0 24px;
  padding-left: 22px;
  color: var(--ink-soft);
}
.step-list li { margin: 10px 0; padding-left: 4px; }
.step-list li::marker { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }

/* 3-Step Visual Demo */
.home-demo {
  max-width: 780px;
  margin: 28px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.home-demo-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.home-demo-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.home-demo-board {
  width: min(100%, 168px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 6px;
  background: var(--tray);
  border-radius: 10px;
}
.home-demo-tile {
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.home-demo-tile--blank { background: transparent; box-shadow: none; }
.home-demo-tile--next {
  background: var(--accent-wash);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.home-demo figcaption {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

/* Mode Cards */
.home-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.home-mode {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease;
}
.home-mode:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.home-mode-swatch {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 14px;
}
.home-mode-swatch--numbers { background: var(--accent-wash); }
.home-mode h3 { margin: 0 0 6px; }
.home-mode p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; }

/* Dark Forest CTA Card */
.cta-card {
  margin: 48px auto 0;
  padding: 32px 36px;
  border-radius: 20px;
  background: var(--accent-strong);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-md);
}
.cta-card > div:first-child { max-width: 560px; }
.cta-card .eyebrow { color: var(--accent-wash); }
.cta-card h2 { color: #fff; margin: 10px 0 8px; }
.cta-card p { margin: 0; color: var(--accent-wash); line-height: 1.6; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Home FAQ */
.home-faq { border-bottom: 0; padding-bottom: 12px; }
.home-faq-list { margin-top: 20px; }
.home-faq-item {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.home-faq-item h3 { margin: 0; font-size: 1rem; }
.home-faq-item p { margin: 0; font-size: 0.94rem; color: var(--ink-soft); line-height: 1.6; }


/* Inner Pages & Article Typography */
.wrap { max-width: 820px; margin: 0 auto; padding-top: 24px; }
.wrap--wide { max-width: 980px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-strong); text-decoration: underline; }

.page-head { margin-bottom: 32px; }
.page-head h1 { margin: 10px 0 14px; font-size: clamp(2rem, 4.2vw, 3rem); }
.lede {
  margin: 0;
  max-width: 64ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.65;
}
.tool-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.tool-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.tool-facts strong { color: var(--accent-strong); }

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}
.section-gap { margin-top: 48px; }
.section { margin-top: 52px; }
.section-head { margin-bottom: 20px; }
.section-head h2 { margin-top: 8px; }

.prose { max-width: 70ch; color: var(--ink-soft); line-height: 1.75; }
.article-card.prose { max-width: none; }
.article-card.prose > * { max-width: 68ch; }
.prose h2 {
  margin: 36px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: 24px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { margin: 12px 0 20px; padding-left: 22px; }
.prose li { margin: 8px 0; }
.prose pre {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.prose pre code { background: transparent; padding: 0; color: var(--ink); }

/* Accordion FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease;
}
.faq details[open] { border-color: var(--accent); }
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  flex: none;
}
.faq details[open] summary::after { content: "−"; }
.faq-body p { margin: 12px 0 0; color: var(--ink-soft); line-height: 1.65; }

/* Related Guides Grid */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.guide-card h3 { color: var(--ink); margin: 0; }
.guide-card p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; }
.guide-card-arrow {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-strong);
}

/* Solver Workbench */
.solver-ui {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.solver-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}
.segmented button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}

.solver-grid {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.solver-stage { display: flex; flex-direction: column; gap: 14px; }
.solver-board-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.solver-board {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--tray);
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(22, 36, 29, 0.1), inset 0 0 0 1px var(--line-strong);
  aspect-ratio: 1;
}
.solver-board .cell {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3.6vw, 1.85rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--line-strong), var(--shadow-sm);
  transition: transform 110ms ease, border-color 140ms ease, background 140ms ease;
}
.solver-board[data-n="4"] .cell { font-size: clamp(1.05rem, 2.8vw, 1.4rem); border-radius: 8px; }
.solver-board .cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.solver-board .cell--empty {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  box-shadow: none;
  border-style: dashed;
}
.solver-board .cell--blank {
  background: transparent;
  border: 2px dashed var(--line-strong);
  box-shadow: none;
}
.solver-board .cell--sel {
  border: 2px solid var(--accent);
  background: var(--accent-wash);
  color: var(--accent-strong);
}
.solver-board .cell--next {
  background: var(--gold-wash);
  border: 2px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 3px 0 var(--gold);
}

.step-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--gold-wash);
  border: 1px solid var(--gold);
}
.step-banner[hidden] { display: none; }
.step-banner-text { display: flex; flex-direction: column; gap: 2px; }
.step-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.step-banner strong { font-size: 0.98rem; color: var(--ink); }
.step-banner-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.status-bar {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--line);
}
.status-bar--info { background: var(--bg); color: var(--ink-soft); }
.status-bar--ok { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.status-bar--bad { background: var(--bad-wash); border-color: var(--bad); color: var(--bad); font-weight: 600; }

.solver-deck {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.deck-block {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deck-block--last { padding-bottom: 0; border-bottom: 0; }
.deck-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.deck-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.deck-sub { font-size: 0.82rem; color: var(--ink-soft); }

.pad {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 8px;
}
.pad .chip {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 120ms ease, border-color 120ms ease, transform 90ms ease;
}
.pad .chip:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-strong); }
.pad .chip:active { transform: scale(0.96); }
.pad .chip--blank { grid-column: span 2; font-family: var(--font-sans); font-size: 0.82rem; }
.pad .chip--used { opacity: 0.5; background: var(--bg); box-shadow: none; }

.solve-primary-row { display: flex; gap: 8px; }
.solve-btn { flex: 1; }
.playback-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.playback-controls .btn { padding: 0 10px; font-size: 0.84rem; min-height: 40px; }
.speed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.speed-row select {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.path { display: flex; flex-wrap: wrap; gap: 6px; max-height: 124px; overflow-y: auto; }
.step-pill {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.step-pill:hover { border-color: var(--accent); color: var(--accent-strong); }
.step-pill--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.paste-wrap summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.paste-wrap textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  resize: vertical;
}
.paste-wrap textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn[hidden] { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0 44px;
  }
  .hero-game { order: -1; }
  .hero-copy h1 { max-width: 15ch; }
  .home-info { grid-template-columns: 1fr; gap: 20px; }
  .solver-grid { grid-template-columns: 1fr; gap: 24px; }
  .solver-stage { max-width: 420px; width: 100%; margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { height: 58px; }
  .site-nav a { padding: 6px 10px; font-size: 0.84rem; }
  .hero-copy h1 { font-size: 2.15rem; }
  .game-board-card { padding: 14px; border-radius: 18px; }
  .board { --gap: 6px; padding: 8px; }
  .board-tools { flex-direction: column; align-items: stretch; }
  .mode-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .mode-option { justify-content: center; padding: 6px 4px; font-size: 0.76rem; }
  .shuffle-btn { width: 100%; }
  .home-demo { gap: 8px; }
  .home-demo-step { padding: 10px 6px; }
  .home-demo-label { font-size: 0.68rem; }
  .home-demo-tile { font-size: 0.8rem; }
  .home-modes { grid-template-columns: 1fr; }
  .home-faq-item { grid-template-columns: 1fr; gap: 6px; }
  .cta-card { padding: 24px 20px; }
  .cta-actions, .cta-actions .button { width: 100%; }
  .article-card { padding: 24px 18px; border-radius: 16px; }
  .guides-grid { grid-template-columns: 1fr; }
  .solver-ui { padding: 16px; border-radius: 18px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .playback-controls { grid-template-columns: repeat(2, 1fr); }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Live timer dot, best caption, and medal ceremony */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: middle;
  animation: liveBreath 2s ease-in-out infinite;
}
.live-dot[hidden] { display: none; }
@keyframes liveBreath {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
.stat-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.stat-caption[hidden] { display: none; }

.medal-ceremony {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}
.medal-unlock {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.medal-badge--green { color: var(--accent-strong); }
.medal-badge--green .medal-ribbon { fill: var(--accent); }
.medal-badge--green .medal-disc { fill: var(--accent-wash); stroke: var(--accent); }
.medal-badge--bronze, .medal-badge--gold { color: var(--gold); }
.medal-badge--bronze .medal-ribbon, .medal-badge--gold .medal-ribbon { fill: var(--gold); }
.medal-badge--bronze .medal-disc, .medal-badge--gold .medal-disc { fill: var(--gold-wash); stroke: var(--gold); }
.medal-badge--silver { color: var(--ink); }
.medal-badge--silver .medal-ribbon { fill: var(--ink-soft); }
.medal-badge--silver .medal-disc { fill: var(--bg); stroke: var(--ink-soft); }
.medal-badge--shine { animation: medalPop 520ms cubic-bezier(0.2, 0.7, 0.3, 1.2) both; }
@keyframes medalPop {
  0% { transform: scale(0.45) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
.segmented[hidden] { display: none; }


/* Article figures & tutorial diagrams */
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 22px 0 8px;
  box-shadow: var(--shadow-sm);
}
.prose img + em, .prose figcaption {
  display: block;
  margin-bottom: 22px;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
