@font-face {
  font-family: "Satoshi";
  src: url("/fonts/SatoshiVariable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ground: #f6f6f7;
  --stage: #ffffff;
  --rule: #ececee;
  --ink: #17181b;
  --muted: #52525b;
  --filament: #d41445;
  --signal: #ff3d00;
  --success: #3f7d5f;
  --radius-object: 4px;
  --radius-control: 3px;
  --seam: 5px;
  --font: "Satoshi", Arial, system-ui, sans-serif;
  --font-data: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.45 var(--font);
}
.seam {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--seam);
  background: var(--filament);
  z-index: 2;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 72px 36px;
  padding-left: max(36px, calc(var(--seam) + 16px));
  padding-right: max(28px, env(safe-area-inset-right));
  padding-bottom: max(72px, calc(24px + env(safe-area-inset-bottom)));
}
.seam {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--seam);
  background: var(--filament);
  z-index: 2;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 72px 36px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}
h1 {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.03em;
}
.how {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
  counter-reset: step;
}
.how li {
  margin: 0;
  padding: 12px 14px 12px 40px;
  position: relative;
  background: var(--stage);
  border: 1px solid var(--rule);
  border-radius: var(--radius-object);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.how li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--filament);
  color: var(--stage);
  font-size: 11px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage {
  display: grid;
  grid-template-columns: minmax(0, 672px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}
.board-wrap {
  background: var(--stage);
  border: 1px solid var(--rule);
  border-radius: var(--radius-object);
  padding: 12px;
  min-width: 0;
}
canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--stage);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  image-rendering: auto;
}
.board-hint {
  display: none;
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}
.board-wrap .actions {
  margin-top: 12px;
}
aside {
  background: var(--stage);
  border: 1px solid var(--rule);
  border-radius: var(--radius-object);
  padding: 16px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0 0 16px;
}
.stat-wide { grid-column: 1 / -1; }
dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.panel-label {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.probs {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.probs li {
  display: grid;
  grid-template-columns: 42px 1fr 48px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.probs span { color: var(--muted); }
.probs i {
  height: 6px;
  background: var(--rule);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.probs i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: var(--filament);
}
.probs b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
}
.probs li.picked span { color: var(--filament); font-weight: 550; }
.probs li.off { opacity: 0.4; }
.probs li.off b { font-size: 10px; letter-spacing: 0.04em; }
.answers {
  margin: 0 0 4px;
}
.answers summary {
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  list-style: none;
}
.answers summary::-webkit-details-marker { display: none; }
.answers[open] summary { margin-bottom: 8px; }
pre {
  margin: 0;
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--radius-object);
  font: 11px/1.4 var(--font-data);
  color: var(--muted);
  white-space: pre-wrap;
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--stage);
  font: 13px/1 var(--font);
  font-weight: 550;
  cursor: pointer;
}
button.ghost {
  background: var(--stage);
  color: var(--ink);
  border: 1px solid var(--rule);
}
button:disabled { opacity: 0.55; cursor: default; }
a.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--stage);
  font: 13px/1 var(--font);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
a.cta:hover { background: var(--ink); }
a.cta-rail {
  height: 30px;
  width: 100%;
  margin-top: 8px;
}
.hint {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--signal);
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: stretch; gap: 14px; }
  .how { grid-template-columns: 1fr; max-width: none; }
  a.cta { width: 100%; }
  a.cta-rail { display: none; }
  .board-hint { display: block; }
  main {
    padding: 20px 14px 28px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-left: max(14px, calc(var(--seam) + 10px));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  .seam { width: 4px; }
  h1 { font-size: 24px; }
  .board-wrap { padding: 8px; }
  aside { padding: 14px; }
  .stats { gap: 8px 12px; }
  .actions {
    gap: 10px;
    margin-top: 12px;
  }
  button {
    min-height: 44px;
    height: 44px;
    flex: 1;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .how li { font-size: 12px; }
  dd { font-size: 13px; }
}
