:root {
  --bg: #0a0c10;
  --panel: #11141a;
  --line: #232834;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #4ade80;       /* GoM green */
  --accent-dim: #14532d;
  --given: #e8eaf0;
  --fill: #4ade80;
  --focus: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); color: var(--text); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 880px; margin: 0 auto; padding: 48px 20px 80px; }

/* ---- hero ---- */
.hero { padding: 28px 0 8px; }
.kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
h1 { font-size: clamp(30px, 5.4vw, 52px); line-height: 1.12; font-weight: 800; }
h1 .accent { color: var(--accent); }
.sub { color: var(--muted); font-size: 18px; margin-top: 18px; max-width: 64ch; }
.sub strong { color: var(--text); }

h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }

section { margin-top: 56px; }

/* ---- demo ---- */
.demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.controls { display: flex; align-items: center; gap: 10px; }
.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent-dim); border-color: var(--accent); color: #d1fae5; font-weight: 600; }
.btn:disabled { opacity: 0.45; cursor: default; }
.speed { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }

.board-wrap { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 18px; align-items: flex-start; }

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(92vw, 480px);
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(15px, 3.4vw, 24px);
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: transparent;
  transition: background 0.25s;
  user-select: none;
}
.cell.given { color: var(--given); font-weight: 700; }
.cell.filled { color: var(--fill); }
.cell.flash { background: rgba(251, 191, 36, 0.22); }
/* thick 3x3 box borders */
.cell.box-r { border-right: 2px solid #39414f; }
.cell.box-b { border-bottom: 2px solid #39414f; }

.board-side { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 14px; }
.stat span { font-size: 30px; font-weight: 800; color: var(--accent); display: block; line-height: 1.1; }
.stat label { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; border-left: 2px solid var(--line); padding-left: 12px; }

/* ---- results table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr:last-child td { border-bottom: none; }
td.us, th.us { background: rgba(74, 222, 128, 0.06); }
th.us { color: var(--accent); }
td.us strong { color: var(--accent); }
.method { color: var(--muted); font-size: 13px; margin-top: 12px; max-width: 72ch; }

/* ---- why ---- */
.why p { color: var(--muted); margin-bottom: 14px; max-width: 70ch; }
.why p em { color: var(--text); font-style: normal; font-weight: 600; }
.cta a { color: var(--accent); text-decoration: none; }
.cta a:hover { text-decoration: underline; }

/* ---- footer ---- */
.disclaimer { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 22px; }
.disclaimer p { color: var(--muted); font-size: 13px; max-width: 76ch; }
.fine { margin-top: 10px; font-size: 12px; opacity: 0.7; }

.cell.try { color: var(--focus); opacity: 0.8; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  background: var(--panel); color: var(--muted); border: none;
  padding: 9px 14px; font-size: 13px; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--accent-dim); color: #d1fae5; font-weight: 600; }
