/* お題ごとの公開ページ用(2026-08-24)。アプリ本体(style.css)とは別ファイルにしている。
   このページはService Workerのキャッシュ対象外の素のHTMLで、アプリのSPAとは
   独立して検索エンジンとAdSenseに読ませるためのもの。配色トークンは本体と揃える。 */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1f1f24;
  --text-muted: #6b6b76;
  --accent: #5b5bd6;
  --accent-soft: #eeedfb;
  --border: #e4e2dd;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* 以下はアプリ本体(style.css)の body に入っているのに、このファイルだけ抜けていた
     設定(2026-09-01)。アプリから「今日のお題」を開くと、ここで挙動が変わっていた。 */
  /* タップしたときの青い枠を消す(Webサイトらしさの代表格) */
  -webkit-tap-highlight-color: transparent;
  /* 端まで引いたときの跳ね返りを閉じ込める */
  overscroll-behavior-y: contain;
  /* ノッチとホームインジケータを避ける。指定が無いと文字が食い込む */
  padding: calc(0px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           calc(64px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  /* 誤ってダブルタップしたときにズームしないようにする(2026-09-01、実機で発生)。
     style.css の body には前から入っていたが、このファイルだけ抜けていて、
     サイトの中でページの種類によって挙動が食い違っていた。
     指を広げるズーム(ピンチ)は止まらないので、文字を大きくしたい人は今までどおりできる。 */
  touch-action: manipulation;
}

main, .site-head, .site-foot {
  max-width: 680px;
  margin: 0 auto;
}

.site-head {
  padding: 18px 0 14px;
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  /* タップ目標44px下限(本体アプリと同じ基準) */
  min-height: 44px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.tagline {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
}

.crumb {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

h1 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  line-height: 1.5;
}
h2 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
}
.card h2:first-child { margin-top: 0; }

.lead { margin: 0 0 20px; }
.lead strong { color: var(--accent); }

.opts { margin-bottom: 14px; }
.opt { margin-bottom: 14px; }
.opt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 5px;
}
.opt-label { font-weight: 700; }
.opt-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-muted);
}
.opt.is-majority .opt-pct { color: var(--accent); }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}
.track {
  height: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}
.fill {
  height: 100%;
  border-radius: 999px;
  background: var(--border);
}
.opt.is-majority .fill { background: var(--accent); }

.meta, .note, .source {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.source {
  /* 出典は長いURLを含むので、狭い画面でも横スクロールさせない */
  overflow-wrap: anywhere;
}
.source a { color: var(--accent); }

.cta {
  display: block;
  margin: 18px 0 8px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cta:hover { opacity: 0.92; }

.related {
  margin: 0;
  padding: 0;
  list-style: none;
}
.related li {
  border-top: 1px solid var(--border);
}
.related li:first-child { border-top: none; }
.related a {
  display: block;
  /* タップ目標44px下限(本体アプリと同じ基準) */
  min-height: 44px;
  padding: 11px 0;
  color: var(--accent);
  text-decoration: none;
}
.related a:hover { text-decoration: underline; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  padding-top: 12px;
  font-size: 0.85rem;
}
.site-foot a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

a:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ダークモードには**寄せない**(2026-09-01)。
   このファイルだけが端末の設定に合わせて黒くなっていたため、
   アプリの中で「今日のお題」を開いた瞬間だけ白から黒に切り替わっていた
   (ホームと結果画面のCTA「1問だけ 今日のお題に答える」が /today を開くため、
   毎日使ってほしい導線がまさにそこだった)。
   アプリ本体(style.css)は明るい配色ひとつで作ってあるので、こちらを合わせる。
   端末がどちらの設定でも同じ見た目になる。
   全体をダークモード対応にするなら、本体と合わせて別途やる(このファイル単独では揃わない)。 */

/* 「今日のお題」の選択肢と答え合わせ(2026-08-24)。
   選ぶまで割合を隠し、選んだ瞬間に開く。切り替えは /js/today.js が行う。 */
.is-hidden { display: none; }

.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 8px;
}
.choice {
  /* タップ目標44px下限(本体アプリと同じ基準) */
  min-height: 56px;
  padding: 15px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.choice:hover:not(:disabled) { background: var(--accent-soft); }
.choice:disabled { cursor: default; }
/* 選ばれなかった側は沈める。多数派だった選択肢は塗って結論を一目で伝える */
.choice:disabled { opacity: 0.5; }
.choice.is-chosen { opacity: 1; }
.choice.is-majority {
  opacity: 1;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.verdict {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}
.verdict.is-hit { color: var(--accent); }
.verdict.is-miss { color: var(--text-muted); }

/* 上と同じ理由でダークモードの上書きは持たない(2026-09-01) */

/* 広告枠(2026-08-24)。出典の下にだけ置く。クイズの流れ(結果画面・答え合わせ)には
   入れない——シェアと再挑戦の導線を潰すため。
   広告のIDが未設定のうちはサーバーが枠自体を出力しないので、この指定は使われない。 */
.ad-slot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  /* 広告が読み込めなかったときに空の余白だけが残らないようにする */
  min-height: 0;
}
.ad-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ad-slot .adsbygoogle {
  display: block;
  /* はみ出して横スクロールを起こさせない */
  max-width: 100%;
  overflow: hidden;
}

/* 連続回答日数(2026-08-24)。毎日開く理由そのものなので、答える前と後の両方に出す。 */
.streak {
  /* 上下の余白は詰める。結果ブロックに1行足すとCTAが折返し(664px)の外へ出る
     (2026-08-24に実測: 余白12pxで670px、6pxで折返し内に収まる)。 */
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.js-result .streak {
  margin: 2px 0 6px;
}

/* 達成演出とシェア(2026-08-25)。
   /today は style.css ではなくこのファイルを読むので、ここにも書く必要がある
   (最初 style.css だけに書いて、数字が16pxのままだった)。
   数字に最大の視覚ウェイトを割く、という指針に沿って大きく出す。 */
.streak-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.streak-number {
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.streak-badge.is-bumped .streak-number { transform: scale(1.18); }
.streak-unit {
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.streak-celebrate { text-align: center; margin: 0 0 6px; }
.streak-milestone {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}
.js-celebrate:empty { display: none; }

/* シェアボタンは他のボタンと同じ幅にする(文字幅ぶんだと押しにくい) */
.js-today-share {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .streak-number { transition: none; }
}

/* 今日のお題の答え合わせ(2026-08-25)。結論は1行、詳細は畳む。
   判定・演出・グラフを縦に並べるとCTAが折返しの外へ出るため。 */
.daily-summary {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.95rem;
}
.daily-summary strong { color: var(--accent); }
.daily-summary .meta { display: inline; font-size: 0.78rem; }
.daily-details { margin: 12px 0 0; }
.daily-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--accent);
  /* タップ目標44px下限 */
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* 答え合わせの上部を詰める(2026-08-25)。判定・演出・結論の3つを積むと
   CTAが671pxとなり折返し664pxをわずかに超えるため、余白だけで吸収する。 */
.js-result .verdict { margin-bottom: 6px; }
.js-celebrate .streak-celebrate { margin: 0; }
.js-celebrate .streak-number { font-size: 3.1rem; }
.daily-summary { margin: 8px 0 10px; }
.js-result .cta { margin-top: 12px; }

/* 昨日のお題への導線(2026-08-25)。見逃した日を取り返せる入口。 */
.yesterday-link { text-align: center; margin: 0 0 16px; }
.yesterday-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 節目のシェアボタン(2026-08-25)。達成の瞬間だけ出る。 */
.js-milestone-share {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
/* 上と同じ理由でダークモードの上書きは持たない(2026-09-01) */

/* 読み上げにだけ渡す文字(2026-08-25)。ポップアップに名前を与えるために使う。
   display:none だと読み上げからも消えるので、見えない位置に置く形にする。 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 割合の出どころが「実在調査から按分した初期データ」から「利用者の回答」へ
   切り替わったお題に添える一言(2026-08-25)。切り替わりはこのアプリで年に何度も
   来ない節目なので、起きたことが分かるようにする。まだのお題には何も出さない。 */
.community-note {
  margin: 6px 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft, rgba(91, 91, 214, .08));
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: var(--text);
}
.community-note.is-hidden { display: none; }

/* 文中のリンクの当たり判定(2026-09-01、レビューで実測)。
   カテゴリのまとめページへの導線とパンくずを足したとき、当たり判定を作らずに
   `<p class="note">` `<p class="crumb">` へ入れただけだったので、**15〜16px**しか
   なかった(下限44pxの3分の1)。同じ形を今朝「その1/その2」でも踏んでいる。
   **文中にリンクを置くときは、必ずここを通す。**
   見た目は変えず、上下の余白で当たり判定だけを広げる。 */
.note a,
.crumb a,
.source a {
  display: inline-block;
  /* **min-heightで直に44pxを取る。** 最初は padding だけで足りると思ったが、
     実測で40pxにしかならなかった(0.85remの行の高さが想定より低い)。
     計算に頼らず下限そのものを書く。 */
  min-height: 44px;
  padding: 10px 0;
  /* 隣接する行と重ならないよう、負のマージンで見た目の位置は元に戻す */
  margin: -10px 0;
  /* 縦位置を中央に揃える(min-heightを足すと上寄りになるため) */
  display: inline-flex;
  align-items: center;
}
