/* ═══════════════════════════════════════════════════════════
   draneko-epithet-select.css  v1.1.0  2026-05-21
   Draねこ 二つ名選択 UI — スタイル
   ─────────────────────────────────────────────────────────
   命名規則：
     .epithetOverlay     = 背景オーバーレイ
     .epithetPanel       = 選択パネル本体
     .epithetHeading     = 見出し
     .epithetSubheading  = サブ見出し（主名）
     .epithetCardRow     = カード横並び列
     .epithetCard        = 候補カード 1 枚
     .epithetIroha       = い/ろ/は/に/ほ 記号
     .epithetOrbWrap     = 宝珠 SVG ラップ
     .epithetName        = 副名
     .epithetYomi        = ふりがな
     .epithetDesc        = 解説テキスト
     .epithetActions     = 確定ボタン行
     .epithetConfirmBtn  = 「この二つ名に決める」ボタン
   z-index: 600 系（色札モーダル 499 より上）
   ═══════════════════════════════════════════════════════════ */

/* ── オーバーレイ ── */
.epithetOverlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 22, 0.78);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.epithetOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── パネル本体 ── */
.epithetPanel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: min(96vw, 680px);
  max-height: 92svh;
  overflow-y: auto;
  background: #FEFCF8;
  border: 1px solid #E8DFD3;
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow: 0 28px 80px rgba(28, 25, 22, 0.36);
  z-index: 601;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@media (max-width: 480px) {
  .epithetPanel {
    width: 96vw;
    padding: 24px 16px 20px;
    border-radius: 16px;
    gap: 16px;
  }
}
.epithetPanel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

/* ── 閉じるボタン ── */
.epithetCloseBtn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: #7C6F64;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.epithetCloseBtn:hover,
.epithetCloseBtn:focus-visible {
  color: #1C1916;
  background: rgba(28, 25, 22, 0.08);
  outline: none;
}

/* ── 見出し ── */
.epithetHeading {
  font-size: 17px;
  font-weight: 600;
  color: #1C1916;
  text-align: center;
  letter-spacing: 0.06em;
  line-height: 1.5;
  margin: 0;
  padding-right: 28px; /* 閉じるボタン分 */
}

/* ── サブ見出し（主名） ── */
.epithetSubheading {
  font-size: 13px;
  color: #7C6F64;
  text-align: center;
  letter-spacing: 0.04em;
  margin: -12px 0 0;
}

/* ── カード行（横並び・スマホは 2+3 or 縦） ── */
.epithetCardRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
}

/* ── カード 1 枚 ── */
.epithetCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: calc(20% - 10px);
  min-width: 100px;
  max-width: 120px;
  padding: 14px 10px 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--ink-faint);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.epithetCard:hover {
  border-color: #B8A99A;
  background: #FAF6F1;
  transform: translateY(-2px);
}
.epithetCard:focus-visible {
  outline: 2px solid #004898;
  outline-offset: 2px;
}
.epithetCard.selected {
  border-color: #004898;
  background: #EEF3FC;
  box-shadow: 0 0 0 3px rgba(0, 72, 152, 0.15);
  transform: translateY(-2px);
}

/* スマホ：カード幅を自動拡張（2列 + ほ は中央） */
@media (max-width: 480px) {
  .epithetCardRow {
    gap: 8px;
  }
  .epithetCard {
    width: calc(50% - 8px);
    min-width: 130px;
    max-width: none;
    padding: 14px 12px;
  }
  /* ほ は幅いっぱい（5枚目・奇数） */
  .epithetCard:nth-child(5) {
    width: 100%;
    max-width: 260px;
  }
}

/* ── いろは記号 ── */
.epithetIroha {
  font-size: 11px;
  font-weight: 600;
  color: #B8A99A;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: none;
  align-self: flex-start;
  padding: 2px 5px;
  background: rgba(28, 25, 22, 0.05);
  border-radius: 4px;
}
.epithetCard.selected .epithetIroha {
  color: #004898;
  background: rgba(0, 72, 152, 0.10);
}

/* ── 宝珠 PNG ── */
.epithetOrbWrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.epithetOrbImg {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
  /* 選択時に軽くフィルターで存在感を強調 */
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  transition: filter 0.15s, transform 0.15s;
}
.epithetCard.selected .epithetOrbImg {
  filter: drop-shadow(0 4px 10px rgba(0, 72, 152, 0.28));
  transform: scale(1.06);
}

/* ── 副名 ── */
.epithetName {
  font-size: 13px;
  font-weight: 600;
  color: #1C1916;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.epithetCard.selected .epithetName {
  color: var(--ink);
}

/* ── ふりがな ── */
.epithetYomi {
  font-size: 10px;
  color: #9A8E84;
  text-align: center;
  letter-spacing: 0.06em;
  line-height: 1.3;
  font-feature-settings: 'palt';
}

/* ── 解説テキスト ── */
.epithetDesc {
  font-size: 11px;
  color: #5C5048;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.04em;
  margin: 2px 0 0;
  font-feature-settings: 'palt';
}

/* ── 確定ボタン行 ── */
.epithetActions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* ── 確定ボタン ── */
.epithetConfirmBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 36px;
  background: #004898;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: none;
  border-radius: 32px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.12s;
  min-width: 200px;
}
.epithetConfirmBtn:hover:not(:disabled) {
  background: var(--ink);
  transform: translateY(-1px);
}
.epithetConfirmBtn:focus-visible {
  outline: 2px solid #004898;
  outline-offset: 3px;
  background: var(--ink);
}
.epithetConfirmBtn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

/* ── スクロールバー（細め） ── */
.epithetPanel::-webkit-scrollbar {
  width: 4px;
}
.epithetPanel::-webkit-scrollbar-track {
  background: transparent;
}
.epithetPanel::-webkit-scrollbar-thumb {
  background: var(--ink-faint);
  border-radius: 2px;
}
