/* 全体レイアウト */
body {
  margin: 0;
  padding: 0;
  background: #050514;
  color: #F9FAFB;
  font-family: "Segoe UI", "Hiragino Sans", sans-serif;
}

.page-bg {
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* セクション */
.section {
  padding: 40px 0;
}

/* ヒーロー */
.hero {
  padding: 60px 0 40px;
  background: radial-gradient(circle at top, #7C3AED, #050514);
  text-align: center;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 10px;
  color: #FEF3C7;
  text-shadow: 0 0 14px rgba(252, 211, 77, 0.8);
}

.hero p {
  font-size: 1.1rem;
  color: #E5E7EB;
}

/* タブ */
#series-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 5, 20, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 0 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 2px 0;
}

.tab {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: #111827;
  color: #E5E7EB;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  background: #1F2937;
  transform: translateY(-1px);
}

.tab.active {
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #111827;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}

/* タブパネル */
.tab-panel.hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.tab-panel {
  opacity: 1;
  transition: opacity 0.3s ease;
}


/* 見出し */
.section h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: #FBBF24;
  text-align: center;
}

.section h3 {
  font-size: 1.3rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: #E5E7EB;
  text-align: center;
}

/* セクションヘッダ + 表示ボタン */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.toggle-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  background: #1F2937;
  color: #E5E7EB;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.toggle-btn:hover {
  background: #374151;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.6);
}

/* トグルボディ */
.toggle-body {
  max-width: 1100px;
  margin: 0 auto;
}

.toggle-body.collapsed {
  display: none;
}

/* 目次 */
.toc-list {
  list-style: none;
  padding-left: 0;
  text-align: center;
}

.toc-list li {
  margin: 6px 0;
}

.toc-list a {
  color: #A5B4FC;
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

/* ランキングカード（横3枚・縦長） */
.ranking-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.ranking-card {
  background: #0B1120;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.7);
  box-shadow: 0 8px 22px rgba(0,0,0,0.75);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.rank-badge {
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: bold;
  color: #111827;
  background: linear-gradient(135deg, #FBBF24, #F97316);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 8px;
}

.ranking-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
}

.ranking-series {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 6px;
  color: #E5E7EB;
}

.ranking-meta {
  font-size: 0.9rem;
  color: #D1D5DB;
}

.ranking-meta-line {
  margin-bottom: 2px;
}

/* クリック可能（シリーズ内TOP3） */
.ranking-card.clickable {
  cursor: pointer;
}

/* シリーズ統計カード */
.stat-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.stat-card {
  background: #0B1120;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.7);
  box-shadow: 0 6px 18px rgba(0,0,0,0.75);
  padding: 16px;
  min-width: 220px;
  flex: 1;
  max-width: 260px;
}

.stat-card-wide {
  flex-basis: 100%;
  max-width: 560px;
}

.stat-label {
  font-size: 0.95rem;
  color: #9CA3AF;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1.3;
}

/* まとめカード */
.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.summary-card {
  background: #0B1120;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.7);
  box-shadow: 0 6px 18px rgba(0,0,0,0.75);
  padding: 18px;
  flex: 1;
  min-width: 220px;
  max-width: 260px;
}

.summary-title {
  font-size: 1rem;
  color: #9CA3AF;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1.3;
}

/* グラフ */
.chart-block {
  margin-top: 20px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.chart-block canvas {
  background: #020617;
  border-radius: 12px;
  padding: 10px;
}

/* スクロールアニメーション */
.fade-slide {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-slide.show {
  opacity: 1;
  transform: translateY(0);
}

/* ボワン表示アニメ */
.blow {
  animation: blow 0.35s ease-out;
}

@keyframes blow {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  80% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* レスポンシブ */
@media (max-width: 1000px) {
  .ranking-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .ranking-cards {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .section-header {
    flex-direction: column;
  }
}

/* ▼ 中央揃え表示ボタン */
.toggle-center {
  text-align: center;
  margin: 8px 0 16px;
}
.toggle-center .toggle-btn {
  display: inline-block;
  margin: 0 auto;
}

/* ▼ グラフフェードイン */
.graph-body {
  opacity: 0;
  transition: opacity 0.8s ease;
  height: auto; /* collapse禁止：Chart.js対策 */
}

.fade-graph {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.fade-graph.show {
  opacity: 1;
}

.hidden-graph {
  opacity: 0;
}

.hidden-graph.show-graph {
  opacity: 1;
}

.back-btn {
  position: fixed;
  top: 16px;
  left: 16px;

  padding: 10px 16px;
  font-size: 16px;
  font-weight: bold;

  color: #ffffff;
  text-decoration: none;

  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  backdrop-filter: blur(6px);

  transition: all 0.25s ease;
  z-index: 9999; /* 何があっても前面 */
}

.back-btn:hover {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-3px);
}


