/* 今昔よそう: 遊ぶ画面
 *
 * 色は site-src/lib/tokens.js と同じ値(このページは /konjaku/ の下で単独で動くので、ここに写す)。
 * 書体は端末のもの(外から読み込まない)。スマートフォンの縦向きが基本。
 * 縦の並び:写真(残りいっぱい、最低 40%。右上に進み具合・一覧・送る)→ 下の欄。ページ自体は動かない。
 * 答える前の欄は中身のぶんの高さ(めくらせない)。答えたあとの欄は全体が1つのかたまりとしてめくれる(どこも固定しない)。
 */

:root {
  --bg: #0a1715;
  --bar: #060f0e;
  --text: #fffaf0;
  --text-sub: #b9d1c6;
  --accent: #e2b540;
  --ink: #0a1b19;
  --play: #437742;
  --get: #c8414d;
  --on-button: #ffffff;
  --line: rgba(255, 250, 240, 0.14); /* 文字の色を薄めたもの(サイトと同じ割合) */
  --line-strong: rgba(255, 250, 240, 0.28);
  --surface: #192522;
  --photo-bg: #1b2624;
  --veil: rgba(6, 15, 14, 0.78); /* 写真の上の札の下地 */

  --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-head: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;

  --tap: 44px;
  --radius: 12px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --gutter-l: max(16px, var(--safe-l));
  --gutter-r: max(16px, var(--safe-r));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bar);
}
body {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* ボタンの二度押しでページが拡大しない */
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 枠 ── */
.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── 写真 ── */
.map {
  position: relative;
  /* 残りを全部写真に(最低 40%)。欄は中身のぶん(答える前)。
     欄の高さは min(60%, 340px) の1つの値。答える前も後も同じなので写真は変わらない */
  flex: 1 1 0;
  min-height: 40%;
  overflow: hidden;
  background: var(--photo-bg);
  touch-action: none; /* 写真の上だけ、指の動きをこちらで受ける */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.map:active { cursor: grabbing; }
.stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
/* 写真は1枚ずつ別の層にする。箱の大きさと transform は viewer.js の place が付ける
   (箱を大きくしない。iPhone で層の絵が大きくなりすぎて、ページが落ちるのを防ぐ) */
.stage img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* 次の問題の写真は、そろってから1回で出す(囲みの #marks も同じ)。隠すのはすぐ、戻すときだけゆっくり */
.stage, #marks { transition: opacity 0.18s ease; }
.stage.is-loading, #marks.is-loading { opacity: 0; transition: none; }
.stage img[hidden] { display: none; }

#marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
#marks .under { fill: none; stroke: rgba(10, 27, 25, 0.6); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
#marks .area, #marks .ln, #marks .dot { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
#marks .area { fill: rgba(226, 181, 64, 0.08); stroke-dasharray: 2 9; }
#marks .ln { fill: none; stroke-dasharray: 2 10; }
#marks .dot { fill: rgba(226, 181, 64, 0.14); }
#marks .badge { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
#marks text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
}
#marks .off { opacity: 0.35; }
#marks .mine .area, #marks .mine .ln, #marks .mine .dot { stroke: var(--get); }
#marks .mine .badge { fill: var(--get); }
#marks .mine text { fill: var(--on-button); }

.stamp {
  position: absolute;
  left: max(12px, var(--safe-l));
  top: calc(var(--safe-t) + 10px);
  max-width: calc(100% - 24px - 190px); /* 右上の札のぶんをあける */
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  line-height: 1.15;
  pointer-events: none;
}
.stamp b {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.stamp b.long { font-size: 21px; }
.stamp span { margin-left: 4px; font-size: 13px; font-weight: 600; }

.loading {
  position: absolute;
  left: max(12px, var(--safe-l));
  top: calc(var(--safe-t) + 52px); /* 時代の札の下 */
  max-width: calc(100% - 24px);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--veil);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none;
}

.photo-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(300px, calc(100% - 32px));
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(6, 15, 14, 0.9);
  text-align: center;
}
.photo-error p { margin: 0 0 12px; }

.credit {
  position: absolute;
  right: max(8px, var(--safe-r));
  bottom: 6px;
  max-width: calc(100% - 16px - var(--safe-l) - var(--safe-r));
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--veil);
  color: #ffffff;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 2行まで */
  overflow: hidden;
  pointer-events: none;
}
.credit:empty { display: none; }

/* 写真の右上の小さな札 */
.tools {
  position: absolute;
  top: calc(var(--safe-t) + 8px);
  right: max(8px, var(--safe-r));
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--veil);
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
}
.progress { padding: 0 10px 0 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tools button {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 700;
}
.tools button:active { filter: brightness(1.25); }
.toast {
  position: absolute;
  right: max(8px, var(--safe-r));
  top: calc(var(--safe-t) + 52px);
  max-width: calc(100% - 16px);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--veil);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none;
}
/* 写真の動かしかた(触ったら消える) */
.touch-hint {
  position: absolute;
  left: 50%;
  bottom: 48px; /* クレジット(2行で上端が下から約38px)から 8px 以上あける */
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--veil);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}
/* 答えたあとのスライダー:写真の下のはし。クレジット(下の細い帯、2行まで)の上 */
.mixrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 20px));
  bottom: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--veil);
  color: #ffffff;
}
.mixrow span { font-family: var(--font-head); font-size: 17px; font-weight: 800; }
.mixrow input { width: 100%; height: var(--tap); margin: 0; accent-color: var(--accent); }

/* ── 下の欄 ── */
.card {
  flex: 0 0 auto; /* 狭い画面:欄の高さは答える前も後も同じ(写真の大きさが変わらない)。写真は最低 40% */
  height: min(60%, 340px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px var(--gutter-r) max(16px, var(--safe-b)) var(--gutter-l);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.card > * { flex: none; margin: 0; }
.card p { margin: 0; }
.soft { color: var(--text-sub); }

.pref { color: var(--text-sub); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: -8px; }
.text { font-size: 17px; }
/* 答える前:県名・問題文は上、選択肢は欄の下にそろえる(欄の高さは答えたあとと同じなので、あいだが空く) */
.card > .opts { margin-top: auto; }

.btn, .opts button, .photo-error button {
  min-height: var(--tap);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 0.08s, filter 0.08s;
}
.btn:active:not(:disabled), .opts button:active:not(:disabled), .photo-error button:active { transform: scale(0.98); filter: brightness(1.12); }
.primary, .opts button, .photo-error button { background: var(--play); color: var(--on-button); }
.primary { width: 100%; min-height: 50px; font-size: 17px; }
.photo-error button { padding: 0 20px; font-size: 16px; }

.opts { display: flex; gap: 6px; }
/* 言葉の選択肢:2列×2段(段の高さはそろう)。右の欄(広い画面)では1列 */
.opts.words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.words button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}
.opts .k {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
}
.opts.keys button { flex: 1 1 0; min-height: 48px; font-size: 20px; }
.opts button:disabled { filter: saturate(0.6); opacity: 0.75; cursor: default; }

/* 答え合わせ */
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.verdict .was { flex-basis: 100%; color: var(--text-sub); font-size: 14px; }
.verdict .badge {
  padding: 2px 14px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
}
.verdict.ok .badge { background: var(--accent); color: var(--ink); }
.verdict.ng .badge { background: var(--get); color: var(--on-button); }
.verdict .ans { font-size: 18px; font-weight: 700; line-height: 1.4; }
.verdict .yours { flex-basis: 100%; color: var(--text-sub); font-size: 15px; }

.label { display: block; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }

.ground img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.ground img:not(.sized) { aspect-ratio: 3 / 2; object-fit: contain; }
.ground figcaption { margin-top: 6px; font-size: 15px; line-height: 1.55; }
.ground small { display: block; margin-top: 2px; color: var(--text-sub); font-size: 12px; }

.crowd { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); }
.crowd h3 { margin: 0 0 6px; color: var(--accent); font-size: 14px; letter-spacing: 0.08em; }
.crowd ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.crowd .row {
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr) auto;
  grid-template-areas: "k lb pct" "bar bar bar";
  align-items: baseline;
  column-gap: 8px;
  row-gap: 3px;
}
.crowd .k { grid-area: k; font-weight: 700; }
.crowd .lb { grid-area: lb; min-width: 0; }
.crowd .pct { grid-area: pct; font-variant-numeric: tabular-nums; font-weight: 700; }
.crowd .bar { grid-area: bar; display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.crowd .bar i { display: block; height: 100%; border-radius: 4px; background: var(--text-sub); }
.crowd .is-answer .bar i { background: var(--accent); }
.crowd .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 1px;
}
.crowd .tag.ans { background: var(--accent); color: var(--ink); }
.crowd .tag.me { border: 1px solid var(--line-strong); color: var(--text); }
.crowd .sum { margin-top: 8px; color: var(--text-sub); font-size: 14px; }

.actions { display: flex; align-items: stretch; gap: 8px; }
.actions .wow { flex: none; }
.actions .next { flex: 1 1 0; width: auto; }
.btn.next { min-height: var(--tap); font-size: 16px; }
.sources ul { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.sources a { color: var(--text-sub); font-size: 13px; overflow-wrap: anywhere; }
.wow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  white-space: nowrap;
}
.wow .n { color: var(--accent); font-variant-numeric: tabular-nums; }
.wow:disabled { cursor: default; opacity: 0.55; }
.wow.is-on, .wow.is-on:disabled { opacity: 1; border-color: var(--accent); background: rgba(226, 181, 64, 0.16); color: var(--accent); }

.error .lead { font-size: 18px; font-weight: 700; }
.empty { padding: 24px 0; font-size: 18px; text-align: center; }

/* 問題が無いとき・読み込めないとき:写真の場所は出さない */
.app.is-bare .map { display: none; }
/* 真ん中寄せは justify-content ではなく auto の余白で(中身が欄より高いとき、justify-content: center は上にはみ出して、めくっても戻せない)。
   欄の直下の最初の子の上と、最後の子の下だけを auto にする。少なければ真ん中、多ければ余白が 0 になって上から並ぶ。
   一覧・結果(.list / .result は margin: auto を持つ)、読み込み中の文、失敗の .error と「もう一度」、空の表示、起動の失敗の札が、これで置かれる */
.app.is-bare .card { flex: 1 1 auto; height: auto; max-height: none; }
.app.is-bare .card > :first-child { margin-top: auto; }
.app.is-bare .card > :last-child { margin-bottom: auto; }


/* 一覧:縦にめくれる。いちばん上に大きな写真。札は幅 900px 未満は2列、それ以上は3列。中身が少ないときだけ真ん中にそろえる(auto の余白なので、はみ出しても上が切れない) */
.card > .list { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 960px; margin: auto; }
.list > * { margin: 0; }
.list h2 { margin: 0 0 8px; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: 0.08em; }
/* いちばん上の大きな写真。題と「はじめる」を写真の下の端に重ねる */
.hero { position: relative; display: flex; align-items: flex-end; min-height: 300px; border-radius: var(--radius); overflow: hidden; background: var(--photo-bg); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-text { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 56px 14px 14px; background: linear-gradient(to top, rgba(8, 14, 13, 0.9) 0%, rgba(8, 14, 13, 0.6) 50%, rgba(8, 14, 13, 0) 100%); }
.hero.is-plain { min-height: 0; }
.hero.is-plain .hero-text { padding-top: 14px; background: none; }
.hero h1 .logo { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.hero h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.hero .lead { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.hero #resume { min-height: 56px; margin-top: 6px; }
/* 札:上に写真(4枚まで)、下に名前と進み具合。スマホは2列 */
.list .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.set-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: transform 0.08s, filter 0.08s;
}
.set-card:active { transform: scale(0.98); filter: brightness(1.12); }
.set-card .mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: 100%; aspect-ratio: 2 / 1; background: var(--photo-bg); }
.set-card .mosaic.n1 { grid-template-columns: minmax(0, 1fr); }
.set-card .mosaic.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); aspect-ratio: 4 / 1; }
.set-card .mosaic.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); aspect-ratio: 3 / 1; }
.set-card .thumb { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--photo-bg); }
.set-card .body { display: flex; flex-direction: column; min-width: 0; padding: 8px 12px 10px; }
.set-card .name { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.set-card .state { color: var(--text-sub); font-size: 14px; line-height: 1.4; }
.set-card .state.is-done { color: var(--accent); }
.list .site-back { align-self: flex-start; min-height: var(--tap); margin: -8px 0 -6px; display: inline-flex; align-items: center; gap: 4px; color: var(--text-sub); font-size: 14px; font-weight: 700; text-decoration: none; }
.list .site-back:hover { color: var(--text); }
.list .credits { align-self: flex-start; min-height: var(--tap); display: inline-flex; align-items: center; color: var(--text-sub); font-size: 14px; }
@media (min-width: 900px) {
  .list .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { min-height: 340px; }
  .hero-text { padding: 96px 24px 22px; }
  .hero h1 { font-size: 40px; }
  .hero #resume { align-self: flex-start; width: auto; min-width: 320px; }
}

/* 結果:縦にめくれる。幅 900px 未満は1列、それ以上は行を2列に */
.card > .result { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 960px; margin: auto; }
.result > * { margin: 0; }
.result h2 { font-family: var(--font-head); font-size: 20px; font-weight: 800; line-height: 1.35; }
.result .score { font-family: var(--font-head); font-size: 28px; font-weight: 800; line-height: 1.3; color: var(--accent); }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: transform 0.08s, filter 0.08s;
}
.result-row:active { transform: scale(0.98); filter: brightness(1.12); }
.result-row::before { content: attr(data-n) "."; flex: none; min-width: 1.6em; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.result-row .thumb { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--photo-bg); }
.result-row .title { flex: 1 1 auto; min-width: 0; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.result-row .mark { flex: none; font-weight: 700; color: var(--text-sub); }
.result-row .mark.ok { color: var(--accent); }
.result-actions { display: flex; flex-direction: column; gap: 8px; }
.result-actions .btn { width: 100%; min-height: 56px; }
.result h2:focus { outline: none; }
@media (min-width: 480px) {
  .result-actions { flex-direction: row; }
  .result-actions .btn { flex: 1 1 0; }
}
@media (min-width: 900px) {
  .result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.noscript { position: fixed; inset: 0; z-index: 10; margin: 0; padding: 24px 16px; color: var(--text); background: var(--bg); }

/* 横向きの電話と広い画面:写真を左(高さいっぱい)、欄を右 */
@media (min-width: 900px), (orientation: landscape) and (max-height: 540px) {
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 32vw, 440px);
    grid-template-rows: minmax(0, 1fr);
  }
  .map { height: auto; min-height: 0; }
  .credit { bottom: max(6px, var(--safe-b)); } /* 横向きでは写真が画面の下のはしまで届く */
  .mixrow { bottom: calc(max(6px, var(--safe-b)) + 40px); }
  .touch-hint { bottom: calc(max(6px, var(--safe-b)) + 42px); }
  .card { flex: 1 1 auto; height: auto; max-height: none; border-top: none; border-left: 1px solid var(--line); }
  .card > .opts { margin-top: 0; }
  .opts.words { grid-template-columns: minmax(0, 1fr); } /* 右の欄では縦に4つ */
  .opts.words button { font-size: 16px; }
  .app.is-bare { display: flex; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(280px, 44%); }
}

/* 幅が狭いとき:みんなの予想は2列×2段のこぢんまりした形 */
@media (max-width: 899px) {
  .crowd { padding: 8px 10px; }
  .crowd h3 { margin: 0 0 4px; font-size: 12px; line-height: 1.4; }
  .crowd ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  .crowd .row { font-size: 13px; line-height: 1.4; column-gap: 6px; row-gap: 2px; grid-template-columns: 1.1em minmax(0, 1fr) auto; }
  .crowd .bar { height: 5px; }
  .crowd .tag { margin-left: 3px; padding: 0 5px; font-size: 10px; }
  .crowd .sum { margin-top: 6px; font-size: 12px; line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .opts button, .photo-error button, .set-card, .result-row, .stage, #marks { transition: none; }
}

/* 出典・クレジットのページ(credits.html)。ここだけの決まり。遊ぶ画面・一覧には効かない。
 * 遊ぶ画面は body を動かさないが、このページは body 自体が縦にめくれる(.app は使わない) */
body.credits-page {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}
.credits-page .credits-main {
  max-width: 40em;
  margin: 0 auto;
  padding: max(24px, var(--safe-t)) var(--gutter-r) max(40px, var(--safe-b)) var(--gutter-l);
}
.credits-page h1 { margin: 8px 0 24px; font-family: var(--font-head); font-size: 26px; line-height: 1.4; }
.credits-page h2 { margin: 32px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); font-family: var(--font-head); font-size: 19px; line-height: 1.5; }
.credits-page h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.5; }
.credits-page p { margin: 0 0 12px; }
.credits-page a { color: var(--accent); }
.credits-page .credits-back { margin: 0; }
.credits-page .credits-back a { display: inline-flex; align-items: center; min-height: var(--tap); }
.credits-page .credits-item { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.credits-page dl { margin: 0; }
.credits-page dt { margin: 8px 0 0; color: var(--text-sub); font-size: 13px; }
.credits-page dt:first-child { margin-top: 0; }
.credits-page dd { margin: 0; overflow-wrap: anywhere; }
