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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #121024;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #fff;
  user-select: none;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px;
}

#topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#hpBox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 16, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
}

#hpBarWrap {
  width: 140px;
  height: 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  overflow: hidden;
}

#hpBar {
  width: 50%;
  height: 100%;
  background: #5ad868;
  transition: width 0.08s linear, background-color 0.2s ease;
}

#topActions {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

#modeBadge {
  background: rgba(15, 16, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

button {
  background: rgba(28, 30, 56, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: rgba(52, 56, 98, 0.95);
}

#prompt {
  align-self: center;
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
  color: #ffe875;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  min-height: 22px;
}

#hints {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

#menuPanel {
  position: fixed;
  top: 60px;
  right: 18px;
  width: 280px;
  background: rgba(18, 20, 38, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#menuPanel.hidden {
  display: none;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-header h2 {
  font-size: 18px;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-section label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row button {
  flex: 1;
}

input[type="range"] {
  width: 100%;
  accent-color: #ff9830;
}

.menu-footer p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}