:root {
  --ink: #1c1915;
  --muted: #5c5348;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --line: #e2d8c8;
  --red: #b42318;
  --indigo: #1e3a5f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans", "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--indigo); }
.wrap { width: min(860px, calc(100% - 32px)); margin: 0 auto; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.mark { width: 36px; height: 36px; border-radius: 8px; display: block; object-fit: cover; }
.nav-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; }
h1 { font-family: "Fraunces", "Noto Serif JP", serif; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.03em; margin: 8px 0 12px; }
.kicker { color: var(--red); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; font-weight: 600; margin: 0; }
.lede { color: var(--muted); max-width: 66ch; }
.crumb { color: var(--muted); margin: 0 0 8px; }
.row { display: flex; gap: 8px; margin: 16px 0; }
input[type="search"] {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; padding: 12px 14px;
}
button.go, button.cmd {
  border: 0; border-radius: 999px; background: var(--red); color: #fff; font: inherit; font-weight: 600;
  padding: 10px 16px; cursor: pointer;
}
button.cmd { background: #fff; color: var(--red); border: 2px solid var(--red); }
.results { display: grid; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: grid; grid-template-columns: 88px 1fr; gap: 12px; cursor: pointer;
}
.card .kj { font-family: "Noto Serif JP", serif; font-size: 2.4rem; line-height: 1; }
.meta { color: var(--muted); }
.stage { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stage svg { width: min(280px, 100%); height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.hand { margin-top: 18px; }
canvas.pad {
  width: 256px; height: 256px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.matches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.matches button {
  font-family: "Noto Serif JP", serif; font-size: 1.6rem; min-width: 48px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; cursor: pointer;
}
.section { padding: 24px 0; }
h2 { font-family: "Fraunces", serif; font-size: 1.6rem; margin: 0 0 8px; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding: 22px 0 36px; }
@media (max-width: 700px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .card { grid-template-columns: 1fr; }
}

.glyph-stroke { fill: var(--ink); opacity: 0; animation: appear 0.35s ease forwards; }
.stroke-badge { opacity: 0; animation: appear 0.2s ease forwards; }
.stroke-badge circle { fill: var(--red); }
.stroke-badge text { fill: #fff; font-size: 32px; font-family: "IBM Plex Sans", sans-serif; font-weight: 700; }
@keyframes appear { to { opacity: 1; } }
.empty { color: var(--muted); }
#stroke svg { width: min(280px, 100%); height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
