/* =====================================================================
   style.css — フリーセル（FreeCell）ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   ===================================================================== */

/* ツールバー */
.fc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.fc-stats {
  display: flex;
  gap: 18px;
  margin-left: auto;
}
.sg-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.sg-stat__label {
  font-size: 0.72rem;
  color: var(--sg-muted, #777);
}
.sg-stat__value {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 盤面全体 */
.fc-board {
  /* カードの基準寸法（画面幅で伸縮）。8列＋左右余白が収まるよう調整 */
  --card-w: clamp(32px, 10.6vw, 56px);
  --card-h: calc(var(--card-w) * 1.4);
  --gap: clamp(2px, 0.9vw, 7px);
  width: 100%;
  overflow-x: auto;
}

/* 上段: フリーセル と ホームセル */
.fc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
  margin-bottom: calc(var(--card-h) * 0.3);
}
.fc-free,
.fc-home {
  display: flex;
  gap: var(--gap);
}

/* 場札の列 */
.fc-tableau {
  display: grid;
  grid-template-columns: repeat(8, var(--card-w));
  gap: var(--gap);
  justify-content: center;
}
.fc-col {
  position: relative;
  width: var(--card-w);
  min-height: var(--card-h);
}

/* カード共通 */
.fc-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w);
  height: var(--card-h);
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: calc(var(--card-w) * 0.12);
  background: #fff;
  padding: 0;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  -webkit-tap-highlight-color: transparent;
}
/* フリーセル・ホーム内のカードは定位置 */
.fc-free .fc-card,
.fc-home .fc-card {
  position: absolute;
  top: 0;
  left: 0;
}

.fc-card.is-red {
  color: #c0392b;
}
.fc-card.is-black {
  color: #1c2530;
}

/* カードの表記 */
.fc-corner {
  position: absolute;
  top: 3%;
  left: 7%;
  font-weight: 700;
  line-height: 1;
  font-size: clamp(0.58rem, 3.1vw, 0.92rem);
  text-align: center;
}
.fc-pip {
  position: absolute;
  right: 8%;
  bottom: 4%;
  font-size: clamp(0.85rem, 4.2vw, 1.45rem);
  line-height: 1;
}

/* 選択中 */
.fc-card.is-sel {
  outline: 3px solid var(--sg-accent, #f59f00);
  outline-offset: -1px;
  box-shadow: 0 0 0 2px var(--sg-accent, #f59f00), 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 50;
}

/* 空きスロット・プレースホルダ */
.fc-slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--card-w);
  height: var(--card-h);
  box-sizing: border-box;
  border: 1px dashed var(--sg-border, #b9c0cc);
  border-radius: calc(var(--card-w) * 0.12);
  background: rgba(127, 127, 127, 0.06);
  color: var(--sg-muted, #8a93a3);
  font-size: clamp(0.9rem, 4.6vw, 1.5rem);
  cursor: pointer;
  padding: 0;
}
.fc-col-empty {
  position: absolute;
  top: 0;
  left: 0;
}
.fc-free-empty {
  background: rgba(59, 91, 219, 0.06);
}
.fc-home-empty.is-red {
  color: #d98b83;
}
.fc-home-empty.is-black {
  color: #97a0ac;
}

/* クリアメッセージ */
.fc-msg {
  margin-top: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--sg-accent, #2f9e44);
}

/* 狭幅時はカードをやや小さく（横スクロールを避ける） */
@media (max-width: 360px) {
  .fc-board {
    --card-w: 10.2vw;
  }
}
