body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-image: url("back.png");
  background-color: rgba(0, 0, 0, 0.75);
  background-blend-mode: darken;
  color: #eee;
}

/* Gradient derrière le joueur actif sur la moitié de l'écran */
body::before {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;         /* côté gauche par défaut */
  width: 75vw;    
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to right, rgba(255, 193, 7, 0.3), rgba(255, 193, 7, 0));
}

body.active-player-2::before {
  left: auto;
  right: 0;        /* côté droit */
  background: linear-gradient(to left, rgba(255, 193, 7, 0.3), rgba(255, 193, 7, 0));
}

/* Suivre le thème système */
@media (prefers-color-scheme: dark) {
  body {
    /*background: #121212;*/
    color: #f8f9fa;
  }
}

/* Mobile paysage : compacter un peu les paddings et boutons */
@media (orientation: landscape) and (max-height: 500px) {
  .card-body {
    padding: .75rem;
  }

  .btn {
    padding: .35rem .6rem;
    font-size: .9rem;
  }

  .display-6 {
    font-size: calc(1.6rem + 1vw);
  }
}

.container {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

.player {
  border: 2px solid #555;
  padding: 20px;
  border-radius: 12px;
  background: #222;
  box-shadow: 0 0 10px #333;
  position: relative; /* déjà présent pour les pseudo-éléments */
  overflow: hidden;
  background-color: #222; /* sombre par défaut */
}

/* Contenu au-dessus du gradient */
.player > * {
  position: relative;
  z-index: 1;
}

.active {
  border-color: #4cafef;
  box-shadow: 0 0 20px #4cafef;
}

.time {
  font-size: 2em;
  margin: 10px 0;
}

.lp {
  font-size: 1.2em;
  margin: 10px 0;
}

.invisible {
  display: none;
}

/*button {
  margin: 5px;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}*/

#log {
  border: 2px solid #555;
  background: #222;
  padding: 10px;
  margin: 10px;
  height: 200px;
  overflow-y: scroll;
  border: 1px solid #444;
  text-align: left;
  font-size: 0.9em;
}

#awaiting-indicator {
  display: none;
  background: orange;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  margin: 5px;
  font-weight: bold;
}

#reaction11,
#reaction12,
#reaction21,
#reaction22 {
  display: none;
}

.player.active {
  border: 2px solid var(--bs-warning);
  box-shadow: 0 0 24px 4px rgba(var(--bs-warning-rgb, 255, 193, 7), .75);
  border-radius: .75rem;
}

.log-entry.system {
  color: gray;
  font-style: italic;
}

.log-entry.response {
  font-weight: bold;
  color: green;
}

.log-entry.declaration {
  font-weight: bold;
  color: blue;
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #222;
  /*margin: 15% auto;*/
  padding: 10px;
  border: 1px solid #888;
  width: 100%;
  color: #eee;
  border-radius: 12px;
}

.highlight {
  font-weight: bold;
  color: #ffeb3b;
}

.log-p1 {
  color: #e74c3c;
  /* rouge vif */
  font-weight: bold;
}

.log-p2 {
  color: #3498db;
  /* bleu clair */
  font-weight: bold;
}


/* Indicateur vocal */
#voice-indicator {
  position: relative;
  /*top: 20px;*/
  margin-left: auto;
  margin-right: auto;
  /*right: 20px;*/
  width: 25px;
  height: 25px;
  background-color: #ccc;
  /* Gris par défaut (inerte) */
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Classe ajoutée quand le micro détecte du son */
#voice-indicator.listening {
  background-color: #007bff;
  /* Bleu pour "écoute" */
  animation: pulse 1.5s infinite;
}

/* Classe ajoutée quand une commande est reconnue */
#voice-indicator.recognized {
  background-color: #dc3545;
  /* Rouge pour "reconnu" */
  transform: scale(1.2);
  /* Grossit un peu pour l'impact */
  animation: none;
  /* Stoppe la pulsation pour montrer le flash */
}

/* Animation de pulsation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}