/* =====================================================================
   style.css — アナグラム（文字並べ替え） ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   色は正規のCSS変数（--sg-*）＋フォールバックでダーク対応。
   ===================================================================== */

.sg-mt-2 { margin-top: var(--sg-space-2, 8px); }
.sg-mt-3 { margin-top: var(--sg-space-3, 12px); }

/* 設定モード選択 */
.sg-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--sg-space-1, 4px);
}
.sg-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ゴーストボタン（控えめ） */
.sg-btn--ghost {
  background: transparent;
  color: var(--sg-primary, #3b5bdb);
  border: 1px solid var(--sg-border, #d7dbe6);
}

/* ステータスバー */
.ag-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: var(--sg-space-3, 12px);
  font-size: 0.9rem;
  color: var(--sg-muted, #666);
}
.ag-status__item {
  background: var(--sg-surface-2, #f1f3f9);
  border: 1px solid var(--sg-border, #e2e6ee);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}
#timer.is-urgent {
  color: #e03131;
  border-color: #e03131;
  font-weight: 700;
}

/* ヒント */
.ag-hint {
  background: var(--sg-primary-soft, #eef2ff);
  border: 1px solid var(--sg-border, #d7dbe6);
  border-radius: 12px;
  padding: 12px 14px;
}
.ag-hint__meaning {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--sg-fg, #1a1f2b);
}
.ag-hint__meta {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--sg-muted, #666);
}
.ag-hint__reveal {
  margin: 6px 0 0;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--sg-primary, #3b5bdb);
}

/* 回答スロット（並べた文字） */
.ag-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 2px dashed var(--sg-border, #d7dbe6);
  border-radius: 12px;
  background: var(--sg-surface, #fff);
}
.ag-answer.is-correct { border-color: #2f9e44; border-style: solid; background: rgba(47,158,68,0.10); }
.ag-answer.is-wrong { border-color: #e03131; border-style: solid; background: rgba(224,49,49,0.08); }
.ag-answer__placeholder {
  color: var(--sg-muted, #999);
  font-size: 0.95rem;
}
.ag-slot {
  min-width: 44px;
  height: 48px;
  padding: 0 10px;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1px solid var(--sg-primary, #3b5bdb);
  border-radius: 10px;
  background: var(--sg-surface, #fff);
  color: var(--sg-fg, #1a1f2b);
  cursor: pointer;
  touch-action: manipulation;
}
.ag-slot:active { transform: scale(0.97); }

/* 文字タイル */
.ag-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--sg-space-1, 4px);
}
.ag-tile {
  min-width: 52px;
  height: 56px;
  padding: 0 12px;
  font-size: 1.55rem;
  font-weight: 700;
  border: 1px solid var(--sg-border, #d7dbe6);
  border-radius: 12px;
  background: var(--sg-surface-2, #f1f3f9);
  color: var(--sg-fg, #1a1f2b);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .12s, background .12s, transform .05s;
}
.ag-tile:hover:not(:disabled) {
  border-color: var(--sg-primary, #3b5bdb);
  background: var(--sg-primary-soft, #eef2ff);
}
.ag-tile:active:not(:disabled) { transform: scale(0.96); }
.ag-tile.is-used {
  opacity: 0.32;
  cursor: default;
  visibility: hidden; /* 位置は保ちつつ非表示にして、残りを詰めない */
}

/* ツール行（戻す/クリア/シャッフル/ヒント） */
.ag-toolrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sg-space-3, 12px);
}
.ag-mini {
  font-size: 0.85rem;
  padding: 7px 12px;
}

/* 入力欄 */
.ag-typerow { margin-top: var(--sg-space-3, 12px); }
.ag-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 1.05rem;
  border: 1px solid var(--sg-border, #d7dbe6);
  border-radius: 10px;
  background: var(--sg-surface, #fff);
  color: var(--sg-fg, #1a1f2b);
}
.ag-input:focus {
  outline: none;
  border-color: var(--sg-primary, #3b5bdb);
  box-shadow: 0 0 0 3px var(--sg-primary-soft, #eef2ff);
}

/* フィードバック */
.ag-feedback {
  min-height: 1.6em;
  margin: var(--sg-space-3, 14px) 0 0;
  font-weight: 600;
  line-height: 1.6;
}
.ag-feedback.is-correct { color: #2f9e44; }
.ag-feedback.is-wrong { color: #e03131; }
.ag-feedback.is-neutral { color: var(--sg-muted, #666); }

/* アクション行 */
.ag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--sg-space-3, 14px);
}

/* 結果 */
.ag-final {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--sg-fg, #1a1f2b);
}
.ag-best {
  font-weight: 600;
  color: var(--sg-primary, #3b5bdb);
  margin: 4px 0 0;
}

/* モバイル：タイルを大きめに */
@media (max-width: 480px) {
  .ag-tile { min-width: 48px; height: 54px; font-size: 1.45rem; }
  .ag-slot { min-width: 40px; height: 46px; font-size: 1.3rem; }
  .ag-toolrow .ag-mini { flex: 1 1 auto; }
}
