/* ===================================
   Layout — UI リデザイン（v2統合済み）
   =================================== */

/* =====================
   1. タイトル「はじめる」呼吸アニメーション
   ===================== */
#btn-new-game {
  min-width: 240px;
  padding: 14px 48px;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  animation: v2-pulse-glow 2.5s ease-in-out infinite;
}

@keyframes v2-pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(233, 69, 96, 0.3); }
  50% { box-shadow: 0 0 28px rgba(233, 69, 96, 0.6), 0 0 60px rgba(233, 69, 96, 0.15); }
}

/* 「つづきから」をテキストリンク風に */
#btn-load-game {
  background: transparent;
  border: none;
  color: var(--color-text-dim);
  font-size: 0.9rem;
  min-width: auto;
  padding: 8px 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#btn-load-game:hover {
  color: var(--color-text);
}

/* =====================
   2. タイトル画面パーティクル
   ===================== */
.v2-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.v2-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.6) 0%, transparent 70%);
  animation: v2-float linear infinite;
  opacity: 0;
}

@keyframes v2-float {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) translateX(var(--drift, 20px));
  }
}

/* =====================
   3. シナリオカード サムネイル
   ===================== */
.scenario-item {
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.scenario-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.scenario-item.selected {
  transform: translateY(-2px);
}

.scenario-thumbnail {
  width: 100%;
  height: 100px;
  overflow: hidden;
  position: relative;
}

.scenario-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.scenario-item:hover .scenario-thumbnail img {
  transform: scale(1.08);
}

/* サムネイル下部のグラデーション */
.scenario-thumbnail::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

.scenario-item .scenario-body {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* =====================
   4. 画面遷移アニメーション
   ===================== */
.screen.v2-exit {
  animation: v2-screen-exit 0.25s ease forwards;
  pointer-events: none;
}

.screen.v2-enter {
  animation: v2-screen-enter 0.3s ease forwards;
}

@keyframes v2-screen-exit {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

@keyframes v2-screen-enter {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 戻る方向のアニメーション */
.screen.v2-exit-back {
  animation: v2-screen-exit-back 0.25s ease forwards;
  pointer-events: none;
}

.screen.v2-enter-back {
  animation: v2-screen-enter-back 0.3s ease forwards;
}

@keyframes v2-screen-exit-back {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

@keyframes v2-screen-enter-back {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* タイトル→プレイ系の暗転遷移 */
.screen.v2-exit-fade {
  animation: v2-screen-fade-out 0.4s ease forwards;
  pointer-events: none;
}

.screen.v2-enter-fade {
  animation: v2-screen-fade-in 0.5s ease forwards;
}

@keyframes v2-screen-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes v2-screen-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =====================
   5. モーダル登場アニメーション
   ===================== */
.modal:not([hidden]) {
  animation: v2-overlay-in 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal:not([hidden]) .modal-content {
  animation: v2-modal-scale-in 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes v2-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes v2-modal-scale-in {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =====================
   6. 選択肢 staggered スライドイン
   ===================== */
.choice-btn {
  opacity: 0;
  animation: v2-choice-slide-in 0.3s ease forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes v2-choice-slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 選択肢の番号バッジ */
.choice-btn {
  padding-left: 40px;
  position: relative;
}

.choice-btn::before {
  content: attr(data-index);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-text-dim);
  line-height: 22px;
  text-align: center;
}

/* 選択肢のホバー改善 */
.choice-btn:hover {
  transform: translateX(4px);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.08);
}

/* =====================
   7. パーティプレビュー順次登場
   ===================== */
.character-card {
  opacity: 0;
  animation: v2-card-appear 0.45s ease forwards;
  animation-delay: calc(var(--i, 0) * 150ms);
}

@keyframes v2-card-appear {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* カードホバー */
.character-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* =====================
   8. ボタンクリック scaleフィードバック
   ===================== */
.btn:active:not(:disabled) {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}

.choice-btn:active {
  transform: scale(0.97) translateX(4px);
}

/* =====================
   追加: シナリオパネルの幅拡張
   ===================== */
.scenario-panel {
  max-width: 960px;
}

/* =====================
   追加: タイトル画面の微調整
   ===================== */
.title-container {
  position: relative;
  z-index: 2;
}

.title-menu {
  gap: 8px;
}

/* =====================
   9. プレイ画面キャラ立ち絵バー
   ===================== */
.play-portraits {
  position: absolute;
  top: 70px;
  left: 0;
  right: 60px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  z-index: 1;
  pointer-events: none;
  height: 130px;
}

.play-portrait {
  width: 80px;
  max-height: 130px;
  object-fit: contain;
  object-position: bottom;
  filter: brightness(0.65) saturate(0.9);
  transition: filter 0.4s ease, transform 0.4s ease;
  flex-shrink: 1;
}

.play-portrait.speaking {
  filter: brightness(1) saturate(1);
  transform: translateY(-4px) scale(1.03);
}

/* =====================
   10. VN風テキストウィンドウ
   ===================== */
.play-background {
  filter: brightness(0.55);
}

#screen-play.screen.active {
  align-items: stretch;
  justify-content: stretch;
}

.play-layout {
  padding: 0;
  width: 100%;
}

.objective-widget {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(212, 168, 67, 0.2);
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 80%, transparent 100%);
  padding: 8px 60px 8px 16px;
  margin: 0;
}

.dialogue-area {
  position: absolute;
  top: 200px;
  bottom: 78px;
  left: 0;
  right: 0;
  height: auto;
  max-height: none;
  flex: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.5) 8%,
    rgba(0, 0, 0, 0.78) 100%
  );
  padding: 32px 16px 12px;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 8%,
    black 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 8%,
    black 100%
  );
  z-index: 2;
}

.chat-input-area {
  position: absolute;
  bottom: 0;
  left: 56px;
  right: 0;
  z-index: 4;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
}

.character-select-bar {
  position: absolute;
  bottom: 46px;
  left: 56px;
  right: 0;
  z-index: 4;
  padding: 4px 12px;
  pointer-events: auto;
}

.replay-bar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
}

.choice-panel {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 90%;
  max-width: 600px;
  background: rgba(15, 52, 96, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* v2: 選択肢パネル最小化トグルバー */
.v2-choice-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  cursor: pointer;
  background: rgba(212, 168, 67, 0.15);
  border-bottom: 1px solid rgba(212, 168, 67, 0.2);
  user-select: none;
  transition: background 0.2s;
}
.v2-choice-toggle:hover {
  background: rgba(212, 168, 67, 0.25);
}
.v2-choice-toggle-label {
  font-size: 0.8rem;
  color: var(--color-accent-gold, #d4a843);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.v2-choice-toggle-arrow {
  font-size: 0.7rem;
  color: var(--color-accent-gold, #d4a843);
  transition: transform 0.3s ease;
}

/* v2: 最小化状態 - 選択肢ボタンを非表示 */
.choice-panel.v2-minimized .choice-btn {
  display: none;
}
.choice-panel.v2-minimized {
  width: auto;
  min-width: 160px;
  max-width: 200px;
}
.choice-panel.v2-minimized .v2-choice-toggle {
  border-bottom: none;
}

/* =====================
   11. 絵文字→テキスト/SVG置換 (CSS部分)
   ===================== */
/* インベントリの📦をCSS図形に */
.inventory-item::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-accent-gold);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ヘルプの💡をCSS丸に */
.help-tips li::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--color-accent-gold);
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  left: 2px;
  top: 10px;
}

/* 感情表示: 絵文字を非表示にしてテキストラベルに（JS側で制御） */

/* =====================
   13. ツールバー縦配置
   ===================== */
.play-toolbar {
  flex-direction: column;
  top: 72px;
  right: 8px;
  gap: 4px;
  z-index: 4;
}

.play-toolbar .btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s, background 0.15s;
  position: relative;
  font-size: 0;
}

.play-toolbar .btn-icon:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}

/* SVGアイコン in toolbar */
.play-toolbar .btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-text);
  fill: none;
  stroke-width: 1.5;
}

/* ツールチップ */
.play-toolbar .btn-icon::after {
  content: attr(title);
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: var(--color-text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.play-toolbar .btn-icon:hover::after {
  opacity: 1;
  transition-delay: 0.5s;
}

/* デバッグボタン: ?debug=1のみ表示 */
.play-toolbar #btn-debug {
  display: none;
}

html[data-debug="1"] .play-toolbar #btn-debug {
  display: flex;
}

/* =====================
   14. エンディング タイプライター + スローズーム
   ===================== */
#ending-background {
  animation: v2-slow-zoom 30s ease-in-out infinite alternate;
}

@keyframes v2-slow-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.ending-summary.v2-typewriter {
  animation: none;
  opacity: 1;
}

.ending-summary .v2-typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--color-accent-gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: v2-cursor-blink 0.7s step-end infinite;
}

@keyframes v2-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* エンディング パーティ集合表示 */
.ending-party-portraits {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  opacity: 0;
  animation: endingFadeIn 1s ease forwards;
  animation-delay: 0.5s;
}

.ending-party-portraits img {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(212, 168, 67, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* =====================
   15. パーティ情報モーダル タブUI
   ===================== */
.v2-party-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.v2-party-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.v2-party-tab:hover {
  color: var(--color-text);
}

.v2-party-tab.active {
  color: var(--color-accent-gold);
  border-bottom-color: var(--color-accent-gold);
}

.v2-party-tab-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  vertical-align: middle;
}

/* Tab content: show single character large */
.v2-party-tab-content .party-info-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.v2-party-tab-content .party-info-card .info-portrait {
  width: 160px;
  height: 240px;
  margin-bottom: 12px;
}

.v2-party-tab-content .party-info-card .info-details {
  text-align: left;
  width: 100%;
}

/* =====================
   16. LLM設定折り畳み
   ===================== */
.v2-llm-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.v2-llm-details summary {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--color-text-dim);
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-llm-details summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid var(--color-text-dim);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s;
}

.v2-llm-details[open] summary::before {
  transform: rotate(90deg);
}

.v2-llm-details summary::-webkit-details-marker {
  display: none;
}

.v2-llm-details .v2-llm-content {
  padding: 0 14px 14px;
}

/* =====================
   17. レスポンシブ強化
   ===================== */
@media (max-width: 1024px) {
  .play-portrait {
    width: 60px;
    max-height: 100px;
  }
  .play-portraits {
    height: 100px;
  }
  .dialogue-area {
    top: 170px;
  }
  .scenario-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .play-portraits {
    display: none;
  }
  .dialogue-area {
    height: 55vh;
    max-height: none;
  }
  .objective-widget {
    font-size: 0.85rem;
  }
  .play-toolbar {
    flex-direction: row;
    top: auto;
    bottom: 48px;
    right: 8px;
  }
  .play-toolbar .btn-icon::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .scenario-list {
    grid-template-columns: 1fr;
  }
  .choice-panel {
    width: 95%;
    flex-direction: column;
  }
  .ending-party-portraits img {
    width: 50px;
    height: 75px;
  }
}

/* =====================
   18. Google Fonts (Noto Serif JP)
   ===================== */
/* フォント適用はindex.htmlの<link>で読み込み後に有効 */
.game-title,
.panel h2,
.ending-title,
.beat-transition-name,
.modal-content h3 {
  font-family: 'Noto Serif JP', var(--font-title);
}

/* =====================
   追加: マイクロインタラクション
   ===================== */
/* 入力フォーカスグロー */
.text-input:focus,
.select-input:focus,
#chat-input:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.25);
}

/* カード選択チェックマーク */
.scenario-item.selected::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--color-accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.scenario-item.selected::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 18px;
  width: 6px;
  height: 10px;
  border: solid var(--color-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  z-index: 3;
}

.scenario-item {
  position: relative;
}

/* スライダーフィードバック */
#ai-count-display {
  display: inline-block;
  min-width: 2em;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--color-accent-gold);
  transition: transform 0.15s;
}

#ai-count:active + #ai-count-display {
  transform: scale(1.2);
}

/* =====================
   追加: モーダル×閉じるボタン
   ===================== */
.modal-content {
  position: relative;
}

.v2-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}

.v2-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

/* =====================
   追加: タイトル画面パララックス
   ===================== */
.title-slideshow {
  transition: transform 0.3s ease-out;
  will-change: transform;
}

/* =====================
   追加: パーティ設定レイアウト
   ===================== */
.player-profile-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* アイコン選択行 */
.player-avatar-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.icon-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.icon-preset-btn {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  overflow: visible;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.icon-preset-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.icon-preset-btn.selected {
  border-color: var(--color-accent-gold);
  background: rgba(212, 168, 67, 0.1);
}

.icon-preset-btn img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  display: block;
}

.icon-preset-btn .icon-label {
  font-size: 0.7rem;
  color: var(--color-text-dim);
  line-height: 1;
}

.icon-preset-btn.selected .icon-label {
  color: var(--color-accent-gold);
}

.icon-preset-btn .icon-emoji-fallback {
  display: none;
}

/* フォーム2カラムグリッド */
.player-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

@media (max-width: 600px) {
  .player-form-grid {
    grid-template-columns: 1fr;
  }
}

/* プレビュー画像（JS挿入、アイコン選択の横に表示） */
.v2-player-preview {
  display: none;
}

/* =====================
   追加: パーティプレビュー改善
   ===================== */
.party-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.character-card {
  width: 180px;
  flex-shrink: 0;
}

.seed-display {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.7;
  font-family: monospace;
}

.character-card .char-portrait {
  max-width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  transition: transform 0.3s ease;
}

.character-card:hover .char-portrait {
  transform: scale(1.04);
}

/* 性格ピルバッジ */
.v2-personality-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
}

.v2-personality-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(212, 168, 67, 0.15);
  color: var(--color-accent-gold);
  border: 1px solid rgba(212, 168, 67, 0.25);
}

/* 「冒険に出発」ボタン pulse glow */
#btn-start-game {
  min-width: 200px;
  padding: 12px 36px;
  font-size: 1.05rem;
  animation: v2-pulse-glow 2.5s ease-in-out infinite;
}

/* =====================
   追加: タイトル文字装飾（アウトライン+グロー）
   ===================== */
.game-title {
  -webkit-text-stroke: 0.5px rgba(212, 168, 67, 0.6);
  text-shadow:
    0 0 20px rgba(212, 168, 67, 0.3),
    0 2px 8px rgba(212, 168, 67, 0.4),
    0 0 60px rgba(212, 168, 67, 0.1);
}

/* =====================
   追加: スライダー値色変化フィードバック
   ===================== */
#ai-count:active ~ #ai-count-display,
#ai-count:focus ~ #ai-count-display {
  color: var(--color-primary);
  transform: scale(1.2);
  transition: transform 0.15s, color 0.15s;
}

/* =====================
   追加: シナリオ空状態表示
   ===================== */
.v2-scenario-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-dim);
}

.v2-scenario-empty-icon {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
}

.v2-scenario-empty-text {
  font-size: 0.95rem;
}

/* =====================
   LLMプロバイダ選択UI
   ===================== */
.llm-provider-fields {
  margin-top: 8px;
}

.llm-provider-fields[hidden] {
  display: none;
}

.cost-note {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  margin: 4px 0 8px;
  padding-left: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

/* APIキー入力欄 */
input[type="password"].text-input {
  font-family: monospace;
  letter-spacing: 0.05em;
}
