/* styles.css — アイミル
   配色は結果カードのモックに合わせた「深い藍〜紫の夜空 × やわらかいゴールド」。 */
:root {
  --bg: #14122e;
  --bg-mid: #2b2658;
  --bg-soft: #3d2f63;
  --panel: #221f47;      /* 質問カードの面 */
  --panel-2: #2b2858;    /* 選択肢の面 */
  --gold: #f3d488;
  --gold-bright: #f6dd9b;
  --gold-deep: #d9b96a;
  --ink: #28244f;        /* ゴールド地の上にのせる濃い文字色 */
  --text: #f4efe0;
  --text-dim: #cfc6e6;
  --line: rgba(217, 185, 106, 0.3);
  --line-soft: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 50% -8%, #4a3a7a 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-mid) 55%, var(--bg-soft) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.7;
}

/* --- ヘッダー --- */
.site-header { text-align: center; padding: 40px 16px 12px; }
.logo {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 6px 0 0; color: var(--text-dim); font-size: 0.95rem; }

.container { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }

.intro {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 8px 0 28px;
}
.intro-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--gold);
}

/* --- 質問カード --- */
.q-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 0 0 16px;
  padding: 18px 18px 14px;
}
.q-title {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}
.q-options { display: flex; flex-direction: column; gap: 8px; }

/* --- 質問：グラデーション5段階 --- */
.scale { margin-top: 4px; }
.scale .poles {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.scale .pole { max-width: 47%; }
.scale .pole.b { text-align: right; }

.scale-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 2px;
}
.scale-track::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, #8f8bb5 50%, #7f77dd 100%);
  opacity: 0.5;
}

.dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dot input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.dot .circle {
  display: block;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid;
  box-sizing: border-box;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}
.dot.d1 .circle, .dot.d5 .circle { width: 32px; height: 32px; }
.dot.d2 .circle, .dot.d4 .circle { width: 26px; height: 26px; }
.dot.d3 .circle { width: 20px; height: 20px; }
.dot.d1 .circle { border-color: var(--gold); }
.dot.d2 .circle { border-color: #ddc187; }
.dot.d3 .circle { border-color: #8f8bb5; }
.dot.d4 .circle { border-color: #a99fe0; }
.dot.d5 .circle { border-color: #7f77dd; }
.dot:hover .circle { transform: scale(1.12); }
.dot:has(input:checked) .circle { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }
.dot.d1:has(input:checked) .circle { background: var(--gold); }
.dot.d2:has(input:checked) .circle { background: #ddc187; }
.dot.d3:has(input:checked) .circle { background: #8f8bb5; }
.dot.d4:has(input:checked) .circle { background: #a99fe0; }
.dot.d5:has(input:checked) .circle { background: #7f77dd; }
.dot input:focus-visible + .circle { box-shadow: 0 0 0 3px var(--gold); }

.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.opt:hover { border-color: var(--gold-deep); }
.opt:active { transform: scale(0.995); }
.opt input { accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.opt:has(input:checked) {
  border-color: var(--gold);
  background: rgba(243, 212, 136, 0.12);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.opt-text { font-size: 0.98rem; }

/* --- ボタン --- */
.form-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0 18px;
  background: linear-gradient(180deg, transparent, var(--bg-soft) 55%);
}
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  cursor: pointer;
  width: 100%;
}
.btn-primary {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  color: var(--ink);
  font-size: 1.05rem;
  box-shadow: var(--shadow);
}
.btn-primary:disabled {
  background: #3a3768;
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-share {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  color: var(--ink);
}
.btn-line { background: #06c755; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
}

/* --- 結果カード（モック準拠） --- */
.result-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(600px 320px at 50% -15%, #4a3a7a 0%, transparent 70%),
    linear-gradient(180deg, #1b1838 0%, #2b2658 55%, #3d2f63 100%);
  padding: 26px 20px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.r-brand {
  margin: 0;
  letter-spacing: 0.24em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}
.r-title {
  margin: 4px 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.r-avatar {
  display: block;
  width: 116px;
  height: 116px;
  margin: 4px auto 14px;
}
.r-type-pill {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}
.r-desc {
  margin: 14px auto 4px;
  max-width: 28em;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}
.r-rank-label {
  margin: 22px 0 12px;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ランキング */
.rank-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.rank-item:last-child { border-bottom: none; }
.rank-item.is-top {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(243, 212, 136, 0.12);
  margin-bottom: 6px;
}
.rank-no {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.rank-item.is-top .rank-no {
  width: 38px;
  height: 38px;
  background: var(--gold);
  color: var(--ink);
  border: none;
}
.rank-main { flex: 1; min-width: 0; }
.rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.rank-name { font-weight: 700; font-size: 1rem; }
.rank-item.is-top .rank-name { font-size: 1.05rem; }
.rank-score { color: var(--gold); font-weight: 800; font-size: 1.05rem; flex: none; }
.rank-item.is-top .rank-score { color: var(--gold-bright); font-size: 1.25rem; }
.rank-reason { margin: 2px 0 7px; color: var(--text-dim); font-size: 0.8rem; }
.rank-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.rank-bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--gold);
}

/* シェアブロック */
.share-block { margin: 24px 0 0; }
.share-head {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 14px;
}
.share-img {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.btn-insta {
  color: #fff;
  background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
}
.result-note { margin: 16px 0 0; font-size: 0.76rem; color: var(--text-dim); }

/* --- 広告枠 --- */
.ad-slot { min-height: 90px; margin: 26px 0 0; }

/* --- タイプ一覧ページ --- */
.logo a { color: inherit; text-decoration: none; }
.types-intro {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 8px 0 24px;
}
.section-title {
  text-align: center;
  font-size: 1.15rem;
  margin: 32px 0 16px;
}
.cta-center { text-align: center; margin: 24px 0; }
.cta-center .btn {
  display: inline-block;
  width: auto;
  max-width: 100%;
  text-decoration: none;
  padding: 14px 28px;
}
.type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.type-card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 18px 16px;
  text-align: center;
}
.type-avatar { display: block; width: 88px; height: 88px; margin: 2px auto 6px; }
.type-no {
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--gold-deep);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.75;
}
.type-name { margin: 0; font-size: 1.15rem; color: var(--gold); font-weight: 700; }
.type-vibe { margin: 2px 0 10px; font-size: 0.82rem; color: var(--text-dim); }
.type-desc { margin: 0 0 12px; font-size: 0.92rem; text-align: left; }
.type-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.type-tag {
  font-size: 0.76rem;
  color: var(--gold);
  background: rgba(243, 212, 136, 0.12);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
}
.types-link { text-align: center; margin: 16px 0 0; }
.types-link a { color: var(--gold); font-size: 0.92rem; text-decoration: none; }
.types-link a:hover { text-decoration: underline; }

@media (min-width: 560px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
}

/* --- フッター --- */
.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 24px 16px 40px;
}
.copyright { margin-top: 8px; opacity: 0.7; }
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--text-dim); margin: 0 8px; }

@media (min-width: 560px) {
  .result-actions { flex-direction: row; flex-wrap: wrap; }
  .result-actions .btn { flex: 1; min-width: 160px; }
}

/* --- 文書ページ（プライバシーポリシー等） --- */
.doc { max-width: 720px; margin: 0 auto; padding: 32px 20px 56px; }
.doc h1 { font-size: 1.6rem; margin: 14px 0 4px; }
.doc h2 { font-size: 1.12rem; margin: 30px 0 8px; color: var(--gold); }
.doc .lead { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 20px; }
.doc p, .doc li { color: var(--text); font-size: 0.95rem; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc a { color: var(--gold); }
.home-link {
  display: inline-block;
  margin: 8px 0 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}
.home-link:hover { color: var(--gold); }
