/*
 * style.css — ねこ先生の地理クエスト
 * ゲームの画面のような、かわいい見た目。奥行きは影のぼかしでなく、太い線と下の厚み（ずらした面）で出す。
 */
:root {
  --ink: #3a2a25;
  --ink-soft: #6b5850;
  --paper: #fffaf0;
  --cream: #fff1d6;
  --sky1: #d6ecff;
  --sky2: #e4f3ff;
  --red: #e2463a;
  --star: #ffc93c;
  --gold: #ffcf4a;
  --mint: #7fd6b6;
  --kanto: #e2622f;
  --kanto-t: #ffe2d2;
  --tohoku: #23935c;
  --tohoku-t: #d6f3e2;
  --hokkaido: #3a6fd8;
  --hokkaido-t: #dce7ff;
  --c: var(--kanto);
  --ct: var(--kanto-t);
  --round: "M PLUS Rounded 1c", "Zen Maru Gothic", system-ui, sans-serif;
  --body: "Zen Maru Gothic", "M PLUS Rounded 1c", system-ui, sans-serif;
  color-scheme: light;
}
[data-stage="tohoku"] { --c: var(--tohoku); --ct: var(--tohoku-t); }
[data-stage="hokkaido"] { --c: var(--hokkaido); --ct: var(--hokkaido-t); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--body);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.75;
  background-color: var(--sky2);
  background-image: conic-gradient(var(--sky1) 25%, var(--sky2) 0 50%, var(--sky1) 0 75%, var(--sky2) 0);
  background-size: 56px 56px;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .round { font-family: var(--round); font-feature-settings: "palt"; }
ruby rt { font-size: 0.42em; font-weight: 700; letter-spacing: 0.04em; }

/* 共通のボタン：太い線＋下の厚み */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 20px 9px;
  font-family: var(--round);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { background: var(--gold); }
.btn-stage { background: var(--c); color: #fff; }
.btn-small { min-height: 40px; padding: 6px 14px 7px; font-size: 14px; }
.btn:focus-visible, .blank:focus-visible, .stage-card:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid var(--hokkaido);
  outline-offset: 3px;
}

/* ───────── タイトル ───────── */
.hero {
  position: relative;
  padding: 28px 16px 0;
  overflow: hidden;
}
.hero-in {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 8px 20px;
}
.hero-cat { width: 168px; align-self: end; }
.hero-cat svg { display: block; width: 100%; height: auto; }
.hero-text { padding-bottom: 22px; }
.hero-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 12px 3px;
  font-family: var(--round);
  font-weight: 800;
  font-size: 13px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
}
.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: var(--paper);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}
.hero h1 .accent { color: var(--gold); }
.hero-sub { margin: 10px 0 16px; font-family: var(--round); font-weight: 800; font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hud {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 6px 16px;
  font-family: var(--round);
  font-weight: 800;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.hud svg { width: 22px; height: 22px; }
.hud b { font-size: 20px; }
.hud .cnt { font-variant-numeric: tabular-nums; }
.ground {
  position: relative;
  height: 26px;
  margin: 0 -16px;
  background: #9bd36b;
  border-top: 3px solid var(--ink);
}

/* ───────── ステージ選択 ───────── */
.stages {
  background: #9bd36b;
  padding: 8px 16px 28px;
  border-bottom: 3px solid var(--ink);
}
.stages-in {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stage-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px 14px;
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.stage-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.stage-badge {
  grid-row: 1 / 4;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--c);
  border: 3px solid var(--ink);
}
.stage-badge svg { width: 40px; height: 40px; }
.stage-no { font-family: var(--round); font-weight: 900; font-size: 12px; letter-spacing: 0.12em; color: var(--c); }
.stage-name { font-family: var(--round); font-weight: 900; font-size: 20px; line-height: 1.25; }
.stage-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.bar {
  flex: 1;
  height: 12px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
}
.bar i { display: block; height: 100%; width: 0; background: var(--star); border-right: 2.5px solid var(--ink); transition: width 0.4s; }
.bar i[style*="width: 0"] { border-right: 0; }

/* ───────── 道具バー（上に固定） ───────── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.toolbar-in {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.tabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.tab {
  flex: 1;
  min-height: 40px;
  padding: 4px 6px;
  font-family: var(--round);
  font-weight: 800;
  font-size: 14px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--ct);
  color: var(--ink);
  text-decoration: none;
  display: grid;
  place-items: center;
  line-height: 1.2;
}
.tab.is-on { background: var(--c); color: #fff; }
.toggle-all { flex: none; }

/* ───────── ステージ本文 ───────── */
main { padding: 8px 16px 40px; }
.stage { max-width: 960px; margin: 28px auto 0; }
.stage-banner {
  position: relative;
  padding: 14px 18px 16px;
  color: #fff;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink);
}
.stage-banner .stage-no { color: #fff; opacity: 0.92; font-size: 13px; }
.stage-banner h2 { margin: 2px 0 2px; font-size: clamp(24px, 5vw, 32px); font-weight: 900; line-height: 1.25; }
.stage-banner p { margin: 0; font-weight: 700; font-size: 14px; line-height: 1.5; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.4;
}
.section-title .sno {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
}
.lead {
  margin: -4px 0 14px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--paper);
  border: 2.5px dashed var(--ink-soft);
  border-radius: 14px;
}
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* 問題カード */
.qcard {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  overflow: hidden;
}
.qcard-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0 14px;
}
.qnum {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  font-family: var(--round);
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 12px;
  line-height: 1;
}
.zone {
  font-family: var(--round);
  font-weight: 800;
  font-size: 13px;
  padding: 2px 10px 3px;
  background: var(--ct);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.star-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 4px 12px 4px 8px;
  font-family: var(--round);
  font-weight: 800;
  font-size: 13px;
  background: transparent;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
}
.star-btn svg { width: 22px; height: 22px; }
.star-btn svg path { fill: var(--paper); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.star-btn[aria-pressed="true"] { background: var(--cream); }
.star-btn[aria-pressed="true"] svg path { fill: var(--star); }
.star-btn.pop svg { animation: starpop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes starpop { 0% { transform: scale(0.6) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }

.qtext { margin: 10px 14px 12px; font-size: 16px; line-height: 2.05; }
.blank {
  display: inline-block;
  min-width: 5.2em;
  margin: 0 2px;
  padding: 0 10px;
  line-height: 1.7;
  font-family: var(--round);
  font-weight: 900;
  font-size: 16px;
  text-align: center;
  vertical-align: baseline;
  background: var(--cream);
  border: 2.5px dashed var(--ink);
  border-radius: 10px;
}
.blank .a { display: none; color: var(--red); }
.blank .q { color: var(--ink-soft); letter-spacing: 0.1em; }
.blank[aria-expanded="true"] { background: #fff; border-style: solid; border-color: var(--red); }
.blank[aria-expanded="true"] .a { display: inline; }
.blank[aria-expanded="true"] .q { display: none; }

.qbody { padding: 0 14px 4px; }
.qbody[hidden] { display: none; }
.answer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 10px;
  padding: 10px 14px 8px;
  background: var(--ct);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
}
.answer .label { font-family: var(--round); font-weight: 800; font-size: 13px; }
.answer .word { font-family: var(--round); font-weight: 900; font-size: 28px; line-height: 1.5; color: var(--red); }
.answer .also { font-weight: 700; font-size: 15px; }
.points { margin: 0; display: grid; gap: 8px; }
.points > div { display: grid; grid-template-columns: 5.6em 1fr; gap: 8px; align-items: start; }
.points dt {
  font-family: var(--round);
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  padding: 3px 4px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  margin-top: 2px;
}
.points dd { margin: 0; font-size: 15.5px; line-height: 1.75; }
.points .k-note dt { background: #ffe9a8; }
.tiles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.tile {
  display: grid;
  justify-items: center;
  min-width: 64px;
  padding: 6px 8px 5px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
}
.tile b { font-family: var(--round); font-weight: 900; font-size: 26px; line-height: 1.2; }
.tile small { font-size: 11.5px; font-weight: 700; line-height: 1.3; text-align: center; }
.qcard-foot { padding: 12px 14px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qcard-foot .btn { flex: 1; }
.dur { font-size: 13px; font-weight: 700; opacity: 0.8; }

.credit {
  max-width: 960px;
  margin: 40px auto 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

/* ───────── 解説シーン（動画のように再生） ───────── */
.scene {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background-color: var(--ct);
  background-image: radial-gradient(color-mix(in srgb, var(--c) 18%, transparent) 2.4px, transparent 2.6px);
  background-size: 22px 22px;
}
.scene[hidden] { display: none; }
.scene-frame {
  width: min(980px, 100%);
  height: min(calc(100vh - 20px), 760px);
  height: min(calc(100dvh - 20px), 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
}
.scene-top { display: flex; align-items: center; gap: 8px; }
.scene-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 14px;
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.scene-pill.light { color: var(--ink); background: var(--paper); }
.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.scene-close { margin-left: auto; }

.board {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--ink);
  overflow: hidden;
}
.board-answer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 10px 14px 6px;
  text-align: center;
}
.board-answer .word {
  font-family: var(--round);
  font-weight: 900;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.3;
  color: var(--red);
}
.board-answer .also { font-family: var(--round); font-weight: 800; font-size: 16px; }
.board-answer .q-mark {
  font-family: var(--round);
  font-weight: 900;
  font-size: clamp(26px, 6vw, 36px);
  padding: 0 22px;
  color: var(--ink-soft);
  background: var(--cream);
  border: 3px dashed var(--ink);
  border-radius: 14px;
}
.board-answer.pop .word { animation: pop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.board-mid { position: relative; min-height: 0; display: grid; }
.board-fig { position: relative; min-height: 0; padding: 4px 10px 8px; display: grid; place-items: center; }
.board-q {
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 14.5px;
  line-height: 1.8;
  border-top: 2.5px dashed #e6dccd;
}
.board-q .fill { color: var(--red); font-family: var(--round); font-weight: 900; }
.board-q .qn { font-family: var(--round); font-weight: 900; margin-right: 4px; }
.board-fig > svg { width: 100%; height: 100%; max-height: 100%; display: block; }
.board-chip {
  position: absolute;
  left: 12px;
  top: 0;
  padding: 2px 12px 3px;
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.board-chip.on { opacity: 1; transform: none; }
.board-tiles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.board-tiles .tile { opacity: 0; transform: translateY(16px) scale(0.8); transition: opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.board-tiles.on .tile { opacity: 1; transform: none; }
.board-tiles.on .tile:nth-child(2) { transition-delay: 0.12s; }
.board-tiles.on .tile:nth-child(3) { transition-delay: 0.24s; }
.board-tiles.on .tile:nth-child(4) { transition-delay: 0.36s; }

.talk {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px;
}
.talk-cat { width: 112px; margin-bottom: -4px; position: relative; z-index: 1; }
.talk-cat svg { display: block; width: 100%; height: auto; }
.talk-box {
  position: relative;
  min-height: 128px;
  padding: 22px 18px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
}
.talk-name {
  position: absolute;
  top: -15px;
  left: 16px;
  padding: 1px 14px 2px;
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  color: var(--ink);
  background: var(--mint);
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.talk-text { margin: 0; min-height: 3.6em; font-family: var(--round); font-weight: 800; font-size: clamp(16px, 3.6vw, 20px); line-height: 1.75; }
.talk-text .rest { color: transparent; }
.talk-next {
  position: absolute;
  right: 16px;
  bottom: 8px;
  width: 14px;
  height: 10px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: nudge 0.9s ease-in-out infinite;
  opacity: 0;
}
.talk-next.on { opacity: 1; }
@keyframes nudge { 50% { transform: translateY(4px); } }

.ctrl {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.ctrl .main {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: var(--gold);
}
.ctrl .main svg { width: 26px; height: 26px; }
.seek { display: flex; gap: 4px; align-items: center; min-width: 0; height: 48px; }
.seek button {
  flex: var(--w, 1) 1 0;
  min-width: 10px;
  height: 18px;
  padding: 0;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.seek button i { position: absolute; inset: 0; width: 0; background: var(--c); }
.time { font-family: var(--round); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }

.scene-end {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  text-align: center;
}
.scene-end[hidden] { display: none; }
.scene-end h3 { margin: 0; font-size: 24px; font-weight: 900; }
.scene-end .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.scene-end .burst svg { width: 64px; height: 64px; }
.scene-end .burst svg path { fill: var(--star); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.scene-end.got .burst svg { animation: starpop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* ───────── 猫（オリジナルのキャラクター） ───────── */
.cat .c-fur { fill: #f7e6cf; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.cat .c-belly { fill: #fff6ea; }
.cat .c-ear-in { fill: #f4b9ae; }
.cat .c-stripe { fill: none; stroke: #d9a877; stroke-width: 3.2; stroke-linecap: round; }
.cat .c-cheek { fill: #f6a9a0; opacity: 0.6; }
.cat .c-eye { fill: var(--ink); }
.cat .c-shine { fill: #fff; }
.cat .c-nose { fill: #e58c80; }
.cat .c-mouth { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.cat .c-mouth-open { fill: #b5564a; stroke: var(--ink); stroke-width: 1.6; opacity: 0; transform-box: fill-box; transform-origin: center top; }
.cat .c-whisker { stroke: #8c6b55; stroke-width: 1.6; stroke-linecap: round; }
.cat .c-scarf { fill: var(--mint); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.cat .c-tail { fill: none; stroke: var(--ink); stroke-width: 13; stroke-linecap: round; }
.cat .c-tail-in { fill: none; stroke: #edd2ae; stroke-width: 8; stroke-linecap: round; }
.cat .c-arm-line { fill: none; stroke: var(--ink); stroke-width: 13; stroke-linecap: round; }
.cat .c-arm-in { fill: none; stroke: #f7e6cf; stroke-width: 8; stroke-linecap: round; }
.cat .c-pointer { stroke: #8b6a4a; stroke-width: 3.4; stroke-linecap: round; }
.cat .c-pointer-tip { fill: var(--red); }
.cat .c-body { transform-box: view-box; transform-origin: 60px 132px; animation: bob 2.4s ease-in-out infinite; }
.cat .c-tailg { transform-box: view-box; transform-origin: 86px 120px; animation: tail 2.8s ease-in-out infinite; }
.cat .c-head { transform-box: view-box; transform-origin: 60px 94px; }
.cat .c-head.nod { animation: nod 0.7s ease-out; }
.cat .c-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.cat .c-ear-r { transform-box: view-box; transform-origin: 84px 40px; animation: twitch 6s infinite; }
.cat .c-arm { opacity: 0; transform-box: view-box; transform-origin: 80px 104px; transform: rotate(30deg); transition: opacity 0.2s, transform 0.3s; }
.cat.is-pointing .c-arm { opacity: 1; transform: rotate(0); }
.cat.is-pointing .c-paw-right { opacity: 0; }
.cat.is-talking .c-mouth-open { opacity: 1; animation: talk 0.28s ease-in-out infinite; }
.cat.is-talking .c-mouth { opacity: 0.3; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(1.01, 0.99); } }
@keyframes tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes nod { 0% { transform: rotate(0); } 35% { transform: rotate(-5deg) translateY(2px); } 100% { transform: rotate(0); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes twitch { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(9deg); } 94% { transform: rotate(-3deg); } }
@keyframes talk { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* ───────── 図 ───────── */
.fig { font-family: var(--round); font-weight: 800; }
.fig text { fill: var(--ink); font-size: 12px; }
.fig .t-big { font-size: 15px; font-weight: 900; }
.fig .t-s { font-size: 10.5px; }
.fig .t-w { fill: #fff; }
.fig .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fig .o { stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.fig .pill { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.fig [data-k] { transition: opacity 0.35s; }
.fig .dim { opacity: 0.25; }
.fig .hl .pill { fill: #ffe46b; }
.fig [data-from], .fig [data-only] { transition: opacity 0.4s, transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
.fig [data-from]:not(.on) { opacity: 0; transform: translateY(6px); }
.fig [data-only]:not(.on) { display: none; }
.fig .flow { stroke-dasharray: 7 7; animation: flow 1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -14; } }
.fig .flow-r { stroke-dasharray: 7 7; animation: flow 1s linear infinite reverse; }
.fig .drive { animation: drive 3.2s ease-in-out infinite; }
@keyframes drive { 0% { transform: translateX(0); } 50% { transform: translateX(-86px); } 50.01% { transform: translateX(0); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateX(-86px); } }
.fig .fall { animation: fall 1.6s linear infinite; }
@keyframes fall { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }
.fig .float { animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-3px); } }
.fig .spin { transform-box: fill-box; transform-origin: center; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fig .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ───────── 画面幅ごと ───────── */
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .stages-in { grid-template-columns: 1fr; gap: 10px; }
  .stage-card { padding: 10px 12px 12px; }
  .stage-badge { width: 50px; height: 50px; border-radius: 14px; }
  .stage-badge svg { width: 34px; height: 34px; }
}
@media (max-width: 520px) {
  .hero { padding-top: 20px; }
  .hero-in { grid-template-columns: 112px 1fr; gap: 4px 10px; }
  .hero-cat { width: 112px; }
  .hero-text { padding-bottom: 14px; }
  .hero-kicker { font-size: 11.5px; padding: 1px 10px 2px; }
  .hero-sub { font-size: 13px; margin: 6px 0 0; }
  .hero-actions { grid-column: 1 / -1; padding-bottom: 18px; }
  .hero-actions .btn { flex: 1; }
  .toolbar-in { padding: 8px 10px; gap: 6px; }
  .tab { font-size: 13px; min-height: 40px; }
  .toggle-all { padding: 6px 10px 7px; font-size: 13px; }
  .talk-cat { width: 84px; }
  .talk-box { min-height: 118px; padding: 20px 14px 12px; }
  .ctrl { gap: 6px; grid-template-columns: auto auto auto 1fr; }
  .ctrl .time { display: none; }
  .ctrl .main { width: 54px; height: 54px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 14px; }
  .points > div { grid-template-columns: 1fr; gap: 2px; }
  .points dt { justify-self: start; padding: 1px 10px; }
}
@media (max-height: 640px) {
  .board-q { display: none; }
}
@media (min-width: 900px) and (min-height: 700px) {
  .talk-cat { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .cat .c-body, .cat .c-tailg, .cat .c-ear-r, .fig .flow, .fig .flow-r, .fig .drive, .fig .fall, .fig .float, .fig .spin, .fig .pulse { animation: none; }
}
