/* 全画面のWebGLキャンバスと、その上に重ねるUI用のスタイル。
   レイアウトの責務のみを持ち、色や強さの調整は main 側の CONFIG に置いている。 */

:root {
  --bg: #05060a;
  --fg: #e8ecff;
  --muted: rgba(232, 236, 255, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* スマホでのバウンス/選択を抑え、没入感を優先する */
  overflow: hidden;
  overscroll-behavior: none;
}

/* 背景に敷く全画面キャンバス。touch-action:none でドラッグ回転をブラウザに奪われない */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* キャンバス上の重ね表示。クリック/ドラッグを妨げないよう pointer-events は無効。
   下部はページャが占めるため、タイトルは上部へ配置する */
.overlay {
  position: fixed;
  left: max(20px, env(safe-area-inset-left));
  top: max(20px, env(safe-area-inset-top));
  pointer-events: none;
  user-select: none;
}

.overlay__title {
  margin: 0 0 6px;
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: 0.04em;
  /* ネオン発光を薄く効かせて、パーティクルの世界観に馴染ませる */
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.55), 0 0 40px rgba(168, 85, 247, 0.35);
}

.overlay__hint {
  margin: 0;
  font-size: clamp(12px, 3.4vw, 15px);
  color: var(--muted);
}

/* 画面右上の音楽コントロール。ガラス調ピルで「選ぶ／再生／曲名」を横に並べる */
.audio {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(72vw, 340px);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(15, 18, 32, 0.55);
  border: 1px solid rgba(232, 236, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
}

.audio__btn {
  border: 0;
  border-radius: 999px;
  background: rgba(232, 236, 255, 0.1);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.audio__btn:hover {
  background: rgba(232, 236, 255, 0.2);
}

.audio__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* 再生/一時停止の丸アイコンボタン */
.audio__btn--icon {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-content: center;
}

/* 曲名。長い場合は省略記号で切る */
.audio__name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 画面下中央のページャ。ドット列（現在ページ表示）とガラス調ピルを縦に並べる */
.pager {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  user-select: none;
}

/* 現在ページを示すドット列。各ドットはタップでそのページへ直接ジャンプする */
.pager__dots {
  display: flex;
  gap: 10px;
}

.pager__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(232, 236, 255, 0.28);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.pager__dot:hover {
  background: rgba(232, 236, 255, 0.55);
}

/* 現在ページのドットはネオン色で強調し、少し大きく見せる */
.pager__dot--active {
  background: #22d3ee;
  transform: scale(1.35);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}

/* ‹ ラベル › を並べるガラス調のピル */
.pager__pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 18, 32, 0.55);
  border: 1px solid rgba(232, 236, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pager__btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pager__btn:hover {
  background: rgba(232, 236, 255, 0.12);
}

.pager__label {
  min-width: 96px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  /* letter-spacing の分だけ右に空くので、視覚的な中央合わせに左パディングで補正 */
  padding-left: 0.22em;
}

/* WebGL非対応時のフォールバック。既定では隠し、body.no-webgl のときだけ中央表示する */
.fallback {
  display: none;
}

body.no-webgl #scene,
body.no-webgl .overlay,
body.no-webgl .audio,
body.no-webgl .pager {
  display: none;
}

body.no-webgl .fallback {
  display: grid;
  place-content: center;
  height: 100%;
  margin: 0;
  padding: 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
