/* ================================================================
   コード確認・修正ページ — music-tools plugin （ダークテーマ）
   ================================================================ */

.crv-wrap {
  font-family: sans-serif;
  color: #e0e0e0;
  background: #111;
  box-sizing: border-box;
}
.crv-wrap *, .crv-wrap *::before, .crv-wrap *::after { box-sizing: inherit; }

/* ── ヘッダー ── */
.crv-header {
  background: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
}
.crv-title {
  font-size: 15px;
  margin: 0;
  color: #fff;
  flex: 1;
}
.crv-stats {
  font-size: 13px;
  color: #888;
}

/* ── セクション（JSONファイルごと）── */
.crv-section { border-bottom: 1px solid #222; }
.crv-section-header {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #ccc;
  background: #181818;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.crv-section-header:hover { background: #1e1e1e; }
.crv-section-arrow { font-size: 10px; transition: transform 0.2s; }
.crv-section.open .crv-section-arrow { transform: rotate(90deg); }
.crv-section-body { display: none; padding: 12px 16px 20px; }
.crv-section.open .crv-section-body { display: block; }
.crv-btn-dl {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #252525;
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}
.crv-btn-dl:hover { background: #3a3a3a; color: #fff; }

/* ── キーグループ ── */
.crv-key-wrap { margin-bottom: 20px; }
.crv-key-label {
  font-size: 13px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #2a2a2a;
}

/* ── カードグリッド ── */
.crv-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.crv-card {
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 8px 8px 6px;
  text-align: center;
  position: relative;
  transition: border-color 0.15s;
}
.crv-card:hover { border-color: #444; }
.crv-card-label {
  font-size: 10px;
  color: #666;
  margin-bottom: 4px;
  white-space: nowrap;
}
.crv-card-diagram svg { display: block; }
.crv-fixed-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
}

/* ── カードフッター ── */
.crv-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}
.crv-btn-play {
  padding: 3px 7px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #252525;
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.crv-btn-play:hover { background: #333; color: #fff; }
.crv-btn-edit {
  padding: 3px 8px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #252525;
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s;
}
.crv-btn-edit:hover { background: #333; color: #fff; }
.crv-ok-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #666;
  cursor: pointer;
}
.crv-ok-label:has(.crv-ok-check:checked) { color: #27ae60; }

/* ── モーダル ── */
#crv-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}
#crv-modal.open { display: flex; }
.crv-modal-box {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  margin: auto;
}
.crv-modal-title {
  font-size: 16px;
  color: #fff;
  margin: 0 0 16px;
  text-align: center;
}

/* ── 開始フレット ── */
.crv-startfret-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #888;
}
.crv-sf-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #2a2a2a;
  color: #ccc;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.1s;
}
.crv-sf-btn:hover { background: #3a3a3a; }
#crv-sf-val {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  min-width: 24px;
  text-align: center;
}

/* ── 編集ダイアグラム ── */
.crv-edit-diagram {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
}

/* ── バレー設定 ── */
.crv-barre-section {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.crv-barre-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  margin-bottom: 0;
}
.crv-barre-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.crv-barre-inputs label {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
}
.crv-barre-inputs input[type="number"] {
  width: 52px;
  padding: 4px 6px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 13px;
}

/* ── モーダルアクション ── */
.crv-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.crv-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
}
.crv-btn-save         { background: #e74c3c; color: #fff; }
.crv-btn-save:hover   { background: #c0392b; }
.crv-btn-save:disabled { background: #555; cursor: default; }
.crv-btn-cancel       { background: #2a2a2a; color: #888; }
.crv-btn-cancel:hover { background: #3a3a3a; }

/* ── ウェルカムモーダル ── */
.crv-welcome-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.crv-welcome-overlay.open { display: flex; }
.crv-welcome-box {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}
.crv-welcome-title {
  font-size: 18px;
  color: #fff;
  margin: 0 0 18px;
  text-align: center;
}
.crv-welcome-body {
  font-size: 14px;
  color: #ccc;
  line-height: 1.75;
  margin-bottom: 22px;
}
.crv-welcome-body p { margin: 0 0 10px; }
.crv-welcome-body p:last-child { margin-bottom: 0; }
.crv-welcome-body strong { color: #e74c3c; }
.crv-welcome-ok {
  display: block;
  width: 100%;
  background: #e74c3c;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
}
.crv-welcome-ok:hover { background: #c0392b; }

/* ── ローディング ── */
.crv-loading {
  padding: 48px;
  text-align: center;
  color: #666;
  font-size: 14px;
}
