/* すべての要素に対してボックスサイズをborder-boxに設定 */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* html全体の余白と高さ設定 */
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;
  background-image: url("assets/bg.png");
  background-size: cover;
  background-position: center;
  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 {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

/* 問題画像 */
.target-image {
  width: 300px;
  height: 300px;
  object-fit: contain;
}

/* シルエット表示（画像を黒くする） */
.silhouette {
  filter: brightness(0);
}

/* 選択肢エリア */
.choice-area {
  width: min(900px, 100%);
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  margin-top: 10px;
  margin-bottom: 4px;
}

/* 選択ボタン */
.choice-btn {
  flex: 1;
  min-width: 0;
  padding: 18px 12px;
  font-size: 28px;
  font-weight: bold;
  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.wrong {
  background-color: #ccc;
  box-shadow: none;
}

/* 無効状態（クリック不可） */
.choice-btn.disabled {
  pointer-events: none;
}

/* 無効時ホバー */
.choice-btn.disabled:hover {
  transform: none;
  background-color: #4cc9f0;
}

/* 不正解で無効になったボタンのホバー */
.choice-btn.wrong.disabled:hover {
  background-color: #ccc;
}

/* 判定マーク表示用のコンテナ */
.judge-mark {
  position: absolute;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

/* 判定マーク表示状態 */
.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;
}

/* 新記録メッセージ */
.new-record {
  font-size: 24px;
  font-weight: bold;
  color: #f59e0b;
  margin: 4px 0;
  min-height: 32px;
}

/* スマホ向け微調整 */
@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 {
    padding: 8px 10px 10px;
  }

  .target-image {
    width: 150px;
    height: 150px;
  }

  .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;
  }

  .new-record {
    font-size: 20px;
  }
}