/* ===========================
   クイズ広場 — yorozu-craft 共通の和紙風の配色
   色はトークン（--bg / --card / --text / --muted / --accent / --border）だけを使う。
   ダークモードは端末の設定に自動で合わせる（prefers-color-scheme。手動切替は付けない）
   =========================== */
:root {
  color-scheme: light dark;
  --bg: #f0ebe0;
  --bg-2: #e6dfd0;
  --card: #faf6ee;
  --text: #3a3025;
  --muted: #6e604f;
  --accent: #8b4513;
  --accent-soft: #f3e6d8;
  --border: #cfc0a0;
  --shadow: rgba(58, 48, 37, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1814;
    --bg-2: #25201a;
    --card: #2b251e;
    --text: #ece4d6;
    --muted: #b9ab96;
    --accent: #e0a066;
    --accent-soft: #3a2e22;
    --border: #4a3f33;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

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

body {
  /* README「ツールを追加するとき」9: 端末のフォント。Web フォントは読まない */
  font-family: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: var(--accent); }

/* ヘッダー */
.app-header {
  text-align: center;
  padding: 1.4rem 1rem 1.1rem;
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
}
.app-header h1 { font-size: 1.45rem; color: var(--accent); line-height: 1.4; }
.app-header .subtitle { font-size: 0.88rem; color: var(--muted); margin-top: 0.3rem; }

/* レイアウト */
.app-main { max-width: 680px; margin: 0 auto; padding: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px var(--shadow);
}
.card h2 {
  font-size: 1.02rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.9rem;
}

/* 入力 */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.field input[type="number"], .field input[type="text"], .field select {
  width: 100%;
  max-width: 16rem;
  padding: 0.45rem 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--card);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 読みもの（guide.html） */
.content h3 { font-size: 0.95rem; margin: 1rem 0 0.3rem; }
.content p, .content li { font-size: 0.9rem; }
.content p + p { margin-top: 0.5rem; }
.content ul, .content ol { padding-left: 1.3rem; margin: 0.3rem 0; }
.faq dt { font-weight: 600; margin-top: 0.9rem; font-size: 0.92rem; }
.faq dt::before { content: 'Q. '; color: var(--accent); }
.faq dd { font-size: 0.88rem; color: var(--muted); padding: 0.2rem 0 0.5rem 1.2rem; border-bottom: 1px solid var(--border); }
.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; font-size: 0.9rem; }
.info-list dt { font-weight: 600; }
.info-list dd { color: var(--muted); }
.small { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }

/* フッター */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.footer-nav ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-bottom: 0.6rem; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--accent); }

@media (max-width: 480px) {
  .app-header h1 { font-size: 1.2rem; }
}

/* ===========================
   画面の骨組み（yorozu-plans の docs/SCREEN.md。README「ツールを追加するとき」25）
   必須の入力（fieldset.req）→ 結果（.result-card）→ くわしく入れる（details.opt）、上端の固定バー、PC の 2 カラム
   seido-keisan/nenmatsu と gakushu-print の試験（2026-09-24）から取り出したもの
   =========================== */
fieldset.card { min-width: 0; }
.req legend {
  float: left; width: 100%;   /* legend を枠の上に載せず、h2 と同じ見た目で枠の中に置く */
  font-size: 1.02rem; font-weight: 700; color: var(--accent);
  border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin-bottom: 0.9rem;
}
.req legend + * { clear: both; }

/* 結果: 大きな数字 1 つ＋ 1 行。内訳は details.rels */
.result-card { scroll-margin-top: 56px; }   /* 固定バー（44px）で見出しが隠れないように */
.result-card:focus { outline: none; }
.result-big { font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1.3; }
.result-sub { font-size: 0.9rem; color: var(--muted); }
details.rels > summary { cursor: pointer; min-height: 44px; padding: 0.55rem 0; list-style: none; color: var(--accent); font-size: 0.92rem; }
details.rels > summary::-webkit-details-marker { display: none; }
details.rels > summary::before { content: '▸'; margin-right: 0.4rem; }
details.rels[open] > summary::before { content: '▾'; }

/* くわしく入れる（1 グループ 1 つの details）。summary の .opt-state に今の状態を出す（screen.js の detailsSummary） */
details.card.opt { padding: 0 1.2rem; margin-bottom: 0.6rem; }
details.card.opt > summary {
  cursor: pointer; display: block; min-height: 44px; padding: 0.6rem 0;
  color: var(--accent); font-weight: 600; font-size: 0.95rem; list-style: none;
}
details.card.opt > summary::-webkit-details-marker { display: none; }
details.card.opt > summary::before { content: '▸'; margin-right: 0.4rem; }
details.card.opt[open] > summary::before { content: '▾'; }
details.card.opt[open] { padding-bottom: 0.9rem; }
details.card.opt[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 0.9rem; }
details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-state { color: var(--text); font-weight: normal; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0; }   /* ボタンの間隔（SCREEN.md 5 章。4 章の上下 12px 以上は margin で） */
.btn-row .btn { min-height: 44px; }

/* 固定バー（SCREEN.md 0 章の 3・D59）: 上端に 1 行、高さ 44px。下端は AdSense のアンカー広告が使う。
   読み込み時は hidden（screen.js が出し入れする。fixed なのでレイアウトはずれない） */
.fixbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 44px;
  background: var(--card); border-bottom: 2px solid var(--accent); box-shadow: 0 2px 8px var(--shadow);
}
.fixbar a, .fixbar button {
  display: block; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 1rem; height: 42px; line-height: 42px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: inherit; font-weight: 700;
  color: var(--accent); background: none; border: none; text-decoration: none; cursor: pointer;
}
.fixbar a:focus-visible, .fixbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

/* PC（900px 以上）の 2 カラム（D63: 制度の計算機だけ）。<main class="app-main layout-2col"> にすると、
   左に入力・右に結果（sticky）。結果が常に見えるので、固定バーに fixbar-narrow も付けて PC では出さない */
@media (min-width: 900px) {
  .fixbar-narrow { display: none !important; }
  .layout-2col { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); column-gap: 1.2rem; align-items: start; }
  .layout-2col > *, .layout-2col > form > * { grid-column: 1; }
  .layout-2col > form { display: contents; }
  .layout-2col .result-card { grid-column: 2; grid-row: 1 / span 30; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}

@media print {
  .fixbar, .no-print { display: none !important; }
  /* 印刷では折りたたみの中も出す（途中の計算・入れた値を紙に残す） */
  main details::details-content { content-visibility: visible; display: block; }
  main details > summary::before { content: none; }
  .layout-2col { display: block; }
  .layout-2col .result-card { position: static; max-height: none; overflow: visible; }
  /* 広告は印刷に出さない（gakushu-print と同じ） */
  ins.adsbygoogle, .google-auto-placed, iframe[id^="aswift"], iframe[id^="google_ads"] { display: none !important; }
}

/* ===========================
   クイズ広場（入口・題材のページ）
   =========================== */
.js-loading #app { visibility: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crumb { font-size: 0.85rem; margin-bottom: 0.2rem; }
.crumb a { text-decoration: none; }

/* 入口の一覧 */
.topics { list-style: none; }
.topic { padding: 0; }
.topic a { display: grid; grid-template-columns: 3rem 1fr; gap: 0 0.6rem; padding: 1rem 1.1rem; color: var(--text); text-decoration: none; min-height: 44px; }
.topic a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-icon { grid-row: span 3; font-size: 2rem; line-height: 1.2; text-align: center; }
.topic-name { font-weight: 700; color: var(--accent); font-size: 1.08rem; }
.topic-desc { font-size: 0.86rem; color: var(--muted); }
.topic-rec { font-size: 0.8rem; color: var(--muted); }
.topic-rec:empty { display: none; }

/* メニュー */
.opt-row { margin-bottom: 0.7rem; }
.opt-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg-item {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0.3rem 0.75rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 0.92rem; cursor: pointer;
}
.seg-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.seg-item:has(input:disabled) { opacity: 0.5; cursor: default; }
.seg-item input { accent-color: var(--accent); }
.weak-row { display: flex; align-items: center; gap: 0.4rem; min-height: 44px; font-size: 0.92rem; }
.weak-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.start-row { text-align: center; margin: 0.4rem 0 0.2rem; }
.best-line { text-align: center; min-height: 1.2em; }
.sub-row { justify-content: center; margin-bottom: 1rem; }
.btn-big { font-size: 1.1rem; padding: 0.75rem 2.2rem; min-height: 48px; }
.btn-sub { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); padding: 0.3rem 0.8rem; min-height: 40px; font-size: 0.88rem; cursor: pointer; }
.challenge { border-color: var(--accent); }
.weak-list { columns: 2; font-size: 0.85rem; padding-left: 1.2rem; margin: 0.3rem 0; }
.src-links { padding-left: 1.2rem; word-break: break-all; }

/* 出題 */
.play-bar { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; font-size: 0.92rem; color: var(--muted); }
.play-bar .score { margin-right: auto; font-weight: 700; color: var(--accent); }
.question { font-size: 1.35rem; font-weight: 700; line-height: 1.5; margin: 0.4rem 0 1rem; min-height: 2.1em; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.choice {
  min-height: 56px; padding: 0.6rem; font: inherit; font-size: 1.1rem; font-weight: 600; color: var(--text);
  background: var(--card); border: 2px solid var(--border); border-radius: 10px; cursor: pointer; line-height: 1.35;
}
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice.ok { border-color: #2e7d32; background: #e3f1e4; color: #1b4d1f; }
.choice.ok::before { content: '○ '; }
.choice.ng { border-color: #b3261e; background: #f9e1df; color: #6d1510; }
.choice.ng::before { content: '× '; }
.choice:disabled { cursor: default; }
@media (prefers-color-scheme: dark) {
  .choice.ok { background: #1f3a21; color: #cfe9d1; }
  .choice.ng { background: #4a1f1c; color: #f5cdc9; }
}
.type-form .answer {
  width: 100%; font-size: 1.4rem; padding: 0.6rem 0.8rem; border: 2px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text);
}
.type-form .answer:focus { outline: none; border-color: var(--accent); }
.feedback { margin-top: 1rem; padding: 1rem; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.fb-title { font-size: 1.2rem; font-weight: 700; }
.fb-title.ok { color: #2e7d32; }
.fb-title.ng { color: #b3261e; }
@media (prefers-color-scheme: dark) { .fb-title.ok { color: #8fd694; } .fb-title.ng { color: #f2a19a; } }
.fb-near { font-weight: 600; }
.fb-body { margin: 0.3rem 0 0.8rem; }
.feedback .btn-big { width: 100%; }

/* 結果 */
.result-title { font-size: 1.4rem; color: var(--accent); border: none; margin-bottom: 0.2rem; }
.result-miss { margin-top: 0.8rem; font-size: 0.9rem; }
.result-miss ul { padding-left: 1.2rem; }
.btn-col { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.share-url { width: 100%; margin-top: 0.4rem; padding: 0.4rem; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }

/* 一覧 */
.table-wrap { overflow-x: auto; }
.list-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 0.6rem; }
.list-table th, .list-table td { border-bottom: 1px solid var(--border); padding: 0.35rem 0.4rem; text-align: left; vertical-align: top; }
.list-table th { font-size: 0.82rem; color: var(--muted); }
.reveal { min-width: 44px; min-height: 36px; border: 1px dashed var(--accent); border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: inherit; cursor: pointer; }

/* 印刷の見本（画面では縮小せずに白い紙として並べる。ダークモードでも白） */
.sheets { margin-top: 0.5rem; }
.sheet { background: #fff; color: #111; padding: 12mm 12mm 8mm; margin-bottom: 1rem; border: 1px solid var(--border); box-shadow: 0 2px 8px var(--shadow); }
.sheet-head h2 { font-size: 1.1rem; color: #111; border-bottom: 2px solid #111; padding-bottom: 0.2rem; margin-bottom: 0.3rem; }
.sheet-meta { font-size: 0.8rem; color: #444; }
.sheet-name { display: flex; gap: 1rem; font-size: 0.9rem; margin: 0.4rem 0 0.6rem; }
.sheet-name .nm { flex: 1; border-bottom: 1px solid #111; }
.sheet-name .pt { width: 8em; border-bottom: 1px solid #111; text-align: right; }
.sheet-list { padding-left: 2.2rem; font-size: 0.95rem; }
.sheet-list li { padding: 0.3rem 0; border-bottom: 1px dotted #999; break-inside: avoid; }
.sheet-list .q { display: block; }
.sheet-list .cs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; font-size: 0.88rem; color: #333; }
.sheet-list .blank { display: block; height: 1.5em; }
.sheet-list .a { display: block; font-weight: 700; }
.sheet-credit { font-size: 0.7rem; color: #666; margin-top: 0.5rem; text-align: right; }

@page { size: A4 portrait; margin: 12mm; }
@media print {
  /* 印刷の画面のときは、問題と答えの紙だけを出す（Ctrl+P から印刷しても白紙にならない） */
  body.print-mode { background: #fff; }
  body.print-mode > :not(main), body.print-mode main > :not(#scr-print), body.print-mode #scr-print > :not(#sheets) { display: none !important; }
  body.print-mode main { max-width: none; padding: 0; margin: 0; }
  body.print-mode .sheet { border: none; box-shadow: none; padding: 0; margin: 0; }
  body.print-mode .sheet + .sheet { break-before: page; page-break-before: always; }
}

/* 百人一首 読み上げ（/hyakunin/）。歌は大きく、声が無い端末では読み手がこれを見て読む */
.voice-line { text-align: center; }
.voice-line.warn { color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 0.5rem 0.7rem; }
.voice-select { width: 100%; min-height: 44px; font: inherit; padding: 0.3rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.rate-range { width: 100%; min-height: 44px; accent-color: var(--accent); }
.yomi-card { text-align: center; cursor: default; min-height: 11rem; }
.yomi-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
.yomi-kami, .yomi-shimo { font-size: 1.55rem; line-height: 1.6; font-weight: 700; opacity: 0.55; transition: opacity 0.2s; }
.yomi-kami.now, .yomi-shimo.now { opacity: 1; color: var(--accent); }
.yomi-shimo.dim { visibility: hidden; }
.yomi-kana { margin-top: 0.5rem; }
.yomi-hidden { font-size: 1.1rem; color: var(--muted); padding: 2rem 0; }
.yomi-status { text-align: center; min-height: 1.5em; font-weight: 600; margin: 0.2rem 0 0.8rem; }
.yomi-sub { justify-content: center; margin: 0; }
.yomi-page .play-bar .score { font-size: 0.88rem; }
.yomi-page .play-bar .btn-ghost { white-space: nowrap; }
.done-list { padding-left: 2.2rem; font-size: 0.85rem; }
.done-list li { padding: 0.15rem 0; }
@media (min-width: 600px) { .yomi-kami, .yomi-shimo { font-size: 2rem; } }

/* 高齢者向けの題材（昭和クイズ。topics/*.js の page.big）: 字とボタンを大きく、選択肢は 1 列 */
.noads { font-size: 0.9rem; color: var(--text); margin-top: 0.4rem; }
body.big .app-main { font-size: 1.1rem; }
body.big .subtitle { font-size: 1rem; }
body.big .seg-item { font-size: 1.05rem; min-height: 52px; }
body.big .opt-label { font-size: 1.05rem; }
body.big .question { font-size: 1.6rem; }
body.big .choices { grid-template-columns: 1fr; }
body.big .choice { font-size: 1.35rem; min-height: 68px; text-align: left; padding: 0.7rem 1rem; }
body.big .fb-title { font-size: 1.45rem; }
body.big .fb-body { font-size: 1.1rem; }
body.big .btn-big { font-size: 1.25rem; min-height: 56px; }
body.big .small { font-size: 0.92rem; }
.fb-talk { margin: -0.3rem 0 0.8rem; padding: 0.5rem 0.7rem; background: var(--accent-soft); border-radius: 8px; }

/* 回想法カード（A4 に 6 枚。点線で後ろへ折ると答えがかくれる。答えは 180 度回して印刷） */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 84mm; border-top: 1px dashed #999; border-left: 1px dashed #999; }
.qcard { display: flex; flex-direction: column; border-right: 1px dashed #999; border-bottom: 1px dashed #999; padding: 3mm 4mm; overflow: hidden; break-inside: avoid; }
.qc-front { flex: 1 1 55%; }
.qc-head { font-size: 0.75rem; color: #555; }
.qc-q { font-size: 1.05rem; font-weight: 700; line-height: 1.45; margin: 0.1rem 0 0.3rem; }
.qc-cs { list-style: none; font-size: 1rem; line-height: 1.5; }
.qc-fold { font-size: 0.65rem; color: #777; text-align: center; border-top: 1px dashed #777; margin: 1mm -4mm 1mm; padding-top: 0.5mm; }
.qc-back { flex: 1 1 45%; transform: rotate(180deg); font-size: 0.8rem; line-height: 1.45; display: flex; flex-direction: column; justify-content: flex-end; }
.qc-a { font-weight: 700; font-size: 0.95rem; }
.qc-ex, .qc-talk { color: #333; }
@media print {
  body.print-mode .cards-sheet { padding: 0; }
}

/* ===========================
   早押しボタン（/hayaoshi/）: 1 台を 2〜4 人で囲む全画面。上側の人のボタンは文字を 180 度回す
   =========================== */
body.playing-full { overflow: hidden; overscroll-behavior: none; }
.play-full {
  position: fixed; inset: 0; z-index: 100; display: grid; gap: 6px; background: var(--bg);
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto 1fr;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.play-full .zones { display: contents; }
.play-full.n2 { grid-template-areas: "z0 z0" "host host" "z1 z1"; }
.play-full.n3 { grid-template-areas: "z0 z0" "host host" "z1 z2"; }
.play-full.n4 { grid-template-areas: "z0 z1" "host host" "z2 z3"; }
.zone.z0 { grid-area: z0; } .zone.z1 { grid-area: z1; } .zone.z2 { grid-area: z2; } .zone.z3 { grid-area: z3; }
.play-full.n2 .z0 .zone-inner, .play-full.n3 .z0 .zone-inner, .play-full.n4 .z0 .zone-inner, .play-full.n4 .z1 .zone-inner { transform: rotate(180deg); }
.zone {
  --c: #c0392b; position: relative; min-height: 0; border: 3px solid var(--c); border-radius: 18px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 14%, var(--bg)); color: var(--text); font: inherit;
  touch-action: none; -webkit-tap-highlight-color: transparent; transition: opacity 0.1s, background 0.1s;
}
.zone.z1 { --c: #1f5fbf; } .zone.z2 { --c: #2e7d32; } .zone.z3 { --c: #b86e00; }
.zone-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; height: 100%; pointer-events: none; }
.zone-inner::before {
  content: ''; display: block; width: min(34vw, 20vh, 150px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 70%); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 60%, #000);
}
.zone-name { font-weight: 700; font-size: 1.15rem; }
.zone-score { font-size: 1.5rem; font-weight: 700; color: var(--c); }
.zone-state { min-height: 1.4em; font-weight: 700; font-size: 1.2rem; }
.zone:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.zone.win { background: var(--c); color: #fff; animation: zone-pop 0.5s ease-out; }
.zone.win .zone-score { color: #fff; }
.zone.win .zone-inner::before { background: #fff; box-shadow: 0 0 0 8px color-mix(in srgb, #fff 45%, transparent); }
.zone.right { background: color-mix(in srgb, var(--c) 35%, var(--bg)); }
.zone.locked { opacity: 0.35; }
.zone.out { opacity: 0.45; filter: grayscale(0.8); }
@keyframes zone-pop { from { transform: scale(0.97); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .zone.win { animation: none; } }
.host { grid-area: host; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0.35rem 0.5rem; }
.host-q { font-size: 0.9rem; line-height: 1.45; }
.hq-head { font-weight: 700; color: var(--accent); }
.hq-text { font-size: 1rem; font-weight: 600; }
.hq-choices { font-size: 0.9rem; }
.hq-answer { font: inherit; font-size: 0.85rem; margin: 0.2rem 0; padding: 0.2rem 0.6rem; min-height: 36px; border: 1px dashed var(--accent); border-radius: 6px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.hq-answer:disabled { color: var(--text); cursor: default; }
.host-btns, .host-more { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.3rem; }
.hbtn { flex: 1 1 auto; min-height: 44px; min-width: 44px; padding: 0.3rem 0.6rem; font: inherit; font-weight: 700; font-size: 0.92rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--card); cursor: pointer; }
.hbtn:disabled { opacity: 0.4; cursor: default; }
.hbtn-ok { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.hbtn-ng { background: #b3261e; border-color: #b3261e; color: #fff; }
.hbtn-sub { background: var(--accent-soft); color: var(--accent); flex: 0 1 auto; }
.names .name-input { width: 100%; max-width: 16rem; min-height: 44px; font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.keys-list { padding-left: 1.2rem; }
kbd { font-family: inherit; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3rem; background: var(--bg); }
.rank-list { padding-left: 0; list-style: none; font-size: 1.3rem; font-weight: 700; }
.rank-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.reader-sheet h2 { font-size: 1.1rem; color: #111; border-bottom: 2px solid #111; margin-bottom: 0.4rem; }
.reader-list { padding-left: 2.2rem; font-size: 1rem; }
.reader-list li { padding: 0.35rem 0; border-bottom: 1px dotted #999; break-inside: avoid; }
.reader-list .rq, .reader-list .rc, .reader-list .ra { display: block; }
.reader-list .rc { font-size: 0.9rem; color: #333; }
.reader-list .ra { font-weight: 700; }
@media print {
  body.print-reader { background: #fff; }
  body.print-reader > :not(main), body.print-reader main > :not(#scr-reader), body.print-reader #scr-reader > :not(#reader-sheet) { display: none !important; }
  body.print-reader main { max-width: none; padding: 0; margin: 0; }
  body.print-reader .reader-sheet { border: none; box-shadow: none; padding: 0; margin: 0; }
}
