/* 🌈 通用基础样式 */
body {
  margin: 0;
  background: linear-gradient(to bottom, #eaf3ff, #dce7f5);
  font-family: 'Segoe UI', sans-serif;
  color: #2c3e50;
  overflow: hidden;
}

/* 🎮 游戏区域样式 */
#game-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%); /* 上移避免被遮挡 */
  text-align: center;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-width: 90vw;
}

#game-area h1 {
  margin: 0;
  font-size: 24px;
  color: #2c3e50;
}

#start-btn {
  background: #ffffff;
  color: #3498db;
  border: 2px solid #3498db;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-top: 12px;
}

#start-btn:hover {
  background: #3498db;
  color: white;
}

#game-box {
  margin-top: 20px;
  width: 300px;
  height: 300px;
  background-color: #f4faff;
  border: 1px solid #3498db;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: inset 0 0 8px rgba(52, 152, 219, 0.15);
  margin-left: auto;
  margin-right: auto;
}

.bug {
  width: 20px;
  height: 20px;
  background-color: #e74c3c;
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(231, 76, 60, 0.6);
  transition: transform 0.1s;
}

.bug:hover {
  transform: scale(1.3);
}

#score-display {
  margin-top: 10px;
  color: #2c3e50;
  font-weight: bold;
}

/* 📊 指标样式通用部分 */
.metric {
  white-space: nowrap;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  transition: color 0.2s ease;
}

/* PC 滚动条美化可删除 */
#metrics::-webkit-scrollbar {
  width: 6px;
}
#metrics::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* 💻 PC 端 - 展开完整指标，不滚动 */
@media (min-width: 769px) {
  #metrics-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
  }

  #toggle-metrics {
    display: none;
  }

  #metrics {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    max-width: none;
    max-height: none;
    overflow: visible;
  }
}

/* 📱 移动端 - 折叠面板 */
@media (max-width: 768px) {
  #metrics-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 999;
  }

  #toggle-metrics {
    display: inline-block;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 15px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  #metrics {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
    font-size: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
    max-width: 95vw;
    max-height: 35vh;
    overflow-y: auto;
  }

  #metrics.expanded {
    display: flex;
  }

  .metric {
    margin-bottom: 0;
  }
}

