* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  font-family: Arial, sans-serif;
  padding: 20px;
}
.game-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 100%;
}
h1 {
  color: #e63946;
  margin-bottom: 15px;
  font-size: 2.2rem; /* 恢复电脑端标题大小 */
}
.score {
  font-size: 1.2rem;
  color: #2a9d8f;
  margin-bottom: 15px;
  font-weight: bold;
}
#gameCanvas {
  border: 3px solid #264653;
  border-radius: 12px;
  background: #f8f9fa;
  width: 100%;
  height: auto;
  max-width: 400px; /* 限制电脑端画布宽度 */
}
.btn-group {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}
.game-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #2a9d8f, #264653);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.game-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(42, 157, 143, 0.4);
}
/* 手机端方向按键（仅手机显示，不影响电脑） */
.mobile-controls {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  display: none;
}
.dir-btn {
  width: 65px;
  height: 65px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #ff6b6b);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.dir-btn:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, #d62828, #e63946);
}
.dir-middle {
  display: flex;
  gap: 8px;
}
/* 仅手机端显示按键 */
@media (max-width: 768px) {
  .mobile-controls {
    display: flex;
  }
  .game-panel {
    max-width: 100%;
  }
  h1 {
    font-size: 1.8rem; /* 手机端标题适配 */
  }
}