/* ─── ヘッダー ──────────────────────────────────────────────────── */
.ri-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #0a1628;
  border-bottom: 1px solid #2a3a5c;
}
.ri-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: #c8a84b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ri-back-btn {
  color: #7ab3ff;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.ri-back-btn:hover { text-decoration: underline; }

/* ─── 参照写真トグルボタン ──────────────────────────────────────── */
.photo-ref-toggle {
  padding: 5px 10px;
  background: #1a2a3a;
  border: 1px solid #3a4a6a;
  color: #7ab3ff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.photo-ref-toggle.hidden { display: none; }
.photo-ref-toggle:hover { border-color: #5a7aaa; }

/* ─── 参照写真エリア（デフォルト非表示、高さ auto・最大 40vh） ──── */
.photo-ref-area {
  background: #060e1e;
  border-bottom: 1px solid #1a2a4a;
  max-height: 40vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  padding: 4px;
}
.photo-ref-area.hidden { display: none; }
.photo-ref-img {
  max-height: calc(40vh - 8px);
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* ─── ステップインジケーター ────────────────────────────────────── */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: #0e1a35;
  flex-wrap: wrap;
}
.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #1e2e50;
  color: #556080;
  border: 2px solid #2a3a5c;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.step-dot.is-active { background: #c8a84b; color: #0a1628; border-color: #c8a84b; }
.step-dot.is-done   { background: #2a4a2a; color: #5a9a5a; border-color: #3a6a3a; }

/* ─── 案内文 ────────────────────────────────────────────────────── */
.step-guide {
  margin: 0;
  padding: 10px 16px;
  background: #0e1a35;
  color: #a0b8d0;
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 1px solid #1a2a4a;
  min-height: 40px;
}

/* ─── セクション ────────────────────────────────────────────────── */
.step-section { padding: 14px 16px; }
.step-section.hidden { display: none; }

/* ─── Step 1: 写真準備 ──────────────────────────────────────────── */
.photo-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.photo-upload-label {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  background: #2a4a7a;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.photo-upload-label input[type="file"] { display: none; }
.photo-upload-label:hover { background: #3a5a8a; }
.photo-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6a8090;
}
.skip-btn {
  background: none;
  border: 1px solid #3a4a6a;
  color: #7a9aba;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.skip-btn:hover { border-color: #6a8aaa; color: #9ab8d0; }

/* ─── Step 2〜7: ボード入力 ─────────────────────────────────────── */

/* マーク3ボタン */
.mark-input-bar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mark-input-bar.hidden { display: none; }
.mark-input-btn {
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.mark-o        { background: #0a2a0a; color: #90ee90; border-color: #2a5a2a; }
.mark-o.is-active   { background: #1a4a1a; border-color: #90ee90; box-shadow: 0 0 8px rgba(144,238,144,0.4); }
.mark-x        { background: #2a0a0a; color: #ee9090; border-color: #5a2a2a; }
.mark-x.is-active   { background: #4a1a1a; border-color: #ee9090; box-shadow: 0 0 8px rgba(238,144,144,0.4); }
.mark-clear    { background: #1a1a2a; color: #8090a8; border-color: #2a2a4a; }
.mark-clear.is-active { background: #2a2a3a; border-color: #6070a0; }

/* 位置補正バー */
.shift-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.shift-bar.hidden { display: none; }
.shift-label { font-size: 12px; color: #8090a8; white-space: nowrap; }
.shift-btn {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #2a3a5c;
  background: #1a2a3a;
  color: #c8d8e8;
  transition: background 0.15s;
}
.shift-btn:hover { background: #2a3a4a; border-color: #4a6a8a; }

/* 辺向きボタン */
.mode-bar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mode-bar.hidden { display: none; }
.orient-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #2a3a5c;
  color: #8090a8;
  background: #1a2a3a;
  transition: border-color 0.15s, color 0.15s;
}
.orient-btn.is-active { border-color: #c8a84b; color: #c8a84b; background: #1a1400; }
.orient-btn:hover:not(.is-active) { border-color: #4a5a7c; color: #a0b0c0; }

/* ボードスクロール（style.css の .board をそのまま使用） */
.board-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 入力画面のセルは白背景（紙ボードに合わせて視認性向上） */
#inputBoard .cell { background: #fff; color: #111; }

/* 修復済み傷跡（cut+tape 共存）: < 傷跡を表示 */
.scar-line {
  font-size: 15px;
  font-weight: 900;
  color: #3a7a8a;
  display: inline-block;
  line-height: 1;
}
#inputBoard .hole-healed .scar-line { font-size: 22px; }

/* テープ越しカット（hole=true AND taped=true）: ◀▶ を濃い色で */
#inputBoard .hole-over-tape .tri-left  { color: #1a5a6a; }
#inputBoard .hole-over-tape .tri-right { color: #0a2a4a; }

/* ─── 辺プレビュー（pointerdown 時の選択辺ハイライト） ──────────── */
.cell.tap-hint-h   { border-top:  4px solid rgba(200,168,75,0.9) !important; }
.cell.tap-hint-v   { border-left: 4px solid rgba(200,168,75,0.9) !important; }
.cell.tap-hint-none { background-color: rgba(80,80,80,0.15) !important; }

/* ─── Step 8: 確認・生成 ────────────────────────────────────────── */

.player-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; max-width: 360px; }
.form-label  { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8090a8; }
.form-label input,
.form-label select {
  padding: 7px 10px;
  border-radius: 5px;
  border: 1px solid #2a3a5c;
  background: #0e1a35;
  color: #c8d8e8;
  font-size: 14px;
}
.generate-btn {
  padding: 12px 28px;
  background: #c8a84b;
  color: #0a1628;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.generate-btn:hover { background: #e0c060; }

/* ─── ナビゲーション（sticky） ──────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0a1628;
  border-top: 1px solid #1a2a4a;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.nav-btn {
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #2a3a5c;
  background: #1a2a3a;
  color: #c8d8e8;
  transition: border-color 0.15s, background 0.15s;
}
.nav-btn:hover:not(:disabled) { border-color: #4a6a8a; background: #2a3a4a; }
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.nav-btn.hidden   { visibility: hidden; }
.step-nav-label   { font-size: 12px; color: #6a8a9a; text-align: center; }

/* ─── 自動認識ボタン ────────────────────────────────────────────── */
.recognize-btn {
  display: block;
  margin-top: 14px;
  padding: 10px 24px;
  background: #1a3a6a;
  border: 1px solid #3a6aaa;
  color: #7ab3ff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.recognize-btn:hover:not(:disabled) { background: #2a4a7a; }
.recognize-btn.hidden { display: none; }
.recognize-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.recognize-status { margin-top: 8px; font-size: 13px; color: #8090a8; }
.recognize-status.error { color: #ee9090; }
.recognize-status.hidden { display: none; }

/* ─── スマホ対応 ────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .step-dot        { width: 22px; height: 22px; font-size: 10px; }
  .mark-input-btn  { padding: 8px 12px; font-size: 13px; }
  .photo-choice-row { gap: 8px; }
}
