/* 「数字の正体は？」固有の盤面。共通UIは ../css/game-common.css。 */

.game-area { width: 100%; }

.ni-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* 候補欄は全 Lv で同じ高さを予約する（Lv1/2 は空欄）。Lv3 は説明1行 + 数字1行。 */
.ni-cands {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 64px;
  height: 64px;
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  background: #fff8e6;
  box-sizing: border-box;
}
.ni-cands.is-empty { background: transparent; }
.ni-cands-label { font-size: 13px; font-weight: 700; color: #5b6b60; line-height: 1.3; white-space: nowrap; }
.ni-cands-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ni-cand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid #d8a634;
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.ni-equations {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 480px;
}
/* 式は1行（画像 + 演算子 + 画像 = 数値）。2桁の和でも折り返さない。 */
.ni-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
  min-height: 52px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f3f5ee;
}
.ni-img { width: 44px; height: 44px; flex: 0 0 auto; display: block; }
.ni-op { font-size: 26px; font-weight: 800; color: #3c4a40; flex: 0 0 auto; }
.ni-val { font-size: 28px; font-weight: 800; color: var(--ink); min-width: 1.4em; text-align: left; flex: 0 0 auto; }

.ni-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.ni-question .ni-img { width: 48px; height: 48px; }

/* 回答は 2×2。 */
.ni-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 420px;
  touch-action: manipulation;
}
.ni-choice {
  position: relative;
  min-height: 60px;
  margin: 0;
  border: 3px solid #b9c7ad;
  border-radius: 14px;
  background: #fff;
  color: #2b3a30;
  font: inherit;
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(52, 75, 64, 0.18);
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.ni-choice:disabled { cursor: default; }
.ni-choice.is-correct { border-color: var(--green); background: #e6f4ea; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--green); }
.ni-choice.is-correct::after { content: "○"; position: absolute; top: 2px; right: 8px; font-size: 16px; color: var(--green); }
.ni-choice.is-wrong { border-style: dashed; border-color: #b42318; background: #fdecea; }
.ni-choice.is-wrong::after { content: "×"; position: absolute; top: 2px; right: 8px; font-size: 16px; color: #b42318; }
.ni-choice.is-dim { opacity: 0.55; }
html.is-keyboard-nav .ni-choice:focus-visible { outline: 3px solid #d88635; outline-offset: 2px; }

@media (max-width: 430px) {
  .ni-wrap { gap: 8px; }
  .ni-img { width: 36px; height: 36px; }
  .ni-question .ni-img { width: 40px; height: 40px; }
  .ni-op { font-size: 22px; }
  .ni-val { font-size: 24px; }
  .ni-eq { min-height: 44px; gap: 4px; }
  .ni-question { font-size: 19px; }
  .ni-cands { min-height: 58px; height: 58px; }
  .ni-cands-label { font-size: 12px; }
  .ni-cand { width: 30px; height: 30px; font-size: 18px; }
  .ni-choice { min-height: 54px; font-size: 26px; }
}
