:root {
  --ink: #1c1917;
  --paper: #f4efe4;
  --card: #fffdf8;
  --line: #e4d7c3;
  --gold: #b45309;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(800px 360px at 0% -10%, #fde68a 0%, transparent 50%),
    var(--paper);
}
a { color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 22px 16px 72px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: -0.04em; }
.brand span { color: var(--gold); }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a, .chip {
  text-decoration: none; font-size: 13px; border: 1px solid var(--line);
  background: var(--card); border-radius: 999px; padding: 6px 10px;
}
h1 { font-size: clamp(34px, 7vw, 58px); letter-spacing: -0.045em; line-height: 0.95; margin: 22px 0 8px; }
.lede { max-width: 40em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-height: 168px;
}
.tag { color: var(--gold); font-size: 12px; letter-spacing: 0.08em; }
.card b { display: block; font-size: 22px; margin: 6px 0; }
.card p, .note, .help p { color: #57534e; }
.stage { position: relative; margin-top: 14px; background: #111827; border-radius: 16px; overflow: hidden; }
canvas { display: block; width: 100%; height: auto; touch-action: none; background: #111827; }
.hud { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: #f8fafc; padding: 10px 12px; }
button {
  border: 0; background: #f59e0b; color: #1c1917; font-weight: 700;
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.over {
  position: absolute; inset: 52px 0 0; display: grid; place-items: center;
  background: rgba(17, 24, 39, 0.62); color: white; text-align: center;
}
.over[hidden] { display: none; }
.over h2 { margin: 0 0 8px; font-size: 36px; }
.help { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 8px; margin-top: 14px; }
.help h2 { font-size: 16px; margin: 14px 0 4px; }
.board { display: grid; gap: 8px; justify-content: center; margin: 18px 0; }
.cell {
  width: 64px; height: 64px; border-radius: 10px; border: 2px solid #d6d3d1;
  background: #fff; font-weight: 800; font-size: 22px; cursor: pointer;
}
.cell.on { background: #1c1917; color: #f8fafc; border-color: #1c1917; }
.keys { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.keys button { min-width: 42px; }
.kb { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px; justify-content: center; }
.word { font-size: 28px; letter-spacing: 0.2em; text-align: center; margin: 8px 0; }
.ok { color: #15803d; } .bad { color: #b91c1c; }
@media (max-width: 420px) {
  .cell { width: 52px; height: 52px; font-size: 18px; }
  .kb { grid-template-columns: repeat(5, 44px); }
}
