:root {
  --bg-color: #1e1e1e;
  --text-color: #ffffff;
  --ui-bg: rgba(0, 0, 0, 0.5);
  --accent-color: #0f0;
  --tooltip-bg: rgba(0, 0, 0, 0.7);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: sans-serif;
  user-select: none;
}
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}
canvas, #gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.hud {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  background: var(--ui-bg);
  padding: 8px;
  border-radius: 4px;
  z-index: 10;
  font-size: 14px;
  color: var(--accent-color);
}
.hud > * + * {
  margin-top: 4px;
}
#inventory.hud {
  top: auto;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  gap: 8px;
}
#inventory.hud > * + * {
  margin-top: 0;
}
#inventory .slot {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--text-color);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s;
}
#inventory .slot.selected {
  border-color: var(--accent-color);
}
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-color);
  font-size: 18px;
  z-index: 100;
}
#overlay-message {
  font-size: 24px;
  margin-bottom: 16px;
}
.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--tooltip-bg);
  color: var(--text-color);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 20;
}
@media (max-width: 600px) {
  .hud {
    padding: 6px;
    font-size: 12px;
  }
  .hud > * + * {
    margin-top: 2px;
  }
  #inventory.hud {
    bottom: 10px;
    padding: 6px;
    gap: 4px;
  }
  #inventory .slot {
    width: 28px;
    height: 28px;
  }
  .overlay {
    font-size: 16px;
  }
  #overlay-message {
    font-size: 20px;
    margin-bottom: 12px;
  }
  .tooltip {
    font-size: 10px;
    padding: 2px 4px;
  }
}