@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/inter-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/inter-latin-700.woff2) format("woff2");
}
:root {
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --ink: #1d2b36;
  --muted: #5d6b75;
  --red: #c0392b;
  --inset: #f3f6f7;
  --line: #d7e0e4;
  --card: #fff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  background-color: #ac854e;
  background-image: linear-gradient(#4d4e4e 0%, #716861 30%, #8a7968 55%, #a6865a 85%, #ac854e 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
@media (max-width: 899px), (hover: none) and (pointer: coarse) {
  body { background-attachment: scroll; }
}
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 8px; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.top { background: #fff; }
.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.mark { display: block; flex: none; }
button.nav-toggle { display: none; }
#site-nav { display: flex; gap: 4px 16px; align-items: center; }
#site-nav a {
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
}
#site-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 799px) {
  button.nav-toggle { display: inline-flex; }
  #site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  #site-nav.open { display: flex; }
  #site-nav a { padding: 0 2px; }
}
main { padding: 8px 0 56px; }
h1 { font-size: 2.2rem; line-height: 1.15; font-weight: 700; margin: 0 0 8px; }
h2 { font-size: 1.75rem; line-height: 1.25; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; margin: 16px 0 8px; }
.panel {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.lead { margin: 0 0 16px; max-width: 68ch; }
.layout { display: grid; gap: 24px; }
.play { padding: 12px 16px 8px; }
.play h1 { max-width: 20ch; margin-bottom: 2px; }
.play .board, .play .midrow, .play .runbox, .play .cpu-line, .play .meta-row { margin-top: 2px; margin-bottom: 2px; }
.play .status, .play .hint { margin-top: 2px; margin-bottom: 2px; }
.play .actions { margin-top: 2px; }
@media (min-width: 1100px) {
  .layout { grid-template-columns: 760px minmax(0, 1fr); align-items: start; }
  .panel { padding: 28px; }
  .play { padding: 8px 20px 8px; }
}
.prose { margin-top: 56px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose h2 { margin-top: 8px; }
.steps-nav, .anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.anchors a, .steps-nav a { font-weight: 700; }
.btn, button.btn, a.btn {
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
}
a.btn { color: var(--ink); }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.primary:disabled { background: var(--accent); color: #fff; }
.levels { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.levels .btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.hint, .level-note, .muted { color: var(--muted); margin: 4px 0; }
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}
.banner svg { flex: none; margin-top: 2px; }
.banner p { margin: 0; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.seat {
  background: var(--inset);
  border-radius: 12px;
  padding: 8px 8px 6px;
  min-width: 0;
}
.seat-name { margin: 0; font-weight: 700; line-height: 1.25; }
.role { font-weight: 400; color: var(--muted); }
.seat-score { margin: 0; font-variant-numeric: tabular-nums; line-height: 1; }
.seat-score b { font-size: 2.5rem; line-height: 1; font-weight: 700; }
.seat-score span { color: var(--muted); }
.track {
  position: relative;
  height: 12px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin: 4px 0 0;
}
.fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; max-width: 100%; }
.tick90 {
  position: absolute;
  left: 74.4%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--muted);
  background: #fff;
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
}
.target-line { margin: 4px 0 0; color: var(--muted); }
.status { min-height: 0; font-weight: 700; margin: 4px 0; }
.runbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0; }
.runhead { min-width: 4.5rem; }
.runbox .lbl { margin: 0; color: var(--muted); line-height: 1.2; }
.runnum { margin: 0; font-size: 2.5rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.zones { display: grid; gap: 8px; }
.midrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 4px 0; }
.midrow .crib-open { flex: 1 1 18rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 4px 0; font-weight: 700; }
.meta-bit { color: var(--muted); font-weight: 400; }
.cpu-line { display: flex; align-items: center; gap: 12px; margin: 4px 0; min-width: 0; }
.cpu-line .zone-label { margin: 0; }
.pile { display: flex; align-items: center; height: 2.25rem; }
.pile .cd { width: 1.5rem; height: 2.1rem; --cw: 1.5rem; margin-left: -0.85rem; }
.pile .cd:first-child { margin-left: 0; }
.pile-count { margin-left: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zone { min-width: 0; }
.zone-label { margin: 0 0 2px; font-weight: 700; }
.stack-top { margin-top: 16px; }
.mini-check { display: inline-flex; width: 16px; height: 16px; vertical-align: middle; color: var(--accent); }
.zone.counting { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
.fan { display: grid; justify-content: center; gap: 0.5rem 0.75rem; }
.fan.six { grid-template-columns: repeat(3, 4rem); }
.fan.rest { grid-template-columns: repeat(4, 4rem); gap: 0.5rem; }
.seq { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.cd {
  --cw: 4rem;
  width: 4rem;
  height: 5rem;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  border-radius: calc(var(--cw) * 0.12);
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  padding: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
button.cd { cursor: pointer; font: inherit; }
button.cd:disabled { cursor: default; }
.cd.r { color: var(--red); }
.cd .ix {
  position: absolute;
  left: 4%;
  top: 3%;
  width: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-size: max(1rem, calc(var(--cw) * 0.3));
}
.cd .ix i { font-style: normal; font-size: 0.9em; }
.cd .pp::before { content: attr(data-s); }
.cd .pp { position: absolute; right: 8%; bottom: 6%; font-size: calc(var(--cw) * 0.42); line-height: 1; }
.cd .tick {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #fff;
  color: var(--accent);
  opacity: 0;
}
.cd.sel .tick { opacity: 1; }
.cd.sel { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cd.bad { border-style: dashed; }
.cd.lit { box-shadow: inset 0 0 0 3px var(--accent); }
.cd.bk {
  background-color: var(--accent);
  border-color: var(--accent-hover);
  color: transparent;
  box-shadow: inset 0 0 0 3px #fff;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 4px, transparent 4px 9px);
}
.cd.bk .pp, .cd.bk .ix { display: none; }
.place {
  min-height: 5rem;
  border: 2px dashed var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 8px;
}
.cut-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.cut-row figure { margin: 0; text-align: center; }
.cut-row figcaption { font-size: 1rem; margin-top: 8px; }
.actions, .row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.secondary { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 4px; }
.secondary details { flex: 1 1 220px; }
.secondary summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.confirm-box, .result {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  background: var(--inset);
}
.result { border-color: var(--accent); background: #fff; }
.result-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 8px; }
.finalnum { font-size: 1.5rem; font-variant-numeric: tabular-nums; font-weight: 700; margin: 0 0 8px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { margin: 0 0 8px; }
.log button, .combo {
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  min-height: 44px;
  cursor: pointer;
  color: var(--ink);
}
.log button[aria-pressed="true"], .combo[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.pts { font-variant-numeric: tabular-nums; font-weight: 700; }
.total-line { font-size: 1.5rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.ex { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 8px 0; --cw: 4rem; }
.ex .cd { --cw: 4rem; }
figure.diagram { margin: 16px 0 24px; }
figure.diagram figcaption { margin-top: 8px; max-width: 68ch; }
.panels { display: grid; gap: 16px; }
.mini {
  background: var(--inset);
  border-radius: 12px;
  padding: 12px;
}
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--inset); }
.step-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .step-grid { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--inset);
  border-radius: 12px;
  padding: 16px;
  margin: 0;
}
.step b { display: block; margin-bottom: 4px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.faq p { margin-top: 0; }
.foot { background: #fff; padding: 24px 0; color: var(--muted); }
.foot .tag { color: var(--ink); font-weight: 700; margin: 0 0 8px; }
.foot ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot a { font-weight: 700; }
.counter-top { margin-bottom: 16px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.slot { width: 4rem; }
.slot .slot-hit {
  display: block;
  width: 4rem;
  min-height: 5rem;
  padding: 0;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.slot.on .slot-hit { border-style: solid; border-color: var(--accent); }
.slot .cd { border-radius: calc(4rem * 0.12); }
.slot-name { display: block; font-size: 0.9rem; min-height: 2.6em; margin-bottom: 4px; }
.remove { width: 100%; margin-top: 4px; min-height: 44px; }
.suits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 700px) { .suits { grid-template-columns: repeat(4, 1fr); } }
.ranks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ranks .btn, .suits .btn { width: 100%; padding: 0 6px; }
.suits .btn[aria-pressed="true"], .mode .btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.mode { display: flex; gap: 8px; margin: 8px 0 16px; }
@media (min-width: 900px) {
  .play .cd { --cw: 5rem; width: 5rem; height: 7rem; }
  .play .pile .cd { --cw: 1.5rem; width: 1.5rem; height: 2.1rem; }
  .play .fan.six { grid-template-columns: repeat(6, 5rem); }
  .play .fan.rest { grid-template-columns: repeat(4, 5rem); }
  .counter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .counter-top { grid-column: 1 / -1; }
}
.noscript {
  background: var(--inset);
  border-radius: 12px;
  padding: 12px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (min-width: 1280px) {
  .wrap { width: min(1180px, calc(100% - 100px)); }
}
