@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rubik:wght@400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Inclut les bordures et paddings dans les dimensions */
}

/* Configuration du corps principal avec fond dégradé violet/noir */
html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* Empêche le scroll */
  background: linear-gradient(135deg, #0a0015 0%, #1a0033 50%, #0f001f 100%);
  height: 100%; 
  width: 100%;
  position: relative;
}

/* Créer un effet d'étoiles scintillantes */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Plusieurs dégradés radiaux pour créer des étoiles à différentes positions */
  background-image: 
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, white, transparent),
    radial-gradient(1px 1px at 33% 85%, white, transparent),
    radial-gradient(1px 1px at 75% 45%, white, transparent);
  background-size: 200% 200%;
  animation: twinkle 8s ease-in-out infinite; /* Animation de scintillement */
  opacity: 0.3; /* Transparence pour effet subtil */
  pointer-events: none; /* Ne bloque pas les clics */
  z-index: 0;
}

/* Créer des confettis tombants */
body::after {
  content: '';
  position: fixed;
  top: -10%;
  left: 0;
  width: 100%;
  height: 110%;
  /* Plusieurs dégradés linéaires pour créer des confettis colorés */
  background-image:
    linear-gradient(45deg, #FFD700 2px, transparent 2px),     
    linear-gradient(-45deg, #FF69B4 2px, transparent 2px),     
    linear-gradient(90deg, #00CED1 2px, transparent 2px),      
    linear-gradient(135deg, #FF4500 2px, transparent 2px);     
  background-size: 50px 50px, 80px 80px, 100px 100px, 60px 60px;
  background-position: 0 0, 40px 40px, 20px 20px, 70px 70px;
  animation: confetti-fall 20s linear infinite; /* Animation de chute */
  opacity: 0.1; /* Très transparent pour ne pas gêner */
  pointer-events: none;
  z-index: 0;
}

/* Animation des confettis tombants */
@keyframes confetti-fall {
  0% { transform: translateY(-10%); }
  100% { transform: translateY(110%); }
}

/* Animation de scintillement des étoiles */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

#imgpacman, #fantome1, #fantome2, #fantome3, #fantome4, #fantomeBleu {
  position: absolute;
  display: none; 
  z-index: 100;
}

.proprieteJeu {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#h1 {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  z-index: 10;
}

h1 {
  font-family: "Press Start 2P", monospace; /* Police style arcade */
  font-weight: 400;
  color: #FFD700; 
  text-align: center;
  font-size: clamp(32px, 8vw, 80px); /* Taille responsive */
  margin: 0;
  /* Effet néon doré avec ombre violette */
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.6),
    0 0 30px rgba(255, 215, 0, 0.4),
    4px 4px 0px rgba(157, 0, 255, 0.8);
  animation: pulse 2s ease-in-out infinite; /* Animation de pulsation */
  letter-spacing: 2px;
}

/* Animation de pulsation du titre */
@keyframes pulse {
  0%, 100% { 
    text-shadow: 
      0 0 10px rgba(255, 215, 0, 0.8),
      0 0 20px rgba(255, 215, 0, 0.6),
      0 0 30px rgba(255, 215, 0, 0.4),
      4px 4px 0px rgba(157, 0, 255, 0.8);
  }
  50% { 
    text-shadow: 
      0 0 20px rgba(255, 215, 0, 1),
      0 0 30px rgba(255, 215, 0, 0.8),
      0 0 40px rgba(255, 215, 0, 0.6),
      4px 4px 0px rgba(157, 0, 255, 1);
  }
}

/* Classe de base pour tous les boutons avec effet néon et survol */
.bouton-base {
  background: linear-gradient(135deg, #7e3ca0 0%, #3D005B 100%); /* Dégradé violet */
  color: #FFD700; 
  font-family: "Press Start 2P", monospace;
  border: 3px solid #FFD700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 4px 15px rgba(157, 0, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden; /* Pour l'effet de brillance */
}

/* Effet de brillance qui traverse le bouton au survol */
.bouton-base::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.bouton-base:hover::before {
  left: 100%; /* Traverse le bouton */
}

/* Effet au survol : bouton plus clair, plus grand, avec ombre plus forte */
.bouton-base:hover {
  background: linear-gradient(135deg, #9d5cc0 0%, #5a0085 100%);
  transform: translateY(-3px) scale(1.05); /* Lève le bouton */
  box-shadow: 
    0 6px 20px rgba(157, 0, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: #FFA500; /* Bordure orange au survol */
}

/* Effet au clic : légère compression */
.boutonJouer:active {
  transform: translateY(-1px) scale(1.02);
}

#niveauActuel {
  font-family: "Press Start 2P", monospace;
  color: #FFD700;
  font-size: clamp(14px, 2.5vw, 20px);
  text-align: center;
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(61, 0, 91, 0.7); /* Fond violet semi-transparent */
  padding: clamp(8px, 1.5vw, 12px) clamp(15px, 2.5vw, 20px);
  border-radius: 8px;
  border: 2px solid #FFD700;
  backdrop-filter: blur(5px); /* Flou de l'arrière-plan */
  display: block;
}

.boutonJouer {
  font-size: clamp(24px, 4vw, 48px);
  padding: clamp(15px, 2vw, 25px) clamp(30px, 4vw, 50px);
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 3s ease-in-out infinite; /* Animation de flottement */
}

/* Animation de flottement du bouton Jouer */
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}

.boutonRegles,
.boutonNiveaux,
.boutonParametres {
  font-size: clamp(14px, 2vw, 20px);
  padding: clamp(10px, 1.5vw, 15px) clamp(20px, 2.5vw, 30px);
  display: block;
  position: absolute;
  bottom: 5%;
}

.boutonRegles {
  left: 5%; 
}

.boutonNiveaux {
  left: 50%;
  transform: translateX(-50%); 
}

.boutonNiveaux:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.05);
}

.boutonParametres {
  right: 5%; 
}

.boutonMenu {
  font-size: clamp(14px, 2vw, 20px);
  padding: clamp(10px, 1.5vw, 15px) clamp(20px, 2.5vw, 30px);
  display: none; 
  position: absolute;
  bottom: 5%;
  right: 5%;
  z-index: 10000; 
}

#gameContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(90vw, 90vh, 700px);
  max-height: min(90vw, 90vh, 700px);
  display: none; 
  border: 4px solid #FFD700;
  border-radius: 8px;
  box-shadow: 
    0 0 30px rgba(255, 215, 0, 0.5),
    0 0 60px rgba(157, 0, 255, 0.3);
  background: black;
  padding: 10px;
}

#jeuCanvas {
  position: relative;
  display: block;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Conserve les proportions */
  margin: 0 auto;
}

#score {
  color: #FFD700;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(12px, 2vw, 18px);
  text-align: center;
  display: none; 
  position: absolute;
  bottom: clamp(10px, 2%, 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(61, 0, 91, 0.9);
  padding: clamp(8px, 1.5vw, 12px) clamp(15px, 2.5vw, 20px);
  border-radius: 8px;
  border: 2px solid #FFD700;
  backdrop-filter: blur(5px);
}

/* Styles communs pour les écrans de fin de partie */
#perdu,
#gagne {
  position: fixed;
  font-family: "Press Start 2P", monospace;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(85vw, 400px);
  padding: clamp(30px, 5vw, 50px) clamp(20px, 4vw, 40px);
  background: linear-gradient(135deg, #3D005B 0%, #1a0033 100%);
  color: #FFD700;
  font-size: clamp(28px, 6vw, 48px);
  font-weight: bold;
  justify-content: center;
  text-align: center;
  align-items: center;
  display: none; 
  flex-direction: column;
  gap: 20px;
  border-radius: 15px;
  border: 4px solid #FFD700;
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.6),
    0 0 80px rgba(157, 0, 255, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Animation d'apparition */
}

/* Animation d'apparition avec effet de rebond */
@keyframes popIn {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

#perdu {
  color: #FF4444; 
  border-color: #FF4444;
  box-shadow: 
    0 0 40px rgba(255, 68, 68, 0.6),
    0 0 80px rgba(255, 68, 68, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
}

#gagne {
  color: #4CAF50; 
  border-color: #4CAF50;
  box-shadow: 
    0 0 40px rgba(76, 175, 80, 0.6),
    0 0 80px rgba(76, 175, 80, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Paragraphes dans l'écran de victoire */
#gagne p {
  font-size: clamp(16px, 3vw, 24px);
  color: #FFD700;
  margin: 5px 0;
}

#boutonRecommencer,
#niveau_suivant {
  font-family: "Press Start 2P", monospace;
  background: linear-gradient(135deg, #7e3ca0 0%, #3D005B 100%);
  color: #FFD700;
  font-size: clamp(12px, 2.5vw, 18px);
  font-weight: bold;
  padding: clamp(12px, 2vw, 18px) clamp(20px, 3vw, 30px);
  border: 3px solid #FFD700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(157, 0, 255, 0.4);
  display: none; 
  position: relative;
  overflow: hidden;
}

/* Effet de brillance sur les boutons Recommencer et Niveau suivant */
#boutonRecommencer::before,
#niveau_suivant::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#boutonRecommencer:hover::before,
#niveau_suivant:hover::before {
  left: 100%;
}

#boutonRecommencer:hover,
#niveau_suivant:hover {
  background: linear-gradient(135deg, #9d5cc0 0%, #5a0085 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(157, 0, 255, 0.6);
  border-color: #FFA500;
}

#reglesJeu {
  display: none; 
  font-family: "Press Start 2P", monospace;
  color: #FFD700;
  text-align: center;
  font-size: clamp(24px, 5vw, 48px);
  margin: clamp(30px, 5vw, 50px);
  position: absolute;
  top: clamp(20px, 5%, 60px);
  left: 50%;
  transform: translateX(-50%);
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    3px 3px 6px rgba(0, 0, 0, 0.8);
  width: 90%;
}

#reglesJeu h2 {
  font-size: clamp(24px, 5vw, 48px);
  font-weight: 400;
  margin: 0;
}

#explications {
  display: none; 
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  color: #f5f5f5;
  font-size: clamp(14px, 2vw, 20px);
  line-height: 1.8;
  text-align: left;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(85vw, 800px);
  max-height: 70vh;
  overflow-y: auto; /* Scroll si trop de contenu */
  background: rgba(61, 0, 91, 0.95);
  padding: clamp(25px, 4vw, 40px);
  border-radius: 15px;
  border: 3px solid #FFD700;
  box-shadow: 
    0 0 30px rgba(255, 215, 0, 0.5),
    0 0 60px rgba(157, 0, 255, 0.3);
  backdrop-filter: blur(10px);
  margin-top: clamp(80px, 15vh, 150px);
}

/* Style de la scrollbar pour les règles */
#explications::-webkit-scrollbar {
  width: 10px;
}

#explications::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

#explications::-webkit-scrollbar-thumb {
  background: #FFD700;
  border-radius: 5px;
}

#explications::-webkit-scrollbar-thumb:hover {
  background: #FFA500;
}

#boutons_niveaux {
  display: none; 
  flex-wrap: wrap;
  gap: clamp(15px, 2vw, 25px);
  padding: clamp(20px, 3vw, 40px);
  width: 90%;
  max-width: 1200px;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 70vh;
  overflow-y: auto; /* Scroll si nécessaire */
  background: rgba(26, 0, 51, 0.8);
  border-radius: 20px;
  border: 3px solid #FFD700;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.4),
    0 0 80px rgba(157, 0, 255, 0.3);
}

/* Style de la scrollbar pour la sélection des niveaux */
#boutons_niveaux::-webkit-scrollbar {
  width: 12px;
}

#boutons_niveaux::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

#boutons_niveaux::-webkit-scrollbar-thumb {
  background: #FFD700;
  border-radius: 6px;
}

#boutons_niveaux::-webkit-scrollbar-thumb:hover {
  background: #FFA500;
}

/* Boutons individuels de niveau */
.bouton-niveau {
  width: clamp(120px, 18vw, 180px);
  height: clamp(120px, 18vw, 180px);
  background: linear-gradient(135deg, #7e3ca0 0%, #3D005B 100%);
  color: #FFD700;
  border: 3px solid #FFD700;
  border-radius: 15px;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(157, 0, 255, 0.4);
  position: relative;
  overflow: hidden;
}

/* Effet de brillance sur les boutons de niveau */
.bouton-niveau::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.bouton-niveau:hover:not(:disabled)::before {
  left: 100%;
}

.bouton-niveau:hover:not(:disabled) {
  background: linear-gradient(135deg, #9d5cc0 0%, #5a0085 100%);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(157, 0, 255, 0.6);
  border-color: #FFA500;
}

/* Niveau verrouillé (grisé avec image de cadenas) */
.bouton-niveau.verrouille,
.bouton-niveau:disabled {
  background: linear-gradient(135deg, #1a0028 0%, #0a0015 100%);
  cursor: not-allowed;
  opacity: 0.6;
  border-color: #666;
  color: #666;
  /* Image du cadenas en fond */
  background-image: url('images/cadenas.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: clamp(50px, 10vw, 80px); /* Taille responsive du cadenas */
}

.bouton-niveau:disabled:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* RESPONSIVE DESIGN - TABLETTES */
@media (max-width: 768px) {
  body::before {
    background-size: 300% 300%;
  }
  
  #h1 {
    top: 5%;
  }
  
  /* Titre plus petit */
  h1 {
    font-size: clamp(24px, 10vw, 48px);
    letter-spacing: 1px;
  }
  
  /* Bouton Jouer plus petit */
  .boutonJouer {
    font-size: clamp(20px, 5vw, 36px);
    padding: 15px 30px;
  }
  
  /* Boutons du menu plus petits */
  .boutonRegles,
  .boutonNiveaux,
  .boutonParametres,
  .boutonMenu {
    font-size: clamp(12px, 3vw, 16px);
    padding: 10px 15px;
  }
  
  /* Conteneur du jeu plus petit */
  #gameContainer {
    max-width: min(95vw, 95vh, 550px);
    max-height: min(95vw, 95vh, 550px);
    padding: 8px;
    border: 3px solid #FFD700;
  }
  
  /* Score plus petit */
  #score {
    font-size: clamp(10px, 3vw, 14px);
    padding: 6px 10px;
    bottom: 5px;
  }
  
  /* Niveau actuel plus petit */
  #niveauActuel {
    font-size: clamp(12px, 3vw, 16px);
    padding: 6px 12px;
    top: 55%;
  }
  
  /* Écrans de fin plus petits */
  #perdu,
  #gagne {
    width: 90vw;
    font-size: clamp(24px, 7vw, 36px);
    padding: 25px 15px;
  }
  
  /* Règles plus petites */
  #reglesJeu h2 {
    font-size: clamp(20px, 6vw, 32px);
  }
  
  #explications {
    font-size: clamp(12px, 3.5vw, 16px);
    padding: 20px;
    width: 90vw;
    max-height: 65vh;
    line-height: 1.6;
  }
  
  /* Grille de niveaux plus compacte */
  #boutons_niveaux {
    gap: 12px;
    padding: 15px;
    width: 95vw;
    max-height: 65vh;
  }
  
  /* Boutons de niveau plus petits */
  .bouton-niveau {
    width: clamp(90px, 28vw, 140px);
    height: clamp(90px, 28vw, 140px);
    font-size: clamp(14px, 4vw, 18px);
  }
  
  .bouton-niveau.verrouille,
  .bouton-niveau:disabled {
    background-size: clamp(40px, 15vw, 60px);
  }
}

/* RESPONSIVE DESIGN - MOBILES */
@media (max-width: 480px) {
  /* Repositionnement du bouton Jouer */
  .boutonJouer {
    top: 45%;
  }
  
  /* Niveau actuel repositionné */
  #niveauActuel {
    top: 52%;
    font-size: clamp(10px, 3.5vw, 14px);
  }
  
  /* Boutons du menu repositionnés */
  .boutonRegles {
    bottom: 3%;
    left: 3%;
  }
  
  .boutonNiveaux {
    bottom: 3%;
  }
  
  .boutonParametres,
  .boutonMenu {
    bottom: 3%;
    right: 3%;
  }
  
  /* Grille de niveaux encore plus compacte */
  #boutons_niveaux {
    gap: 10px;
    padding: 10px;
  }
  
  /* Boutons de niveau encore plus petits */
  .bouton-niveau {
    width: clamp(75px, 30vw, 110px);
    height: clamp(75px, 30vw, 110px);
    font-size: clamp(12px, 4.5vw, 16px);
    border-radius: 10px;
  }
}

/* Animation de tremblement pour l'écran PERDU */
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  25% { transform: translate(-50%, -50%) rotate(-2deg); }
  75% { transform: translate(-50%, -50%) rotate(2deg); }
}

#perdu {
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), shake 0.5s ease-in-out 0.5s;
}

#gagne {
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#panneauParametres {
  display: none; 
  flex-direction: column;
  align-items: center;
  gap: clamp(25px, 4vw, 40px);
  padding: clamp(30px, 5vw, 50px);
  width: min(85vw, 600px);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(61, 0, 91, 0.95);
  border-radius: 20px;
  border: 4px solid #FFD700;
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.5),
    0 0 80px rgba(157, 0, 255, 0.3);
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.titre-parametres {
  font-family: "Press Start 2P", monospace;
  color: #FFD700;
  font-size: clamp(24px, 5vw, 40px);
  margin: 0;
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    3px 3px 6px rgba(0, 0, 0, 0.8);
}

.controle-musique {
  display: flex;
  flex-direction: column;
  gap: 25px;
  width: 100%;
  align-items: center;
}

.bouton-musique {
  font-family: "Press Start 2P", monospace;
  background: linear-gradient(135deg, #7e3ca0 0%, #3D005B 100%);
  color: #FFD700;
  font-size: clamp(16px, 3vw, 24px);
  padding: clamp(15px, 2.5vw, 20px) clamp(25px, 4vw, 40px);
  border: 3px solid #FFD700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(157, 0, 255, 0.4);
  position: relative;
  overflow: hidden;
  min-width: clamp(250px, 60vw, 350px);
}

/* Effet de brillance sur le bouton musique */
.bouton-musique::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.bouton-musique:hover::before {
  left: 100%;
}

.bouton-musique:hover {
  background: linear-gradient(135deg, #9d5cc0 0%, #5a0085 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(157, 0, 255, 0.6);
  border-color: #FFA500;
}

/* État actif = bouton vert */
.bouton-musique.actif {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  border-color: #2ecc71;
  box-shadow: 
    0 4px 15px rgba(46, 204, 113, 0.5),
    0 0 20px rgba(46, 204, 113, 0.3);
}

.bouton-musique.actif:hover {
  background: linear-gradient(135deg, #3ae374 0%, #2ecc71 100%);
  border-color: #3ae374;
  box-shadow: 
    0 6px 20px rgba(46, 204, 113, 0.7),
    0 0 30px rgba(46, 204, 113, 0.5);
}

.controle-volume {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  align-items: center;
}

.controle-volume label {
  font-family: "Press Start 2P", monospace;
  color: #FFD700;
  font-size: clamp(14px, 2.5vw, 20px);
  text-shadow: 
    0 0 8px rgba(255, 215, 0, 0.8),
    2px 2px 4px rgba(0, 0, 0, 0.8);
}

.curseur-volume {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(250px, 60vw, 400px);
  height: 12px;
  background: linear-gradient(to right, #3D005B 0%, #7e3ca0 100%);
  outline: none;
  border-radius: 10px;
  box-shadow: 
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(157, 0, 255, 0.3);
  border: 2px solid #FFD700;
}

/* Curseur du slider pour Chrome et Safari */
.curseur-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    0 4px 8px rgba(0, 0, 0, 0.4);
  border: 2px solid #f5f5f5;
  transition: all 0.2s ease;
}

.curseur-volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 
    0 0 15px rgba(255, 215, 0, 1),
    0 6px 12px rgba(0, 0, 0, 0.5);
}

/* Curseur du slider pour Firefox */
.curseur-volume::-moz-range-thumb {
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    0 4px 8px rgba(0, 0, 0, 0.4);
  border: 2px solid #f5f5f5;
  transition: all 0.2s ease;
}

.curseur-volume::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 
    0 0 15px rgba(255, 215, 0, 1),
    0 6px 12px rgba(0, 0, 0, 0.5);
}

.affichage-volume {
  font-family: "Press Start 2P", monospace;
  color: #FFD700;
  font-size: clamp(16px, 3vw, 22px);
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.3);
  padding: clamp(8px, 1.5vw, 12px) clamp(15px, 2.5vw, 20px);
  border-radius: 8px;
  border: 2px solid #FFD700;
  min-width: 80px;
  text-align: center;
}

/* RESPONSIVE POUR LE PANNEAU DES PARAMÈTRES */
@media (max-width: 768px) {
  #panneauParametres {
    width: 90vw;
    padding: 25px 20px;
  }
  
  .bouton-musique {
    min-width: 250px;
    font-size: clamp(14px, 4vw, 18px);
  }
  
  .curseur-volume {
    width: clamp(200px, 70vw, 300px);
  }
}

@media (max-width: 480px) {
  .titre-parametres {
    font-size: clamp(18px, 6vw, 28px);
  }
  
  .bouton-musique {
    min-width: 200px;
    font-size: clamp(12px, 4.5vw, 16px);
    padding: 12px 20px;
  }
  
  .controle-volume label {
    font-size: clamp(12px, 3.5vw, 16px);
  }
  
  .curseur-volume {
    width: clamp(180px, 75vw, 250px);
  }
  
  .affichage-volume {
    font-size: clamp(14px, 4vw, 18px);
  }
}