/* =====================================================================
   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;
}

/* 石数表示 */
.rv-score {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.rv-score__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rv-score__item strong {
  font-size: 1.25rem;
  min-width: 1.4em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rv-score__disc {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}
.rv-score__disc.is-black {
  background: radial-gradient(circle at 34% 30%, #6b6b6b, #111 65%);
}
.rv-score__disc.is-white {
  background: radial-gradient(circle at 34% 30%, #fff, #d3d6dc 78%);
  border: 1px solid #9aa0ab;
}

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

/* パス通知 */
.rv-pass {
  min-height: 1.2em;
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #b54708;
}

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

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

/* ---------- 盤面（モバイルは横スクロール可） ---------- */
.rv-board-wrap {
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.rv-board {
  --rcell: clamp(32px, 10vw, 48px);
  display: grid;
  grid-template-columns: repeat(8, var(--rcell));
  grid-template-rows: repeat(8, var(--rcell));
  gap: 1px;
  background: #1f7a4d;
  border: 3px solid #14603a;
  border-radius: 4px;
  flex: 0 0 auto;
}

.rv-cell {
  position: relative;
  width: var(--rcell);
  height: var(--rcell);
  padding: 0;
  margin: 0;
  border: 0;
  background: #2a9d63;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.rv-cell:disabled {
  cursor: default;
}
.rv-cell.is-empty:not(:disabled):hover {
  background: #33b070;
}

/* 石（色＋形で判別） */
.rv-disc {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  display: block;
  font-size: 0; /* 記号は視覚的に隠すが読み上げ用に保持 */
  line-height: 0;
  box-sizing: border-box;
}
.rv-cell.is-black .rv-disc {
  background: radial-gradient(circle at 34% 30%, #6b6b6b, #111 65%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.rv-cell.is-white .rv-disc {
  background: radial-gradient(circle at 34% 30%, #fff, #d3d6dc 78%);
  border: 1px solid #9aa0ab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 合法手のドット表示 */
.rv-cell.is-legal::after {
  content: "";
  position: absolute;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* 最後に置いた石を強調 */
.rv-cell.is-last::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid var(--sg-primary, #3b5bdb);
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
}

.rv-cell:focus-visible {
  outline: 2px solid var(--sg-primary, #3b5bdb);
  outline-offset: -2px;
  z-index: 3;
}

/* 早見表（手本の五目に倣う） */
.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);
}
