body {
  margin: 0;
  overflow: hidden;
  background-color: #4C3390;
  font-family: sans-serif;
}

canvas {
  display: block;
}
#mobile-fov-toggle {
  position: absolute;
  top: 60px; /* même hauteur que #toggle-panel */
  left: calc(30px + 250px); /* 30px = left de #fov-control + sa largeur */
  padding: 10px 14px;
  font-size: 20px;
  z-index: 21;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: left 0.3s ease;
}

#fov-control.hidden + #mobile-fov-toggle {
  left: 0; /* revient sur le bord gauche */
}


#toggle-panel {
  position: fixed;
  top: 60px;
  right: 0;
  z-index: 30;
  background-color: rgba(0, 0, 0, 0.85); /* 👈 identique à side-panel */
  border: none;
  color: #fff;
  padding: 10px 14px;
  font-size: 20px;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  transition: right 0.3s ease;
}

#side-panel.open + #toggle-panel {
  right: 250px; /* même largeur que le panneau */
}


#toggle-fov {
  position: absolute;
  top: 20px;
  left: 0;
  transform: translateX(-100%);
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  padding: 10px;
  font-size: 18px;
  cursor: pointer;
  z-index: 21;
  transition: background-color 0.3s;
}

#toggle-fov:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#fov-control.hidden {
  display: none;
}

#side-panel {
  position: fixed;
  top: 0;
  right: -260px; /* caché à droite */
  width: 250px;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  padding: 20px;
  box-sizing: border-box;
  transition: right 0.3s ease;
  z-index: 25;
  overflow-y: auto;
}

#side-panel.open {
  right: 0;
}

#side-panel h3 {
  color: white;
  margin-top: 0;
}

#side-panel .case-button {
  width: 100%;
  margin-top: 10px;
  background-color: #ef895f;
  border: none;
  color: #000;
  padding: 8px 12px;
  font-weight: bold;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}


.case-button {
  background-color: #ef895f;
  border: none;
  color: #000;
  padding: 8px 12px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.case-button:hover {
  background-color: #ffae84;
}

#bottom-panel {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 10%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#toggle-button,
#grid-button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #000;
}

#toggle-button {
  background-color: #00ffcc;
}

#grid-button {
  background-color: #ffcc00;
  margin-left: 10px;
}

#fov-control {
  position: absolute;
  top: 20px;
  left: 30px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 5px 5px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  user-select: none;
  z-index: 20;
  width: 250px;
  box-sizing: border-box;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#fov-control label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #ffffff;
}

#fov-slider,
.opacity-slider {
  width: 100%;
  height: 13px;
  background: linear-gradient(to right, #ef895f 0%, #000 0%);
  border-radius: 4px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-bottom: 10px;
}

#fov-slider::-webkit-slider-runnable-track,
.opacity-slider::-webkit-slider-runnable-track {
  height: 13px;
  background: transparent;
  border-radius: 4px;
}

#fov-slider::-webkit-slider-thumb,
.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 24px;
  background: #fff;
  border-radius: 3px;
  margin-top: -5px;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

#fov-slider::-moz-range-track,
.opacity-slider::-moz-range-track {
  height: 13px;
  background: transparent;
  border-radius: 4px;
}

#fov-slider::-moz-range-thumb,
.opacity-slider::-moz-range-thumb {
  width: 12px;
  height: 24px;
  background: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#fov-value {
  text-align: right;
  font-weight: bold;
  margin-bottom: 10px;
  color: #ffffff;
}

.opacity-control {
  margin-bottom: 10px;
}

.opacity-control label {
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #4C3390;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

#loading-bar-container {
  width: 300px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

#loading-bar {
  height: 100%;
  width: 0%;
  background-color: #ef895f;
  transition: width 0.2s;
}

#loading-text {
  color: white;
  font-weight: bold;
}

#logo {
  position: absolute;
  bottom: 60px;
  right: 10px;
  height: 200px;
  z-index: 20;
  opacity: 0.9;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#logo:hover {
  transform: scale(1.2);
}

input[type="range"] {
  border: 1px solid black;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  #fov-control {
    position: absolute;
    top: 10px;
    left: 5vw;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 12px;
    user-select: none;
    z-index: 20;
    width: 60vw;
    box-sizing: border-box;
    max-height: 30vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

#mobile-fov-toggle {
  position: absolute;
  top: 60px;
  left: calc(5vw + 60vw);
  padding: 10px 14px;      /* même volume que #toggle-panel */
  font-size: 20px;         /* même taille de texte */
  z-index: 21;
  background-color: rgba(255, 255, 255, 0.1); /* conserve ton style original */
  border: none;
  color: #fff;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: left 0.3s ease;
}


#fov-control.hidden + #mobile-fov-toggle {
  left: 0; /* Langette reste collée au bord gauche */
}

.opacity-control,
#fov-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#fov-control label {
  margin-bottom: 4px;
}

  #fov-slider,
  .opacity-slider {
    height: 8px;
  }

  #fov-slider::-webkit-slider-thumb,
  .opacity-slider::-webkit-slider-thumb {
    width: 10px;
    height: 16px;
    margin-top: -4px;
  }

  #fov-slider::-moz-range-thumb,
  .opacity-slider::-moz-range-thumb {
    width: 10px;
    height: 16px;
  }

  #bottom-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    height: auto;
    padding: 10px;
  }

  #toggle-button,
  #grid-button {
    width: auto;
    margin: 0;
    flex: 1 1 auto;
    min-width: 100px;
  }

  #logo {
    height: 120px;
    bottom: 40px;
    right: 5px;
  }
}