/* /assets/css/music-library-dark.css?v=20260610-heading */
/* ================================================================
   H/MIX GALLERY — Music Library DARK THEME
   深緑・夜・森・静けさ / ゲームタイトル画面の没入感
   ================================================================ */

/* ===================================================================
   § 1. CSS変数オーバーライド
   =================================================================== */

body.library-page--dark {
  /* 背景 — 漆黒の森（共通ダークトークン参照） */
  --color-bg:           var(--dark-bg);
  --color-bg-2:         var(--dark-bg-2);
  --color-bg-3:         var(--dark-bg-3);
  --color-surface:      var(--dark-surface);
  --color-surface-2:    var(--dark-surface-2);
  --color-surface-3:    #223625;

  /* テキスト — 月光の白 */
  --color-text:         var(--dark-text);
  --color-text-muted:   var(--dark-text-muted);
  --color-text-dim:     var(--dark-text-dim);

  /* グリーン — 翡翠 */
  --color-green:        var(--dark-green);
  --color-green-mid:    var(--dark-green-mid);
  --color-green-light:  var(--dark-green-light);
  --color-green-pale:   var(--dark-green-pale);
  --color-green-dim:    #2d5a3d;

  /* ゴールド — ランタン */
  --color-gold:         var(--dark-gold);
  --color-gold-light:   var(--dark-gold-light);

  /* ボーダー */
  --color-border:       var(--dark-border);
  --color-border-hover: var(--dark-border-hover);

  background-color: var(--color-bg);
  color: var(--color-text);
}

/* ===================================================================
   § 2. 蛍エフェクト — レイヤー構造
   ──────────────────────────────────────────────────────────────────
   問題: hero__fireflies を #scene-bg の中に入れると
         scene-bg の opacity(0〜0.50) が継承され、
         fireflyGlow(0.12〜0.95) が 0.05〜0.38 に圧縮 → 明滅が見えなくなる。
         CSS opacity 継承は子要素から上書き不可。

   解法: hero__fireflies を scene-bg と独立した兄弟要素にし、
         自身の opacity:1 を保つ。
         コンテンツセクションを z-index:3 に引き上げることで、
         暗い背景色がUIエリアの蛍を視覚的に覆い隠す。
         → 背景画像が透けているエリアにのみ蛍が見える。

   z-index 階層:
     #scene-bg (z-index:1)             ← 図書館背景画像
     .hero__fireflies (fixed, z-index:2) ← 蛍 / TOPと同一アニメ
     コンテンツ全セクション (z-index:3) ← UI / 暗背景が蛍を隠す
     player (z-index:1200)
   =================================================================== */

body.library-page--dark .hero__fireflies {
  position: fixed;
  z-index: 2;   /* scene-bg(1) より上 / コンテンツ(3) より下 */
  pointer-events: none; /* クリックを阻害しない */
}

/* ===================================================================
   § 3. scenic-bg: ダーク背景で映えるよう opacity 引き上げ
        + タグ連動切替用に transition を 0.8s に短縮（base: 1.8s）
   =================================================================== */

body.library-page--dark #scene-bg {
  transition: opacity 0.8s ease-in-out;
}
body.library-page--dark #scene-bg.is-idle    { opacity: 0.40; }
body.library-page--dark #scene-bg.is-visible { opacity: 0.55; }

/* ===================================================================
   § 3. Header
   =================================================================== */

body.library-page--dark .site-header {
  background: rgba(11, 21, 16, 0.92);
  border-bottom: 1px solid rgba(80, 160, 110, 0.14);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
}

body.library-page--dark .site-header.scrolled {
  background: rgba(10, 18, 14, 0.97);
}

body.library-page--dark .logo-text {
  color: var(--color-green-light);
  text-shadow: 0 0 24px rgba(126, 203, 149, 0.30);
}

body.library-page--dark .logo-sub   { color: var(--color-text-dim); }

body.library-page--dark .nav-link {
  color: var(--color-text-muted);
}
body.library-page--dark .nav-link:hover,
body.library-page--dark .nav-link--active {
  color: var(--color-green-light);
}

body.library-page--dark .nav-link--cta {
  border-color: rgba(100, 180, 130, 0.30);
  color: var(--color-green-light);
}
body.library-page--dark .nav-link--cta:hover {
  background: rgba(80, 160, 110, 0.18);
  border-color: var(--color-green-mid);
}

body.library-page--dark .nav-toggle span {
  background: var(--color-text-muted);
}

/* ===================================================================
   § 4. Hero — ゲームタイトル画面
   z-index:auto で scenic-bg が透過して映える
   =================================================================== */

body.library-page--dark .music-library-hero {
  z-index: auto;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0)    0%,
    rgba(0, 0, 0, 0.25) 50%,
    rgba(0, 0, 0, 0.50) 100%
  );
  border-bottom: 1px solid rgba(80, 160, 110, 0.10);
  padding: clamp(100px, 14vw, 180px) 20px clamp(72px, 10vw, 120px);
}

/* 霧レイヤー */
body.library-page--dark .music-library-hero::before {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(60, 120, 80, 0.10) 0%, rgba(0, 0, 0, 0) 58%),
    radial-gradient(ellipse at 30% 55%, rgba(40, 80, 55, 0.08) 0%, rgba(0, 0, 0, 0) 54%);
}

/* テクスチャレイヤー */
body.library-page--dark .music-library-hero::after {
  opacity: 0.08;
}

/* eyebrow */
body.library-page--dark .music-library-hero__eyebrow {
  color: rgba(154, 223, 180, 0.82);
  text-shadow: 0 0 20px rgba(100, 200, 140, 0.30);
  letter-spacing: 0.45em;
}

/* タイトル "Music Library" */
body.library-page--dark .music-library-hero__title {
  color: #f0faf4;
  text-shadow:
    0 0 40px rgba(100, 220, 150, 0.22),
    0 2px 0 rgba(0, 0, 0, 0.65),
    0 4px 20px rgba(0, 0, 0, 0.50);
  font-weight: 400;
}

/* タイトル下ライン */
body.library-page--dark .music-library-hero__title::after {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(100, 200, 140, 0.30) 18%,
    rgba(120, 210, 155, 0.50) 50%,
    rgba(100, 200, 140, 0.30) 82%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: 0 0 18px rgba(100, 200, 140, 0.18);
}

/* lead */
body.library-page--dark .music-library-hero__lead {
  color: rgba(225, 245, 232, 0.95);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75);
}

/* sublead */
body.library-page--dark .music-library-hero__sublead {
  color: rgba(170, 205, 182, 0.88);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

/* 検索ラップ */
body.library-page--dark .music-library-hero__search-wrap {
  background: rgba(12, 22, 16, 0.82);
  border: 1px solid rgba(100, 180, 130, 0.24);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(100, 180, 130, 0.12);
  backdrop-filter: blur(24px);
}

/* 検索入力 */
body.library-page--dark .music-library-hero__search {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(100, 180, 130, 0.14);
  caret-color: var(--color-green-light);
}

body.library-page--dark .music-library-hero__search::placeholder {
  color: rgba(120, 170, 135, 0.60);
}

body.library-page--dark .music-library-hero__search:focus {
  box-shadow:
    inset 0 0 0 1.5px rgba(100, 180, 130, 0.40),
    0 0 0 3px rgba(80, 160, 110, 0.14);
}

/* 検索アイコン */
body.library-page--dark .music-library-hero__search-icon {
  color: rgba(100, 180, 130, 0.60);
}

/* クリアボタン */
body.library-page--dark .ml-search-clear {
  color: var(--color-text-dim);
}
body.library-page--dark .ml-search-clear:hover {
  background: rgba(100, 180, 130, 0.12);
  color: var(--color-text);
}

/* 人気タグラベル */
body.library-page--dark .music-library-hero__quick-tag-label {
  color: var(--color-text-dim);
}

/* 人気タグボタン */
body.library-page--dark .music-library-hero__quick-tag {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(100, 180, 130, 0.22);
  color: rgba(170, 215, 180, 0.82);
}
body.library-page--dark .music-library-hero__quick-tag:hover {
  background: rgba(80, 160, 110, 0.20);
  border-color: rgba(100, 200, 140, 0.45);
  color: var(--color-green-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}

/* ===================================================================
   § 5. コンテンツセクション — z-index: 3 で scene-bg と蛍より前面へ
   scene-bg(z-index:1) と hero__fireflies(z-index:2) より上に配置。
   各セクションの暗い background-color が蛍を視覚的に隠すため
   テキスト・カード上に蛍が重なって見えることはない。
   =================================================================== */

body.library-page--dark .ml-intro,
body.library-page--dark .ml-quick-scene,
body.library-page--dark .ml-filter-panel,
body.library-page--dark .ml-active-filters,
body.library-page--dark .ml-results-bar,
body.library-page--dark .ml-main,
body.library-page--dark .end-cta,
body.library-page--dark .site-footer {
  position: relative;
  z-index: 3;   /* 蛍(z-index:2) より上 — 各セクションの暗背景が蛍を隠す */
}

/* ===================================================================
   § 6. Library Intro
   =================================================================== */

body.library-page--dark .ml-intro {
  background: rgba(8, 16, 12, 0.60);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

body.library-page--dark .ml-intro__main {
  color: rgba(225, 245, 232, 0.95);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
}

body.library-page--dark .ml-intro__sub {
  color: rgba(150, 190, 162, 0.80);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

/* ===================================================================
   § 7. Quick Scene Navigation
   =================================================================== */

body.library-page--dark .ml-quick-scene {
  background: rgba(8, 16, 12, 0.50);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(80, 160, 110, 0.10);
  border-bottom: 1px solid rgba(80, 160, 110, 0.10);
}

body.library-page--dark .ml-scene-card {
  background: rgba(22, 38, 28, 0.90);
  border-color: rgba(100, 180, 130, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
}

body.library-page--dark .ml-scene-card:hover {
  background: rgba(40, 80, 55, 0.60);
  border-color: rgba(100, 200, 140, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 16px rgba(80, 160, 110, 0.14);
}

body.library-page--dark .ml-scene-card.is-active {
  background: rgba(60, 120, 80, 0.50);
  border-color: rgba(126, 203, 149, 0.65);
  box-shadow: 0 0 20px rgba(100, 200, 140, 0.22);
}

/* QuickScene カードラベル */
body.library-page--dark .ml-scene-icon  { color: var(--color-green-light); }
body.library-page--dark .ml-scene-label { color: rgba(210, 240, 220, 0.95); }
body.library-page--dark .ml-scene-label-jp { color: rgba(150, 190, 162, 0.75); }

/* QuickScene SVGアイコン (ml-qs-* クラス) */
body.library-page--dark .ml-qs-card {
  background: rgba(16, 30, 22, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(100, 180, 130, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
body.library-page--dark .ml-qs-card:hover {
  background: rgba(30, 65, 44, 0.55);
  border-color: rgba(100, 200, 140, 0.40);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 16px rgba(80, 160, 110, 0.08);
}
body.library-page--dark .ml-qs-card.active {
  background: rgba(40, 100, 65, 0.40);
  border-color: rgba(126, 203, 149, 0.55);
  color: var(--color-green-light);
  box-shadow:
    0 0 20px rgba(100, 200, 140, 0.15),
    inset 0 0 12px rgba(100, 200, 140, 0.04);
}
body.library-page--dark .ml-qs-label     { color: rgba(210, 240, 220, 0.90); }
body.library-page--dark .ml-qs-label-jp  { color: rgba(150, 190, 162, 0.72); }

/* ===================================================================
   § 8. Filter Panel
   =================================================================== */

body.library-page--dark .ml-filter-panel {
  background: rgba(10, 28, 18, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(80, 160, 110, 0.10);
  border-bottom: 1px solid rgba(80, 160, 110, 0.10);
}

body.library-page--dark .ml-filter-heading {
  color: rgba(180, 225, 195, 0.92);
}

body.library-page--dark .ml-filter-heading svg {
  color: var(--color-green-mid);
}

/* フィルターヘッダー右側グループ */
body.library-page--dark .ml-filter-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 最近再生フィルターボタン — 青緑 / 時間の流れ */
body.library-page--dark .ml-recent-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(80, 195, 210, 0.78);
  background: rgba(20, 60, 40, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(60, 170, 190, 0.22);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
body.library-page--dark .ml-recent-filter-btn:hover {
  color: rgba(110, 220, 235, 0.90);
  border-color: rgba(70, 190, 210, 0.38);
  background: rgba(30, 80, 50, 0.70);
}
body.library-page--dark .ml-recent-filter-btn[aria-pressed="true"] {
  color: rgba(100, 230, 245, 0.96);
  border-color: rgba(70, 200, 220, 0.55);
  background: rgba(18, 110, 130, 0.16);
  box-shadow:
    0 0 8px  rgba(80, 210, 230, 0.30),
    0 0 18px rgba(50, 170, 190, 0.14);
  text-shadow: 0 0 6px rgba(100, 220, 240, 0.28);
}

/* お気に入りのみフィルターボタン — 灯火 / アンバー */
body.library-page--dark .ml-fav-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(210, 148, 62, 0.78);
  background: rgba(20, 60, 40, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(200, 130, 45, 0.22);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
body.library-page--dark .ml-fav-filter-btn:hover {
  color: rgba(255, 184, 88, 0.90);
  border-color: rgba(255, 148, 45, 0.38);
  background: rgba(30, 80, 50, 0.70);
}
body.library-page--dark .ml-fav-filter-btn.is-active,
body.library-page--dark .ml-fav-filter-btn[aria-pressed="true"] {
  color: rgba(255, 175, 72, 0.98);
  border-color: rgba(255, 145, 45, 0.55);
  background: rgba(180, 100, 18, 0.16);
  box-shadow:
    0 0 8px  rgba(255, 170, 60, 0.32),
    0 0 18px rgba(255, 120, 35, 0.14);
  text-shadow: 0 0 6px rgba(255, 180, 80, 0.30);
}

body.library-page--dark .ml-filter-reset-btn {
  color: var(--color-text-muted);
  background: rgba(20, 60, 40, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-color: rgba(100, 180, 130, 0.22);
}
body.library-page--dark .ml-filter-reset-btn:hover {
  color: var(--color-green-light);
  border-color: rgba(100, 200, 140, 0.42);
  background: rgba(30, 80, 50, 0.70);
}

/* フィルターグループ */
body.library-page--dark .ml-filter-group {
  background: rgba(14, 28, 20, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(100, 180, 130, 0.15);
}

body.library-page--dark .ml-filter-group-toggle {
  color: rgba(195, 230, 208, 0.92);
  border-bottom-color: rgba(80, 140, 100, 0.14);
}
body.library-page--dark .ml-filter-group-toggle:hover {
  background: rgba(40, 70, 50, 0.50);
  color: var(--color-green-light);
}

body.library-page--dark .ml-filter-group-label   { color: rgba(210, 240, 220, 0.95); }
body.library-page--dark .ml-filter-group-label-jp { color: var(--color-text-dim); }
body.library-page--dark .ml-filter-group-icon     { color: var(--color-gold-light); }

/* チップ */
body.library-page--dark .ml-chip {
  background: rgba(22, 40, 30, 0.90);
  border-color: rgba(100, 180, 130, 0.22);
  color: rgba(180, 220, 192, 0.88);
}

body.library-page--dark .ml-chip:hover {
  background: rgba(50, 100, 68, 0.55);
  border-color: rgba(100, 200, 140, 0.45);
  color: var(--color-green-light);
}

body.library-page--dark .ml-chip.is-active,
body.library-page--dark .ml-chip[aria-pressed="true"] {
  background: rgba(60, 140, 90, 0.22);
  border-color: rgba(126, 203, 149, 0.55);
  color: var(--dark-green-light, #9adfb4);
  box-shadow:
    0 0 12px rgba(100, 200, 140, 0.20),
    inset 0 0 8px rgba(100, 200, 140, 0.06);
  text-shadow: 0 0 8px rgba(100, 200, 140, 0.25);
}

/* ===================================================================
   § 9. Active Filters / Results Bar
   =================================================================== */

body.library-page--dark .ml-active-filters {
  background: rgba(8, 16, 12, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(80, 160, 110, 0.10);
}

body.library-page--dark .ml-active-filters-label {
  color: var(--color-text-muted);
}

body.library-page--dark .ml-active-chip {
  background: rgba(60, 140, 90, 0.18);
  border-color: rgba(126, 203, 149, 0.35);
  color: var(--dark-green-light, #9adfb4);
  box-shadow: 0 0 8px rgba(100, 200, 140, 0.10);
}

body.library-page--dark .ml-active-chip__remove:hover {
  background: rgba(200, 80, 80, 0.22);
  color: rgba(240, 185, 185, 0.95);
}

/* 最近再生フィルターチップ — 青緑 */
body.library-page--dark .ml-active-chip--recent {
  background: rgba(18, 110, 130, 0.18);
  border-color: rgba(70, 195, 215, 0.40);
  color: rgba(110, 225, 240, 0.90);
}

/* お気に入りフィルターチップ — アンバー */
body.library-page--dark .ml-active-chip--fav {
  background: rgba(170, 100, 18, 0.20);
  border-color: rgba(255, 145, 45, 0.42);
  color: rgba(255, 184, 88, 0.92);
}

body.library-page--dark .ml-active-clear-all {
  color: var(--color-text-muted);
  border-color: rgba(100, 180, 130, 0.22);
}
body.library-page--dark .ml-active-clear-all:hover {
  color: var(--color-green-light);
  border-color: rgba(100, 200, 140, 0.42);
}

body.library-page--dark .ml-results-bar {
  background: rgba(10, 18, 14, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(80, 140, 100, 0.14);
}

body.library-page--dark .ml-results-count {
  color: rgba(180, 225, 195, 0.95);
}

body.library-page--dark .ml-results-condition {
  color: var(--color-text-muted);
}

body.library-page--dark .ml-results-hint {
  color: var(--color-text-dim);
}

/* ===================================================================
   § 10. Card Grid — フル幅レイアウト + 左右フェード
   =================================================================== */

/*
  ml-main をフル幅に解放し、::before の gradient で左右フェードを演出。
  z-index 構造:
    #scene-bg (fixed, z-index:1)
    └─ .ml-main (relative, z-index:2) ← scene-bg より上
         ├─ ::before (z-index:-1) ← .ml-main 内で最背面 / scene-bg より上
         └─ .ml-grid / cards ← ::before の上
*/

body.library-page--dark .ml-main {
  max-width: 100%;
  margin: 0;
  padding: var(--space-2xl) clamp(0.75rem, 2.5vw, 2.5rem) var(--space-4xl);
  background: transparent;  /* 背景は ::before に委譲 */
}

/* 左右フェードグラデーション背景 */
body.library-page--dark .ml-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 18, 14, 0)    0%,
    rgba(10, 18, 14, 0.04) 3%,
    rgba(10, 18, 14, 0.10) 8%,
    rgba(10, 18, 14, 0.16) 16%,
    rgba(10, 18, 14, 0.20) 24%,
    rgba(10, 18, 14, 0.20) 76%,
    rgba(10, 18, 14, 0.16) 84%,
    rgba(10, 18, 14, 0.10) 92%,
    rgba(10, 18, 14, 0.04) 97%,
    rgba(10, 18, 14, 0)   100%
  );
  pointer-events: none;
  z-index: -1;
}

/* グリッド: 3列固定 / max-width で画面が広がってもカード幅を抑制 */
body.library-page--dark .ml-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1080px;    /* 3列 × ~340px + gap = カード幅を適切に抑える */
  margin-left: auto;
  margin-right: auto;
}

/* カード本体
   ① animation:none でベースCSSのml-card-appearをキャンセル（scroll-revealに委譲）
   ② 視認できる背景色を付与
   ③ ボーダーを強化 */
body.library-page--dark .ml-card {
  animation: none;
  background-color: rgba(14, 28, 20, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(100, 180, 130, 0.18);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    background-color 0.35s ease;
}

body.library-page--dark .ml-card:hover {
  background-color: rgba(18, 36, 26, 0.85);
  border-color: rgba(100, 200, 140, 0.38);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.60),
    0 0 28px rgba(80, 160, 110, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ホバー時: 試聴ボタンが少し前に浮き出る */
body.library-page--dark .ml-card:hover .ml-btn-play {
  transform: translateY(-3px) scale(1.08);
  background: rgba(45, 110, 72, 0.62);
  border-color: rgba(118, 192, 148, 0.62);
  box-shadow: 0 6px 22px rgba(50, 130, 80, 0.40);
}

body.library-page--dark .ml-card.is-playing {
  border-color: rgba(126, 203, 149, 0.82);
  box-shadow:
    0 0 0 2px rgba(100, 220, 140, 0.95),
    0 0 38px rgba(80, 200, 120, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.50);
}

/* ジャケット背景を統一 — タグ別グラデーションを全て深緑ベースに上書き
   body.library-page--dark .ml-card[data-tag-primary] .ml-card-jacket は
   specificityが (0,3,0) でベースCSSの (0,2,0) を上回るため !important 不要 */
body.library-page--dark .ml-card-jacket,
body.library-page--dark .ml-card[data-tag-primary] .ml-card-jacket {
  background: linear-gradient(145deg, #0e1f17 0%, #172b1d 45%, #1d3422 72%, #12201a 100%);
  filter: none;
}

/* カードタイトル */
body.library-page--dark .ml-card-title {
  color: rgba(240, 255, 245, 0.98);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.70);
}

body.library-page--dark .ml-card:hover .ml-card-title {
  color: rgba(165, 240, 190, 1);
}

body.library-page--dark .ml-card.is-playing .ml-card-title {
  color: rgba(155, 255, 190, 1);
}

/* カード説明文 */
body.library-page--dark .ml-card-desc {
  color: rgba(195, 225, 205, 0.82);
}

/* カードID・尺 */
body.library-page--dark .ml-card-id       { color: rgba(150, 190, 165, 0.55); }
body.library-page--dark .ml-card-duration { color: rgba(150, 190, 165, 0.50); }

/* カードタグ */
body.library-page--dark .ml-card-tag {
  border-color: rgba(140, 200, 165, 0.28);
  background: rgba(50, 100, 68, 0.28);
  color: rgba(185, 230, 200, 0.88);
}

/* 試聴ボタン */
body.library-page--dark .ml-btn-play {
  background: rgba(40, 100, 62, 0.45);
  border-color: rgba(100, 180, 130, 0.42);
  color: rgba(200, 245, 215, 0.95);
}
body.library-page--dark .ml-btn-play:hover {
  background: rgba(50, 120, 75, 0.65);
  border-color: rgba(126, 203, 149, 0.65);
  box-shadow: 0 4px 20px rgba(60, 140, 90, 0.40);
}

/* お気に入りボタン — 灯火 / アンバー */
body.library-page--dark .ml-btn-fav {
  border-color: rgba(200, 130, 45, 0.22);
  background: rgba(140, 90, 18, 0.10);
  color: rgba(210, 148, 62, 0.55);
}
body.library-page--dark .ml-btn-fav:hover {
  border-color: rgba(255, 150, 50, 0.45);
  color: rgba(255, 184, 88, 0.92);
  background: rgba(160, 100, 18, 0.18);
}
body.library-page--dark .ml-btn-fav.is-fav {
  color: rgba(255, 168, 60, 0.98);
  border-color: rgba(255, 148, 45, 0.65);
  background: rgba(180, 100, 18, 0.22);
  box-shadow:
    0 0 6px  rgba(255, 175, 70, 0.42),
    0 0 14px rgba(255, 125, 35, 0.20);
  text-shadow: 0 0 5px rgba(255, 190, 90, 0.25);
}

/* ダウンロードボタン */
body.library-page--dark .ml-btn-dl {
  border-color: rgba(140, 200, 160, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(180, 220, 195, 0.60);
}
body.library-page--dark .ml-btn-dl:hover {
  border-color: rgba(140, 200, 160, 0.52);
  color: rgba(210, 248, 225, 0.95);
  background: rgba(50, 110, 72, 0.25);
}

/* ===================================================================
   § 11. Load More
   =================================================================== */

body.library-page--dark .ml-loadmore-btn {
  background: rgba(18, 34, 24, 0.90);
  border-color: rgba(100, 180, 130, 0.26);
  color: var(--color-text-muted);
}
body.library-page--dark .ml-loadmore-btn:hover {
  background: rgba(50, 100, 68, 0.45);
  border-color: rgba(100, 200, 140, 0.48);
  color: var(--color-green-light);
}

/* ===================================================================
   § 12. Empty State
   =================================================================== */

body.library-page--dark .ml-empty-title {
  color: rgba(190, 225, 200, 0.95);
}
body.library-page--dark .ml-empty-sub {
  color: var(--color-text-dim);
}
body.library-page--dark .ml-empty-reset {
  color: var(--color-green-light);
  border-color: rgba(100, 180, 130, 0.35);
}
body.library-page--dark .ml-empty-reset:hover {
  background: var(--color-green-mid);
  color: #fff;
}

/* ===================================================================
   § 13. Bottom CTA
   =================================================================== */

/* ===================================================================
   旧 ml-bottom-cta は end-cta に置き換え済み（クラス名は保持）
   =================================================================== */
body.library-page--dark .ml-bottom-cta {
  display: none; /* 保険 */
}

/* ===================================================================
   § END CTA — 次の旅への分岐点
   =================================================================== */

body.library-page--dark .end-cta {
  background: rgba(8, 14, 11, 0.96);
  border-top: 1px solid rgba(80, 140, 100, 0.14);
  text-align: center;
  padding: 100px 20px 120px;
}

body.library-page--dark .end-cta__inner {
  max-width: 580px;
  margin: 0 auto;
}

body.library-page--dark .end-cta__title {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.10em;
  color: rgba(216, 240, 228, 0.96);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

body.library-page--dark .end-cta__desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.86rem;
  line-height: 2.0;
  color: rgba(180, 215, 198, 0.72);
  margin-bottom: 2.75rem;
}

/* Card renewal overrides */
body.library-page--dark .ml-card {
  background:
    linear-gradient(180deg, rgba(22, 44, 32, 0.76), rgba(9, 18, 13, 0.82)),
    rgba(12, 26, 18, 0.56);
  border-color: rgba(170, 220, 188, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 52px rgba(0, 0, 0, 0.42);
}
body.library-page--dark .ml-card:hover {
  background:
    linear-gradient(180deg, rgba(25, 52, 37, 0.84), rgba(10, 22, 15, 0.88)),
    rgba(14, 32, 22, 0.64);
  border-color: rgba(178, 234, 196, 0.34);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(91, 190, 124, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.library-page--dark .ml-btn-tools {
  border-color: rgba(226, 198, 128, 0.45);
  background:
    linear-gradient(135deg, rgba(226, 198, 128, 0.20), rgba(78, 164, 110, 0.22)),
    rgba(255, 255, 255, 0.06);
  color: rgba(248, 232, 180, 0.96);
}
body.library-page--dark .ml-btn-tools:hover {
  border-color: rgba(246, 216, 148, 0.76);
  color: rgba(255, 242, 196, 1);
  box-shadow:
    0 8px 24px rgba(226, 198, 128, 0.20),
    0 0 18px rgba(90, 190, 124, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.12);
}
body.library-page--dark .ml-card-icon-actions .ml-btn-detail {
  border-color: rgba(140, 200, 160, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(180, 220, 195, 0.66);
}
body.library-page--dark .ml-card-icon-actions .ml-btn-detail:hover {
  border-color: rgba(140, 200, 160, 0.52);
  color: rgba(210, 248, 225, 0.95);
  background: rgba(50, 110, 72, 0.25);
}
body.library-page--dark.ml-card-style-game .ml-card {
  border-color: rgba(104, 236, 156, 0.34);
  background:
    linear-gradient(135deg, rgba(13, 46, 30, 0.92), rgba(3, 13, 11, 0.96)),
    rgba(4, 14, 10, 0.86);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(104, 236, 156, 0.06),
    inset 0 0 24px rgba(104, 236, 156, 0.06);
}
body.library-page--dark.ml-card-style-game .ml-btn-tools {
  border-color: rgba(104, 236, 156, 0.62);
  background: linear-gradient(180deg, rgba(43, 142, 78, 0.42), rgba(9, 52, 31, 0.62));
  color: rgba(201, 255, 220, 0.98);
}
body.library-page--dark.ml-card-style-fantasy .ml-card {
  border-color: rgba(236, 205, 132, 0.34);
  background:
    radial-gradient(circle at 18% 10%, rgba(236, 205, 132, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(49, 35, 20, 0.88), rgba(11, 23, 16, 0.94));
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.52),
    inset 0 0 34px rgba(236, 205, 132, 0.07);
}
body.library-page--dark.ml-card-style-fantasy .ml-btn-tools {
  border-color: rgba(255, 226, 156, 0.66);
  background: linear-gradient(135deg, rgba(146, 98, 34, 0.34), rgba(51, 94, 57, 0.25));
}
body.library-page--dark.ml-card-style-bold .ml-card {
  border-color: rgba(246, 216, 148, 0.36);
  background:
    linear-gradient(112deg, rgba(3, 8, 7, 0.98) 0 56%, rgba(56, 92, 62, 0.72) 56% 100%);
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(246, 216, 148, 0.04);
}
body.library-page--dark.ml-card-style-bold .ml-btn-tools {
  border-color: rgba(246, 216, 148, 0.76);
  background: rgba(246, 216, 148, 0.22);
}
body.library-page--dark.ml-card-style-forest-glass .ml-card {
  border-color: oklch(0.74 0.06 142 / 0.22);
  background:
    radial-gradient(140% 70% at 50% 0%,
      oklch(0.62 0.14 var(--light-hue, 132) / calc(0.22 * var(--surface-alpha, 0.62) * var(--surface-tint, 0.55))),
      transparent 55%),
    radial-gradient(120% 80% at 50% 0%,
      oklch(0.34 0.07 152 / calc(0.55 * var(--surface-alpha, 0.62))),
      transparent 60%),
    linear-gradient(160deg,
      oklch(0.27 0.05 152 / var(--surface-alpha, 0.62)) 0%,
      oklch(0.20 0.04 152 / var(--surface-alpha, 0.62)) 55%,
      oklch(0.16 0.03 152 / var(--surface-alpha, 0.62)) 100%);
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.10 var(--light-hue, 132) / calc(var(--reveal-edge, 0.60) * 0.7)),
    inset 0 0 0 1px oklch(0.74 0.06 142 / 0.06),
    0 1px 1px oklch(0.04 0.005 150 / 0.4),
    0 12px 30px -10px oklch(0.04 0.005 150 / 0.55);
}
body.library-page--dark.ml-card-style-forest-glass .ml-card:hover {
  border-color: oklch(0.92 0.10 var(--light-hue, 132) / 0.36);
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.12 var(--light-hue, 132) / calc(var(--reveal-edge, 0.60) * 1)),
    inset 0 0 0 1px oklch(0.92 0.10 var(--light-hue, 132) / 0.14),
    0 2px 2px oklch(0.04 0.005 150 / 0.45),
    0 24px 50px -12px oklch(0.04 0.005 150 / 0.7),
    0 0 60px -8px oklch(0.78 0.18 var(--glow-color, 142) / calc(var(--glow-alpha, 0.48) * 1.4));
}
body.library-page--dark.ml-card-style-forest-glass .ml-btn-tools {
  border-color: oklch(0.82 0.10 90 / 0.36);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, oklch(0.86 0.10 90 / calc(0.20 * var(--tools-glow, 0.95))), transparent 70%),
    linear-gradient(180deg, oklch(0.42 0.10 150 / 0.95), oklch(0.30 0.08 152 / 0.95));
  color: oklch(0.96 0.04 142);
}

body.library-page--dark .end-cta__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ベースボタン */
body.library-page--dark .end-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.80rem;
  letter-spacing: 0.06em;
  border: 1px solid rgba(100, 170, 130, 0.28);
  color: rgba(190, 228, 208, 0.82);
  background: rgba(20, 55, 38, 0.28);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s ease;
}
body.library-page--dark .end-cta__btn:hover {
  color: rgba(220, 248, 230, 0.96);
  border-color: rgba(120, 200, 155, 0.45);
  background: rgba(30, 75, 52, 0.38);
  transform: translateY(-1px);
}

/* 主役: 保存リスト — アンバー */
body.library-page--dark .end-cta__btn--primary {
  color: #ffd6a0;
  border-color: rgba(255, 150, 60, 0.48);
  background: rgba(180, 95, 18, 0.16);
  box-shadow:
    0 0 10px rgba(255, 170, 80, 0.22),
    inset 0 0 10px rgba(255, 155, 60, 0.06);
  animation: endCtaPulse 3.0s ease-in-out infinite;
}
body.library-page--dark .end-cta__btn--primary:hover {
  color: #ffe8c0;
  border-color: rgba(255, 170, 70, 0.65);
  background: rgba(200, 110, 20, 0.24);
  box-shadow:
    0 0 14px rgba(255, 190, 100, 0.38),
    0 0 28px rgba(255, 140, 50, 0.18);
  transform: translateY(-2px);
}

@keyframes endCtaPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 80, 0.20), inset 0 0 10px rgba(255, 155, 60, 0.06); }
  50%       { box-shadow: 0 0 18px rgba(255, 195, 110, 0.36), inset 0 0 12px rgba(255, 165, 70, 0.10); }
}

/* ghost: TOP へ */
body.library-page--dark .end-cta__btn--ghost {
  opacity: 0.58;
  border-color: rgba(80, 130, 100, 0.18);
  background: transparent;
}
body.library-page--dark .end-cta__btn--ghost:hover {
  opacity: 0.88;
}

/* モバイル */
@media (max-width: 600px) {
  body.library-page--dark .end-cta {
    padding: 72px 16px 100px;
  }
  body.library-page--dark .end-cta__actions {
    flex-direction: column;
    align-items: center;
  }
  body.library-page--dark .end-cta__btn {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }
}

body.library-page--dark .btn--ghost {
  border-color: rgba(100, 180, 130, 0.30);
  color: rgba(185, 225, 198, 0.88);
}
body.library-page--dark .btn--ghost:hover {
  background: rgba(60, 130, 80, 0.22);
  border-color: rgba(100, 200, 140, 0.50);
  color: var(--color-green-light);
}

/* ===================================================================
   § 14. Footer
   =================================================================== */

body.library-page--dark .site-footer {
  background: rgba(7, 13, 11, 0.98);
  border-top: 1px solid rgba(80, 140, 100, 0.12);
}

body.library-page--dark .footer-logo   { color: var(--color-green-light); }

body.library-page--dark .footer-tagline,
body.library-page--dark .footer-desc   { color: var(--color-text-dim); }

body.library-page--dark .footer-nav-heading { color: rgba(175, 220, 190, 0.88); }

body.library-page--dark .footer-nav-list a {
  color: rgba(140, 180, 152, 0.75);
}
body.library-page--dark .footer-nav-list a:hover {
  color: var(--color-green-light);
}

/* コピーライト: WCAG AA 対応でコントラスト強化 */
body.library-page--dark .footer-copy {
  color: rgba(130, 165, 140, 0.75);
}

/* ===================================================================
   § 15. Scroll Reveal アニメーション
   [data-reveal] は必ず body.library-page--dark スコープに閉じる
   ベースCSSの ml-card-appear アニメーションとの競合を防ぐため
   .ml-card への animation: none 上書きと組み合わせて使用
   =================================================================== */

body.library-page--dark [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

body.library-page--dark [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

body.library-page--dark [data-reveal="d1"] { transition-delay: 0.06s; }
body.library-page--dark [data-reveal="d2"] { transition-delay: 0.12s; }
body.library-page--dark [data-reveal="d3"] { transition-delay: 0.18s; }
body.library-page--dark [data-reveal="d4"] { transition-delay: 0.24s; }
body.library-page--dark [data-reveal="d5"] { transition-delay: 0.30s; }

/* Hero 要素: ページロード時にアニメーション */
body.library-page--dark .music-library-hero__inner > * {
  animation: darkHeroReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.library-page--dark .music-library-hero__eyebrow    { animation-delay:  60ms; }
body.library-page--dark .music-library-hero__title      { animation-delay: 160ms; }
body.library-page--dark .music-library-hero__lead       { animation-delay: 280ms; }
body.library-page--dark .music-library-hero__sublead    { animation-delay: 380ms; }
body.library-page--dark .music-library-hero__search-wrap  { animation-delay: 480ms; }
body.library-page--dark .music-library-hero__quick-tags   { animation-delay: 580ms; }

@keyframes darkHeroReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ===================================================================
   § 16. アクセシビリティ
   =================================================================== */

/* フォーカスリング */
body.library-page--dark :focus-visible {
  outline: 2px solid rgba(126, 203, 149, 0.85);
  outline-offset: 3px;
  border-radius: 3px;
}

body.library-page--dark .ml-btn-play:focus-visible,
body.library-page--dark .ml-btn-fav:focus-visible,
body.library-page--dark .ml-btn-dl:focus-visible {
  outline-offset: 2px;
}

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  body.library-page--dark [data-reveal],
  body.library-page--dark [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
  body.library-page--dark .music-library-hero__inner > * {
    animation: none !important;
  }
}

/* mobile: GPU コスト抑制 */
@media (hover: none) and (pointer: coarse) {
  body.library-page--dark #scene-bg {
    background-attachment: scroll;
  }
}

/* ===================================================================
   § 17. タグ別ボーダーアクセント
   カードの色はすべて深緑で統一し、個性はボーダーの色だけで表現する。
   opacity は控えめに保ち背景世界観との調和を優先。
   =================================================================== */

/* 和風・神社・東洋 → ランタン金 */
body.library-page--dark .ml-card[data-tag-primary="japanese"],
body.library-page--dark .ml-card[data-tag-primary="oriental"],
body.library-page--dark .ml-card[data-tag-primary="shrine"]  {
  border-color: rgba(196, 160, 65, 0.38);
}
body.library-page--dark .ml-card[data-tag-primary="japanese"]:hover,
body.library-page--dark .ml-card[data-tag-primary="oriental"]:hover,
body.library-page--dark .ml-card[data-tag-primary="shrine"]:hover  {
  border-color: rgba(215, 180, 80, 0.58);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(196, 160, 65, 0.14),
    inset 0 1px 0 rgba(255, 230, 160, 0.06);
}

/* 戦闘・ボス → 熾火の赤 */
body.library-page--dark .ml-card[data-tag-primary="battle"],
body.library-page--dark .ml-card[data-tag-primary="boss"]   {
  border-color: rgba(200, 90, 65, 0.32);
}
body.library-page--dark .ml-card[data-tag-primary="battle"]:hover,
body.library-page--dark .ml-card[data-tag-primary="boss"]:hover   {
  border-color: rgba(220, 110, 80, 0.52);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(200, 80, 60, 0.14),
    inset 0 1px 0 rgba(255, 180, 160, 0.05);
}

/* ホラー・神秘・暗い → 紫煙 */
body.library-page--dark .ml-card[data-tag-primary="horror"],
body.library-page--dark .ml-card[data-tag-primary="mysterious"],
body.library-page--dark .ml-card[data-tag-primary="dark"]     {
  border-color: rgba(145, 80, 185, 0.30);
}
body.library-page--dark .ml-card[data-tag-primary="horror"]:hover,
body.library-page--dark .ml-card[data-tag-primary="mysterious"]:hover,
body.library-page--dark .ml-card[data-tag-primary="dark"]:hover     {
  border-color: rgba(160, 95, 205, 0.50);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(145, 80, 185, 0.14),
    inset 0 1px 0 rgba(200, 160, 255, 0.05);
}

/* 勇壮・幻想・中世・ケルト → 月光青 */
body.library-page--dark .ml-card[data-tag-primary="epic"],
body.library-page--dark .ml-card[data-tag-primary="fantasy"],
body.library-page--dark .ml-card[data-tag-primary="celtic"],
body.library-page--dark .ml-card[data-tag-primary="medieval"] {
  border-color: rgba(80, 115, 200, 0.30);
}
body.library-page--dark .ml-card[data-tag-primary="epic"]:hover,
body.library-page--dark .ml-card[data-tag-primary="fantasy"]:hover,
body.library-page--dark .ml-card[data-tag-primary="celtic"]:hover,
body.library-page--dark .ml-card[data-tag-primary="medieval"]:hover {
  border-color: rgba(95, 130, 220, 0.50);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(80, 115, 200, 0.14),
    inset 0 1px 0 rgba(160, 190, 255, 0.05);
}

/* 悲しい・記憶 → 鋼青 */
body.library-page--dark .ml-card[data-tag-primary="sad"],
body.library-page--dark .ml-card[data-tag-primary="memory"]  {
  border-color: rgba(75, 118, 195, 0.28);
}

/* ===================================================================
   § 18. お気に入りカード — 静かな特別感
   :has() で .ml-btn-fav.is-fav を持つカードに暖色アクセントを付与
   =================================================================== */

body.library-page--dark .ml-card:has(.ml-btn-fav.is-fav) {
  border-color: rgba(220, 145, 50, 0.38);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(200, 120, 30, 0.12),
    0 0 40px rgba(180, 90, 20, 0.06),
    inset 0 1px 0 rgba(255, 210, 130, 0.07);
}

/* カード上部の琥珀ライン — "光が宿った曲" の印 */
body.library-page--dark .ml-card:has(.ml-btn-fav.is-fav)::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 165, 55, 0.80) 0%,
    rgba(255, 140, 40, 0.40) 45%,
    transparent 80%
  );
  border-radius: 24px 24px 0 0;
  z-index: 3;
  pointer-events: none;
}

body.library-page--dark .ml-card:has(.ml-btn-fav.is-fav):hover {
  border-color: rgba(255, 160, 55, 0.55);
}

/* ===================================================================
   § 19. 呼吸アニメーション — 「ここは、音楽が眠る場所。」
   .ml-intro が is-revealed になった後、ごく静かに呼吸する。
   opacity: 0.92↔1.0 / scale: 1.000↔1.013 / translateY: 0↔-2px
   =================================================================== */

@keyframes breatheText {
  0%, 100% {
    opacity:   0.92;
    transform: scale(1.000) translateY(0px);
  }
  50% {
    opacity:   1.00;
    transform: scale(1.013) translateY(-2px);
  }
}

body.library-page--dark .ml-intro.is-revealed .ml-intro__main {
  animation: breatheText 5.5s ease-in-out 0.9s infinite;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* ===================================================================
   § 20. レスポンシブグリッド
   =================================================================== */

/* 1200px: 3列がデフォルトになったため個別指定不要 */

@media (max-width: 820px) {
  body.library-page--dark .ml-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: none;   /* 小画面はフル幅を使う */
    gap: 1rem;
  }
}

@media (max-width: 500px) {
  body.library-page--dark .ml-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
}

/* reduced-motion 追加: 呼吸・精霊アニメーション無効 */
@media (prefers-reduced-motion: reduce) {
  body.library-page--dark .ml-intro.is-revealed .ml-intro__main {
    animation: none;
  }
}

/* ===================================================================
   § 12. お気に入りモーダル → fav-modal.css に移管（TOP/Library共用）
   music-library.html は fav-modal.css を <link> で読み込むこと
   =================================================================== */

/* ── ユーザータグ（旅人が曲に付けたタグ）─────────────────
   公式58タグ＝「どんな音か」／ユーザータグ＝「どこで鳴ったか」。
   別の軸であることが一目で分かるよう、足あとと同じ金の系統で分ける。 */
body.library-page--dark .ml-filter-group--user .ml-filter-group-icon { color: rgba(209, 184, 122, 0.9); }

body.library-page--dark .ml-usertag-note {
  flex-basis: 100%;
  margin: 0 0 8px;
  font-size: 0.72rem;
  line-height: 1.7;
  color: rgba(200, 190, 165, 0.55);
}
body.library-page--dark .ml-usertag-note a {
  color: rgba(226, 206, 156, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(209, 184, 122, 0.3);
}
body.library-page--dark .ml-usertag-note a:hover { color: #f0d99a; border-bottom-color: rgba(240, 217, 154, 0.8); }

body.library-page--dark .ml-chip--user {
  background: rgba(36, 30, 18, 0.9);
  border-color: rgba(209, 184, 122, 0.3);
  color: rgba(226, 206, 156, 0.9);
}
body.library-page--dark .ml-chip--user:hover {
  background: rgba(90, 72, 34, 0.5);
  border-color: rgba(226, 196, 124, 0.6);
  color: #f2e2b6;
}
body.library-page--dark .ml-chip--user.active,
body.library-page--dark .ml-chip--user[aria-pressed="true"] {
  background: rgba(150, 118, 50, 0.26);
  border-color: rgba(232, 200, 128, 0.65);
  color: #f6e8bf;
  box-shadow: 0 0 12px rgba(214, 178, 100, 0.22);
}
body.library-page--dark .ml-chip--user .ml-chip-count {
  margin-left: 6px;
  font-size: 0.68em;
  opacity: 0.6;
}

/* 左レール側のユーザータグ（表示されているのはこちら） */
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-left-tag-group__icon { color: rgba(209, 184, 122, 0.9); }
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-chip {
  background: rgba(36, 30, 18, 0.9);
  border-color: rgba(209, 184, 122, 0.3);
  color: rgba(226, 206, 156, 0.9);
}
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-chip:hover {
  background: rgba(90, 72, 34, 0.5);
  border-color: rgba(226, 196, 124, 0.6);
  color: #f2e2b6;
}
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-chip.active,
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-chip.is-active,
body.library-page--dark .ml-left-tag-group[data-category="usertag"] .ml-chip[aria-pressed="true"] {
  background: rgba(150, 118, 50, 0.28);
  border-color: rgba(232, 200, 128, 0.7);
  color: #f6e8bf;
}

/* /assets/css/cardtools-forest-glass.css?v=20260519-3 */
/* =====================================================================
   H/MIX MUSIC LIBRARY — cardtools=forest-glass
   "新緑のガラス" card variant — opt-in via ?cardtools=forest-glass

   Mount: body[data-cardtools="forest-glass"] is set by music-library.js
          when the URL carries ?cardtools=forest-glass

   All rules are scoped under that attribute so this file is a no-op
   when the param is absent.

   Required card DOM (created by music-library.js when the attr is on):
     <div class="fg-perspective">
       <article class="ml-card">
         <div class="ml-card-jacket"></div>
         <div class="fg-noise"></div>
         <div class="fg-iridescent"></div>
         <div class="fg-iridescent fg-iridescent--sharp"></div>
         <div class="fg-specular"></div>
         <div class="fg-gloss"></div>
         <div class="fg-halo"></div>
         <div class="ml-card-inner">...existing inner markup...</div>
       </article>
     </div>

   Pointer tracking writes --mx, --my, --rx, --ry onto .ml-card.
   ===================================================================== */

body[data-cardtools="forest-glass"] {
  /* ── Effect knobs ──────────────────────────────────────────────── */

  /* 視点・動き */
  --fg-tilt-max:        8deg;
  --fg-hover-lift:      6px;
  --fg-hover-scale:     1.018;

  /* 透明感（ガラスの厚み） */
  --fg-surface-alpha:   0.24;
  --fg-surface-blur:    24px;
  --fg-surface-tint:    0.30;

  /* 光の反射 — defaults tuned for 新緑の眩しい光 */
  --fg-light-hue:       132;
  --fg-light-peak:      0.995;
  --fg-light-chroma:    0.16;
  --fg-ambient-light:   0.22;
  --fg-specular-alpha:  0.28;
  --fg-specular-size:   32%;
  --fg-specular-sharp:  0.62;
  --fg-secondary-spec:  0.42;
  --fg-iri-alpha:       0.30;
  --fg-iri-shift:       0deg;
  --fg-reveal-edge:     0.30;

  /* 外側のグロー */
  --fg-glow-hue:        142;
  --fg-glow-alpha:      0.16;

  /* 表面のテクスチャ */
  --fg-noise-alpha:     0.05;
}

/* =====================================================================
   Perspective wrapper
   ===================================================================== */
body[data-cardtools="forest-glass"] .fg-perspective {
  perspective: 1200px;
  perspective-origin: 50% 50%;
  /* NOTE: no transform-style: preserve-3d — preserve-3d isolates each
     descendant into its own 3D rendering context, which breaks
     mix-blend-mode on the light/iridescent layers. */
}

/* =====================================================================
   Card — glass surface
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card {
  position: relative;
  border: 1px solid rgba(126, 203, 149, 0.22);
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  transform: none;
  transform-origin: 50% 50%;
  transition:
    transform .35s cubic-bezier(.2,.7,.2,1),
    box-shadow .35s,
    border-color .35s;
  will-change: transform;

  background:
    radial-gradient(140% 70% at 50% 0%,
      oklch(0.62 0.14 var(--fg-light-hue) /
        calc(0.22 * var(--fg-surface-alpha) * var(--fg-surface-tint))),
      transparent 55%),
    radial-gradient(120% 80% at 50% 0%,
      oklch(0.34 0.07 152 / calc(0.55 * var(--fg-surface-alpha))),
      transparent 60%),
    linear-gradient(160deg,
      oklch(0.27 0.05 152 / var(--fg-surface-alpha)) 0%,
      oklch(0.20 0.04 152 / var(--fg-surface-alpha)) 55%,
      oklch(0.16 0.03 152 / var(--fg-surface-alpha)) 100%);

  backdrop-filter: blur(var(--fg-surface-blur)) saturate(1.05);
  -webkit-backdrop-filter: blur(var(--fg-surface-blur)) saturate(1.05);
  background-color: transparent !important; /* override dark-theme override */

  box-shadow:
    inset 0 1px 0 oklch(0.96 0.10 var(--fg-light-hue) /
      calc(var(--fg-reveal-edge) * 0.7)),
    inset 0 0 0 1px oklch(0.74 0.06 142 / 0.06),
    0 1px 1px oklch(0.04 0.005 150 / 0.4),
    0 12px 30px -10px oklch(0.04 0.005 150 / 0.55);
}

/* Override the dark-theme is-playing box-shadow with our own */
body[data-cardtools="forest-glass"] .ml-card.is-playing {
  border-color: oklch(0.86 0.14 142 / 0.6) !important;
  box-shadow:
    inset 0 1px 0 oklch(0.92 0.10 152 / 0.5),
    inset 0 0 0 1px oklch(0.86 0.14 142 / 0.25),
    0 0 0 1px oklch(0.86 0.14 142 / 0.35),
    0 24px 50px -12px oklch(0.04 0.005 150 / 0.7),
    0 0 80px -8px oklch(0.74 0.16 142 / 0.45) !important;
}

/* =====================================================================
   Jacket — bright young-leaf light spill replacing the dark gradient
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card-jacket {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% -10%,
      oklch(0.78 0.14 var(--fg-light-hue) / calc(0.55 * var(--fg-surface-tint))),
      transparent 60%),
    radial-gradient(ellipse 50% 40% at 82% 14%,
      oklch(0.92 0.12 110 / calc(0.20 * var(--fg-surface-tint))),
      transparent 60%),
    linear-gradient(170deg,
      oklch(0.26 0.07 var(--fg-light-hue) / calc(0.85 * var(--fg-surface-alpha))) 0%,
      oklch(0.14 0.03 150 / calc(0.95 * var(--fg-surface-alpha))) 100%) !important;
  opacity: calc(0.18 + 0.42 * var(--fg-surface-alpha)) !important;
  transition: transform var(--transition-slow, .5s);
}

/* Existing tag-primary gradients on .ml-card-jacket are overridden above
   so the whole grid reads as one consistent "forest glass" palette. */

body[data-cardtools="forest-glass"] .ml-card-jacket::before,
body[data-cardtools="forest-glass"] .ml-card-jacket::after {
  display: none;
}

/* leaf-veined fine pattern layered on the jacket */
body[data-cardtools="forest-glass"] .ml-card-jacket::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg,
      oklch(0.92 0.08 152 / 0.05) 0 1px,
      transparent 1px 14px),
    repeating-linear-gradient(25deg,
      oklch(0.86 0.10 90 / 0.03) 0 1px,
      transparent 1px 22px);
  mix-blend-mode: plus-lighter;
  opacity: 0.55;
  pointer-events: none;
}

/* =====================================================================
   Effect layers
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card > .fg-noise,
body[data-cardtools="forest-glass"] .ml-card > .fg-iridescent,
body[data-cardtools="forest-glass"] .ml-card > .fg-specular,
body[data-cardtools="forest-glass"] .ml-card > .fg-gloss {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

body[data-cardtools="forest-glass"] .ml-card > .fg-halo {
  display: block;
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

/* Iridescent sheen — soft pass */
body[data-cardtools="forest-glass"] .fg-iridescent {
  background:
    conic-gradient(from calc(120deg + var(--fg-iri-shift)),
      oklch(0.96 0.14 var(--fg-light-hue) / 0.0)  0deg,
      oklch(0.98 0.14 var(--fg-light-hue) / 0.85) 28deg,
      oklch(0.99 0.10 100 / 0.75) 60deg,
      oklch(0.95 0.18 130 / 0.85) 95deg,
      oklch(0.92 0.16 152 / 0.65) 140deg,
      oklch(0.86 0.18 142 / 0.70) 180deg,
      oklch(0.94 0.14 122 / 0.55) 230deg,
      oklch(0.99 0.10 100 / 0.40) 290deg,
      oklch(0.96 0.14 var(--fg-light-hue) / 0.0) 360deg);
  -webkit-mask-image:
    radial-gradient(circle at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      black 0%, black 14%, transparent 58%);
          mask-image:
    radial-gradient(circle at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      black 0%, black 14%, transparent 58%);
  mix-blend-mode: plus-lighter;
  opacity: calc(var(--fg-iri-alpha) *
    (var(--fg-ambient-light) + var(--fg-hover-active, 0) * 0.22));
  transition: opacity .35s ease;
  filter: blur(5px) saturate(1.35);
}

/* Iridescent — sharp pass */
body[data-cardtools="forest-glass"] .fg-iridescent--sharp {
  filter: none;
  mix-blend-mode: plus-lighter;
  opacity: calc(var(--fg-iri-alpha) * 0.28 *
    (var(--fg-ambient-light) * 0.5 + var(--fg-hover-active, 0) * 0.18));
  -webkit-mask-image:
    radial-gradient(circle at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      black 0%, black 6%, transparent 30%);
          mask-image:
    radial-gradient(circle at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      black 0%, black 6%, transparent 30%);
}

/* Specular — bright young-leaf hotspot following the pointer */
body[data-cardtools="forest-glass"] .fg-specular {
  background:
    radial-gradient(
      calc(var(--fg-specular-size) * (0.18 + (1 - var(--fg-specular-sharp)) * 0.10))
      calc(var(--fg-specular-size) * (0.18 + (1 - var(--fg-specular-sharp)) * 0.10))
      at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      oklch(var(--fg-light-peak) var(--fg-light-chroma) var(--fg-light-hue) /
        calc(var(--fg-specular-alpha) * var(--fg-secondary-spec))) 0%,
      oklch(0.95 0.18 var(--fg-light-hue) /
        calc(var(--fg-specular-alpha) * var(--fg-secondary-spec) * 0.55)) 28%,
      transparent 60%),
    radial-gradient(
      var(--fg-specular-size) var(--fg-specular-size)
      at calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%),
      oklch(var(--fg-light-peak) var(--fg-light-chroma) var(--fg-light-hue) /
        calc(var(--fg-specular-alpha) * (0.9 - var(--fg-specular-sharp) * 0.3))) 0%,
      oklch(0.92 0.18 calc(var(--fg-light-hue) + 14) /
        calc(var(--fg-specular-alpha) * 0.55)) 22%,
      oklch(0.88 0.16 152 /
        calc(var(--fg-specular-alpha) * 0.30)) 45%,
      transparent 70%);
  mix-blend-mode: plus-lighter;
  opacity: calc(var(--fg-ambient-light) * 0.45 + var(--fg-hover-active, 0) * 0.22);
  transition: opacity .35s ease;
  filter: saturate(1.15);
}

/* Top-edge gloss */
body[data-cardtools="forest-glass"] .fg-gloss {
  background:
    linear-gradient(180deg,
      oklch(0.96 0.14 var(--fg-light-hue) / calc(var(--fg-reveal-edge) * 0.6)) 0%,
      oklch(0.92 0.10 var(--fg-light-hue) / 0) 18%,
      transparent 100%),
    linear-gradient(95deg,
      transparent 0%,
      oklch(0.95 0.06 var(--fg-light-hue) / calc(var(--fg-reveal-edge) * 0.10)) 6%,
      transparent 18%);
  mix-blend-mode: plus-lighter;
}

/* Outer halo */
body[data-cardtools="forest-glass"] .fg-halo {
  background: radial-gradient(ellipse 75% 60% at 50% 50%,
    oklch(0.78 0.18 var(--fg-glow-hue) /
      calc(var(--fg-glow-alpha) *
        (var(--fg-ambient-light) * 0.4 + var(--fg-hover-active, 0) * 0.22))),
    transparent 70%);
  filter: blur(26px);
  opacity: calc(var(--fg-ambient-light) * 0.5 + var(--fg-hover-active, 0) * 0.20);
  transition: opacity .45s ease;
}

/* Noise overlay */
body[data-cardtools="forest-glass"] .fg-noise {
  opacity: var(--fg-noise-alpha);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.65 0'/></filter><rect width='100%25' height='100%25' filter='url(/assets/css/%23n)'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

/* =====================================================================
   Inner content sits above all effect layers
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card-inner {
  position: relative;
  z-index: 2;
}

/* =====================================================================
   Hover — full light activation + perspective tilt
   --fg-hover-active is toggled to 1 via :hover
   --mx/--my/--rx/--ry are written by JS (pointer tracking)
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card:hover {
  --fg-hover-active: 1;
  border-color: oklch(0.92 0.10 var(--fg-light-hue) / 0.24);
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.12 var(--fg-light-hue) /
      calc(var(--fg-reveal-edge) * 0.72)),
    inset 0 0 0 1px oklch(0.92 0.10 var(--fg-light-hue) / 0.08),
    0 2px 2px oklch(0.04 0.005 150 / 0.45),
    0 24px 50px -12px oklch(0.04 0.005 150 / 0.7),
    0 0 60px -8px oklch(0.78 0.18 var(--fg-glow-hue) /
      calc(var(--fg-glow-alpha) * 0.7));
}

body[data-cardtools="forest-glass"] .fg-perspective:hover .ml-card {
  transform:
    rotateX(calc(var(--ry, 0) * var(--fg-tilt-max) * -1))
    rotateY(calc(var(--rx, 0) * var(--fg-tilt-max)))
    translateY(calc(var(--fg-hover-lift) * -1))
    scale(var(--fg-hover-scale));
}

/* =====================================================================
   Creator tools button
   ===================================================================== */
body[data-cardtools="forest-glass"] .ml-card-actions {
  align-items: center;
  gap: 8px;
}

body[data-cardtools="forest-glass"] .ml-btn-play,
body[data-cardtools="forest-glass"] .ml-btn-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
  min-height: 36px;
  padding: 0.48rem 0.92rem 0.48rem 0.72rem;
  border: 1px solid oklch(0.82 0.10 90 / 0.36);
  border-radius: 999px;
  color: oklch(0.96 0.04 142);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      oklch(0.86 0.10 90 / 0.20),
      transparent 70%),
    linear-gradient(180deg,
      oklch(0.42 0.10 150 / 0.95),
      oklch(0.30 0.08 152 / 0.95));
  box-shadow:
    inset 0 1px 0 oklch(0.92 0.08 152 / 0.5),
    inset 0 -1px 0 oklch(0.10 0.03 150 / 0.5),
    0 4px 14px -3px oklch(0.20 0.06 152 / 0.6);
  overflow: hidden;
  isolation: isolate;
}

body[data-cardtools="forest-glass"] .ml-btn-play {
  min-width: 92px;
  border-color: oklch(0.78 0.09 152 / 0.34);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      oklch(0.78 0.10 152 / 0.14),
      transparent 70%),
    linear-gradient(180deg,
      oklch(0.34 0.08 152 / 0.92),
      oklch(0.24 0.06 152 / 0.92));
}

body[data-cardtools="forest-glass"] .ml-btn-tools {
  min-width: 132px;
}

body[data-cardtools="forest-glass"] .ml-btn-play::before,
body[data-cardtools="forest-glass"] .ml-btn-tools::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg,
      oklch(0.92 0.08 152 / 0) 0 6px,
      oklch(0.92 0.08 152 / 0.08) 6px 7px);
  opacity: 0.7;
}

body[data-cardtools="forest-glass"] .ml-btn-play::after,
body[data-cardtools="forest-glass"] .ml-btn-tools::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 30%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(110deg,
    transparent 0%,
    oklch(0.99 0.05 92 / 0.20) 40%,
    oklch(0.92 0.10 152 / 0.14) 60%,
    transparent 100%);
  filter: blur(3px);
  transform: skewX(-18deg);
  transition: left .7s cubic-bezier(.2,.7,.2,1);
}

body[data-cardtools="forest-glass"] .ml-card:hover .ml-btn-play::after,
body[data-cardtools="forest-glass"] .ml-btn-play:hover::after,
body[data-cardtools="forest-glass"] .ml-card:hover .ml-btn-tools::after,
body[data-cardtools="forest-glass"] .ml-btn-tools:hover::after {
  left: 130%;
}

body[data-cardtools="forest-glass"] .ml-btn-play .play-icon-svg {
  color: oklch(0.94 0.08 152);
  filter: drop-shadow(0 0 3px oklch(0.78 0.12 152 / 0.35));
}

body[data-cardtools="forest-glass"] .ml-btn-tools .tools-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: oklch(0.96 0.08 92);
  filter: drop-shadow(0 0 3px oklch(0.86 0.10 90 / 0.35));
}

body[data-cardtools="forest-glass"] .ml-btn-tools .tools-pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(0.92 0.16 142);
  box-shadow: 0 0 4px oklch(0.92 0.16 142 / 0.45);
  animation: fgToolsPulse 2.4s ease-in-out infinite;
}

body[data-cardtools="forest-glass"] .ml-btn-play:hover {
  border-color: oklch(0.90 0.10 152 / 0.42);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      oklch(0.82 0.11 152 / 0.18),
      transparent 70%),
    linear-gradient(180deg,
      oklch(0.39 0.10 152 / 0.94),
      oklch(0.28 0.08 152 / 0.94));
  box-shadow:
    inset 0 1px 0 oklch(0.92 0.10 152 / 0.34),
    inset 0 -1px 0 oklch(0.10 0.03 150 / 0.5),
    0 6px 18px -3px oklch(0.16 0.07 152 / 0.65),
    0 0 16px -7px oklch(0.78 0.12 152 / 0.24);
}

body[data-cardtools="forest-glass"] .ml-btn-tools:hover {
  border-color: oklch(0.92 0.10 90 / 0.40);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      oklch(0.86 0.10 90 / 0.16),
      transparent 70%),
    linear-gradient(180deg,
      oklch(0.48 0.12 148 / 0.95),
      oklch(0.34 0.10 152 / 0.95));
  box-shadow:
    inset 0 1px 0 oklch(0.92 0.10 152 / 0.38),
    inset 0 -1px 0 oklch(0.10 0.03 150 / 0.5),
    0 6px 18px -3px oklch(0.20 0.08 152 / 0.7),
    0 0 18px -6px oklch(0.86 0.10 90 / 0.24);
}

@keyframes fgToolsPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.10); }
}

/* =====================================================================
   Mobile / reduced motion fallbacks
   ===================================================================== */
@media (hover: none), (max-width: 720px) {
  body[data-cardtools="forest-glass"] .fg-perspective:hover .ml-card {
    transform: none;
  }
  body[data-cardtools="forest-glass"] .fg-perspective { perspective: none; }
  /* keep ambient light, drop pointer-driven layers */
  body[data-cardtools="forest-glass"] .fg-iridescent--sharp { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-cardtools="forest-glass"] .ml-card,
  body[data-cardtools="forest-glass"] .fg-perspective:hover .ml-card {
    transition: none !important;
    transform: none !important;
  }
  body[data-cardtools="forest-glass"] .ml-btn-tools .tools-pip {
    animation: none;
  }
}

/* /assets/css/fav-modal.css?v=20260629c */
/**
 * H/MIX GALLERY — fav-modal.css
 * お気に入りリストモーダル（共通スタイル）
 * TOP / Music Library 両ページで読み込む
 */

/* スクロールロック */
body.fav-modal-open {
  overflow: hidden;
}

/* モーダルルート — 非表示状態は hidden 属性 */
/* bottom: 88px でプレイヤー（height:88px / z-index:1200）を常に露出させる */
/* CSS変数をここで上書き → どのページから開いても Library dark と完全同一 */
.fav-modal {
  position: fixed;
  inset: 0 0 88px 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;

  /* ── Library dark テーマ変数をモーダルスコープに固定 ── */
  --color-text:         #e8f5ec;
  --color-text-muted:   #b0c8b8;
  --color-text-dim:     #6e8f76;
  --color-green:        #7ecb95;
  --color-green-light:  #9adfb4;
  --color-green-pale:   rgba(100, 200, 140, 0.12);
  --color-border:       rgba(100, 180, 130, 0.18);
}
.fav-modal[hidden] {
  display: none;
}

/* バックドロップ */
.fav-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 7, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* パネル */
.fav-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 2rem));
  height: min(580px, calc(100vh - 88px - 3rem));
  display: flex;
  flex-direction: column;
  background: rgba(14, 26, 18, 0.97);
  border: 1px solid rgba(100, 180, 130, 0.25);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(60, 140, 90, 0.08),
    0 12px 60px rgba(0, 0, 0, 0.72),
    0 0 40px rgba(40, 110, 70, 0.14);
  animation: favModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes favModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ヘッダー */
.fav-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(100, 180, 130, 0.12);
  flex-shrink: 0;
}

.fav-modal__title {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--color-green-light, #9adfb4);
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.fav-modal__total {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.70rem;
  letter-spacing: 0.06em;
  color: var(--color-text-dim, #6e8f76);
  font-weight: 400;
}

.fav-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(140, 180, 155, 0.50);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.fav-modal__close:hover {
  color: rgba(180, 220, 195, 0.90);
  border-color: rgba(100, 180, 130, 0.28);
  background: rgba(60, 140, 90, 0.12);
}
.fav-modal__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ボディ — スクロール可能 */
.fav-modal__body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 160, 110, 0.30) transparent;
}
.fav-modal__body::-webkit-scrollbar { width: 4px; }
.fav-modal__body::-webkit-scrollbar-track { background: transparent; }
.fav-modal__body::-webkit-scrollbar-thumb {
  background: rgba(80, 160, 110, 0.30);
  border-radius: 2px;
}

/* リスト */
.fav-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* アイテム */
.fav-modal__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.60rem 1.5rem;
  border-bottom: 1px solid rgba(80, 140, 100, 0.08);
  transition: background 0.15s ease;
}
.fav-modal__item:last-child { border-bottom: none; }
.fav-modal__item:hover { background: rgba(60, 120, 85, 0.10); }

/* 削除アニメーション */
.fav-modal__item--removing {
  overflow: hidden;
  animation: favItemOut 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes favItemOut {
  from { opacity: 1; max-height: 60px; padding-top: 0.60rem; padding-bottom: 0.60rem; }
  to   { opacity: 0; max-height: 0;    padding-top: 0;       padding-bottom: 0;       }
}

/* 再生ボタン */
.fav-modal__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(60, 130, 85, 0.18);
  border: 1px solid rgba(80, 160, 110, 0.28);
  color: rgba(120, 210, 155, 0.85);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.fav-modal__play:hover {
  background: rgba(70, 150, 100, 0.30);
  border-color: rgba(100, 190, 140, 0.50);
  color: rgba(160, 230, 185, 1);
  box-shadow: 0 0 10px rgba(80, 180, 120, 0.22);
}
.fav-modal__play svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  margin-left: 1px;
}

/* トラック情報 */
.fav-modal__info {
  flex: 1 1 0;
  min-width: 0;
}
.fav-modal__track-title {
  font-size: 0.82rem;
  color: var(--color-text, #e8f5ec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.fav-modal__track-tags {
  font-size: 0.65rem;
  color: var(--color-text-dim, #6e8f76);
  margin-top: 0.18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.03em;
}

/* 削除ボタン */
.fav-modal__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(200, 138, 50, 0.35);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.fav-modal__remove:hover {
  color: rgba(255, 168, 60, 0.88);
  border-color: rgba(255, 145, 45, 0.28);
  background: rgba(180, 100, 18, 0.14);
  box-shadow: 0 0 6px rgba(255, 160, 55, 0.20);
}
.fav-modal__remove svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* 空状態 */
.fav-modal__empty {
  text-align: center;
  color: var(--color-text-dim, #6e8f76);
  font-size: 0.80rem;
  padding: 3rem 2rem;
  margin: 0;
  letter-spacing: 0.06em;
}
.fav-modal__empty[hidden] { display: none; }

/* フッター */
.fav-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(100, 180, 130, 0.10);
  flex-shrink: 0;
}
.fav-modal__footer[hidden] { display: none; }

.fav-modal__footer-play {
  display: flex;
  gap: 0.5rem;
}

/* 再生・シャッフル・シアター再生ボタン */
.fav-modal__play-all,
.fav-modal__shuffle-all,
.fav-modal__play-theater {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(120, 210, 155, 0.80);
  background: rgba(40, 100, 65, 0.15);
  border: 1px solid rgba(80, 160, 110, 0.28);
  border-radius: 3px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.fav-modal__play-all:hover,
.fav-modal__shuffle-all:hover,
.fav-modal__play-theater:hover {
  color: rgba(160, 235, 190, 0.95);
  border-color: rgba(100, 190, 140, 0.50);
  background: rgba(50, 120, 80, 0.25);
  box-shadow: 0 0 8px rgba(80, 180, 120, 0.15);
}
.fav-modal__play-all:disabled,
.fav-modal__shuffle-all:disabled,
.fav-modal__play-theater:disabled {
  color: rgba(80, 120, 95, 0.35);
  border-color: rgba(60, 100, 75, 0.18);
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* まとめてDLボタン */
.fav-modal__dl-all {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(210, 148, 62, 0.78);
  background: rgba(140, 90, 18, 0.12);
  border: 1px solid rgba(200, 130, 45, 0.28);
  border-radius: 3px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.fav-modal__dl-all:hover {
  color: rgba(255, 184, 88, 0.96);
  border-color: rgba(255, 148, 45, 0.48);
  background: rgba(160, 100, 18, 0.20);
  box-shadow:
    0 0 8px  rgba(255, 170, 60, 0.28),
    0 0 18px rgba(255, 120, 35, 0.12);
}
.fav-modal__dl-all:disabled {
  color: rgba(160, 120, 55, 0.28);
  border-color: rgba(160, 110, 40, 0.14);
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.fav-modal__clear {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(190, 130, 50, 0.55);
  background: transparent;
  border: 1px solid rgba(200, 130, 45, 0.20);
  border-radius: 3px;
  padding: 0.4rem 1.25rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.fav-modal__clear:hover {
  color: rgba(255, 168, 60, 0.88);
  border-color: rgba(255, 145, 45, 0.40);
  background: rgba(180, 100, 18, 0.12);
}

/* ── アイテム内レイアウト（チェックボックス対応） ── */
.fav-modal__item {
  gap: 0; /* innerDivに任せる */
  padding: 0;
}
.fav-modal__item-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.60rem 1.5rem 0.60rem 0.5rem;
  flex: 1 1 0;
  min-width: 0;
}

/* チェックボックス（申請選択） */
.fav-modal__select {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin: 0 0 0 1.5rem;
  cursor: pointer;
  accent-color: var(--color-green, #7ecb95);
  opacity: 0.75;
  transition: opacity 0.15s;
}
.fav-modal__select:hover,
.fav-modal__select:focus-visible {
  opacity: 1;
  outline: 1px solid rgba(100, 200, 140, 0.5);
  outline-offset: 2px;
}
.fav-modal__select:checked {
  opacity: 1;
}

/* チェック済みアイテムの背景 */
.fav-modal__item:has(.fav-modal__select:checked) {
  background: rgba(60, 120, 85, 0.08);
}
.fav-modal__item:has(.fav-modal__select:checked) .fav-modal__track-title {
  color: var(--color-green-light, #9adfb4);
}

/* ── フッター：ライセンス申請行 ── */
.fav-modal__footer {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.fav-modal__footer-license {
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(100, 180, 130, 0.10);
}

.fav-modal__apply-license {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  color: rgba(200, 158, 72, 0.90);
  background: rgba(130, 88, 18, 0.14);
  border: 1px solid rgba(200, 148, 50, 0.32);
  border-radius: 3px;
  padding: 0.50rem 1rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.fav-modal__apply-license:hover:not(:disabled) {
  color: rgba(255, 200, 100, 1);
  border-color: rgba(255, 175, 70, 0.55);
  background: rgba(160, 105, 20, 0.24);
  box-shadow: 0 0 10px rgba(255, 180, 70, 0.18);
}
.fav-modal__apply-license:disabled {
  color: rgba(150, 118, 58, 0.32);
  border-color: rgba(160, 120, 45, 0.16);
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.fav-modal__apply-license svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fav-modal__apply-count {
  font-size: 0.68rem;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

/* 心臓→ライセンスの血管: 選択があると脈動＋矢印（消えていた導線の正式版） */
.fav-modal__apply-license.is-ready {
  color: rgba(255, 205, 110, 1);
  border-color: rgba(255, 180, 80, 0.55);
  background: rgba(160, 105, 20, 0.22);
  animation: favLicensePulse 2.4s ease-in-out infinite;
}
.fav-modal__apply-license.is-ready::after {
  content: "\2192"; /* → */
  margin-left: 0.15em;
  font-weight: 600;
  transition: transform 0.18s ease;
}
.fav-modal__apply-license.is-ready:hover::after { transform: translateX(3px); }
@keyframes favLicensePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 180, 70, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(255, 180, 70, 0.14); }
}
@media (prefers-reduced-motion: reduce) {
  .fav-modal__apply-license.is-ready { animation: none; }
}

/* パック誘導バナー（4曲以上で表示） */
.fav-modal__packhint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(150, 110, 30, 0.12);
  border: 1px solid rgba(212, 164, 76, 0.28);
  border-radius: 4px;
  flex-shrink: 0;
}
.fav-modal__packhint[hidden] { display: none; }
.fav-modal__packhint-text {
  flex: 1 1 auto;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: rgba(220, 180, 110, 0.92);
}
.fav-modal__packhint-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(220, 180, 110, 0.55);
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.fav-modal__packhint-close:hover {
  color: rgba(255, 205, 120, 0.95);
  background: rgba(150, 110, 30, 0.20);
}

/* レスポンシブ */
@media (max-width: 600px) {
  .fav-modal__panel {
    height: calc(100vh - 88px - 0.5rem);
    border-radius: 6px 6px 0 0;
    align-self: flex-end;
  }
}

/* ============================================================
   「ひとつの心臓」常駐ハート・ハブ ＋ 飛ぶハート ＋ 初回オンボーディング
   お気に入りをサイトの主役に。世界観(深緑×金)で常駐・脈打つ。
   ============================================================ */
/* ポケットの心臓: HERO中央紋章と同意匠の円形メダリオン */
#hmix-fav-hub{
  position: fixed; right: clamp(12px,2vw,26px); bottom: clamp(76px,12vh,104px);
  z-index: 2147483500; display: grid; place-items: center; padding: 0;
  width: clamp(50px,6vw,58px); height: clamp(50px,6vw,58px);
  border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: rgba(10,18,13,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(202,164,78,.40); box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  color: #e7ca7c; font-family: 'Noto Sans JP', system-ui, sans-serif;
  transition: transform .25s ease, box-shadow .3s ease, border-color .3s ease, background .3s ease;
}
#hmix-fav-hub:hover, #hmix-fav-hub:focus-visible{
  transform: translateY(-2px) scale(1.06); outline: none;
  border-color: rgba(230,200,122,.78); background: rgba(16,26,19,.7);
  box-shadow: 0 14px 38px -10px rgba(0,0,0,.7), 0 0 20px rgba(202,164,78,.35);
}
#hmix-fav-hub .hfh-crest{ grid-area: 1/1; display: block; width: 86%; height: 86%; }
#hmix-fav-hub .hfh-crest svg{ width: 100%; height: 100%; display: block; transition: filter .35s ease; }
#hmix-fav-hub.has-fav .hfh-crest svg{ filter: drop-shadow(0 0 5px rgba(255,200,110,.6)); }
/* 0件は輪郭ハート＝「これから集める」余白（中央と同じ作法） */
#hmix-fav-hub:not(.has-fav) .hfh-heart-shape{ fill: rgba(231,202,124,.12); }
#hmix-fav-hub .hfh-count{
  grid-area: 1/1; z-index: 2; transform: translateY(1px);
  font-weight: 600; font-size: clamp(13px,1.5vw,15px); text-align: center;
  color: #3a2c10; text-shadow: 0 1px 0 rgba(255,245,200,.5);
}
#hmix-fav-hub:not(.has-fav) .hfh-count{ color: rgba(245,236,220,.9); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
#hmix-fav-hub.has-fav{ animation: hfhBreathe 3.6s ease-in-out infinite; }
@keyframes hfhBreathe{
  0%,100%{ box-shadow: 0 10px 30px -10px rgba(0,0,0,.6), 0 0 0 0 rgba(255,200,110,0); }
  50%    { box-shadow: 0 10px 30px -10px rgba(0,0,0,.6), 0 0 0 7px rgba(255,200,110,.10); }
}
@keyframes hfhPulse{ 0%{transform:scale(1);} 28%{transform:scale(1.28);} 55%{transform:scale(.93);} 100%{transform:scale(1);} }
#hmix-fav-hub.hfh-pulse{ animation: hfhPulse .65s cubic-bezier(.22,1,.36,1); }

/* 飛ぶハート */
.hfh-fly{ position: fixed; z-index: 2147483600; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none;
  transition: transform .85s cubic-bezier(.5,0,.35,1), opacity .85s ease; }
.hfh-fly svg{ width: 100%; height: 100%; fill: #ff6f8c; filter: drop-shadow(0 0 6px rgba(255,150,170,.85)); }

/* 初回オンボーディング吹き出し */
.hfh-tip{ position: fixed; right: clamp(12px,2vw,26px); bottom: calc(clamp(76px,12vh,104px) + 58px);
  z-index: 2147483550; max-width: 244px; padding: 11px 15px; border-radius: 13px;
  background: rgba(12,20,15,.93); color: #eef0ea; border: 1px solid rgba(202,164,78,.42);
  font-family: 'Noto Sans JP', sans-serif; font-size: 12.5px; line-height: 1.65;
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.72); opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.hfh-tip.on{ opacity: 1; transform: translateY(0); }

@media print{ #hmix-fav-hub, .hfh-tip, .hfh-fly{ display: none !important; } }
@media (prefers-reduced-motion: reduce){
  #hmix-fav-hub.has-fav, #hmix-fav-hub.hfh-pulse{ animation: none; }
  .hfh-fly{ transition: opacity .3s ease; }
}

/* /assets/css/credit-modal.css */
/**
 * H/MIX GALLERY — credit-modal.css
 * ダウンロード時クレジットコピーモーダル
 * fav-modal.css のデザインシステムに準拠
 */

/* ─── パネル固有スタイル ────────────────────────── */
.credit-dl-panel {
  width: min(480px, calc(100vw - 2rem));
  height: auto;
  max-height: calc(100vh - 88px - 3rem);
}

/* ─── ボディ ────────────────────────────────────── */
.credit-dl-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── マイクロコピー ────────────────────────────── */
.credit-dl-micro {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* ─── テキストエリア ────────────────────────────── */
.credit-dl-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(154, 223, 180, 0.25);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.75;
  color: #9adfb4;
  resize: none;
  outline: none;
  cursor: text;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.credit-dl-textarea:focus {
  border-color: rgba(154, 223, 180, 0.5);
}

/* ─── アクション行 ──────────────────────────────── */
.credit-dl-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── ボタン：共通 ──────────────────────────────── */
.credit-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  transition: all 0.15s;
  white-space: nowrap;
}

/* ─── プライマリ（コピーする） ───────────────────── */
.credit-dl-btn--primary {
  flex: 1;
  padding: 0.7rem 1.5rem;
  background: rgba(154, 223, 180, 0.12);
  border: 1px solid rgba(154, 223, 180, 0.4);
  color: #9adfb4;
  font-size: 0.95rem;
  font-weight: 500;
}

.credit-dl-btn--primary:hover {
  background: rgba(154, 223, 180, 0.2);
  border-color: rgba(154, 223, 180, 0.6);
}

.credit-dl-btn--primary.copied {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

/* ─── セカンダリ（.txt保存） ─────────────────────── */
.credit-dl-btn--secondary {
  padding: 0.7rem 1.2rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
}

.credit-dl-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

/* ─── 閉じるテキストリンク ─────────────────────── */
/* ── ハッシュタグセクション ── */
.credit-dl-hashtag-section {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(100, 180, 130, 0.12);
  border-radius: 8px;
  background: rgba(100, 180, 130, 0.04);
}
.credit-dl-hashtag-label {
  font-size: 0.7rem;
  color: rgba(180, 220, 195, 0.50);
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}
.credit-dl-hashtag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.credit-dl-hashtag-text {
  flex: 1;
  font-size: 0.8rem;
  color: rgba(154, 223, 180, 0.85);
  line-height: 1.5;
  word-break: break-all;
}
.credit-dl-btn--small {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(154, 223, 180, 0.30);
  background: rgba(154, 223, 180, 0.08);
  color: #9adfb4;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}
.credit-dl-btn--small:hover {
  background: rgba(154, 223, 180, 0.18);
}

.credit-dl-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
  cursor: pointer;
  align-self: center;
  transition: color 0.15s;
  padding: 0.25rem 0.5rem;
  letter-spacing: 0.04em;
}

.credit-dl-dismiss:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* /assets/css/theater.css?v=20260331-7 */
/* ============================================================
   THEATER MODE (FEATURED MUSIC IMPERSIVE EXPERIENCE)
   ============================================================ */

/* INP改善: theater open時のbody固定をクラスで一括適用 */
body.theater-body-lock {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: var(--theater-scroll-y, 0px);
}

.theater-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  /* visibility:hidden で非表示中は一切描画しない（bg-journey フラッシュ防止）*/
  visibility: hidden;
  transition: opacity 1.5s ease, visibility 0s linear 1.5s;
}

.theater-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 1.5s ease, visibility 0s linear 0s;
}

.theater-bg {
  position: absolute;
  inset: 0;
  /* 微かな星の光 — 完全な闇ではなく宇宙的な空間 */
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(154, 223, 180, 0.15), transparent),
    radial-gradient(1px 1px at 80% 70%, rgba(154, 223, 180, 0.10), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(200, 230, 210, 0.12), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(154, 223, 180, 0.08), transparent),
    radial-gradient(1.5px 1.5px at 65% 45%, rgba(200, 230, 210, 0.10), transparent),
    radial-gradient(1px 1px at 35% 90%, rgba(154, 223, 180, 0.12), transparent),
    radial-gradient(0.8px 0.8px at 92% 15%, rgba(180, 240, 200, 0.10), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(154, 223, 180, 0.08), transparent),
    #030403;
  z-index: 1;
  transition: background 1.5s ease;
}

.theater-window {
  position: relative;
  z-index: 2;
  width: min(94vw, 1300px);
  aspect-ratio: 16 / 9;
  transform: scale(0.95);
  transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theater-modal.is-open .theater-window {
  transform: scale(1);
}

/* Removed hard glass border for seamless portal effect */

.theater-scenery {
  position: absolute;
  inset: -15%; /* 枠をさらに広げ、フェードの距離を十分に確保 */
  background-color: #030403;
  background-image: none;
  background-size: cover;
  background-position: center;
  filter: brightness(0.8) contrast(1.1);
  transition: filter 2s ease;
  /* 複数のポイントで透明度をコントロールし、圧倒的に滑らかなグラデーションを作る */
  mask-image: radial-gradient(ellipse at center, 
    rgba(0,0,0,1) 15%, 
    rgba(0,0,0,0.8) 35%, 
    rgba(0,0,0,0.3) 55%, 
    rgba(0,0,0,0) 72%
  );
  -webkit-mask-image: radial-gradient(ellipse at center, 
    rgba(0,0,0,1) 15%, 
    rgba(0,0,0,0.8) 35%, 
    rgba(0,0,0,0.3) 55%, 
    rgba(0,0,0,0) 72%
  );
}

/* scenery 周縁のリムライト — 窓枠が光る */
.theater-scenery::after {
  content: '';
  position: absolute;
  inset: -15%;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(100, 180, 130, 0.03) 52%,
    rgba(80, 160, 110, 0.06) 56%,
    rgba(60, 140, 90, 0.03) 62%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 1;
}

/* Particles layer (fireflies) */
.theater-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* UI Layer */
.theater-ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 3rem;
  opacity: 0;
  pointer-events: none; /* Let clicks pass through the invisible parts */
  transition: opacity 1.2s ease 0.5s;
}

.theater-modal.is-open .theater-ui {
  opacity: 1;
}

.theater-top, .theater-bottom {
  pointer-events: auto; /* Buttons remain clickable */
}

.theater-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.theater-controls-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ── 帰還 + 全画面のペア ─────────────────────────────── */
.theater-controls-top-pair {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.theater-controls-top-pair__sep {
  display: block;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.theater-return-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.4rem 1.4rem;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all 0.4s ease;
  border-radius: 0;
}

.theater-return-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  letter-spacing: 0.32em;
}

.theater-fullscreen-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.4rem 1.1rem;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.4s ease;
  border-radius: 0;
  white-space: nowrap;
}

.theater-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  letter-spacing: 0.28em;
}

.theater-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 6px 14px 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}
.theater-close__label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.theater-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.90);
}

/* 全画面ボタン：物語性 */
.theater-fullscreen-btn--story {
  position: relative;
}
.theater-fullscreen-btn--story::after {
  content: '— すりガラスの向こうへ';
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Noto Serif JP', serif;
  font-size: 0.62rem;
  color: rgba(200, 220, 210, 0.40);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.theater-fullscreen-btn--story:hover::after {
  opacity: 1;
}

.theater-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
}

.theater-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theater-title {
  font-family: var(--font-serif-jp, serif);
  font-size: 2rem;
  font-weight: 300;
  color: rgba(255, 250, 240, 0.95);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  margin: 0;
}

.theater-composer {
  font-family: var(--font-display, sans-serif);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.theater-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.4s ease;
  backdrop-filter: blur(8px);
}
.theater-play-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.1);
}

.theater-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theater-sub-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  text-decoration: none;
}
.theater-sub-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.theater-btn-fav.is-fav {
  color: #e25555;
}
.theater-btn-fav.is-fav .icon-fav-off { display: none; }
.theater-btn-fav.is-fav .icon-fav-on { display: block !important; }

/* Navigation Arrows */
@keyframes nav-float-prev {
  0%, 100% { transform: translateY(-50%) translateX(0); box-shadow: 0 0 0 rgba(255,255,255,0); opacity: 0.6; }
  50%      { transform: translateY(-50%) translateX(-10px); box-shadow: 0 0 20px rgba(255,255,255,0.15); opacity: 1; }
}
@keyframes nav-float-next {
  0%, 100% { transform: translateY(-50%) translateX(0); box-shadow: 0 0 0 rgba(255,255,255,0); opacity: 0.6; }
  50%      { transform: translateY(-50%) translateX(10px); box-shadow: 0 0 20px rgba(255,255,255,0.15); opacity: 1; }
}

.theater-nav {
  position: absolute;
  top: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  z-index: 20;
}
.theater-nav-prev {
  left: 3vw;
  animation: nav-float-prev 3s ease-in-out infinite;
}
.theater-nav-next {
  right: 3vw;
  animation: nav-float-next 3s ease-in-out infinite;
}
.theater-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  animation-play-state: paused;
  transform: translateY(-50%) scale(1.15) !important;
  box-shadow: 0 0 30px rgba(255,255,255,0.3) !important;
  opacity: 1 !important;
}

/* Feature Music entry point (Theater Gate) */
.featured-music {
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
  background: #030403;
}

/* 奥からの光漏れ — 深緑の呼吸する光 */
.featured-music::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  width: 80%;
  height: 70%;
  background: radial-gradient(
    ellipse 50% 40% at 50% 50%,
    rgba(100, 180, 130, 0.06) 0%,
    rgba(80, 160, 110, 0.03) 40%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: gateGlowDrift 12s ease-in-out infinite;
}

/* 上下ビネット + 中央の微かな光 */
.featured-music::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 60% at 50% 60%, rgba(60, 140, 90, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 80% 20% at 50% 0%, rgba(4, 12, 8, 0.90) 0%, transparent 60%),
    radial-gradient(ellipse 80% 20% at 50% 100%, rgba(4, 12, 8, 0.90) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gateGlowDrift {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.7; transform: translate(-50%, -50%) scale(1.08); }
}

/* Updated Gate Design */
.fm-card {
  position: relative;
  width: min(100%, 1000px);
  margin: 4rem auto 0;
  aspect-ratio: 21 / 9;
  min-height: 380px;
  cursor: pointer;
  border-radius: 4px;
  background: #000;
  box-shadow: 0 40px 100px rgba(0,0,0,0.9);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* リムライト — 門の縁が微かに光る */
.fm-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  background: linear-gradient(
    to bottom,
    rgba(100, 180, 130, 0.12) 0%,
    transparent 15%,
    transparent 85%,
    rgba(100, 180, 130, 0.08) 100%
  );
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 1s ease;
}

.fm-card:hover::before {
  opacity: 1;
}

.fm-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(100, 180, 130, 0.15);
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 1),
    0 0 40px rgba(100, 180, 130, 0.08),
    0 0 100px rgba(60, 140, 90, 0.04);
}

.fm-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  filter: grayscale(0.5) brightness(0.6);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fm-card:hover .fm-card-bg {
  opacity: 0.6;
  filter: grayscale(0.2) brightness(0.8);
  transform: scale(1.05);
}

.fm-card-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 20%, rgba(0,0,0,0.8) 100%);
  z-index: 1;
  pointer-events: none;
}

.fm-card-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  pointer-events: none; /* Make clicks pass to .fm-card */
}

.fm-tag {
  font-family: var(--font-display, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: rgba(154, 223, 180, 0.50);
  text-transform: uppercase;
  margin: 0;
}

.fm-title {
  font-family: var(--font-serif-jp, serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 200;
  color: #fff;
  letter-spacing: 0.2em;
  margin: 0;
  text-shadow: 0 0 30px rgba(0,0,0,0.5);
  transition: all 0.8s ease;
}

.fm-card:hover .fm-title {
  letter-spacing: 0.25em;
  text-shadow: 0 0 40px rgba(100, 180, 130, 0.25);
}

.fm-composer {
  font-family: var(--font-display, sans-serif);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

.fm-play-indicator {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.5s ease;
}

.fm-play-indicator svg {
  opacity: 0.5;
  transition: all 0.5s ease;
}

.fm-card:hover .fm-play-indicator {
  color: #fff;
}
.fm-card:hover .fm-play-indicator svg {
  opacity: 1;
  transform: translateX(4px);
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.5));
}


/* Fullscreen Special States */
.theater-modal.is-fullscreen .theater-window {
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  transform: scale(1) !important;
}

.theater-modal.is-fullscreen .theater-scenery {
  inset: 0;
  mask-image: none;
  -webkit-mask-image: none;
  filter: brightness(0.9) contrast(1.1);
}

.theater-modal.is-fullscreen .theater-ui {
  padding: clamp(2rem, 8vh, 6rem) clamp(2rem, 8vw, 8rem);
}

.theater-modal.is-fullscreen .theater-title {
  font-size: clamp(2rem, 6vh, 4rem);
}

.theater-modal.is-fullscreen .theater-nav-prev { left: 5vw; }
.theater-modal.is-fullscreen .theater-nav-next { right: 5vw; }

/* 全画面中：縮小ボタンをグレーアウト（帰還が主アクション） */
.theater-modal.is-fullscreen .theater-fullscreen-btn {
  color: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  cursor: default;
}
.theater-modal.is-fullscreen .theater-controls-top-pair__sep {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Scene button (top-left) ───────────────────────────── */
.theater-controls-top-left {
  display: flex;
  align-items: center;
}

.theater-scene-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
  padding: 0.4rem 1.2rem;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all 0.4s ease;
  border-radius: 1px;
  backdrop-filter: blur(4px);
}
.theater-scene-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ── Info area (left column of theater-bottom) ─────────── */
.theater-info-area {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  max-width: 55%;
}

/* ── Seekbar ───────────────────────────────────────────── */
.theater-seekbar-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theater-time {
  font-family: var(--font-display, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  min-width: 2.4em;
  text-align: center;
  flex-shrink: 0;
}

.theater-seekbar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  transition: height 0.2s ease;
}
.theater-seekbar:hover {
  height: 5px;
}
.theater-seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  transition: transform 0.15s ease;
}
.theater-seekbar:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}
.theater-seekbar::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  border: none;
}
.theater-seekbar::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

/* ── License area ──────────────────────────────────────── */
.theater-license-area {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.theater-license-text {
  font-family: var(--font-display, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
}

.theater-license-link {
  font-family: var(--font-display, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(209, 184, 122, 0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(209, 184, 122, 0.3);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.theater-license-link:hover {
  color: rgba(209, 184, 122, 1);
  border-bottom-color: rgba(209, 184, 122, 0.8);
}

/* ── Loop / Share buttons ──────────────────────────────── */
.theater-btn-loop {
  color: rgba(255, 255, 255, 0.35);
}
.theater-btn-loop.is-active {
  color: rgba(140, 210, 170, 0.9);
  background: rgba(140, 210, 170, 0.08);
}

.theater-btn-share {
  color: rgba(255, 255, 255, 0.4);
}

/* ── Ken Burns effect ──────────────────────────────────── */
@keyframes kenburns {
  0%   { background-position: 50% 50%; transform: scale(1.00); }
  25%  { background-position: 48% 52%; transform: scale(1.05); }
  50%  { background-position: 52% 48%; transform: scale(1.07); }
  75%  { background-position: 49% 51%; transform: scale(1.04); }
  100% { background-position: 50% 50%; transform: scale(1.00); }
}

.theater-modal.is-playing .theater-scenery {
  animation: kenburns 35s ease-in-out infinite;
}

/* 再生中: 底部に音楽の光が灯る */
.theater-modal.is-playing .theater-bottom::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 120px;
  background: radial-gradient(
    ellipse 60% 80% at 50% 100%,
    rgba(100, 180, 130, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  animation: playGlow 4s ease-in-out infinite;
}

@keyframes playGlow {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ── Scene Picker — Left Side Panel ─────────────────────── */
.theater-scene-picker {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  background: rgba(4, 4, 3, 0.92);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.theater-scene-picker[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}
.theater-scene-picker.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.theater-scene-picker__header {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.2rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.theater-scene-picker__title {
  font-family: var(--font-serif-jp, serif);
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  flex: 1;
}

.theater-scene-picker__close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theater-scene-picker__close:hover { color: rgba(255, 255, 255, 0.8); }

.theater-scene-picker__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.theater-scene-picker__body::-webkit-scrollbar { width: 3px; }
.theater-scene-picker__body::-webkit-scrollbar-track { background: transparent; }
.theater-scene-picker__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* カテゴリグループ */
.theater-scene-group {
  padding: 0.5rem 0 0.3rem;
}
.theater-scene-group + .theater-scene-group {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.theater-scene-group__label {
  font-family: var(--font-display, sans-serif);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.25);
  padding: 0.3rem 1.2rem 0.4rem;
  text-transform: uppercase;
}

.theater-scene-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.2rem 1rem 0.4rem;
}

.theater-scene-tag {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  padding: 0.3rem 0.75rem;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 1px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.theater-scene-tag:hover {
  background: rgba(209, 184, 122, 0.1);
  border-color: rgba(209, 184, 122, 0.4);
  color: rgba(209, 184, 122, 0.95);
}

/* ── Controls top-left gap ───────────────────────────────── */
.theater-controls-top-left {
  gap: 0.7rem;
}

/* ── Volume bar ──────────────────────────────────────────── */
.theater-volume-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.4rem;
}

.theater-volume-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  transition: height 0.15s ease;
}
.theater-volume-bar:hover {
  height: 5px;
}
.theater-volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease;
}
.theater-volume-bar:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}
.theater-volume-bar::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  cursor: pointer;
}
.theater-volume-bar::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

/* ── Auto-hide controls (cinema mode) ───────────────────── */
.theater-top,
.theater-bottom {
  transition: opacity 0.5s ease;
}

.theater-modal.controls-hidden .theater-top,
.theater-modal.controls-hidden .theater-bottom {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.theater-modal.controls-hidden .theater-nav {
  opacity: 0 !important;
  pointer-events: none;
  animation: none !important;
  transition: opacity 0.8s ease !important;
}

.theater-modal.controls-hidden {
  cursor: none;
}

/* ── UI非表示時：曲名と作曲者名を残す ── */
.theater-breath-light {
  position: fixed;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 10001;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.theater-modal.controls-hidden .theater-breath-light {
  opacity: 1;
}
.theater-modal:not(.controls-hidden) .theater-breath-light,
.theater-modal.theater-opening .theater-breath-light {
  opacity: 0;
}
.theater-breath-light__title {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(230, 245, 235, 0.90);
  text-shadow:
    0 0 20px rgba(200, 230, 210, 0.40),
    0 0 40px rgba(154, 223, 180, 0.25),
    0 0 80px rgba(154, 223, 180, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.60);
  animation: theaterTitleGlow 4s ease-in-out infinite;
}
.theater-breath-light__composer {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: rgba(180, 210, 190, 0.45);
  margin-top: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.50);
}
@keyframes theaterTitleGlow {
  0%, 100% {
    text-shadow:
      0 0 15px rgba(200, 230, 210, 0.30),
      0 0 30px rgba(154, 223, 180, 0.15),
      0 2px 8px rgba(0, 0, 0, 0.60);
  }
  50% {
    text-shadow:
      0 0 25px rgba(200, 230, 210, 0.55),
      0 0 50px rgba(154, 223, 180, 0.30),
      0 0 100px rgba(154, 223, 180, 0.15),
      0 2px 8px rgba(0, 0, 0, 0.60);
  }
}

/* ── 開場シーケンス中：UIを完全に隠す ── */
.theater-modal.theater-opening .theater-top,
.theater-modal.theater-opening .theater-bottom,
.theater-modal.theater-opening .theater-nav {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}
.theater-modal.theater-opening {
  cursor: default;
}

/* ══════════════════════════════════════════════════════════
   Mobile — Portrait (〜768px)
   PC版を縮小するのではなく、モバイル専用レイアウトとして再設計
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── ウィンドウをビューポート全体に ── */
  .theater-window {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    transform: none !important;
    border-radius: 0;
  }
  .theater-modal.is-open .theater-window {
    transform: none !important;
  }
  .theater-scenery {
    inset: 0;
    mask-image: none;
    -webkit-mask-image: none;
    filter: brightness(0.72) contrast(1.05);
  }

  /* ── UI レイヤー：パディングをゼロにして各セクションが管理 ── */
  .theater-ui {
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* ══ TOP BAR ══
     左: 情景ボタンのみ（小）
     右: 帰還 + × 閉じる                    */
  .theater-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    min-height: 52px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
    flex-shrink: 0;
  }

  /* 左側：情景ボタンのみ表示。お気に入り・足跡ボタンは非表示 */
  .theater-controls-top-left {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
  }
  .theater-fav-list-btn,
  .theater-footprints-btn {
    display: none;
  }
  .theater-scene-btn {
    font-size: 0.63rem;
    padding: 0.28rem 0.6rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  /* お気に入りボタンだけモバイルでも表示 */
  .theater-fav-list-btn {
    display: flex;
  }

  /* 右側：帰還ボタン + × */
  .theater-controls-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .theater-controls-top-pair {
    display: flex;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 1px;
    overflow: hidden;
  }
  /* モバイルは全画面ボタン・セパレータを非表示（iOS Fullscreen API非対応） */
  .theater-fullscreen-btn,
  .theater-controls-top-pair__sep {
    display: none;
  }
  .theater-fullscreen-btn--story::after {
    display: none;
  }
  .theater-return-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    letter-spacing: 0.12em;
    border: none;
  }
  /* 閉じるボタン：モバイルではラベルを隠してアイコンのみ */
  .theater-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .theater-close__label {
    display: none;
  }

  /* ══ NAV 矢印：両端に寄せ、コンテンツと干渉しないサイズに ══ */
  .theater-nav {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    animation-play-state: paused; /* モバイルはフロートアニメ停止 */
  }
  .theater-nav svg {
    width: 22px;
    height: 22px;
  }
  .theater-nav-prev {
    left: 0;
    animation: none;
  }
  .theater-nav-next {
    right: 0;
    animation: none;
  }

  /* ══ BOTTOM：曲情報 → シークバー → ボタン群（縦積み） ══ */
  .theater-bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 12px 20px max(16px, env(safe-area-inset-bottom, 16px));
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    flex-shrink: 0;
  }

  /* 曲情報エリア：全幅 */
  .theater-info-area {
    max-width: 100%;
    gap: 0.3rem;
  }
  .theater-info {
    gap: 0.2rem;
  }
  .theater-title {
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    line-height: 1.3;
  }
  .theater-composer {
    font-size: 0.67rem;
    letter-spacing: 0.12em;
  }
  .theater-seekbar-area {
    gap: 0.4rem;
    margin-top: 0.1rem;
  }
  .theater-time {
    font-size: 0.6rem;
    min-width: 2em;
  }
  .theater-license-area { display: none; }
  .theater-volume-area  { display: none; }

  /* コントロールボタン行：アイコンのみ、中央寄せ */
  .theater-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    flex-wrap: nowrap;
  }
  .theater-sub-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  /* 「足跡を残す」テキスト非表示、アイコンのみ */
  .theater-btn-footprint span { display: none; }

  /* 再生ボタン：少し大きめ */
  .theater-play-btn {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  /* ══ パネル類 ══ */

  /* お気に入りパネル：画面右全幅 */
  .theater-fav-panel {
    width: 100%;
    max-width: 100%;
  }

  /* 情景ピッカー：下からのシートに変更 */
  .theater-scene-picker {
    width: 100%;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: 65%;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    transform: translateY(100%);
  }
  .theater-scene-picker.is-open {
    transform: translateY(0);
  }

  /* シェアポップアップ：右上に出る */
  .theater-share-popup {
    right: 0;
    left: auto;
    bottom: calc(100% + 6px);
  }
}

/* ══════════════════════════════════════════════════════════
   Mobile — Landscape（横画面 / max-height 500px）
   ══════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .theater-window {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    transform: none !important;
  }
  .theater-modal.is-open .theater-window {
    transform: none !important;
  }
  .theater-scenery {
    inset: 0;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .theater-ui {
    padding: 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .theater-top {
    padding: 6px 16px;
    min-height: 44px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    flex-shrink: 0;
  }
  .theater-fav-list-btn,
  .theater-footprints-btn { display: none; }
  .theater-fav-list-btn { display: flex; }
  .theater-fullscreen-btn,
  .theater-controls-top-pair__sep { display: none; }
  .theater-return-btn {
    font-size: 0.65rem;
    padding: 0.25rem 0.7rem;
  }
  .theater-close { width: 36px; height: 36px; }

  .theater-nav { width: 36px; height: 36px; animation: none; }
  .theater-nav-prev { left: 0; }
  .theater-nav-next { right: 0; }

  /* 横画面は左右並列でコンパクトに */
  .theater-bottom {
    flex-direction: row;
    align-items: flex-end;
    padding: 8px 16px max(10px, env(safe-area-inset-bottom, 10px));
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    gap: 1rem;
    flex-shrink: 0;
  }
  .theater-info-area {
    max-width: 55%;
    gap: 0.2rem;
    flex: 1;
  }
  .theater-title { font-size: 0.95rem; }
  .theater-composer { font-size: 0.6rem; }
  .theater-time { font-size: 0.58rem; }
  .theater-play-btn { width: 44px; height: 44px; }
  .theater-sub-btn { width: 38px; height: 38px; }
  .theater-btn-footprint span { display: none; }
  .theater-controls { gap: 0.1rem; flex-wrap: nowrap; }
  .theater-license-area { display: none; }
  .theater-volume-area  { display: none; }

  .theater-scene-picker {
    width: 100%;
    top: auto;
    left: 0; right: 0; bottom: 0;
    height: 75%;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    transform: translateY(100%);
  }
  .theater-scene-picker.is-open { transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   Share Popup
   ══════════════════════════════════════════════════════════ */
.theater-share-wrap {
  position: relative;
}

.theater-share-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -4px;
  background: rgba(6, 6, 5, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  backdrop-filter: blur(12px);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  z-index: 50;
  animation: share-popup-in 0.18s ease;
}
.theater-share-popup[hidden] { display: none; }

@keyframes share-popup-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.theater-share-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: none;
  color: rgba(255, 250, 240, 0.65);
  cursor: pointer;
  font-family: var(--font-display, sans-serif);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem;
  border-radius: 1px;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
}
.theater-share-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 250, 240, 1);
}
.theater-share-item--copy {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 2px;
  color: rgba(209, 184, 122, 0.7);
}
.theater-share-item--copy:hover {
  color: rgba(209, 184, 122, 1);
  background: rgba(209, 184, 122, 0.06);
}

/* ══════════════════════════════════════════════════════════
   Favorites Panel
   ══════════════════════════════════════════════════════════ */
.theater-fav-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  background: rgba(4, 4, 3, 0.9);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(209, 184, 122, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.theater-fav-panel[hidden] {
  display: flex !important;   /* hidden でも transform アニメを使う */
  visibility: hidden;
  pointer-events: none;
}
.theater-fav-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* ── ヘッダー ─────────────────────────────────────────── */
.theater-fav-panel__header {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.2rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 0.6rem;
  flex-shrink: 0;
}

.theater-fav-panel__title {
  font-family: var(--font-serif-jp, serif);
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  color: rgba(209, 184, 122, 0.8);
  margin: 0;
  flex: 1;
}

.theater-fav-panel__count {
  font-family: var(--font-display, sans-serif);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

.theater-fav-panel__close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theater-fav-panel__close:hover { color: rgba(255, 255, 255, 0.8); }

/* ── リスト ───────────────────────────────────────────── */
.theater-fav-panel__list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(209, 184, 122, 0.2) transparent;
}
.theater-fav-panel__list::-webkit-scrollbar { width: 4px; }
.theater-fav-panel__list::-webkit-scrollbar-track { background: transparent; }
.theater-fav-panel__list::-webkit-scrollbar-thumb { background: rgba(209, 184, 122, 0.2); border-radius: 2px; }

.theater-fav-panel__hint {
  font-family: var(--font-display, sans-serif);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.2);
  padding: 0.45rem 1.2rem 0.35rem;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.theater-fav-panel__empty {
  padding: 2rem 1.2rem;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  letter-spacing: 0.1em;
}

/* ── 各アイテム ───────────────────────────────────────── */
.theater-fav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  cursor: default;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  user-select: none;
}
.theater-fav-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.theater-fav-item.is-playing {
  background: rgba(209, 184, 122, 0.05);
}
.theater-fav-item.is-dragging {
  opacity: 0.4;
}
.theater-fav-item.drag-over {
  border-top: 2px solid rgba(209, 184, 122, 0.5);
}

.theater-fav-item__drag {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  cursor: grab;
  padding: 0.7rem 0;
  line-height: 1;
}
.theater-fav-item__drag:active { cursor: grabbing; }

.theater-fav-item__index {
  flex-shrink: 0;
  width: 20px;
  font-family: var(--font-display, sans-serif);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0;
  text-align: right;
}

.theater-fav-item__name {
  flex: 1;
  font-family: var(--font-serif-jp, serif);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: rgba(255, 250, 240, 0.7);
  padding: 0.7rem 0.5rem 0.7rem 0.6rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theater-fav-item__name:hover { color: rgba(255, 250, 240, 1); }
.theater-fav-item.is-playing .theater-fav-item__name {
  color: rgba(209, 184, 122, 0.95);
}

.theater-fav-item__playing {
  flex-shrink: 0;
  font-size: 0.55rem;
  color: rgba(209, 184, 122, 0.8);
  padding-right: 0.3rem;
  animation: fp-playing-pulse 1.4s ease-in-out infinite;
}
@keyframes fp-playing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.theater-fav-item__remove {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(209, 184, 122, 0.3);
  cursor: pointer;
  padding: 0.7rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}
.theater-fav-item__remove:hover {
  color: rgba(220, 80, 80, 0.8);
  transform: scale(1.2);
}

/* ── フッター ─────────────────────────────────────────── */
.theater-fav-panel__footer {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.theater-fav-panel__play-all {
  width: 100%;
  background: rgba(209, 184, 122, 0.08);
  border: 1px solid rgba(209, 184, 122, 0.3);
  border-radius: 1px;
  color: rgba(209, 184, 122, 0.8);
  font-family: var(--font-serif-jp, serif);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  padding: 0.55rem;
  cursor: pointer;
  transition: all 0.3s;
}
.theater-fav-panel__play-all:hover {
  background: rgba(209, 184, 122, 0.15);
  border-color: rgba(209, 184, 122, 0.6);
  color: rgba(209, 184, 122, 1);
}

/* チェックボックス */
.theater-fav-item__check {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(209, 184, 122, 0.3);
  border-radius: 3px;
  background: rgba(209, 184, 122, 0.05);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.theater-fav-item__check:checked {
  background: rgba(209, 184, 122, 0.25);
  border-color: rgba(209, 184, 122, 0.7);
}
.theater-fav-item__check:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 12px;
  color: rgba(209, 184, 122, 0.95);
}

/* 商用ライセンスボタン */
.theater-fav-panel__license {
  width: 100%;
  margin-top: 0.5rem;
  background: rgba(100, 160, 120, 0.08);
  border: 1px solid rgba(100, 160, 120, 0.3);
  border-radius: 1px;
  color: rgba(140, 200, 160, 0.8);
  font-family: var(--font-serif-jp, serif);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
}
.theater-fav-panel__license:hover:not(:disabled) {
  background: rgba(100, 160, 120, 0.18);
  border-color: rgba(100, 160, 120, 0.6);
  color: rgba(160, 220, 180, 1);
}
.theater-fav-panel__license:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── モバイル ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .theater-fav-panel {
    width: 100%;
    top: auto;
    height: 65%;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid rgba(209, 184, 122, 0.15);
  }
  .theater-fav-panel.is-open {
    transform: translateY(0);
  }
}

/* ═══ 蛍パーティクル — CSS animation版（INP改善: setInterval不使用）═══ */
.window-firefly {
  background: rgba(255, 255, 200, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 200, 0.5);
  animation:
    firefly-drift var(--ff-dur, 8s) ease-in-out var(--ff-delay, 0s) infinite alternate,
    firefly-glow  calc(var(--ff-dur, 8s) * 0.7) ease-in-out var(--ff-delay, 0s) infinite alternate;
  will-change: transform, opacity;
}

@keyframes firefly-drift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(calc(var(--ff-dx, 8%) * -0.5), calc(var(--ff-dy, 8%) * 0.8)); }
  66%  { transform: translate(var(--ff-dx, 8%), calc(var(--ff-dy, 8%) * -0.3)); }
  100% { transform: translate(calc(var(--ff-dx, 8%) * -0.3), var(--ff-dy, 8%)); }
}

@keyframes firefly-glow {
  0%   { opacity: 0.2; }
  50%  { opacity: 1.0; }
  100% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .window-firefly {
    animation: firefly-glow 4s ease-in-out infinite alternate;
  }
}
