/* 「さっき何だっけ？」固有の盤面。共通UIは ../css/game-common.css。 */

.game-area { width: 100%; }

.game-area .mb-skeleton {
  --mb-card-h: 118px;
  --mb-card-num: 56px;
  --mb-card-img: 72px;
  --mb-choice-h: 56px;
  --mb-choice-img: 40px;
  --mb-choice-name: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
/* Lv3 は数字も画像も同じ高さのカードにして、問題ごとの高さのジャンプを避ける */
.game-area .mb-skeleton[data-level="3"] { --mb-choice-h: 92px; }

.mb-label {
  margin: 0;
  min-height: 1.5em;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
}
.mb-now { width: 100%; max-width: 240px; }
.mb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--mb-card-h);
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fffef8;
  color: var(--ink);
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}
.mb-card-num {
  font-size: var(--mb-card-num);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.mb-card img { display: block; width: var(--mb-card-img); height: var(--mb-card-img); pointer-events: none; -webkit-user-drag: none; }
.mb-card-name { font-size: 15px; font-weight: 800; line-height: 1.25; white-space: nowrap; }

.mb-ask {
  margin: 0;
  min-height: 1.5em;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  color: var(--green);
}

/* 初期記憶の「覚えた！」と回答の4択は同じ場所に重ね、どちらでも高さを同じにする */
.mb-bottom {
  display: grid;
  width: 100%;
  max-width: 360px;
  min-height: calc(var(--mb-choice-h) * 2 + 8px);
}
.mb-bottom > * { grid-area: 1 / 1; }
.mb-bottom [hidden] { display: none !important; }

.mb-ready.play {
  align-self: center;
  justify-self: center;
  width: min(100%, 220px);
  min-height: 48px;
  padding: 10px 24px;
  font-size: 16px;
  text-align: center;
}
/* 押せない間ははっきりグレーアウト（約1秒後に通常の緑へ） */
.mb-ready.play:disabled {
  opacity: 1;
  background: #d9ddd4;
  color: #8d9788;
  box-shadow: none;
  cursor: not-allowed;
}
.mb-ready.play { transition: background-color 0.18s, color 0.18s; }

.mb-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--mb-choice-h);
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.mb-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 4px 2px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  outline: none;
  box-sizing: border-box;
}
.mb-choice-num { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mb-choice img { display: block; width: var(--mb-choice-img); height: var(--mb-choice-img); pointer-events: none; -webkit-user-drag: none; }
.mb-choice-name { max-width: 100%; font-size: var(--mb-choice-name); font-weight: 800; line-height: 1.25; white-space: nowrap; }
html.is-keyboard-nav .mb-choice:focus-visible { border-color: #d88635; }
@media (hover: hover) {
  .mb-choice:not(:disabled):hover { border-color: rgba(50, 102, 77, 0.5); background: #fbfdf7; }
}

.mb-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(52, 75, 64, 0.3);
}

/* 答え合わせ（色だけに頼らず、○ × と枠線の形・文言を併用） */
.mb-choice:disabled { cursor: default; opacity: 1; }
.mb-choices.is-reveal .mb-choice:not(.is-correct):not(.is-wrong) { opacity: 0.55; }
.mb-choice.is-correct { border-color: var(--green); background: #e3f0e3; }
.mb-choice.is-correct .mb-badge { display: flex; background: var(--green); }
.mb-choice.is-correct .mb-badge::before { content: "○"; }
.mb-choice.is-wrong { border: 2px dashed #b42318; background: #fbe9e6; }
.mb-choice.is-wrong .mb-badge { display: flex; background: #b42318; }
.mb-choice.is-wrong .mb-badge::before { content: "×"; }

@media (max-width: 430px) {
  .game-area .mb-skeleton {
    --mb-card-h: 106px;
    --mb-card-num: 52px;
    --mb-card-img: 60px;
    --mb-choice-h: 54px;
    --mb-choice-img: 38px;
    gap: 6px;
  }
  .game-area .mb-skeleton[data-level="3"] { --mb-choice-h: 80px; }
  .mb-choice-num { font-size: 26px; }
  .mb-bottom { max-width: 320px; }
  .mb-choices { gap: 6px; }
  .mb-bottom { min-height: calc(var(--mb-choice-h) * 2 + 6px); }
}
@media (max-height: 760px) {
  .game-area .mb-skeleton { gap: 5px; --mb-card-h: 96px; --mb-card-num: 46px; --mb-card-img: 52px; }
}
@media (min-width: 700px) {
  .game-area .mb-skeleton { --mb-choice-h: 64px; --mb-choice-img: 46px; --mb-choice-name: 14px; }
  .game-area .mb-skeleton[data-level="3"] { --mb-choice-h: 100px; }
  .mb-bottom { max-width: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .mb-ready.play { transition: none; }
}
