/* Styles spécifiques à la page Construire des mots */

/* En-tête du jeu */
.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-header h2 {
  color: var(--primary);
  margin-bottom: 8px;
}

.game-header p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Contrôles du jeu */
.game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background-color: white;
  padding: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.level-selector {
  display: flex;
  gap: 10px;
}

.level-btn {
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Comic Neue', cursive;
  font-weight: bold;
  transition: var(--transition);
}

.level-btn:hover, 
.level-btn.active {
  background-color: var(--primary);
}

/* Conteneur principal du jeu */
.game-container {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--box-shadow);
}

/* Container de l'image du mot */
.word-image-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

#word-image {
  width: 250px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Container du mot à construire */
.word-container {
  margin-bottom: 24px;
}

.word-target {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 70px;
  flex-wrap: wrap;
}

.syllable-slot {
  width: 80px;
  height: 60px;
  border: 2px dashed var(--primary-light);
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f9fe;
  font-size: 24px;
  font-weight: bold;
  font-family: 'Baloo 2', cursive;
  position: relative;
}

.syllable-slot.filled {
  border-style: solid;
  background-color: white;
}

.syllable-slot.hint {
  border-color: var(--secondary);
  animation: pulse 1.5s infinite;
}

.syllable-number {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-family: 'Comic Neue', cursive;
}

/* Container des syllabes disponibles */
.syllables-container {
  margin-bottom: 24px;
}

.available-syllables {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.syllable-btn {
  width: 80px;
  height: 60px;
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  font-family: 'Baloo 2', cursive;
  cursor: pointer;
  transition: var(--transition);
}

.syllable-btn:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
}

.syllable-btn.selected {
  opacity: 0.5;
  pointer-events: none;
}

.syllable-btn.inactive {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Boutons d'action */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-family: 'Comic Neue', cursive;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn.primary {
  background-color: var(--primary);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark);
}

.btn.secondary {
  background-color: var(--secondary);
  color: white;
}

.btn.secondary:hover {
  background-color: var(--secondary-dark);
}

.btn.tertiary {
  background-color: var(--accent);
  color: white;
}

.btn.tertiary:hover {
  opacity: 0.9;
}

.btn img {
  width: 20px;
  height: 20px;
}

/* Feedback */
.feedback {
  text-align: center;
  padding: 16px;
  border-radius: var(--border-radius);
  margin-top: 16px;
  font-weight: bold;
  font-size: 18px;
}

.feedback.success {
  background-color: rgba(70, 204, 143, 0.2);
  color: var(--success);
}

.feedback.error {
  background-color: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.feedback.info {
  background-color: rgba(78, 115, 233, 0.2);
  color: var(--primary);
}

.feedback.hidden {
  display: none;
}

/* Progression */
.progress-container {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--box-shadow);
  margin-bottom: 24px;
}

.progress-container h3 {
  text-align: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.progress-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}

.progress-stat {
  text-align: center;
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  font-family: 'Baloo 2', cursive;
}

.progress-bar {
  height: 16px;
  background-color: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--success);
  border-radius: 8px;
  transition: width 0.5s ease;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  max-width: 90%;
  width: 500px;
  padding: 32px;
  text-align: center;
  position: relative;
  animation: zoomIn 0.3s forwards;
}

@keyframes zoomIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-image, .trophy-image {
  width: 150px;
  height: 150px;
  margin: 16px auto;
  display: block;
}

.success-message {
  font-size: 18px;
  margin: 16px 0;
}

.highlight {
  color: var(--primary);
  font-weight: bold;
  font-family: 'Baloo 2', cursive;
  font-size: 120%;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

/* Score display in modal */
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0;
}

.score-circle {
  width: 100px;
  height: 100px;
  background-color: var(--primary-light);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
  font-family: 'Baloo 2', cursive;
  margin-bottom: 8px;
}

#level-message {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  margin-top: 12px;
}

/* Help modal */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text);
  transition: var(--transition);
}

.close-btn:hover {
  background-color: var(--accent);
  color: white;
}

.help-instructions {
  margin: 24px 0;
}

.help-step {
  display: flex;
  align-items: center;
  margin: 16px 0;
  text-align: left;
}

.help-number {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Floating help button */
.floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--secondary);
  color: white;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
}

.floating-btn:hover {
  background-color: var(--secondary-dark);
  transform: scale(1.1);
}

/* Animations */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.wiggle {
  animation: wiggle 0.5s ease;
}

/* Responsive design */
@media (max-width: 768px) {
  .game-controls {
    flex-direction: column;
    gap: 16px;
  }
  
  .level-selector {
    width: 100%;
    justify-content: center;
  }
  
  .action-buttons {
    flex-wrap: wrap;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .syllable-btn, .syllable-slot {
    width: 60px;
    height: 50px;
    font-size: 20px;
  }
  
  #word-image {
    width: 200px;
    height: 160px;
  }
  
  .modal-content {
    padding: 24px 16px;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
}