/* すべての要素のボックスサイズを border-box に設定（paddingやborderを含めたサイズ計算にする） */
* {
  box-sizing: border-box;
}

/* html全体の余白をなくし、高さを100%にする */
html {
  margin: 0;
  height: 100%;
}

/* bodyの基本設定：中央配置＆フォント設定 */
body {
  margin: 0;
  height: 100vh;
  font-family: sans-serif;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ゲーム全体のコンテナ */
.container {
  margin: 0 auto;
  background: #fff;
  border: 2px solid #333;
  width: 100%;
  max-width: 1196px;
  height: 540px;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* ヘッダー全体 */
.game-header {
  height: 50px;
  padding: 8px 14px;
  flex: 0 0 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* 左側のヘッダー（問題数表示など） */
.header-left {
  justify-self: start;
  font-weight: bold;
  font-size: 20px;
  color: #333;
  white-space: nowrap;
  min-height: 24px;
}

/* 中央タイトル */
.header-center {
  justify-self: center;
  font-weight: bold;
  font-size: 22px;
  color: #333;
  text-align: center;
  white-space: nowrap;
}

/* 右側のヘッダー */
.header-right {
  justify-self: end;
  font-weight: bold;
  font-size: 20px;
  color: #333;
  min-height: 24px;
  white-space: nowrap;
}

/* メインエリア */
.game-main {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* 共通ボタンデザイン */
.btn {
  padding: 18px 40px;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 999px;
  background: #18c56e;
  color: white;
  cursor: pointer;
  box-shadow: 0 6px #0e9f56;
  transition: all 0.15s ease;
}

/* ホバー時の色変更 */
.btn:hover {
  background: #1edc7c;
}

/* 押したときのアニメーション */
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px #0e9f56;
}

/* ゲーム画面（初期は非表示） */
.game-panel {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 28px 40px;
  position: relative;
}

/* 画像エリア全体 */
.image-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 画像表示枠 */
#imageWindow {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: none;
  border-radius: 0;
  position: relative;
  background: #fff;
}

/* クイズ対象の画像 */
#targetImage {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  display: block;
  opacity: 0;
  background: #fff;
}

/* 選択肢ボタンエリア */
.choice-area {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 10;

  width: min(900px, 90%);
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}

/* 各選択肢ボタン */
.choice-btn {
  flex: 1;
  min-width: 0;
  padding: 18px 12px;
  font-size: 22px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  background-color: #4cc9f0;
  color: white;
  transition: 0.2s;
  box-shadow: 0 5px rgba(0, 0, 0, 0.15);
}

/* ホバー時 */
.choice-btn:hover {
  transform: translateY(-1px);
  background-color: #5fd3f5;
}

/* 押したとき */
.choice-btn:active {
  transform: scale(0.96);
}

/* 無効時 */
.choice-btn:disabled {
  pointer-events: none;
  opacity: 0.9;
}

/* 正解・不正解マーク */
.judge-mark {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

/* 表示状態 */
.judge-mark.show {
  display: flex;
}

/* 正解マーク（◯） */
.judge-mark.correct::before {
  content: "◯";
  font-size: 190px;
  line-height: 1;
  color: rgba(255, 140, 0, 0.72);
  font-weight: bold;
}

/* 不正解マーク（×） */
.judge-mark.wrong::before {
  content: "×";
  font-size: 180px;
  line-height: 1;
  color: rgba(60, 130, 255, 0.78);
  font-weight: bold;
}

/* 結果画面 */
.result {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

/* 結果タイトル */
.result-title {
  margin: 0;
  font-size: 34px;
  color: #333;
}

/* 結果テキスト */
.result-text {
  margin: 0;
  font-size: 30px;
  font-weight: bold;
  color: #333;
}

/* スマホ対応 */
@media (max-width: 768px) {
  .game-header {
    padding: 8px 10px;
  }

  .header-left,
  .header-right {
    font-size: 15px;
  }

  .header-center {
    font-size: 18px;
  }

  .btn {
    padding: 16px 32px;
    font-size: 22px;
  }

/* スマホ用ゲームパネル */
.game-panel {
  width: 100%;
  height: 100%;
  display: none;
  position: relative;
  overflow: hidden;
  padding: 0;
}

  /* 画像サイズ縮小 */
  #imageWindow {
    width: 230px;
    height: 230px;
    border-width: 6px;
  }

  /* 選択肢間隔 */
  .choice-area {
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 2px;
  }

  /* ボタンサイズ縮小 */
  .choice-btn {
    font-size: 18px;
    padding: 14px 8px;
    border-radius: 28px;
  }

  /* マークサイズ縮小 */
  .judge-mark.correct::before {
    font-size: 150px;
  }

  .judge-mark.wrong::before {
    font-size: 145px;
  }

  /* 結果文字サイズ */
  .result-title {
    font-size: 30px;
  }

  .result-text {
    font-size: 24px;
  }
}