/* =====================================================================
   style.css — 重力四目並べ ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   ===================================================================== */

/* モード・手番切替（手本のモード切替を流用） */
.sg-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: var(--sg-space-1, 4px);
}
.sg-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* 操作ボタン群 */
.cf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.cf-actions .sg-btn {
  padding: 8px 14px;
  font-size: 0.95rem;
}

/* ステータス（手番・勝敗） */
.cf-status {
  min-height: 1.4em;
  margin: 4px 0 12px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
}
.cf-status.is-ok { color: #067647; }
.cf-status.is-warn { color: #b54708; }

/* 戦績 */
.cf-record-wrap {
  text-align: center;
  font-size: 0.9rem;
  color: var(--sg-muted, #777);
}

/* ---------- 盤面（モバイルは横スクロール可） ---------- */
.cf-board-wrap {
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.cf-board {
  --cf-cols: 7;
  --cf-rows: 6;
  --cf-cell: clamp(38px, 12vw, 60px);
  display: grid;
  grid-template-columns: repeat(var(--cf-cols), var(--cf-cell));
  grid-template-rows: repeat(var(--cf-rows), var(--cf-cell));
  gap: 4px;
  background: var(--sg-primary, #3b5bdb);
  padding: 8px;
  border-radius: 12px;
  flex: 0 0 auto;
}
.cf-board:focus-visible {
  outline: 3px solid #ffb020;
  outline-offset: 2px;
}

.cf-cell {
  position: relative;
  width: var(--cf-cell);
  height: var(--cf-cell);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.cf-cell:disabled {
  cursor: default;
}

/* 穴（円形のくぼみ）。空マスは盤色に対して明るい抜き。 */
.cf-disc {
  width: 86%;
  height: 86%;
  border-radius: 50%;
  display: block;
  box-sizing: border-box;
  background: var(--sg-card-bg, #f4f6fb);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.08s ease;
}

/* 赤：塗りつぶしの円 */
.cf-cell.is-red .cf-disc {
  background: radial-gradient(circle at 34% 30%, #ff8a8a, #d92d20 68%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
/* 黄：中空のリング（色に加えて形でも判別） */
.cf-cell.is-yellow .cf-disc {
  background: radial-gradient(circle at 34% 30%, #ffe08a, #f5b301 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  border: 4px solid #a86a00;
}

/* 落下先プレビュー（選択列の着地点に薄い石） */
.cf-cell.is-preview[data-preview="red"] .cf-disc {
  background: rgba(217, 45, 32, 0.32);
}
.cf-cell.is-preview[data-preview="yellow"] .cf-disc {
  background: rgba(245, 179, 1, 0.35);
  border: 3px dashed rgba(168, 106, 0, 0.7);
}

/* 最後に落とした石を強調 */
.cf-cell.is-last .cf-disc {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

/* 勝ちライン（点滅で強調） */
.cf-cell.is-win .cf-disc {
  animation: cf-win-pulse 0.7s ease-in-out infinite alternate;
}
@keyframes cf-win-pulse {
  from { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9); }
  to { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.15); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-cell.is-win .cf-disc {
    animation: none;
    outline: 3px solid #fff;
    outline-offset: -3px;
  }
}

.cf-cell:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 2;
}

/* 早見表 */
.sg-chart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px 16px;
}
.sg-chart-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
}
.sg-chart-row__key {
  flex: 0 0 6em;
  font-weight: 600;
}
.sg-chart-row__val {
  flex: 1 1 auto;
  color: var(--sg-muted, #555);
}
