/* ================================
   15. PANNEAU LATÉRAL & SETTINGS
   ================================ */

/* Icône engrenage pour ouvrir le menu */
#settings-gear {
  cursor: pointer;
  width: 40px;
  height: 40px;
}
#settings-gear img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 5px #0ff);
  transition: transform 0.3s ease, filter 0.3s ease;
}

#settings-gear img:hover {
  transform: rotate(90deg);
  filter: drop-shadow(0 0 10px #0ff);
}

/* Fond semi-transparent flou */
#side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#side-menu.active {
  opacity: 1;
  pointer-events: auto;
}

/* Contenu du menu latéral */
.side-menu-content {
  width: 200px;
  margin-top: 80px;
  margin-right: 0;
  padding: 1.5rem;
  background-color: rgba(17,17,17,0.9);
  border-left: 2px solid #0ff;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 12px rgba(0,255,255,0.2);
  transform: translateX(100%);
  transition: transform 0.4s ease;
}
#side-menu.active .side-menu-content {
  transform: translateX(0);
}
.side-menu-content .close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: #fff;
}
.side-menu-content ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0 0;
}
.side-menu-content li {
  margin-bottom: 1rem;
}
.side-menu-content a {
  color: #0ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.side-menu-content a:hover {
  color: #fff;
}

.rules-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.rules-overlay.active {
  display: flex;
}

.rules-content {
  background: #222;
  color: #fff;
  width: 90%;
  max-width: 600px;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,255,255,0.3);
  position: relative;
  max-height: 80vh;
  overflow: hidden;
}

.rules-content h2 {
  margin-top: 0;
  text-align: center;
}

.rules-scroll {
  overflow-y: auto;
  max-height: 60vh;
  padding-right: 0.5rem;
}

.close-rules-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* conteneur générique d’overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  padding: 1rem;
}
/* quand on l’active */
.overlay.active {
  display: flex;
}
/* contenu central */
.overlay-content {
  position: relative;
  background: #1e1e1e;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  color: #fff;
  text-align: left;
}
/* bouton fermer */
.close-privacy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
}
/* petite classe pour l’intérieur scrollable */
.privacy-scroll {
  margin-top: 1rem;
  line-height: 1.5;
}

/* conteneur de tuiles */
.settings-bubble .settings-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* style de chaque tuile */
.settings-bubble .settings-tiles .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

/* icône à l’intérieur de la tuile */
.settings-bubble .settings-tiles .tile i {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.5rem;
}

/* effet au survol */
.settings-bubble .settings-tiles .tile:hover {
  background: rgba(255,255,255,0.1);
}

.settings-bubble {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  visibility: hidden;
  opacity: 0;

  /* 1) Fond sombre semi-transparent */
  background-color: rgba(0, 0, 0, 0.6);

  /* 2) Flou derrière l’élément */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* 3) Nouveau contexte pour que le backdrop-filter fonctionne */
  isolation: isolate;

  /* 4) Empêche le bord de se brouiller avec le contenu du background */
  background-clip: padding-box;

  width: 80%;
  max-width: 360px;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border: 1px solid #333;
  z-index: 1500;
  text-align: center;

  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out,
    visibility 0s linear 0.25s;
}

.settings-bubble.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  transition-delay: 0s;
}

/* Pour les grands écrans */
@media (min-width: 1024px) {
  .settings-bubble {
    width: 50%;
    max-width: 600px;
  }
}

/* LE BACKDROP sous la bulle */
#settings-backdrop {
  position: fixed;
  inset: 0;                     /* top/right/bottom/left = 0 */
  background: rgba(0,0,0,0.6);  /* semi-transparent */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1499;                /* juste sous la bulle */
  opacity: 0;
  pointer-events: none;         /* cliquable seulement quand actif */
  transition: opacity 0.25s ease-out;
}
#settings-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* TA BULLE : on garde ton style + isolation */
.settings-bubble {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  visibility: hidden;
  opacity: 0;

  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  isolation: isolate;
  background-clip: padding-box;

  width: 80%;
  max-width: 360px;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  border: 1px solid #333;
  z-index: 1500;  /* au-dessus du backdrop */
  text-align: center;

  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out,
    visibility 0s linear 0.25s;
}
.settings-bubble.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  transition-delay: 0s;
}

@media (min-width: 1024px) {
  .settings-bubble {
    width: 50%;
    max-width: 600px;
  }
}
