:root {
  --bg: #14162b; --panel: #1f2440; --panel2: #262b4d;
  --text: #eef0f8; --muted: #aab0cc; --accent: #ffd166; --accent2: #7c6ff0;
  --border: #343a5f;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 18px 64px; }
header.site { padding: 14px 0 6px; }
header.site .logo { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
header.site nav { margin-top: 6px; font-size: 14px; }
header.site nav a { margin-right: 16px; color: var(--muted); text-decoration: none; }
h1 { font-size: 30px; line-height: 1.4; }
h2 { font-size: 22px; margin-top: 40px; }
.btn {
  display: inline-block; background: var(--accent); color: #1a1c30;
  font-weight: 700; padding: 14px 34px; border-radius: 10px;
  text-decoration: none; border: none; cursor: pointer; font-size: 17px;
}
.btn.sub { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin: 18px 0; }
.muted { color: var(--muted); font-size: 14px; }
footer.site { border-top: 1px solid var(--border); margin-top: 48px; padding-top: 16px; font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); margin-right: 14px; }

/* 診断画面 */
.progress { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin: 14px 0 22px; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.q { padding: 16px 0; border-bottom: 1px solid var(--border); }
.q p { margin: 0 0 10px; font-weight: 600; }
.scale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scale .side { font-size: 12px; color: var(--muted); width: 74px; }
.scale .side.r { text-align: left; }
.scale label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--accent2); cursor: pointer; font-size: 0;
}
.scale label.big { width: 48px; height: 48px; }
.scale label.mid { width: 44px; height: 44px; }
.scale input { display: none; }
.scale input:checked + span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent2); display: block; }
.pager { display: flex; justify-content: space-between; margin-top: 26px; }

/* 狭幅では7段階スケールを1行に収める（390px幅で折り返し防止） */
@media (max-width: 520px) {
  .scale { gap: 3px; flex-wrap: nowrap; }
  .scale .side { width: 48px; font-size: 11px; }
  .scale label { width: 30px; height: 30px; }
  .scale label.big { width: 36px; height: 36px; }
  .scale label.mid { width: 32px; height: 32px; }
}

/* 結果・軸バー */
.code-big { font-size: 56px; font-weight: 800; letter-spacing: 2px; }
.type-name { font-size: 26px; color: var(--accent); font-weight: 700; }
.axis-row { margin: 14px 0; }
.axis-row .lab { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.bar { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }
canvas.preview { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }

/* 相性表マトリクス */
table.matrix { border-collapse: collapse; font-size: 12px; }
table.matrix th, table.matrix td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; }
table.matrix th { background: var(--panel2); }
table.matrix td a { text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid a { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-decoration: none; color: var(--text); }
.score-big { font-size: 48px; font-weight: 800; color: var(--accent); }
select, .pick { font-size: 16px; padding: 10px; border-radius: 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
