/* =====================================================================
   style.css — ダイスポーカー ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   色は正規変数 var(--sg-…, フォールバック) のみ使用（ダーク対応）。
   ===================================================================== */

/* ツールバー（操作ボタン + スタッツ） */
.sg-dice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sg-dice-actions {
  display: flex;
  gap: 8px;
}
.sg-dice-stats {
  display: flex;
  gap: 18px;
}
.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.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* サイコロ列 */
.sg-dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 6px;
}
.sg-die {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sg-border, #e5e7eb);
  border-radius: 14px;
  background: var(--sg-surface, #fff);
  color: var(--sg-fg, #222);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}
.sg-die__face {
  font-size: 3rem;
  line-height: 1;
}
.sg-die:not(:disabled):active {
  transform: scale(0.94);
}
.sg-die:disabled {
  cursor: default;
  opacity: 0.85;
}
/* ホールド中のサイコロ */
.sg-die.is-held {
  border-color: var(--sg-primary, #3b5bdb);
  background: var(--sg-primary-soft, #eef1fd);
}
.sg-die__tag {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--sg-primary, #3b5bdb);
  border-radius: 6px;
  padding: 1px 6px;
  opacity: 0;
  pointer-events: none;
}
.sg-die.is-held .sg-die__tag {
  opacity: 1;
}

.sg-dice-status {
  margin-top: 14px;
  font-weight: 600;
  color: var(--sg-accent, #3b5bdb);
  min-height: 1.4em;
}

/* スコアカード */
.sg-scorecard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.95rem;
}
.sg-scorecard th,
.sg-scorecard td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
}
.sg-scorecard thead th {
  font-size: 0.78rem;
  color: var(--sg-muted, #777);
  font-weight: 600;
}
.sg-score-cell {
  text-align: right;
  width: 84px;
  font-variant-numeric: tabular-nums;
}
.sg-score-name {
  font-weight: 600;
}
.sg-score-label {
  display: block;
}
.sg-score-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--sg-muted, #777);
  margin-top: 1px;
}

/* 記入セル（候補=クリック可 / 確定 / 未記入） */
.sg-score-val {
  min-width: 60px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sg-muted, #999);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.sg-score-val.is-preview {
  border-color: var(--sg-primary, #3b5bdb);
  background: var(--sg-primary-soft, #eef1fd);
  color: var(--sg-primary, #3b5bdb);
  cursor: pointer;
}
.sg-score-val.is-preview:hover,
.sg-score-val.is-preview:focus-visible {
  background: var(--sg-primary, #3b5bdb);
  color: #fff;
  outline: none;
}
.sg-score-val.is-filled {
  color: var(--sg-fg, #222);
  cursor: default;
}
.sg-score-row.is-locked {
  opacity: 0.75;
}

/* 集計行 */
.sg-score-total-row th {
  font-weight: 600;
  color: var(--sg-muted, #555);
  font-size: 0.9rem;
}
.sg-score-total-row td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sg-score-grand th {
  color: var(--sg-fg, #222);
  font-size: 1rem;
}
.sg-score-grand td {
  font-size: 1.3rem;
  color: var(--sg-accent, #3b5bdb);
}

/* 小さい画面向け */
@media (max-width: 400px) {
  .sg-die {
    width: 54px;
    height: 54px;
  }
  .sg-die__face {
    font-size: 2.5rem;
  }
}
