/* ========== Global Styles ========== */
body {
  /* Reset margin and padding for the body */
  margin: 0;
  padding: 0;
  /* Set a background image with specific properties */
  background-image: url('../img/personadle_wallpaper.jpg');
  background-size: cover; /* Make the image cover the entire background */
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Prevent the image from repeating */
  background-attachment: fixed; /* Fix the background while scrolling */
  font-family: Arial, sans-serif; /* Set the default font for the body */
}

/* ========== Title ========== */
#title {
  /* Style for the title element */
  display: inline-block; /* Make it inline-block for better control */
  color: #51ff00; /* Set the text color */
  font-family: 'Times New Roman', Times, serif; /* Use a serif font */
  font-size: 30px; /* Set font size */
  padding: 10px 20px; /* Add padding around the title */
  border-radius: 10px; /* Round the corners */
}

.title-wrapper {
  /* Center the title wrapper */
  text-align: center;
}

.input-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.input-wrapper > .input-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  position: relative;
}


/* === BOUTONS SUBMIT / REPLAY ALIGNÉS DROITE DU CHAMP === */
#guessButton,
#resetButton {
  display: block;
  height: 90px;
  flex-shrink: 0;
}
#textbar {
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  width: 280px;
  border: 2px solid #444;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}


/* ========== Logo Home Page ========== */
#imgHomePage {
  /* Style for the homepage logo */
  width: 1200px; /* Set width */
  height: auto; /* Maintain aspect ratio */
  transition: transform 0.3s ease-in-out; /* Smooth scaling effect */
  display: block; /* Center the image */
  margin: 15px auto 0; /* Add margin */
}

#imgHomePage:hover {
  /* Scale the logo slightly on hover */
  transform: scale(1.1);
}

/* ========== Gamemode Buttons ========== */
.gamemode-button {
  /* Style for gamemode buttons */
  width: 100%; /* Full width */
  max-width: 500px; /* Set max width */
  height: auto; /* Maintain aspect ratio */
  border: none; /* Remove border */
  padding: 0; /* Remove padding */
  background: none; /* Transparent background */
  cursor: pointer; /* Pointer cursor on hover */
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effects */
  display: block; /* Center the button */
  margin: 20px auto; /* Add margin */
}

.gamemode-button img {
  /* Style for images inside gamemode buttons */
  width: 100%; /* Full width */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Block-level element */
  border-radius: 15px; /* Round the corners */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); /* Add shadow */
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effects */
}

/* Hover effects for specific gamemode buttons */
#classicButton:hover img {
  transform: scale(1.03); /* Slightly scale up */
  box-shadow: 0 6px 14px rgb(32, 131, 245); /* Change shadow color */
}

#EmojiButton:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgb(240, 198, 12);
}

#AllOutAttackButton:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgb(255, 52, 52);
}

#shadowsButton:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgb(41, 99, 138);
}

#PersonaeButton:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgb(199, 169, 0);
}

#MusicButton:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgb(180, 22, 154);
}

/* ========== Gamemode Title ========== */
.gamemode-title {
  /* Style for gamemode titles */
  text-align: center; /* Center the text */
  color: white; /* Set text color */
  font-family: 'Times New Roman', Times, serif; /* Use serif font */
  font-size: 36px; /* Set font size */
  border: 4px solid rgb(202, 202, 202); /* Add border */
  padding: 15px 30px; /* Add padding */
  border-radius: 12px; /* Round the corners */
  background: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
  box-shadow: 0 0 15px rgba(8, 8, 8, 0.7); /* Add shadow */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effects */
  display: block; /* Block-level element */
  width: fit-content; /* Adjust width to content */
  margin: 30px auto; /* Center and add margin */
}

/* ========== Header Box ========== */
.personadle-box {
  /* Style for the header box */
  background: rgba(0, 102, 204, 0.87); /* Semi-transparent blue background */
  color: white; /* Set text color */
  padding: 30px 40px; /* Add padding */
  border-radius: 10px; /* Round the corners */
  text-align: center; /* Center the text */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); /* Add shadow */
  max-width: 400px; /* Set max width */
  margin: auto; /* Center the box */
}

.personadle-box h1 {
  /* Style for header text */
  margin: 0 0 15px; /* Add bottom margin */
  font-size: 26px; /* Set font size */
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* Use sans-serif font */
}

.personadle-box p {
  /* Style for paragraph text */
  font-size: 16px; /* Set font size */
  color: #e0e0e0; /* Light gray text color */
}

/* ========== Autocomplete Styles ========== */
.autocomplete-items {
  /* Style for autocomplete dropdown */
  position: absolute; /* Position relative to parent */
  left: 50%; /* Center horizontally */
  transform: translateX(-50%); /* Adjust centering */
  background-color: #ffffff; /* White background */
  border: 2px solid #000000; /* Black border */
  border-radius: 14px; /* Round the corners */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* Add shadow */
  z-index: 99; /* Ensure it appears above other elements */
  top: 100%; /* Position below the input */
  margin-top: 6px; /* Add spacing */
  width: 340px; /* Set width */
  max-height: 320px; /* Limit height */
  overflow-y: auto; /* Enable vertical scrolling */
  font-family: 'Segoe UI', sans-serif; /* Use sans-serif font */
  animation: fadeZoomIn 0.25s ease-out; /* Add fade-in animation */
}

/* === AUTOCOMPLÉTION POSITIONNÉE CORRECTEMENT SOUS LE TEXTBAR === */
#autocompleteList {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  max-height: 250px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.3);
  z-index: 5;
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-options {
  
  /* Style for each autocomplete option */
  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Center items vertically */
  padding: 12px 16px; /* Add padding */
  font-size: 17px; /* Set font size */
  font-weight: 600; /* Make text bold */
  cursor: pointer; /* Pointer cursor on hover */
  border-bottom: 1px solid #ddd; /* Add bottom border */
  transition: background-color 0.2s ease-in-out; /* Smooth hover effect */
  white-space: nowrap; /* Prevent text wrapping */
}

.list-options:last-child {
  /* Remove border for the last option */
  border-bottom: none;
}

.list-options:hover {
  /* Change background color on hover */
  background-color: #f0f0f0;
}

.list-options img {
  width: 100px;
  height: 100px;
  object-fit: contain; /* Pour voir l’image entière */
  background-color: white; /* Fond blanc si l’image est petite */
  border-radius: 8px;
  margin-right: 12px;
  flex-shrink: 0;
  border: 1px solid #ccc;
  
}


.list-options span {
  white-space: normal;       /* Permet les retours à la ligne */
  overflow: visible;         /* Ne masque pas le texte */
  text-overflow: unset;      /* Plus d’ellipse */
  max-width: 230px;          /* Conserve une largeur propre */
  line-height: 1.2;          /* Un peu de respi */
}


.autocomplete-active {
  background-color: #7b8383 !important;
}


.textbar-container {
  position: relative;
}


/* ========== Hint Button & Quote Text ========== */




.link-wrapper {

  position: relative;

  display: inline-block;

  margin: 0 16px;

  width: fit-content;

  height: fit-content;

}



.link-wrapper .fallback {

  font-size: 2.25em;

  letter-spacing: 4px;

  line-height: 0;

  opacity: 0;

  position: relative;

  top: 15px;

  left: 0;

}



.img-wrapper {

  position: relative;

  width: 100%;

  height: auto;

  border-radius: 10px; /* optionnel */

}



.img-wrapper img {

  width: 100%;

  height: auto;

  display: block;

  position: relative;

  z-index: 2;

  transition: transform 0.15s ease;

  pointer-events: none;

}



.img-wrapper .normal {

  display: block;
  

}



.img-wrapper .active {

  display: none;

}



.link-wrapper:hover {

  z-index: 9999;

}



.link-wrapper:hover .shape-wrapper {

  display: block;

  transform: rotate(-6deg);

}



.link-wrapper:nth-child(even):hover .shape-wrapper {

  transform: rotate(11deg);

}



.link-wrapper:hover .shape-wrapper .cyan-fill {

  transform: scale(3, 0.1);

}



.link-wrapper:hover .img-wrapper .normal {

  display: none;

}



.link-wrapper:hover .img-wrapper .active {

  display: block;

  animation: tiltBounce 0.15s ease forwards;

}



.shape-wrapper {

  display: none;

  position: absolute;

  inset: 0;

  pointer-events: none;

  filter: sepia(50%) saturate(3);

  z-index: 1;

}



.shape {

  position: absolute;

  inset: 0;

  overflow: hidden;

  transition: all 0.1s linear;

}



.shape svg {

  width: 100%;

  height: 100%;

  position: absolute;

  top: 0;

  left: 0;

}



.shape.cyan-fill {

  mix-blend-mode: screen;

  animation-delay: 0.05s;

  animation-duration: 0.4s;

  opacity: 0.6;

}



.shape.red-fill {

  animation-delay: 0.08s;

  animation-duration: 0.45s;

  opacity: 0.8;

}



.jelly {

  animation-name: jelly;

  animation-iteration-count: infinite;

  animation-timing-function: linear;

  transform-origin: center;

}



@keyframes tiltBounce {

  0% { transform: scale(1) rotate(-7deg); }

  50% { transform: scale(1.5) rotate(-7deg); }

  100% { transform: scale(1.15) rotate(-7deg); }

}



@keyframes tiltBounceAlt {

  0% { transform: scale(1) rotate(7deg); }

  50% { transform: scale(1.5) rotate(7deg); }

  100% { transform: scale(1.15) rotate(7deg); }

}



@keyframes jelly {

  0% {

    transform: scale(1.05,1) skewX(8deg) translateY(1px)

               rotateX(10deg) rotateY(5deg) rotateZ(-5deg);

  }

  50% {

    transform: scale(1.05,1.05) skewX(-5deg) translateY(-1px)

               translateZ(-10px);

  }

  100% {

    transform: scale(1.05,1) skewX(8deg) translateY(1px)

               rotateX(-10deg) rotateY(-5deg) rotateZ(-5deg);

  }

}



/* Style pour le texte de l'indice */
#quoteHint {
  font-size: 17px;
  font-style: italic;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 20px;
  border-radius: 10px;
  max-width: 500px;
  margin: 20px auto 0;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: none;
}

/* Conteneur principal des résultats */
#output {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Lignes de réponse */
.guess-row {
  display: grid;
  grid-template-columns: 100px repeat(7, 140px); /* chaque colonne = largeur fixe */
  gap: 14px;
  margin-bottom: 20px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  width: auto; /* auto plutôt que fit-content */
  max-width: 1300px;
}


 .guess-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  background-color: white;
  border-radius: 10px;
  border: 2px solid #ccc;
}


.guess-cell {
  width: 140px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: 'Arial', sans-serif;
  font-size: 15px;
  color: white;
  border-radius: 10px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  animation: flipIn 0.5s ease forwards;
  transform: rotateX(90deg);
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}





/* Delay l'animation de chaque case */
.guess-cell:nth-child(2) { animation-delay: 0.1s; }
.guess-cell:nth-child(3) { animation-delay: 0.2s; }
.guess-cell:nth-child(4) { animation-delay: 0.3s; }
.guess-cell:nth-child(5) { animation-delay: 0.4s; }
.guess-cell:nth-child(6) { animation-delay: 0.5s; }

.category-row {
  display: grid;
  grid-template-columns: 100px repeat(7, 140px); /* identique à .guess-row */
  gap: 14px;
  margin: 50px auto 10px auto;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  color: white;
  text-transform: uppercase;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 14px;
  max-width: 1300px;
}



.correct {
  background-color: #2ecc71;
}

.misplaced {
  background-color: #f1c40f;
  color: black;
}

.wrong {
  background-color: #e74c3c;
}

@keyframes flipIn {
  0% {
    transform: rotateX(90deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0);
    opacity: 1;
  }
}

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

.confetti-emoji {
  position: fixed;
  font-size: 2.2rem;
  z-index: 9999;
  pointer-events: none;
  animation: explode-diagonal 1s ease-out forwards;
  transform: translate(0, 0);
}

@keyframes explode-diagonal {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-move), var(--y-move)) rotate(var(--rotate));
    opacity: 0;
  }
}

.emoji-hint-zone {
  background: linear-gradient(to bottom right, #1875d1bd, #1d92dac2);
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  margin: 30px auto;
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.emoji-hint-zone h2 {
  font-size: 1.3rem;
  color: white;
  margin-bottom: 20px;
}

.emoji-hint-zone p {
  font-size: 0.95rem;
  color: #d0e6ff;
  margin-top: 10px;
}



.emoji-unit {
  font-size: 4rem;
  margin: 0 12px;
  opacity: 0;
  transform: scale(0.5);
  animation: popEmoji 0.3s forwards ease-out;
  display: inline-block;
  cursor: default;

  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.emoji-unit:hover {
  transform: scale(1.35);
  filter: drop-shadow(0 0 18px rgb(255, 234, 234))
          drop-shadow(0 0 12px rgb(4, 255, 255));
}


@keyframes popEmoji {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popEmoji {
  to {
    opacity: 1;
    transform: scale(1);
  }
}


@keyframes popEmoji {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.victory-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 3px solid #4caf50;
  border-radius: 12px;
  padding: 20px;
  background-color: #e6fbe6;
  max-width: 500px;
  margin: 30px auto 10px auto;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.victory-box img {
  width: 150px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.win-message {
  text-align: center;
  font-size: 1.4rem;
  color: #2e7d32;
  font-weight: bold;
}



.codename {
  font-weight: 700;
  font-size: 16px;
  color: black;
}

.realname {
  font-size: 14px;
  color: #555;
  font-style: italic;
  line-height: 1.1;
}


.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: max-content;
  max-width: 280px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  text-align: left;
  font-size: 13px;
  font-family: Arial, sans-serif;
  border-radius: 6px;
  padding: 8px 10px;
  position: absolute;
  z-index: 100;
  bottom: 125%; /* Au-dessus du texte */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%; /* Flèche en dessous */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}


.blur-level-0 { filter: blur(14px); }
.blur-level-1 { filter: blur(12px); }
.blur-level-2 { filter: blur(10px); }
.blur-level-3 { filter: blur(8px); }
.blur-level-4 { filter: blur(6px); }
.blur-level-5 { filter: blur(3px); }
.blur-level-6 { filter: blur(0px); transition: filter 0.4s ease; }

.victory-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 3px solid #4caf50;
  border-radius: 12px;
  padding: 20px;
  background-color: #e6fbe6;
  max-width: 500px;
  margin: 30px auto 10px auto;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.victory-box img {
  width: 50px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.win-message {
  text-align: center;
  font-size: 1.4rem;
  color: #2e7d32;
  font-weight: bold;
}


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

.aoa-gif-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px auto;
  padding: 20px;
  max-width: 700px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
  border: 2px solid #ff3c3c;
}

#aoaGif {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  margin: 40px auto;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
  transition: filter 0.3s ease;
}

/* ===== VICTORY BOX IMAGE PLUS GRANDE ===== */
.victory-box img {
  width: 200px;
  height: auto;
  border-radius: 14px;
  margin-bottom: 15px;
}

/* ===== LISTE D’ERREURS EN BAS ===== */
#wrongGuessList {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.wrong-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffdddd;
  border: 3px solid #ff3c3c;
  border-radius: 12px;
  padding: 10px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
  min-width: 110px;
}

.wrong-mini img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 6px;
}

.wrong-mini p {
  font-size: 14px;
  font-weight: bold;
  color: #a10000;
  margin: 0;
  text-align: center;
}

/* Animation shake */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}
.shake {
  animation: shake 0.5s;
}


/* Compteur stylisé pour Give Up et Hint */
.counter {
  display: inline-block;
  background-color: #2e2e2e;
  color: #fdd835;
  border: 2px solid #fdd835;
  border-radius: 10px;
  padding: 4px 10px;
  margin-left: 8px;
  font-size: 15px;
  font-weight: bold;
  font-family: "Segoe UI", sans-serif;
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.counter.activated {
  background-color: #fdd835;
  color: black;
  transform: scale(1.05);
}


/* ===== MODALE - Comment jouer ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  position: relative;
  font-family: Arial, sans-serif;
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.modal .close:hover {
  color: #000;
}


.rules-button-wrapper {
  text-align: center;
  margin: 40px auto;
}

.persona-btn {
  background: linear-gradient(135deg, #ff003c, #c60000);
  border: none;
  color: white;
  font-size: 1.2rem;
  padding: 12px 28px;
  border-radius: 12px;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #000;
  font-family: 'Arial Black', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease-in-out;
}

.persona-btn:hover {
  transform: scale(1.05) rotate(-1deg);
  background: linear-gradient(135deg, #ff0055, #d00000);
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #000, 0 0 10px #ff0000;
}

.persona-btn:active {
  transform: scale(0.98) rotate(0deg);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000;
}


/* ========== Filtres Opus ========== */
.filter-buttons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  z-index: 999;
}

.filter-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  font-family: 'Arial Black', sans-serif;
  text-shadow: 1px 1px 2px black;
  transition: 0.2s;
  opacity: 0.8;
}

.filter-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.filter-btn.active {
  box-shadow: 0 0 0 3px white, 0 0 0 5px black;
  opacity: 1;
}

.filter-p1 {
  background-color: purple;
}

.filter-p2 {
  background-color: rgb(223, 155, 30);
}

.filter-p3 {
  background-color: #0074D9; /* Bleu */
}

.filter-p4 {
  background-color: #FFDC00; /* Jaune */
  color: #ffffff;
}

.filter-p5 {
  background-color: #FF4136; /* Rouge Persona 5 */
}

.filter-p5x {
  background: linear-gradient(145deg, #1a1a1a, #8b0000); /* Dégradé noir vers rouge foncé */
  color: #ffffff;
  border: 1px solid #ff003c; /* Rouge vif pour accent */
  box-shadow: 0 0 6px #ff003c80; /* Glow léger rouge néon */
}


/* Modale - verrouille le scroll en arrière-plan */
body.modal-open {
  overflow: hidden;
}

/* Conteneur principal de la modale */
.modal {
  display: none; /* Affichée dynamiquement */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

/* Contenu interne avec scroll vertical */
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 10px;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  font-family: 'Arial', sans-serif;
  box-shadow: 0 0 15px #000;
}

/* Fermer */
.modal .close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
}

.modal .close:hover {
  color: red;
}

/* Texte des règles + mise en page */
#rulesText {
  line-height: 1.7;
}

#rulesText ul {
  margin-top: 10px;
  margin-bottom: 25px;
  padding-left: 20px;
}

#rulesText ul ul {
  margin-top: 5px;
  margin-bottom: 10px;
}

#rulesText strong {
  display: block;
  margin-top: 20px;
  font-size: 1.1em;
}


.separator {
  border: none;
  border-top: 2px dashed #ccc;
  margin: 30px 0;
  opacity: 0.6;
}


.filter-switches {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 15px;
  z-index: 1000;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.switch input {
  display: none;
}

.slider {
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  position: relative;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background-color: white;
  transition: 0.2s;
}

input:checked + .slider::before {
  transform: translateX(20px);
}

input:checked + .slider.blue { background-color: #0074D9; }
input:checked + .slider.yellow { background-color: #FFDC00; }
input:checked + .slider.red { background-color: #FF4136; }

.label-text {
  font-family: 'Arial Black', sans-serif;
  color: white;
  text-shadow: 1px 1px 2px black;
  font-size: 0.9em;
}

.input-row {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  gap: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.textbar-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

#textbar {
  width: 280px;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #444;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.button-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}
/* Ajout protection contre l'écrasement des boutons */
.link-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  min-width: 100px;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.link-wrapper:hover {
  transform: scale(1.05);
}

.hint-giveup-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hint-block,
.giveup-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}


/* ========== Alignement Textbar avec Replay à gauche et Submit à droite ========== */
.input-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.input-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px;
  margin-top: 25px;
  width: fit-content;
}

.button-left,
.button-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.textbar-container {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#textbar {
  width: 280px;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #444;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Empêche les boutons d’être écrasés */
.link-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  min-width: 100px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.link-wrapper:hover {
  transform: scale(1.05);
}
.rules-icon-wrapper {
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: 10;
}
.personadle-box {
  position: relative;
}

/* Retirer le cadre et les effets de hover spécifiques pour le bouton Rules */
.rules-link-wrapper {
  border: none;
  box-shadow: none;
  transition: none;
}

/* Bouton switch mode sombre */
.darkmode-toggle {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: 0 0 6px black;
}

.switch input {
  display: none;
}

.switch .slider {
  width: 40px;
  height: 22px;
  background-color: #ccc;
  border-radius: 30px;
  position: relative;
  transition: 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background-color: white;
  transition: 0.2s;
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch input:checked + .slider {
  background-color: #4caf50;
}

.slider.round {
  border-radius: 30px;
}

.label-text {
  font-family: 'Arial Black', sans-serif;
  color: white;
  font-size: 0.9rem;
}

/* Fond d’écran avec transition */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-image: url('../img/personadle_wallpaper.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -1;
  opacity: 1;
  transition: background-image 0.5s ease-in-out;
  pointer-events: none;
}

body.darkmode::before {
  background-image: url('../img/personadle_wallpaper_dark.jpg');
}

/* Toggle bouton */
.darkmode-toggle {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: 0 0 6px black;
}

.switch input {
  display: none;
}

.switch .slider {
  width: 40px;
  height: 22px;
  background-color: #ccc;
  border-radius: 30px;
  position: relative;
  transition: 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background-color: white;
  transition: 0.2s;
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch input:checked + .slider {
  background-color: #4caf50;
}

.slider.round {
  border-radius: 30px;
}

.label-text {
  font-family: 'Arial Black', sans-serif;
  color: white;
  font-size: 0.9rem;
}

/* ========== Dark Mode Polishing ========== */
body.darkmode input[type="text"],
body.darkmode #textbar {
  background-color: #111;
  color: #fff !important;
  border: 2px solid #666;
}

body.darkmode .autocomplete-items,
body.darkmode #autocompleteList {
  background-color: #222;
  color: #fff !important;
  border: 2px solid #666;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

body.darkmode .list-options:hover {
  background-color: #333 !important;
}

body.darkmode .list-options {
  border-bottom: 1px solid #555;
  color: #fff;
}

body.darkmode .list-options span {
  color: #ffffff !important;
}

body.darkmode .list-options img {
  background-color: #000;
  border: 1px solid #555;
}

body.darkmode .counter {
  background-color: #444;
  color: #fdd835;
  border-color: #888;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

body.darkmode .aoa-gif-zone {
  background: rgba(40, 40, 40, 0.85);
  border-color: #ff6a6a;
}
/* ===== Dark Mode pour la modale des règles ===== */
body.darkmode .modal-content {
  background-color: #1c1c1c;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  border: 1px solid #444;
}

body.darkmode .modal-content h2,
body.darkmode .modal-content strong {
  color: #c1c1c1;
}

body.darkmode .modal-content ul {
  color: #dddddd;
}

body.darkmode .modal-content p {
  color: #cccccc;
}

body.darkmode .modal .close {
  color: #aaa;
}

body.darkmode .modal .close:hover {
  color: #fff;
} 

/* Fix du texte noir dans .modal-content en dark mode */
body.darkmode #rulesText strong {
  color: #ffffff !important;
}

/* ===== Dark Mode - Résultats du Classique Mode ===== */
body.darkmode .guess-row {
  background-color: rgba(30, 30, 30, 0.9);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.15);
}

body.darkmode .guess-cell {
  background-color: #1e1e1e;
  color: #ffffff;
  border: 1px solid #555;
}

body.darkmode .guess-image {
  background-color: #000;
  border: 2px solid #666;
}

body.darkmode .category-row {
  background-color: rgba(60, 60, 60, 0.7);
  color: #fff;
  border: 1px solid #444;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Couleurs spécifiques des feedbacks restent identiques */
body.darkmode .correct {
  background-color: #2ecc71; /* vert */
}
body.darkmode .misplaced {
  background-color: #f1c40f; /* jaune */
  color: black;
}
body.darkmode .wrong {
  background-color: #e74c3c; /* rouge */
  color: white;
}

/* ===== Dark Mode - Compteur max atteint ===== */
body.darkmode .counter.activated {
  background-color: #fdd835;
  color: #000;
  border-color: #888;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}


/* Footer */
footer {
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    position: relative;
    bottom: 0;
    width: 100%;
    font-family: Arial, sans-serif;
}

footer p {
    margin: 5px 0;
}


/* ===== Silhouette Mode Zone ===== */
/* ===== Silhouette Mode Zone ===== */
.silhouette-box {
  width: 100%;
  max-width: 600px;
  height: 600px;
  margin: 40px auto 20px auto;
  background: #f0f0f0; /* couleur claire pour bien voir la silhouette noire */
  display: flex;
  justify-content: center;
  align-items: center;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease-in-out;
}

.darkmode .silhouette-box {
  background: #1f1f2f; /* gris-bleu foncé, visible sur silhouette noire */
  border-color: #ccc;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.1);
}

/* ✅ Nouveau wrapper pour gérer le zoom sans effet de flash */
.zoom-wrapper {
  transform: scale(1.8); /* zoom par défaut */
  transition: transform 0.4s ease;
  display: inline-block;
}

/* ✅ On retire le transform de l’image */
#silhouetteImage {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0); /* silhouette noire */
  margin-bottom: 20px;
  visibility: hidden; /* cachée tant qu’elle n’est pas chargée */
  transition: filter 0.3s ease, visibility 0s;
}



/* Liste des mauvaises réponses */
.wrong-guess {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px auto;
  padding: 6px 12px;
  border-radius: 12px;
  background-color: #330000;
  color: white;
  font-weight: bold;
  max-width: 300px;
  animation: shake 0.4s ease-in-out;
}

.wrong-guess img {
  height: 48px;
  border-radius: 8px;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.victory-message {
  margin-top: 12px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #66ff66;
  text-align: center;
}

/* Pour le mode Silhouette uniquement : cacher l’image dans .victory-box */
.silhouette-box .victory-box img {
  display: none;
}

/* Centrer la boîte de victoire dans la silhouette */
.silhouette-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}


/* Centrer le texte dans la victory-box */
.silhouette-box .victory-box {
  margin-top: 20px;
  background-color: #e6fbe6;
  border: 3px solid #4caf50;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
  animation: fadeInVictory 0.3s ease-in-out;
}

.silhouette-box .victory-message {
  font-size: 1.4rem;
  font-weight: bold;
  color: #2e7d32;
}

#silhouetteImage {
  animation: popInSilhouette 0.4s ease;
}

@keyframes popInSilhouette {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
#daltonianToggle {
  position: fixed; /* <-- C'est ça le plus important */
  top: 60px;
  right: 12px;

  background-color: #1f1f1f;
  color: #f0f0f0;
  border: 2px solid #4caf50;
  padding: 6px 20px;
  font-weight: bold;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;

  z-index: 10;
}



#daltonianToggle:hover {
  background-color: #2e2e2e;
  border-color: #81c784;
}

#daltonianToggle:active {
  transform: scale(0.98);
  background-color: #3d3d3d;
}


/* Mode daltonien : les cellules n'ont pas de couleur de fond */
body.daltonian-mode .guess-cell.correct,
body.daltonian-mode .guess-cell.misplaced,
body.daltonian-mode .guess-cell.wrong {
  background-color: transparent !important;
  color: rgb(76, 67, 67) !important;
  border: 2px solid gray;
} 

#silhouetteImage {
  visibility: hidden;
}


.persona-box {
  width: 500px;
  height: 500px;
  border: 4px solid #ff4757;
  background-color: #1e1e2f;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
  transition: transform 0.3s ease-in-out;
}

#personaImage {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

/* === Victory Box - Style clair par défaut === */
.victory-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 25px auto;
  padding: 20px 25px;
  max-width: 600px;
  border-radius: 16px;
  background-color: #e7e7e7;
  border: 3px solid #000000;
  box-shadow: 0 0 18px #147501bb;
  font-family: 'Arial Black', Impact, sans-serif;
  text-align: center;
  animation: pulseWin 0.5s ease-in-out;
}

body.darkmode .victory-box {
  background-color: #2f2f45;
  color: #f0f0f0;
  border: 3px solid #45bd00;
  box-shadow: 0 0 22px rgba(69, 189, 0, 0.6);
}

.victory-box img {
  width: 305px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.victory-message {
  color: rgb(255, 255, 255);
  font-size: 1.1rem;
  line-height: 1.4;
  text-shadow: 1px 1px 0 #000, 2px 2px 0 #857679;
}

body.darkmode .victory-message {
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, 2px 2px 3px #888;
}

/* === Nom du Persona === */
.persona-name {
  color: #e53935; /* rouge profond */
  letter-spacing: 1.2px;
  font-weight: bold;
  text-shadow: 0 0 4px #fcfcfc, 0 0 8px #b71c1c;
  animation: appear-glow 0.8s ease forwards;
  opacity: 0;
}

body.darkmode .persona-name {
  text-shadow: 0 0 4px #ffffff00, 0 0 8px #630000;
}

/* === Apparition et effet lueur (optionnel) === */
@keyframes appear-glow {
  to {
    opacity: 1;
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 4px #8e44ad, 0 0 10px #8e44ad;
  }
  to {
    text-shadow: 0 0 6px #9b59b6, 0 0 14px #9b59b6;
  }
}

/* === Animation victoire === */
@keyframes pulseWin {
  0% {
    transform: scale(0.95);
    opacity: 0.2;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}


.user-name {
  color: #3498db; /* bleu Persona */
  letter-spacing: 1px;
  font-weight: bold;
  text-shadow: 0 0 4px #ffffff, 0 0 6px #2c3e50;
}

body.darkmode .user-name {
  text-shadow: 0 0 4px #d0d0d000, 0 0 8px #001727;
}


.persona-name,
.user-name {
  margin: 0 6px;
}

.connector {
  margin: 0 4px;
}


audio {
  width: 300px;
  height: 40px;
  outline: none;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.6), 0 0 6px rgba(0, 255, 255, 0.4);
  transition: box-shadow 0.3s ease;
  margin: 20px auto;
  display: block;
}

/* Personnalisation quand le dark mode est actif */
body.darkmode audio {
  background-color: #111;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.5), 0 0 6px rgba(255, 0, 0, 0.3);
}

/* Optionnel : Hover */
audio:hover {
  box-shadow: 0 0 16px rgba(255, 0, 0, 0.8), 0 0 8px rgba(0, 255, 255, 0.5);
}


.audio-wrapper {
  background-color: #f4f4f4;
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  width: fit-content;
  margin: 30px auto;
  border: 2px solid #d62828;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.audio-wrapper:hover {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

body.darkmode .audio-wrapper {
  background-color: #1b1b1b;
  border-color: #00ffff;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}

.victory-link {
  color: #ffa500;
  text-decoration: underline;
  font-weight: bold;
}
.victory-link:hover {
  color: #ffd700;
}
/* === Personadle Music Mode - Victory Box Plus Grande === */
body.music-mode .victory-box {
  max-width: 750px;
  padding: 30px 35px;
  border: 4px solid #f5067d;
  box-shadow: 0 0 28px #f73093b9;
}

body.music-mode .victory-box img {
  width: 300px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Mode sombre amélioré */
body.music-mode.darkmode .victory-box {
  background-color: #2c1f2f;
  border-color: #ff66cc;
  box-shadow: 0 0 30px rgba(255, 102, 204, 0.6);
}

.legal-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  padding-top: 60px;
}

.legal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  border-radius: 10px;
  color: #000;
}

.legal-content h2, .legal-content h3 {
  margin-top: 20px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}


.nav-button {
  background: linear-gradient(135deg, #f7f7f7, #e5e5e5);
  color: #222;
  padding: 18px 28px;
  font-size: 1.4em;
  font-weight: bold;
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  text-align: center;
  width: 220px;
}

.nav-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px #000000;
}

.prev-mode {
  margin-left: 5%;
  color: #c62828;
  box-shadow: 0 0 12px rgba(198, 40, 40, 0.5);
}

.prev-mode:hover {
  box-shadow: 0 0 18px #ff5252;
}

.next-mode {
  margin-right: 5%;
  color: #b8860b;
  box-shadow: 0 0 12px rgba(184, 134, 11, 0.5);
}

.next-mode:hover {
  box-shadow: 0 0 18px #f0c60c;
}

body.darkmode .nav-button {
  background: linear-gradient(135deg, #222, #333);
  color: #f0c60c;
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
}

body.darkmode .nav-button:hover {
  background: linear-gradient(135deg, #333, #444);
  box-shadow: 0 0 18px #f0c60c;
}

body.darkmode .prev-mode {
  color: #ff5050;
  box-shadow: 0 0 12px rgba(255, 80, 80, 0.7);
}

body.darkmode .prev-mode:hover {
  box-shadow: 0 0 18px #ff5050;
}

body.darkmode .next-mode {
  color: #f0c60c;
  box-shadow: 0 0 12px rgba(240, 198, 12, 0.7);
}

body.darkmode .next-mode:hover {
  box-shadow: 0 0 18px #f0c60c;
}

#socialLinks {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

#socialLinks a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: #f0f0f0;
  border-radius: 12px;
  border: 2px solid #ccc;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#socialLinks a img {
  width: 24px;
  height: 24px;
  filter: invert(0%) sepia(100%) saturate(0%) hue-rotate(0deg);
  transition: transform 0.2s ease, filter 0.2s ease;
}

#socialLinks a:hover {
  background-color: #e0e0e0;
  border-color: #999;
  transform: translateY(-2px);
}

#socialLinks a:hover img {
  transform: scale(1.2);
  filter: hue-rotate(180deg);
}

/* 🌙 Dark mode adaptation */
body.darkmode #socialLinks a {
  background-color: #222;
  border-color: #555;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

body.darkmode #socialLinks a img {
  filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg);
}

body.darkmode #socialLinks a:hover {
  background-color: #333;
  border-color: #888;
}
.daily-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #111;
  color: white;
  padding: 10px 20px;
  border: 2px solid #ff0040;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s, color 0.3s;
}

body:not(.darkmode) .daily-btn {
  background-color: #f0f0f0;
  color: #111;
  border: 2px solid #cc0033;
}

.daily-modal {
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.daily-modal-content {
  margin: 10% auto;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  border-radius: 12px;
  text-align: center;
  border: 3px solid;
  transition: all 0.3s;
}

/* 🌑 Mode sombre */
body.darkmode .daily-modal-content {
  background-color: #1c1c1c;
  color: white;
  border-color: #ff0040;
}

/* ☀️ Mode clair */
body:not(.darkmode) .daily-modal-content {
  background-color: #ffffff;
  color: #111;
  border-color: #cc0033;
}

.daily-modal .close {
  float: right;
  font-size: 28px;
  cursor: pointer;
  color: inherit;
}

#dailyCountdown {
  font-family: monospace;
  font-size: 1.5em;
  font-weight: bold;
  color: #00cc66;
}

/* === RESPONSIVE FIX MOBILE & TABLETTE - VERSION CLASSIQUE AMÉLIORÉE === */

body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Tap targets */
button, .link-wrapper, .persona-btn {
  min-height: 48px;
  padding: 12px 20px;
}

#textbar {
  font-size: 17px;
}

/* Écrans ≤ 768px */
@media (max-width: 768px) {
  body {
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center top !important;
    padding: 10px;
  }

  body::before {
    background-attachment: scroll !important;
    background-size: cover;
    background-position: center top;
  }

  #imgHomePage {
    width: 90%;
    max-width: 400px;
    margin: 10px auto;
    display: block;
  }

  .gamemode-title {
    font-size: 24px;
    padding: 10px 20px;
    margin: 20px auto;
    max-width: 95%;
  }

  .input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
  }

  #textbar {
    width: 80%;
    max-width: 300px;
    margin-right: 0;
  }

  #guessButton, #resetButton, #hintButton, #giveUpButton {
    width: 80%;
    max-width: 250px;
    padding: 12px 20px;
    font-size: 16px;
  }

  #resetButton {
    margin-left: 0;
    margin-top: 10px;
  }

  .guess-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 10px;
    width: 95%;
    max-width: 350px;
    margin: auto;
  }

  .category-row {
    display: none;
  }

  .guess-image {
    width: 120px;
    height: 120px;
    align-self: center;
    margin-bottom: 10px;
  }

  .guess-cell {
    width: 100%;
    height: 70px;
    font-size: 12px;
    padding: 5px;
    position: relative;
  }

  .guess-cell::before {
    content: attr(data-label);
    position: absolute;
    top: 2px;
    left: 5px;
    font-size: 10px;
    opacity: 0.8;
  }

  .autocomplete-items {
    width: 90%;
    max-width: 320px;
    max-height: 250px;
    left: 50%;
    transform: translateX(-50%);
  }

  .list-options {
    padding: 10px 12px;
    font-size: 15px;
    min-height: 60px;
  }

  .list-options img {
    width: 60px;
    height: 60px;
    margin-right: 10px;
  }

  .list-options span {
    max-width: 200px;
    font-size: 14px;
  }

  .emoji-hint-zone {
    padding: 20px 15px;
    margin: 20px auto;
    max-width: 95%;
  }

  .emoji-unit {
    font-size: 2.5rem;
    margin: 0 6px;
  }

  .emoji-unit:hover {
    transform: scale(1.15);
  }

  #quoteHint {
    max-width: 95%;
    margin: 15px auto;
    padding: 10px 15px;
    font-size: 15px;
  }

  .victory-box {
    max-width: 95%;
    margin: 20px auto;
    padding: 15px;
  }

  .victory-box img {
    width: 120px;
  }

  .win-message {
    font-size: 1.2rem;
  }

  .confetti-emoji {
    font-size: 1.8rem;
  }

  .gamemode-button:hover img {
    transform: scale(1.01);
  }

  /* Chevauchement fixe : boutons flottants */
  .darkmode-toggle {
    top: 10px;
    right: 10px;
    z-index: 1000;
  }

  #daltonianToggle {
    top: 60px;
    right: 10px;
    z-index: 1000;
  }

  .filter-buttons, .filter-switches {
    top: 110px;
    left: 10px;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
  }

  .daily-btn {
    bottom: 20px;
    right: 12px;
    font-size: 14px;
    padding: 8px 14px;
    z-index: 1000;
  }
}

/* Écrans < 480px */
@media (max-width: 480px) {
  body { padding: 5px; }

  #title { font-size: 20px; }

  .gamemode-title { font-size: 20px; padding: 8px 15px; }

  .guess-cell {
    height: 60px;
    font-size: 11px;
  }

  .guess-cell::before {
    font-size: 9px;
  }

  .guess-image {
    width: 100px;
    height: 100px;
  }

  .emoji-unit {
    font-size: 2rem;
    margin: 0 4px;
  }

  .victory-box img {
    width: 100px;
  }

  .win-message {
    font-size: 1.1rem;
  }
}

/* Accessibilité */
@media (hover: none) and (pointer: coarse) {
  .gamemode-button,
  #guessButton,
  #hintButton,
  #resetButton,
  #giveUpButton {
    touch-action: manipulation;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #imgHomePage:hover,
  .gamemode-button:hover img,
  .emoji-unit:hover {
    transform: none;
  }
}

/* === Modale commune === */
.modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #ffffff;
  color: #000;
  padding: 30px;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* === Dark mode override === */
body.darkmode .modal-content {
  background-color: #1f1f1f;
  color: white;
  box-shadow: 0 0 20px #000;
}

/* === Fermeture modale === */
.modal-content .close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

/* === Input Pseudo === */
#pseudoInput {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  background: #f0f0f0;
  color: #000;
}

body.darkmode #pseudoInput {
  background: #333;
  color: white;
}

/* === Avatar Preview === */
.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #51ff00;
  margin-bottom: 10px;
}

/* === Avatar Grid === */
#avatarGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
}

#avatarGrid img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

#avatarGrid img:hover {
  transform: scale(1.1);
  border: 2px solid #ff3366;
}

#avatarGrid img.selected {
  border: 3px solid #51ff00;
}

/* === Canvas === */
#avatarCanvas {
  background-color: #eee;
  border: 2px solid #51ff00;
  display: block;
  margin: 10px auto;
  max-width: 100%;
}

body.darkmode #avatarCanvas {
  background-color: #222;
}

/* === Zoom / Valider boutons === */
.crop-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.crop-controls button {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #ddd;
  color: black;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.crop-controls button:hover {
  background-color: #bbb;
}

body.darkmode .crop-controls button {
  background-color: #444;
  color: white;
}

body.darkmode .crop-controls button:hover {
  background-color: #666;
}

/* === Bouton “Mon Profil” === */
.profile-btn {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 12px;
  background-color: #f7322b;
  color: black;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-btn:hover {
  background-color: #e46262;
}

#profileDisplay {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

/* === Avatar “aucun” === */
.avatar-none {
  width: 80px;
  text-align: center;
  background: #eee;
  border: 2px solid #aaa;
  border-radius: 8px;
  font-size: 14px;
  line-height: 80px;
  cursor: pointer;
  transition: background 0.2s;
  color: #000;
}

.avatar-none:hover {
  background: #ccc;
}

body.darkmode .avatar-none {
  background: #444;
  border: 2px solid #888;
  color: white;
}

body.darkmode .avatar-none:hover {
  background: #666;
}

/* === Avatar dans l'en-tête === */
.profile-avatar {
  width: 172px;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid black;
}

body.darkmode .profile-avatar {
  border-color: white;
}

/* === Couleur adaptative du label Border Color === */
.border-color-label {
  font-weight: bold;
  color: black;
}

body.darkmode .border-color-label {
  color: white;
}


