/* ============================================================
   占い会議 — "占い手帖 / 天文暦" をテーマにしたビジュアル
   深い藍夜 × 真鍮ゴールド。明朝ディスプレイ × 洗練ゴシック本文。
   ============================================================ */
:root {
  --ink: #100f24;          /* 藍夜（背景） */
  --ink-2: #181734;        /* パネル */
  --ink-3: #211f44;        /* 隆起面 */
  --line: #322e52;         /* 罫線 */
  --paper: #efe9da;        /* 象牙色テキスト */
  --paper-2: #cfc7e0;      /* やや沈めたテキスト */
  --muted: #948cb4;        /* 補足 */
  --gold: #c9a86a;         /* 真鍮ゴールド（主アクセント） */
  --gold-bright: #e4c789;
  --gold-soft: rgba(201, 168, 106, 0.28);
  --maxw: 600px;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
/* キーボード操作時だけ金の輪郭を出す（マウス/タップでは出さない） */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
body {
  color: var(--paper);
  font-family: var(--sans);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* ダブルタップ等での不意のズーム/ズレを防ぐ（ピンチズーム抑止と合わせて画面を固定） */
  touch-action: manipulation;
  /* 星屑を散らした藍夜 */
  background-color: var(--ink);
  background-image:
    radial-gradient(1px 1px at 18% 22%, rgba(233, 224, 255, 0.5), transparent),
    radial-gradient(1px 1px at 72% 16%, rgba(233, 224, 255, 0.35), transparent),
    radial-gradient(1.4px 1.4px at 42% 38%, rgba(201, 168, 106, 0.5), transparent),
    radial-gradient(1px 1px at 88% 64%, rgba(233, 224, 255, 0.4), transparent),
    radial-gradient(1px 1px at 28% 78%, rgba(233, 224, 255, 0.3), transparent),
    radial-gradient(1.2px 1.2px at 62% 88%, rgba(201, 168, 106, 0.4), transparent),
    radial-gradient(130% 90% at 50% -10%, #211d46 0%, var(--ink) 58%);
}

/* 深い夜空のうえに、ゆっくり瞬く星屑のレイヤーを重ねる（神秘性の演出） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 30%, rgba(228, 199, 137, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 82% 22%, rgba(233, 224, 255, 0.85), transparent),
    radial-gradient(1px 1px at 52% 12%, rgba(233, 224, 255, 0.7), transparent),
    radial-gradient(1.3px 1.3px at 33% 64%, rgba(228, 199, 137, 0.8), transparent),
    radial-gradient(1px 1px at 68% 72%, rgba(233, 224, 255, 0.7), transparent),
    radial-gradient(1.1px 1.1px at 90% 52%, rgba(233, 224, 255, 0.7), transparent),
    radial-gradient(1px 1px at 8% 84%, rgba(228, 199, 137, 0.7), transparent);
  animation: twinkle 6.5s ease-in-out infinite;
}
/* 上方から差すゴールドのオーラ */
body::after {
  content: ""; position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: min(680px, 120vw); height: 320px; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(201, 168, 106, 0.12), transparent 70%);
}
@keyframes twinkle { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }

#app {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  /* 高さは必ず画面いっぱいに。dvh 非対応ブラウザで #app が中身の高さに
     縮んで「下半分が動かない紺の余白」になるのを防ぐため、段階フォールバック。 */
  height: 100%;       /* html,body が height:100% なので最終フォールバック */
  height: 100vh;      /* dvh 非対応環境向け */
  height: 100dvh;     /* 対応環境はこれが優先（モバイルのバー変動に追従） */
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== App bar ===== */
.appbar {
  flex: none; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(16, 15, 36, 0.96), rgba(16, 15, 36, 0.75));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gold-soft);
}
/* ロゴ＋ワードマーク＝トップへ戻るボタン */
.brand {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  text-align: left; color: inherit; font: inherit;
}
.brand:active { transform: scale(0.98); }
.logo-mark {
  flex: none; width: 30px; height: 30px; display: block; color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(201, 168, 106, 0.35));
}
.logo-mark .logo-core { fill: var(--gold-bright); }
.wordmark {
  font-family: var(--serif); font-weight: 800; font-size: 20px;
  letter-spacing: 0.14em; color: var(--paper); white-space: nowrap;
}
.wordmark-sep { color: var(--gold); margin: 0 -0.04em; }
.wordmark-sub { font-size: 13px; letter-spacing: 0.3em; color: var(--gold); margin-left: 0.5em; font-weight: 700; }
.iconbtn {
  background: none; border: none; color: var(--paper);
  cursor: pointer; padding: 0;
  width: 38px; height: 38px; margin-left: -8px; /* 見た目は細く、当たり判定は38px確保 */
  display: grid; place-items: center; border-radius: 50%;
  transition: background 0.15s;
}
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:hover { background: rgba(201, 168, 106, 0.1); }
.badge {
  font-family: var(--serif); font-size: 10px; letter-spacing: 0.18em;
  padding: 4px 10px; border-radius: 2px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.live { color: var(--ink); background: var(--gold); border-color: var(--gold); font-weight: 700; }
.badge.demo { color: var(--gold); border-color: var(--gold-soft); }

/* ===== Screens ===== */
.screen { display: none; flex-direction: column; padding: 22px 18px 30px; gap: 16px; }
/* フロー内の「◯◯に戻る」。ヘッダの裸の「＜」をやめ、文脈の分かる控えめなリンクに */
.flow-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  margin: -6px 0 -8px -6px; padding: 6px 10px 6px 6px;
  background: none; border: none; border-radius: 6px; cursor: pointer;
  color: var(--muted); font-family: var(--serif); font-size: 12px; letter-spacing: 0.08em;
  transition: color 0.15s;
}
.flow-back svg { width: 14px; height: 14px; }
.flow-back:hover { color: var(--gold-bright); }
.screen.active { display: flex; flex: 1; min-height: 0; }
.screen.active:not(.thread-screen) { overflow-y: auto; }

.eyebrow {
  font-family: var(--serif); font-size: 12px; letter-spacing: 0.32em;
  color: var(--gold); text-transform: none; margin: 4px 0 2px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: "✦"; flex: none; font-size: 10px; color: var(--gold); opacity: 0.9; }
.eyebrow::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-soft), transparent); }

/* ===== Hero: 占いの輪 ===== */
.hero { text-align: center; padding: 6px 0 8px; }
.council { width: 230px; max-width: 64vw; margin: 0 auto 6px; }
.council svg { width: 100%; height: auto; overflow: visible; }
.orbit { fill: none; stroke: var(--gold); }
.orbit-outer { opacity: 0.18; stroke-width: 1; stroke-dasharray: 2 6; transform-origin: 110px 110px; animation: spin 80s linear infinite; }
.orbit-inner { opacity: 0.3; stroke-width: 1; }
.ring-badge circle, .ring-center circle {
  fill: var(--ink-3); stroke: var(--accent); stroke-width: 1.2;
}
.ring-center circle { fill: var(--ink-2); stroke-width: 1.5; }
.ring-badge .bsig, .ring-center .bsig { color: var(--accent); overflow: visible; }
.ring-badge { opacity: 0; animation: badge-in 0.7s ease forwards; transform-box: fill-box; }
.ring-badge:nth-child(3) { animation-delay: 0.15s; }
.ring-badge:nth-child(4) { animation-delay: 0.27s; }
.ring-badge:nth-child(5) { animation-delay: 0.39s; }
.ring-badge:nth-child(6) { animation-delay: 0.51s; }
.ring-badge:nth-child(7) { animation-delay: 0.63s; }
.ring-badge:nth-child(8) { animation-delay: 0.75s; }
.ring-center { opacity: 0; animation: badge-in 0.8s ease 0.85s forwards; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes badge-in { from { opacity: 0; } to { opacity: 1; } }

.hero-title {
  font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.55;
  letter-spacing: 0.04em; margin: 14px 0 10px;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.hero-title.fading { opacity: 0; transform: translateY(6px); }
.hero-lead { color: var(--paper-2); font-size: 13px; line-height: 1.9; margin: 0; }
.hero-lead b { color: var(--gold-bright); font-weight: 700; }
/* 日本語の折り返しを「文節単位」に固定（語の途中で割れない）。break点は <wbr> のみ。 */
.kbreak { word-break: keep-all; overflow-wrap: break-word; }

/* このサイトの流れ・強み */
.how {
  margin: 18px 0 10px; padding: 14px 16px;
  background: linear-gradient(165deg, rgba(201,168,106,0.08), rgba(33,31,68,0.4));
  border: 1px solid var(--gold-soft); border-radius: 8px;
}
.how-head {
  font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: 0.1em;
  color: var(--gold-bright); text-align: center; margin-bottom: 12px;
}
.how-head::before, .how-head::after { content: "✦"; color: var(--gold); font-size: 9px; margin: 0 8px; vertical-align: 2px; opacity: 0.9; }
/* ステップ（番号を縦線でつなぎ、順序が伝わるように） */
.how-step { display: flex; align-items: center; gap: 12px; position: relative; }
.how-step + .how-step { margin-top: 10px; }
.how-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; position: relative; z-index: 1;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 13px;
  color: #2a2010; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}
/* 番号同士をつなぐ縦線 */
.how-step:not(:last-of-type) .how-num::after {
  content: ""; position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  width: 1.5px; height: 22px; background: var(--gold-soft);
}
.how-tx { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.how-tx b { font-family: var(--serif); font-size: 14px; color: var(--paper); letter-spacing: 0.03em; }
.how-tx span { font-size: 11.5px; color: var(--muted); }
.how-foot {
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--gold-soft);
  font-size: 12px; line-height: 1.7; color: var(--gold-bright); letter-spacing: 0.02em;
}

/* ===== Theme grid ===== */
/* テーマ一覧: 1行1テーマ（アイコン＋タイトル＋説明） */
.grid { display: flex; flex-direction: column; gap: 12px; }
.theme-card {
  position: relative; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 4px;
  padding: 15px 18px; cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
/* ホバーは「浮かせる」より「灯りがともる」。持ち上げ＋大影はやらない */
.theme-card:hover { border-color: var(--gold); }
.theme-card:hover .medallion { box-shadow: 0 0 0 4px rgba(0,0,0,0.18), 0 0 22px -4px var(--gold); }
.theme-card:active { transform: scale(0.99); }
.theme-card .medallion { width: 46px; height: 46px; margin: 0; }
.theme-card .ticon { width: 24px; height: 24px; }
.t-text { min-width: 0; }
.theme-card .t-title { font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; color: var(--paper); }
.theme-card .t-desc { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 3px; }
.theme-card .t-arrow { margin-left: auto; color: var(--gold); opacity: 0.55; flex: none; display: grid; place-items: center; transition: transform 0.18s ease, opacity 0.18s; }
.theme-card .t-arrow .chev { width: 17px; height: 17px; display: block; }
.theme-card:hover .t-arrow { opacity: 0.95; transform: translateX(3px); }

/* 金のメダリオン: アイコンを円形台座＋光輪で受ける（オービット紋章と同じ世界観） */
.medallion {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; margin: 0 auto 12px;
  background: radial-gradient(circle at 50% 38%, rgba(201,168,106,0.16), rgba(16,15,36,0.2) 70%), var(--ink-3);
  border: 1px solid var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.18), inset 0 0 14px -8px var(--gold-bright);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}
.ticon { width: 27px; height: 27px; color: var(--gold-bright); display: block; }
.eyebrow-ico { width: 17px; height: 17px; color: var(--gold); vertical-align: -3px; margin-right: 7px; }
.inline-ico { width: 16px; height: 16px; color: var(--gold-bright); vertical-align: -2px; margin-right: 6px; }

/* ===== Depth ===== */
.depth-list { display: flex; flex-direction: column; gap: 14px; margin: auto 0; }
.screen-foot {
  text-align: center; margin-top: 12px; color: var(--gold);
  font-family: var(--serif); font-size: 12px; letter-spacing: 0.18em; opacity: 0.5;
}
.depth-card {
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 4px;
  padding: 18px 20px; cursor: pointer; display: flex; gap: 16px; align-items: center;
  transition: border-color 0.18s ease, transform 0.12s, box-shadow 0.18s;
}
.depth-card:hover { border-color: var(--gold); }
.depth-card:hover .medallion { box-shadow: 0 0 0 4px rgba(0,0,0,0.18), 0 0 22px -4px var(--gold); }
.depth-card:active { transform: scale(0.99); }
.depth-card .medallion { width: 48px; height: 48px; margin: 0; }
.depth-card .ticon { width: 25px; height: 25px; }
.depth-card .d-title { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.05em; }
.depth-card .d-desc { color: var(--muted); font-size: 12.5px; line-height: 1.7; }

/* ===== Cast 選択 ===== */
.cast-lead { color: var(--paper-2); font-size: 13px; line-height: 1.9; margin: 0 0 4px; }
.cast-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cast-card {
  position: relative; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 12px 14px;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 4px; color: var(--paper);
  opacity: 0.8;
  transition: opacity 0.18s, filter 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.cast-card:active { transform: scale(0.97); }
.cast-card.on {
  opacity: 1; border-color: var(--accent, var(--gold-soft));
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -12px var(--accent, rgba(201,168,106,0.6)), 0 0 0 1px var(--accent);
}
/* 未選択はキャラがモノクロで眠っている。選択でカラーに目覚める */
.cast-card:not(.on) .portrait { filter: grayscale(0.85) brightness(0.72); }
.cast-card .cast-sigil { transition: transform 0.2s; }
.cast-card.on .cast-sigil { transform: scale(1.12); animation: pick-pop 0.32s ease; }
@keyframes pick-pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1.12); }
}
.cast-sigil {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(201,168,106,0.14), rgba(16,15,36,0.2) 70%), var(--ink-3);
  border: 1px solid var(--accent, var(--gold-soft));
  box-shadow: 0 0 0 4px rgba(0,0,0,0.18);
}
.cast-card.on .cast-sigil { box-shadow: 0 0 0 4px rgba(0,0,0,0.18), 0 0 18px -6px var(--accent); }
.cast-sigil .sigil { width: 24px; height: 24px; color: var(--accent, var(--gold)); }
.cast-name { font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.cast-craft { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; }
.cast-check {
  position: absolute; top: 9px; left: 9px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--accent, var(--gold)); color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0; transform: scale(0.4); transition: opacity 0.18s, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.cast-card.on .cast-check { opacity: 1; transform: scale(1); }
/* 「i」マーク: 占術ロジックを開く（選択トグルとは独立） */
.cast-info {
  position: absolute; top: 7px; right: 7px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; z-index: 2;
  font-family: var(--serif); font-size: 12px; font-weight: 700; font-style: italic; line-height: 1;
  color: var(--gold-bright); background: rgba(16, 15, 36, 0.7);
  border: 1px solid var(--gold-soft); opacity: 0.85; transition: opacity 0.15s, background 0.15s;
}
.cast-info:hover { opacity: 1; background: rgba(201, 168, 106, 0.18); border-color: var(--gold); }

/* 結果画面: 名前の右の「i」 */
.craft-info-btn {
  margin-left: 6px; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; flex: none;
  font-family: var(--serif); font-size: 11px; font-weight: 700; font-style: italic; line-height: 1;
  color: var(--gold-bright); background: transparent; border: 1px solid var(--gold-soft);
  display: inline-grid; place-items: center; vertical-align: middle; transition: background 0.15s, border-color 0.15s;
}
.craft-info-btn:hover { background: rgba(201, 168, 106, 0.16); border-color: var(--gold); }

/* 占術ロジックの説明モーダル */
.info-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 7, 20, 0.78); backdrop-filter: blur(3px); padding: 20px;
}
.info-box {
  max-width: 420px; width: 100%; max-height: 88vh; overflow: auto;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--gold-soft); border-radius: 10px; padding: 20px;
  box-shadow: 0 24px 60px -24px #000, inset 0 0 26px -16px var(--accent, var(--gold-bright));
}
.info-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.info-sigil {
  width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(201,168,106,0.16), rgba(16,15,36,0.2) 70%), var(--ink-3);
  border: 1px solid var(--accent, var(--gold-soft));
}
.info-sigil .sigil { width: 24px; height: 24px; color: var(--accent, var(--gold)); }
.info-name { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--paper); }
.info-craft { font-size: 11.5px; color: var(--muted); letter-spacing: 0.05em; margin-top: 2px; }
.info-list { margin: 0; }
.info-list dt {
  font-family: var(--serif); font-size: 12px; font-weight: 700; color: var(--gold-bright);
  letter-spacing: 0.06em; margin-top: 14px;
}
.info-list dt::before { content: "✦ "; color: var(--gold); font-size: 9px; }
.info-list dd { margin: 5px 0 0; font-size: 13px; line-height: 1.85; color: var(--paper-2); }
.info-close {
  margin-top: 18px; width: 100%; padding: 11px; cursor: pointer; background: transparent;
  border: 1px solid var(--gold-soft); border-radius: 3px; color: var(--gold);
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.12em; transition: background 0.15s, border-color 0.15s;
}
.info-close:hover { background: rgba(201, 168, 106, 0.08); border-color: var(--gold); }
/* テーマ別「得意な占い師」ヒント */
.cast-hint {
  margin: -4px 2px 2px; padding: 9px 12px; border-radius: 6px;
  font-size: 12px; line-height: 1.7; color: var(--paper-2);
  background: rgba(201, 168, 106, 0.1); border: 1px solid var(--gold-soft);
}
.cast-hint b { color: var(--gold-bright); font-weight: 700; }
/* 得意(◎)の占い師カードの強調 */
.cast-card.reco { border-color: var(--gold); box-shadow: 0 8px 26px -14px rgba(201, 168, 106, 0.55); }
.cast-card.reco .cast-sigil { box-shadow: 0 0 0 4px rgba(0,0,0,0.18), 0 0 18px -5px var(--gold-bright); }
.cast-tag.reco-tag { color: #2a2010; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: var(--gold); }
/* 選択アクションのボタン群 */
/* 占い師の選び方トグル（得意 / 全員）— 読みやすいセグメント切替 */
.cast-toggle {
  display: flex; gap: 6px; padding: 4px;
  background: var(--ink-3); border: 1px solid var(--gold-soft); border-radius: 9px;
}
.seg {
  flex: 1; padding: 12px 8px; border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--paper-2);
  font-family: var(--serif); font-size: 14px; letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
}
.seg:hover { color: var(--gold-bright); }
.seg.active {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-weight: 700; box-shadow: 0 4px 14px -8px var(--gold);
}

/* オリジナル占術の仕切り見出し（グリッド全幅） */
.cast-divider {
  grid-column: 1 / -1; margin: 8px 2px 0;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--gold);
}
.cast-divider::before { content: "✦"; font-size: 10px; opacity: 0.9; }
.cast-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-soft), transparent); }
/* 「オリジナル」タグ（カード内） */
.cast-tag {
  margin-top: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--gold-bright); background: rgba(201, 168, 106, 0.14); border: 1px solid var(--gold-soft);
}
/* モーダル内のオリジナルタグ */
.info-tag {
  margin-left: 8px; padding: 2px 9px; border-radius: 999px; vertical-align: middle;
  font-family: var(--sans, sans-serif); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--gold-bright); background: rgba(201, 168, 106, 0.16); border: 1px solid var(--gold-soft);
}
.info-about { margin: 0 0 6px; font-size: 13px; line-height: 1.85; color: var(--paper); }

.cast-count { display: block; text-align: center; font-size: 12px; color: var(--paper-2); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.cast-count.warn { color: var(--gold-bright); }
.ghost-btn {
  background: transparent; color: var(--gold); border: 1px solid var(--gold-soft);
  border-radius: 3px; font-family: var(--serif); font-size: 12.5px; letter-spacing: 0.08em;
  padding: 7px 14px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: rgba(201, 168, 106, 0.08); border-color: var(--gold); }

/* ===== Form ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 7px; color: var(--paper-2); letter-spacing: 0.04em; }
.field .req { color: var(--gold); margin-left: 8px; font-size: 10px; font-family: var(--serif); letter-spacing: 0.1em; }
.field .help { color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.6; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--ink); color: var(--paper);
  border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px;
  font-size: 16px; font-family: inherit; transition: border-color 0.15s;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.8; }
.field input::placeholder, .field textarea::placeholder { color: #5c557a; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
/* 必須エラーの項目ハイライト */
.field.invalid label { color: #e6889a; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #e6889a; box-shadow: 0 0 0 2px rgba(230, 136, 154, 0.18); }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 36px;
}
.field select:invalid { color: #5c557a; }
.field select option { background: var(--ink-2); color: var(--paper); }

.primary-btn {
  position: relative; overflow: hidden;
  margin-top: 6px; width: 100%; padding: 15px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: 0.14em;
  box-shadow: 0 8px 26px -12px rgba(201, 168, 106, 0.7);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}
/* 金箔のひかりが横切るシマー */
.primary-btn::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 248, 230, 0.55), transparent);
  transform: skewX(-18deg); animation: sheen 9s ease-in-out infinite;
}
/* 光は「たまに」よぎるから上質に見える。頻繁だと安っぽくなる */
@keyframes sheen { 0% { left: -60%; } 14%, 100% { left: 140%; } }
@media (prefers-reduced-motion: reduce) { .primary-btn::after { animation: none; } }
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: scale(0.99); }
.primary-btn:disabled { opacity: 0.5; }
.form-error { color: #e6889a; font-size: 12.5px; min-height: 16px; margin: 0; }

/* 主要ボタンを画面下に常時固定（スクロールせずに必ず押せる）。
   親 .screen の左右18px・下30pxパディングを相殺して全幅に。下端はセーフエリア対応。 */
/* CTAを持つ画面は下パディングを消し、stickyを画面下端にぴったり密着させる */
.screen:has(.screen-cta) { padding-bottom: 0; }
.screen-cta {
  position: sticky; bottom: 0; z-index: 5;
  margin: auto -18px 0; /* 上は auto で、内容が短いとき画面下へ寄せる。下端は密着 */
  padding: 14px 18px max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, rgba(16, 15, 36, 0), var(--ink) 34%);
}
.screen-cta .primary-btn { margin-top: 0; }

/* ===== Thread ===== */
/* display は指定しない（非アクティブ時は .screen の display:none で隠し、
   アクティブ時は .screen.active の display:flex で表示させる）。
   ここで display:flex を無条件指定すると、鑑定結果画面が常時表示されて
   #app 下部に居座り「全画面で下半分が動かない紺の余白」になる。 */
.thread-screen { padding: 0; flex: 1; min-height: 0; position: relative; flex-direction: column; }

/* 相談内容の固定ヘッダ */
.thread-head { flex: none; padding: 9px 16px; border-bottom: 1px solid var(--line); background: rgba(12, 11, 30, 0.5); }
.thread-head:empty { display: none; }
.th-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.th-row b { color: var(--paper); font-family: var(--serif); letter-spacing: 0.03em; }
.th-depth { font-size: 10.5px; color: var(--gold-bright); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 1px 8px; }
.th-name { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.th-sub { font-size: 12px; color: var(--paper-2); margin-top: 4px; line-height: 1.55; max-height: 3.1em; overflow: hidden; }

/* 重なったカード（スタック）。背後に次のカードが覗いて「めくる」感を出す */
.deck { flex: 1; min-height: 0; position: relative; overflow: hidden; padding: 16px 16px 20px; }
.deck-card {
  position: absolute; left: 16px; right: 16px; top: 16px; bottom: 24px;
  overflow: hidden;
  /* 紙の札のような面：濃紺の地＋金の二重枠＋浮き影 */
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201,168,106,0.10), transparent 60%),
    linear-gradient(180deg, #1c1a40, #15132f);
  border: 1px solid rgba(201,168,106,0.55); border-radius: 16px;
  box-shadow: 0 22px 44px -20px #000, 0 4px 14px -10px #000;
  transition: transform 0.42s cubic-bezier(.2,.7,.25,1), opacity 0.32s ease, box-shadow 0.42s ease;
  /* 上端を軸にして重ねると「付箋を重ねた」段差が上に覗く */
  transform-origin: top center; will-change: transform, opacity;
}
/* 背後（これから読む／読み終えた）カードは、覗く上端だけが見える。
   影を弱めて奥行きを出し、前面カードとの段差を強調する。 */
.deck-card.is-behind {
  box-shadow: 0 10px 22px -16px #000;
}
.deck-card.is-behind::after {
  content: ""; position: absolute; inset: 0; border-radius: 16px;
  background: rgba(16, 15, 36, 0.28); pointer-events: none; z-index: 3;
}
/* 中身だけがスクロールする層。額縁（金枠）は .deck-card 側に固定されたまま、
   長文でも金線が本文を横切らない。 */
.deck-scroll {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 24px 22px 30px;
  scrollbar-width: none;
}
.deck-scroll::-webkit-scrollbar { width: 0; }
/* カードはデッキ高さを満たし、中身は上下中央へ（短い鑑定でも空きが偏らない／長文は上から） */
.deck-scroll > * { margin: auto 0; width: 100%; max-width: 560px; }
/* 札の内側の細い金枠（手触り感）。スクロールしても額縁に留まる */
.deck-card::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(201,168,106,0.3);
  border-radius: 11px; pointer-events: none; z-index: 2;
}
/* 下に続きがあるときだけ、下端がふわっと沈む（「まだ読める」の合図） */
.deck-fade {
  position: absolute; left: 1px; right: 1px; bottom: 1px; height: 48px; z-index: 2;
  border-radius: 0 0 15px 15px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(17, 15, 40, 0.94));
  opacity: 0; transition: opacity 0.3s ease;
}
.deck-fade.on { opacity: 1; }

/* 全画面で読む(⤢ボタン＋カードタップ) */
.deck-zoom-btn {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  background: rgba(24, 23, 52, 0.66); border: 1px solid var(--gold-soft); color: var(--gold);
  transition: transform 0.15s, border-color 0.15s;
}
.deck-zoom-btn svg { width: 16px; height: 16px; display: block; }
.deck-zoom-btn:hover { transform: scale(1.08); border-color: var(--gold); }
.deck-card.is-behind .deck-zoom-btn { visibility: hidden; }
.card-zoom {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 9, 26, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: stretch; justify-content: center;
  padding: 0;
  animation: czIn 0.22s ease both;
}
@keyframes czIn { from { opacity: 0; } to { opacity: 1; } }
.cz-sheet {
  width: min(760px, 100%); display: flex; flex-direction: column; min-height: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201,168,106,0.10), transparent 60%),
    linear-gradient(180deg, #1c1a40, #15132f);
  border-left: 1px solid rgba(201,168,106,0.4); border-right: 1px solid rgba(201,168,106,0.4);
}
.cz-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line);
}
.cz-title { font-family: var(--serif); font-size: 14px; letter-spacing: 0.08em; color: var(--gold-bright); }
.cz-close {
  flex: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 20px; line-height: 1; padding: 0;
  background: none; border: 1px solid var(--line); color: var(--paper);
}
.cz-close:hover { border-color: var(--gold); color: var(--gold-bright); }
.cz-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 26px 22px calc(44px + env(safe-area-inset-bottom));
}
.cz-body > * { max-width: 640px; margin: 0 auto; width: 100%; }
body.theme-pop .deck-zoom-btn { background: #fff; border: 2px solid #f0d6e0; color: var(--pop-pink-deep); }
body.theme-pop .card-zoom { background: rgba(77, 53, 66, 0.42); }
body.theme-pop .cz-sheet {
  background: linear-gradient(180deg, #ffffff, #fff6ef);
  border-color: #f6d9e5;
}

/* スタックのナビ（前へ / ラベル / 次へ）。スワイプが分からなくても押せる */
.deck-nav { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px max(8px, env(safe-area-inset-bottom)); }
.deck-nav[hidden] { display: none; }
.deck-arrow {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-soft);
  background: rgba(24, 23, 52, 0.85); color: var(--gold); cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.15s, color 0.15s;
}
.deck-arrow svg { width: 17px; height: 17px; display: block; }
.deck-arrow:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); }
.deck-arrow:disabled { opacity: 0.3; cursor: default; }
.deck-label { flex: 1; text-align: center; line-height: 1.2; }
.deck-label b { display: block; font-family: var(--serif); font-size: 14px; color: var(--paper); letter-spacing: 0.04em; }
.deck-label span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 裏で鑑定が続いていることを示す小さな灯 */
.deck-live {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 5px;
  background: var(--gold-bright); vertical-align: 1px;
  animation: livepulse 1.8s ease-in-out infinite;
}
@keyframes livepulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.deck-next {
  flex: none; padding: 10px 16px 10px 20px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--gold); background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; white-space: nowrap;
  transition: box-shadow 0.3s ease;
}
.deck-next .chev { width: 15px; height: 15px; display: block; }
.deck-next:disabled { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 400; padding: 10px 18px; }
/* 新しいカードが裏に届いた合図。読書の邪魔をしない静かな明滅（数回で止まる） */
.deck-next.has-new { animation: nudge 1.6s ease-in-out 3; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 199, 137, 0); }
  50% { box-shadow: 0 0 0 5px rgba(228, 199, 137, 0.22), 0 0 18px -2px rgba(228, 199, 137, 0.5); }
}
@media (prefers-reduced-motion: reduce) {
  .deck-live, .deck-next.has-new { animation: none; }
}

/* 占い師カードの中身（チャット風をやめ、鑑定書らしく） */
.oc-card { max-width: 560px; }
.oc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid rgba(201,168,106,0.25); }
.oc-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.oc-name { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; }
.oc-craft { font-size: 11.5px; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
/* 名前の右の「あなたは◯◯」分類札。占い師ごとのアクセント色で薄く彩る */
.oc-type {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 12px 7px; margin-left: 8px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 45%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent, var(--gold)) 8%, transparent);
  text-align: center;
}
.oc-type-k { font-size: 9px; color: var(--muted); letter-spacing: 0.14em; }
.oc-type-v { font-family: var(--serif); font-size: 13.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--paper); white-space: nowrap; }
.oc-type-s { font-size: 9.5px; color: color-mix(in srgb, var(--accent, var(--gold)) 75%, var(--paper)); letter-spacing: 0.06em; white-space: nowrap; }
.oc-body { display: block; font-family: var(--serif); font-size: 15px; line-height: 2.0; color: var(--paper); white-space: pre-wrap; word-break: break-word; letter-spacing: 0.02em; }
.oc-body.revealed { animation: bubbleReveal 0.5s ease both; }
.oc-body strong { color: var(--gold-bright); font-weight: 700; }

/* デッキ内のラッキー手帖・鑑定カルテは、外枠の札に溶け込ませる（二重枠を防ぐ） */
.deck-card .lucky-card, .deck-card .chart-card,
.cz-body .lucky-card, .cz-body .chart-card { background: none; border: none; box-shadow: none; padding: 0; margin: 0; }
.deck-card .lucky-card::before, .deck-card .chart-card::before,
.cz-body .lucky-card::before, .cz-body .chart-card::before { display: none; }

/* 結果フッタ（免責はカード内へ。ここはシェア＋やり直しの1行だけ） */
.thread-foot { flex: none; padding: 0 16px; }
.thread-foot:empty { display: none; }
.thread-foot .result-actions { display: flex; gap: 10px; margin: 8px 0 12px; }
.thread-foot .share-btn { flex: 1; margin: 0; padding: 12px 14px; font-size: 14px; }
.thread-foot .restart-btn { margin: 0; padding: 12px 16px; white-space: nowrap; }
.thread-foot .sys-note { margin: 10px 0; }
.thread-foot .restart-btn#retryBtn { margin: 8px auto 12px; }

/* 結果フッタ（免責・シェア・やり直し） */
.thread-foot { flex: none; padding: 0 16px; }
.thread-foot:empty { display: none; }
.thread-foot .disclaimer { margin: 10px 0 0; }
.thread-foot .result-actions { margin: 10px 0 12px; }
.thread-foot .sys-note { margin: 10px 0; }
.thread-foot .restart-btn { margin: 8px auto 12px; }

/* 鑑定を中止ボタン（生成中だけ表示） */
.stop-btn {
  position: absolute; left: 50%; bottom: calc(58px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  /* deck-card(z-index:40)の上に浮かせる。6だとカードの裏に隠れる */
  z-index: 50; border: 1px solid var(--gold-soft); border-radius: 999px;
  background: rgba(24, 23, 52, 0.92); color: var(--gold); cursor: pointer;
  font-family: var(--serif); font-size: 12.5px; letter-spacing: 0.06em; padding: 9px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
}
.stop-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.stop-btn[hidden] { display: none; }
.usage-bar {
  flex: none; font-size: 11px; color: var(--muted);
  padding: 7px 16px; border-bottom: 1px solid var(--line);
  background: rgba(12, 11, 30, 0.6); display: flex; gap: 10px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.usage-bar b { color: var(--paper); font-weight: 600; }
.usage-bar .cost { color: var(--gold-bright); }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 18px; }

.msg { display: flex; gap: 12px; align-items: flex-start; animation: rise 0.32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.avatar {
  --accent: var(--gold);
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--ink-3); border: 1px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.18), 0 0 18px -8px var(--accent);
}
.avatar .sigil { width: 23px; height: 23px; color: var(--accent); }
.avatar.user { font-family: var(--serif); font-weight: 700; color: var(--gold); border-color: var(--gold-soft); font-size: 17px; }

.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.msg-name { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; }
.msg-craft { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; }

.bubble {
  background: linear-gradient(168deg, var(--ink-2), rgba(24, 23, 52, 0.7));
  border: 1px solid var(--line); border-left: 2px solid var(--accent, var(--line));
  border-radius: 3px 12px 12px 12px;
  padding: 13px 16px; font-size: 15px; line-height: 1.95;
  white-space: pre-wrap; word-break: break-word; color: var(--paper);
}
/* 鑑定の根拠データ。ピル型バッジの羅列をやめ、目録のような静かな1行ずつに */
.derived { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.chip {
  font-size: 11.5px; padding: 3px 0 3px 12px; position: relative;
  color: var(--paper-2); letter-spacing: 0.04em; line-height: 1.6;
}
.chip::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; background: var(--gold); opacity: 0.7;
  /* 菱形の小点（シジルの線の言語に合わせる） */
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

/* FB: 信憑性 — 「この占術について」折りたたみ。根拠（成り立ち＋再現性）を控えめに添える。 */
.craft-note { margin: -2px 0 10px; }
.craft-note summary {
  font-size: 11px; color: var(--muted); cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 5px; user-select: none;
  border-bottom: 1px dotted var(--line); padding-bottom: 1px;
}
.craft-note summary::-webkit-details-marker { display: none; }
.craft-note summary::before { content: "ⓘ"; color: var(--gold); font-size: 11px; }
.craft-note summary:hover { color: var(--paper-2); }
.craft-note p {
  margin: 7px 0 0; font-size: 11.5px; line-height: 1.75; color: var(--muted);
  border-left: 2px solid var(--gold-soft); padding-left: 10px;
}

/* FB4: 「引いていく様子」の演出ログ（鑑定本文の前に1行ずつ出る） */
.draw-log:empty { display: none; }
.draw-log { margin-bottom: 9px; display: flex; flex-direction: column; gap: 4px; }
.draw-step {
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  font-family: var(--serif); letter-spacing: 0.03em;
  padding-left: 12px; border-left: 2px solid var(--accent, var(--line));
  opacity: 0; animation: drawIn 0.45s ease forwards;
}
@keyframes drawIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== 引いた札・卦のビジュアル表示（タロット/ルーン/易） ===== */
.draw-visual:empty { display: none; }
.draw-visual { margin: 2px 0 10px; }
.draw-visual.show .dv-row { animation: dvIn 0.5s ease both; }
@keyframes dvIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
.dv-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* タロット風カード（著作権のある絵柄は使わず、月の紋章＋名前で表現） */
.dv-card, .dv-rune {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 92px; padding: 10px 8px; border-radius: 8px; text-align: center;
  background: radial-gradient(circle at 50% 28%, rgba(201,168,106,0.14), rgba(16,15,36,0.35) 72%), var(--ink-3);
  border: 1px solid var(--gold-soft); box-shadow: 0 6px 18px -12px #000, inset 0 0 18px -12px var(--gold-bright);
}
.dv-pos { font-size: 9.5px; color: var(--muted); letter-spacing: 0.04em; }
.dv-emblem { width: 30px; height: 30px; color: var(--accent, var(--gold)); }
.dv-emblem .sigil { width: 30px; height: 30px; }
.dv-card.rev .dv-emblem, .dv-rune.rev .dv-glyph { transform: rotate(180deg); }
.dv-glyph { font-size: 30px; line-height: 1.1; color: var(--gold-bright); font-family: var(--serif); }
.dv-name { font-family: var(--serif); font-size: 12px; font-weight: 700; color: var(--paper); letter-spacing: 0.03em; }
.dv-ori { font-size: 9.5px; padding: 1px 7px; border-radius: 999px; color: var(--gold-bright); border: 1px solid var(--gold-soft); }
.dv-card.rev .dv-ori, .dv-rune.rev .dv-ori { color: #e6a4b4; border-color: rgba(230,136,154,0.5); }

/* 易: 六爻（陰陽の線） */
.dv-hex {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 16px; border-radius: 8px;
  background: radial-gradient(circle at 50% 22%, rgba(201,168,106,0.12), rgba(16,15,36,0.35) 75%), var(--ink-3);
  border: 1px solid var(--gold-soft); box-shadow: inset 0 0 18px -12px var(--gold-bright);
}
.hex-lines { display: flex; flex-direction: column; gap: 5px; width: 70px; }
.hex-line { height: 7px; border-radius: 2px; position: relative; }
.hex-line.yang { background: var(--gold); }
.hex-line.yin { background: transparent; display: flex; justify-content: space-between; }
.hex-line.yin::before, .hex-line.yin::after { content: ""; width: 44%; height: 100%; background: var(--gold); border-radius: 2px; }
.hex-line.chg { box-shadow: 0 0 7px 1px var(--gold-bright); }
.hex-line.chg.yin::before, .hex-line.chg.yin::after { box-shadow: 0 0 7px 1px var(--gold-bright); }
.dv-hex .dv-name { margin-top: 2px; }
.dv-changed { font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em; }

/* 鑑定本文の一括フェード表示（出力され切ってから） */
.bubble.revealed { animation: bubbleReveal 0.5s ease both; }
@keyframes bubbleReveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ユーザー（相談者）の親メッセージ */
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble {
  background: linear-gradient(168deg, #2a2450, #221d44);
  border: 1px solid #463c70; border-left-width: 1px;
  border-radius: 12px 3px 12px 12px; font-family: var(--serif); letter-spacing: 0.03em;
}

/* タイピングインジケータ */
.typing { display: inline-flex; gap: 5px; padding: 5px 2px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0.4; animation: blink 1.3s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* 生成待ちの所作。チャットボットの「…」ではなく、星を読む静かな待ち姿。 */
.divining { display: inline-flex; align-items: center; gap: 10px; padding: 4px 0; }
.divining-star {
  font-size: 15px; color: var(--gold); line-height: 1;
  animation: divine-pulse 1.9s ease-in-out infinite;
}
.divining-tx {
  font-family: var(--serif); font-size: 13.5px; letter-spacing: 0.1em;
  background: linear-gradient(100deg, var(--muted) 30%, var(--gold-bright) 50%, var(--muted) 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: divine-shimmer 2.6s linear infinite;
}
@keyframes divine-pulse { 0%, 100% { opacity: 0.5; transform: scale(0.9) rotate(0deg); } 50% { opacity: 1; transform: scale(1.12) rotate(90deg); } }
@keyframes divine-shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .divining-star, .divining-tx { animation: none; }
  .divining-tx { color: var(--gold-bright); }
}

/* ===== 今日のラッキー手帖（日替わりテーマ）===== */
.lucky-card {
  position: relative;
  background: linear-gradient(168deg, #241f48, #1a1638);
  border: 1px solid var(--gold-soft);
  border-radius: 4px; padding: 18px 18px 20px;
  box-shadow: 0 8px 32px -18px rgba(201, 168, 106, 0.5);
  animation: rise 0.34s ease both;
}
.lk-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lk-emoji.medallion { width: 44px; height: 44px; margin: 0; }
.lk-emoji .ticon { width: 23px; height: 23px; }
.lk-title { font-family: var(--serif); font-weight: 800; font-size: 17px; letter-spacing: 0.1em; color: var(--paper); }
.lk-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; margin-top: 2px; }

.lk-overall {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  background: rgba(201, 168, 106, 0.07); border: 1px solid var(--gold-soft); border-radius: 3px;
}
.lk-ov-label { font-family: var(--serif); font-size: 13px; letter-spacing: 0.12em; color: var(--gold-bright); }
.lk-ov-stars { flex: 1; }
.lk-ov-tag {
  font-family: var(--serif); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink); background: var(--gold); padding: 3px 12px; border-radius: 2px;
}

.stars { font-size: 16px; letter-spacing: 0.06em; line-height: 1; white-space: nowrap; }
.lk-ov-stars .stars { font-size: 19px; }
.stars .on { color: var(--gold-bright); }
.stars .off { color: var(--line); }

.lk-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; margin-bottom: 14px; }
.lk-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; }
.lk-cat-label { font-size: 12.5px; color: var(--paper-2); letter-spacing: 0.04em; }

.lk-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.lk-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; background: var(--ink-2);
}
.lk-item-label { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; }
.lk-item-val { font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--paper); display: flex; align-items: center; gap: 7px; }
.lk-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); flex: none; }

.lk-keyword {
  text-align: center; font-size: 13px; color: var(--paper-2); letter-spacing: 0.04em;
  margin: 16px 0 12px;
}
.lk-keyword b { font-family: var(--serif); font-size: 16px; color: var(--gold-bright); letter-spacing: 0.1em; margin: 0 0.2em; }
.lk-advice {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; line-height: 1.8; color: var(--paper);
  padding: 11px 14px; background: rgba(201, 168, 106, 0.07);
  border-left: 2px solid var(--gold); border-radius: 0 3px 3px 0;
}
.lk-advice-label {
  font-family: var(--serif); font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; color: var(--gold);
}
/* 鑑定結果からキーワード/指針が差し込まれるまでの仮表示 */
.lk-pending { opacity: 0.6; font-style: italic; font-weight: 400 !important; animation: lkpulse 1.4s ease-in-out infinite; }
@keyframes lkpulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.75; } }

/* ===== 鑑定書（統合カルテ）===== */
.chart-card {
  position: relative;
  background:
    linear-gradient(168deg, #211c44, #1a1638);
  border: 1px solid var(--gold);
  border-radius: 4px; padding: 22px 20px 24px; margin-top: 4px;
  box-shadow: 0 10px 40px -18px rgba(201, 168, 106, 0.6);
  animation: rise 0.4s ease both;
}
.chart-card::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-soft);
  border-radius: 2px; pointer-events: none;
}
.chart-seal {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 6px;
}
.chart-seal .sigil { width: 26px; height: 26px; color: var(--gold); }
.chart-seal .seal-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  border: 1px solid var(--gold-soft); box-shadow: 0 0 0 3px rgba(0,0,0,0.18);
}
.chart-seal .seal-name { font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em; color: var(--gold-bright); }
.chart-card h2 {
  font-family: var(--serif); font-weight: 800; font-size: 19px; text-align: center;
  letter-spacing: 0.24em; margin: 2px 0 14px; color: var(--paper);
}
.chart-card h2::before, .chart-card h2::after { content: "❖"; color: var(--gold); font-size: 11px; margin: 0 0.6em; vertical-align: middle; }
.chart-card h3, .chart-card strong.section {
  display: block; font-family: var(--serif); font-size: 12.5px; color: var(--gold);
  margin: 16px 0 6px; font-weight: 700; letter-spacing: 0.16em;
  padding-bottom: 4px; border-bottom: 1px solid var(--gold-soft);
}
.chart-card ul { margin: 5px 0; padding-left: 20px; }
.chart-card li { margin: 4px 0; font-size: 14px; line-height: 1.85; }
.chart-card li::marker { color: var(--gold); }
.chart-card p { margin: 5px 0; font-size: 14px; line-height: 1.9; }
.chart-card strong { color: var(--gold-bright); }

.disclaimer {
  font-size: 11px; color: var(--muted); line-height: 1.7;
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 11px;
}
.sys-note { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0; }

.restart-btn {
  display: block; margin: 18px auto 8px; padding: 11px 26px; cursor: pointer;
  background: transparent; color: var(--gold); border: 1px solid var(--gold-soft);
  border-radius: 3px; font-family: var(--serif); font-size: 13px; letter-spacing: 0.12em;
  transition: background 0.15s, border-color 0.15s;
}
.restart-btn:hover { background: rgba(201, 168, 106, 0.08); border-color: var(--gold); }

/* ===== 再訪バナー（おかえりなさい） ===== */
.welcome-back {
  margin: 6px 0 14px; padding: 14px 16px;
  border: 1px solid var(--gold-soft); border-radius: 6px;
  background: linear-gradient(165deg, rgba(201,168,106,0.12), rgba(33,31,68,0.5));
  box-shadow: inset 0 0 18px -10px var(--gold-bright);
}
.wb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-hi { font-family: var(--serif); font-size: 15px; color: var(--gold-bright); letter-spacing: 0.04em; }
.wb-hi b { color: #fff; }
.wb-clear {
  flex: none; width: 34px; height: 34px; margin: -5px; line-height: 1; cursor: pointer;
  background: transparent; border: none; color: var(--gold); opacity: 0.6; font-size: 13px;
  display: grid; place-items: center; border-radius: 50%;
}
.wb-clear:hover { opacity: 1; }
.wb-meta { margin-top: 4px; font-size: 12px; color: #9aa0cf; letter-spacing: 0.04em; }
.wb-cta {
  margin-top: 12px; width: 100%; padding: 12px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: 0.1em;
  box-shadow: 0 8px 22px -12px rgba(201, 168, 106, 0.7);
}
.wb-cta:hover { filter: brightness(1.06); }
.wb-cta:active { transform: scale(0.99); }

/* ===== 結果のシェア導線 ===== */
.result-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; }
.share-btn {
  display: block; margin: 2px auto; padding: 13px 30px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: 0.12em;
  box-shadow: 0 8px 24px -12px rgba(201, 168, 106, 0.7);
}
.share-btn:hover { filter: brightness(1.06); }
.share-btn:active { transform: scale(0.99); }
.result-actions .restart-btn { margin: 4px auto 8px; }

/* シェア用フォールバック（PCなど） */
.share-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 7, 20, 0.78); backdrop-filter: blur(3px); padding: 20px;
}
.share-box {
  max-width: 420px; width: 100%; max-height: 92vh; overflow: auto; text-align: center;
  background: var(--ink-2); border: 1px solid var(--gold-soft); border-radius: 10px; padding: 18px;
}
.share-img { width: 100%; max-width: 320px; border-radius: 8px; border: 1px solid var(--gold-soft); }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.sb {
  display: block; padding: 11px 8px; cursor: pointer; text-decoration: none; text-align: center;
  border: 1px solid var(--gold-soft); border-radius: 4px; background: var(--ink-3);
  color: var(--gold-bright); font-size: 13px; font-family: var(--serif); letter-spacing: 0.06em;
}
.sb:hover { border-color: var(--gold); background: rgba(201,168,106,0.1); }
.share-close {
  margin-top: 8px; padding: 9px 22px; cursor: pointer; background: transparent;
  border: 1px solid var(--gold-soft); border-radius: 3px; color: #9aa0cf; font-size: 13px;
}
.share-close:hover { border-color: var(--gold); color: var(--gold); }

/* SNS投稿案 —「写し」の紙面（シェアモーダル内）。鑑定書の金罫・明朝トーンを踏襲し、
   青系アクセント・グレー角丸カードのSaaSルックは使わない。 */
.share-drafts { margin: 14px 2px 4px; text-align: left; }
.share-drafts[hidden] { display: none; }
.drafts-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-family: var(--serif); font-size: 12px; font-weight: 700; letter-spacing: 0.28em; color: var(--gold);
}
.drafts-head::before { content: "✦"; flex: none; font-size: 9px; opacity: 0.9; }
.drafts-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-soft), transparent); }
.drafts-toggle { margin-bottom: 10px; }
.drafts-toggle .seg { padding: 8px 6px; font-size: 12.5px; }
/* 紙面そのものがコピーのボタン（1タップで完結） */
.draft-paper {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(201, 168, 106, 0.06), rgba(16, 15, 36, 0.35));
  border: 1px solid var(--gold-soft); border-left: 2px solid var(--gold);
  border-radius: 0 3px 3px 0; padding: 13px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.draft-paper:hover { border-color: var(--gold); }
.draft-paper:active { transform: scale(0.995); }
.draft-paper.copied { background: rgba(201, 168, 106, 0.15); border-left-color: var(--gold-bright); }
.draft-text {
  display: block; font-family: var(--serif); font-size: 13.5px; line-height: 1.95;
  letter-spacing: 0.02em; color: var(--paper); white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto;
}
.draft-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; padding: 0 2px; }
.draft-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.draft-count.over { color: #e6889a; }
.draft-copy { font-family: var(--serif); font-size: 11px; color: var(--gold); letter-spacing: 0.06em; }
.draft-paper.copied + .draft-foot .draft-copy { color: var(--gold-bright); }

/* ===== サイトナビ（Webサイト風ヘッダ） ===== */
.brand { flex: 0 1 auto; }
.site-nav { margin-left: auto; display: flex; gap: 2px; flex: none; }
.nav-link {
  background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 4px;
  color: var(--paper-2); font-family: var(--serif); font-size: 12.5px; letter-spacing: 0.03em; white-space: nowrap;
}
.nav-link:hover { color: var(--gold-bright); }
.nav-link.current { color: var(--gold-bright); }
.nav-link.current::after { content: ""; display: block; height: 1.5px; background: var(--gold); margin-top: 2px; border-radius: 2px; }
/* 狭い画面: ナビ3項目(占い師一覧/タイプ図鑑/使い方)がロゴと重ならないよう詰める */
@media (max-width: 480px) {
  .appbar { gap: 6px; }
  .wordmark { font-size: 17px; letter-spacing: 0.08em; }
  .wordmark-sub { font-size: 11px; letter-spacing: 0.18em; margin-left: 0.35em; }
  .nav-link { padding: 6px 4px; font-size: 11.5px; letter-spacing: 0; }
  .badge { padding: 3px 6px; letter-spacing: 0.06em; }
}
@media (max-width: 400px) {
  .logo-mark { display: none; } /* 最狭幅ではロゴマークを畳んで文字を守る */
}

/* ===== コンテンツページ（占い師一覧 / について） ===== */
/* 縦に長いページで子要素（特にボタン）が flex で潰れて文字が切れるのを防ぐ */
.screen.page > * { flex: 0 0 auto; }
.page-head { margin-bottom: 14px; }
.page-title {
  font-family: var(--serif); font-size: 23px; font-weight: 800; letter-spacing: 0.05em;
  color: var(--paper); margin: 6px 0 6px;
}
.page-title::before { content: "✦"; color: var(--gold); font-size: 12px; margin-right: 8px; vertical-align: 3px; }
.page-lead { color: var(--paper-2); font-size: 13px; line-height: 1.85; margin: 0; }
.page-cta { margin-top: 20px; }

/* 占い師ギャラリー */
.casts-gallery { display: flex; flex-direction: column; gap: 10px; }
.gcast {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px; cursor: pointer;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 6px; transition: border-color 0.15s, transform 0.12s;
}
.gcast:hover { border-color: var(--gold); transform: translateY(-1px); }
.gcast-sigil {
  width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(201,168,106,0.16), rgba(16,15,36,0.2) 70%), var(--ink-3);
  border: 1px solid var(--accent, var(--gold-soft));
}
.gcast-sigil .sigil { width: 24px; height: 24px; color: var(--accent, var(--gold)); }
.gcast-tx { flex: 1; min-width: 0; }
.gcast-name { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--paper); }
.gcast-craft { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.gcast-tag { font-size: 9px; padding: 1px 6px; border-radius: 999px; color: var(--gold-bright); border: 1px solid var(--gold-soft); vertical-align: 1px; }
.gcast-info {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 11px; color: var(--gold-bright); border: 1px solid var(--gold-soft);
}

/* About */
.about-body { margin-top: 4px; }
.about-h { font-family: var(--serif); font-size: 14px; color: var(--gold-bright); letter-spacing: 0.06em; margin: 20px 0 9px; }
.about-h::before { content: "✦ "; color: var(--gold); font-size: 10px; }
.about-p { font-size: 13px; line-height: 1.9; color: var(--paper-2); margin: 0; }
.about-note { font-size: 12px; color: var(--muted); }
.about-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.about-steps li { counter-increment: s; display: flex; flex-direction: column; padding-left: 36px; position: relative; }
.about-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 12px; color: #2a2010;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}
.about-steps b { font-family: var(--serif); font-size: 14px; color: var(--paper); }
.about-steps span { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }

/* ===== フッタ ===== */
.site-footer {
  margin: 28px -18px -30px; padding: 22px 18px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--gold-soft); background: rgba(12, 11, 30, 0.45); text-align: center;
}
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.foot-link { background: none; border: none; cursor: pointer; color: var(--gold); font-family: var(--serif); font-size: 12.5px; }
.foot-link:hover { color: var(--gold-bright); }
.foot-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 0 0 8px; }
.foot-brand {
  font-family: var(--serif); color: var(--gold); font-size: 13px; letter-spacing: 0.1em; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.foot-mark { width: 18px; height: 18px; color: var(--gold); opacity: 0.85; }

/* ===== 鑑定からの離脱確認（結果は保存されないため） ===== */
.leave-box { max-width: 340px; text-align: center; }
.leave-title { font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; color: var(--paper); margin: 4px 0 10px; }
.leave-note { font-size: 12.5px; line-height: 1.9; color: var(--paper-2); margin: 0 0 18px; }
.leave-actions { display: flex; flex-direction: column; gap: 9px; }
/* 「読み続ける」が安全側＝主役。「離れる」は控えめに */
.leave-stay {
  width: 100%; padding: 13px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a2010; font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: 0.1em;
}
.leave-go { width: 100%; padding: 11px; }

/* ===== アクセシビリティ ===== */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== キャラ画像(assets/cast) ===== */
.portrait { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* ============================================================
   ポップテーマ「マカロンポップ」(きせかえ)
   動物占い系のライトで可愛いトーン。クリーム地×パステル×
   キャラがステッカーのように並ぶ。body.theme-pop で発動。
   ============================================================ */
body.theme-pop {
  --ink: #fff5e9;          /* クリーム背景 */
  --ink-2: #ffffff;        /* パネルは白 */
  --ink-3: #fdeff5;        /* 薄ピンクの面 */
  --line: #f6d3e2;         /* ピンクの罫線 */
  --paper: #4d3542;        /* ココアローズの文字(濃) */
  --paper-2: #5f4453;
  --muted: #7d5f70;
  --gold: #f4a93c;         /* はちみつイエロー(塗り用) */
  --gold-bright: #9e6008;  /* 文字が乗る箇所は濃いはちみつ */
  --gold-soft: rgba(232, 150, 30, 0.4);
  --pop-pink: #ff87b3;
  --pop-pink-deep: #ff6ba0;
  --pop-pink-text: #c22762;
  --pop-mint: #7fd8c9;
  --pop-lav: #b9a8f0;
  --serif: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", var(--sans);
  background-color: var(--ink);
  /* ちいかわ風: クリーム地にごく薄いダイヤ柄＋数個の星 */
  background-image:
    radial-gradient(2.2px 2.2px at 14% 12%, rgba(244, 169, 60, 0.5), transparent),
    radial-gradient(2.2px 2.2px at 86% 8%, rgba(255, 135, 179, 0.45), transparent),
    radial-gradient(2px 2px at 50% 20%, rgba(185, 168, 240, 0.4), transparent),
    linear-gradient(45deg, rgba(244, 169, 60, 0.04) 25%, transparent 25%, transparent 75%, rgba(244, 169, 60, 0.04) 75%),
    linear-gradient(-45deg, rgba(244, 169, 60, 0.04) 25%, transparent 25%, transparent 75%, rgba(244, 169, 60, 0.04) 75%),
    radial-gradient(70% 42% at 50% -10%, #ffe7f1 0%, transparent 62%),
    linear-gradient(180deg, #fff1de 0%, var(--ink) 55%);
  background-size: auto, auto, auto, 58px 58px, 58px 58px, auto, auto;
}
/* 瞬く星→ふわふわ漂うパステル紙吹雪(ごく控えめ) */
body.theme-pop::before {
  opacity: 0.35;
  background-image:
    radial-gradient(3px 3px at 12% 30%, rgba(244, 169, 60, 0.6), transparent),
    radial-gradient(2.6px 2.6px at 82% 22%, rgba(255, 135, 179, 0.55), transparent),
    radial-gradient(2.2px 2.2px at 52% 12%, rgba(185, 168, 240, 0.5), transparent),
    radial-gradient(3px 3px at 33% 64%, rgba(127, 216, 201, 0.5), transparent),
    radial-gradient(2.4px 2.4px at 68% 72%, rgba(255, 135, 179, 0.45), transparent),
    radial-gradient(2.6px 2.6px at 90% 52%, rgba(244, 169, 60, 0.5), transparent),
    radial-gradient(2.2px 2.2px at 8% 84%, rgba(185, 168, 240, 0.45), transparent);
}
/* 金のオーラ→画面上部のパステルにじみ */
body.theme-pop::after {
  background:
    radial-gradient(55% 30% at 18% -5%, rgba(255, 135, 179, 0.2), transparent 70%),
    radial-gradient(50% 28% at 85% -4%, rgba(127, 216, 201, 0.18), transparent 70%);
}

/* ヘッダー: 白ベース＋ピンクの縁 */
body.theme-pop .appbar {
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.97), rgba(255, 250, 243, 0.85));
  border-bottom: 2px solid #ffd9e7;
}
body.theme-pop .appbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
  background: radial-gradient(circle at 6px 0px, #ffd9e7 3px, transparent 3.4px);
  background-size: 14px 7px; background-repeat: repeat-x;
  pointer-events: none;
}
body.theme-pop .appbar { position: relative; }
body.theme-pop .logo-mark { color: var(--pop-pink-deep); }
body.theme-pop .wordmark-sub { color: var(--pop-pink-text); }

/* まるっと角丸＋白カード＋やさしい影 */
body.theme-pop .theme-card,
body.theme-pop .depth-card,
body.theme-pop .cast-card,
body.theme-pop .gcast,
body.theme-pop .welcome-back,
body.theme-pop .info-box {
  border-radius: 22px;
  background: #fff;
  border: 2px solid #f6d9e5;
  box-shadow: 0 6px 18px -10px rgba(214, 122, 155, 0.35);
}
body.theme-pop .how {
  border-radius: 22px; background: #fff;
  border: 2px dashed #ffc9dd;
  box-shadow: 0 6px 18px -10px rgba(214, 122, 155, 0.3);
}
body.theme-pop .info-box { box-shadow: 0 18px 44px -18px rgba(120, 60, 90, 0.4); }
body.theme-pop .field input,
body.theme-pop .field textarea,
body.theme-pop .field select {
  border-radius: 16px; background: #fffaf4; border: 2px solid #f0d6e0; color: var(--paper);
}
body.theme-pop .cast-sigil,
body.theme-pop .medallion,
body.theme-pop .info-sigil,
body.theme-pop .gcast-sigil {
  box-shadow: 0 3px 10px -4px rgba(120, 60, 90, 0.45);
  border: 2px solid #fff;
}

/* ボタンはぷっくりキャンディ */
body.theme-pop .primary-btn {
  border: none; border-radius: 999px;
  background: linear-gradient(180deg, #ffb1cd 0%, var(--pop-pink-deep) 100%);
  color: #fff; letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 22px -8px rgba(255, 107, 160, 0.65), inset 0 -3px 0 rgba(0, 0, 0, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
body.theme-pop .primary-btn:hover { filter: brightness(1.04); }
body.theme-pop .ghost-btn,
body.theme-pop .flow-back,
body.theme-pop .page-cta { border-radius: 999px; }
body.theme-pop .ghost-btn { background: #fff; border: 2px solid #f0d6e0; }
body.theme-pop .ghost-btn:hover { background: #fff2f7; border-color: var(--pop-pink); }
body.theme-pop .cast-toggle, body.theme-pop .seg { border-radius: 999px; }
body.theme-pop .cast-toggle { background: #fff; border: 2px solid #f6d9e5; }
body.theme-pop .seg.active {
  background: linear-gradient(180deg, #ffd873, var(--gold));
  color: #6b4708;
}

/* 見出し・リード */
body.theme-pop .hero-title {
  letter-spacing: 0.05em; text-shadow: none; color: #5e4152;
}
body.theme-pop .hero-lead b { color: var(--pop-pink-text); }
body.theme-pop .how-num {
  background: linear-gradient(180deg, #ffb1cd, var(--pop-pink-deep));
  color: #fff; border: none;
}
body.theme-pop .theme-card:hover,
body.theme-pop .depth-card:hover { border-color: var(--pop-pink); }
body.theme-pop .theme-card .t-arrow { color: var(--pop-pink-deep); }

/* 「i」マーク・選択チェック */
body.theme-pop .cast-info {
  background: #fff; border: 2px solid #f0d6e0; color: var(--pop-pink-text); opacity: 1;
}
body.theme-pop .cast-check { color: #fff; }
body.theme-pop .cast-card.on {
  border-color: var(--accent, var(--pop-pink));
  box-shadow: 0 14px 28px -12px var(--accent, rgba(255, 107, 160, 0.6)), 0 0 0 1px var(--accent);
}

/* 鑑定結果・カルテ(ダーク前提の札→白い可愛いカルテに) */
body.theme-pop .deck-card {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 209, 226, 0.35), transparent 60%),
    linear-gradient(180deg, #ffffff, #fff6ef);
  border: 2px solid #f6d9e5; border-radius: 22px;
  box-shadow: 0 18px 36px -18px rgba(120, 60, 90, 0.45), 0 4px 12px -8px rgba(120, 60, 90, 0.3);
}
body.theme-pop .chart-card {
  background: linear-gradient(180deg, #fff, #fff4ec);
  border-radius: 22px; border: 2px solid #ffd9a8;
}
/* デッキ内では外枠(白カード)が既にあるので内側の二重枠を消す。
   padding:0(.deck-card .chart-card)のまま枠だけ復活すると文字が枠に接触してはみ出して見える */
body.theme-pop .deck-card .chart-card,
body.theme-pop .cz-body .chart-card { background: none; border: none; box-shadow: none; border-radius: 0; }
body.theme-pop .deck-card.is-behind::after { background: rgba(107, 77, 91, 0.14); }
/* 結果画面のヘッダ・ナビ・フェードもダーク前提のままだったので明るいトーンに */
body.theme-pop .thread-head { background: rgba(255, 255, 255, 0.72); border-bottom: 1px solid var(--line); }
body.theme-pop .deck-fade { background: linear-gradient(180deg, transparent, rgba(255, 246, 239, 0.96)); border-radius: 0 0 20px 20px; }
body.theme-pop .deck-arrow { background: #fff; border: 2px solid #f0d6e0; color: var(--pop-pink-deep); }
body.theme-pop .deck-arrow:hover:not(:disabled) { border-color: var(--pop-pink); color: var(--pop-pink-text); }
body.theme-pop .deck-card::before { border-color: rgba(244, 169, 60, 0.35); }

/* きせかえボタン(両テーマ共通) */
.skin-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 16px; line-height: 1; padding: 0;
  background: rgba(16, 15, 36, 0.5); border: 1px solid var(--gold-soft);
  transition: transform 0.15s, border-color 0.15s;
}
.skin-btn:hover { transform: scale(1.08); border-color: var(--gold); }
body.theme-pop .skin-btn { background: #fff; border: 2px solid #f0d6e0; }

/* ポップ: ヒーローの輪を主役サイズに＋吹き出し */
body.theme-pop .council { width: 272px; max-width: 76vw; }
.council-bubble { display: none; }
body.theme-pop .council-bubble {
  display: inline-block; position: relative;
  margin: 2px auto 10px; padding: 7px 16px;
  background: #fff; border: 2px solid #f6d9e5; border-radius: 999px;
  font-family: var(--serif); font-weight: 700; font-size: 13px; color: var(--pop-pink-text);
  box-shadow: 0 4px 12px -6px rgba(214, 122, 155, 0.4);
}
body.theme-pop .council-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px; background: #fff;
  border-right: 2px solid #f6d9e5; border-bottom: 2px solid #f6d9e5;
}
body.theme-pop .hero { text-align: center; }

/* ===== ポップ: 振り切りかわいい(ぷにぷに・パステルローテーション) ===== */
/* カードの縁をパステルで順繰りに(キャラゲーの棚みたいに) */
body.theme-pop .theme-card:nth-child(4n+1) { border-color: #f9cfe0; }
body.theme-pop .theme-card:nth-child(4n+2) { border-color: #c8ebe3; }
body.theme-pop .theme-card:nth-child(4n+3) { border-color: #e2dcf8; }
body.theme-pop .theme-card:nth-child(4n)   { border-color: #fbe3bd; }
body.theme-pop .cast-card:nth-child(4n+1) { border-color: #f9cfe0; }
body.theme-pop .cast-card:nth-child(4n+2) { border-color: #c8ebe3; }
body.theme-pop .cast-card:nth-child(4n+3) { border-color: #e2dcf8; }
body.theme-pop .cast-card:nth-child(4n)   { border-color: #fbe3bd; }

/* ぷにっと弾むホバー */
@keyframes jelly {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.05, 0.94); }
  55% { transform: scale(0.96, 1.04); }
  75% { transform: scale(1.02, 0.98); }
  100% { transform: scale(1, 1); }
}
body.theme-pop .theme-card:hover,
body.theme-pop .depth-card:hover { animation: jelly 0.5s ease; }
body.theme-pop .cast-card:hover .cast-sigil,
body.theme-pop .gcast:hover .gcast-sigil { animation: jelly 0.5s ease; }
body.theme-pop .primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -8px rgba(255, 107, 160, 0.75), inset 0 -3px 0 rgba(0, 0, 0, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
body.theme-pop .skin-btn:hover { animation: jelly 0.5s ease; }

/* 見出し下のドット飾り */
body.theme-pop .how-head { position: relative; padding-bottom: 12px; }
body.theme-pop .how-head::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px;
  width: 108px; height: 6px;
  background: radial-gradient(circle at 3px 3px, #ffd9e7 2.6px, transparent 3px);
  background-size: 12px 6px; background-repeat: repeat-x;
}

/* ============================================================
   ポップ: PC(900px〜)は Apple 的な洗練に振る
   — 柄・点線・色縁・ぷにぷにを削ぎ、余白と大タイポと精密な影で見せる。
   モバイルの可愛い装飾はそのまま(この節はデスクトップのみ上書き)。
   ============================================================ */
@media (min-width: 900px) {
  body.theme-pop {
    --maxw: 1100px;
    /* 柄を消して、ごく淡いグラデだけの静かな背景 */
    background-image:
      radial-gradient(80% 46% at 50% -12%, #ffece5 0%, transparent 60%),
      linear-gradient(180deg, #fff3e6 0%, var(--ink) 46%);
    background-size: auto, auto;
  }
  body.theme-pop::before, body.theme-pop::after { display: none; }

  /* ガラス質ヘッダー＋ヘアライン */
  body.theme-pop .appbar {
    padding: 18px 40px;
    background: rgba(255, 250, 243, 0.72);
    -webkit-backdrop-filter: saturate(1.4) blur(18px);
    backdrop-filter: saturate(1.4) blur(18px);
    border-bottom: 1px solid rgba(109, 61, 83, 0.1);
  }
  body.theme-pop .appbar::after { display: none; }
  body.theme-pop .site-nav { gap: 26px; }

  /* 鑑定画面(.thread-screen)は除外 — 大きな余白がデッキの高さを潰すため(専用の余白を下で指定) */
  body.theme-pop .screen:not(.thread-screen) { padding: 56px 64px 96px; gap: 30px; }
  /* 鑑定画面: カードの高さを最優先。余白は控えめ、窓が低いときは画面ごとスクロールで逃がす */
  body.theme-pop .thread-screen { padding: 18px 64px 24px; gap: 14px; overflow-y: auto; }
  body.theme-pop .deck { min-height: 420px; }
  body.theme-pop .thread-foot .result-actions { flex-direction: row; justify-content: center; gap: 14px; }
  body.theme-pop .thread-foot .share-btn { flex: none; min-width: 260px; }
  /* .result-actions .restart-btn の margin:auto(縦積み用)が横並びでは余白を食うので殺す */
  body.theme-pop .thread-foot .result-actions .restart-btn { margin: 0; }
  /* 「鑑定を中止」がナビのラベルに重ならないよう、ナビの上に浮かせる */
  body.theme-pop .stop-btn { bottom: 92px; }

  /* ヒーロー: 大タイポ×余白。装飾は吹き出し1つだけ */
  body.theme-pop .hero {
    display: grid; grid-template-columns: 1.08fr 420px;
    column-gap: 64px; align-items: center; text-align: left;
    padding: 46px 0 38px;
  }
  body.theme-pop .council-bubble {
    grid-column: 2; grid-row: 1; justify-self: center; align-self: end; margin-bottom: 6px;
    border: none; box-shadow: 0 10px 30px -14px rgba(120, 60, 90, 0.35);
    font-size: 13.5px; padding: 8px 18px;
  }
  body.theme-pop .council-bubble::after { border: none; box-shadow: 3px 3px 6px -3px rgba(120, 60, 90, 0.18); }
  body.theme-pop .council { grid-column: 2; grid-row: 2; width: 400px; max-width: none; margin-top: 4px; }
  body.theme-pop .hero-title {
    grid-column: 1; grid-row: 1; align-self: end; margin: 0;
    font-size: 42px; line-height: 1.55; font-weight: 900; letter-spacing: 0.02em;
    text-shadow: none; white-space: nowrap;
  }
  body.theme-pop .hero-lead {
    grid-column: 1; grid-row: 2; align-self: start;
    text-align: left; margin-top: 18px; max-width: 33em;
    font-size: 16.5px; line-height: 2.15; color: var(--paper-2);
  }

  /* カード: 色縁をやめてヘアライン＋大きく柔らかい影。ホバーは静かに浮く */
  body.theme-pop .theme-card,
  body.theme-pop .theme-card:nth-child(n),
  body.theme-pop .depth-card,
  body.theme-pop .cast-card,
  body.theme-pop .cast-card:nth-child(n),
  body.theme-pop .gcast,
  body.theme-pop .welcome-back {
    background: #fff;
    border: 1px solid rgba(109, 61, 83, 0.09);
    border-radius: 24px;
    box-shadow: 0 22px 54px -34px rgba(120, 60, 90, 0.35);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s, border-color 0.2s;
  }
  body.theme-pop .theme-card:hover,
  body.theme-pop .depth-card:hover,
  body.theme-pop .gcast:hover {
    animation: none;
    transform: translateY(-4px);
    border-color: rgba(109, 61, 83, 0.14);
    box-shadow: 0 34px 70px -36px rgba(120, 60, 90, 0.45);
  }
  body.theme-pop .cast-card:hover .cast-sigil,
  body.theme-pop .gcast:hover .gcast-sigil { animation: none; }

  /* テーマ: 3列・ゆったり */
  body.theme-pop .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  body.theme-pop .theme-card { padding: 26px 22px; }
  body.theme-pop .theme-card .t-title { font-size: 17px; }
  body.theme-pop .theme-card .t-desc { font-size: 12.5px; margin-top: 5px; }

  /* 3ステップ: 枠を捨てて素の3カラム(Apple的フィーチャー段) */
  body.theme-pop .how {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 40px;
    background: transparent; border: none; box-shadow: none;
    padding: 34px 8px 26px;
  }
  body.theme-pop .how-head, body.theme-pop .how-foot { grid-column: 1 / -1; text-align: center; }
  body.theme-pop .how-step .how-num::after { display: none; }
  body.theme-pop .how-head { font-size: 21px; letter-spacing: 0.14em; padding-bottom: 20px; }
  body.theme-pop .how-head::after { display: none; }
  body.theme-pop .how-step { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  body.theme-pop .how-num {
    width: 46px; height: 46px; font-size: 18px;
    box-shadow: 0 10px 22px -10px rgba(255, 107, 160, 0.55);
  }
  body.theme-pop .how-tx b { font-size: 16px; }
  body.theme-pop .how-tx span { font-size: 12.5px; }
  body.theme-pop .how-foot { margin-top: 20px; color: var(--muted); border: none; padding: 0; }

  /* 占い師: 4列・アイコン大きく */
  body.theme-pop .cast-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  body.theme-pop .cast-card { padding: 26px 14px 20px; }
  body.theme-pop .cast-sigil { width: 84px; height: 84px; }
  body.theme-pop .cast-name { font-size: 15px; margin-top: 2px; }
  body.theme-pop #castsGallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* CTA: 幅を絞って中央に(全幅ボタンはPCでは野暮) */
  body.theme-pop .primary-btn { max-width: 460px; margin-left: auto; margin-right: auto; display: block; }
  body.theme-pop .ghost-btn { max-width: 460px; margin-left: auto; margin-right: auto; }

  /* 鑑定デッキ: 読み物の紙幅に(JSのinline transformと競合しないようleft/rightで中央寄せ) */
  body.theme-pop .deck-card { left: calc(50% - 320px); right: calc(50% - 320px); }

  /* タイプ図鑑: PCは4列 */
  .types-gallery { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .gtype-sigil { width: 92px; height: 92px; }
}

/* ===== 星性タイプカード(type_profile / docs/type-profile-contract.md) ===== */
.type-card { text-align: center; }
.type-eyebrow { font-family: var(--serif); font-size: 12px; letter-spacing: 0.2em; color: var(--gold-bright); margin-bottom: 12px; }
.type-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.type-emblem {
  width: 88px; height: 88px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 32%, #2e2a55, #17152f 78%);
  border: 2px solid var(--gold); color: #e4c789;
  font-family: var(--serif); font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.type-id { text-align: left; }
/* 星座変種(細分類・テキストの二つ名) */
.type-variant { margin-top: 10px; display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.type-variant .tv-epithet { font-family: var(--serif); font-weight: 800; font-size: 16.5px; color: var(--gold-bright); letter-spacing: 0.06em; }
.type-variant .tv-sign { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.tv-line { margin: 5px 12px 0; font-size: 12.5px; color: var(--paper-2); line-height: 1.9; }
/* 「あなたはこういう人」等のセクション見出し */
.type-sec-head {
  margin: 18px auto 0; padding-top: 14px; border-top: 1px dashed var(--line);
  font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--gold-bright); letter-spacing: 0.18em;
}
/* 相性のいい人(相手の獣イラスト＋ひとこと) */
.type-match { display: flex; align-items: center; gap: 12px; margin: 12px 4px 0; text-align: left; }
.type-match .tm-portrait {
  width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 32%, #2e2a55, #17152f 78%);
  color: #e4c789; font-family: var(--serif); font-weight: 800; font-size: 15px;
}
.type-match .tm-body b { display: block; font-family: var(--serif); font-size: 14px; color: var(--gold-bright); letter-spacing: 0.04em; }
.type-match .tm-body p { margin: 4px 0 0; font-size: 12.5px; color: var(--paper-2); line-height: 1.85; }
/* やるべきこと・はじめの一歩 */
.type-action { text-align: left; margin: 8px 4px 0; font-size: 13.5px; color: var(--paper); line-height: 2.0; }
/* 卜術の「いまのあなた」(参加済=状態文/未参加=🔒空枠) */
.type-cur-note { text-align: left; font-size: 11.5px; color: var(--muted); margin: 8px 4px 0; line-height: 1.8; }
.type-cur {
  text-align: left; margin: 10px 0 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
}
.type-cur b {
  font-family: var(--serif); font-size: 12px; color: var(--gold-bright); letter-spacing: 0.1em; margin-right: 10px;
}
.type-cur .tc-drawn { font-size: 11px; color: var(--muted); }
.type-cur p { margin: 4px 0 0; font-size: 13px; color: var(--paper); line-height: 1.9; }
.type-cur.locked { border-style: dashed; opacity: 0.75; }
.type-cur.locked p { color: var(--muted); font-size: 12px; }
body.theme-pop .type-cur { background: #fff; border: 2px solid #f6d9e5; }
body.theme-pop .type-cur.locked { background: transparent; border-style: dashed; }
body.theme-pop .type-cur b { color: var(--pop-pink-text); }
.type-name { font-family: var(--serif); font-weight: 800; font-size: 24px; color: var(--gold-bright); letter-spacing: 0.04em; }
.type-kana { font-size: 11.5px; color: var(--muted); letter-spacing: 0.12em; margin-top: 3px; }
.type-motto { font-family: var(--serif); font-size: 14.5px; color: var(--paper); margin: 12px 0 2px; letter-spacing: 0.08em; }
.type-traits { margin-top: 8px; }
.type-chip {
  display: inline-block; font-size: 11px; padding: 3px 11px; margin: 3px;
  border-radius: 999px; border: 1px solid var(--gold-soft); color: var(--gold-bright); letter-spacing: 0.06em;
}
.type-profile { text-align: left; margin: 16px 2px 0; line-height: 2.05; }
.type-from { text-align: left; font-size: 12.5px; color: var(--paper-2); margin: 8px 2px 0; line-height: 1.9; }
.type-sc { text-align: left; margin: 14px 0 0; }
.type-sc dt { font-family: var(--serif); font-size: 12px; font-weight: 700; color: var(--gold-bright); margin-top: 9px; letter-spacing: 0.1em; }
.type-sc dd { margin: 3px 0 0; font-size: 13px; color: var(--paper-2); line-height: 1.9; }
.type-axes {
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center;
}
.type-axis b { color: var(--gold-bright); margin-right: 3px; }
.type-basis { width: 100%; opacity: 0.85; line-height: 1.7; }
/* ポップテーマでの差し色(エンブレムは紺×金のまま=キャラ画像と同じ作法) */
body.theme-pop .type-emblem { border-color: var(--pop-pink); box-shadow: 0 3px 10px -4px rgba(120, 60, 90, 0.45); }
body.theme-pop .type-name { color: var(--pop-pink-text); }
body.theme-pop .type-variant .tv-epithet { color: var(--pop-pink-text); }
body.theme-pop .type-sec-head { color: var(--gold-bright); }
body.theme-pop .type-match .tm-portrait { border-color: var(--pop-pink); }
body.theme-pop .type-match .tm-body b { color: var(--pop-pink-text); }
.type-match.tappable { cursor: pointer; border-radius: 14px; padding: 8px; margin: 8px -4px 0; transition: background 0.15s; }
.type-match.tappable:hover { background: rgba(201, 168, 106, 0.08); }
body.theme-pop .type-match.tappable:hover { background: #fff1f6; }
.tm-more { display: inline-block; margin-top: 5px; font-size: 11.5px; color: var(--gold-bright); letter-spacing: 0.06em; }
body.theme-pop .tm-more { color: var(--pop-pink-deep); }
/* タイプカード下部の導線 */
.type-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.type-pair-btn {
  border: none; border-radius: 999px; cursor: pointer; padding: 11px 20px;
  font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold), #b8924e); color: #191734;
}
body.theme-pop .type-pair-btn { background: linear-gradient(135deg, var(--pop-pink), var(--pop-pink-deep)); color: #fff; }
.type-zukan-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  padding: 11px 18px; font-size: 12.5px; color: var(--paper-2); letter-spacing: 0.05em;
}
.type-zukan-btn:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ===== タイプ図鑑ページ ===== */
.types-how {
  border: 1px dashed var(--gold-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 6px;
  font-size: 13px; color: var(--paper-2); line-height: 1.9;
}
.types-how b { font-family: var(--serif); color: var(--gold-bright); letter-spacing: 0.08em; display: block; margin-bottom: 4px; }
.types-how p { margin: 4px 0; }
.types-how ul { margin: 6px 0; padding-left: 2px; list-style: none; }
.types-how li { margin: 3px 0; }
.types-how li b { display: inline; margin-right: 8px; }
.types-how-note { font-size: 12px; color: var(--muted); }
body.theme-pop .types-how { background: #fff; border: 2px dashed #f6d9e5; }
.types-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gtype {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 10px 14px; text-align: center; cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}
.gtype:hover { transform: translateY(-3px); border-color: var(--gold); }
.gtype-sigil { display: block; width: 78px; height: 78px; margin: 0 auto; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); }
.gtype-name { font-family: var(--serif); font-weight: 800; font-size: 14.5px; color: var(--paper); margin-top: 8px; letter-spacing: 0.04em; }
.gtype-motto { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
body.theme-pop .gtype { background: #fff; border: 2px solid #f6d9e5; }
body.theme-pop .gtype:hover { border-color: var(--pop-pink); }
body.theme-pop .gtype-sigil { border-color: var(--pop-pink); }
body.theme-pop .gtype-name { color: var(--pop-pink-text); }
/* タイプ詳細モーダルの追加部品 */
.type-info-box { max-height: 84vh; overflow-y: auto; }
.ti-sec { font-family: var(--serif); font-size: 12px; font-weight: 700; color: var(--gold-bright); letter-spacing: 0.14em; margin: 16px 0 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ti-variants { list-style: none; margin: 0; padding: 0; }
.ti-variants li { margin: 8px 0; font-size: 12.5px; line-height: 1.8; }
.ti-variants li b { font-family: var(--serif); color: var(--paper); }
.ti-variants li .tv-sign { margin-left: 8px; font-size: 11px; color: var(--muted); }
.ti-variants li p { margin: 2px 0 0; color: var(--paper-2); }
.ti-match {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer;
  color: inherit; font: inherit;
}
.ti-match:hover { border-color: var(--gold); }
.ti-match .tm-portrait { width: 46px; height: 46px; flex: none; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); }
.ti-match .tm-tx { flex: 1; min-width: 0; }
.ti-match .tm-tx b { font-family: var(--serif); font-size: 13px; color: var(--gold-bright); display: block; }
.ti-match .tm-tx i { font-style: normal; font-size: 12px; color: var(--paper-2); line-height: 1.7; }
.ti-match-arrow { flex: none; color: var(--muted); }
body.theme-pop .ti-match { border: 2px solid #f6d9e5; background: #fff; }
body.theme-pop .ti-match .tm-portrait { border-color: var(--pop-pink); }
body.theme-pop .ti-match .tm-tx b { color: var(--pop-pink-text); }

/* ===== ふたりの相性チェック ===== */
.pair-body { display: flex; flex-direction: column; gap: 18px; max-width: 560px; margin: 0 auto; width: 100%; }
.pair-partner { display: flex; align-items: center; gap: 16px; }
.pp-sigil { width: 84px; height: 84px; flex: none; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); display: block; }
.pair-partner .pp-tx span { display: block; font-size: 12px; color: var(--muted); }
.pair-partner .pp-tx b { display: block; font-family: var(--serif); font-size: 20px; color: var(--paper); margin-top: 2px; }
.pair-partner .pp-tx i { display: block; font-style: normal; font-size: 12.5px; color: var(--paper-2); margin-top: 4px; }
.pair-form { display: flex; flex-direction: column; gap: 10px; }
.pair-label { font-size: 13.5px; color: var(--paper); line-height: 1.8; }
.pair-input {
  padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink-2); color: var(--paper); font-size: 16px;
}
.pair-note { font-size: 11.5px; color: var(--muted); margin: 0; }
.pair-duo { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pd-one { text-align: center; }
.pd-one .pp-sigil { margin: 0 auto; }
.pd-one b { display: block; font-family: var(--serif); font-size: 14.5px; color: var(--paper); margin-top: 6px; }
.pd-one > span:last-child { font-size: 11.5px; color: var(--muted); }
.pd-x { font-family: var(--serif); font-size: 22px; color: var(--gold); }
.pair-score { text-align: center; padding: 14px; border: 1px solid var(--gold-soft); border-radius: 16px; }
.pair-score .ps-stars { display: block; font-size: 22px; letter-spacing: 0.2em; color: var(--gold-bright); }
.pair-score b { display: block; font-family: var(--serif); font-size: 18px; color: var(--paper); margin-top: 4px; letter-spacing: 0.08em; }
.pair-score i { display: block; font-style: normal; font-size: 12px; color: var(--gold-bright); margin-top: 6px; }
.pair-score.destined { border: 2px solid var(--gold); background: rgba(201, 168, 106, 0.08); }
.pair-lines { list-style: none; margin: 0; padding: 0; }
.pair-lines li { position: relative; padding-left: 20px; margin: 8px 0; font-size: 13.5px; line-height: 1.9; color: var(--paper); }
.pair-lines li::before { content: "✦"; position: absolute; left: 2px; color: var(--gold); font-size: 11px; }
.pair-mine { border-top: 1px dashed var(--line); padding-top: 4px; }
.pair-mine p { font-size: 13px; color: var(--paper-2); line-height: 1.95; margin: 6px 0; }
.pair-mine .pm-variant { font-size: 12px; color: var(--muted); }
.pair-mine .type-zukan-btn { margin-top: 6px; }
.pair-cta { text-align: center; border-top: 1px dashed var(--line); padding-top: 16px; }
.pair-cta p { font-size: 12.5px; color: var(--paper-2); margin: 0 0 10px; }
.pair-share-box .pair-url {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--ink-3); color: var(--paper-2); font-size: 12px; margin: 10px 0 4px;
}
body.theme-pop .pair-input, body.theme-pop .pair-share-box .pair-url { background: #fff; border: 2px solid #f6d9e5; }
body.theme-pop .pp-sigil { border-color: var(--pop-pink); }
body.theme-pop .pair-score { background: #fff; border: 2px solid #f6d9e5; }
body.theme-pop .pair-score.destined { border-color: var(--pop-pink); background: #fff1f6; }
body.theme-pop .pair-score .ps-stars { color: var(--gold-bright); }
body.theme-pop .pd-x { color: var(--pop-pink-deep); }
body.theme-pop .type-chip { background: #fff; border: 2px solid #f6d9e5; color: var(--pop-pink-text); }
body.theme-pop .type-eyebrow { color: var(--gold-bright); }
