/*
  見た目
  ★このファイルは、通常は編集しません。
    色を変えたいときは、下の「色の設定」だけを触れば済みます。
*/

/* ── 色の設定（ここだけ変えれば全体の色が変わります） ── */
:root {
  --ink:        #1f2937;   /* 文字 */
  --muted:      #6b7280;   /* 補足の文字 */
  --line:       #e5e7eb;   /* 罫線 */
  --bg:         #f7f8fa;   /* 背景 */
  --card:       #ffffff;   /* カードの地色 */
  --accent:     #1f6feb;   /* 強調・ボタン */
  --accent-ink: #ffffff;   /* ボタンの文字 */
  --weak:       #c2410c;   /* 弱点の強調 */
  --warn-bg:    #fff7ed;   /* 注意の地色 */
}

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

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  /* 日本語の詰めを効かせる */
  font-feature-settings: "palt" 1;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── カード ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 22px;
}
.card--warn { background: var(--warn-bg); border-color: #fdba74; }

h1 { font-size: 26px; line-height: 1.5; font-weight: 800; }
h2 { font-size: 19px; line-height: 1.6; font-weight: 800; }
h3 { font-size: 17px; line-height: 1.6; font-weight: 800; }

.lead  { margin-top: 14px; font-size: 15.5px; }
.sub   { margin-top: 26px; font-size: 14px; letter-spacing: 0; color: var(--muted); font-weight: 700; }
.note  { margin-top: 14px; font-size: 13px; color: var(--muted); }
.note--warn { color: var(--weak); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  /* 長い設定名でも枠からはみ出さないよう折り返す */
  word-break: break-all;
}

/* ── 一覧 ── */
.check-list { list-style: none; margin-top: 10px; }
.check-list li {
  position: relative;
  padding-left: 20px;
  margin-top: 8px;
  font-size: 15px;
}
.check-list li::before {
  content: "";
  position: absolute; left: 0; top: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

#config-error-list { margin-top: 12px; padding-left: 20px; }
#config-error-list li { margin-top: 6px; font-size: 14.5px; }

/* ── ボタン ── */
.btn {
  display: inline-block;
  width: 100%;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost   { background: transparent; color: var(--muted); border-color: var(--line); }
.btn:hover    { opacity: .92; }

/* キーボードで操作する人に、いまどこにいるかを見せる */
.btn:focus-visible,
.choice:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ── 進み具合 ── */
.progress__text { font-size: 13px; color: var(--muted); font-weight: 700; }
.progress__bar {
  margin-top: 8px;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}

/* ── 質問 ── */
.axis-name {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
}
.question {
  margin-top: 8px;
  /* 長い質問文でも読みやすいよう、行間を広めに */
  line-height: 1.7;
  /* 途中で不自然に切れないようにする */
  overflow-wrap: anywhere;
}

.choices { margin-top: 22px; display: grid; gap: 10px; }
.choice {
  width: 100%;
  padding: 18px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.choice:hover { border-color: var(--accent); }
.choice--selected { border-color: var(--accent); background: #eff6ff; }

.actions { margin-top: 20px; }
.actions .btn { margin-top: 0; }

/* ── 結果 ── */
.result-label { font-size: 13px; letter-spacing: 0; color: var(--muted); font-weight: 700; }
.total { margin-top: 4px; font-size: 56px; font-weight: 800; line-height: 1.1; }
.total__unit { font-size: 20px; font-weight: 700; color: var(--muted); margin-left: 4px; }

.axes { margin-top: 12px; display: grid; gap: 12px; }
.axis {
  display: grid;
  /* 軸名／バー／点数。狭い画面でもはみ出さないよう最小幅を0にする */
  grid-template-columns: minmax(0, 1fr) 90px 52px;
  align-items: center;
  gap: 10px;
}
.axis__name  { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.axis__bar   { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.axis__fill  { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.axis__score { font-size: 14px; font-weight: 800; text-align: right; }
.axis--weak .axis__name  { color: var(--weak); }
.axis--weak .axis__fill  { background: var(--weak); }

.weak {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--weak);
  border-radius: 8px;
  background: #fffbf8;
}
.weak__label { font-size: 12px; letter-spacing: 0; color: var(--weak); font-weight: 700; }

/* 全軸満点のとき。弱点の赤ではなく、強調色で出す */
.weak--good { border-left-color: var(--accent); background: #f5f9ff; }
.weak--good .weak__label { color: var(--accent); }
.weak h3 { margin-top: 6px; }
.weak p  { margin-top: 10px; font-size: 15px; }

.cta {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.cta p { margin-top: 10px; font-size: 15px; }

.disclaimer {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  text-align: center;
}

/* ── 狭い画面 ── */
@media (max-width: 400px) {
  #app  { padding: 16px 12px 40px; }
  .card { padding: 22px 16px; }
  .total { font-size: 46px; }
  /* 点数バーを畳んで、軸名と点数だけにする（横にはみ出さないため） */
  .axis { grid-template-columns: minmax(0, 1fr) 52px; }
  .axis__bar { display: none; }
}

/* 動きを減らす設定の方には、動きを出さない */
@media (prefers-reduced-motion: reduce) {
  .progress__fill { transition: none; }
}
