/* =========================================================
   SC@LPA — CALCUL MENTAL
   FICHIER : calcul_mental.css
   CHEMIN  : /maths/calcul/calcul_mental/assets/css/calcul_mental.css
   ========================================================= */

.cm-toolbar {
  background: #f8f9fa;
  border-radius: 1rem;
}

.cm-toolbar select {
  min-width: 155px;
}

.cm-toolbar label {
  font-weight: 600;
  color: #495057;
}

#competence:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}

/* =========================================================
   GRILLE
   ========================================================= */

.cm-grid-title {
  font-weight: 600;
  color: #495057;
}

.cm-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
}

.cm-grid-item {
  padding: 8px;
  text-align: center;
  border-radius: 8px;
  background: #f1f3f5;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(0,0,0,0.08);
}

.cm-grid-item:hover {
  background: #dee2e6;
  transform: translateY(-1px);
}

.cm-grid-item.active {
  outline: 3px solid rgba(13, 110, 253, 0.25);
  transform: scale(1.03);
}

.cm-grid-item.empty {
  background: #f1f3f5;
  color: #212529;
}

.cm-grid-item.in-progress {
  background: #ffc107;
  color: #212529;
}

.cm-grid-item.mastered {
  background: #198754;
  color: #fff;
}

.cm-grid-item.fail {
  background: #dc3545;
  color: #fff;
}

/* =========================================================
   ARDOISE
   ========================================================= */

.cm-ardoise {
  position: relative;
  min-height: 280px;
  border-radius: 1.25rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.10)),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 2px,
      rgba(0,0,0,0.03) 3px,
      rgba(0,0,0,0.03) 4px
    ),
    #254d39;
  box-shadow:
    inset 0 0 0 6px #7b5736,
    inset 0 0 0 12px #5a3d25,
    0 8px 20px rgba(0,0,0,0.18);
}

.cm-ardoise-inner {
  min-height: 248px;
  border-radius: 0.9rem;
  padding: 1.2rem 1.4rem;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 35%),
    transparent;
}

.cm-ardoise-badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.cm-ardoise-code,
.cm-ardoise-label {
  color: #f5f5f0;
  text-shadow:
    0 0 1px rgba(255,255,255,0.70),
    0 0 2px rgba(255,255,255,0.35);
}

.cm-ardoise-code {
  margin-bottom: 1rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: "Comic Sans MS", "Trebuchet MS", cursive, sans-serif;
}

.cm-ardoise-label {
  font-size: 1.2rem;
  line-height: 1.5;
  font-family: "Comic Sans MS", "Trebuchet MS", cursive, sans-serif;
  white-space: normal;
}

/* =========================================================
   MODALE
   ========================================================= */

.cm-modal-content {
  background: #f8f9fa;
}

.cm-question {
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 700;
  color: #212529;
}

#cm-answer {
  font-size: 2rem;
  font-weight: 600;
}

.cm-feedback {
  min-height: 2rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.cm-feedback.ok {
  color: #198754;
}

.cm-feedback.bad {
  color: #dc3545;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991.98px) {
  .cm-ardoise {
    min-height: 220px;
  }

  .cm-ardoise-inner {
    min-height: 188px;
  }
}

@media (max-width: 768px) {
  .cm-toolbar .row {
    flex-direction: column;
    align-items: stretch;
  }

  .cm-toolbar .col-auto {
    width: 100%;
  }

  .cm-toolbar select {
    width: 100%;
    min-width: 0;
  }

  #cm-answer {
    font-size: 1.6rem;
  }
}
.cm-grid-item.missing {
  border: 2px dashed #dc3545;
  background: #fff3f3;
  color: #dc3545;
}