/* =====================================================================
   style.css — はさみ将棋 ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   駒は画像を使わず、CSS の五角形と文字（歩・と）で描く。
   ===================================================================== */

/* ---------- 設定 ---------- */
.hs-settings {
  display: grid;
  gap: 10px;
}
.hs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.hs-row > .sg-label {
  flex: 0 0 100%;
  margin: 0;
}
.hs-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.hs-radios label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.95rem;
}
#cpu-opts[hidden],
#side-opts[hidden],
#record-wrap[hidden] {
  display: none;
}

/* ---------- 手番・取った数 ---------- */
.hs-status {
  min-height: 1.4em;
  margin: 2px 0 8px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
}
.hs-status.is-ok { color: #067647; }
.hs-status.is-warn { color: #b54708; }
.sg-dark .hs-status.is-ok { color: #6ce9a6; }
.sg-dark .hs-status.is-warn { color: #fdb022; }
.hs-cap {
  margin: 4px auto;
  max-width: 460px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 8px;
}
.hs-cap > span {
  white-space: nowrap;
}
.hs-cap__dots {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--sg-muted, #777);
}

/* ---------- 盤 ---------- */
.hs-board-wrap {
  display: flex;
  justify-content: center;
}
.hs-board {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  padding: 1px;
  background: #5c3d1e; /* 罫線の色 */
  border: 3px solid #5c3d1e;
  border-radius: 4px;
  box-sizing: border-box;
  touch-action: manipulation;
}
.hs-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: #e9c27a; /* 盤の木の色 */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}
.hs-cell:disabled {
  cursor: default;
}
.hs-cell:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: -3px;
  z-index: 2;
}
.hs-cell.is-last {
  background: #f3d79c;
}
.hs-cell.is-selected {
  background: #ffe9a8;
  box-shadow: inset 0 0 0 3px #1d4ed8;
}
.hs-cell.is-captured {
  background: #f4b4a8;
}
/* 動ける先の印 */
.hs-cell.is-dest::after {
  content: "";
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.55);
}

/* ---------- 駒（五角形＋文字） ---------- */
.hs-piece {
  width: 80%;
  height: 86%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12%;
  box-sizing: border-box;
  clip-path: polygon(50% 0, 86% 16%, 100% 100%, 0 100%, 14% 16%);
  background: linear-gradient(180deg, #fbe7bf, #e0b56a);
  color: #1a1a1a;
  font-weight: 700;
  font-size: clamp(0.85rem, 4.6vw, 1.55rem);
  line-height: 1;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  pointer-events: none;
  user-select: none;
}
.hs-piece.is-gote {
  color: #b42318; /* と は赤い文字で区別する */
}
/* 奥（上側）の駒は向こう向き */
.hs-piece.is-far {
  transform: rotate(180deg);
}

/* ---------- ルール早見 ---------- */
.hs-rules {
  margin: 0;
}
.hs-rules > div {
  padding: 6px 0;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
}
.hs-rules dt {
  font-weight: 600;
}
.hs-rules dd {
  margin: 2px 0 0;
  color: var(--sg-muted, #555);
}
