/* 江戸時代なら何日かかる？ 飛脚で帰省  固有スタイル（色は変数のみ） */
:root { --eh-paper: #f6efe0; --eh-paper-2: #ead9b8; --eh-shu: #b8432f; --eh-ai: #2f4f7a; --eh-road: #b9a27a; --eh-sea: #e3ecf2; --eh-skin: #e9b98f; --eh-ink: #2a241c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --eh-paper: #2a251d; --eh-paper-2: #3a3124; --eh-shu: #ec7a62; --eh-ai: #8fb2e6; --eh-road: #7d6a4c; --eh-sea: #1b2632; --eh-skin: #d7a57c; --eh-ink: #f0e7d6; }
}
:root[data-theme="dark"] { --eh-paper: #2a251d; --eh-paper-2: #3a3124; --eh-shu: #ec7a62; --eh-ai: #8fb2e6; --eh-road: #7d6a4c; --eh-sea: #1b2632; --eh-skin: #d7a57c; --eh-ink: #f0e7d6; }

.h-sec { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.eh-sub { font-size: 15px; font-weight: 800; margin: 14px 0 8px; }
.eh-hero > * + * { margin-top: 10px; }
.eh-hero { padding: 4px 0 16px; }
.eh-landing { border-color: var(--eh-shu); background: var(--accent-soft); }
.eh-landing-q { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.eh-daily .daily-box b { display: block; line-height: 1.4; }
.eh-err { color: var(--bad); margin: 8px 0 0; }
.eh-select { width: 100%; min-height: 48px; font-size: 16px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); margin-bottom: 10px; }
.eh-form .btn { margin-top: 4px; }

/* 地図 */
.eh-hero-art { position: relative; background: var(--eh-paper); border-radius: var(--radius); padding: 8px; }
.eh-hero-map svg, .eh-map-wrap svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.eh-map-wrap { background: var(--eh-paper); border-radius: var(--radius); padding: 8px; margin: 10px 0; }
.eh-map-wrap.is-small svg { max-width: 260px; }
.eh-hero-runner { position: absolute; right: 6px; bottom: 6px; width: 34%; max-width: 150px; }
.eh-hero-runner svg { display: block; width: 100%; height: auto; }
.eh-sea { fill: var(--eh-sea); }
.eh-inset { fill: none; stroke: var(--eh-road); stroke-dasharray: 3 3; }
.eh-inset-t { font-size: 9px; fill: var(--text-sub); }
.eh-road { stroke: var(--eh-road); stroke-width: 2.4; stroke-linecap: round; }
.eh-road.is-sea, .eh-route.is-sea { stroke-dasharray: 4 4; }
.eh-route { stroke: var(--eh-shu); stroke-width: 4.5; stroke-linecap: round; }
.eh-node { fill: var(--eh-road); }
.eh-node.is-on { fill: var(--eh-shu); }
.eh-pin circle { fill: var(--surface); stroke-width: 3; }
.eh-pin.is-from circle { stroke: var(--eh-ai); }
.eh-pin.is-to circle { stroke: var(--eh-shu); }
.eh-pin text { font-size: 13px; font-weight: 800; fill: var(--eh-ink); paint-order: stroke; stroke: var(--eh-paper); stroke-width: 3px; }

/* 飛脚 */
.eh-runner .eh-shadow { fill: var(--eh-ink); opacity: .15; }
.eh-runner .eh-pole { stroke: var(--eh-road); stroke-width: 4; stroke-linecap: round; }
.eh-runner .eh-box { fill: var(--eh-shu); }
.eh-runner .eh-cord { stroke: var(--eh-ink); stroke-width: 2; }
.eh-runner .eh-leg line, .eh-runner .eh-arm { stroke: var(--eh-skin); stroke-width: 7; stroke-linecap: round; }
.eh-runner .eh-torso { fill: var(--eh-ai); }
.eh-runner .eh-head { fill: var(--eh-skin); }
.eh-runner .eh-hachi { fill: var(--surface); stroke: var(--eh-ink); stroke-width: .8; }
.eh-runner .eh-leg { transform-box: fill-box; }
.eh-runner .eh-leg-f { transform-origin: 0% 0%; }
.eh-runner .eh-leg-b { transform-origin: 100% 0%; }
.eh-runner.is-run .eh-leg-f { animation: eh-leg-f .5s ease-in-out infinite alternate; }
.eh-runner.is-run .eh-leg-b { animation: eh-leg-b .5s ease-in-out infinite alternate; }
.eh-runner.is-run .eh-body { animation: eh-bob .25s ease-in-out infinite alternate; }
@keyframes eh-leg-f { from { transform: rotate(-18deg); } to { transform: rotate(16deg); } }
@keyframes eh-leg-b { from { transform: rotate(16deg); } to { transform: rotate(-18deg); } }
@keyframes eh-bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .eh-runner.is-run .eh-leg-f, .eh-runner.is-run .eh-leg-b, .eh-runner.is-run .eh-body { animation: none; } }

/* ルート */
.eh-route-title { font-size: 20px; font-weight: 900; margin: 4px 0 8px; line-height: 1.4; }
.eh-km { font-size: 16px; margin: 6px 0 2px; }
.eh-km b { font-size: 30px; color: var(--eh-shu); margin: 0 2px; font-variant-numeric: tabular-nums; }
.eh-modes { display: grid; gap: 8px; margin: 10px 0; }
.eh-mode { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.eh-mode.is-mine { border-color: var(--eh-shu); background: var(--accent-soft); }
.eh-mode b { display: block; line-height: 1.35; }
.eh-mode-days { flex: none; font-size: 22px; font-weight: 900; color: var(--eh-shu); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ミニゲーム */
.eh-run > * + * { margin-top: 12px; }
.eh-track { position: relative; height: 120px; background: var(--eh-paper); border-radius: var(--radius); overflow: hidden; }
.eh-track-line { position: absolute; left: 12px; right: 12px; bottom: 30px; height: 6px; border-radius: 3px; background: var(--eh-road); }
.eh-stations { position: absolute; left: 4px; right: 4px; bottom: 6px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--eh-ink); }
.eh-st { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eh-track-runner { position: absolute; bottom: 26px; left: 0; width: 64px; }
.eh-track-runner svg { display: block; width: 100%; height: auto; }
.eh-drum { position: relative; width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center; }
.eh-drum-ring { position: absolute; inset: 10px; border-radius: 50%; border: 6px solid var(--eh-shu); opacity: .3; }
.eh-drum-core { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--eh-shu); color: var(--accent-ink); font-weight: 900; font-size: 18px; }
.eh-judge { text-align: center; font-size: 22px; font-weight: 900; min-height: 34px; margin: 0; }
.eh-judge.is-good { color: var(--good); }
.eh-judge.is-ok { color: var(--warn); }
.eh-judge.is-bad { color: var(--bad); }
.eh-tap { display: block; width: 100%; min-height: 120px; border: 0; border-radius: 22px; font-size: 30px; font-weight: 900; background: var(--eh-shu); color: var(--accent-ink); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.eh-tap:active { transform: scale(.98); }
.eh-tap:disabled { opacity: .6; }

/* 結果 */
.eh-result > * + * { margin-top: 12px; }
.eh-res-line { font-size: 18px; font-weight: 800; line-height: 1.6; margin: 6px 0 10px; }
.eh-res-days { font-size: 40px; color: var(--eh-shu); font-variant-numeric: tabular-nums; }
.eh-rank-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.eh-rank { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; background: var(--eh-shu); color: var(--accent-ink); }
.eh-rank.r-B, .eh-rank.r-C { background: var(--eh-ai); }
.eh-again .btn { min-width: 140px; }
.eh-titles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eh-title { padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--text-sub); }
.eh-title.on { border-style: solid; border-color: var(--eh-shu); color: var(--text); background: var(--accent-soft); }
.eh-title b { display: block; font-size: 14px; }
.eh-title small { display: block; font-size: 11px; line-height: 1.4; }
.eh-stamps { display: flex; flex-wrap: wrap; gap: 4px; }
.eh-stamp { min-width: 30px; padding: 2px 6px; font-size: 11px; text-align: center; border-radius: 6px; background: var(--surface-2); color: var(--text-sub); }
.eh-stamp.on { background: var(--eh-shu); color: var(--accent-ink); font-weight: 700; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.bar-row .bar-label { width: 96px; flex: none; }
.bar-row .bar-pct { width: 44px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.bar-row.is-me { font-weight: 800; }
.src-list { padding-left: 18px; margin: 6px 0; font-size: 13px; }
.src-list li { margin: 4px 0; }
.eh-about h3 { font-size: 15px; margin: 12px 0 4px; }
