/*
 * public/css/stage-wizard.css — Phase 1 Sprint 3 (phase11-v1-foundation)
 *
 * Sprint 3 spec: .ars-state/phase1-sprint3-spec.md §7 D-7
 * drift #5 境界:
 *   - 既存 public/css/style.css を改変しない
 *   - PDR-1 正本側の class 名（サイドバー系・ナビ系・ピル系）を再定義しない
 *
 * frontend.md 準拠:
 *   - font-size 床 14px
 *   - ボタン最小 44x44px (Fitts の法則)
 */

.stage-wizard {
  display: block;
  padding: 12px;
  margin: 12px 0;
  font-size: 14px;
  color: #222;
}

.stage-wizard-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-wizard-badge {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  background: #f5f5f5;
  color: #444;
  cursor: default;
  text-align: center;
}

.stage-wizard-badge[data-state="pending"] {
  background: #f5f5f5;
  color: #999;
  border-color: #d8d8d8;
}

.stage-wizard-badge[data-state="done"] {
  background: #e6f6e6;
  color: #2a6e2a;
  border-color: #98c998;
}

.stage-wizard-badge[data-state="current"] {
  background: #fff4c2;
  color: #5a4200;
  border-color: #d8b200;
  font-weight: 700;
  box-shadow: 0 0 0 2px #f4d663 inset;
}

.stage-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-wizard-back,
.stage-wizard-next,
.stage-wizard-reset {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid #888;
  border-radius: 6px;
  background: #ffffff;
  color: #222;
  cursor: pointer;
}

.stage-wizard-back:hover,
.stage-wizard-next:hover,
.stage-wizard-reset:hover {
  background: #f0f0f0;
}

.stage-wizard-back:disabled,
.stage-wizard-next:disabled,
.stage-wizard-reset:disabled {
  background: #eeeeee;
  color: #aaaaaa;
  cursor: not-allowed;
}

.stage-wizard-next {
  border-color: #3060a8;
  background: #e9f0fb;
  color: #14356e;
  font-weight: 600;
}

.stage-wizard-reset {
  border-color: #b24040;
  color: #7a1d1d;
}

.stage-wizard-error {
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 14px;
  color: #8a1d1d;
  background: #fdecec;
  border: 1px solid #e5a2a2;
  border-radius: 4px;
}

.stage-wizard-error[hidden] {
  display: none;
}

/* ─────────────────────────────────────────────────────────────────
 * Phase 1 Sprint 4: Stage A 入力ペインのスタイル追記
 *
 * Sprint 4 spec: .ars-state/phase1-sprint4-spec.md §3 D-11
 * 既存 Sprint 3 CSS は 1 行も改変せず、末尾に追記のみ。
 *
 * drift #5 境界（厳守）:
 *   - PDR-1 正本側のサイドバー系 / ナビ系 / ピル系 class を追加しない
 * ───────────────────────────────────────────────────────────────── */

.stage-wizard-pane {
  display: block;
  padding: 16px;
  margin-top: 16px;
  font-size: 14px;
  color: #222;
  background: #fafafa;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
}

.stage-wizard-pane-title {
  margin: 0 0 12px 0;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  color: #14356e;
}

.stage-wizard-field {
  display: block;
  margin-bottom: 12px;
}

.stage-wizard-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.stage-wizard-field .required-mark {
  color: #b24040;
  font-weight: 700;
}

.stage-wizard-field textarea {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #222;
  background: #ffffff;
  border: 1px solid #b8b8b8;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}

.stage-wizard-field textarea:focus {
  outline: none;
  border-color: #3060a8;
  box-shadow: 0 0 0 2px #c5dbf5;
}

.stage-wizard-field .field-error {
  margin-top: 4px;
  font-size: 14px;
  color: #8a1d1d;
}

.stage-wizard-field .field-error[hidden] {
  display: none;
}

.stage-wizard-save {
  min-width: 120px;
  min-height: 44px;
  padding: 10px 20px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  background: #3060a8;
  border: 1px solid #244880;
  border-radius: 6px;
  cursor: pointer;
}

.stage-wizard-save:hover {
  background: #244880;
}

.stage-wizard-save:disabled {
  background: #a0b5d0;
  border-color: #a0b5d0;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────
 * Phase 1 Sprint 5: Stage B 入力ペインのスタイル追記
 *
 * Sprint 5 spec: .plans/2026-04-16-phase1-sprint5-stage-b-plan.md §2.2 D-5
 * 既存 Sprint 3/4 CSS は 1 行も改変せず、末尾に追記のみ。
 *
 * drift #5 境界（厳守）:
 *   - PDR-1 正本側のサイドバー系 / ナビ系 / ピル系 class を追加しない
 * ───────────────────────────────────────────────────────────────── */

.stage-wizard-ng-count {
  display: inline-block;
  padding: 6px 10px;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #5a4200;
  background: #fff7d9;
  border: 1px solid #d8b200;
  border-radius: 4px;
}

.stage-wizard-ng-count[data-ng-count="3"] {
  color: #8a1d1d;
  background: #fdecec;
  border-color: #e5a2a2;
}

.stage-wizard-warning-badge {
  display: inline-block;
  padding: 6px 12px;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #8a1d1d;
  background: #fdecec;
  border: 1px solid #e5a2a2;
  border-radius: 4px;
}

.stage-wizard-warning-badge[hidden] {
  display: none;
}

.stage-wizard-force-button {
  min-width: 180px;
  min-height: 44px;
  padding: 10px 20px;
  margin-top: 8px;
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  background: #b24040;
  border: 1px solid #8a1d1d;
  border-radius: 6px;
  cursor: pointer;
}

.stage-wizard-force-button:hover {
  background: #8a1d1d;
}

.stage-wizard-force-button:disabled {
  background: #d9a0a0;
  border-color: #d9a0a0;
  cursor: not-allowed;
}

.stage-wizard-force-button[hidden] {
  display: none;
}

.stage-wizard-pane-help {
  margin: 0 0 12px 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

/* ─────────────────────────────────────────────────────────────────
 * Phase 1 Sprint 6: Stage C 入力ペインのスタイル追記
 *
 * Sprint 6 spec: .plans/2026-04-16-phase1-sprint6-stage-c-plan.md §2.2
 * 既存 Sprint 3/4/5 CSS は 1 行も改変せず、末尾に追記のみ。
 *
 * drift #5 境界（厳守）:
 *   - PDR-1 正本側のサイドバー系 / ナビ系 / ピル系 class を追加しない
 * ───────────────────────────────────────────────────────────────── */

.stage-wizard-act-group {
  display: block;
  padding: 12px;
  margin: 12px 0;
  font-size: 14px;
  color: #222;
  background: #f3f6fb;
  border: 1px solid #c8d3e4;
  border-radius: 4px;
}

.stage-wizard-act-group[hidden] {
  display: none;
}

.stage-wizard-act-group-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #14356e;
}

.stage-wizard-act-counter {
  display: block;
  padding: 6px 10px;
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background: #ffffff;
  border: 1px solid #cfd8e4;
  border-radius: 4px;
}

.stage-wizard-act-counter[data-ok="true"] {
  color: #2a6e2a;
  background: #eaf7ea;
  border-color: #9acc9a;
}

.stage-wizard-act-counter[data-ok="false"] {
  color: #8a1d1d;
  background: #fdecec;
  border-color: #e5a2a2;
}

/* ────────────────────────────────────────────────────────────── */
/* Phase 1 Sprint 7 (phase11-v1-foundation): Stage D char cards */
/* ────────────────────────────────────────────────────────────── */

.stage-wizard-char-card {
  display: block;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  background: #ffffff;
  border: 1px solid #cfd8e4;
  border-radius: 6px;
}

.stage-wizard-char-card .stage-wizard-char-badge {
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1d4f8a;
  background: #e7f1fb;
  border: 1px solid #b9d4ee;
  border-radius: 4px;
}

.stage-wizard-char-card .stage-wizard-char-readonly-row {
  padding: 2px 0;
  font-size: 14px;
  color: #333;
}

.stage-wizard-char-card .stage-wizard-char-readonly-label {
  font-weight: 600;
  color: #555;
}

.stage-wizard-char-card .stage-wizard-char-readonly-value {
  color: #1a1a1a;
}

.stage-wizard-char-protagonist {
  background: #f5f9ff;
  border-color: #b9d4ee;
}

.stage-wizard-char-protagonist .stage-wizard-char-badge {
  color: #6a3f1d;
  background: #fbf1e7;
  border-color: #e4c9aa;
}

.stage-wizard-remove-char-btn {
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  margin-top: 8px;
  font-size: 14px;
  color: #8a1d1d;
  background: #fdecec;
  border: 1px solid #e5a2a2;
  border-radius: 4px;
  cursor: pointer;
}

.stage-wizard-remove-char-btn:hover {
  background: #fcdcdc;
}

.stage-wizard-add-char-btn {
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d4f8a;
  background: #e7f1fb;
  border: 1px dashed #7aa8d6;
  border-radius: 4px;
  cursor: pointer;
}

.stage-wizard-add-char-btn:hover:not(:disabled) {
  background: #d6e6f6;
}

.stage-wizard-add-char-btn:disabled {
  color: #999;
  background: #f0f0f0;
  border-color: #cccccc;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
 * Phase 1 Sprint 8: Stage E「10 話の流れ」
 *   - 第 1 部カーブ 8 カード + 第 1 章カーブ 8 カード + 10 話テーブル
 *   - frontend.md 準拠: font-size >= 14px / min 44x44px / アクセント 1 色
 * ───────────────────────────────────────────────────────────── */

.stage-wizard-emotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 10px 0 20px;
}

.stage-wizard-emotion-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  min-width: 44px;
  min-height: 44px;
  font-size: 14px;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid #c9d4e0;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.stage-wizard-emotion-card:hover {
  border-color: #6c5ce7;
  background: #f6f4ff;
}

.stage-wizard-emotion-card.selected {
  border-color: #6c5ce7;
  background: #eee9ff;
  box-shadow: 0 0 0 2px #d7ccff inset;
}

.stage-wizard-emotion-card .emotion-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.stage-wizard-emotion-card .emotion-card-desc {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

.stage-wizard-emotion-card .emotion-card-preview {
  margin-top: 4px;
}

.stage-wizard-recommendations {
  padding: 10px 12px;
  margin: 8px 0 16px;
  font-size: 14px;
  color: #333;
  background: #fafcff;
  border-left: 3px solid #6c5ce7;
  border-radius: 4px;
}

.stage-wizard-episode-table {
  width: 100%;
  margin: 12px 0 16px;
  font-size: 14px;
  border-collapse: collapse;
  background: #ffffff;
}

.stage-wizard-episode-table th,
.stage-wizard-episode-table td {
  padding: 8px 6px;
  font-size: 14px;
  text-align: left;
  border-bottom: 1px solid #e4e8ee;
  vertical-align: top;
}

.stage-wizard-episode-table th {
  font-weight: 600;
  color: #555;
  background: #f7f9fc;
}

.stage-wizard-episode-table td select,
.stage-wizard-episode-table td textarea {
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #c9d4e0;
  border-radius: 4px;
  box-sizing: border-box;
}

.stage-wizard-episode-table td.episode-position {
  width: 48px;
  font-weight: 600;
  color: #6c5ce7;
  text-align: center;
}

.stage-wizard-episode-progress {
  margin: 8px 0 16px;
  padding: 8px 12px;
  font-size: 14px;
  color: #1a1a1a;
  background: #f2f6fb;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────────
 * Phase 1 Sprint 9 — Stage F 第1話 骨格 UI
 * 新規 3 class: .stage-wizard-opening-textarea / .stage-wizard-opening-counter /
 *                .stage-wizard-complete-banner
 * font-size ≥ 14px (frontend.md 準拠)
 * min 44x44px (ボタン / select は既存 .stage-wizard-save / .stage-wizard-field 再利用)
 * ───────────────────────────────────────────────────────────────── */

.stage-wizard-opening-textarea {
  width: 100%;
  min-height: 300px;
  max-width: 100%;
  padding: 12px;
  font-size: 14px;
  line-height: 1.7;
  border: 1px solid #c9d4e0;
  border-radius: 4px;
  box-sizing: border-box;
  resize: vertical;
}

.stage-wizard-opening-counter {
  margin: 6px 0 14px;
  padding: 4px 8px;
  font-size: 14px;
  text-align: right;
  color: #555;
  background: transparent;
  min-width: 44px;
}

.stage-wizard-opening-counter.stage-f-count-orange {
  color: #c98a00;
  font-weight: 600;
}

.stage-wizard-opening-counter.stage-f-count-green {
  color: #0a7a3a;
  font-weight: 600;
}

.stage-wizard-opening-counter.stage-f-count-red {
  color: #c0392b;
  font-weight: 600;
}

.stage-wizard-complete-banner {
  margin: 18px 0 12px;
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.7;
  color: #1a4d1a;
  background: #e7f7ea;
  border: 1px solid #8dc79a;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}
