html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.kukubomb-wrapper {
  width: 100%;
  max-width: 800px; /* 例えば PC での最大幅 */
  margin-left: auto;
  margin-right: auto;
  padding: 0; /* ← container のパディングを継承させない */
  height: 100%;
  position: relative;
}

.kukubomb-game {
  position: relative;
  width: 100%;
  height: 100%;
}

.ui-overlay.three-line-ui {
  position: absolute;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.3em 0.6em;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

#timer.timer-bar {
  align-self: center;
  width: 60%;
  height: 16px;
  background-color: #444;
  border-radius: 10px;
  overflow: hidden;
}

#timer-fill {
  height: 100%;
  width: 100%;
  background-color: #4caf50;
  transition: width 1s linear;
}

#question-overlay.question-centered {
  text-align: center;
  font-size: min(6vw, 28px);
  font-weight: bold;
  color: #03a9f4;
  text-shadow: 2px 2px 4px #000;
  pointer-events: none;
  z-index: 5;
}

.stats-line {
  display: flex;
  justify-content: flex-end;
  gap: 0.8em;
  font-size: 14px;
  color: #03a9f4;
  text-shadow: 1px 1px 1px #000;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ゲームオーバー＆カウントダウン表示の共通設定 */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto; /* 背後にあるcanvasの操作を許可 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.countdown-text {
  font-size: 4rem;
  color: #fff;
  text-shadow: 2px 2px 8px #000;
  font-weight: bold;
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
}

/* スマホ向け調整（画面幅が480px以下） */
@media (max-width: 480px) {
  .countdown-text {
    font-size: 2rem;
  }
}

.gameover-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #ff5050;
  text-shadow: 2px 2px 10px #000;
  font-weight: bold;
  text-align: center;
}

#final-score {
  font-size: 1.5rem;
  color: #fff;
  margin-top: 1rem;
}

.hidden {
  display: none;
}

.gameover-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#submit-score-btn,
#retry-btn {
  font-size: 1rem;
  padding: 8px 16px;
}

.btn {
  background: transparent;
  border: 2px solid #0f0;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  transition: all 0.2s;
}