* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  -webkit-user-drag: none;
  /* Chrome / Safari */
  user-drag: none;
  /* Standard (encore peu supporté, le webkit est important) */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #071029 0%, #000000 100%); /* dark navy -> black */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e6eef8; /* light text for dark background */
} 

h1#money {
  font-size: 3.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

.game-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.game-cps {
  font-size: 1.05rem;
  color: #cfd8e3;
  margin: 0;
}

.container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  background: transparent; /* removed white panel */
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 900px;
  width: 100%;
  margin: 20px;
} 

.game-section {
  display: flex;
  flex-direction: column; /* place les stats au-dessus du cookie */
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.upgrades-section {
  display: flex;
  flex-direction: column;
  gap: 12px; /* moins d'espace vertical */
  flex: 1;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  padding: 16px;
  border-radius: 12px;
  border-left: 3px solid #667eea;

  /* Fixe la section des améliorations sur la droite */
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 380px; /* largeur augmentée pour 2 colonnes */
  max-height: 80vh;
  overflow-y: auto;
  z-index: 50;
}

/* Petite ajustement pour éviter que le container chevauche la sidebar */
.container {
  padding-right: 420px; /* laisse de la place pour la sidebar plus large */
}

/* Spécial : petites cases pour améliorations spéciales (alignées en haut à droite) */
.special-upgrades {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.special-upgrade {
  position: relative;
}

.special-btn {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #111;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.special-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Tooltip visible au hover (s'affiche à gauche du bouton) */
.special-upgrade .tooltip {
  display: none;
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  min-width: 220px;
  background: rgba(20,20,20,0.95);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  text-align: left;
  z-index: 100;
}

.special-upgrade:hover .tooltip,
.special-btn:focus + .tooltip {
  display: block;
}

.special-upgrade .tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: #ffd700;
} 

/* Forcer le texte des paragraphes dans le tooltip en blanc pour lisibilité */
.special-upgrade .tooltip p {
  color: #ffffff;
  margin: 0;
  font-size: 0.95rem;
}

.reset-container {
  margin-top: 8px;
}

/* Grid pour les améliorations normales : deux colonnes pour réduire le scroll */
.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Responsive: sur petits écrans, passer la sidebar en bas */
@media (max-width: 700px) {
  .upgrades-section {
    position: static;
    transform: none;
    width: 100%;
    max-height: none;
  }
  .upgrades-grid { grid-template-columns: 1fr; }
  .container { padding-right: 0; }
} 

.upgrade-box {
  background: rgba(255,255,255,0.03);
  padding: 10px;
  border-radius: 10px;
  box-shadow: none;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upgrade-box h3 {
  font-size: 0.86rem;
  color: #ffd700;
  margin: 0;
  text-transform: uppercase;
  font-weight: 700;
}

.upgrade-left { /* titre + meta */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upgrade-meta {
  font-size: 0.9rem;
  color: #dbe7ff;
}

.upgrade-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.upgrade-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  border: none;
  padding: 8px 10px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.upgrade-cost {
  font-size: 0.9rem;
  color: #cfd8e3;
  margin: 0;
}


.le-rond {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden; /* clip l'image pour qu'elle prenne exactement la forme du cercle */
  display: inline-block; /* mieux adapté pour une image */
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Assure que l'image prend exactement la taille du cercle */
.le-rond img,
.cookie-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* remplissage complet; change to 'contain' si tu veux voir toute l'image sans recadrage */
  display: block;
}

.le-rond:hover {
  transform: scale(1.05);
}

.le-rond:active {
  transform: scale(0.95);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

#clicker {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 30px;
  font-size: 1.2rem;
}

#clicker:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#clicker:active {
  transform: translateY(0);
}

#a1, #a2, #a3, #a4 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  flex: 1;
  width: 100%;
}

#a1:hover, #a2:hover, #a3:hover, #a4:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(241, 241, 241, 0.4);
}

#a1:disabled, #a2:disabled, #a3:disabled, #a4:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

p {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: #cfd8e3; /* lighter on dark background */
}

.floating-text {
    position: absolute;
    pointer-events: none; /* Pour que le texte ne gêne pas les futurs clics */
    color: #ffffff; /* visible on dark background */
    font-weight: bold;
    font-family: sans-serif;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 1000;
    font-size: 24px;
}

p span {
  color: #667eea;
  font-weight: bold;
  font-size: 1.3rem;
}

.buttons-container {
  display: flex;
  gap: 12px;
  width: 100%;
}

.buttons-container button {
  flex: 1;
}



@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px); /* Monte de 50px */
        opacity: 0; /* Devient invisible */
    }
}