/* ============================================================
   16タイプ せいかくラボ  v3
   レイアウト: 白いキャンバスに、もちっと丸い文字とチャンキーなボタン。
   キャラは「舞台」に立たせる。
   ルール: 余白は4pxグリッド / ボタン・入力は角丸12px＋2px線 / カードは角丸20px・影なし
   ============================================================ */

:root {
  /* 色：キャンバス・線・文字（イラストの主線に合わせた焦げ茶） */
  --paper: #ffffff;
  --wash: #f4f7ef;
  --wash-2: #eaf0e2;
  --line: #e2e7da;
  --line-strong: #c9d1bd;
  --ink: #3a2e2c;
  --ink-2: #6b605c;
  --ink-3: #8b807b;

  /* 色：ずんだ（主役・CTA）と めたん（ピンク＋ドレスの藤色） */
  --zunda: #78c93c;
  --zunda-deep: #4f9a1f;
  --zunda-ink: #3f7d17;
  --zunda-tint: #e9f7dc;
  --metan: #e46cbf;
  --metan-deep: #b23f8f;
  --metan-ink: #a83786;
  --metan-tint: #fce8f5;
  --lilac: #9db2e6;
  --lilac-tint: #ebf0fc;
  --gold: #f5c542;
  --focus: #3d7fe0;

  /* 文字 */
  --f-display: "Mochiy Pop One", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  --f-body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --f-latin: "Fredoka", "M PLUS Rounded 1c", system-ui, sans-serif;
  /* 1.25倍のスケール */
  --t-xs: 0.78rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.56rem;
  --t-2xl: 1.95rem;
  --t-3xl: 2.44rem;
  --t-4xl: 3.05rem;

  /* 余白（4pxグリッド） */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-ctl: 12px;
  --r-card: 20px;
  --r-big: 28px;
  --bw: 2px;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161914;
    --wash: #1f241b;
    --wash-2: #283023;
    --line: #333b2d;
    --line-strong: #4a5541;
    --ink: #f1eee8;
    --ink-2: #c6bfb6;
    --ink-3: #a29a90;
    --zunda: #8bd94f;
    --zunda-deep: #4f8f24;
    --zunda-ink: #a6e374;
    --zunda-tint: #263a18;
    --metan: #f08ad0;
    --metan-deep: #9c3a7d;
    --metan-ink: #ff9fdc;
    --metan-tint: #3a1f33;
    --lilac: #a9bcef;
    --lilac-tint: #232a3d;
    --focus: #8cb6ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161914;
  --wash: #1f241b;
  --wash-2: #283023;
  --line: #333b2d;
  --line-strong: #4a5541;
  --ink: #f1eee8;
  --ink-2: #c6bfb6;
  --ink-3: #a29a90;
  --zunda: #8bd94f;
  --zunda-deep: #4f8f24;
  --zunda-ink: #a6e374;
  --zunda-tint: #263a18;
  --metan: #f08ad0;
  --metan-deep: #9c3a7d;
  --metan-ink: #ff9fdc;
  --metan-tint: #3a1f33;
  --lilac: #a9bcef;
  --lilac-tint: #232a3d;
  --focus: #8cb6ff;
  color-scheme: dark;
}

/* タイプのグループ色 */
.g-NT { --g: #8a6cf0; --g-tint: #f0ebff; --g-ink: #5b3fc0; --g-deep: #6a4fd6; --g-on: #fff; }
.g-NF { --g: #3ea36b; --g-tint: #e2f5ea; --g-ink: #1f7347; --g-deep: #2b8253; --g-on: #fff; }
.g-SJ { --g: #3d8bd9; --g-tint: #e6f1fc; --g-ink: #1f62a8; --g-deep: #2a70ba; --g-on: #fff; }
.g-SP { --g: #f08a24; --g-tint: #fff0de; --g-ink: #a85406; --g-deep: #c96a10; --g-on: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .g-NT { --g-tint: #2a2448; --g-ink: #c4b3ff; }
  :root:not([data-theme="light"]) .g-NF { --g-tint: #1b3326; --g-ink: #8fdcb0; }
  :root:not([data-theme="light"]) .g-SJ { --g-tint: #1a2a3c; --g-ink: #95c6f5; }
  :root:not([data-theme="light"]) .g-SP { --g-tint: #3a2714; --g-ink: #ffbe80; }
}
:root[data-theme="dark"] .g-NT { --g-tint: #2a2448; --g-ink: #c4b3ff; }
:root[data-theme="dark"] .g-NF { --g-tint: #1b3326; --g-ink: #8fdcb0; }
:root[data-theme="dark"] .g-SJ { --g-tint: #1a2a3c; --g-ink: #95c6f5; }
:root[data-theme="dark"] .g-SP { --g-tint: #3a2714; --g-ink: #ffbe80; }

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--t-md);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.skip-link:focus { top: 12px; }
.noscript { padding: 40px 0; text-align: center; }
.latin { font-family: var(--f-latin); font-variant-numeric: tabular-nums; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: var(--s4); padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-face { width: 38px; height: 38px; border-radius: 12px; background: var(--zunda-tint); overflow: hidden; flex-shrink: 0; }
.brand-face img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { font-family: var(--f-display); font-size: 1.12rem; line-height: 1.1; }
.brand-text small { display: block; font-family: var(--f-latin); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; color: var(--ink-3); }
.top-nav { display: none; margin-left: auto; gap: 2px; }
.top-nav a { text-decoration: none; font-weight: 700; font-size: var(--t-sm); padding: 8px 14px; border-radius: var(--r-ctl); color: var(--ink-2); }
.top-nav a:hover { background: var(--wash); color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--zunda-ink); background: var(--zunda-tint); }
.icon-btn {
  margin-left: auto; width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--line); border-radius: var(--r-ctl);
  box-shadow: 0 3px 0 var(--line);
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
@media (min-width: 860px) {
  .top-nav { display: flex; }
  .icon-btn { margin-left: var(--s2); }
}

/* ---------- タブバー（スマホ） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper); border-top: var(--bw) solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 0.7rem; font-weight: 800; color: var(--ink-3); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--zunda-ink); }
.tabbar a[aria-current="page"] svg { background: var(--zunda-tint); border-radius: 10px; padding: 2px; width: 36px; height: 28px; }
@media (min-width: 860px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- レイアウト ---------- */
.app { max-width: 760px; margin: 0 auto; padding: var(--s5) 16px var(--s7); outline: none; }
.app.wide { max-width: 1080px; }
.view { animation: viewIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes viewIn { from { opacity: 0.4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stack { display: grid; gap: var(--s4); }
.stack-lg { display: grid; gap: var(--s6); }
.stack > *, .stack-lg > *, .info-grid > *, .tab-panel > * { min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.center { text-align: center; }

.page-head { display: grid; gap: var(--s2); padding-block: var(--s2) var(--s4); }
.eyebrow { font-family: var(--f-latin); font-weight: 600; font-size: var(--t-xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.page-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.7rem, 6vw, 2.44rem); line-height: 1.25; }
.page-lead { color: var(--ink-2); max-width: 38em; }


/* ---------- カード ---------- */
.card { background: var(--paper); border: var(--bw) solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.card.tint { background: var(--wash); border-color: transparent; }
a.card, .card-link { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.card:hover, .card-link:hover { border-color: var(--line-strong); box-shadow: 0 4px 0 var(--line); transform: translateY(-2px); }
a.card:active, .card-link:active { transform: translateY(2px); box-shadow: none; }

/* ---------- ボタン（チャンキー） ---------- */
.btn {
  --b: var(--paper); --b-text: var(--ink); --b-edge: var(--line); --b-line: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 22px;
  border: var(--bw) solid var(--b-line); border-radius: var(--r-ctl);
  background: var(--b); color: var(--b-text);
  font-weight: 800; font-size: var(--t-md); letter-spacing: 0.04em; text-decoration: none;
  box-shadow: 0 4px 0 var(--b-edge);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--b-edge); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-lg { min-height: 58px; font-size: var(--t-lg); padding: 12px 30px; }
.btn-sm { min-height: 40px; font-size: var(--t-sm); padding: 6px 14px; box-shadow: 0 3px 0 var(--b-edge); }
.btn-block { width: 100%; }
.btn-zunda { --b: var(--zunda); --b-text: #173300; --b-edge: var(--zunda-deep); --b-line: var(--zunda); }
.btn-metan { --b: var(--metan); --b-text: #3a0b2b; --b-edge: var(--metan-deep); --b-line: var(--metan); }
.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--wash); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.text-link { color: var(--zunda-ink); font-weight: 800; text-underline-offset: 3px; }

/* ---------- チップ・バッジ ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--g, var(--ink)); color: var(--g-on, var(--paper)); font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.06em; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: #fff7d6; color: #5a4700; border-radius: var(--r-ctl); padding: 12px 14px; font-size: var(--t-sm); font-weight: 700; }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
:root[data-theme="dark"] .notice { background: #3a3210; color: #ffe58a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice { background: #3a3210; color: #ffe58a; } }

/* ---------- 会話 ---------- */
.talk { display: grid; gap: var(--s3); }
.talk-row { display: flex; align-items: flex-end; gap: 10px; }
.talk-row.right { flex-direction: row-reverse; }
.avatar { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; overflow: hidden; background: var(--zunda-tint); }
.avatar.metan { background: var(--metan-tint); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bubble { position: relative; background: var(--wash); border-radius: 18px; padding: 10px 14px; font-size: 0.95rem; line-height: 1.65; min-width: 0; }
.talk-row:not(.right) .bubble { border-bottom-left-radius: 6px; }
.talk-row.right .bubble { border-bottom-right-radius: 6px; background: var(--metan-tint); }
.talk-row:not(.right) .bubble { background: var(--zunda-tint); }
.bubble .who { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-3); }

/* ---------- ホーム：ヒーロー ---------- */
.hero { display: grid; gap: var(--s5); align-items: center; padding-block: var(--s2) var(--s4); }
.hero-copy { display: grid; gap: var(--s4); justify-items: start; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--wash); font-size: var(--t-sm); font-weight: 800; color: var(--ink-2); }
.hero-tag .dots { display: inline-flex; }
.hero-tag .dots span { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; border: 2px solid var(--paper); }
.hero-tag .dots span + span { margin-left: -8px; }
.hero-tag .dots img { width: 100%; height: 100%; object-fit: cover; }
.hero-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.1rem, 8.6vw, 3.6rem); line-height: 1.22; letter-spacing: 0.01em; }
.hero-title .z { color: var(--zunda-ink); }
.hero-title .m { color: var(--metan-ink); }
.hero-lead { color: var(--ink-2); max-width: 30em; font-size: 1.02rem; }

/* キャラの舞台 */
.stage { position: relative; height: 160px; border-radius: var(--r-big); overflow: hidden; background: var(--zunda-tint); isolation: isolate; }
.stage::before {
  content: ""; position: absolute; inset: auto -10% -46% -10%; height: 70%;
  background: var(--zunda); border-radius: 50%; z-index: -1; opacity: 0.55;
}
.stage::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: var(--metan-tint); z-index: -1;
}
.stage .chara { position: absolute; bottom: -38%; height: 125%; width: auto; filter: drop-shadow(0 6px 0 rgba(58, 46, 44, 0.08)); }
.stage .chara.z { left: 6%; animation: sway 5s ease-in-out infinite; transform-origin: bottom center; }
.stage .chara.m { right: 4%; animation: sway 5s ease-in-out -2.5s infinite; transform-origin: bottom center; }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(1.2deg) translateY(-4px); } }
.stage .say {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 2;
  background: var(--paper); border-radius: 14px; padding: 6px 12px; font-size: var(--t-sm); font-weight: 800; white-space: nowrap;
  box-shadow: 0 3px 0 var(--line);
}
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.1fr 1fr; gap: var(--s6); padding-block: var(--s5); }
  .stage { height: 440px; }
  .stage .chara { bottom: -6%; height: 100%; }
}

/* ---------- ホーム：いまの集計 ---------- */
.home-tally .sec-title { display: flex; align-items: center; gap: 8px; }
.home-tally .sec-title svg { width: 22px; height: 22px; color: var(--zunda-ink); flex-shrink: 0; }
#homeTally { display: grid; gap: var(--s4); justify-items: center; }
.ht-text { display: grid; gap: var(--s2); justify-items: start; min-width: 0; width: 100%; }
.ht-text .btn { white-space: nowrap; }
@media (min-width: 560px) {
  #homeTally { display: flex; gap: var(--s5); align-items: center; justify-content: space-between; }
}
.ht-total { font-weight: 800; }
.ht-total b { font-size: var(--t-2xl); color: var(--zunda-ink); margin: 0 2px; }
.mini-map { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(12, 1fr); gap: 2px; width: 180px; flex-shrink: 0; aspect-ratio: 1; }
.mini-map i { border-radius: 2px; background: var(--g, var(--line)); opacity: 0.85; }
.mini-map i.pending { background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, var(--paper) 2px 4px); }
@media (min-width: 760px) { .mini-map { width: 168px; } }

/* ---------- タイプの印（グループ色の丸＋4文字。TYPE_ART="image" なら丸の中に絵） ---------- */
.tmark {
  position: relative; width: var(--tm, 64px); height: var(--tm, 64px); flex-shrink: 0;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--g); color: var(--g-on);
}
.tmark .tm-code { font-family: var(--f-latin); font-weight: 700; font-size: calc(var(--tm, 64px) * 0.27); line-height: 1; letter-spacing: 0.02em; }
.tmark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--g-tint); }

.meter { height: 10px; border-radius: 999px; background: var(--wash-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--metan); }

/* ---------- 診断画面 ---------- */
.quiz-top { display: flex; align-items: center; gap: var(--s3); }
.quiz-back { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--r-ctl); background: var(--paper); border: var(--bw) solid var(--line); box-shadow: 0 3px 0 var(--line); }
.quiz-back:active { transform: translateY(3px); box-shadow: none; }
.quiz-back svg { width: 20px; height: 20px; }
.ticks { flex: 1; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.ticks i { height: 12px; border-radius: 4px; background: var(--wash-2); transition: background 0.25s; }
.ticks i.done { background: var(--zunda); }
.ticks i.now { background: var(--metan); }
.quiz-meta { display: flex; justify-content: space-between; font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); letter-spacing: 0.08em; margin-top: var(--s2); }
.quiz-meta .latin { font-weight: 600; }
.q-card { margin-top: var(--s5); padding: var(--s6) var(--s5); text-align: center; border-radius: var(--r-big); }
.q-card.enter { animation: qIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.q-card.enter-back { animation: qInBack 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes qIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes qInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.q-num { font-family: var(--f-latin); font-weight: 600; font-size: var(--t-sm); letter-spacing: 0.16em; color: var(--metan-ink); }
.q-text { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.3rem, 5.4vw, 1.75rem); line-height: 1.55; margin: var(--s3) auto var(--s6); max-width: 18em; min-height: 3.1em; display: flex; align-items: center; justify-content: center; }
.likert { display: flex; align-items: center; justify-content: space-between; gap: 6px; max-width: 440px; margin: 0 auto; }
.likert label { position: relative; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.likert input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.likert .dot {
  --c: var(--zunda); --c-deep: var(--zunda-deep);
  display: grid; place-items: center; border-radius: 50%;
  border: 3px solid var(--c); background: var(--paper);
  transition: transform 0.12s, background 0.15s, box-shadow 0.12s;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 35%, transparent);
}
.likert label:hover .dot { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 18%, var(--paper)); }
.likert input:checked + .dot { background: var(--c); box-shadow: 0 2px 0 var(--c-deep); transform: translateY(2px); }
.likert input:checked + .dot::after { content: ""; width: 30%; height: 30%; border-radius: 50%; background: var(--paper); }
.likert input:focus-visible + .dot { outline: 3px solid var(--focus); outline-offset: 3px; }
.likert .l2 .dot { width: 62px; height: 62px; }
.likert .l1 .dot { width: 50px; height: 50px; }
.likert .l0 .dot { width: 40px; height: 40px; --c: var(--line-strong); --c-deep: var(--ink-3); }
.likert .lm1 .dot { width: 50px; height: 50px; --c: var(--metan); --c-deep: var(--metan-deep); }
.likert .lm2 .dot { width: 62px; height: 62px; --c: var(--metan); --c-deep: var(--metan-deep); }
.likert-ends { display: flex; justify-content: space-between; max-width: 460px; margin: var(--s3) auto 0; font-size: var(--t-sm); font-weight: 800; }
.likert-ends .a { color: var(--zunda-ink); }
.likert-ends .d { color: var(--metan-ink); }
.quiz-guide { margin-top: var(--s5); }
.kbd-hint { margin-top: var(--s4); font-size: var(--t-xs); color: var(--ink-3); text-align: center; }
.kbd-hint kbd { font-family: var(--f-latin); border: 1.5px solid var(--line-strong); border-bottom-width: 3px; border-radius: 6px; padding: 0 5px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- 診断カード（結果） ---------- */
.dx-card { border-radius: var(--r-big); background: var(--g-tint); overflow: hidden; position: relative; }
.dx-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s5) 0; font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.12em; color: var(--ink-2); }
.dx-head .latin { font-weight: 600; letter-spacing: 0.18em; }
.dx-body { display: grid; grid-template-columns: 1fr; gap: var(--s2); padding: var(--s3) var(--s5) var(--s5); }
.dx-code { font-family: var(--f-latin); font-weight: 700; font-size: clamp(4rem, 21vw, 6.6rem); line-height: 0.95; letter-spacing: 0.02em; color: var(--g-ink); display: flex; }
.dx-code span { display: inline-block; animation: popIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.dx-code span:nth-child(2) { animation-delay: 0.07s; }
.dx-code span:nth-child(3) { animation-delay: 0.14s; }
.dx-code span:nth-child(4) { animation-delay: 0.21s; }
@keyframes popIn { from { transform: translateY(16px) scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
.dx-nick { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 6.4vw, 2rem); line-height: 1.3; }
.dx-catch { color: var(--ink-2); word-break: auto-phrase; }
.dx-tags { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* 指標メーター */
.axis-list { display: grid; gap: var(--s5); }
.axis-row .axis-title { font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); letter-spacing: 0.1em; margin-bottom: var(--s2); }
.axis-line { display: grid; grid-template-columns: 58px 1fr 58px; gap: var(--s3); align-items: center; }
.axis-side { font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); line-height: 1.2; }
.axis-side b { display: block; font-family: var(--f-latin); font-weight: 700; font-size: var(--t-xl); color: var(--ink-3); }
.axis-side.right { text-align: right; }
.axis-side.on { color: var(--ink); }
.axis-side.on b { color: var(--g-ink); }
.axis-track { position: relative; height: 16px; border-radius: 999px; background: var(--wash-2); overflow: hidden; }
.axis-track::after { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 2px; background: var(--paper); opacity: 0.8; }
.axis-fill { position: absolute; top: 0; bottom: 0; background: var(--g); border-radius: 999px; transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.axis-fill.from-left { left: 0; }
.axis-fill.from-right { right: 0; }
.axis-pct { text-align: center; font-size: var(--t-sm); font-weight: 800; margin-top: var(--s1); color: var(--g-ink); }

/* タブ（セグメント） */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--wash); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 800; font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--line); }

.info-grid { display: grid; gap: var(--s3); }
@media (min-width: 640px) { .info-grid.two { grid-template-columns: 1fr 1fr; } }
.disc-sm { width: 64px; height: 64px; border-radius: 50%; background: var(--g-tint); display: grid; place-items: center; flex-shrink: 0; }

/* ---------- 都道府県ランキング ---------- */
.map-wrap { position: relative; }
.jmap {
  container-type: inline-size;
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(12, 1fr);
  gap: 3px; aspect-ratio: 1; width: 100%; max-width: 100%;
}
.jtile {
  display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 6px;
  background: color-mix(in srgb, var(--g, var(--line-strong)) 38%, var(--paper));
  /* マスの幅に合わせて文字サイズを決める（2文字がちょうど収まる大きさ） */
  font-size: 3.1cqw; font-weight: 800; line-height: 1; color: var(--ink); text-align: center;
  white-space: nowrap; overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.jtile.long { font-size: 2.3cqw; }
.jtile.big { font-size: 5cqw; }
.jtile:hover, .jtile:focus-visible { transform: scale(1.35); z-index: 4; position: relative; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.jtile[aria-pressed="true"] { outline: 3px solid var(--metan); outline-offset: 1px; z-index: 3; position: relative; }
.jtile.mine { box-shadow: inset 0 0 0 2px var(--metan); }
.map-tip {
  position: absolute; z-index: 6; transform: translateX(-50%); pointer-events: none;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 8px 14px 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.map-tip[hidden] { display: none; }
.map-tip .tip-text { display: grid; line-height: 1.35; }
.map-tip .tip-text b { font-size: 1.1rem; }
.map-tip .tip-text span { font-size: 0.9rem; font-weight: 700; }
.map-hint { margin-top: var(--s2); }
@media (hover: none) { .map-hint { display: none; } }
.map-legend { display: grid; gap: 6px; font-size: var(--t-xs); font-weight: 700; margin-bottom: var(--s3); }
.map-legend h3 { font-family: var(--f-display); font-weight: 400; font-size: var(--t-md); line-height: 1.4; }
.legend-items { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.legend-items span { display: inline-flex; align-items: center; gap: 4px; }
.legend-items i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; background: color-mix(in srgb, var(--g, var(--line-strong)) 38%, var(--paper)); }
.rank-rows { display: grid; gap: var(--s2); }
.rank-row { display: grid; grid-template-columns: 26px 44px 1fr; gap: 10px; align-items: center; }
.rank-row .rn { font-family: var(--f-latin); font-weight: 700; text-align: center; color: var(--ink-3); }
.rank-row.top .rn { color: var(--metan-ink); }
.rank-row .disc-sm { width: 44px; height: 44px; font-size: 0.72rem; font-weight: 800; color: var(--ink); }
.rank-row .r-label { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-sm); font-weight: 800; }
.rank-row .r-label small { font-family: var(--f-latin); font-weight: 600; color: var(--ink-3); }
.rank-row .r-bar { height: 8px; border-radius: 999px; background: var(--wash-2); overflow: hidden; margin-top: 3px; }
.rank-row .r-bar span { display: block; height: 100%; background: var(--g); border-radius: 999px; }
.rank-row.mine .r-label { color: var(--metan-ink); }
.type-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.type-picker button { border: 0; border-radius: 10px; background: var(--g-tint); padding: 8px 2px; font-family: var(--f-latin); font-weight: 700; color: var(--g-ink); }
.type-picker button[aria-pressed="true"] { background: var(--g); color: var(--g-on); box-shadow: 0 3px 0 var(--g-deep); }

/* ---------- about ---------- */
.axis-explain { display: grid; gap: var(--s3); }
.axis-explain .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
.axis-explain .pole { background: var(--wash); border-radius: 14px; padding: 10px 12px; font-size: var(--t-sm); color: var(--ink-2); }
.axis-explain .pole b { display: block; font-size: var(--t-md); color: var(--ink); }
.axis-explain .pole b span { font-family: var(--f-latin); font-weight: 700; margin-right: 6px; }
.prose { display: grid; gap: var(--s3); }
.prose p { color: var(--ink-2); }
.nav-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.nav-duo figure { margin: 0; border-radius: var(--r-card); background: var(--zunda-tint); display: grid; justify-items: center; padding: var(--s4) var(--s3) 0; overflow: hidden; }
.nav-duo figure.metan { background: var(--metan-tint); }
.nav-duo img { height: 220px; width: auto; }
.nav-duo figcaption { padding-block: var(--s2); font-weight: 800; font-size: var(--t-sm); }

/* ---------- フッター ---------- */
.site-footer { max-width: 760px; margin: var(--s5) auto 0; padding: var(--s5) 16px var(--s6); border-top: 1px solid var(--line); text-align: center; font-size: var(--t-xs); color: var(--ink-3); }
.footer-links { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; margin-bottom: var(--s3); font-size: var(--t-sm); font-weight: 800; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-note { line-height: 1.7; margin-top: 6px; }
.footer-note a { color: var(--ink-2); }
.footer-copy { margin-top: var(--s3); font-weight: 800; letter-spacing: 0.1em; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); border-radius: 14px;
  padding: 10px 18px; font-weight: 800; font-size: var(--t-sm); white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 860px) { .toast { bottom: 28px; } }

/* ---------- 動きを減らす ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 追加：見出し・フォーム要素の調整 ---------- */
.sec-title { font-family: var(--f-display); font-weight: 400; font-size: var(--t-lg); line-height: 1.35; margin-bottom: var(--s3); }
legend.q-text { display: block; width: 100%; padding: 0; text-align: center; min-height: 3.1em; }

/* ---------- 県の集計に参加（入口・タイプ → 県 → 投票 → 投票後） ---------- */
.entry-btns { display: grid; gap: var(--s3); width: 100%; }
@media (min-width: 560px) { .entry-btns { display: flex; flex-wrap: wrap; width: auto; } }
.entry-note { font-size: var(--t-sm); color: var(--ink-3); font-weight: 700; }
.voted-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.voted-line svg { width: 20px; height: 20px; color: var(--zunda-ink); flex-shrink: 0; }
.voted-line b { color: var(--ink); }
.steps { display: flex; gap: var(--s2); counter-reset: none; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--wash); font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); white-space: nowrap; }
.steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-family: var(--f-latin); flex-shrink: 0; }
.steps li.now { background: var(--zunda-tint); color: var(--zunda-ink); }
.steps li.now b { background: var(--zunda); color: #173300; }
.steps li.done b { background: var(--zunda-ink); color: var(--paper); }
.vote-groups { display: grid; gap: var(--s4); }
@media (min-width: 760px) { .vote-groups { grid-template-columns: 1fr 1fr; } }
.vote-group h2 { font-family: var(--f-display); font-weight: 400; font-size: var(--t-md); color: var(--g-ink); margin-bottom: var(--s2); }
.vote-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.card.vote-type { position: relative; display: grid; justify-items: center; gap: 2px; padding: var(--s2) 4px var(--s3); background: var(--g-tint); border-color: transparent; text-align: center; }
.vote-type small { font-size: 0.72rem; font-weight: 800; line-height: 1.3; margin-top: 4px; }
.vote-type.marked { border-color: var(--metan); }
.vote-type .mine { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--metan); color: #3a0b2b; font-size: 0.62rem; padding: 1px 8px; white-space: nowrap; letter-spacing: 0; }
.vote-unsure { display: flex; gap: var(--s3); align-items: center; }
.card.chosen-type { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--g-tint); border-color: transparent; }
.chosen-type .code { font-weight: 700; font-size: var(--t-xl); color: var(--g-ink); line-height: 1.1; }
.chosen-type .nick { font-size: var(--t-sm); font-weight: 800; }
.chosen-type .btn { margin-left: auto; flex-shrink: 0; }
.pref-list { display: grid; gap: var(--s4); }
.pref-region h3 { font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: var(--s2); }
.pref-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (min-width: 640px) { .pref-btns { grid-template-columns: repeat(6, 1fr); } }
.pref-btn { min-height: 44px; padding: 4px 2px; border: var(--bw) solid var(--line); border-radius: var(--r-ctl); background: var(--paper); font-weight: 800; font-size: var(--t-sm); box-shadow: 0 3px 0 var(--line); -webkit-tap-highlight-color: transparent; }
.pref-btn:active { transform: translateY(3px); box-shadow: none; }
.pref-btn[aria-pressed="true"] { background: var(--zunda); border-color: var(--zunda); color: #173300; box-shadow: 0 3px 0 var(--zunda-deep); }
.pref-btn:disabled { opacity: 0.6; }
.vote-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-card);
  background: var(--paper); border: var(--bw) solid var(--zunda); box-shadow: 0 8px 24px rgba(58, 46, 44, 0.16);
}
@media (min-width: 860px) { .vote-bar { bottom: 16px; } }
.vote-bar-text { display: grid; font-weight: 700; color: var(--ink-2); text-align: center; }
.vote-bar-text b { font-size: var(--t-lg); color: var(--ink); }
.vote-bar-text .small { color: var(--ink-3); }
.vote-bar .btn { width: 100%; }
.join-card { background: var(--zunda-tint); border-color: transparent; display: grid; gap: var(--s3); }
.join-card .sec-title { margin-bottom: 0; }
.join-lead { color: var(--ink-2); }
.nth-card { display: grid; justify-items: center; gap: var(--s3); text-align: center; background: var(--g-tint); border-color: transparent; padding: var(--s6) var(--s5); }
.nth-text { display: grid; gap: 2px; }
.nth-lead { font-weight: 800; color: var(--ink-2); }
.nth-main { font-family: var(--f-display); font-size: var(--t-xl); line-height: 1.4; }
.nth-num { display: inline-block; margin: 0 4px; font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--g-ink); animation: popIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.nth-type { font-family: var(--f-display); font-size: var(--t-lg); }
.nth-type b { font-weight: 700; color: var(--g-ink); font-size: var(--t-2xl); }
.tally-pending { display: grid; gap: var(--s2); margin-top: var(--s2); }
.tp-big { font-family: var(--f-display); font-size: var(--t-xl); }
.tp-big b { font-size: var(--t-3xl); color: var(--metan-ink); margin: 0 4px; }
.jtile.pending { background: repeating-linear-gradient(135deg, var(--wash-2) 0 4px, var(--paper) 4px 8px); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend-items .pending i { background: repeating-linear-gradient(135deg, var(--wash-2) 0 3px, var(--paper) 3px 6px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.join-card .btn-lg { font-size: var(--t-md); }
.nth-type .nw { display: inline-block; white-space: nowrap; }
