/* css/style.css */

/* Importation de la police Orbitron pour un look futuriste */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* Réinitialisation générale */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Style global du body */
body {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  font-family: 'Orbitron', sans-serif;
  color: #e0f7fa;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Conteneurs principaux (dashboard, game, compte, stats) */
.lobby, .dashboard, .container, .account-container, .stats-container {
  background: rgba(0, 0, 50, 0.7);
  width: 90%;
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,150,255,0.5);
  text-align: center;
}

/* Titres et textes */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: #81d4fa;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

p, label {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #e0f7fa;
}

/* Contrôles de formulaire */
input, select, button {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  background: rgba(255,255,255,0.2);
  color: #e0f7fa;
  outline: none;
}

select {
  color: #000;
}

button {
  background-color: #0288d1;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: #0277bd;
}

/* Liens stylisés comme des boutons */
a.button, a.logout, a.back-home {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: #0288d1;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  margin-bottom: 1rem;
  
}
a.button:hover, a.logout:hover, a.back-home:hover {
  background-color: #0277bd;
}

/* Grille de jeu */
#grid {
  margin: 1.5rem 0;
}
.row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.cell {
  width: 50px;
  height: 50px;
  border: 2px solid #d3d6da;
  border-radius: 4px;
  background-color: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  text-transform: uppercase;
}
.cell.correct {
  background-color: #6aaa64;
  border-color: #6aaa64;
  color: #fff;
}
.cell.present {
  background-color: #f7a943;
  border-color: #f7a943;
  color: #fff;
}
.cell.absent {
  background-color: #787c7e;
  border-color: #787c7e;
  color: #fff;
}

/* ========================= */
/*       Clavier Virtuel     */
/* ========================= */

/* Conteneur du clavier : occupe 100% du conteneur central */
#keyboard {
  width: 100%;
  max-width: 600px; /* Pour s'assurer qu'il ne déborde pas */
  margin: 1rem auto;
  box-sizing: border-box;
}

/* Chaque ligne du clavier */
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px !important;         /* Espacement fixe entre les touches */
  margin-bottom: 10px !important;
}

/* Pour les lignes de lettres (les 3 premières lignes) */
.keyboard-row:not(:last-child) .key {
  width: 60px !important;
  height: 60px !important;
  padding: 10px !important;
  font-size: 1.4rem !important;
  border: none !important;
  border-radius: 8px !important;
  background-color: #d3d6da !important;
  color: #000 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  user-select: none !important;
  transition: background-color 0.2s !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

/* Pour la dernière ligne (touches spéciales : "Entrer" et "Effacer") */
.keyboard-row:last-child .key {
  width: 90px !important;
  height: 60px !important;
  padding: 4px !important;
  font-size: 1rem !important;
  border: none !important;
  border-radius: 8px !important;
  background-color: #d3d6da !important;
  color: #000 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  user-select: none !important;
  transition: background-color 0.2s !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}


/* Modification de l'état des touches (les mêmes classes que précédemment) */
button.key.correct {
  background-color: #6aaa64 !important; /* Vert */
  color: #fff !important;
}
button.key.present {
  background-color: orange !important;    /* Orange */
  color: #fff !important;
}


button.key.absent:disabled {
  background-color: #454545 !important; /* gris foncé */
  color: #fff !important;
  cursor: not-allowed !important;
}



/* Vous pouvez ajouter ici d'autres règles si nécessaire */

}



/* Styles fixes pour toutes les touches de lettres (lignes 1, 2, 3) */
.keyboard-row:not(:last-child) .key {
  width: 60px;
  min-width: 60px;
  padding: 10px;
  font-size: 1.4rem;
  border: none;
  border-radius: 8px;
  background-color: #d3d6da;
  color: #000;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  transition: background-color 0.2s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Pour la dernière ligne (touches spéciales : Entrer et Effacer), dimensions réduites */
.keyboard-row:last-child .key {
  width: 50px;
  min-width: 50px;
  padding: 4px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #d3d6da;
  color: #000;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  transition: background-color 0.2s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Scoreboard en mode multijoueurs */
.scoreboard {
  width: 100%;
  max-width: 600px;
  margin: 1rem auto;
  background: #eef;
  padding: 1rem;
  border-radius: 8px;
  text-align: left;
}
.scoreboard h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: #0277bd;
}
.scoreboard ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.scoreboard li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #ccc;
  font-size: 1rem;
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .lobby, .dashboard, .container, .account-container, .stats-container {
    padding: 1rem;
    margin: 1rem;
  }
  h1 {
    font-size: 2rem;
  }
  input, select, button, a.button {
    font-size: 1rem;
    padding: 0.75rem;
  }
  .cell {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .keyboard-row:not(:last-child) .key {
    width: 50px;
    min-width: 50px;
    padding: 8px;
    font-size: 1.2rem;
  }
  .keyboard-row:last-child .key {
    width: 40px;
    min-width: 40px;
    padding: 4px;
    font-size: 1rem;
  }
}
