/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #eee;
}

/* 游戏主容器 */
.game-container {
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

/* 标题 */
h1 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #e94560;
  text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

/* 信息栏 */
.info-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 16px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item .label {
  color: #94a3b8;
  font-size: 14px;
}

.info-item span:not(.label) {
  font-weight: bold;
  color: #f8fafc;
}

select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #eee;
  font-size: 14px;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #e94560;
}

/* 画布包装器 */
.canvas-wrapper {
  position: relative;
  display: inline-block;
  margin: 0 auto 16px;
}

#gameCanvas {
  display: block;
  background: #0d1b2a;
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5),
              0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 游戏结束遮罩 */
.game-over-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-over-mask.hidden {
  display: none;
}

.game-over-content {
  text-align: center;
}

.game-over-content h2 {
  color: #e94560;
  font-size: 24px;
  margin-bottom: 12px;
}

.game-over-content p {
  margin-bottom: 20px;
  font-size: 18px;
}

.game-over-content #finalScore {
  font-weight: bold;
  color: #4ade80;
}

.game-over-content button {
  padding: 12px 28px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background: #e94560;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.game-over-content button:hover {
  background: #ff6b6b;
  transform: scale(1.05);
}

/* 暂停遮罩 */
.pause-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pause-mask.hidden {
  display: none;
}

.pause-mask p {
  font-size: 20px;
  color: #f8fafc;
}

.pause-mask .hint {
  font-size: 14px;
  color: #94a3b8;
}

/* 操作说明 */
.instructions {
  margin-bottom: 16px;
  padding: 10px;
  font-size: 13px;
  color: #94a3b8;
}

/* 控制按钮 */
.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.controls button {
  padding: 10px 24px;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

#startBtn {
  background: #22c55e;
  color: white;
}

#startBtn:hover:not(:disabled) {
  background: #16a34a;
  transform: scale(1.03);
}

#pauseBtn {
  background: #64748b;
  color: white;
}

#pauseBtn:hover:not(:disabled) {
  background: #475569;
  transform: scale(1.03);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
