/* ============================================================
   関連番組マップ（惑星ビジュアライズ）専用スタイル
   style.css のネオン×ダークトーンを継承しつつ全画面レイアウトに上書き
   ============================================================ */

.galaxy-body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ノイズテクスチャは宇宙の星屑として薄く残す */
.galaxy-body::before {
  opacity: 0.25;
  z-index: 0;
}

#galaxy-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 0, 127, 0.10), transparent 45%),
    radial-gradient(circle at 75% 75%, rgba(234, 255, 0, 0.08), transparent 45%),
    #060608;
}
#galaxy-canvas.dragging { cursor: grabbing; }

/* ---- オーバーレイUI ---- */
#galaxy-ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* キャンバス操作を妨げない。UI要素だけ個別に有効化 */
}
#galaxy-ui button,
#galaxy-ui a { pointer-events: auto; }

#galaxy-header {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  max-width: min(440px, calc(100vw - 2.5rem));
}
#galaxy-header h1 {
  font-size: 1.6rem;
  margin: 0.5rem 0 0.6rem;
}
.galaxy-lead {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cfcfcf;
  margin: 0;
  text-shadow: 0 1px 6px #000;
}

/* ---- 中心番組パネル ---- */
#focus-panel {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: min(320px, calc(100vw - 2.5rem));
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  pointer-events: auto;
  background: rgba(12, 12, 16, 0.82);
  border: 1px solid var(--neon-pink);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 0 24px rgba(255, 0, 127, 0.35), inset 0 0 16px rgba(255, 0, 127, 0.08);
  backdrop-filter: blur(4px);
  animation: focus-in 0.25s ease;
}
@keyframes focus-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.focus-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.focus-panel__label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--neon-pink);
  font-weight: 700;
}
.focus-panel__clear {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.15s ease;
}
.focus-panel__clear:hover { color: var(--neon-yellow); }
#focus-name {
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  word-break: break-word;
}
.focus-panel__meta {
  font-size: 0.8rem;
  color: #999;
  margin: 0 0 0.7rem;
}
.focus-panel__related {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rel;
}
.focus-panel__related li { margin: 0 0 0.4rem; }
.focus-panel__related a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: #eee;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.focus-panel__related a:hover {
  border-color: var(--neon-yellow);
  background: rgba(234, 255, 0, 0.06);
  color: #fff;
}
.focus-panel__related a::before {
  counter-increment: rel;
  content: counter(rel);
  color: var(--neon-yellow);
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 1.1em;
  text-align: right;
}
.focus-panel__count {
  margin-left: auto;
  color: #888;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ---- ローディング / エラー ---- */
.galaxy-loading,
.galaxy-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #bbb;
  font-size: 0.95rem;
  text-shadow: 0 0 12px var(--neon-yellow);
  pointer-events: none;
}
.galaxy-error { color: var(--neon-pink); text-shadow: 0 0 12px var(--neon-pink); }

/* ---- 操作ヒント ---- */
.galaxy-hint {
  position: absolute;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #666;
  margin: 0;
  white-space: nowrap;
}

/* ---- リストフォールバック ---- */
.list-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: rgba(8, 8, 10, 0.96);
  backdrop-filter: blur(6px);
}
.list-overlay__close { margin-bottom: 1.5rem; }

/* スマホ調整：上部の説明は隠し、情報パネルは下部のコンパクトなシートに */
@media (max-width: 640px) {
  #galaxy-header { top: 0.55rem; left: 0.7rem; right: 0.7rem; max-width: none; }
  #galaxy-header h1 { font-size: 1.05rem; margin: 0.25rem 0 0.3rem; }
  #galaxy-header .badge { font-size: 0.58rem; }
  .galaxy-lead {
    font-size: 0.7rem;
    line-height: 1.45;
    /* 読みやすいよう暗いプレートを敷く（グラフに重なっても視認できる） */
    background: rgba(8, 8, 12, 0.62);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    backdrop-filter: blur(2px);
  }
  .galaxy-lead br { display: none; }            /* 1段にまとめてコンパクトに */

  #focus-panel {
    top: auto;
    bottom: 0.6rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: 30vh;
    padding: 0.55rem 0.7rem 0.6rem;
    border-radius: 14px;
  }
  .focus-panel__head { margin-bottom: 0.25rem; }
  #focus-name { font-size: 1rem; margin: 0 0 0.2rem; }
  .focus-panel__meta { font-size: 0.72rem; margin: 0 0 0.45rem; }
  .focus-panel__related a { font-size: 0.8rem; padding: 0.38rem 0.45rem; }
  .focus-panel__related li { margin: 0 0 0.3rem; }

  .galaxy-hint { display: none; }
}
