* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #1a0a00;
  background-image:
    radial-gradient(ellipse at center, #2d1500 0%, #0d0500 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  font-family: 'Georgia', 'Times New Roman', serif;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  position: relative;
  display: inline-block;
  box-shadow:
    0 0 60px rgba(255, 180, 50, 0.15),
    0 0 120px rgba(255, 140, 0, 0.08),
    inset 0 0 0 2px rgba(255, 200, 100, 0.1);
  border-radius: 8px;
}

canvas {
  display: block;
  border-radius: 6px;
  cursor: crosshair;
}

#ui-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

#info-panel {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  font-size: 15px;
  color: #d4c5a0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  letter-spacing: 0.5px;
}

#info-panel span {
  color: #ffcc66;
  font-weight: bold;
  font-size: 18px;
}

#bgm-toggle {
  background: rgba(255,200,100,0.12);
  border: 1px solid rgba(200,170,100,0.3);
  color: #c0b080;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bgm-toggle:hover { background: rgba(255,200,100,0.25); color: #ffcc66; }
#bgm-toggle.on { background: rgba(255,200,100,0.3); color: #ffcc66; border-color: #ffcc66; }

#message {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #c0b080;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  letter-spacing: 0.5px;
  transition: opacity 0.4s;
}

#power-bar-container {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 200px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(200,170,100,0.3);
  border-radius: 9px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}

#power-bar-container.active {
  opacity: 1;
}

#power-bar-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #ff4400, #ff8800, #ffcc00, #44ff44);
  border-radius: 9px;
  transition: height 0.05s linear;
}

#power-bar-label {
  position: absolute;
  bottom: -22px;
  width: 100%;
  text-align: center;
  color: #c0b080;
  font-size: 10px;
  letter-spacing: 1px;
}

#friction-control {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #c0b080;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: auto;
}

#friction-control label {
  white-space: nowrap;
}

#friction-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to right, #44aa44, #aaaa44, #cc4400);
  outline: none;
  cursor: pointer;
}

#friction-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffcc66;
  border: 2px solid #8b5e3c;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(255,200,100,0.5);
}

#friction-label {
  color: #ffcc66;
  font-weight: bold;
  min-width: 18px;
  text-align: center;
}

/* 响应式 */
@media (max-width: 1100px) {
  #power-bar-container {
    right: 8px;
    top: auto;
    bottom: 60px;
    transform: none;
    width: 120px;
    height: 12px;
    border-radius: 6px;
  }
  #power-bar-fill {
    bottom: auto;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: 6px;
    background: linear-gradient(to right, #ff4400, #ff8800, #ffcc00, #44ff44);
  }
}
