/* Mots interactifs dans la consigne (Tokens tactiles calibrés) */
.tokens-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  line-height: 1.8;
  padding: 0.15rem 0;
}

.word-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.word-token:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
  transform: translateY(-1px);
}

.word-token:active {
  transform: scale(0.94);
  background: #E2E8F0;
}

.word-token.punctuation {
  cursor: default;
  min-height: auto;
  padding: 0.1rem 0.15rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

.word-token.punctuation:hover,
.word-token.punctuation:active {
  background: transparent;
  border-color: transparent;
  transform: none;
}

/* Surlignages sémantiques fixes selon le plan cognitif */
/* Rouge/Orange : Verbe d'action (Alerte sur ce qu'il faut faire) */
.word-token.is-verb {
  background: var(--color-verb-light) !important;
  color: var(--color-verb) !important;
  border: 2px solid var(--color-verb) !important;
  font-weight: 800 !important;
  box-shadow: 0 0 8px var(--color-verb-glow);
}

/* Réussite positive : Mot validé en VERT */
.word-token.is-correct-green {
  background: #D1FAE5 !important;
  color: #065F46 !important;
  border: 2px solid #10B981 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3) !important;
}

/* Bleu : Cible */
.word-token.is-target {
  background: var(--color-target-light) !important;
  color: var(--color-target) !important;
  border: 2px solid var(--color-target) !important;
  font-weight: 800 !important;
  box-shadow: 0 0 8px var(--color-target-glow);
}

/* Vert : Contrainte */
.word-token.is-constraint {
  background: var(--color-constraint-light) !important;
  color: var(--color-constraint) !important;
  border: 2px solid var(--color-constraint) !important;
  font-weight: 800 !important;
  box-shadow: 0 0 8px var(--color-constraint-glow);
}

/* Animation d'aide : mot qui attire l'attention doucement */
.word-token.hint-highlight {
  animation: pulseGently 0.9s infinite alternate;
  outline: 2px dashed #F59E0B;
}

/* Zone de Réussite Verte compacte */
.success-zone-green {
  background: var(--color-success-bg, #ECFDF5) !important;
  border: 2px solid var(--color-success, #10B981) !important;
  padding: 0.65rem 0.85rem !important;
  border-radius: var(--radius-md) !important;
  text-align: center !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12) !important;
  animation: popSuccess 0.25s ease;
}

.success-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #10B981;
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25);
}

.success-word-highlight {
  font-size: 1.35rem;
  font-weight: 900;
  color: #065F46;
  margin: 0.25rem 0;
  display: inline-block;
  padding: 0.15rem 0.85rem;
  background: #FFFFFF;
  border: 1.5px solid #34D399;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.12);
}

.success-zone-text {
  color: #047857;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* Boîte récapitulative de décodage */
.extracted-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  background: var(--bg-panel-left);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.extracted-card {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.extracted-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.extracted-card-value {
  font-size: 0.98rem;
  font-weight: 700;
}

/* Sélecteur de Choix Cognitifs / Catégories */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.choice-btn {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 46px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:hover {
  border-color: #2563EB;
  background: #EFF6FF;
  transform: translateY(-1px);
}

.choice-btn:active {
  transform: scale(0.97);
}

.choice-btn.selected {
  border-color: #2563EB;
  background: #DBEAFE;
  color: #1D4ED8;
}

.choice-btn.correct {
  border-color: #10B981 !important;
  background: #ECFDF5 !important;
  color: #065F46 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.choice-btn.wrong {
  border-color: #EF4444 !important;
  background: #FEE2E2 !important;
  color: #991B1B !important;
  animation: wiggle 0.4s ease;
}

.choice-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Composant Planification (Étape 4) : Ordonnancement logique */
.planning-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.planning-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  min-height: 64px;
}

.planning-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.planning-order-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563EB;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.planning-controls {
  display: flex;
  gap: 0.5rem;
}

.btn-order {
  padding: 0.6rem 0.85rem;
  font-size: 1.1rem;
  background: var(--bg-panel-left);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.btn-order:active {
  transform: scale(0.92);
  background: #E2E8F0;
}

.btn-order:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Composant Exécution & Auto-Vérification (Étape 5) */
.execution-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.response-box {
  background: #F8FAFC;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.response-box textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 1.05rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.response-box textarea:focus {
  outline: 3px solid #3B82F6;
  border-color: #2563EB;
}

.checklist-title {
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 58px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.check-item:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.check-item:active {
  transform: scale(0.98);
  background: #F1F5F9;
}

.check-item.is-checked {
  background: #ECFDF5;
  border-color: #10B981;
}

.check-item input[type="checkbox"] {
  width: 28px;
  height: 28px;
  accent-color: #10B981;
  cursor: pointer;
  flex-shrink: 0;
}

.check-item label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  cursor: pointer;
  flex: 1;
  line-height: 1.4;
}

/* Mode Réflexe Flash */
.flash-container {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.flash-timer-bar {
  width: 100%;
  height: 12px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.flash-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B, #EF4444);
  width: 100%;
  transition: width 0.1s linear;
}

.flash-prompt-box {
  background: var(--bg-panel-left);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  font-size: 1.5rem;
  line-height: 1.8;
  font-weight: 600;
}

/* Message méta-cognitif / Bulle d'aide */
.hint-balloon {
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  color: #92400E;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: popSuccess 0.2s ease;
}

/* Ceintures - Grille de progression */
.belts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.belt-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-fast);
}

.belt-card.unlocked {
  border-color: #10B981;
  background: #F0FDF4;
}

.belt-card.current {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.belt-badge-large {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 2px solid rgba(0,0,0,0.15);
}
