/* ヨリミチ 本番サイトの共通の見た目（資料33・34 案C「夜の路地と灯り」）
   焦げ茶の夜に、提灯と戸口の灯り（琥珀色）。暖簾は藍、提灯は朱。夜の町の一枚の見た目なので、明るい表示は持たない */
:root {
  --paper: #1A1512; --card: #241D18; --card2: #2E251F; --ink: #F7E9D2; --muted: #C4A982; --line: #3E3128;
  --accent: #C8362F; --accent-ink: #FFF3E0; --glow: #FFB24D; --amber: #E9B872; --indigo: #2E3B5E; --frame: #3A2C22;
  --ink-fixed: #2A201A; --type-color: #FFB24D;
  --c-energy: #F08A6C; --c-explore: #86A9F2; --c-bond: #6CC096; --c-pace: #B994E2; --c-weather: #86B9CC;
  --night: #1A1512; --night-ink: #F7E9D2;
  --mincho: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "BIZ UDPMincho", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.75; font-size: 16px; min-height: 100vh;
  background-image: radial-gradient(60% 420px at 50% 0, rgba(255, 178, 77, .16), rgba(255, 178, 77, 0)),
    linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 14%, rgba(0, 0, 0, 0) 86%, rgba(0, 0, 0, .28));
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif; }
img, svg { max-width: 100%; }
a { color: inherit; }
.wrap { max-width: 600px; margin: 0 auto; padding-block: 12px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { line-height: 1.4; text-wrap: balance; font-family: var(--mincho); font-weight: 700; letter-spacing: .02em; }
h1 { text-shadow: 0 0 24px rgba(255, 178, 77, .28); }
h2 { color: var(--amber); }
a { text-decoration-color: rgba(233, 184, 114, .5); }
h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 19px; margin: 28px 0 8px; }
p { margin: 8px 0; }
.note { font-size: 14px; color: var(--muted); }
.center { text-align: center; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 12px; }
.btn { display: block; width: 100%; min-height: 52px; margin-top: 14px; border: 0; border-radius: 14px; background: var(--amber); color: #1A1512;
  font: inherit; font-weight: 700; text-align: center; text-decoration: none; line-height: 52px; cursor: pointer; }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 22px rgba(200, 54, 47, .35); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 400; }
.btn:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
select, input[type=text] { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
label.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
label.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; }

/* 上の帯 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 600px; margin: 0 auto; }
.top a { text-decoration: none; font-weight: 700; letter-spacing: .06em; }
.top > a:first-child { font-family: var(--mincho); font-size: 18px; white-space: nowrap; }
.top nav { white-space: nowrap; }
@media (max-width: 440px) { .top > a:first-child .note { display: none; } .top nav a { margin-left: 10px; } }
.top > a:first-child::before { content: ""; display: inline-block; width: 10px; height: 13px; margin-right: 8px; border-radius: 50%; background: #E2563B;
  box-shadow: 0 0 10px 2px rgba(255, 178, 77, .6); vertical-align: -1px; }
.top nav a { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 14px; }

/* 質問 */
.bar { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--glow); transition: width .2s; }
.q { font-size: 20px; font-weight: 700; margin: 22px 0 12px; min-height: 3.4em; }
.opts { display: grid; gap: 8px; }
.opts button { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; padding: 0 16px; cursor: pointer; }
.opts button.sel { border-color: var(--glow); background: var(--card2); font-weight: 700; }
.cheer { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.cheer svg { flex: none; }

/* 結果 */
.hero { text-align: center; padding-top: 8px; }
/* 灯りのともった戸口（奥に住人と影が見える） */
.door { display: inline-block; line-height: 0; border: 5px solid var(--frame); border-radius: 999px 999px 6px 6px; overflow: hidden;
  box-shadow: 0 0 36px rgba(255, 178, 77, .38); vertical-align: bottom; }
.door svg { display: block; }
.door.sm { border-width: 3px; box-shadow: 0 0 18px rgba(255, 178, 77, .3); }
.doors { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
/* 住人の紋（資料37） */
.mon .mon-name { text-align: center; font-family: var(--mincho); font-weight: 700; font-size: 18px; margin: 6px 0 4px; color: var(--amber); }
.mon-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.mon-legend .dot { width: 9px; height: 9px; margin-right: 4px; }
/* 暖簾（地区名） */
.noren { display: flex; justify-content: center; gap: 4px; margin: 4px 0 -2px; }
.noren span { writing-mode: vertical-rl; background: var(--indigo); color: var(--ink); font-family: var(--mincho); font-weight: 700; font-size: 18px;
  width: 34px; height: 62px; padding-top: 7px; display: flex; justify-content: flex-start; align-items: center; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.lantern-glow { color: var(--amber); letter-spacing: .2em; }
.hero .copy { font-size: 16px; margin: 4px 0 0; color: var(--amber); font-family: var(--mincho); }
.rough { text-align: left; }
.item { margin-top: 12px; }
.item p { margin: 2px 0 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dom { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.dom:first-of-type { border-top: 0; padding-top: 0; }
details.panel summary { cursor: pointer; list-style: none; font-weight: 700; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::before { content: "＋ "; }
details.panel[open] summary::before { content: "－ "; }
details.panel summary .d { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

/* 4つの軸（A'改：5つのマス・両極の名前・1色。03 §4.1 の幅と同じ区切り） */
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend .lp { width: 56px; flex: none; text-align: center; }
.legend .lc { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.legend .lc span { display: flex; justify-content: center; white-space: nowrap; }
.legend .lc span:first-child { justify-content: flex-end; }
.legend .lc span:last-child { justify-content: flex-start; }
.axis { margin-top: 14px; }
.axis .row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.axis .pole { width: 56px; flex: none; text-align: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.axis .pole.on { color: var(--ink); font-weight: 700; }
.cells { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.cell { height: 14px; border-radius: 4px; background: var(--line); }
.cell.on { background: var(--type-color); }
.cell.center.on { background: var(--muted); }
.axis .word { font-weight: 700; margin-top: 2px; }
.axis .word.l { text-align: left; padding-left: 64px; }
.axis .word.r { text-align: right; padding-right: 64px; }
.axis .word.c { text-align: center; }
.dbar { margin-top: 10px; }
.dbar .t { height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; }
.dbar .f { height: 100%; }
.nums { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-variant-numeric: tabular-nums; margin-top: 10px; font-size: 14px; }

/* 一覧（キャラクター・タイプ） */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px 10px; text-align: center; text-decoration: none; }
.tile:hover { border-color: var(--amber); }
.tile svg { width: 100%; max-width: 110px; height: auto; display: block; margin: 0 auto; }
.tile b { display: block; font-size: 13px; line-height: 1.4; }
.tile span { font-size: 12px; color: var(--muted); }

/* 結果の共有（X・LINE） */
.sharebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sharebtns .btn { margin-top: 0; }
#shareX { background: #F7E9D2; color: #1A1512; }
#shareLine { background: #06C755; color: #FFFFFF; }

/* 共有カード */
.cardbox { display: flex; justify-content: center; margin-top: 12px; }
.cardbox canvas { width: 100%; max-width: 300px; height: auto; border-radius: 18px; box-shadow: 0 0 30px rgba(255, 178, 77, .18), 0 10px 30px rgba(0, 0, 0, .4); }

footer { max-width: 600px; margin: 0 auto; padding-block: 24px 40px; font-size: 13px; color: var(--muted);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
footer a { margin-right: 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
[hidden] { display: none !important; }
