body {
  margin: 0;
  padding: 0;
}

.rocket-box {
  background-image: url(../../img/expression-bg6.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  color: #fff;
  font-family: "Taipei Sans TC Beta", sans-serif;
  text-align: center;
  padding: 2rem;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  box-sizing: border-box;
}

h1 {
  margin-bottom: 1rem;
}

.game-container {
  max-width: 600px;
  margin: 0 auto;
}

.rocket-area {
  height: 50vh;
  position: relative;
  margin-bottom: 2rem;
  overflow: visible;
  /* 確保火箭可以飛出容器範圍 */
}

.rocket-area #rocket {
  width: 150px;
  position: absolute;
  bottom: 0;
  left: calc(50% - 50px);
  transition: bottom 2s cubic-bezier(0.2, 0, 0.8, 1);
  /* 修改過渡效果為加速模式 */
}

.rocket-area.launched #rocket {
  bottom: 200vh;
  /* 增加飛行高度，確保完全飛出視窗 */
  transition: bottom 3s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* 使用更強烈的加速效果 */
}

.buttons-area {
  display: flex;
  flex-wrap: wrap;
  /* 允許按鈕換行 */
  justify-content: center;
  gap: 0.5rem;
  /* 縮小按鈕間距 */
  margin-bottom: 1rem;
}

.number-btn {
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  color: #fff;
  font-size: 1.8rem;
  /* 稍微縮小字體 */
  padding: 0.6rem 1.2rem;
  /* 縮小內邊距 */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.5rem;
  /* 添加下方間距，確保換行時有足夠間距 */
  min-width: 3rem;
  /* 設定最小寬度 */
  max-width: 4.5rem;
  /* 設定最大寬度，確保大數字也能正常顯示 */
}

.number-btn.correct {
  background: linear-gradient(45deg, #00cc66, #009933);
  opacity: 0.7;
}

#message {
  margin-top: 1rem;
  font-size: 1.5rem;
}

#restartBtn {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: #ff6600;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
}

.grid-area {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  max-width: 600px;
  margin: 0 auto;
}

.number-cell {
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  color: #fff;
  font-size: 1.2rem;
  padding: 0.5rem 0;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.number-cell.correct {
  background: #00cc66;
}

.number-cell.wrong {
  animation: shake 0.3s;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }

  100% {
    transform: translateX(0);
  }
}

/* 針對手機螢幕的媒體查詢 */
@media (max-width: 480px) {
  .buttons-area {
    gap: 0.3rem;
    /* 更緊湊的按鈕間距 */
  }

  .number-btn {
    font-size: 1.5rem;
    /* 更小的字體 */
    padding: 0.4rem 0.8rem;
    /* 更小的內邊距 */
    margin-bottom: 0.3rem;
    min-width: 2.5rem;
  }

  #message {
    font-size: 1.2rem;
    /* 縮小信息區域的字體 */
  }
}

/* 針對更小的手機螢幕 */
@media (max-width: 320px) {
  .buttons-area {
    gap: 0.2rem;
  }

  .number-btn {
    font-size: 1.3rem;
    padding: 0.3rem 0.6rem;
    min-width: 2rem;
  }

  #message {
    font-size: 1rem;
  }
}