body {
  margin: 0;
  overflow: hidden;
  background: #222;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
}

canvas {
  display: block;
}

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

/* Make UI elements interactive */
#customization-screen, .modal, #dialogue-box {
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

/* HUD */
#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bar-container {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.5);
  padding: 5px;
  border-radius: 5px;
}

.bar-bg {
  width: 200px;
  height: 15px;
  background: #444;
  border-radius: 3px;
  overflow: hidden;
}

#hp-bar {
  width: 100%;
  height: 100%;
  background: #ff4444;
  transition: width 0.2s;
}

#xp-bar {
  width: 0%;
  height: 100%;
  background: #44aaff;
  transition: width 0.2s;
}

.currency-display {
  font-size: 20px;
  font-weight: bold;
  color: #ffaaee;
  text-shadow: 1px 1px 0 #000;
}

.seed-icon {
  color: #ff4444; 
  font-family: monospace; /* makeshift seed icon */
}

#inventory-box {
  margin-top: 10px;
  background: rgba(0,0,0,0.6);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

.mini-help {
  font-size: 10px;
  color: #aaa;
  margin-top: 5px;
}

/* Modal Styles */
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2a1a1a;
  border: 4px solid #d45d79;
  border-radius: 15px;
  padding: 20px;
  width: 400px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.modal h2 {
  margin-top: 0;
  color: #ff88aa;
  text-align: center;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.shop-item {
  background: #442222;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #663333;
}

.shop-item:hover {
  background: #663333;
}

.inv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #332222;
  margin-bottom: 5px;
  padding: 8px;
  border-radius: 4px;
}

.craft-btn {
  background: #ff6688;
  border: none;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

/* Customization Screen */
#customization-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a0b0b, #331111);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.custom-controls {
  background: rgba(0,0,0,0.5);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  width: 300px;
}

.control-group {
  margin-bottom: 15px;
}

.control-group label {
  display: block;
  margin-bottom: 5px;
}

button {
  background: #d45d79;
  border: none;
  padding: 10px 20px;
  color: white;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.1s;
}

button:active {
  transform: scale(0.95);
}

#dialogue-box {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  background: #fff;
  color: #000;
  border: 4px solid #333;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#dialogue-speaker {
  margin: 0 0 5px 0;
  color: #d45d79;
  font-weight: bold;
}

#dialogue-text {
  margin: 0 0 10px 0;
}
