/* --- CONFIGURATION DU MAIN --- */
body > main.game-main {
  width: 100% !important;
  max-width: 1200px !important;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 40px 20px;
  margin: 0 auto;
}

/* --- ZONE DE JEU --- */
.game-area {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  width: 100%;
  background: #1e2024;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid #383c44;
  /* Ombre violette subtile pour marquer le mode "Visualisation" */
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.15);
}

/* --- 1. LE PLATEAU --- */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.board-placeholder {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
  background: #2b2d33;
  /* Motif damier */
  background-image:
    linear-gradient(45deg, #383c44 25%, transparent 25%),
    linear-gradient(-45deg, #383c44 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #383c44 75%),
    linear-gradient(-45deg, transparent 75%, #383c44 75%);
  background-size: 40px 40px;
  background-position:
    0 0,
    0 20px,
    20px -20px,
    -20px 0px;

  /* Bordure Violette ici ! */
  border: 5px solid #2b2d33;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #72767d;
  font-weight: bold;
  text-align: center;
}

/* Info Joueur */
.player-info {
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2b2d33;
  padding: 10px 15px;
  border-radius: 8px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: #383c44;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details {
  display: flex;
  flex-direction: column;
}
.name {
  color: #fff;
  font-weight: bold;
}
.rating {
  color: #b9bbbe;
  font-size: 0.8rem;
}

/* --- 2. LA SIDEBAR --- */
.game-sidebar {
  background: #18191c;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* EN-TÊTE CORRIGÉ (Comme sur l'autre page) */
.puzzle-header {
  border-bottom: 1px solid #383c44;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}

.puzzle-header h2 {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Badge ID en Violet */
#puzzle-id {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 10px;
  border-radius: 6px;
  border-left: 3px solid #a855f7; /* VIOLET */
}

.rating-badge {
  background: rgba(220, 38, 38, 0.15); /* Rouge pour Difficile */
  color: #ef4444;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
}

.turn-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #26292f;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #fff;
}
.turn-indicator.white-turn .turn-icon {
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  margin-bottom: 5px;
}
.turn-indicator h3 {
  color: #fff;
  margin-bottom: 2px;
  font-size: 1rem;
}
.turn-indicator p {
  color: #999;
  font-size: 0.85rem;
}

/* --- NOUVEAU : ZONE DE SAISIE (INPUT) --- */
.move-input-zone {
  background: #2b2d33;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #383c44;
}

.move-input-zone label {
  display: block;
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

/* Le champ texte style "Code" */
#move-input {
  width: 100%;
  background: #18191c;
  border: 1px solid #383c44;
  color: #fff;
  font-family: "Courier New", monospace; /* Police style terminal */
  font-size: 1.1rem;
  padding: 10px;
  border-radius: 6px;
  text-transform: uppercase; /* Force les majuscules */
}

#move-input:focus {
  outline: none;
  border-color: #a855f7; /* Focus Violet */
}

/* Bouton Envoyer */
.btn-submit {
  background: #a855f7;
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 50px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn-submit:hover {
  background: #9333ea;
}

.input-hint {
  font-size: 0.75rem;
  color: #72767d;
  margin-top: 8px;
  font-style: italic;
}

/* Boutons bas de page */
.controls {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.btn-game {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
}

.btn-game.secondary {
  background: #2b2d33;
  color: #ccc;
  border: 1px solid transparent;
}
.btn-game.secondary:hover {
  background: #363940;
  color: #fff;
  border-color: #555;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .game-area {
    grid-template-columns: 1fr;
  }
  .board-wrapper {
    order: 1;
  }
  .game-sidebar {
    order: 2;
  }
}
