* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  max-width: 1560px;
  min-width: 1240px;
  margin: 25px auto;
  color: #333;
  line-height: 1.5;
}

.container * {
  box-sizing: border-box;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.1rem;
  max-width: 90%;
  opacity: 0.85;
  margin: 0 auto;
}

.game-area {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.game-board {
  position: relative;
  border: 10px solid #333;
  box-shadow: 0 0 0 2px #4CAF50;
  background: #000;
  height: 820px;
}

#game-canvas {
  display: block;
  background: #000;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.game-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.game-overlay h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #f44336;
  text-shadow: 0 0 10px #f44336;
}

.game-overlay p {
  font-size: 1.5rem;
  margin-bottom: 25px;
  color: #fff;
}

.btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1rem;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid #2E7D32;
}

.btn:hover {
  background: #2E7D32;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

#pause-btn {
  background: #FF9800;
  /* 橙色区别于开始按钮 */
  border-color: #E65100;
}

#pause-btn:hover {
  background: #E65100;
}

.game-info {
  background: #111;
  border: 2px solid #333;
  padding: 20px;
  width: 450px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.score-container {
  text-align: center;
  padding: 15px;
  background: #000;
  border: 2px solid #333;
}

.score-title {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 5px;
}

.score-value {
  font-size: 2.4rem;
  font-weight: bold;
  color: #4CAF50;
  text-shadow: 0 0 10px #4CAF50;
}

.controls {
  background: #000;
  border: 2px solid #333;
  padding: 15px;
}

.controls h3 {
  font-size: 1.4rem;
  color: #4CAF50;
  margin-bottom: 15px;
  text-shadow: 0 0 5px #4CAF50;
}

.controls ul {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
}

.controls li {
  width: calc(50% - 5px);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ddd;
  font-size: 0.95rem;
}

.key {
  display: inline-block;
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 0;
  min-width: 56px;
  text-align: center;
  font-weight: bold;
  border: 1px solid #555;
}

.instructions {
  background: #000;
  border: 2px solid #333;
  padding: 15px;
}

.game-info h3 {
  font-size: 1.2rem;
  color: #4CAF50;
  margin-bottom: 10px;
}

.instructions p {
  margin-top: 6px;
  color: #ddd;
  font-size: 0.95rem;
}

.difficulty {
  display: flex;
  gap: 15px;
}

.difficulty-btn {
  flex: 1;
  padding: 10px;
  background: #333;
  color: #ddd;
  border: 1px solid #555;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}

.difficulty-btn.active {
  background: #4CAF50;
  color: white;
  border-color: #2E7D32;
}

.speed-indicator {
  height: 20px;
  background: #222;
  border: 1px solid #333;
  margin-top: 15px;
  overflow: hidden;
  position: relative;
}

.speed-fill {
  height: 100%;
  background: #4CAF50;
  width: 0%;
  transition: width 0.3s;
}

.speed-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #aaa;
  font-size: 0.8rem;
}

footer {
  margin-top: 25px;
  text-align: center;
}

footer p {
  color: #666;
  font-size: 0.9rem;
}

.game-border {
  position: absolute;
  border: 2px solid #4CAF50;
  pointer-events: none;
}

.game-border.top {
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
}

.game-border.right {
  top: 0;
  right: -2px;
  bottom: 0;
  width: 2px;
}

.game-border.bottom {
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
}

.game-border.left {
  top: 0;
  left: -2px;
  bottom: 0;
  width: 2px;
}
