/* style.css */

/* Réinitialisation de base */
body {
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  font-family: Arial, sans-serif;
}

/* Conteneur principal */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
}

/* Bouton de connexion en pleine largeur pour faciliter le clic */
#connectBtn {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 18px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}
#connectBtn:hover {
  background-color: #0056b3;
}

/* Conteneur Flex pour les slots */
#dice-host {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px; /* réduit l’écart entre les slots */
}

/* Style de base pour chaque slot */
.dice-slot {
  flex: 1 1 calc(50% - 6px); /* tient compte du gap réduit */
  border: 1px solid #ccc;
  background-color: #fff;
  margin: 2px; /* réduit l’espacement vertical */
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;  /* ou center */
  gap: 8px;     /* espace entre les dés dans le slot */
  min-height: 44px; /* pour garder une belle taille même vide */
}

/* Responsive : chaque slot plein largeur sur mobile */
@media (max-width: 600px) {
  .dice-slot {
    flex: 1 1 100%;
    font-size: 120%;      /* un peu plus grand si besoin */
  }
}

/* Image optionnelle dans un slot */
#slot-pageimg {
  display: block;
  margin: 1em auto;
  max-width: 80%;
  height: auto;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* Statut batterie */
.battery-status {
  margin: 2px 0;
  font-size: 60%;
}

#dice-host {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;         /* réduit l’espace horizontal entre les dés */
  margin-bottom: 10px;
}

.dice-slot {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: none;        /* retire la bordure slot */
  box-shadow: none;    /* retire l’ombre slot */
  padding: 0;
  margin: 0;
  gap: 4px;
}
.dice-state {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  background: #ececec;
  font-size: 1.15em;
  font-weight: bold;
  min-width: 48px;
  text-align: center;
  border: 1px solid #ccc;
  margin: 0;
  gap: 4px;
}

#slot-result {
  background: #eee;
  white-space: pre-line;
  margin: 1em auto 0 auto;   /* centre horizontalement */
  font-weight: bold;
  font-size: 200%;
  text-align: center;        /* centre le texte à l'intérieur */
  display: flex;
  flex-direction: column;
  align-items: center;       /* centre le contenu, même sur plusieurs lignes */
  justify-content: center;
  min-width: 60vw;           /* largeur min visuelle, à ajuster si besoin */
  max-width: 98vw;
  padding: 8px 0;
  border-radius: 8px;
}



/* Optionnel : pour marquer un slot déconnecté */
.dice-slot.disconnected {
  opacity: 0.3;
  filter: grayscale(70%);
}

/* Désactivé car tu n’utilises plus .dice-block */
/* .dice-block {
  margin: 2px 0;
  font-size: 30%;
  color: #000;
} */

/* === Email box (mobile-first, iPhone X ok) === */
.email-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 14px;
  margin: 14px auto 0 auto;
  max-width: 500px;
  text-align: left;
}
.email-label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}
#emailInput {
  width: 100%;
  height: 44px;
  font-size: 16px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
#sendEmailBtn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-size: 18px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#sendEmailBtn:hover { background-color: #218838; }
#sendEmailBtn:disabled {
  background-color: #9fc8a7;
  cursor: not-allowed;
  opacity: 0.9;
}

.email-msg {
  margin-top: 8px;
  font-size: 14px;
  color: #444;
  min-height: 1.2em; /* évite le "saut" d'interface */
  word-break: break-word;
}
