/* 色と文字のテスト 固有の見た目（共通は ../common/base.css）。問題の文字のインクとボタンの見本は決まった色（ダーク表示でも変えない）。
   カードの地は --board（ダークでも明るい生成り）なので、カードの中の文字は決まった色 */
[hidden] { display: none !important; }

.board-wrap { position: relative; }
.card {
  background: var(--board); color: #1F2328; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px 12px; display: flex; flex-direction: column; align-items: center;
}
.hud { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; font-size: 15px; color: #5B616B; min-height: 30px; }
.hud #hud-l { text-align: left; font-weight: 700; color: #1F2328; font-size: 17px; white-space: nowrap; }
.hud #hud-r { text-align: right; }
.hud .clock { font-size: 20px; font-weight: 700; color: #1F2328; }
.hud .clock.low { color: #9A6415; }
.meter, .qbar { width: 100%; max-width: 560px; height: 8px; margin-top: 4px; border-radius: 999px; background: #E6E2D8; overflow: hidden; }
.meter i, .qbar i { display: block; height: 100%; width: 100%; background: #2F5D8A; border-radius: 999px; transform-origin: left center; }
.meter.low i { background: #9A6415; }
.qbar { max-width: 240px; height: 6px; margin-top: 2px; }
.qbar i { background: #5B616B; }
.qbar.low i { background: #9A6415; }
.qbar.off { visibility: hidden; }

/* 問い（何を答えるか）。インクの色＝塗りつぶし、書いてある文字＝点線の枠（色だけで区別しない） */
.ask {
  margin-top: 10px; min-height: 36px; padding: 4px 16px; border-radius: 999px; font-size: 17px; font-weight: 700; line-height: 1.6;
  display: inline-flex; align-items: center; gap: 6px; border: 2px solid transparent;
}
.ask:empty { visibility: hidden; }
.ask[data-ask="ink"] { background: #2F5D8A; color: #FFFFFF; border-color: #2F5D8A; }
.ask[data-ask="word"] { background: #FFFFFF; color: #1F2328; border: 2px dashed #1F2328; }

/* 問題の文字。どの色にも同じ細い縁取り（明るい黄色も読めるように） */
.plate { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 112px; margin-top: 4px; }
.word {
  font-size: clamp(56px, 15vw, 92px); font-weight: 800; line-height: 1.15; letter-spacing: .04em;
  -webkit-text-stroke: 1.5px rgba(31, 35, 40, .45); paint-order: stroke fill;
  user-select: none; -webkit-user-select: none;
}
:root:lang(en) .word { letter-spacing: .02em; font-size: clamp(48px, 13vw, 84px); }
.card.veil .word, .card.veil .ask { visibility: hidden; }
.card.veil .answers { opacity: .45; pointer-events: none; }
.card.done .answers { opacity: .45; pointer-events: none; }
.card.done .qbar { visibility: hidden; }

.fb { min-height: 1.6em; margin: 4px 0 6px; font-size: 17px; font-weight: 700; color: #1F2328; text-align: center; line-height: 1.6; }
.fb.ok { color: #2E7D4F; }
.fb.ng { color: #B23A3A; }

/* 答えのボタン（並びは遊んでいる間は変わらない）。色の見本＋色の名前（問題の文字とは別の位置）＋キー */
.answers { width: 100%; max-width: 600px; display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 4), 1fr); touch-action: manipulation; }
.answers[data-n="4"] { --cols: 4; }
.answers[data-n="5"] { --cols: 5; }
.answers[data-n="6"] { --cols: 6; }
.ans {
  appearance: none; position: relative; min-height: 64px; padding: 16px 4px 6px; border-radius: 8px; cursor: pointer;
  background: #FFFFFF; color: #1F2328; border: 2px solid #858891; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 2px 0 rgba(31, 35, 40, .18); -webkit-tap-highlight-color: transparent;
}
.ans:active { transform: translateY(1px); box-shadow: none; }
.ans .sw { display: block; width: 70%; max-width: 64px; height: 16px; border-radius: 4px; }
.ans .nm { font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.ans .k { position: absolute; top: 1px; right: 5px; font-size: 12px; line-height: 1.2; color: #5B616B; font-variant-numeric: tabular-nums; }
.ans.hit { border-color: #2E7D4F; box-shadow: 0 0 0 3px #2E7D4F; }
.ans.right { border-color: #2F5D8A; box-shadow: 0 0 0 4px #2F5D8A; }
.ans.ng { border-color: #B23A3A; background: #FBEDEC; }
.ans.ng::after { content: '×'; position: absolute; top: 0; left: 6px; color: #B23A3A; font-weight: 800; font-size: 18px; }
.ans:focus-visible { outline: 3px solid #2F5D8A; outline-offset: 2px; }
@media (hover: none) { .ans .k { display: none; } .ans { padding-top: 8px; } }

/* 一時停止 */
.pause-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(251, 250, 246, .94); border-radius: var(--radius); color: #1F2328; z-index: 4; text-align: center; padding: 16px; }
.pause-box p { margin: 0; font-size: 18px; font-weight: 700; }
.callout { z-index: 3; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
#play .controls { justify-content: center; margin-top: 8px; }

/* 設定: 色のセットの見本 */
.hint.chips { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--ink); }
.chip i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .2); }
.chip-note { flex-basis: 100%; font-size: 14px; color: var(--ink-sub); }

/* 結果（盤の下に） */
.result-box { position: static; margin: 10px auto 0; max-width: 600px; }
.result-box h2 { margin-top: 0; font-size: 1.3rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.stats div { border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 4px; background: var(--surface); text-align: center; }
.stats b { display: block; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { font-size: 14px; color: var(--ink-sub); line-height: 1.4; display: block; }
.stats .main b { color: var(--ok); }
.result-box .best { display: inline-block; font-size: 14px; color: var(--ok); border: 1.5px solid var(--ok); border-radius: 999px; padding: 0 8px; font-weight: 700; }
.result-box .best-line { margin: 0 0 6px; }
.result-box .small { margin: 6px 0 2px; font-size: 15px; color: var(--ink-sub); text-align: left; }
.kinds { border-collapse: collapse; margin: 4px auto 6px; font-variant-numeric: tabular-nums; }
.kinds th, .kinds td { border: 1px solid var(--line); padding: 2px 12px; text-align: center; }
.kinds th { font-size: 14px; color: var(--ink-sub); font-weight: 700; }
.kinds td:first-child { text-align: left; }
.result-box .note { color: var(--ink-sub); font-size: 15px; }
.small-note { font-size: 14px; color: var(--ink-sub); }

@media (max-width: 560px) {
  .answers[data-n="4"] { --cols: 2; }
  .answers[data-n="5"], .answers[data-n="6"] { --cols: 3; }
  .ans { min-height: 58px; }
}
@media (max-width: 480px) {
  .stage { padding: 8px; }
  .card { padding: 8px 6px 10px; }
  .plate { min-height: 96px; }
  .controls .btn.icon { padding: 0 10px; }
  .stats b { font-size: 24px; }
  #controls-btn { display: none; } /* 操作のしかたはゲームのすぐ下にあるので、スマホ幅ではボタンを1行に収める */
}
/* 上のバーの高さを一定に（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; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
