@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #222;
  font-family: 'Nunito', sans-serif;
}

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

canvas {
  display: block;
}

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

/* Enable pointer events for UI elements */
#character-creator, #inventory-screen, #dialogue-box, #ending-screen, .inventory-btn {
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

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

.bar-container {
  width: 250px;
}

.health-bar, .xp-bar {
  width: 100%;
  height: 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 10px;
  margin-bottom: 5px;
  overflow: hidden;
  border: 2px solid #fff;
}

#health-fill {
  width: 100%;
  height: 100%;
  background: #ff4444;
  transition: width 0.2s;
}

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

.currency {
  font-family: 'Fredoka One', cursive;
  color: #fff;
  font-size: 24px;
  text-shadow: 2px 2px 0 #000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.seed-icon {
  font-size: 0; /* Hidden text, drawn shape in CSS */
  width: 15px;
  height: 20px;
  background: #ffaaaa;
  border-radius: 50% 50% 20% 20%;
  display: inline-block;
  position: relative;
}
.seed-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 5px;
  width: 5px;
  height: 5px;
  background: #00cc00;
  border-radius: 50%;
}

/* Character Creator */
#character-creator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 240, 245, 0.95);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  text-align: center;
  max-width: 500px;
  width: 90%;
}

#character-creator h1 {
  font-family: 'Fredoka One', cursive;
  color: #ff4081;
}

.preview-box {
  background: #e1f5fe;
  border-radius: 10px;
  margin: 20px auto;
  display: inline-block;
  border: 4px solid #fff;
}

.control-group {
  margin: 15px 0;
  text-align: left;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  color: #555;
}

button {
  background: #ff4081;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 18px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Fredoka One', cursive;
  transition: transform 0.1s;
}

button:hover {
  transform: scale(1.05);
  background: #f50057;
}

/* Modal Styles */
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  min-width: 300px;
  text-align: center;
}

/* Dialogue */
#dialogue-box {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid #8d6e63;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
}

#npc-name {
  margin: 0 0 10px 0;
  color: #d84315;
  font-family: 'Fredoka One', cursive;
}

#dialogue-options button {
  margin: 5px;
  font-size: 14px;
  padding: 8px 16px;
  background: #8d6e63;
}

#crafting-buttons button {
  display: block;
  width: 100%;
  margin: 5px 0;
}

.inventory-btn {
  margin-top: 10px;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
}
