/**
 * premium-analysis.css
 * プレミアム詳細分析ページ専用スタイル
 * Version: 1.0.0
 * 作成日: 2025-11-19
 *
 * 対応ページ: premium-analysis.html
 * 対応タブ: Tab 1-4（音程精度・エラー分析・練習プラン・成長記録）
 *
 * 注意事項:
 * - Tab 1（音程精度分析）は主にbase.cssの共通スタイルを使用
 * - Tab 4にはモード別分析が含まれる（将来10モード対応予定）
 * - 脳内処理パターン分析は実験的機能として含まれる
 */

/* ================================================================
   フィルターUI（モードセレクト）
   ================================================================ */

/* フィルターサマリーバー */
.premium-filter-section {
  margin-bottom: 1.5rem;
}

.filter-summary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-summary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-summary-content {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.filter-summary-icon {
  width: 20px;
  height: 20px;
  color: #a855f7;
  flex-shrink: 0;
}

.filter-summary-text {
  font-size: 0.95rem;
  font-weight: 600;
}

.filter-summary-change {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.3);
  border: 1px solid rgba(168, 85, 247, 0.5);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  flex-shrink: 0;
}

.filter-change-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* フィルターモーダル */
.filter-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.filter-modal {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.filter-modal-header {
  padding: 1.25rem 1.5rem 0;
}

.filter-modal-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.filter-modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select {
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.filter-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.filter-select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.filter-select option {
  background: #1e293b;
  color: white;
  padding: 0.5rem;
}

.filter-modal-footer {
  padding: 0 1.5rem 1.25rem;
}

.filter-modal-confirm-btn {
  width: 100%;
}

/* ================================================================
   タブナビゲーション
   ================================================================ */

/* データ蓄積の目安ノート */
.analysis-data-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
}

.tab-navigation {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 0.5rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
  background: rgba(139, 92, 246, 0.25);
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.tab-button i {
  width: 16px;
  height: 16px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

/* タブ選択ドロップダウン（モバイル用） */
.tab-select-wrapper {
  display: none;
  position: relative;
  margin-bottom: 1rem;
}

.tab-select-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #a78bfa;
  pointer-events: none;
  z-index: 1;
}

.tab-select {
  width: 100%;
  padding: 1rem 2.75rem 1rem 2.75rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e0d4fc' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.tab-select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.tab-select option {
  background: #1e293b;
  color: white;
  padding: 0.5rem;
}

/* モバイル対応（プレミアム分析タブ専用） */
@media (max-width: 768px) {
  .tab-navigation {
    display: none;
  }

  .tab-select-wrapper {
    display: block;
  }
}

/* ================================================================
   Tab 2: エラーパターン分析
   ================================================================ */

#premium-content-section .chart-container {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  height: auto;
}

.chart-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.chart-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#f59e0b 0% var(--sharp-percent), #60a5fa var(--sharp-percent) 100%);
}

.chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #3e1a72;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.chart-percentage {
  color: #f59e0b;
  font-size: 2rem;
  font-weight: 700;
}

.chart-label {
  color: #cbd5e1;
  font-size: 0.875rem;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-color.sharp {
  background: #f59e0b;
}

.legend-color.flat {
  background: #60a5fa;
}

.legend-text {
  color: #cbd5e1;
  font-size: 0.875rem;
}

.expansion-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.expansion-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.expansion-interval {
  color: white;
  font-weight: 600;
  min-width: 60px;
  font-size: 1rem;
}

.expansion-tendency-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.expansion-tendency {
  font-weight: 600;
}

.expansion-tendency.expand {
  color: #ef4444;
}

.expansion-tendency.contract {
  color: #3b82f6;
}

.expansion-tendency.accurate {
  color: #10b981;
}

.expansion-semitones {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* ================================================================
   Tab 3: 練習プラン（脳内ピアノ理論ベース）
   ================================================================ */

/* Layer 1: 脳内ピアノ基礎カード */
.bp-intro-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.bp-intro-desc strong {
  color: white;
}

.ab-blocks {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.ab-block {
  flex: 1;
  padding: 0.875rem 1rem;
  text-align: center;
}

.ab-block--a {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-right: none;
  border-radius: 10px 0 0 10px;
}

.ab-block--b {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 0 10px 10px 0;
}

.ab-divider {
  display: flex;
  align-items: center;
  padding: 0 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.ab-block-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.ab-block-notes {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.35rem;
}

.ab-block-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.bp-tuning-fork-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  margin: 0;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Layer 2: 共鳴ステージカード */
.stage-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stage-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid;
}

.stage-badge-num {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.stage-badge-label {
  font-size: 0.5rem;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.stage-badge--1 { border-color: #fca5a5; color: #fca5a5; }
.stage-badge--2 { border-color: #93c5fd; color: #93c5fd; }
.stage-badge--3 { border-color: #fbbf24; color: #fbbf24; }
.stage-badge--4 { border-color: #6ee7b7; color: #6ee7b7; }

.stage-info { flex: 1; }

.stage-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.4rem;
}

.stage-dots {
  display: flex;
  gap: 6px;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.stage-dot--active-1 { background: #fca5a5; }
.stage-dot--active-2 { background: #93c5fd; }
.stage-dot--active-3 { background: #fbbf24; }
.stage-dot--active-4 { background: #6ee7b7; }

.stage-message {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.stage-tip {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  line-height: 1.6;
  margin: 0;
}

/* Layer 2: 共鳴ステージカード */
#brain-stage-card {
  margin-top: 1rem;
}

/* Layer 3: 空カード（アドバイスなし） */
.practice-advice-empty {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.2);
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Layer 3: データ不足メッセージ（共鳴ステージ上部バナー） */
.practice-stage-pending {
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* Layer 3: 個別アドバイスカード */
.practice-advice-card {
  padding: 1.25rem;
  border-radius: 12px;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.practice-advice-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.practice-advice-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin: 0;
}

.practice-advice-body {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.practice-in-app {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  line-height: 1.6;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

.practice-in-app-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
}



/* ================================================================
   脳内処理パターン分析スタイル（実験的機能）
   ================================================================ */

.brain-processing-section {
  margin-top: 1.5rem;
}

.brain-processing-intro {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  text-align: center;
}

.brain-processing-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brain-group-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brain-group-card--weakness {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.brain-group-title {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brain-group-notes {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.brain-group-avg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.brain-group-icon {
  display: flex;
  align-items: center;
}

.brain-group-avg-label {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.brain-group-avg-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.brain-group-count {
  color: #cbd5e1;
  font-size: 0.85rem;
  text-align: center;
}

.brain-difficulty-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brain-difficulty-title {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brain-difficulty-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.brain-difficulty-analysis {
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

.brain-notes-detail-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brain-notes-detail-title {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brain-notes-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  margin-bottom: 0;
}

.brain-notes-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.brain-notes-toggle-btn span {
  flex: 1;
}

.brain-notes-detail-content {
  margin-top: 1rem;
}

.brain-notes-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brain-notes-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brain-notes-detail-note {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 40px;
}

.brain-notes-detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

/* ================================================================
   レスポンシブ対応
   ================================================================ */

@media (max-width: 768px) {
  .brain-processing-comparison {
    grid-template-columns: 1fr;
  }


}

/* ================================================================
   脳バランス分析（🧠アイコン・A-B精度差メーター）
   ================================================================ */

/* 🧠絵文字アイコン */
.brain-emoji-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

/* 脳バランスメーター */
.brain-balance-meter {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 12px;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brain-balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.brain-balance-label {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
}

.brain-balance-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

/* バランススケール */
.brain-balance-scale {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-top: 1.25rem; /* 三角インジケーター用スペース */
}

.brain-balance-scale-label {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 500;
  min-width: 60px;
}

.brain-balance-scale-label.left {
  text-align: right;
}

.brain-balance-scale-label.right {
  text-align: left;
}

/* バランスバー */
.brain-balance-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  position: relative;
}

/* 中心縦線（バー上下を貫通） */
.brain-balance-bar::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -10px;
  width: 2px;
  height: 26px;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-50%);
}

/* バランスインジケーター（下向き三角 ▼） */
.brain-balance-indicator {
  position: absolute;
  top: -18px;
  width: 14px;
  height: 12px;
  background: white;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
  transition: left 0.3s ease;
  filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.4));
}

/* バランスコメント */
.brain-balance-comment {
  color: #cbd5e1;
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.brain-balance-comment--pending {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

/* データ収集中ノート（月間成長比較等） */
.data-pending-note {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* バランス状態に応じた色分け（4ランク統一） */
.brain-balance-value.rank-excellent {
  color: #fbbf24;
}

.brain-balance-value.rank-good {
  color: #86efac;
}

.brain-balance-value.rank-pass {
  color: #93c5fd;
}

.brain-balance-value.rank-practice {
  color: #f87171;
}

/* インジケーター三角のランク色 */
.brain-balance-indicator.rank-excellent { background: #fbbf24; }
.brain-balance-indicator.rank-good      { background: #86efac; }
.brain-balance-indicator.rank-pass      { background: #93c5fd; }
.brain-balance-indicator.rank-practice  { background: #f87171; }

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .brain-emoji-icon {
    font-size: 1.25rem;
  }

  .brain-balance-meter {
    padding: 1rem;
  }

  .brain-balance-scale-label {
    min-width: 50px;
    font-size: 0.9rem;
  }

  .brain-balance-value {
    font-size: 1.1rem;
  }
}

/* フィルター状態バッジ（セクション見出し横） */
.filter-context-badge {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  font-weight: 400;
}

/* 平均音程精度のモードタイトル（総合評価と同レイアウト） */
.accuracy-mode-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}

.accuracy-period-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  margin: 0 0 0.25rem;
}

/* ================================================================
   Tab 1: 音程精度 - 音程間隔別カード
   ================================================================ */

/* カードコンテナ（#interval-accuracy-list用） */
#interval-accuracy-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 各音程のカード */
.interval-accuracy-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.875rem 1rem;
}

/* カードヘッダー（階名と度数） */
.interval-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.interval-note-name {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
}

.interval-degree {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* カードボディ（上行/下行の行） */
.interval-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 上行/下行の各行 */
.interval-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.direction-label {
  color: #94a3b8;
  font-size: 0.8rem;
  min-width: 52px;
  flex-shrink: 0;
}

.interval-row .progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.interval-row .progress-fill-custom {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.accuracy-value {
  min-width: 60px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 500;
}

/* レスポンシブ対応（モバイル） */
@media (max-width: 480px) {
  .interval-accuracy-card {
    padding: 0.75rem;
  }

  .interval-note-name {
    font-size: 1rem;
  }

  .direction-label {
    font-size: 0.75rem;
    min-width: 48px;
  }

  .accuracy-value {
    min-width: 55px;
    font-size: 0.8rem;
  }
}


/* 弱点練習リンク（次期メジャーバージョンまで非表示） */
.interval-weakness-cta {
  display: none;
}

/* ================================================================
   脳バランス分析 - 上行/下行並列表示
   ================================================================ */

.brain-group-directions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 0.75rem 0;
}

.brain-direction-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brain-direction-item .direction-label {
  font-size: 1rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

.brain-direction-item .direction-label.ascending {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.brain-direction-item .direction-label.descending {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.brain-direction-value {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

/* ================================================================
   スケール度数別精度 - カードグリッド表示（PC横並び対応）
   ================================================================ */

/* グリッドコンテナ：PC で横並び */
.brain-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.brain-notes-card {
  min-width: 0;
}

/* 音階カード */
.brain-notes-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  text-align: center;
}

/* 音名（ド・レ・ミ…） */
.brain-notes-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.1rem;
}

/* 方向別行（アイコン + 値） */
.brain-notes-direction-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.brain-notes-direction-item .direction-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
}

.brain-notes-direction-item .direction-indicator.asc {
  color: #60a5fa;
}

.brain-notes-direction-item .direction-indicator.desc {
  color: #c084fc;
}

.brain-notes-detail-value {
  font-size: 1rem;
  font-weight: 600;
}

/* モバイル調整 */
@media (max-width: 480px) {
  .brain-notes-card {
    flex: 0 0 calc(33.333% - 0.44rem);
  }

  .brain-group-directions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .brain-direction-item {
    justify-content: center;
  }
}

/* 音階グリッド: モバイルは2列 */
@media (max-width: 768px) {
  .brain-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========================================
   Phase 4: 新規分析セクション
   ======================================== */

/* 4-1: 評価ラベル */
.accuracy-eval-label {
  text-align: center;
}

/* 4-2: 音程別シャープ/フラット偏り */
.interval-bias-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.interval-bias-label {
  color: #cbd5e1;
  font-size: 0.8rem;
  min-width: 4.5rem;
  flex-shrink: 0;
}

.interval-bias-bar-container {
  flex: 1;
  min-width: 0;
}

.interval-bias-bar-bg {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.interval-bias-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
  z-index: 1;
}

.interval-bias-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 6px;
  opacity: 0.8;
}

.interval-bias-value {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* Tab2: 音程別偏りバー（方向別色） */
.bias-bar--sharp { background: #f59e0b; }
.bias-bar--flat  { background: #3b82f6; }

/* ランク凡例（Tab1: 音程間隔別精度・脳バランス分析） */
.rank-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 0.75rem;
}

/* Tab4: TOP3改善/停滞カード */
.growth-card {
  position: relative;
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
}
.growth-card--improved {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.growth-card--mild {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.growth-card--severe {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.growth-card-rank {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  color: white;
  font-weight: 700;
  font-size: 1rem;
}
.growth-card-interval {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.growth-card-data {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.85);
}
.growth-card-improvement {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Tab4: 成長速度・壁検出 */
.growth-speed-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
}
.plateau-warning {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fbbf24;
}

/* Tab4: 連続正解ストリーク */
.streak-card {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
}
.streak-card--longest {
  background: rgba(245, 158, 11, 0.1);
}
.streak-card--recent {
  background: rgba(59, 130, 246, 0.1);
}
.streak-card-label {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}
.streak-card-label--longest { color: #f59e0b; }
.streak-card-label--recent  { color: #3b82f6; }
.streak-card-value {
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

/* Tab4: インラインスタイル代替クラス */
.monthly-improvement-value {
  font-weight: 600;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
}
.improvement-trend-icon {
  display: inline;
}
.tab4-sub-note {
  margin: 0;
}

/* ================================================================
   Tab 1: 誤差遷移グラフ
   ================================================================ */

.error-trend-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.error-trend-header {
  margin-bottom: 0.75rem;
}

.heading-no-margin {
  margin: 0;
}

.error-trend-description {
  margin-bottom: 1rem;
}

.error-trend-chart-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
}

.error-trend-chart-wrapper canvas {
  max-height: 240px;
}

.error-trend-ma-info {
  margin-top: 0.5rem;
  text-align: right;
}

/* 安定度サマリー（誤差遷移グラフ下） */
.stability-summary {
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.stability-summary-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.stability-summary-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.stability-summary-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stability-summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.stability-summary-status {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.stability-summary-guide {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

/* インライン凡例 */
.error-trend-legend-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

.error-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.error-trend-legend-line {
  width: 12px;
  height: 3px;
  display: inline-block;
  border-radius: 2px;
}

.error-trend-legend-line-white {
  background: rgba(255, 255, 255, 0.9);
}

.error-trend-legend-line-yellow {
  background: #fbbf24;
}

.error-trend-legend-line-green {
  background: #10b981;
}

.error-trend-legend-separator {
  margin: 0 0.25rem;
  color: #94a3b8;
}

/* 評価分布セクションのデータ量テキスト */
.distribution-data-count {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin: 0 0 0.75rem;
}

/* モバイル対応 */
@media (max-width: 480px) {
  .error-trend-legend-inline {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* 練習カレンダー */
.practice-calendar-wrapper {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.practice-calendar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.practice-calendar-info {
  font-size: 0.8rem;
  color: #e2e8f0;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.practice-calendar-days {
  color: #a78bfa;
  font-weight: 600;
}

.practice-calendar-legend-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0 0 0.5rem;
}

.practice-calendar-legend-row .practice-dot {
  margin: 0 1px;
}

.practice-calendar-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.practice-calendar-range-note {
  font-size: 0.8rem;
  font-weight: 400;
  color: #cbd5e1;
  margin-left: 0.5rem;
}

.practice-dot {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

.practice-dot-none {
  background: rgba(255, 255, 255, 0.22);
}

.practice-dot-once {
  background: #a78bfa;
}

.practice-dot-multi {
  background: #c4b5fd;
  box-shadow: 0 0 5px rgba(167, 139, 250, 0.6);
}

.practice-calendar-labels {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  gap: 0.3rem;
}

.practice-calendar-labels .label-sep {
  color: #64748b;
}


/* 平均音程精度カード：モバイルでもPCと同じ2remを維持（results.cssの1.5rem上書き） */
@media (max-width: 768px) {
  #tab-accuracy .stat-value-rank,
  #tab-accuracy .stat-value-rank.grade-value {
    font-size: 2rem;
  }
}

/* ⚠️警告セクション: モバイルでアイコンを上・テキストを下に縦並び */
@media (max-width: 480px) {
  .weakness-supplement-heading {
    flex-direction: column;
    gap: 0.4rem;
  }
}
