body {
  background-color: #0e0e0e;
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  color: #fff;
  user-select: none;
}

#gameContainer {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Section gauche - Zone de clic principal */
#leftSection {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background-color: #1a1a1a;
  border-right: 2px solid #333;
  overflow-y: auto;
}

h1 {
  color: #ffdc73;
  text-shadow: 0 0 5px #ffb347;
  margin-bottom: 30px;
}

#mainClickArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
}

#mainPatouImg {
  width: 250px;
  height: 250px;
  cursor: pointer;
  transition: transform 0.1s;
  filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.7));
  border-radius: 50%;
  object-fit: cover;
}

#mainPatouImg:hover {
  transform: scale(1.03);
}

#mainPatouImg:active {
  transform: scale(0.95);
}

#patouCountDisplay {
  font-size: 2.5rem;
  font-weight: bold;
  color: #ffdc73;
  text-shadow: 0 0 5px #ffb347;
  margin: 20px 0 10px;
}

#patouPerSecond {
  font-size: 1.2rem;
  color: #ccc;
}

/* Section centrale - Buildings et Upgrades */
#centerSection {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  background-color: #1a1a1a;
  border-right: 2px solid #333;
  overflow: hidden;
}

#buildingsDisplay {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  padding: 15px;
  gap: 10px;
  background-color: #222;
  border-bottom: 2px solid #333;
  min-height: 150px;
  max-height: 150px;
  overflow-y: auto;
}

.buildingIcon {
  width: 50px;
  height: 50px;
  background-color: #333;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.buildingIcon img {
  width: 40px;
  height: 40px;
}

.buildingCounter {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background-color: #ffb347;
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

#upgradesPath {
  padding: 20px;
  background-color: #1e1e1e;
}

#upgradesPath h3 {
  color: #ffdc73;
  margin-top: 0;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}

#upgradesContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 0;
}

.upgradeItem {
  width: 60px;
  height: 60px;
  background-color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: visible;
}

.upgradeItem:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.6);
  z-index: 10;
}

.upgradeItem img {
  width: 100%;
  height: 100%;
  padding: 5px;
  box-sizing: border-box;
}

.upgradeItem.available {
  box-shadow: 0 0 8px rgba(140, 255, 102, 0.7);
}

.upgradePrice {
  position: absolute;
  bottom: -10px;
  right: -10px;
  background-color: #8cff66;
  color: #000;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 5px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* Section droite - Boutique */
#rightSection {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  background-color: #1a1a1a;
  overflow-y: auto;
}

#rightSection h2 {
  color: #ffdc73;
  text-align: center;
  padding: 15px 0;
  margin: 0;
  background-color: #222;
  border-bottom: 2px solid #333;
}

#shopContainer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.shopItem {
  display: flex;
  align-items: center;
  background-color: #2a2a2a;
  border-radius: 5px;
  padding: 10px;
  transition: background-color 0.2s;
  cursor: pointer;
  position: relative;
}

.shopItem:hover {
  background-color: #333;
}

.shopItem.locked {
  filter: brightness(0.6);
  cursor: not-allowed;
}

.shopItem.available {
  box-shadow: 0 0 5px rgba(255, 179, 71, 0.3);
}

.shopItem img {
  width: 64px;
  height: 64px;
  margin-right: 10px;
}

.shopItemInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shopItemName {
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffdc73;
}

.shopItemDesc {
  font-size: 0.9rem;
  color: #aaa;
  margin: 3px 0;
}

.shopItemCost {
  font-weight: bold;
  color: #8cff66;
}

.shopItemStats {
  color: #ccc;
  font-size: 0.8rem;
}

/* Style pour le compteur de bâtiments en haut à droite */
.building-counter {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #FFD700;
  color: #000;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  min-width: 18px;
  text-align: center;
  z-index: 5;
}

/* Effets spéciaux */
@keyframes patouGlow {
  0% { filter: drop-shadow(0 0 5px rgba(255, 179, 71, 0.7)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 179, 71, 0.9)); }
  100% { filter: drop-shadow(0 0 5px rgba(255, 179, 71, 0.7)); }
}

.floating-text {
  position: absolute;
  animation: float-up 2s ease-out;
  opacity: 0;
  color: #ffdc73;
  font-weight: bold;
  text-shadow: 0 0 3px #000;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 100;
}

@keyframes float-up {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

/* Nouvelle zone défilante */
.scrollableSection {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sectionBlock {
  padding: 20px;
  border-bottom: 2px solid #333;
}

/* Fonds différents pour chaque bloc */
#statsBlock {
  background-color: #1e1e1e;
}

#upgradeTreeBlock {
  background-color: #1a1a24;
  padding-bottom: 40px;
}

.sectionBlock h3 {
  color: #ffdc73;
  margin-top: 0;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

/* Style pour les statistiques */
#statsContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.statItem {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  background-color: #2a2a2a;
  border-radius: 5px;
}

.statLabel {
  color: #ccc;
}

/* Arbre d'améliorations */
#upgradeTreeContainer {
  padding: 10px 0;
  overflow-y: auto;
}

.upgradeTreeRow {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 0;
  position: relative;
}

.upgradeTreeRow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #444;
  z-index: 0;
}

.upgradeTreeRow.category {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed #444;
}

.upgradeTreeRow.category:first-child {
  border-top: none;
  margin-top: 0;
}

.upgradeTreeCategory {
  width: 100%;
  color: #ffdc73;
  font-weight: bold;
  padding: 5px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #555;
}

.treeUpgradeItem {
  width: 60px;
  height: 60px;
  background-color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: visible;
  z-index: 1;
}

.treeUpgradeItem.purchased {
  background-color: #2c3e50;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
  opacity: 0.9;
}

.treeUpgradeItem.locked {
  filter: grayscale(100%) brightness(0.4);
  cursor: not-allowed;
}

.treeUpgradeItem:hover:not(.locked) {
  transform: scale(1.05);
  z-index: 10;
}

.treeUpgradeItem img {
  width: 100%;
  height: 100%;
  padding: 5px;
  box-sizing: border-box;
}

.treeUpgradePrice {
  position: absolute;
  bottom: -10px;
  right: -10px;
  background-color: #8cff66;
  color: #000;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 5px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.treeUpgradeItem.purchased .treeUpgradePrice {
  background-color: #3498db;
}

.treeUpgradeDependencyLine {
  position: absolute;
  background-color: #555;
  z-index: 0;
}

/* Styles pour la carte du village */
#villageMapContainer {
  display: none; /* Masquer complètement la carte */
}

/* Masquer tous les éléments liés à la carte */
#villageMap, #mapControls, .mapBuilding, .buildingTooltip {
  display: none;
}

/* Styles pour les bâtiments sur la carte */
.mapBuilding {
  position: absolute;
  width: 40px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease, filter 0.3s ease;
  cursor: pointer;
}

.mapBuilding:hover {
  transform: scale(1.2);
  z-index: 100;
}

.mapBuilding.cursor {
  width: 20px;
  height: 20px;
  background-image: url('assets/cursor.png');
}

.mapBuilding.patoupat {
  width: 30px;
  height: 30px;
  background-image: url('assets/patoupat.png');
  border-radius: 50%;
}

.mapBuilding.superPatoupat {
  width: 35px;
  height: 35px;
  background-image: url('assets/superpatoupat.png');
  border-radius: 50%;
}

.mapBuilding.megaPatoupat {
  width: 40px;
  height: 40px;
  background-image: url('assets/megapatoupat.png');
  border-radius: 50%;
}

.mapBuilding.patouFarm {
  width: 45px;
  height: 45px;
  background-image: url('assets/farm.png');
}

.mapBuilding.patouFactory {
  width: 50px;
  height: 50px;
  background-image: url('assets/factory.png');
}

.mapBuilding.patouMine {
  width: 45px;
  height: 45px;
  background-image: url('assets/mine.png');
}

@keyframes buildingAppear {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
  