@charset "UTF-8";

/* p が display:flex; なので縦に並べる */
.mb-controls {
  width: 100%;
  display: grid;
  gap: 10px;
}

.mb-choice {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.mb-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  background: #fff;
}

.mb-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 非活性を“灰色ベタ”じゃなく少し上品に */
.button-1:disabled {
  opacity: 0.45;
  filter: grayscale(0.6);
  cursor: not-allowed;
}
.button-1:disabled::after {
  opacity: 0.5;
}

.mb-status{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 0.95em;

  box-sizing: border-box;
  min-width: 0;

  /* 折り返し（互換性重視） */
  overflow-wrap: break-word; /* 推奨 */
  word-wrap: break-word;     /* 古い互換 */
  word-break: break-word;    /* 一部ブラウザ互換 */
}



/* 盤面 */
.mb-board {
  width: 100%;
  max-width: 260px;   /* ← 半分くらい */
  aspect-ratio: 1 / 1;
  margin-top: 6px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;           /* ← 少し詰める */

  padding: 8px;       /* ← 少し詰める */
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* マス */
.mb-cell {
  border: none;
  border-radius: 16px;
  background: rgba(255,255,255,0.85);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(0,0,0,0.10);
  cursor: pointer;

  /* 画像を中央に綺麗に */
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;

  transition: transform 0.05s ease, box-shadow 0.15s ease;
}

.mb-cell:active {
  transform: translateY(1px);
}

.mb-cell:focus-visible {
  outline: 3px solid rgba(108, 200, 247, 0.85);
  outline-offset: 2px;
}

/* 開始前は押せない雰囲気 */
.mb-board.is-locked .mb-cell {
  cursor: not-allowed;
  opacity: 0.75;
}

/* 〇×画像（HTMLと同じフォルダに置く想定） */
.mb-cell.is-o {
  background-image: url("./marubatsu_maru.png");
}
.mb-cell.is-x {
  background-image: url("./marubatsu_batsu.png");
}

/* 置いたマスは押せない */
.mb-cell.is-filled {
  cursor: not-allowed;
}

/* box30 の本文領域（元の .box30 p 相当） */
.box30-body {
  padding: 15px 20px;
  margin: 0;

  display: flex;
  flex-direction: column;  /* ← 縦に固定 */
  gap: 12px;
  min-width: 0;            /* ← はみ出し防止 */
}

/* ===== 盤面（デザイン強化版） ===== */
.mb-board {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin-top: 6px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;

  padding: 10px;
  border-radius: 20px;

  /* ここがポイント：ベースの色＋うっすら模様 */
  background:
    /* うっすら光のグラデ */
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,0.70), rgba(255,255,255,0.05) 60%, rgba(0,0,0,0.05) 100%),
    /* 斜めストライプ（控えめ） */
    repeating-linear-gradient(135deg,
      rgba(108,200,247,0.12) 0 8px,
      rgba(255,255,255,0.00) 8px 16px
    ),
    /* 下地 */
    linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0.35));

  border: 1px solid rgba(0,0,0,0.12);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.55);

  position: relative;
  overflow: hidden; /* 擬似要素を角丸で切る */
}

/* 盤面のフレーム（内枠） */
.mb-board::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.10),
    inset 0 0 0 6px rgba(255,255,255,0.18);
  pointer-events: none;
}

/* グリッド線（3x3のラインを“盤面っぽく”） */
.mb-board::after {
  content: "";
  position: absolute;
  inset: 10px;              /* paddingに合わせる */
  border-radius: 14px;
  pointer-events: none;

  /* 縦2本＋横2本の線を一気に描く */
  background:
    linear-gradient(to right,
      transparent 0,
      transparent calc(33.333% - 1px),
      rgba(0,0,0,0.18) calc(33.333% - 1px),
      rgba(0,0,0,0.18) calc(33.333% + 1px),
      transparent calc(33.333% + 1px),
      transparent calc(66.666% - 1px),
      rgba(0,0,0,0.18) calc(66.666% - 1px),
      rgba(0,0,0,0.18) calc(66.666% + 1px),
      transparent calc(66.666% + 1px),
      transparent 100%
    ),
    linear-gradient(to bottom,
      transparent 0,
      transparent calc(33.333% - 1px),
      rgba(0,0,0,0.18) calc(33.333% - 1px),
      rgba(0,0,0,0.18) calc(33.333% + 1px),
      transparent calc(33.333% + 1px),
      transparent calc(66.666% - 1px),
      rgba(0,0,0,0.18) calc(66.666% - 1px),
      rgba(0,0,0,0.18) calc(66.666% + 1px),
      transparent calc(66.666% + 1px),
      transparent 100%
    );

  /* 線が強すぎる時はこれを下げる（0.18→0.12とか） */
  opacity: 0.9;
}

/* マスは盤面に馴染ませつつ“置き場感”を強化 */
.mb-cell {
  border: none;
  border-radius: 16px;

  background: rgba(255,255,255,0.78);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(0,0,0,0.10),
    inset 0 -10px 18px rgba(0,0,0,0.04);

  cursor: pointer;

  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;

  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* 押した時の気持ちよさ */
.mb-cell:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 6px rgba(0,0,0,0.12),
    inset 0 0 0 1px rgba(0,0,0,0.12),
    inset 0 -10px 18px rgba(0,0,0,0.03);
}
