/* 「早く押せ」固有の盤面。共通UIは ../css/game-common.css。 */

.game-area { width: 100%; }

.qp-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.qp-prompt {
  margin: 0;
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* 既存の4択カードに近い角丸四角のボタン。位置は動かさない。 */
.qp-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.qp-count-1 { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
.qp-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.qp-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.qp-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 132px;
  margin: 0;
  padding: 8px 6px;
  border: 3px solid #b9c7ad;
  border-radius: 16px;
  background: #f3f5ee;
  color: #3c4a40;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  box-sizing: border-box;
  box-shadow: 0 3px 0 rgba(52, 75, 64, 0.18);
  /* 文字と色の切り替えは一瞬で行う。点滅や移動のアニメーションは付けない。 */
  transition: none;
}
.qp-btn:disabled { cursor: default; }
.qp-btn-label {
  display: block;
  max-width: 100%;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

/* 色。GO（go）と待機中の緑（green）は同じ見た目にし、色だけでは合図にならないようにする。 */
.qp-btn[data-tone="neutral"] { background: #f3f5ee; border-color: #b9c7ad; color: #3c4a40; }
.qp-btn[data-tone="red"] { background: #d8402f; border-color: #8f1f14; color: #fff; }
.qp-btn[data-tone="blue"] { background: #2b6dcc; border-color: #173f7d; color: #fff; }
.qp-btn[data-tone="yellow"] { background: #f1c93a; border-color: #8a6a00; color: #3d2f00; }
.qp-btn[data-tone="green"],
.qp-btn[data-tone="go"] { background: #2f9b57; border-color: #175c32; color: #fff; }
.qp-btn[data-tone="red"] .qp-btn-label,
.qp-btn[data-tone="blue"] .qp-btn-label,
.qp-btn[data-tone="green"] .qp-btn-label,
.qp-btn[data-tone="go"] .qp-btn-label { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }

.qp-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
html.is-keyboard-nav .qp-btn:focus-visible { outline: 3px solid #d88635; outline-offset: 2px; }

.qp-badge {
  position: absolute;
  top: -9px;
  right: -7px;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(52, 75, 64, 0.3);
}
.qp-btn.is-correct { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--green); }
.qp-btn.is-correct .qp-badge { display: flex; background: var(--green); }
.qp-btn.is-correct .qp-badge::before { content: "○"; }
.qp-btn.is-wrong { border-style: dashed; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #b42318; }
.qp-btn.is-wrong .qp-badge { display: flex; background: #b42318; }
.qp-btn.is-wrong .qp-badge::before { content: "×"; }
.qp-btn.is-dim { opacity: 0.55; }

/*
 * 終了表示（共通の #finish-overlay / .finish-mark）は文字選択できる。最後に押した直後の連打・ダブルタップが
 * 画面中央に出た「終了！」へ当たると、単語区切りで「！」だけが選択され、ブラウザの青い選択背景が付いていた。
 * このゲームでは押した位置にそのまま終了表示が重なるので、終了表示だけ選択できないようにする（focus 表示は変えない）。
 */
.game-page .finish-overlay,
.game-page .finish-overlay .finish-mark {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* スマートフォン幅: 3個は縦に並べ、1個あたりのタップ領域を広く取る。 */
@media (max-width: 430px) {
  .qp-prompt { font-size: 17px; min-height: 2.6em; }
  .qp-grid { gap: 10px; }
  .qp-count-1 .qp-btn { min-height: 128px; }
  .qp-count-2 .qp-btn { min-height: 112px; }
  .qp-count-3 { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
  .qp-count-3 .qp-btn { min-height: 76px; }
  .qp-btn-label { font-size: 26px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .qp-wrap { gap: 6px; }
  .qp-prompt { min-height: 1.6em; font-size: 15px; }
  .qp-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; }
  .qp-btn,
  .qp-count-1 .qp-btn,
  .qp-count-2 .qp-btn,
  .qp-count-3 .qp-btn { min-height: 72px; }
  .qp-btn-label { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-btn:active:not(:disabled) { transform: none; }
}
