/* Animations pour les effets spéciaux */
@keyframes pulse-circle {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

@keyframes vibrate {
  0%, 100% { transform: scale(1); }
  25% { transform: translate(-2px, 2px) scale(1.05); }
  50% { transform: translate(2px, -2px) scale(1.1); }
  75% { transform: translate(-1px, -1px) scale(1.05); }
}

@keyframes float-snowflake {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.7; }
  100% { transform: translate(5px, 5px) rotate(45deg); opacity: 1; }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px gold; }
  50% { box-shadow: 0 0 20px gold, 0 0 30px rgba(255, 215, 0, 0.6); }
  100% { box-shadow: 0 0 5px gold; }
}

/* Reset et style général */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background-color: #1e2533; /* Fond bleu foncé */
  color: white;
  text-align: center;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  width: 100%;
  touch-action: none; /* Désactive tous les gestes tactiles par défaut pour éviter le défilement indésirable */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -moz-user-select: none;
  -ms-user-select: none;
  overscroll-behavior: none; /* Empêche le rebond de page sur iOS */
  max-height: -webkit-fill-available; /* Correction hauteur pour iOS */
  margin: 0;
  padding: 0;
  overflow: hidden; /* Empêche le défilement sur tout le body */
  position: fixed; /* Fixe le body pour empêcher tout défilement */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Styles pour l'écran de statistiques */
#stats-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  overflow-y: auto;
  padding-bottom: 10px;
}

#stats-container {
  width: 90%;
  max-width: 500px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  margin-bottom: 0px;
  max-height: 100vh;
  overflow-y: auto; /* Permettre le défilement vertical */
  overflow-x: hidden; /* Masquer le défilement horizontal */
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
  /* Hauteur maximale de l'écran */
  position: relative;
  z-index: 2; /* Pour s'assurer qu'il reste au-dessus du fond */
}

.stats-section {
  margin-bottom: 0px;
  border-bottom: 0px dashed rgba(255, 204, 0, 0.3);
  padding-bottom: 0px;
}

.stats-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.stats-title {
  color: #ffcc00;
  font-size: 18px;
  margin-bottom: 0px;
  text-align: center;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  margin-bottom: 0px;
  transition: all 0.2s ease;
}

.stats-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.stats-item-name {
  color: #ffffff;
  font-weight: bold;
}

.stats-item-value {
  color: #ffcc00;
  font-weight: bold;
}

.stats-mole-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.stats-mole-item {
  display: flex;
  align-items: center;
}

/* Ajustement des éléments d'interface */
.screen {
  padding-bottom: 0px;
  overflow-y: auto; /* Permettre le défilement si nécessaire */
  height: 100vh;
}

.end-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 90%;
  max-width: 400px;
  margin: 0 auto 15px;
}

.reward-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90%;
  max-width: 400px;
  margin: 0 auto 15px;
}

/* Assurer que les boutons de récompense sont bien espacés */
.reward-button {
  width: 100%;
  margin: 5px 0;
  padding: 12px 15px;
  font-size: 18px;
  background-color: #E91E63; /* Rose vif */
  color: white;
  border-radius: 15px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(233, 30, 99, 0.5);
  position: relative;
  overflow: hidden;
}

.reward-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

/* Espaces publicitaires supprimés */

/* Positionnement des boutons */
.mole, .button, .main-button, .menu-button {
  z-index: 900;
}

/* Positionnement des taupes */
.mole {
  position: absolute;
  width: 70px;
  height: 70px;

  z-index: 900;
  cursor: pointer;
  transition: transform 0.2s;
  will-change: transform; /* Optimisation de performance pour les animations */
}



body {
  padding-top: 0;
}

/* Styles communs */
.screen {
  
  position: fixed; 
  top: 0; /* Commence en haut de l'écran */
  left: 0;
  width: 100%;
  height: 100%; /* Hauteur exacte pour éviter le débordement */
  padding: 20px;
  padding-top: 0px;
  padding-bottom: 0px; /* Espace en bas pour le confort et l'indicateur de défilement */
  flex-direction: column;
  justify-content: flex-start; /* Les éléments commencent du haut */
  align-items: center;
  z-index: 10;
  background-color: #1e2533;
  background-size: cover;
  background-position: center;
  box-sizing: border-box;
  overflow-y: auto; /* Permet le défilement vertical si le contenu est trop grand */
  -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
  /* Optimisation pour les écrans avec beaucoup de contenu */
  overflow-x: hidden;
  /* Activer le défilement tactile sur les écrans */
  touch-action: pan-y; /* Permet le défilement vertical tactile */
  /* Animation pour l'indicateur de défilement */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 140, 0, 0.7) rgba(0, 0, 0, 0.1);
}

/* Indicateur de défilement pour les écrans - DÉSACTIVÉ */
.screen::after {
  content: "";
  
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Animation de rebond désactivée */
@keyframes bounce-hint {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(0); }
}

/* Cacher l'indicateur quand on a déjà scrollé - inutile maintenant */
.screen.scrolled::after {
  
  opacity: 0;
}

/* L'écran de jeu ne devrait pas être scrollable */
#game-screen {
  overflow-y: hidden;
  touch-action: none; /* Désactive le défilement tactile sur l'écran de jeu */
}

/* Masquer l'indicateur de défilement sur l'écran de jeu */
#game-screen::after {
  
}

h1, h2 {
  color: #ffd700; /* Texte doré */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  margin-bottom: 0px;
}

h1 {
  font-size: 3em;
}

h2 {
  font-size: 2.5em;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  font-weight: bold;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  transition: transform 0.2s, background-color 0.2s;
  margin: 10px;
}

.main-button {
  background-color: #ff8c00; /* Orange */
  color: white;
  padding: 15px 40px;
  font-size: 1.5em;
}

.menu-button {
  background-color: #4CAF50; /* Vert */
  color: white;
  padding: 12px 30px;
  font-size: 1.2em;
}

.back-button {
  background-color: #f44336; /* Rouge */
  color: white;
  padding: 10px 20px;
  font-size: 1em;
  
}

button:hover, button:active {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Écran d'accueil */
#home-screen {
  display: flex !important;
  flex-direction: column;
  justify-content: center !important;
  align-items: center !important;
  min-height: 100vh;
  background-image: url('images/backgrounds/bg1.png');
  background-size: cover;
  background-position: center;
  position: fixed;
  top: 0 !important;
  left: 0;
  z-index: 5;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

.title {
  margin-bottom: 0px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Écran d'histoire */
#help-screen {
  padding-top: 10px;
}

#story-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 10px;
}

.story-box {
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 0px;
  position: relative;
}

#story-animation {
  width: 100%;
  min-height: 180px;
  margin-bottom: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#story-text {
  text-align: center;
  margin-bottom: 0px;
  font-weight: bold;
  padding: 0 5px;
}

#story-controls {
  display: flex;
  justify-content: space-between;
  padding: 5px;
}

.story-button {
  background-color: #4CAF50;
  color: white;
  font-size: 18px;
  border-radius: 8px;
  padding: 8px 20px;
}

.story-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Écran d'avatar */
.avatar-upload {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  max-width: 400px;
  width: 90%; /* Réduit à 90% au lieu de 100% pour éviter qu'il touche les bords */
   /* Ajusté car l'écran commence déjà en haut */
}

#avatar-editor-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px auto;
  max-width: 450px;
}

#avatar-preview-container {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #ff8c00;
  overflow: hidden;
  position: relative;
  background-color: white;
  margin-bottom: 0px;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
}

#avatar-preview {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none; /* Empêcher le défilement pendant le déplacement tactile */
  cursor: move; /* Visuel pour indiquer qu'on peut déplacer */
  background-color: #eee;
}

#avatar-preview img {
  position: absolute;
  transform-origin: center;
  object-fit: cover;
  transition: transform 0.05s ease-out; /* Encore plus réactif pour le tactile */
  width: 100%;
  height: 100%;
  user-select: none; /* Empêcher la sélection */
  -webkit-user-drag: none; /* Empêcher le drag par défaut */
  touch-action: none; /* S'assurer que le défilement est désactivé aussi sur l'image */
}

.mole-shape-preview {
  border-radius: 50%;
}

.avatar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
}

.avatar-zoom-container {
  width: 90%;
  margin: 15px auto;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
}

.zoom-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.zoom-button {
  width: 60px;
  height: 60px;
  font-size: 30px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin: 0 10px;
}

#zoom-level {
  font-size: 20px;
  color: white;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 10px;
}

.avatar-instruction {
  color: white;
  font-size: 1.1em;
  margin: 10px 0;
  text-align: center;
  background-color: rgba(0,0,0,0.5);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

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

.control-group label {
  margin-bottom: 0px;
  color: white;
}

.slider {
  width: 80%;
  height: 15px;
  background: #333;
  outline: none;
  border-radius: 15px;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.horizontal-buttons {
  display: flex;
  gap: 20px;
}

.direction-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background-color: #2c3e50;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.direction-button:hover {
  background-color: #34495e;
}

.direction-button:active {
  background-color: #1a252f;
  transform: scale(0.95);
}

/* Écran de paramètres */
.settings-options {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  width: 90%; /* Réduit pour éviter les bords */
  max-width: 400px;
   /* Ajusté car l'écran commence déjà en haut */
}

.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}

.setting label {
  font-size: 1.2em;
  margin-right: 15px;
}

input[type="range"] {
  flex: 1;
  height: 20px;
}

.player-name-setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.player-name-setting label {
  margin-bottom: 0px;
}

#player-name {
  width: 100%;
  max-width: 300px;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #4CAF50;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  text-align: center;
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* Écran des trophées */
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 90%;
  max-width: 420px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  justify-content: center;
  align-items: center;
   /* Ajusté car l'écran commence déjà en haut */
}

.trophy-item {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  position: relative;
  overflow: visible;
  transition: transform 0.3s, box-shadow 0.3s;
}

.trophy-item:hover {
  transform: translateY(-5px);
}

.trophy-item img {
  width: 80%;
  height: 80%;
  margin: 0 auto 10px;
  opacity: 0.3;
  object-fit: contain;
  display: block;
  max-width: 100px;
  max-height: 100px;
}

.trophy-item.unlocked {
  background-color: rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.trophy-item.unlocked img {
  opacity: 1;
}

.trophy-item p {
  font-size: 0.8em;

  color: white;
  text-align: center;
  padding: 0 5px;
}

.trophy-description {
  font-size: 0.7em;
  color: #ddd;
  
  padding: 0 5px;
}

.trophy-share-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 8px;
  
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8em;
  transition: background-color 0.3s, transform 0.2s;
  width: 80%;
}

.trophy-share-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

.trophy-share-image {
  margin: 10px auto;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.trophy-share-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  opacity: 1;
}

/* Écran des meilleurs scores */
#highscores-list {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  width: 90%; /* Réduit à 90% pour éviter de toucher les bords */
  max-width: 400px;
  margin-bottom: 0px;
   /* Ajusté car l'écran commence déjà en haut */
}

.highscore-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 0px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 30, 0.6);
  border-radius: 5px;
  margin: 5px 0;
  color: white;
}

.highscore-item span:first-child {
  width: 15%;
  font-weight: bold;
}

.highscore-item span:nth-child(2) {
  width: 25%;
  text-align: center;
  font-weight: bold;
  color: #ffcc00;
}

.highscore-item span:last-child {
  width: 60%;
  text-align: right;
  font-size: 0.9em;
  color: #ccc;
}

.highscore-item:last-child {
  border-bottom: none;
}

/* Écran de jeu */
#game-screen {
  position: fixed; /* L'écran de jeu reste en fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* Utilise toute la hauteur de la fenêtre */
  
  flex-direction: column;
  z-index: 5;
  /* Pas de padding-top ici - il est géré autrement */
  overflow: hidden; /* Empêche le défilement */
}

#hud {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.8); /* Plus opaque pour meilleur contraste */
  border-radius: 0 0 15px 15px;
  width: 100%;
  position: absolute; /* Changé de fixed à absolute */
  z-index: 100;
  top: 10px;
  left: 0;
  height: 60px; /* Hauteur fixe */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* Ombre pour le faire ressortir */
  gap: 15px;
}

#score, #timer {
  font-size: 1.4em;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Améliore la lisibilité */
  color: #ffffff; /* Blanc pour meilleur contraste */
  font-weight: bold;
}

#current-weapon {
  color: #ffd700; /* Doré */
  font-size: 1.4em;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Améliore la lisibilité */
}

#pause-button {
  background-color: rgba(244, 67, 54, 0.9); /* Plus opaque */
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* Ombre pour le faire ressortir */
  border: 1px solid rgba(255, 255, 255, 0.3); /* Bordure subtile */
}

#bonus-time-ad-button, #bonus-time-button {
  background-color: #4caf50;
  border: 2px solid #388e3c;
  color: white;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

#bonus-time-ad-button:before, #bonus-time-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

#bonus-time-ad-button:hover, #bonus-time-button:hover {
  background-color: #66bb6a;
  transform: scale(1.05);
}

#bonus-time-ad-button:active, #bonus-time-button:active {
  background-color: #388e3c;
  transform: scale(0.95);
}

/* Style original pour rétrocompatibilité */
#bonus-time-button {
  background-color: rgba(76, 175, 80, 0.7);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  margin-left: 5px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 5px rgba(76, 175, 80, 0.7); }
  100% { transform: scale(1); }
}

#game-area {
  flex: 1;
  position: absolute;
  overflow: visible;
  background-size: cover;
  background-position: center;
  touch-action: manipulation; /* Manipulation pour taper mais pas défiler */
  border: none;
  z-index: 1;
  width: 100%; /* Garantir l'utilisation de la largeur complète */
  height: 100vh;
  top: 0px;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-overflow-scrolling: touch; /* Meilleur défilement sur iOS */
  /* Meilleur contraste pour les taupes */
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
  will-change: transform; /* Optimisation des performances */
}

/* Conteneur de défi */
#challenge-container {
  position: fixed;
  top: 80px;
  right: 20px;
  max-width: 250px;
  background-color: rgba(255, 255, 0, 0.95);
  border: 4px solid #ff6b00;
  border-radius: 15px;
  padding: 12px;
  z-index: 900; /* Réduit pour ne pas masquer les boutons */
  box-shadow: 0 0 20px rgba(255, 100, 0, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  font-weight: bold;
  color: #d11c1c;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
  opacity: 0;
  
  pointer-events: none; /* Ne bloque pas les interactions */
}

#challenge-container.active {
  transform: scale(1);
  animation: challenge-pulse 2s infinite alternate;
  opacity: 1;
  visibility: visible;
}

@keyframes challenge-pulse {
  0% { transform: scale(1) rotate(-1deg); }
  100% { transform: scale(1.05) rotate(1deg); }
}

/* Mode rage */
#rage-mode-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 900;
  background: linear-gradient(rgba(255, 0, 0, 0), rgba(255, 0, 0, 0.2));
  opacity: 0;
  transition: opacity 0.5s;
  border: 10px solid rgba(255, 0, 0, 0.6);
  box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.6);
  animation: rage-border-pulse 0.5s infinite alternate;
}

#rage-mode-overlay.active {
  opacity: 1;
}

.rage-mode-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000;
  background-color: rgba(200, 0, 0, 0.7);
  padding: 15px;
  border-radius: 15px;
  border: 3px solid #ff0000;
  animation: rage-text-pulse 0.5s infinite alternate;
}

.rage-mode-timer {
  position: absolute;
  bottom: 0px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 5px #ff0000;
  background-color: rgba(200, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 10px;
  border: 2px solid #ff0000;
}

#rage-mode-overlay.active .rage-text {
  transform: translate(-50%, -50%) scale(1);
  animation: rage-text-pulse 0.5s infinite alternate;
}

@keyframes rage-border-pulse {
  0% { box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.6); }
  100% { box-shadow: inset 0 0 60px rgba(255, 0, 0, 0.8); }
}

@keyframes rage-text-pulse {
  0% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  100% { transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
}

/* Taupe dorée */
.mole.golden {
  animation: golden-appear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mole.golden .mole-image {
  border: 4px solid gold;
  box-shadow: 0 0 20px gold, 0 0 40px rgba(255, 215, 0, 0.6);
  animation: golden-pulse 1s infinite alternate ease-in-out;
  filter: brightness(1.2) contrast(1.1) saturate(1.3);
}

@keyframes golden-appear {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  70% { transform: scale(0.9) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes golden-pulse {
  0% { box-shadow: 0 0 20px gold, 0 0 40px rgba(255, 215, 0, 0.6); transform: scale(1); }
  100% { box-shadow: 0 0 30px gold, 0 0 60px rgba(255, 215, 0, 0.8); transform: scale(1.1); }
}

.mole {
  position: absolute;
  width: 70px; /* Taille restaurée à l'original */
  height: 70px;
  cursor: pointer;
  z-index: 900; /* Z-index réduit pour ne pas chevaucher la écran */
  pointer-events: all;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: scale(1);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: mole-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.9);
  border: 4px solid rgba(255, 255, 255, 1);
  overflow: visible;
  will-change: transform, opacity; /* Optimisation performance */
  -webkit-backface- /* Améliore la fluidité des animations */
  backface-
  -webkit-tap-highlight-color: transparent; /* Empêche le surlignage au tap sur mobile */
  touch-action: manipulation; /* Améliore la réactivité tactile */
}

.custom-avatar-mole {
  overflow: hidden;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.custom-avatar-mole img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 50% !important;
}

/* Zone de sécurité pour éviter que les taupes apparaissent dans la écran */
.mole-safe-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 899;
  pointer-events: none;
}

@keyframes mole-appear {
  0% { transform: scale(0); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.mole-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid white;
  will-change: transform; /* Optimisation fluidité */
  object-fit: cover;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  background-color: white;
  display: block;
}

.mole.bonus .mole-image {
  border-color: gold;
  box-shadow: 0 0 15px gold;
  animation: bonus-pulse 1.5s infinite alternate ease-in-out;
}

.mole.malus .mole-image {
  border-color: red;
  box-shadow: 0 0 15px red;
  animation: malus-pulse 1.5s infinite alternate ease-in-out;
}

.mole.frozen .mole-image {
  border-color: #00bfff;
  box-shadow: 0 0 15px #00bfff;
  animation: frozen-pulse 1.5s infinite alternate ease-in-out;
  filter: brightness(0.8) contrast(1.2) saturate(0.7);
}

.frozen-mole {
  opacity: 0.9;
  animation: ice-effect 10s forwards;
}

@keyframes bonus-pulse {
  0% { box-shadow: 0 0 5px gold; }
  100% { box-shadow: 0 0 20px gold; }
}

@keyframes malus-pulse {
  0% { box-shadow: 0 0 5px red; }
  100% { box-shadow: 0 0 20px red; }
}

@keyframes frozen-pulse {
  0% { box-shadow: 0 0 5px #00bfff; filter: brightness(0.8) contrast(1.2) saturate(0.7); }
  100% { box-shadow: 0 0 20px #00bfff; filter: brightness(0.9) contrast(1.4) saturate(0.5); }
}

@keyframes ice-effect {
  0% { transform: scale(1); filter: brightness(0.9) saturate(0.7); }
  20% { transform: scale(0.98); filter: brightness(0.8) saturate(0.6) contrast(1.1); }
  40% { transform: scale(0.96); filter: brightness(0.7) saturate(0.5) contrast(1.2); }
  60% { transform: scale(0.94); filter: brightness(0.6) saturate(0.4) contrast(1.3); }
  80% { transform: scale(0.92); filter: brightness(0.5) saturate(0.3) contrast(1.4); }
  100% { transform: scale(0.9); filter: brightness(0.4) saturate(0.2) contrast(1.5); }
}

.mole.hit .mole-image {
  animation: hit-animation 0.3s forwards;
}

@keyframes hit-animation {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  40% { transform: scale(0.9) rotate(-5deg); opacity: 0.9; }
  70% { transform: scale(0.7) rotate(-10deg); opacity: 0.7; }
  100% { transform: scale(0) rotate(-15deg); opacity: 0; }
}

#mole-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  border: none;
  overflow: visible;
  display: block;
  background-color: transparent;
}

.speech-bubble {
  position: absolute;
  background: white;
  border-radius: 10px;
  padding: 5px 10px;
  color: #d11c1c;
  font-weight: bold;
  font-size: 110%;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  border: 2px solid #ff9900;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
  animation: bubble-pop 0.3s ease-out;
}

.speech-bubble:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: white transparent transparent;
}

.effect {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  transform-origin: center;
}

/* Animations pour différentes armes */
.effect-hand {
  animation: hand-swing 0.3s ease-in-out;
}

.effect-sock {
  animation: sock-swing 0.4s ease-in-out;
}

.effect-hammer {
  animation: hammer-swing 0.5s ease-out;
}

.effect-pan {
  animation: pan-swing 0.4s ease-out;
}

.effect-axe {
  animation: axe-swing 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.effect-bat {
  animation: bat-swing 0.35s ease-in-out;
}

.effect-gun {
  animation: gun-fire 0.6s steps(3);
}

.effect-pokeball {
  animation: pokeball-throw 0.5s cubic-bezier(0.42, 0, 0.58, 1);
}

.effect-fire {
  animation: fire-burn 0.6s ease-in-out;
  filter: brightness(1.2);
}

.effect-kiss {
  animation: kiss-appear 0.5s ease-out;
  filter: hue-rotate(320deg);
}

/* Animation des armes spécifiques */
@keyframes hand-swing {
  0% { transform: scale(0.5) rotate(-30deg); opacity: 0.7; }
  50% { transform: scale(1.1) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(15deg); opacity: 0.8; }
}

@keyframes sock-swing {
  0% { transform: scale(0.3) rotate(-45deg); opacity: 0.8; }
  30% { transform: scale(0.8) rotate(-30deg); opacity: 1; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(30deg); opacity: 0.7; }
}

@keyframes hammer-swing {
  0% { transform: scale(0.5) rotate(-60deg); opacity: 0.7; }
  40% { transform: scale(1.2) rotate(0deg); opacity: 1; }
  70% { transform: scale(0.9) rotate(20deg); opacity: 0.9; }
  100% { transform: scale(0.8) rotate(40deg); opacity: 0.7; }
}

@keyframes pan-swing {
  0% { transform: scale(0.6) rotate(-40deg); opacity: 0.8; }
  50% { transform: scale(1.1) rotate(10deg); opacity: 1; }
  100% { transform: scale(0.9) rotate(30deg); opacity: 0.7; }
}

@keyframes axe-swing {
  0% { transform: scale(0.5) rotate(-70deg); opacity: 0.8; }
  30% { transform: scale(0.9) rotate(-30deg); opacity: 0.9; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(40deg); opacity: 0.7; }
}

@keyframes bat-swing {
  0% { transform: scale(0.7) rotate(-50deg); opacity: 0.8; }
  40% { transform: scale(1.1) rotate(0deg); opacity: 1; }
  100% { transform: scale(0.9) rotate(30deg); opacity: 0.7; }
}

@keyframes gun-fire {
  0% { transform: scale(0.8) translate(-5px, -5px); opacity: 0.9; filter: brightness(1); }
  33% { transform: scale(1.1) translate(0, 0); opacity: 1; filter: brightness(1.5); }
  66% { transform: scale(1.05) translate(5px, -3px); opacity: 0.95; filter: brightness(1.2); }
  100% { transform: scale(0.9) translate(0, 0); opacity: 0.8; filter: brightness(1); }
}

@keyframes pokeball-throw {
  0% { transform: scale(0.5) translate(-20px, 20px); opacity: 0.8; }
  50% { transform: scale(1.2) translate(0, -10px); opacity: 1; }
  75% { transform: scale(0.9) translate(10px, 0); opacity: 0.9; }
  100% { transform: scale(0.7) translate(20px, 10px); opacity: 0.7; }
}

@keyframes fire-burn {
  0% { transform: scale(0.7); opacity: 0.8; filter: brightness(1.1); }
  25% { transform: scale(1); opacity: 1; filter: brightness(1.3); }
  50% { transform: scale(1.2); opacity: 0.9; filter: brightness(1.5); }
  75% { transform: scale(1.1); opacity: 0.8; filter: brightness(1.3); }
  100% { transform: scale(0.9); opacity: 0.7; filter: brightness(1.1); }
}

@keyframes kiss-appear {
  0% { transform: scale(0.3); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  75% { transform: scale(1.1) rotate(10deg); opacity: 0.9; }
  100% { transform: scale(1) rotate(-5deg); opacity: 0.8; }
}

@keyframes tear-fly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  50% { transform: translate(-15px, -20px) rotate(-20deg); opacity: 0.8; }
  100% { transform: translate(-30px, -5px) rotate(-45deg); opacity: 0; }
}

.tear-effect {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  animation: tear-fly 0.5s ease-out forwards;
}

.star-effect {
  position: absolute;
  font-size: 30px;
  color: yellow;
  text-shadow: 0 0 5px red;
  z-index: 9999;
  animation: star-appear 0.4s ease-out forwards;
}

@keyframes star-appear {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

#message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2em;
  color: #ffd700;
  font-weight: bold;
  text-shadow: 2px 2px 4px black, 0 0 10px rgba(255, 215, 0, 0.5);
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 7;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 15px 25px;
  border-radius: 10px;
  border: 2px solid #ff9900;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Écran de fin de partie */
#final-score {
  font-size: 2em;
  margin: 10px 0;
  color: #ffd700;
}

#funny-message {
  font-size: 1.4em;
  margin-bottom: 0px;
  color: #ff4500;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  font-weight: bold;
  padding: 10px;
  line-height: 1.4;
  background-color: rgba(0,0,0,0.2);
  border-radius: 15px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  border: 2px dashed #ff8c00;
}

#mole-result {
  width: 120px;
  height: 120px;
  margin: 15px auto;
  position: relative;
}

#mole-result img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid red;
  object-fit: cover;
}

/* Dialogue de partage */
.share-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.share-dialog-content {
  background-color: #2a3547;
  border-radius: 15px;
  padding: 20px;
  max-width: 90%;
  width: 350px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.share-dialog h3 {
  margin-top: 0;
  color: #ffd700;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: bold;
  color: white;
  cursor: pointer;
  margin-bottom: 0px;
  transition: transform 0.2s, filter 0.2s;
}

.share-button:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.facebook {
  background-color: #3b5998;
}

.twitter {
  background-color: #1da1f2;
}

.whatsapp {
  background-color: #25d366;
}

.telegram {
  background-color: #0088cc;
}

.copy-button, .close-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  transition: transform 0.2s, background-color 0.2s;
}

.close-button {
  background-color: #f44336;
  
}

.copy-button:hover, .close-button:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Effets spéciaux */
@keyframes glow {
  0% { filter: drop-shadow(0 0 5px gold); }
  100% { filter: drop-shadow(0 0 15px gold); }
}

.glow {
  animation: glow 1s infinite alternate;
}

/* Optimisations responsive pour mobile */
@media (max-width: 600px) {
  h1 {
    font-size: 2.2em;
    margin-bottom: 0px;
  }
  
  h2 {
    font-size: 1.8em;
    margin-bottom: 0px;
  }
  
  .main-button {
    padding: 12px 25px;
    font-size: 1.2em;
    margin: 8px;
  }
  
  .menu-button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 6px;
  }
  
  #hud {
    font-size: 0.9em;
    padding: 5px;
  }
  
  .mole {
    width: 70px;
    height: 70px;
  }
  
  #message {
    font-size: 1.5em;
  }
  
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
  }
  
  .trophy-item {
    padding: 6px;
  }
  
  .trophy-item img {
    max-width: 80px;
    max-height: 80px;
  }
  
  /* Réduit l'espacement pour gagner de la place */
  .screen {
    padding: 10px;
  }
  
  /* HUD plus compact */
  #score, #timer, #current-weapon {
    font-size: 1.1em;
  }
  
  /* Effet des armes plus adapté au mobile */
  .effect {
    transform-origin: center;
    transform: scale(0.9);
  }
  
  /* Optimisation pour portrait */
  #game-area {
    height: 100vh;
    width: 100%; /* Utiliser toute la largeur disponible */
    max-width: none; /* Supprimer la limite de largeur */
  }
  
  /* Meilleure gestion des événements tactiles */
  .mole {
    touch-action: manipulation;
  }
  
  /* Amélioration des effets visuels pour mobile */
  .effect {
    transform: scale(1.3); /* Agrandir les effets pour meilleure visibilité */
  }
}

/* Optimisations spécifiques pour très petits écrans */
@media (max-width: 380px) {
  .mole {
    width: 70px;
    height: 70px;
  }
  
  h1 {
    font-size: 1.8em;
    margin: 5px 0;
  }
  
  .main-button, .menu-button {
    padding: 10px 16px;
    font-size: 0.9em;
    min-width: 80px;
  }
  
  #hud {
    font-size: 0.9em;
    padding: 5px;
  }
  
  .trophy-item img {
    max-width: 60px;
    max-height: 60px;
  }
  
  /* Optimisation des bulles de texte pour mobile */
  .speech-bubble {
    font-size: 0.8em;
    padding: 5px;
    max-width: 120px;
  }
  
  /* Optimisation des effets pour mobile */
  .effect {
    transform: scale(1.5);
  }
  
  /* Empêcher les zooms accidentels */
  input, button, select, textarea {
    font-size: 16px; /* Empêche iOS de zoomer sur les champs de saisie */
  }
  
  /* Meilleure gestion des événements tactiles */
  .mole {
    touch-action: manipulation;
  }
}

/* Optimisations pour orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
  #game-area {
    height: 80vh;
    max-height: 80vh;
  }
  
  .screen {
    padding: 5px;
  }
  
  h1 {
    font-size: 1.5em;
    margin: 2px 0;
  }
  
  .main-button, .menu-button {
    padding: 5px 12px;
  }
  
  /* Adaptation du HUD en mode paysage */
  .game-stats {
    font-size: 0.9em;
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    z-index: 100;
  }
  
  .mole {
    width: 70px;
    height: 70px;
  }
  
  /* Style responsive pour l'écran d'histoire */
  #story-container {
    max-width: 90%;
  }
  
  #story-text {
    font-size: 16px;
  }
}

/* Écran d'histoire */
#help-screen {
  position: fixed;
  top: 0; /* Commence immédiatement en haut */
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0; /* Aucun padding - sera géré dans les conteneurs enfants */
  z-index: 900;
  background-color: #1e2533;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: scroll; /* Toujours permettre le défilement */
  -webkit-overflow-scrolling: touch; /* Pour iOS */
}

#story-container {
  width: 100%;
  max-width: 600px;
  margin: 10px auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0; /* Empêche le conteneur de se rétrécir */
}

.story-box {
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
   /* Ajout d'un espace en haut */
  margin-bottom: 0px; /* Espace en bas pour assurer que tout est visible */
}

#story-animation {
  height: 200px;
  margin-bottom: 0px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#story-text {
  color: white;
  font-size: 18px;
  line-height: 1.4;
  padding: 10px;
  min-height: 120px;
  text-align: center;
  position: relative;
}

#story-controls {
  display: flex;
  justify-content: space-between;
  
}

.story-button {
  background-color: #d35400;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.story-button:hover {
  background-color: #e67e22;
  transform: scale(1.1);
}

.story-button:disabled {
  background-color: #7f8c8d;
  cursor: not-allowed;
  transform: scale(1);
}

.story-character {
  position: absolute;
  transition: transform 0.5s, opacity 0.5s;
  width: 80px;
  height: 80px;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
}

.story-effect {
  position: absolute;
  pointer-events: none;
}

/* Animation pour faire trembler l'écran */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Animation pour faire tomber un élément */
@keyframes fall {
  0% { transform: translateY(-100px); opacity: 0; }
  70% { transform: translateY(0); opacity: 1; }
  85% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}

/* Animation pour faire rebondir un élément */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

/* Animation pour faire tourner un élément */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animation de fondu */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Styles pour la boîte de dialogue de partage */
.share-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.share-dialog-content {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.share-dialog h3 {
  margin-top: 0;
  color: #333;
  font-size: 1.5rem;
}

.share-dialog p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0px;
}

.share-button {
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40%;
  color: white;
  font-weight: bold;
  transition: transform 0.2s;
}

.share-button:active {
  transform: scale(0.95);
}

.share-button.facebook {
  background-color: #3b5998;
}

.share-button.twitter {
  background-color: #1da1f2;
}

.share-button.whatsapp {
  background-color: #25d366;
}

.share-button.telegram {
  background-color: #0088cc;
}

.copy-button, .close-button {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  margin: 5px;
  cursor: pointer;
  font-weight: bold;
  width: 80%;
}

.copy-button {
  background-color: #4caf50;
  color: white;
}

.close-button {
  background-color: #f44336;
  color: white;
}
/* Boutons de récompense */
.reward-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  
  width: 100%;
  max-width: 300px;
  z-index: 999;
  position: relative;
  visibility: visible !important;
}

.reward-button {
  padding: 12px 20px;
  border-radius: 8px;
  background-color: #ff9800;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  box-shadow: 0 4px 0 #e65100;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  display: block;
  visibility: visible !important;
}

.reward-button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #e65100;
}

/* Style spécifique pour l'écran de fin */
#game-over-screen {
  
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding-bottom: 0px;
}

/* Styles pour les statistiques rapides */
.quick-stats {
  background-color: rgba(50, 50, 50, 0.8);
  border-radius: 15px;
  padding: 15px;
  margin: 15px auto;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.quick-stats-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #FFD700;
  margin-bottom: 0px;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 15px;
  margin-bottom: 0px;
}

.quick-stat-item {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.quick-stat-item:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.quick-stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 0px;
}

.quick-stat-label {
  font-size: 0.9em;
  color: #aaaaaa;
}

/* Style pour le bouton des statistiques détaillées */
.stats-big-button {
  background-color: #4a148c;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1em;
  
  font-weight: bold;
  box-shadow: 0 0 10px rgba(74, 20, 140, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  width: 80%;
  max-width: 300px;
}

.stats-big-button:hover {
  background-color: #6a1b9a;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(106, 27, 154, 0.7);
}

/* Styles pour les défis - succès et échec */
#challenge-container.success {
  background-color: rgba(39, 174, 96, 0.95);
  border-color: #27ae60;
  animation: success-pulse 1s infinite alternate;
  box-shadow: 0 0 30px rgba(39, 174, 96, 0.8), 0 0 50px rgba(255, 255, 255, 0.5);
}

#challenge-container.failure {
  background-color: rgba(231, 76, 60, 0.95);
  border-color: #c0392b;
  animation: failure-pulse 1s infinite alternate;
  box-shadow: 0 0 30px rgba(231, 76, 60, 0.8), 0 0 50px rgba(255, 255, 255, 0.5);
}

@keyframes success-pulse {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(39, 174, 96, 0.7); }
  100% { transform: scale(1.05); box-shadow: 0 0 40px rgba(39, 174, 96, 0.9), 0 0 60px rgba(255, 255, 255, 0.5); }
}

@keyframes failure-pulse {
  0% { transform: scale(1) rotate(-1deg); box-shadow: 0 0 20px rgba(231, 76, 60, 0.7); }
  100% { transform: scale(1.05) rotate(1deg); box-shadow: 0 0 40px rgba(231, 76, 60, 0.9), 0 0 60px rgba(255, 255, 255, 0.5); }
}

/* Styles pour les animations de bonus de points et de temps */
.points-bonus, .time-bonus {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: bold;
  z-index: 9999;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  transition: all 1s ease-out;
  animation: bonus-appear 0.5s ease-out;
}

.points-bonus {
  color: #FFD700;
  text-shadow: 0 0 10px #ff9900;
}

.time-bonus {
  color: #00FFFF;
  text-shadow: 0 0 10px #00FFFF;
}

@keyframes bonus-appear {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Animations spéciales pour les types de taupes */
@keyframes malus-shake {
  0% { transform: translateX(0) rotate(0deg); }
  10% { transform: translateX(-4px) rotate(-2deg); }
  20% { transform: translateX(4px) rotate(2deg); }
  30% { transform: translateX(-4px) rotate(-2deg); }
  40% { transform: translateX(4px) rotate(2deg); }
  50% { transform: translateX(-4px) rotate(-2deg); }
  60% { transform: translateX(4px) rotate(2deg); }
  70% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(4px) rotate(2deg); }
  90% { transform: translateX(-4px) rotate(-2deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

@keyframes golden-pulse {
  0% { transform: scale(1); box-shadow: 0 0 10px gold, 0 0 20px rgba(255, 215, 0, 0.6); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px gold, 0 0 40px rgba(255, 215, 0, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 10px gold, 0 0 20px rgba(255, 215, 0, 0.6); }
}

/* Styles pour le bouton Custom ta victime */
.victim-editor-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
  color: white !important;
  border: 2px solid #ff5252 !important;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
  font-weight: bold !important;
}

.victim-editor-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6) !important;
}
