 /* =========================
   全体
========================= */
body {
  font-family: system-ui, sans-serif;
  background: #0b6b3a;
  color: white;
  text-align: center;
  margin: 0;
  padding: 4px;
  overflow: hidden; /* ★ PCでも縦スクロール防止 */
}

/* =========================
   メニュー・上部UI
========================= */
#menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

#menu button {
  flex: 0 1 calc(50% - 10px);
  min-width: 0;
  padding: 4px 2px;
  margin: 2px;
  font-size: 13px;
  white-space: nowrap;
}

#status {
  margin: 4px 0;
  min-height: 40px;
}

#turnCanvas {
  width: 36px;
  height: 36px;
  flex-shrink: 0;   /* ← これが重要 */
}

#colorSettings input[type="color"] {
  width: 30px;
  height: 20px;
  vertical-align: middle;
  background: none;
  cursor: pointer;
}

/* =========================
   ボタン（縦を抑える）
========================= */
button {
  padding: 6px 13px;
  margin: 4px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

/* =========================
   盤面サイズの基準値
   1マス = 画面短辺の割合
========================= */
:root {
  --cell-size: clamp(38px, 8.5vmin, 60px);
}

/* =========================
   盤面
========================= */
#board {
  display: grid;
  grid-template-columns: repeat(8, var(--cell-size));
  gap: 0.4vmin;
  background: #004d2a;
  width: max-content;
  margin: 6px auto;
  padding: 4px;
  border-radius: 8px;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: #0f8f4f;
  border-radius: 6px;
  cursor: pointer;
}

/* =========================
   コマ（canvas）
========================= */
canvas {
  width: 100%;
  height: 100%;
  transform: scale(0);
  transition: transform 0.25s ease;
}

canvas.show {
  transform: scale(1);
}

canvas.flip {
  animation: flip 0.4s ease;
}

@keyframes flip {
  0%   { transform: scale(1) rotateY(0deg); }
  50%  { transform: scale(1.1) rotateY(90deg); }
  100% { transform: scale(1) rotateY(180deg); }
}

/* =========================
   スマホ微調整
========================= */
@media (max-width: 600px) {
  button {
    font-size: 15px;
    padding: 6px 12px;
    /*width: 90%;*/
    max-width: 300px;
  }

  #menu {
    display: flex;
    /*flex-direction: column;*/
    align-items: center;
    gap: 6px;
  }
}

/* =========================
   高さが低い端末対策
========================= */
@media (max-height: 700px) {
  button {
    padding: 4px 10px;
    font-size: 13px;
  }

  #board {
    margin: 4px auto;
  }
}