:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e2e2e0;
  --accent: #1f5fbf;
  --ok: #1a8f4c;
  --ng: #c8372d;
  --bar: #cfe0f7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --card: #222226;
    --text: #ececef;
    --muted: #a0a0a8;
    --line: #38383e;
    --accent: #6fa3ef;
    --ok: #4cc57f;
    --ng: #ef6f66;
    --bar: #2b4366;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.6;
}
a { color: var(--accent); }
.site-header, .site-footer { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
.logo { font-weight: 700; text-decoration: none; color: var(--text); }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); padding-bottom: 32px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.screen { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 16px; }
h1 { font-size: 24px; margin: 0 0 8px; }
.lead { margin: 0 0 16px; }
.small { font-size: 12px; color: var(--muted); }
.big { font-size: 32px; font-weight: 700; margin: 8px 0; }

.btn {
  display: block; width: 100%; padding: 12px; margin: 8px 0;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  font-size: 16px; text-align: center; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { font-size: 14px; color: var(--muted); }
.btn.share { background: #000; color: #fff; border-color: #000; }

.progress { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.progress .score { margin-left: auto; }
.mode-tag { font-size: 12px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; }
.mode-title { margin: 16px 0 4px; font-weight: 700; }
.modes .btn { display: flex; justify-content: space-between; align-items: center; text-align: left; }
.modes .btn .count { font-size: 13px; font-weight: 400; opacity: .8; }

.period { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.results { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 8px; }
.results td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.results td.name { white-space: nowrap; width: 7.5em; }
.results td.num { text-align: right; width: 3.5em; font-variant-numeric: tabular-nums; font-weight: 700; }
.results td.bar span { display: block; height: 10px; border-radius: 3px; background: var(--bar); min-width: 2px; }
.results td.num.na { text-align: left; font-weight: 400; color: var(--muted); font-size: 13px; }
.results td.bar span.zero { background: transparent; }

.hint { background: var(--bg); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.choices .btn { text-align: left; }
.choices .btn.correct { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.choices .btn.wrong { border-color: var(--ng); color: var(--ng); }
.choices .btn:disabled { cursor: default; }
.feedback { margin-top: 8px; }
.feedback p { margin: 4px 0; }

.review { padding-left: 1.2em; }
.review li { margin: 4px 0; }
.review .ok { color: var(--ok); }
.review .ng { color: var(--ng); }

/* 広告枠：AdSense導入までは高さ0で非表示 */
.ad-slot { margin: 16px 0; }
.ad-slot:empty { display: none; }

.doc h1 { font-size: 22px; }
.doc h2 { font-size: 17px; margin-top: 24px; }
.doc .results td.name { white-space: normal; width: 9em; line-height: 1.3; }
.doc .results td.name .small { font-size: 11px; }

/* 学歴厨判定 */
.judge { text-align: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.judge-emoji { font-size: 44px; line-height: 1; }
.judge-label { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.judge-pct { margin: 0; font-size: 48px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.judge-pct small { font-size: 22px; margin-left: 2px; }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 12px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4cc57f, #f2b233, #e0533d); transition: width .8s ease; }
.judge-title { margin: 0; font-size: 22px; font-weight: 800; }
.judge-text { margin: 6px 0 8px; font-size: 14px; }
.share-title { margin: 20px 0 6px; font-weight: 700; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sns { display: block; padding: 10px 4px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 700;
  text-align: center; text-decoration: none; color: #fff; cursor: pointer; font-family: inherit; }
.sns-x { background: #000; }
.sns-line { background: #06c755; }
.sns-threads { background: #101010; }
.sns-bluesky { background: #1185fe; }
.sns-facebook { background: #1877f2; }
.sns-copy { background: var(--card); color: var(--text); border-color: var(--line); }
@media (prefers-color-scheme: dark) { .sns-x, .sns-threads { border-color: #555; } }

/* 聞き手（街頭インタビュー風）の吹き出し */
.voice { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; }
.voice-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #111; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.voice p { position: relative; margin: 0; padding: 8px 12px; border-radius: 12px; background: #fff7d6; color: #3b3000;
  font-size: 14px; font-weight: 600; line-height: 1.5; }
.voice p::before { content: ""; position: absolute; left: -6px; top: 12px; border: 6px solid transparent; border-right-color: #fff7d6; border-left: 0; }
@media (prefers-color-scheme: dark) { .voice p { background: #4a3f12; color: #fff3c4; } .voice p::before { border-right-color: #4a3f12; } }
.voice-sm p { font-size: 13px; }
.hint { white-space: normal; }

/* 判定：階級と偏差値 */
.judge-tier { display: inline-block; margin: 6px 0 0; padding: 2px 14px; border-radius: 999px; background: #111; color: #ffd84d;
  font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.judge-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.judge-nums .judge-pct { font-size: 40px; }

/* 広告枠 */
.ad-slot:not(:empty) { margin: 24px 0; min-height: 100px; }
.ad-label { margin: 0 0 4px; font-size: 11px; color: var(--muted); text-align: center; }
