    body { 
      margin: 0; 
      overflow: hidden; 
      background: url("textures/james_webb.png") no-repeat center center;
      background-size: cover;
      
    }
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.9) 100%);
      z-index: -1;
    }
    canvas { display: block; }
    #startButton {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 40px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(200,180,255,0.9), rgba(80,40,150,0.3));
  border: 2px solid rgba(255,255,255,0.6);
  color: white;
  font-family: "Cinzel", serif;
  font-size: 1.2em;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(200,180,255,0.8), 0 0 40px rgba(100,80,200,0.6);
  animation: pulse 3s infinite ease-in-out;
}

/* --- MODALE D'ACCUEIL --- */
#welcomeModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  text-align: center;
  color: white;
  font-family: "Cinzel", serif;
  padding: 40px;
  border-radius: 12px;
  background: rgba(20,20,40,0.6);
  box-shadow: 0 0 40px rgba(200,180,255,0.5);
  animation: fadeIn 1.5s ease;
}

.modal-content h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  letter-spacing: 3px;
}

.modal-content p {
  font-size: 1.2em;
  margin-bottom: 30px;
  opacity: 0.9;
}

#enterButton {
  padding: 15px 30px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(180,120,255,0.9), rgba(80,40,150,0.9));
  color: white;
  font-family: "Quicksand", sans-serif;
  font-size: 1.1em;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(180,120,255,0.8);
  transition: transform 0.2s, box-shadow 0.2s;
}

#enterButton:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(220,180,255,1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}




#startButton:hover {
  box-shadow: 0 0 30px rgba(255,220,255,1), 0 0 60px rgba(180,120,255,0.9);
  transform: translateX(-50%) scale(1.05);
  
}

#btn_start {
  transition: opacity 0.5s ease;
  opacity: 1;
}

#btn_start.fade-out {
  opacity: 0;
  visibility: hidden; /* évite le clic mais garde la place */
}

@keyframes pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.08); }
}

/* Animation de fermeture */
@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.1); }
}

#welcomeModal.closing {
  animation: fadeOut 1.2s ease forwards;
}

#overlayModal {
    display: flex;
    position: fixed;
    z-index: 900;
    background: rgba(0,0,0,0.7);
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    align-items: center; justify-content: center;
  }

  #paintingModal {
    position: relative;
    width: 80vw; height: 80vh;
    border-radius: 20px;
    overflow: hidden;
    background:rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }

  #paintingCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
  }


#artInfo {
  position: absolute;
  bottom: 2vh;
  left: 2vw;
  background: rgba(255,255,255,0.75);
  color: #111;
  padding: 0.8em 1.2em;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
  opacity: 0;
  animation: fadeIn 3.5s ease-in 6s forwards;
  }

#closeButton {
    position: absolute;
    top: 1em; right: 1em;
    z-index: 2;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 6px;
    padding: 0.5em 1em;
    cursor: pointer;
  }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cartelG .phrase1,
.cartelD .phrase2 {
  opacity: 0;
  animation: fadeInUp 2.5s ease forwards;
  animation-delay: 1s; /* le texte démarre après le fond */
}

.cartelG {
  position: absolute;
  left: 15%;
  top: 5%;
  transform: translateX(-50%);
  width: 15%;
  padding: 0.1em 0.05em;
  background: rgba(255, 255, 255, 0.20); /* blanc translucide */
  backdrop-filter: blur(6px); /* effet verre dépoli */
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  color: rgba(255,255,255,1);
  font-family: 'Georgia', serif;
  font-size: 1.3em;
  line-height: 1.2em;
  text-align: center;
  opacity: 0;
  transition: opacity 4s ease-in-out;
}

.cartelD {
  position: absolute;
  right: -2%;
  top: 5%;
  transform: translateX(-50%);
  width: 15%;
  padding: 0.1em 0.05em;
  background: rgba(255, 255, 255, 0.20); /* blanc translucide */
  backdrop-filter: blur(6px); /* effet verre dépoli */
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  color: rgba(255,255,255,1);
  font-family: 'Georgia', serif;
  font-size: 1.3em;
  line-height: 1.2em;
  text-align: center;
  opacity: 0;
  transition: opacity 4s ease-in-out;
}

.fumeOut {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(-40px) scale(1.05) rotate(-2deg);
  transition: opacity 2.5s, filter 2.1s, transform 2.2s cubic-bezier(.51,0,.54,1);
}

#socrate_container {
    position: absolute;
    top : 0;
    left : 31%;
    width : 39%;
    z-index : 1000;
    text-align: center;
    /*justify-content: center;*/
    font-family: 'Georgia', serif;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 3.5s ease-in, transform 3.5s ease-in;
}

#dialog {
    background: rgba(255, 255, 255, 0.20); /* blanc translucide */
    backdrop-filter: blur(6px); /* effet verre dépoli */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    color: rgba(255,255,255,1);
    font-size: 1.2em;
    font-family: 'Georgia', serif;
    text-align: left;
    width : 99%;
    height : 30%;
    min-height: 280px;
}

#chat-form {
    background: rgba(255,255,255,0.20);
    backdrop-filter: blur(6px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    font-family: 'Georgia', serif;
    font-size: 1.2em;
    text-align: center;
    width : 100%;
}

#submit {
    color: #111;
    padding: 0.8em 1.2em;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    background: rgba(255,255,255,0.75);
    text-align: center;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    width : 50%;
    /*opacity: 0;*/
}

#mytext {
    color: #333333;
    padding: 0.8em 1.2em;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    background: rgba(255,255,255,0.75);
    text-align: center;
    justify-content : center;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    width : 80%;
    min-height: 70px;
    /*opacity: 0;*/
}


@keyframes spin {
  0%   { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

#spinner {
  position : absolute;
  left : 46%;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-left-color: #3498db;
  margin-bottom : 20px;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index : 1100;
  
}


.textarea-wrapper {
  position: relative;
  display: inline-block;
}

#counter-overlay {
  position: absolute;
  /*left: 85%;*/
  right : 0;
  bottom: 6px;
  font-size: 0.95em;
  color: #aaa;
  pointer-events: none; /* Cliquer passe à travers */
  background: rgba(255,255,255,0.7); /* Optionnel pour la lisibilité */
  padding: 2px 2px;
  border-radius: 10px;
}

#echange-overlay {
  position: absolute;
  left: 0;
  bottom: 6px;
  font-size: 0.95em;
  color: #aaa;
  pointer-events: none; /* Cliquer passe à travers */
  background: rgba(255,255,255,0.7); /* Optionnel pour la lisibilité */
  padding: 2px 2px;
  border-radius: 10px;
}

#sortieModaleButton {
  display: none;
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 40px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(200,180,255,0.9), rgba(80,40,150,0.3));
  border: 2px solid rgba(255,255,255,0.6);
  color: white;
  font-family: "Cinzel", serif;
  font-size: 1.2em;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(200,180,255,0.8), 0 0 40px rgba(100,80,200,0.6);
  animation: pulse 3s infinite ease-in-out;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s, transform 0.3s;
  z-index : 2000;
}

#sortieModaleButton:hover {
  box-shadow: 0 0 30px rgba(255,220,255,1), 0 0 60px rgba(180,120,255,0.9);
  transform: translateX(-50%) scale(1.05);
  
}