/* スピリチュアルの意味辞典 — テーマ「月あかりの紫」
   テーマは必ずこの変数だけで差し替えられるように書く(構造にベタ書き色を置かない) */
:root {
  --bg: #f3edf9;
  --bg-grad: linear-gradient(178deg, #e6d9f4 0%, #f3edf9 34%, #fbf8fd 72%, #f4eef9 100%);
  --hero-grad: radial-gradient(120% 90% at 50% 0%, #d8c5ef 0%, #e9dcf6 55%, rgba(243,237,249,0) 100%);
  --ink: #43365e;
  --sub: #93859f;
  --accent: #7b5caf;
  --accent-deep: #56418a;
  --gold: #b99453;
  --gold-soft: #e8d9b0;
  --gold-line: #d9c48d;
  --card: #fffdff;
  --card-warm: #fdfaff;
  --line: #e7dcf3;
  --chip-bg: #f5eefb;
  --warn-bg: #fdf7ec;
  --warn-line: #e6d0a6;
  --btn-grad: linear-gradient(135deg, #8a68bd 0%, #6d4fa3 55%, #7f5fb5 100%);
  --shadow: 0 3px 18px rgba(112, 84, 160, .14);
  --shadow-soft: 0 2px 10px rgba(112, 84, 160, .10);
  --radius: 18px;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  padding-bottom: 72px;
  font-size: 15px;
  position: relative;
}
/* 星のまたたく空(固定背景レイヤ) */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg-grad);
}
.sky::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%,  rgba(255,240,200,.8) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 55% 28%, rgba(255,255,255,.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 44%, rgba(255,246,214,.6) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 88% 38%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 66%,  rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 66% 58%, rgba(255,246,214,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 42% 78%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 92% 74%, rgba(255,246,214,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,.4) 50%, transparent 51%);
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; height: auto; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ヘッダ */
.site-head { display: flex; justify-content: center; padding: 14px 10px 8px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.logo-mark { width: 40px; height: 40px; }
.logo-text {
  font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .14em;
}
.stub-band {
  text-align: center; font-size: 10.5px; letter-spacing: .12em;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  color: #6b5836; padding: 3px 8px;
}

/* ヒーロー */
.hero { text-align: center; padding: 18px 8px 26px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -30px -100px auto;
  height: 320px; background: var(--hero-grad); z-index: -1;
}
.hero-img { width: min(430px, 82vw); height: auto; margin-bottom: -6px; }
.hero-sub {
  font-family: var(--serif); font-size: 13.5px; color: var(--accent-deep);
  letter-spacing: .3em; opacity: .85;
}
.hero-title {
  font-family: var(--serif); font-size: 24px; letter-spacing: .16em;
  color: var(--accent-deep); margin: 2px 0 10px; font-weight: 600;
}
.hero-desc { font-size: 12.5px; color: var(--sub); margin-bottom: 18px; letter-spacing: .04em; }

/* 検索 */
.search-form {
  display: flex; align-items: center; max-width: 430px; margin: 0 auto;
  background: rgba(255,255,255,.92); border-radius: 999px;
  border: 1.5px solid var(--gold-line);
  box-shadow: 0 0 0 4px rgba(255,255,255,.5), var(--shadow);
  overflow: hidden;
}
.search-form input {
  flex: 1; border: 0; outline: none; padding: 12px 20px; font-size: 15px;
  color: var(--ink); background: transparent; font-family: var(--sans);
}
.search-form input::placeholder { color: #b6a9c4; }
.search-form button {
  border: 0; background: var(--btn-grad); width: 52px; height: 40px;
  margin: 3px; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35);
}
.search-form.on-page { margin-bottom: 22px; }

/* セクション・見出し(金の飾り線) */
.sec { margin: 30px 0; }
.sec-title {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--serif); font-size: 17px; letter-spacing: .22em;
  font-weight: 600; color: var(--accent-deep); margin-bottom: 18px;
}
.sec-title::before, .sec-title::after {
  content: ""; height: 1px; width: 46px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}
.sec-title::after { background: linear-gradient(90deg, var(--gold-line), transparent); }
.sec-title.big { font-size: 20px; }
.sec-title .more { font-size: 12px; letter-spacing: 0; font-family: var(--sans); }
.center { text-align: center; }
.divider { text-align: center; margin: 26px 0 6px; }
.divider img { width: min(420px, 76vw); opacity: .9; }

/* 円形グリッド(注目) */
.circle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.circle-item { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.circle-ic {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold-line), var(--shadow-soft);
  transition: transform .18s;
}
.circle-item:active .circle-ic, .circle-item:hover .circle-ic { transform: scale(1.06); }
.circle-name { font-size: 12px; color: var(--ink); text-align: center; letter-spacing: .04em; }

/* カテゴリグリッド */
.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 10px; }
.kind-item { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--ink); }
.kind-ic {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold-line), var(--shadow);
  transition: transform .18s;
}
.kind-item:hover .kind-ic { transform: scale(1.05); }
.kind-name { font-size: 12.5px; letter-spacing: .06em; }
.kind-item.is-soon { opacity: .45; }

/* カードグリッド */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow-soft); color: var(--ink);
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.card-ic {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold-line);
}
.card-name { font-family: var(--serif); font-size: 14px; font-weight: 600; margin-top: 6px; }
.card-sub { font-size: 10.5px; color: var(--sub); margin-top: 1px; }

/* チップ */
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  background: var(--chip-bg); border: 1px solid var(--line); color: var(--accent-deep);
  border-radius: 999px; padding: 7px 15px; font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
.chip:hover { border-color: var(--gold-line); }
.chip-o { background: var(--card); }
.chip-n { font-size: 10px; color: var(--sub); margin-left: 4px; }

/* 詳細ページ */
.crumb { font-size: 11.5px; color: var(--sub); margin: 10px 2px; }
.crumb a { color: var(--sub); }
.detail-hero { text-align: center; padding: 20px 10px 12px; }
.detail-ic {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold-line), var(--shadow);
  margin-bottom: 12px;
}
.detail h1 {
  font-family: var(--serif); font-size: 23px; letter-spacing: .1em; color: var(--accent-deep);
}
.title-sub { font-size: 13px; color: var(--sub); display: block; letter-spacing: .14em; margin-top: 2px; }
.lead-box { margin: 12px 0 20px; }

/* 意味ボックス(金縁+チェック) */
.meaning-box {
  background: var(--card); border: 1.5px solid var(--gold-line);
  border-radius: var(--radius); padding: 20px 18px;
  box-shadow: 0 0 0 5px rgba(255,255,255,.55), var(--shadow);
  position: relative;
}
.meaning-box::before {
  content: "✦"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--card); padding: 0 10px; color: var(--gold); font-size: 14px;
}
.meaning-box h2 {
  font-family: var(--serif); font-size: 16px; color: var(--accent-deep);
  letter-spacing: .1em; margin-bottom: 12px; text-align: center;
}
.check-list { list-style: none; }
.check-list li { padding-left: 32px; position: relative; margin: 10px 0; font-size: 14px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px;
  background: url(/img/ic-check.png) center/contain no-repeat;
}

/* 観点アコーディオン(押させて関心を観測する) */
.viewpoints { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
details.vp {
  background: var(--card-warm); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-soft); overflow: hidden;
}
details.vp summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; font-family: var(--serif); font-size: 14.5px; font-weight: 600;
  color: var(--accent-deep); letter-spacing: .08em;
}
details.vp summary::-webkit-details-marker { display: none; }
.vp-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px; }
.vp-teacher {
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  color: var(--sub); letter-spacing: .04em;
}
.vp-arrow { color: var(--gold); font-size: 12px; transition: transform .25s; }
details.vp[open] .vp-arrow { transform: rotate(180deg); }
details.vp[open] summary {
  border-bottom: 1px dashed var(--gold-soft);
  background: linear-gradient(180deg, rgba(232,217,176,.14), transparent);
}
.vp-body { padding: 12px 18px 15px; font-size: 14px; }

/* 先生ボックス */
.teacher-box, .ymyl-note {
  border-radius: var(--radius); padding: 15px 17px; margin: 16px 0;
  font-size: 13.5px; box-shadow: var(--shadow-soft);
}
.teacher-box { background: var(--chip-bg); border: 1px solid var(--line); }
.ymyl-note { background: var(--warn-bg); border: 1.5px solid var(--warn-line); }
.t-name {
  font-family: var(--serif); font-weight: 600; font-size: 12.5px;
  color: var(--accent-deep); margin-bottom: 4px; letter-spacing: .08em;
}
.backlink { margin: 18px 0; font-size: 14px; }

/* ランキング */
.rank-list { list-style: none; }
.rank-list li { margin: 9px 0; }
.rank-list a {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 14px; box-shadow: var(--shadow-soft); color: var(--ink);
}
.rank-no {
  min-width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700;
  background: var(--chip-bg); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif);
}
.rank-list li:nth-child(-n+3) .rank-no {
  background: var(--btn-grad); color: #fff;
  box-shadow: 0 0 0 1.5px var(--gold-line);
}
.rank-ic { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--gold-line); }
.rank-name { font-family: var(--serif); font-weight: 600; }
.rank-kind { margin-left: auto; font-size: 11px; color: var(--sub); }

/* 今日のメッセージ */
.daily-card {
  background: var(--btn-grad); color: #fff; border-radius: var(--radius);
  padding: 24px 18px 22px; text-align: center;
  box-shadow: 0 0 0 1.5px var(--gold-line), 0 0 0 6px rgba(255,255,255,.4), var(--shadow);
  position: relative;
}
.daily-sparkle { position: absolute; top: 10px; right: 14px; width: 34px; opacity: .9; }
.daily-card h2 {
  font-family: var(--serif); font-size: 15px; letter-spacing: .18em; margin-bottom: 8px;
}
.daily-card p { font-size: 13.5px; opacity: .96; }

/* フッタ */
.site-foot {
  margin-top: 44px; padding: 10px 16px 22px; text-align: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.2));
}
.foot-moon { width: 52px; margin: -4px auto 2px; }
.foot-links { display: flex; justify-content: center; gap: 18px; font-size: 12.5px; }
.foot-note { font-size: 11px; color: var(--sub); margin-top: 10px; }
.copyright { font-size: 10.5px; color: var(--sub); margin-top: 8px; letter-spacing: .12em; }

/* ボトムナビ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(252, 250, 254, .95);
  border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  box-shadow: 0 -2px 12px rgba(112, 84, 160, .08);
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 7px 0 8px; font-size: 10px; color: var(--sub);
  display: flex; flex-direction: column; align-items: center; gap: 1px; letter-spacing: .08em;
}
.bottom-nav img { width: 28px; height: 26px; object-fit: contain; }

.empty { text-align: center; color: var(--sub); padding: 22px 0; }

/* 検索オーバーレイ(夢占い作法: 語を選ぶ→トークン化→状況をしぼる) */
body.ov-open { position: fixed; left: 0; right: 0; overflow: hidden; }
.ov {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg); display: flex; flex-direction: column;
}
/* display:flex が hidden属性(UAのdisplay:none)を上書きしてしまうので明示的に殺す */
.ov[hidden] { display: none !important; }
.ov::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--bg-grad);
  z-index: -1;
}
.ov-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.75); backdrop-filter: blur(8px);
}
.ov-back, .ov-clear {
  width: 40px; height: 40px; border: 0; background: transparent;
  color: var(--accent-deep); cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.ov-back svg, .ov-clear svg { width: 22px; height: 22px; }
.ov-field {
  flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0;
  background: #fff; border: 1.5px solid var(--gold-line); border-radius: 999px;
  padding: 4px 14px; box-shadow: var(--shadow-soft);
}
.ov-token {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  background: var(--btn-grad); color: #fff; border-radius: 999px;
  padding: 3px 6px 3px 12px; font-size: 13.5px; font-family: var(--serif); font-weight: 600;
  letter-spacing: .04em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
.ov-token-x {
  border: 0; background: rgba(255,255,255,.22); color: #fff; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ov-token-x svg { width: 12px; height: 12px; }
.ov-input {
  flex: 1; min-width: 60px; border: 0; outline: none; background: transparent;
  font-size: 16px; padding: 8px 2px; color: var(--ink); font-family: var(--sans);
}
.ov-input::placeholder { color: #b6a9c4; }
.ov-body { flex: 1; overflow-y: auto; padding: 18px 16px 40px; }
.ov-h {
  font-family: var(--serif); font-size: 14px; color: var(--sub);
  letter-spacing: .14em; margin: 4px 0 12px; text-align: center;
}
.ov-h.ov-ask { font-size: 17px; color: var(--accent-deep); font-weight: 600; }
.ov-h2 { font-size: 12px; color: var(--sub); letter-spacing: .12em; margin: 18px 0 8px; text-align: center; }
.ov-list { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto; }
.ov-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 13px 18px; cursor: pointer; font-family: var(--sans); font-size: 15px;
  color: var(--ink); box-shadow: var(--shadow-soft); text-align: left;
}
.ov-row:hover { border-color: var(--gold-line); }
.ov-nm { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; }
.ov-go { font-size: 12px; color: var(--sub); }
.ov-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; max-width: 520px; margin: 0 auto; }
.ov-chip {
  background: var(--chip-bg); border: 1px solid var(--line); color: var(--accent-deep);
  border-radius: 999px; padding: 8px 16px; font-size: 13.5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
.ov-chip:hover { border-color: var(--gold-line); }
.ov-note { text-align: center; color: var(--sub); font-size: 13.5px; margin: 22px 0; line-height: 2; }
.ov-thanks { font-size: 11.5px; opacity: .8; }
.ov-showall {
  border: 1px solid var(--gold-line); background: var(--card); color: var(--accent-deep);
  border-radius: 999px; padding: 4px 14px; font-size: 12.5px; cursor: pointer; margin-left: 8px;
}
.ov-more { text-align: center; margin: 22px 0 8px; font-size: 14px; }

/* PC幅 */
@media (min-width: 640px) {
  body { font-size: 16px; padding-bottom: 0; }
  .bottom-nav { display: none; }
  .circle-grid { grid-template-columns: repeat(8, 1fr); }
  .kind-grid { grid-template-columns: repeat(5, 1fr); }
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-title { font-size: 30px; }
  .hero-img { width: 470px; }
}
