/*
 * 公開ページ共通の「櫻」テーマ(検索ページ・メンバー別/Ver別ページ・免責ページ・エラー画面で共有)
 * 色は櫻の淡いピンクを基調にした自作の配色。ゲーム画像は一切使っていない(花びらはCSS/SVGで描画)。
 * 色や角丸を変えたいときは、まず :root の変数を触る。
 */
:root {
  --bg: #fff6f8;
  --panel: #ffffff;
  --panel-soft: #fff1f5;
  --border: #f2cfda;
  --ink: #43292f;
  --ink-sub: #86636e;
  --plum: #7a2a49;          /* 見出し・ロゴ用の濃い赤紫 */
  --accent: #f4a3b9;        /* 櫻ピンク */
  --accent-soft: #fde3ea;   /* ホバー・選択の薄ピンク */
  --accent-strong: #c93f6a; /* 文字・ボタンに使う濃いめのピンク */
  --on-accent: #ffffff;
  --shadow: 0 6px 22px rgba(201, 63, 106, 0.08);

  --radius: 20px;
  --radius-sm: 14px;

  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;

  /* 背景に散らす花びら(単体の花びら5枚を並べたタイル) */
  --petal-tile: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><defs><path id='p' d='M0 0C-5-3-7-10-3-13L0-11L3-13C7-10 5-3 0 0Z'/></defs><g fill='%23f6b5c8' fill-opacity='.30'><use href='%23p' transform='translate(40 50) rotate(20) scale(1.8)'/><use href='%23p' transform='translate(170 30) rotate(-35) scale(1.3)'/><use href='%23p' transform='translate(100 160) rotate(140) scale(2)'/><use href='%23p' transform='translate(225 205) rotate(75) scale(1.5)'/><use href='%23p' transform='translate(25 225) rotate(-100) scale(1.1)'/></g></svg>");
  /* 五枚花びらの櫻の花(見出しの飾り・ロゴ用) */
  --flower: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'><defs><path id='p' d='M0 0C-5-3-7-10-3-13L0-11L3-13C7-10 5-3 0 0Z' transform='scale(1.15)'/></defs><g fill='%23f28aa9'><use href='%23p'/><use href='%23p' transform='rotate(72)'/><use href='%23p' transform='rotate(144)'/><use href='%23p' transform='rotate(216)'/><use href='%23p' transform='rotate(288)'/></g><circle r='2' fill='%23c93f6a'/></svg>");
  --chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23c93f6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  padding-bottom: 60px;
  background-color: var(--bg);
  background-image:
    var(--petal-tile),
    radial-gradient(900px 420px at 92% -8%, #ffe1ea 0%, rgba(255, 225, 234, 0) 65%),
    radial-gradient(800px 480px at -8% 35%, #ffedf2 0%, rgba(255, 237, 242, 0) 65%);
  background-attachment: fixed;
}

a { color: var(--accent-strong); }

/* ---------- ヘッダー ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(100deg, rgba(249, 196, 212, 0.94), rgba(255, 228, 236, 0.94) 55%, rgba(255, 246, 248, 0.94));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* 右端にふわっと花びらを散らす */
.top-bar::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 240px;
  background-image: var(--petal-tile);
  background-size: 130px 130px;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 20%, transparent);
  mask-image: linear-gradient(to left, #000 20%, transparent);
}

.site-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--plum);
  text-decoration: none;
  white-space: nowrap;
}
.site-title::before {
  content: "";
  width: 28px;
  height: 28px;
  background: var(--flower) center / contain no-repeat;
  flex-shrink: 0;
}

/* タイトル横の「非公式」表示(公式サイトと誤解されないように) */
.unofficial-tag {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.scene-count {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

/* ---------- パネル ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px 22px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--plum);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.panel-title::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--flower) center / contain no-repeat;
}

.panel-caption {
  font-size: 12px;
  color: var(--ink-sub);
  margin: 0 0 12px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--ink-sub);
  margin-bottom: 4px;
  padding-left: 6px;
}

.field-hint {
  font-size: 11px;
  color: var(--ink-sub);
  opacity: 0.85;
  margin: 3px 0 0 6px;
}

/* ---------- 入力欄(丸く) ---------- */
input[type="text"], input[type="number"] {
  width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  background: var(--panel-soft);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input::placeholder { color: #b89aa5; }

input:hover, .cs-trigger:hover { border-color: var(--accent); }

input:focus-visible, .cs-trigger:focus-visible, button:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(244, 163, 185, 0.45);
  background-color: var(--panel);
}

button { font-family: inherit; cursor: pointer; }

/* ---------- プルダウン(自前描画。OS標準の四角いリストは使わない) ---------- */
.cs { position: relative; display: block; width: 100%; }
.cs-native { display: none; }

.cs-trigger {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 36px 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink);
  background-color: var(--panel-soft);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.cs-trigger.is-placeholder { color: #a2808c; }
.cs-trigger[aria-expanded="true"] {
  border-color: var(--accent-strong);
  background-color: var(--panel);
}

/* Ver欄(入力しながら候補から選べる欄)にも同じ矢印を付ける */
input.cs-combo {
  padding-right: 36px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.cs-pop {
  position: fixed;
  z-index: 1000;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(122, 42, 73, 0.18);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.cs-pop[hidden] { display: none; }

.cs-opt {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.cs-opt.is-active { background: var(--accent-soft); }
.cs-opt.is-selected {
  color: var(--accent-strong);
  font-weight: 700;
}
.cs-opt.is-selected::before { content: "✿ "; }

/* ---------- ボタン(丸く) ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--accent-strong); color: var(--accent-strong); background: var(--accent-soft); }

.btn-add {
  border: 1px dashed var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
}
.btn-add:hover { background: #fbd3de; }

.btn-remove {
  border: none;
  background: transparent;
  color: var(--ink-sub);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
}
.btn-remove:hover { color: var(--accent-strong); background: var(--accent-soft); }

.btn-submit {
  background: linear-gradient(135deg, #e0648a, #c93f6a);
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 11px 34px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  box-shadow: 0 6px 16px rgba(201, 63, 106, 0.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(201, 63, 106, 0.34); }
.btn-submit:focus-visible { box-shadow: 0 0 0 3px rgba(244, 163, 185, 0.7); }

/* ---------- シーンのカード(検索ページ・メンバー別/Ver別ページで共有。templates/html/_scene_card.html) ---------- */
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 20px 0 32px; font-size: 14px; }
.pager a {
  color: var(--accent-strong);
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.pager a:hover { background: var(--accent-soft); border-color: var(--accent-strong); }

.result-summary {
  scroll-margin-top: 76px;
  font-size: 13px;
  color: var(--ink-sub);
  margin: 0 0 12px 8px;
}
.result-summary strong { color: var(--accent-strong); font-size: 16px; font-variant-numeric: tabular-nums; }

.scene-card {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  scroll-margin-top: 76px;
}

/* 左端のレアリティの帯。R/SR/SSR/UR以外の値は枠線の色のまま */
.rarity-stripe { width: 8px; flex-shrink: 0; background: var(--border); }
.rarity-stripe[data-rarity="R"] { background: #55c8e8; }
.rarity-stripe[data-rarity="SR"] { background: #f3c730; }
.rarity-stripe[data-rarity="SSR"] { background: linear-gradient(180deg, #46a3ea 0%, #8446ea 25%, #c846ea 50%, #ea46e9 75%, #f3a630 100%); }
.rarity-stripe[data-rarity="UR"] { background: linear-gradient(180deg, #40f2b6 0%, #00e6ff 25%, #8446ea 50%, #d046ea 75%, #eaa646 100%); }

/* カードの【Ver】名前 は、Ver別・メンバー別のページへのリンク */
.scene-name a { color: inherit; text-decoration: none; }
.scene-name a:hover { color: var(--accent-strong); text-decoration: underline; }

.scene-body { flex: 1; padding: 14px 18px 16px; min-width: 0; }

.scene-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.scene-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attr-chip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.scene-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--plum);
}

.scene-meta {
  font-size: 12px;
  color: var(--ink-sub);
}

.scene-stats {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-sub);
  font-variant-numeric: tabular-nums;
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 10px;
}

.skill-block {
  border-top: 1px dashed var(--accent);
  padding-top: 8px;
  margin-top: 8px;
}

.skill-name-row {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.skill-sp {
  font-size: 11px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.skill-body-text {
  font-size: 13px;
  color: var(--ink-sub);
  margin: 0 0 6px;
}

.skills-extra {
  position: relative;
  overflow: hidden;
}
.skills-extra.collapsed { max-height: 54px; }
.skills-extra.collapsed::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 54px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--panel) 82%);
  pointer-events: none;
}

/* 開閉ボタン: 閉じている時は「表示」、開いている時は「閉じる」に変わる */
.skills-toggle-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.skills-extra.collapsed + .skills-toggle-row { margin-top: -6px; }

.skills-toggle-btn {
  position: relative;
  z-index: 2;
  border: 1px solid var(--accent-strong);
  background: var(--panel);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 5px 18px;
  font-size: 12px;
  font-weight: 500;
}
.skills-toggle-btn:hover { background: var(--accent-soft); }


.auto-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #b9a8ea;
  text-align: center;
}
.auto-toggle-btn {
  border: 1px solid #8a72d6;
  background: var(--panel);
  color: #6a52c0;
  border-radius: 999px;
  padding: 5px 18px;
  font-size: 12px;
  font-weight: 500;
}
.auto-toggle-btn:hover { background: #f1ecfc; }
.auto-list { text-align: left; margin-top: 4px; }
.auto-list[hidden] { display: none; }
.auto-list .skill-block { border-top-color: #cfc3f2; }
.auto-tag {
  font-size: 11px;
  color: #6a52c0;
  background: #f1ecfc;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  color: var(--ink-sub);
  padding: 40px 0;
  font-size: 14px;
}
.empty-state::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  background: var(--flower) center / contain no-repeat;
  opacity: 0.6;
}

/* ---------- フッター ---------- */
.site-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  font-size: 12px;
  color: var(--ink-sub);
  text-align: center;
}
.site-footer::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 6px;
  background: var(--flower) center / contain no-repeat;
  opacity: 0.8;
}
.site-footer a { text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0 0 4px; }

/* ---------- ページの見出しと説明(トップ・メンバー別・Ver別) ---------- */
.page-intro { margin: 0 4px 18px; }
.page-intro h1 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  color: var(--plum);
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.page-intro p { margin: 0; font-size: 13px; color: var(--ink-sub); }
.page-intro .browse-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.page-intro .browse-links a { font-weight: 500; }

/* パンくず(トップ › メンバー別 › 名前) */
.breadcrumb { font-size: 12px; color: var(--ink-sub); margin: 0 4px 10px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: var(--accent); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* メンバー別・Ver別の一覧(リンクを並べる) */
.link-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.link-grid a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.link-grid a:hover { border-color: var(--accent-strong); background: var(--accent-soft); }
.link-grid .count { font-size: 12px; color: var(--ink-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Ver名は長いので広めに(パソコンで3列、スマホで1列) */
.link-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.link-group + .link-group { margin-top: 18px; }
.link-group h2 {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--plum);
  margin: 0 0 8px;
}
.refine-link { margin: 0 4px 14px; font-size: 13px; }

@media (max-width: 560px) {
  .top-bar { padding: 10px 16px; }
  .site-title { font-size: 18px; gap: 6px; }
  .unofficial-tag { font-size: 10px; padding: 1px 6px; }
  .scene-count { font-size: 11px; padding: 2px 8px; }
  .page { padding: 18px 14px 0; }
  .panel { padding: 16px 16px 18px; }
  .page-intro h1 { font-size: 18px; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .link-grid.is-wide { grid-template-columns: 1fr; }
}
