/* お雑煮を作れるサイト：藍・朱・金・白。システムフォントのみ */
:root {
  --ink: #152238;
  --muted: #5b6b7d;
  --bg: #e7eef6;
  --paper: #ffffff;
  --indigo: #1c3a5c;
  --indigo-deep: #12243a;
  --shu: #b8442e;
  --shu-hover: #9c3826;
  --gold: #c4a24a;
  --gold-soft: #e8d9a0;
  --line: #c5d0dc;
  --ok: #2c6e5d;
  --focus: #1c3a5c;
  --tap: 44px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(196,162,74,0.12), transparent 36%),
    linear-gradient(180deg, #e7eef6 0%, #dfe7f1 100%);
  color: var(--ink);
}
img, svg { max-width: 100%; height: auto; }
button, input, a { font: inherit; }
a { color: var(--indigo); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.wrap { width: min(760px, calc(100% - 32px)); margin: 0 auto; }
.top {
  background: var(--indigo-deep);
  color: #f4f6fb;
  padding: 16px 0 18px;
  border-bottom: 6px solid var(--gold);
}
.top h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.04em; }
.brand { margin: 0 0 6px; font-size: 0.8rem; color: var(--gold-soft); }
.lead { margin: 8px 0 0; color: #cfd8e4; font-size: 0.92rem; }
#main { padding: 20px 0 48px; outline: none; }
.step { margin: 0; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 16px 16px;
  box-shadow: 0 8px 24px rgba(18,36,58,0.06);
}
.card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.hint { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.progress { margin: 0 0 16px; }
.progress-label { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); }
.progress-bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #d5deea;
  overflow: hidden;
}
.progress-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--indigo), var(--gold));
  border-radius: inherit;
}
.progress-bar[data-p="1"]::after { width: 20%; }
.progress-bar[data-p="2"]::after { width: 40%; }
.progress-bar[data-p="3"]::after { width: 60%; }
.progress-bar[data-p="4"]::after { width: 80%; }
.progress-bar[data-p="5"]::after { width: 100%; }
.hero { text-align: center; padding: 12px 8px 8px; }
.hero-mark {
  width: min(240px, 70vw);
  height: auto;
  margin: 0 auto 12px;
  display: block;
  min-height: 160px;
}
.hero h2 { font-size: 1.4rem; margin: 0 0 8px; }
.tag { margin: 0 0 16px; }
.disclaimer {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #f3f6fb;
  border-left: 3px solid var(--gold);
  font-size: 0.85rem;
  color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--shu); color: #fff; flex: 1 1 160px; }
.btn-primary:hover:not(:disabled) { background: var(--shu-hover); }
.btn-secondary { background: var(--indigo); color: #fff; flex: 1 1 160px; }
.btn-ghost { background: #fff; color: var(--indigo); border-color: var(--line); flex: 1 1 120px; }
.btn-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 8px 4px; color: var(--indigo);
}
.choices, #guChoices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#guChoices { margin: 0; }
.choice, .choice-gu, .toggle {
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}
.choice[aria-checked="true"], .choice-gu.is-on, .toggle[aria-pressed="true"] {
  border-color: var(--indigo);
  background: #eef3f9;
  box-shadow: inset 0 0 0 1px var(--indigo);
}
.choice:disabled, .toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.choice-bowl {
  display: block;
  width: 54px;
  height: 36px;
  margin: 0 auto 6px;
  border-radius: 0 0 18px 18px;
  border: 3px solid #c4a24a;
}
.choice-bowl[data-bowl="shu"] { background: #b8442e; }
.choice-bowl[data-bowl="kuro"] { background: #1c1c1c; }
.choice-bowl[data-bowl="hakuji"] { background: #f6f4ef; border-color: #2a4a6a; }
.choice-bowl[data-bowl="ki"] { background: #9a6a38; border-color: #6a4218; }
.live-bowl {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 16px;
}
.live-bowl svg, .finish-stage svg, .result-bowl svg { width: min(320px, 100%); height: auto; }
.mochi-fields { margin-top: 12px; }
.mochi-row { margin-bottom: 12px; }
.mochi-row p { margin: 0 0 8px; font-weight: 600; }
.row-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.finish-stage {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oz-bowl.is-anim .soup { transform-origin: 50% 80%; animation: pour 0.8s ease-out both; }
.oz-bowl.is-anim .mochi { transform-origin: 50% 80%; animation: puff 0.7s 0.7s ease-out both; }
.oz-bowl.is-anim .gu { opacity: 0; animation: fadein 0.5s 1.1s ease-out both; }
@keyframes pour { from { transform: translateY(-18px); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes puff { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.result-style {
  font-size: clamp(1.2rem, 6vw, 1.8rem);
  margin: 8px 0 12px;
  color: var(--indigo-deep);
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.result-lead { font-weight: 700; text-align: center; margin: 0 0 12px; }
.result-bowl { min-height: 240px; display: flex; justify-content: center; }
.blurb { margin: 0 0 8px; }
.source { font-size: 0.9rem; }
.close-list { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
.field { display: block; margin: 8px 0; }
.field input {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.share-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  background: var(--indigo-deep);
  border-radius: 12px;
  margin: 12px 0;
}
.foot {
  background: var(--indigo-deep);
  color: #d5deea;
  padding: 24px 0 32px;
  font-size: 0.88rem;
}
.foot a, .kt-support {
  color: var(--gold-soft);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
a.source, .sources a {
  color: var(--indigo);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}


/* マップ */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* 実形都道府県地図 */
.map-stage { display: flex; flex-direction: column; margin: 8px 0; }
.map-side { display: contents; }
.map-toolbar { order: 1; }
.map-visual { order: 2; }
.map-detail { order: 3; }
.map-frame {
  width: 100%;
  aspect-ratio: var(--map-ar-w, 1000) / var(--map-ar-h, 1215);
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}
.map-frame .jp-map {
  width: 100%;
  height: 100%;
  display: block;
}
.jp-map path.pref {
  fill: #d5dde6;
  stroke: #fff;
  stroke-width: 1.2;
  stroke-linejoin: round;
  cursor: pointer;
  outline: none;
}
.jp-map path.pref.is-light { stroke: #1c3a5c; stroke-width: 1; }
/* 票なし・集計中は細いままだと縮小表示で輪郭が消える。投票色のパレットは変えない。 */
.jp-map path.pref[data-state="empty"],
.jp-map path.pref[data-state="low"] { stroke: #1c3a5c; stroke-width: 2.4; }
.jp-map path.pref[data-state="empty"] { fill: url(#pat-empty); }
.jp-map path.pref[data-state="low"] { fill: url(#pat-low); }
.jp-map path.pref[data-shape="1"] { fill: #1c3a5c; }
.jp-map path.pref[data-shape="2"] { fill: #c4a24a; }
.jp-map path.pref[data-shape="3"] { fill: #8a96a6; }
.jp-map path.pref[data-shape-mix="12"] { fill: url(#pat-mix-12); }
.jp-map path.pref[data-shape-mix="13"] { fill: url(#pat-mix-13); }
.jp-map path.pref[data-shape-mix="23"] { fill: url(#pat-mix-23); }
.jp-map path.pref[data-soup="1"] { fill: #e8d9a0; }
.jp-map path.pref[data-soup="2"] { fill: #dcc07a; }
.jp-map path.pref[data-soup="3"] { fill: #b88848; }
.jp-map path.pref[data-soup="4"] { fill: #7c3030; }
.jp-map path.pref[data-soup="9"] { fill: #7a8aa0; }
.jp-map path.pref.is-on,
.jp-map path.pref:focus,
.jp-map path.pref:focus-visible {
  stroke: var(--gold);
  stroke-width: 3;
}
.jp-map .inset-frame { pointer-events: none; }
.jp-map .inset-label {
  font-family: sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #1c3a5c;
  pointer-events: none;
}
.map-caption, .map-credit {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.map-legend:not([hidden]) { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0; font-size: 0.85rem; }
.map-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; border: 1px solid var(--line); }
.map-meta { color: var(--muted); font-size: 0.9rem; }
.map-detail { background: #f3f6fb; border-radius: 12px; padding: 12px; margin: 12px 0; min-height: 72px; }
.mode-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.pref-picker { margin: 20px 0 8px; }
.pref-picker h2 { font-size: 1.15rem; margin: 0 0 6px; }
.pref-picker .picker-lead { margin: 0 0 12px; font-size: 0.95rem; }
.pref-picker h3 { font-size: 0.88rem; margin: 12px 0 6px; color: var(--muted); font-weight: 700; }
.pref-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-btns button {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.pref-btns button[aria-pressed="true"] {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  background: #f3f6fb;
}
.vote-form label, .vote-form .field { display: block; margin: 10px 0; }
.vote-form select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.vote-msg { margin: 10px 0; font-weight: 600; }
.vote-msg.is-err { color: var(--shu); }
.vote-msg.is-ok { color: var(--ok); }
.leg-kaku{background:#1c3a5c}
.leg-maru{background:#c4a24a}
.leg-none{background:#8a96a6}
.leg-low{background:#c5ced8}
.leg-s1{background:#e8d9a0}
.leg-s2{background:#dcc07a}
.leg-s3{background:#b88848}
.leg-s4{background:#7c3030}
.leg-s9{background:#7a8aa0}

@media (min-width: 1100px) {
  body.map-page header.top { padding: 8px 0 10px; }
  body.map-page header.top .lead { margin-top: 4px; }
  body.map-page main.wrap { padding-top: 8px; }
  body.map-page .disclaimer { margin: 0 0 8px; font-size: 0.85rem; }
  body.map-page header.top .wrap,
  body.map-page main.wrap,
  body.map-page footer.foot .wrap {
    width: min(1100px, calc(100% - 48px));
  }
  .map-stage {
    display: flex;
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
  }
  .map-side {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 240px;
    order: 2;
  }
  .map-toolbar, .map-detail { order: 0; }
  .map-visual {
    flex: 0 1 680px;
    max-width: 680px;
    order: 1;
  }
  .map-frame {
    margin: 0;
    max-width: none;
    /* 1280×800 の第一画面に地図全体（挿枠含む）を収める */
    max-height: 560px;
    width: min(100%, calc(560px * var(--map-ar-w, 1000) / var(--map-ar-h, 1215)));
    aspect-ratio: var(--map-ar-w, 1000) / var(--map-ar-h, 1215);
  }
  .map-side { flex: 1; min-width: 240px; }
}
