/* games/undercover.css — Tout le design de l'écran de jeu Undercover.
   Rien ici n'est partagé avec les autres jeux (voir style.css pour le
   lobby/accueil, communs à tous). */

/* Habillage distinct pendant la partie, pour ne pas confondre avec le lobby */
body.theme-undercover {
  background: radial-gradient(circle at top, #241b3a 0%, #0a0a14 75%);
}

body.theme-undercover #app {
  max-width: 480px;
}

/* La grille de joueurs profite de plus de largeur dès que l'écran le permet */
@media (min-width: 700px) {
  body.theme-undercover #app {
    max-width: 640px;
  }
}

@media (min-width: 1000px) {
  body.theme-undercover #app {
    max-width: 820px;
  }
}

/* --- Écran de jeu --- */

.game-screen {
  width: 100%;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.game-title {
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.round-pill {
  background: rgba(78, 205, 196, 0.12);
  border: 1px solid #4ecdc4;
  color: #4ecdc4;
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 100px;
  font-weight: bold;
  white-space: nowrap;
}

.game-body {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 0 40px rgba(78, 205, 196, 0.06), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.winner-label {
  text-align: center;
  color: #4ecdc4;
  font-weight: bold;
  font-size: 1.1rem;
  margin: 0 0 16px;
}

.word-reveal {
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.6;
}

.round-label {
  text-align: center;
  color: #4ecdc4;
  font-weight: bold;
  margin: 16px 0 12px;
}

/* --- Grille de joueurs (indices en jeu, et classements) --- */

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 6px;
  background: #0f1729;
  border: 1px solid transparent;
  border-radius: 10px;
}

.player-card .avatar {
  width: 60px;
  height: 60px;
}

.player-card-name {
  font-size: 0.8rem;
  font-weight: bold;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-caption {
  font-size: 0.7rem;
  color: #888;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-caption.score {
  color: #4ecdc4;
  font-weight: bold;
}

.player-card-rank {
  font-size: 0.75rem;
  font-weight: bold;
  color: #888;
}

.player-card.eliminated {
  opacity: 0.4;
}

.player-card.current-turn {
  border-color: #4ecdc4;
  box-shadow: 0 0 12px rgba(78, 205, 196, 0.3);
}

.player-card.clickable {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.player-card.clickable:hover {
  border-color: #e94560;
  transform: translateY(-2px);
}

.player-card.selected {
  border-color: #e94560;
  background: rgba(233, 69, 96, 0.12);
}

/* --- Barre de saisie contextuelle, en bas de l'écran de jeu --- */

.composer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.composer input {
  flex: 1;
  margin-bottom: 0;
}

.composer button {
  width: auto;
  margin-bottom: 0;
  padding: 12px 18px;
}

.composer .waiting {
  width: 100%;
  margin: 4px 0;
}

/* --- Carte à retourner pour découvrir son mot --- */

.flip-card {
  perspective: 1000px;
  height: 130px;
  margin-bottom: 20px;
  cursor: pointer;
}

.flip-card.flipped {
  cursor: default;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}

.flip-card-back {
  background: linear-gradient(135deg, #1e1e3f, #0f1729);
  border: 2px dashed #4ecdc4;
  color: #888;
  font-size: 0.9rem;
}

.flip-card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.flip-card-front {
  background: #0f1729;
  border: 2px solid #4ecdc4;
  transform: rotateY(180deg);
}

.role-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 6px;
}

.role-word {
  font-size: 1.6rem;
  font-weight: bold;
}

.banner {
  background: #0f1729;
  border-left: 3px solid #4ecdc4;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.badge-out {
  background: #e94560;
  color: white;
}

/* --- Empilement des indices donnés par un joueur (plusieurs tours) --- */

.player-card-clues {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.clue-chip {
  font-size: 0.68rem;
  color: #aaa;
  background: rgba(78, 205, 196, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue-chip.empty {
  background: none;
  color: #555;
}

/* --- Modal de config (manches / tours), propre à Undercover --- */

.uc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.uc-modal {
  width: 100%;
  max-width: 360px;
  background: #16213e;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.uc-modal h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.2rem;
}

.uc-modal-field {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 12px;
}

.uc-modal-field input {
  margin-top: 4px;
  margin-bottom: 0;
}
