* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: white;
  text-shadow: 1px 1px 2px black;
  z-index: 10;
}

#inventory-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px;
  border-radius: 5px;
  z-index: 10;
}

.inventory-slot {
  width: 40px;
  height: 40px;
  background-color: rgba(200, 200, 200, 0.3);
  border: 2px solid #555;
  margin: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.inventory-slot.selected {
  border-color: white;
  background-color: rgba(255, 255, 255, 0.3);
}

.inventory-item {
  width: 80%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
}

.inventory-slot.selected .inventory-item {
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.5);
}

.inventory-item svg {
  width: 100%;
  height: 100%;
  display: block;
}

.item-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
  font-weight: bold;
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 1px 4px;
  border-radius: 3px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

#stats {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 10;
  text-align: center;
}

#stats div {
  text-align: center;
  margin: 5px 0;
}

#day-counter {
  text-align: center;
}

#day-night-clock {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px auto;
  display: block;
  position: relative;
}

#day-night-clock::before {
  content: "•";
  position: absolute;
  font-size: 10px;
  color: #333;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

#day-night-clock::after {
  content: "•";
  position: absolute;
  font-size: 10px;
  color: #fff;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #222;
  color: white;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 80%;
}

.modal-content h1 {
  margin-bottom: 20px;
  font-size: 36px;
}

.modal-content p {
  margin-bottom: 30px;
  line-height: 1.6;
}

.modal-content button {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 12px 24px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.modal-content button:hover {
  background-color: #3e8e41;
}

#health-bar {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 3px;
  z-index: 10;
}

#health-bar-fill {
  height: 100%;
  background-color: #e74c3c;
  border-radius: 7px;
  width: 100%;
  transition: width 0.3s ease;
}

#enemy-health-container {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  padding: 5px;
  display: none;
  z-index: 10;
}

#enemy-name {
  color: white;
  font-size: 12px;
  text-align: center;
  margin-bottom: 3px;
  font-weight: bold;
}