/* 早押しクイズ（早押しボタン）固有の見た目（共通は ../common/base.css）。問題のカード・4択・説明は 雑学クイズ（games/zatsugaku）と同じ形 */
[hidden] { display: none !important; }
:root {
  /* 人の色（8人）。1〜4はサイトのプレイヤー4色、5〜8を足した。色だけで区別しない（番号・名前も出す） */
  --c1: var(--p-red); --c2: var(--p-blue); --c3: var(--p-green); --c4: var(--p-yellow);
  --c5: #7B5AA6; --c6: #D26A1F; --c7: #1C8585; --c8: #C24E86;
}
/* 人の色の上の文字: ふつうは白、黄色（4番）だけ濃い色（白では読みにくい） */
.pad-wrap, .name-row, .answerer { --pi: #FFFFFF; }
.pad-wrap.light, .name-row.light { --pi: #1F2328; }
.board-wrap { min-height: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 問題のカード（地は明るいまま。文字の色は固定） ---------- */
.card {
  background: var(--board); color: #1F2328; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px 14px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.qhead { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 2px 0 4px; width: 100%; }
.qno { font-size: 15px; font-weight: 700; color: #5B616B; margin-right: 4px; }
.qpts { font-size: 15px; color: #5B616B; margin-left: auto; }
.qpts b { font-size: 18px; color: #1F2328; }
.ktag, .lvtag { font-size: 14px; font-weight: 700; border-radius: 999px; padding: 1px 10px; line-height: 1.6; }
.ktag { background: #E9EEF4; color: #24496E; border: 1px solid #B9C8D8; }
.lvtag { background: #FFFFFF; color: #5B616B; border: 1px solid #C9C4B8; }
.ktag rt, .lvtag rt, .qno rt, .qpts rt { font-weight: 400; }
/* 問題文: 1文字ずつ出る。高さは3行ぶん取っておく（出ていくにつれて下の物が動かないように） */
.ask {
  margin: 6px 0 0; font-size: 24px; font-weight: 700; line-height: 1.9; letter-spacing: .03em; max-width: 34em; width: 100%;
  text-align: left; min-height: calc(2 * 1.9em);
}
.ask rt { font-size: max(.5em, 10px); font-weight: 400; }
.caret { display: inline-block; width: 3px; height: 1.05em; margin-left: 2px; vertical-align: -0.12em; background: #2F5D8A; }
.card.reading .caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .card.reading .caret { animation: none; } }
.kpart { text-decoration: underline; text-decoration-color: #2E7D4F; text-decoration-thickness: 3px; text-underline-offset: 7px; }
.bmark { color: #B23A3A; font-size: .7em; vertical-align: .6em; margin: 0 1px; }
.verdict { margin: 6px 0 0; font-size: 20px; font-weight: 700; min-height: 1.4em; }
.verdict.ok { color: #2E7D4F; } .verdict.ng { color: #B23A3A; }
.verdict .mark { font-size: 26px; margin-right: 6px; }

/* 時間のバー（押せる時間・答える時間） */
.timebar { width: 100%; height: 8px; margin: 8px 0 0; border-radius: 999px; background: #E4E0D6; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: #2F5D8A; border-radius: 999px; }
.timebar.answer i { background: #9A6415; }

/* 押した人（みんなで） */
.answerer { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; font-size: 19px; font-weight: 700; }
.answerer .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--pc); border: 2px solid var(--ink); }

/* ---------- 4択 ---------- */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 560px; margin: 10px auto 4px; }
.opt {
  appearance: none; font: inherit; min-height: 60px; border-radius: 8px; border: 2px solid #8C826F; background: #FFFDF7; color: #1F2328;
  font-size: 21px; font-weight: 700; line-height: 1.35; cursor: pointer; padding: 10px 10px 8px 30px; position: relative;
  filter: var(--shadow-piece); touch-action: manipulation; -webkit-tap-highlight-color: transparent; word-break: keep-all; overflow-wrap: anywhere;
  transition: transform var(--dur), background-color var(--dur), border-color var(--dur), opacity var(--dur);
}
.opt.long { font-size: 17px; }
.opt rt { font-size: max(.45em, 10px); font-weight: 400; }
.opt:active:not([aria-disabled="true"]) { transform: translateY(1px); }
.opt:focus-visible { outline: 3px solid #D9A21B; outline-offset: 2px; }
.opt .n { position: absolute; left: 8px; top: 6px; font: 700 14px/1 var(--font); color: #6B6457; }
.opt[aria-disabled="true"] { cursor: default; }
.opt.ok { background: #E6F3EA; border-color: #2E7D4F; color: #1F5A37; }
.opt.show { background: #E6F3EA; border-color: #2E7D4F; border-style: dashed; color: #1F5A37; }
.opt.ng { background: #FBEDEC; border-color: #B23A3A; color: #7A2424; }
.opt.dim { opacity: .6; }
.opt.gone { opacity: .35; border-style: dashed; filter: none; text-decoration: line-through; }
.opt .res { position: absolute; right: 8px; top: 6px; font: 700 16px/1 var(--font); }
.opt.ok .res, .opt.show .res { color: #2E7D4F; } .opt.ng .res { color: #B23A3A; }
.opt.shake { animation: shake .38s ease-out; }
@keyframes shake { 20% { transform: translateX(-8px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .opt.shake { animation: none; } }

/* ひとりで: 大きな「押す！」 */
.solo-buzz {
  appearance: none; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 100%; max-width: 560px; min-height: 104px; margin: 12px auto 0; cursor: pointer;
  border: 3px solid #7A2A22; border-bottom-width: 7px; border-radius: 16px; background: var(--c1); color: #FFFFFF;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.solo-buzz .sb-main { font-size: 32px; font-weight: 800; letter-spacing: .1em; line-height: 1.3; }
.solo-buzz .sb-main rt { font-size: 12px; font-weight: 400; letter-spacing: 0; }
.solo-buzz .sb-sub { font-size: 15px; opacity: .92; }
.solo-buzz:active { transform: translateY(3px); border-bottom-width: 4px; }
.solo-buzz:focus-visible { outline: 3px solid var(--warn); outline-offset: 3px; }

/* ---------- 答えと説明 ---------- */
.explain { max-width: 560px; margin: 10px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px 12px; font-size: 17px; line-height: 1.9; text-align: left; }
.explain p { margin: 0 0 6px; }
.explain .ans { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.explain .ans .lab { font-size: 14px; font-weight: 700; color: var(--ink-sub); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; line-height: 1.6; }
.explain .ans b { font-size: 26px; }
.explain .ans rt { font-size: max(.45em, 10px); font-weight: 400; }
.explain .where { font-size: 15px; color: var(--ink-sub); margin: 0; }
.explain .kline { display: inline-block; width: 22px; height: 0; border-bottom: 3px solid var(--ok); vertical-align: middle; margin-right: 6px; }
.next-row { display: flex; justify-content: center; margin: 10px 0 0; }
.next-row .btn { min-width: 10em; }

/* ---------- 早押しボタン（人ごとのパッド） ---------- */
.pads { display: grid; gap: 10px; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pads.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 560px) { .pads.n5, .pads.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pads.n7, .pads.n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pad-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pad {
  appearance: none; font: inherit; position: relative; width: 100%; min-height: 128px; padding: 10px 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  background: var(--surface); color: var(--ink); border: 3px solid var(--pc); border-bottom-width: 8px; border-radius: 14px;
  touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: background-color .08s, transform .08s, opacity var(--dur);
}
.pad:active { transform: translateY(3px); border-bottom-width: 5px; }
.pad:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.pad .pn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--pc); color: var(--pi); font-size: 22px; font-weight: 800; line-height: 40px;
  border: 2px solid rgba(0, 0, 0, .25);
}
.pad .pname { font-size: 18px; font-weight: 700; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad .pscore { font-size: 15px; color: var(--ink-sub); line-height: 1.2; }
.pad .pscore b { font-size: 26px; color: var(--ink); margin-right: 2px; }
.pad .pkey { position: absolute; left: 8px; top: 6px; }
@media (hover: none) and (pointer: coarse) { .pad .pkey { display: none; } } /* タッチの端末ではキーを出さない */
.pad .pkey kbd { font-size: 14px; min-width: 1.6em; padding: 0 4px; }
/* 着順・×・休み: ボタンの下の段に（番号の丸に重ねない）。無いときも高さを取っておく */
.pad .pbadge { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.5; padding: 0 8px; border-radius: 999px; background: var(--surface); border: 2px solid var(--pc); color: var(--ink); white-space: nowrap; }
.pad .pbadge.empty { visibility: hidden; }
.pad .pbadge rt { font-weight: 400; }
.pad .pbadge.mark { border-color: var(--ink-sub); color: var(--ink-sub); }
/* 1着: その人の色でぬりつぶして光らせる */
.pad.win { background: var(--pc); color: var(--pi); box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--pc); z-index: 1; }
.pad.win .pn { background: #FFFFFF; color: #1F2328; }
.pad.win .pscore, .pad.win .pscore b { color: var(--pi); }
.pad.win .pkey kbd { background: rgba(255, 255, 255, .9); color: #1F2328; }
.pad.win .pbadge.first { background: #FFFFFF; color: #1F2328; border-color: #FFFFFF; font-size: 16px; }
.pad.win { animation: flash .5s ease-out; }
@keyframes flash { 0% { transform: scale(.94); } 40% { transform: scale(1.04); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pad.win { animation: none; } }
.pad.locked { opacity: .55; }
.pad.out, .pad.rest { opacity: .45; border-style: dashed; }
.pad.tie { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.pad.nudge { animation: nudge .25s ease-out; }
@keyframes nudge { 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
.pads.editing .pad { cursor: default; opacity: .8; }
.adj { display: flex; gap: 6px; justify-content: center; }
.adj .btn { flex: 1 1 0; padding: 0 6px; min-width: 0; }

/* みんなで: 問題の下に小さめのボタン */
.pads.compact { margin-top: 12px; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pads.compact.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pads.compact.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pads.compact .pad { min-height: 88px; padding: 8px 4px 8px; border-bottom-width: 6px; }
.pads.compact .pad .pn { width: 30px; height: 30px; line-height: 30px; font-size: 17px; }
.pads.compact .pad .pname { font-size: 15px; }
.pads.compact .pad .pscore b { font-size: 20px; }
.pads.compact .pad .pkey { top: 3px; left: 4px; }
.pads.compact .pad .pkey kbd { font-size: 13px; min-width: 1.4em; line-height: 1.4; }
.pads.compact .pad .pbadge { margin-top: 2px; font-size: 12px; padding: 0 5px; line-height: 1.45; border-width: 1.5px; }
.pads.compact .pad .pbadge .dt { display: none; }
.pads.compact .pad.win .pbadge.first { font-size: 13px; }
@media (max-width: 480px) { .pads.compact.n5, .pads.compact.n6, .pads.compact.n7, .pads.compact.n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pads.compact .pad .pkey { display: none; } }
@media (max-width: 480px) { .pad { min-height: 112px; } .pads.n7 .pad, .pads.n8 .pad { min-height: 92px; } .pads:not(.compact).n7 .pad .pn, .pads:not(.compact).n8 .pad .pn { width: 32px; height: 32px; line-height: 32px; font-size: 18px; } }

/* 司会のボタン */
.host { justify-content: center; }
.host .btn { min-width: 7em; min-height: 52px; font-size: 19px; }

/* 大きく表示（フルスクリーン） */
.stage:fullscreen { overflow: auto; padding: 16px 24px; border: 0; border-radius: 0; background: var(--bg); }
.stage:fullscreen .board-wrap { max-width: none; }
.stage:fullscreen .pads:not(.compact) .pad { min-height: calc((100vh - 280px) / 2); }
.stage:fullscreen .pads:not(.compact) .pad .pn { width: 64px; height: 64px; line-height: 64px; font-size: 36px; }
.stage:fullscreen .pads:not(.compact) .pad .pname { font-size: 28px; }
.stage:fullscreen .pads:not(.compact) .pad .pscore b { font-size: 44px; }
.stage:fullscreen .ask { font-size: 36px; max-width: none; }
.stage:fullscreen .card { max-width: none; }
.stage:fullscreen .opts { max-width: 900px; }
.stage:fullscreen .opt { font-size: 28px; min-height: 80px; }

/* ---------- 設定: 名前とキー ---------- */
details.names { margin-top: 10px; }
details.names summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 700; color: var(--accent); }
.name-rows { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.name-row { display: flex; align-items: center; gap: 8px; }
.name-row .pn { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--pc); color: var(--pi); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.name-row .nm { flex: 1 1 auto; min-width: 0; }
.name-row input, .name-row select {
  font: inherit; font-size: 17px; min-height: var(--tap); border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 0 8px;
}
.name-row input { width: 100%; }
.name-row .ky { display: flex; align-items: center; gap: 4px; flex: none; font-size: 15px; color: var(--ink-sub); }
.name-row input:focus-visible, .name-row select:focus-visible { outline: 3px solid var(--warn); outline-offset: 1px; }
.sub-choices { margin-top: 8px; }

/* ---------- 結果 ---------- */
/* 結果は流れの中に置く（問題・ボタンを隠すので、盤の高さが無くなっても切れないように） */
.result-box { position: relative; inset: auto; margin: 0 auto; max-width: 560px; }
.rlist { list-style: none; padding: 0; margin: 8px 0 12px; text-align: left; display: block !important; }
.rlist li { display: grid !important; grid-template-columns: 1.6em 1fr auto; gap: 2px 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.rlist .m { font-weight: 800; } .rlist .m.ok { color: var(--ok); } .rlist .m.ng { color: var(--ng); } .rlist .m.none { color: var(--ink-sub); }
.rlist .qq { grid-column: 2; }
.rlist .x { grid-column: 2; color: var(--ink-sub); font-weight: 700; }
.rlist .p { grid-column: 3; grid-row: 1; font-size: 17px; }
.rlist.rank li { grid-template-columns: 3em 20px 1fr auto; align-items: center; }
.rlist.rank .pl { font-weight: 800; }
.rlist.rank .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--pc); border: 2px solid var(--ink); }
.rlist.rank .nm { font-weight: 700; }
.rlist.rank b { font-size: 20px; }
.rlist.rank .sub { grid-column: 3 / 5; font-size: 14px; color: var(--ink-sub); }
.rlist rt { font-weight: 400; }
.result-box .note { font-size: 15px; }

@media (max-width: 480px) {
  .ask { font-size: 21px; }
  .opt { font-size: 19px; min-height: 56px; }
  .opt.long { font-size: 16px; }
  .host .btn { min-width: 0; flex: 1 1 0; padding: 0 10px; }
}

/* iPhone の「連絡先を自動入力」を出さないため入力欄は type=search（要望No.87）。検索欄の見た目は消す */
input[type=search]{-webkit-appearance:none;appearance:none}
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{display:none;-webkit-appearance:none}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
