/* 禁じ手ページ。首屏は四三ページの手順、試し打ちは定石ページの名前当てと同じ配置。 */

.kj-main { max-width: 1040px; margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.ap-titleline .kj-jump { margin-left: auto; font-size: 13px; }
.kj-refs { margin: 4px 0 0; font-size: 12px; line-height: 1.7; color: var(--ap-muted); }

/* ── 首屏カード：四三ページ（.sp-primer）と同じ並び。左に題チップ・盤・釦、右に説明と手順 ── */
.kj-primer {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 457px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.kj-primer__left { display: grid; grid-template-areas: "chips" "board" "nav"; grid-template-rows: auto auto 1fr; justify-items: center; row-gap: 14px; align-content: start; }
.kj-primer__left > .ap-chips { grid-area: chips; justify-self: stretch; align-self: start; }
.kj-primer__left > .kj-board { grid-area: board; }
.kj-board { position: relative; display: grid; place-items: center; width: 457px; height: 457px; }
.kj-board svg, .kj-quizboard svg { display: block; }
.kj-watch { display: flex; flex-direction: column; gap: 12px; }
.kj-kicker { margin: 6px 0 0; font-size: 12px; font-weight: 900; color: var(--ap-cta); letter-spacing: .08em; }
.kj-watch h2 { margin: 0; font-size: 18px; font-weight: 900; line-height: 1.4; color: var(--ap-ink); text-align: left; }
.kj-lead { margin: 0; font-size: 14px; line-height: 1.95; color: var(--ap-sub); }
.kj-shapehead { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.kj-shapehead strong { font-size: 15px; font-weight: 900; }
.kj-shapehead span { font-size: 12px; color: var(--ap-muted); font-variant-numeric: tabular-nums; }
.kj-primer__left > .kj-nav { grid-area: nav; align-self: start; }
.kj-nav { display: flex; gap: 12px; }

/* ── 試し打ち：定石ページの名前当て ── */
.kj-quiz { display: flex; gap: 26px; align-items: center; scroll-margin-top: 80px; }
.kj-quizboard { flex: none; padding: 12px; background: var(--ap-page); border: 1px solid var(--ap-line); border-radius: 10px; }
.kj-quiz__copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.kj-quiz__progress { font-size: 12px; font-weight: 900; color: var(--ap-cta); }
.kj-quiz .kj-quiz__q { margin: 0; font-size: 18px; font-weight: 900; color: var(--ap-ink); text-align: left; }
.kj-quiz__next { align-self: flex-start; }

/* 題チップ：rule-lab が .lab-step を作る。見た目は .ap-chip と同じ */
.lab-step {
  padding: 5px 12px;
  border: 2px solid var(--ap-line);
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-ink);
  font-family: var(--ap-font);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.lab-step[aria-selected="true"] {
  border-color: var(--ap-ink);
  background: var(--ap-tag-yellow);
  box-shadow: 0 2px 0 var(--ap-ink);
}
.lab-step.ap-chip--ok { color: var(--ap-ok-ink); border-color: var(--ap-ok-ink); }
.lab-step.ap-chip--ok[aria-selected="true"] {
  background: var(--ap-ok-bg);
  border-color: var(--ap-ok-ink);
  box-shadow: 0 2px 0 var(--ap-ok-ink);
}

/* 透明な交点は練習盤の SVG と同じ原点に置く。 */
.lab-board__inner { position: relative; }
.board-hits { position: absolute; left: 0; top: 0; }
.board-hit {
  position: absolute;
  width: var(--hit, 28px);
  height: var(--hit, 28px);
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.board-hit:disabled { cursor: default; }
.board-hit--pulse {
  box-shadow: 0 0 0 2px var(--shu);
  animation: lab-hit-pulse 1.4s ease-in-out infinite;
}
/* 試した「打てる」点。半透明の石の上に緑の輪。色は盤 SVG ではなくここ。 */
.board-hit--ok { box-shadow: 0 0 0 2px var(--ap-ok-ink); }
@keyframes lab-hit-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--shu); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .board-hit--pulse { animation: none; }
}
.lab-reason {
  box-sizing: border-box;
  margin: 0;
  min-height: 92px;
  padding: 10px 12px;
  border: 1.5px dashed var(--ap-line);
  border-radius: 10px;
  background: var(--ap-surface);
  color: var(--ap-muted);
  font-size: 13px;
  line-height: 1.7;
}
.kj-quiz .lab-reason p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.lab-reason__end { font-weight: 700; }
.lab-reason[data-state="ng"] {
  border-style: solid;
  border-color: var(--forbidden);
  background: var(--ap-ng-bg);
  color: var(--forbidden);
}
.lab-reason[data-state="ok"] {
  border-style: solid;
  border-color: var(--ap-ok-ink);
  background: var(--ap-ok-bg);
  color: var(--ap-ok-ink);
}

/* 説明欄の幅に合わせて、問いと判定が折り返す行数を先に確保する。 */
.kj-quiz__copy { container-type: inline-size; }
@container (max-width: 360px) {
  .kj-quiz__q { min-height: 2lh; }
  .lab-reason { min-height: calc(4lh + 23px); }
}
@container (max-width: 220px) {
  .kj-quiz__q { min-height: 3lh; }
  .lab-reason { min-height: calc(8lh + 23px); }
}

@media (max-width: 767px) {
  .kj-main { padding: 0 12px; }
  .kj-primer { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 14px; }
  .kj-primer__left { display: contents; }
  .kj-primer__left > .ap-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .kj-primer__left > .ap-chips .ap-chip { flex: none; }
  .kj-board { width: 323px; height: 323px; align-self: center; }
  .kj-quiz { flex-direction: column; align-items: stretch; gap: 14px; }
  .kj-quizboard { align-self: center; }
}
