/* ============================================
   GAME UI — ゲームページ共通部品
   (キャンバスラッパー / オーバーレイ / 凡例 / パネル)
   ============================================ */

/* ----- キャンバス / ステージのラッパー ----- */
.gameui-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.gameui-wrap--block {
  display: block;
  width: 100%;
}

/* ----- キャンバス ----- */
.gameui-canvas {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  touch-action: none; /* ドラッグ/スワイプでページがスクロールしないように */
}

.gameui-canvas--nocursor { cursor: none; }

/* ----- スタート/結果オーバーレイ ----- */
.gameui-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: var(--radius);
  z-index: 10;
  padding: 20px;
  text-align: center;
}

.gameui-overlay h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.gameui-overlay p {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.9;
}

/* ----- 凡例 (パワーアップ説明など) ----- */
.gameui-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gameui-legend span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}

/* ----- DOMゲーム用パネル ----- */
.gameui-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* ----- モード/難易度の選択ボタン群 ----- */
.gameui-modes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.gameui-mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.gameui-mode-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gameui-mode-btn.is-active {
  background: linear-gradient(135deg, rgba(148, 128, 255, 0.25), rgba(78, 232, 223, 0.15));
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(148, 128, 255, 0.25);
}

/* ----- 結果表示の統計グリッド ----- */
.gameui-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.gameui-stat {
  text-align: center;
}

.gameui-stat__value {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
}

.gameui-stat__label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
