/* Liste des crafts possibles */
#craftable-list {
  margin-top: 18px;
  background: rgba(30, 30, 30, 0.95);
  border-radius: 8px;
  padding: 12px 10px 10px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  min-width: 220px;
  max-width: 320px;
  color: #fff;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.craft-btn {
  background: linear-gradient(90deg, #ffd700 60%, #fffbe6 100%);
  color: #333;
  border: 2px solid #ffd700;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  padding: 8px 10px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.craft-btn:hover {
  background: linear-gradient(90deg, #fffbe6 60%, #ffd700 100%);
  color: #111;
  transform: translateY(-2px) scale(1.03);
}

.no-craft {
  color: #bbb;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* Bouton de suppression dans la zone de craft */
.remove-craft-item {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 80, 80, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  z-index: 2;
  transition: background 0.2s, transform 0.2s;
}
.remove-craft-item:hover {
  background: #ff2222;
  transform: scale(1.1);
}

/* Bouton de suppression dans la hotbar */
.remove-hotbar-item {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 80, 80, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  opacity: 0.7;
}
.remove-hotbar-item:hover {
  background: #ff2222;
  transform: scale(1.15);
  opacity: 1;
}
.hotbar-slot:hover .remove-hotbar-item {
  opacity: 1;
}
/* Container principal du HUD */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Container des stats au-dessus de la hotbar */
#stats-container {
  display: grid;
  grid-template-columns: 2fr 2fr;

  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.stats-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Barres de stats mini */
.stat-bar-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-icon-mini {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.stat-bg-mini {
  width: 160px;
  height: 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.stat-fill-mini {
  height: 100%;
  transition: width 0.3s ease;
}

.stat-fill-mini.health {
  background: linear-gradient(90deg, #ff4444, #ff6666);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.stat-fill-mini.hydration {
  background: linear-gradient(90deg, #4444ff, #6666ff);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.stat-fill-mini.hunger {
  background: linear-gradient(90deg, #ff8800, #ffaa00);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.stat-fill-mini.fatigue {
  background: linear-gradient(90deg, #8844ff, #aa66ff);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

/* Hotbar style Minecraft */
#hotbar {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.hotbar-slot {
  width: 64px;
  height: 64px;
  background: rgba(139, 139, 139, 0.8);
  border: 2px solid rgba(85, 85, 85, 1);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.hotbar-slot:hover {
  background: rgba(160, 160, 160, 0.9);
  border-color: rgba(200, 200, 200, 1);
}

.hotbar-slot.active {
  background: rgba(255, 255, 255, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 10px rgba(255, 255, 255, 0.3);
}

.slot-number {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  color: white;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

.slot-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  image-rendering: pixelated;
}

.slot-content img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.slot-quantity {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 12px;
  color: white;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

.slot-name {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 12px;
  color: white;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

/* Inventaire popup (reste inchangé) */
.ui-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius: 10px;
  z-index: 200;
  color: white;
  min-width: 400px;
  border: 3px solid rgba(139, 139, 139, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.ui-panel h2 {
  margin: 0 0 15px 0;
  text-align: center;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

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

.inventory-item {
  background: rgba(139, 139, 139, 0.8);
  padding: 15px 10px;
  border-radius: 4px;
  text-align: center;
  border: 2px solid rgba(85, 85, 85, 1);
  transition: all 0.2s;
  cursor: pointer;
}

.inventory-item:hover {
  background: rgba(160, 160, 160, 0.9);
  border-color: rgba(200, 200, 200, 1);
  transform: translateY(-2px);
}

.item-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.item-icon-img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

.item-name {
  font-size: 14px;
  color: #fff;
  text-transform: capitalize;
  margin-bottom: 4px;
}

.item-quantity {
  font-size: 12px;
  color: #aaa;
  font-weight: bold;
}

.empty-message {
  color: #888;
  text-align: center;
  padding: 20px;
  font-style: italic;
}

.craft-area {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  color: #fff;
  height: 95%;
}

#craft-block h3 {
  margin-left: auto;
  margin-right: auto;
  font-size: 16px;
  text-align: center;
}


#craft-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  color: #fff;
  border-bottom: #fff 3px solid;
  padding-bottom: 10px;
}

.craft-slot {
  width: 64px;
  height: 64px;
  background: rgba(139, 139, 139, 0.8);
  border: 2px solid rgba(85, 85, 85, 1);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.craft-slot:hover {
  background: rgba(160, 160, 160, 0.9);
  border-color: rgba(200, 200, 200, 1);
}

.craft-slot.filled {
  background: rgba(100, 200, 100, 0.3);
  border-color: rgba(100, 200, 100, 0.8);
}

.craft-slot-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 24px;
}

.craft-slot-content img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.craft-slot-content .item-name-small {
  font-size: 10px;
  color: #fff;
  margin-top: 2px;
}

.craft-arrow {
  font-size: 32px;
  color: #fff;
  margin: 0 10px;
}

#craft-result {
  width: 80px;
  height: 80px;
  background: rgba(139, 139, 139, 0.8);
  border: 3px solid rgba(255, 215, 0, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#craft-result.has-result {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 1);
  animation: glow 1s infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
}

.craft-result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 32px;
}

.craft-result-content img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

#craft-button {
  width: 100%;
  padding: 10px;
  background: rgba(100, 200, 100, 0.8);
  border: 2px solid rgba(100, 200, 100, 1);
  border-radius: 4px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

#craft-button:hover:not(:disabled) {
  background: rgba(100, 200, 100, 1);
  transform: translateY(-2px);
}

#craft-button:disabled {
  background: rgba(100, 100, 100, 0.5);
  border-color: rgba(100, 100, 100, 0.8);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Les items de l'inventaire doivent être draggables */
.inventory-item {
  cursor: grab;
}

.inventory-item:active {
  cursor: grabbing;
}

