:root {
  color-scheme: light; /* 占い・すごろくと同じく、端末がダークモードでも明るい色で表示 */
  --bg: #f3f4fa;
  --card: #ffffff;
  --text: #1c1f33;
  --muted: #646a85;
  --line: #dfe2ef;
  --accent: #3b3fc4;
  --accent-ink: #ffffff;
  --gold: #c98a12;
  --soft: #eceefc;
  --bar: #e4e6f3;
  --g-body: #2f8fd8;
  --g-study: #8a4fc7;
  --g-money: #c98a12;
  --g-power: #d2513b;
  --g-life: #2c9a6a;
}
* { 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.65;
}
a { color: var(--accent); }
.site-header, .site-footer { max-width: 680px; margin: 0 auto; padding: 12px 16px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo { font-weight: 800; text-decoration: none; color: var(--text); letter-spacing: .5px; }
.logo b { color: var(--accent); }
.nav { display: flex; gap: 12px; font-size: 13px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a.on { color: var(--accent); font-weight: 700; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); padding-bottom: 32px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.screen { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; margin-bottom: 16px; }
h1 { font-size: 24px; margin: 0 0 8px; line-height: 1.35; }
h2 { font-size: 19px; margin: 24px 0 8px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
.lead { margin: 0 0 12px; }
.small { font-size: 12px; color: var(--muted); }
.safe { font-size: 13px; background: var(--soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; }

.btn {
  display: block; width: 100%; padding: 12px; margin: 8px 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-family: inherit;
  font-size: 16px; text-align: center; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn:disabled { opacity: .5; cursor: default; }

/* 入力 */
.step { margin: 18px 0 6px; font-weight: 700; }
.who { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px; align-items: stretch; }
.seg { border: 2px solid var(--line); border-radius: 12px; padding: 10px 6px; background: var(--card); color: var(--text);
  cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 700; }
.seg.on { border-color: var(--accent); background: var(--soft); color: var(--accent); }
.age { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 12px; padding: 0 10px; }
.age input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 18px; font-family: inherit; padding: 10px 0; text-align: right; }
.age span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.group-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.group-block h3 { display: flex; align-items: center; gap: 6px; margin: 10px 0 2px; font-size: 15px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.g-body { --g: var(--g-body); } .g-study { --g: var(--g-study); } .g-money { --g: var(--g-money); } .g-power { --g: var(--g-power); } .g-life { --g: var(--g-life); }
.dot { background: var(--g); }
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: 0; }
.field label { font-weight: 700; line-height: 1.35; }
.field label small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.field .inp { display: flex; align-items: center; gap: 4px; }
.field select { height: 40px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px;
  background: var(--card); color: var(--text); font-family: inherit; max-width: 150px; }
.field input { width: 96px; height: 40px; text-align: right; font-size: 17px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 8px; background: var(--card); color: var(--text); font-family: inherit; }
.field input:focus, .age input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field .unit { font-size: 13px; color: var(--muted); width: 2.4em; }
.field.off { opacity: .45; }
.field.off input { pointer-events: none; }
.more-fit summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 8px 0; }
.err { color: var(--g-power); font-size: 13px; min-height: 1.2em; margin: 4px 0 0; }

/* 結果 */
.judge { text-align: center; }
.judge-emoji { font-size: 64px; line-height: 1.2; }
.judge-label { margin: 0; color: var(--muted); font-size: 14px; }
.judge-score { font-size: 54px; font-weight: 900; margin: 0; color: var(--accent); line-height: 1.15; }
.judge-score small { font-size: 18px; color: var(--muted); font-weight: 700; }
.judge-title { font-size: 26px; font-weight: 900; margin: 6px 0 4px; }
.judge-title::before, .judge-title::after { content: "★"; color: var(--gold); font-size: 16px; vertical-align: middle; margin: 0 6px; }
.radar { display: block; margin: 8px auto 0; max-width: 340px; width: 100%; height: auto; }
.radar text { font-size: 11px; fill: var(--muted); }
.res-list { list-style: none; padding: 0; margin: 12px 0 0; }
.res { padding: 12px 0; border-bottom: 1px solid var(--line); }
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.res-name { font-weight: 800; }
.res-name .dot { margin-right: 6px; }
.res-val { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 4px; }
.res-top { font-size: 22px; font-weight: 900; color: var(--g); white-space: nowrap; }
.meter { position: relative; height: 10px; background: var(--bar); border-radius: 999px; margin: 8px 0 4px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--g); opacity: .85; }
.meter b { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--text); border-radius: 2px; transform: translateX(-2px); }
.meter-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.res-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.res-sub b { color: var(--text); }
.share-title { font-weight: 700; margin: 20px 0 6px; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sns { display: block; padding: 10px 4px; border-radius: 10px; text-align: center; text-decoration: none; font-weight: 700; font-size: 14px;
  color: #fff; border: 0; font-family: inherit; cursor: pointer; }
.sns-x { background: #111; } .sns-line { background: #06c755; } .sns-threads { background: #333; }
.sns-bluesky { background: #1185fe; } .sns-facebook { background: #1877f2; } .sns-copy { background: #5b5f78; }

/* 項目へのリンク */
.items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.items-grid a { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--text);
  border-left: 4px solid var(--g); }
.items-grid a strong { display: block; }
.items-grid a span { font-size: 12px; color: var(--muted); }

/* 表 */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.list th:first-child, table.list td:first-child { text-align: left; }
table.list th { font-size: 12px; color: var(--muted); }
table.list td.hl { font-weight: 800; }
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 4px 14px;
  font-size: 14px; cursor: pointer; font-family: inherit; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.doc h1 { font-size: 22px; }
.doc li { margin-bottom: 4px; }
.note { border-left: 4px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--card)); padding: 8px 12px; font-size: 14px; border-radius: 0 8px 8px 0; }
.ad-slot { margin: 16px 0; }
.ad-slot:empty { display: none; }
.hikidashi-more { margin-top: 16px; }
@media (max-width: 380px) {
  .field input { width: 80px; }
  .judge-score { font-size: 46px; }
}
