/* 紙の診断票のような見た目にする。色は墨と生成り、結果だけ朱色のハンコで押す。 */
:root {
  --paper: #efeadf;
  --sheet: #fbf9f3;
  --ink: #2b2a26;
  --muted: #6b665c;
  --rule: #d6cfbf;
  --shu: #c8382a;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  padding: 1.5rem 1rem 3rem;
  line-height: 1.8;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  max-width: 600px;
  margin: 0 auto;
  padding: 1.75rem;
}

[hidden] { display: none !important; }

.eyebrow { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.3rem; }
#q-count { font-family: var(--mono); color: var(--ink); }
h1 { font-family: var(--mincho); font-weight: 700; margin: 0 0 0.9rem; font-size: 1.7rem; line-height: 1.4; }
h2 { margin: 0 0 1.1rem; font-size: 1.15rem; line-height: 1.6; }
h2.sub { font-family: var(--mincho); font-size: 1rem; margin: 1.8rem 0 0.5rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--ink); }
.lead { margin: 0 0 1.25rem; }

button {
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
}
button:hover { background: #f3eee2; }

a.button {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
  padding: 0.6rem 1.1rem;
}
a.button.x { background: #000; color: #fff; border: 1px solid #000; }
a.button.x:hover { background: #222; }
button.primary { background: var(--ink); color: var(--sheet); font-weight: 700; }
button.primary:hover { background: #000; }

/* 選択肢: 記入欄のように番号を振る */
.choices { display: grid; gap: 0.5rem; counter-reset: c; }
.choices button { text-align: left; width: 100%; border-color: var(--rule); display: flex; gap: 0.7rem; align-items: baseline; }
.choices button::before { counter-increment: c; content: counter(c); font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.choices button:hover { border-color: var(--ink); }

.progress { height: 3px; background: var(--rule); margin-bottom: 0.9rem; }
#progress-bar { height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }

/* 結果のハンコ */
.result-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.stamp {
  width: 104px; height: 104px;
  display: grid; place-items: center;
  border: 3px solid var(--shu);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--sheet), inset 0 0 0 5px var(--shu);
  color: var(--shu);
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  transform: rotate(-9deg);
  opacity: 0.9;
}
.catch { font-weight: 700; margin: 0 0 0.8rem; }
.catch::before { content: "―― "; color: var(--muted); font-weight: 400; }
#r-buddy { margin: 0; }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.5rem; }
.note { color: var(--muted); font-size: 0.85rem; }

.lang { display: flex; justify-content: flex-end; gap: 0.8rem; margin: -0.6rem 0 0.4rem; }
.lang-btn { padding: 0; font-size: 0.8rem; border: none; border-bottom: 1px solid transparent; border-radius: 0; color: var(--muted); background: none; }
.lang-btn:hover { background: none; color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.stats { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.35rem; }
.stats li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label val" "bar bar"; row-gap: 0.15rem; column-gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.stats .label { grid-area: label; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats .val { grid-area: val; text-align: right; font-family: var(--mono); }
.stats .bar { grid-area: bar; height: 6px; background: #ebe5d8; }
.stats .bar span { display: block; height: 100%; background: #a39d90; }
.stats li.mine { color: var(--ink); font-weight: 700; }
.stats li.mine .bar span { background: var(--shu); }

footer { margin-top: 2rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); color: var(--muted); }

@media (max-width: 480px) {
  .card { padding: 1.25rem 1rem; }
  .stamp { width: 84px; height: 84px; font-size: 1.05rem; }
}
