/* 診断サイトの共通の見た目：紙・墨・青インク 1 色 */
:root {
  --paper: #f3f1eb;
  --paper-2: #ebe8df;
  --ink: #211f1b;
  --sub: #6b665c;
  --accent: #2c5a85;
  --line: #d8d3c6;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 480px;
  min-height: 100dvh;
  padding: 0 16px 24px;
  background-color: var(--paper);
  /* ごく薄い紙の目 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.28  0 0 0 0 0.22  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
}
html { background: var(--paper); }

a { color: var(--accent); }
h1, h2 { font-weight: 800; font-feature-settings: "palt"; letter-spacing: .01em; }

.site-head { padding: 12px 0 4px; }
.site-name {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 2px solid var(--ink);
}

.intro { padding: 10px 0 4px; }
.title { font-size: 26px; line-height: 1.3; margin: 0 0 4px; }
.lead { margin: 0; color: var(--sub); }

.stage { flex: 1; display: flex; flex-direction: column; }

.site-foot { margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--sub); font-size: 16px; }
.site-foot p { margin: 0; }
body.is-playing .site-foot { display: none; }
body.is-playing .intro { display: none; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px;
  font: inherit; font-weight: 700; font-size: 16px;
  color: var(--ink); background: transparent;
  border: 2px solid var(--ink); border-radius: 4px;
  text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--paper-2); }
.btn-main { background: var(--ink); color: var(--paper); }
.btn-main:active { background: #000; }
.btn:disabled { opacity: .35; cursor: default; }
.btn:focus-visible, .key:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 進み具合 */
.progress { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.progress-num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.5em; }
.progress-bar { flex: 1; height: 4px; background: var(--line); }
.progress-fill { display: block; height: 100%; background: var(--accent); }

/* 結果 */
.result { padding-top: 8px; }
.result-head { margin: 0; font-weight: 700; color: var(--sub); }
.result-label { margin: 18px 0 0; font-weight: 700; font-size: 18px; }
.result-big { margin: 0; line-height: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.result-big .big { font-size: 88px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-big .unit { font-size: 22px; font-weight: 700; }
.result-sub { margin: 14px 0 20px; padding-top: 10px; border-top: 2px solid var(--ink); }
.result-sub p { margin: 0 0 4px; font-size: 17px; }
.result-sub p:first-child { font-weight: 800; font-size: 20px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn-main { grid-column: 1 / -1; }
.share-canvas { display: block; width: 100%; height: auto; margin: 16px 0 4px; border: 1px solid var(--line); }

.details h2, .others h2 { font-size: 18px; margin: 28px 0 6px; }
.details table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.details th, .details td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 16px; vertical-align: top; }
.details thead th { color: var(--sub); font-weight: 700; font-size: 16px; }
.details td { text-align: right; }
.details thead th:not(:first-child) { text-align: right; }
.details tr.note td { text-align: left; color: var(--sub); font-size: 16px; padding-top: 0; }
.details tr:has(+ tr.note) th, .details tr:has(+ tr.note) td { border-bottom: 0; }

.again { margin-top: 20px; }
.again .btn { width: 100%; }

/* 一覧（トップ・ほかの診断） */
.diag-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.diag-list li { border-bottom: 1px solid var(--line); }
.diag-list a { display: block; padding: 14px 2px; color: var(--ink); text-decoration: none; min-height: 48px; }
.diag-list a:active { background: var(--paper-2); }
.diag-title { display: block; font-weight: 800; font-size: 19px; }
.diag-lead { display: block; color: var(--sub); font-size: 16px; line-height: 1.6; }
.diag-time { display: inline-block; margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 問いの箱と選択肢（どの診断も同じ class を使う） */
.q-card { margin-top: 12px; }
.q-title { font-size: 20px; line-height: 1.5; margin: 4px 0 14px; }
.choice {
  display: block; width: 100%; min-height: 52px; padding: 10px 14px;
  font: inherit; font-size: 17px; font-weight: 700; text-align: left; line-height: 1.45;
  color: var(--ink); background: #fbfaf6;
  border: 2px solid var(--ink); border-radius: 4px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.choice:active { background: var(--paper-2); }
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 答えの文が長い診断は、表を縦に積む（問い → あなた／今 の 2 列） */
.details--stack table, .details--stack thead, .details--stack tbody { display: block; }
.details--stack tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.details--stack thead th:first-child { display: none; }
.details--stack tbody th { grid-column: 1 / -1; border-bottom: 0; padding-bottom: 0; }
.details--stack td, .details--stack thead th:not(:first-child) { text-align: left; }
.details--stack tr.note td { grid-column: 1 / -1; }
