/* ===== 人物相関図 共通CSS ===== */
/* 全セレクタに #tepunChart 等のID or .cc-wrapper を必ず付ける */
/* テーマ(SWELL)との干渉を防ぐため、汎用タグへのスタイル指定は行わない */

.cc-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

/* Header */
.cc-wrapper .cc-header {
  text-align: center;
  margin-bottom: 12px;
}

.cc-wrapper .cc-header h2 {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #1a1a1a !important;
  letter-spacing: 0.5px !important;
  line-height: 1.4 !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}
.cc-wrapper .cc-header h2::before,
.cc-wrapper .cc-header h2::after { display: none !important; }

.cc-wrapper .cc-subtitle {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* Legend */
.cc-wrapper .cc-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.cc-wrapper .cc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #666;
}

.cc-wrapper .cc-legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
}

.cc-wrapper .cc-legend-line.dashed {
  height: 0;
  border-top: 3px dashed;
}

.cc-wrapper .cc-legend-ring {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid;
  background: transparent;
}

/* SVG */
.cc-wrapper .cc-canvas { position: relative; }

.cc-wrapper .cc-canvas svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: manipulation;
}

/* Nodes */
.cc-node { cursor: pointer; transition: opacity 0.3s; }
.cc-node.dimmed { opacity: 0.2; }
.cc-node.active .cc-node-glow { opacity: 0.9 !important; stroke-width: 3 !important; }

.cc-node-photo {
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
  transition: filter 0.3s;
}

.cc-node-initial {
  font-size: 28px;
  font-weight: 900;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.cc-node-name {
  font-size: 14px;
  font-weight: 700;
  fill: #222;
  text-anchor: middle;
}

.cc-node-actor {
  font-size: 12px;
  fill: #888;
  text-anchor: middle;
}

/* Lines */
.cc-line {
  fill: none;
  stroke-width: 1.2;
  opacity: 0.3;
  transition: opacity 0.3s, stroke-width 0.3s;
}
.cc-line.love { stroke: #e74c8b; stroke-width: 2.2; }
.cc-line.family { stroke: #f0a030; }
.cc-line.rivalry { stroke: #7b2d8e; stroke-dasharray: 7 4; }
.cc-line.ally { stroke: #888; stroke-dasharray: 4 4; }

.cc-line.highlight { opacity: 1; stroke-width: 3; }
.cc-line.dimmed { opacity: 0.1; }

.cc-line-label {
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cc-line-label.love { fill: #d44080; }
.cc-line-label.family { fill: #c08020; }
.cc-line-label.rivalry { fill: #7b2d8e; }
.cc-line-label.ally { fill: #777; }
.cc-line-label.dimmed { opacity: 0.1; }

/* soukanzu.jp風チップ: ほぼ不透明の白背景＋関係色の薄い枠線（角丸・枠色はJSが属性で指定） */
.cc-label-bg {
  fill: #fff;
  opacity: 0.96;
  stroke-width: 1;
  stroke-opacity: 0.45;
  transition: opacity 0.3s;
}
.cc-label-bg.dimmed { opacity: 0.1; }

/* Arrows */
.cc-arrow-love { fill: #e74c8b; }
.cc-arrow-family { fill: #f0a030; }
.cc-arrow-rivalry { fill: #7b2d8e; }
.cc-arrow-ally { fill: #888; }

/* Detail Panel */
.cc-wrapper .cc-detail {
  background: #f8f8fa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  display: none;
  animation: ccSlideUp 0.25s ease-out;
  position: absolute;
  transform: translateX(-50%);
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.cc-wrapper .cc-detail.visible { display: block; }

@keyframes ccSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cc-wrapper .cc-detail-close {
  position: absolute;
  top: 8px; right: 12px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.cc-wrapper .cc-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cc-wrapper .cc-detail-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.cc-wrapper .cc-detail-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

.cc-wrapper .cc-detail-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.cc-wrapper .cc-detail-actor {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.cc-wrapper .cc-detail-role {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 12px;
}

.cc-wrapper .cc-detail-rels { display: flex; flex-direction: column; gap: 6px; }

.cc-wrapper .cc-detail-rel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  cursor: pointer;
}

.cc-wrapper .cc-detail-rel-type {
  font-weight: 700;
  min-width: 70px;
  flex-shrink: 0;
}

.cc-wrapper .cc-detail-rel-target { color: #555; }

/* Tap hint */
.cc-wrapper .cc-hint {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin-top: 10px;
}

/* ===== SEO structured text ===== */
.cc-wrapper .cc-seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-bottom: 16px;
}

.cc-wrapper .cc-seo-table th {
  background: #f5f5f7;
  font-weight: 700;
  color: #444;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #ddd;
}

.cc-wrapper .cc-seo-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  color: #555;
  vertical-align: top;
}

.cc-wrapper .cc-seo-table tr:last-child td { border-bottom: none; }

/* ===== Desktop ===== */
@media (min-width: 768px) {
  .cc-wrapper {
    max-width: 1000px;
  }
  .cc-wrapper .cc-header h2 { font-size: 28px !important; }
  .cc-node-name { font-size: 15px; }
  .cc-node-actor { font-size: 13px; }
  .cc-node-initial { font-size: 30px; }
  .cc-line-label { font-size: 12px; }
  .cc-wrapper .cc-detail { max-width: 450px; }
}
