/* MOT-MYSTERE WIDGET V1 — fichier à mettre en ligne */
.mot-mystere-widget {
  --mot-mystere-blue: #147e99;
  --mot-mystere-blue-dark: #0f6d86;
  --mot-mystere-blue-ink: #0f4c5c;
  --mot-mystere-green: #06752c;
  --mot-mystere-green-bg: #e7f8ed;
  --mot-mystere-red: #d64545;
  --mot-mystere-yellow: #ffb913;
  --mot-mystere-yellow-bg: #fff5bf;
  --mot-mystere-border: #cfd9e6;
  max-width: 680px;
  margin: 20px auto;
  color: #17212b;
  font-family: Arial, system-ui, sans-serif;
}

.mot-mystere-widget *,
.mot-mystere-widget *::before,
.mot-mystere-widget *::after {
  box-sizing: border-box;
}

.mm-grid {
  grid-template-areas:
"item1 item3" 
"item2 item3";
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 20px;
}

@media (max-width: 780px) {
  .mm-grid {
  grid-template-areas:
"item1" 
"item2"
"item3";
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 20px;
}
    
}
    

.mot-mystere-word {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px auto 18px;
  grid-area: item1;
}

.mot-mystere-letter {
  display: grid;
  width: 40px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--mot-mystere-border);
  border-radius: 8px;
  background: #fafcff;
  color: #6b7785;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.mot-mystere-letter.is-found {
  border-color: var(--mot-mystere-green);
  background: var(--mot-mystere-green-bg);
  color: var(--mot-mystere-green);
}

.mot-mystere-letter.is-solution {
  border: 2px dashed var(--mot-mystere-yellow);
  background: var(--mot-mystere-yellow-bg);
  color: #6a4d08;
}

.mot-mystere-separator {
  min-width: 10px;
  color: var(--mot-mystere-blue-ink);
  font-size: 20px;
  font-weight: 700;
}

.mot-mystere-keyboard {
  display: flex;
  max-width: 470px;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  grid-area: item2;
}

.mot-mystere-key {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--mot-mystere-blue);
  border-radius: 8px;
  background: var(--mot-mystere-blue);
  color: #fff;
  cursor: pointer;
  font: 700 18px/1 Arial, system-ui, sans-serif;
}

.mot-mystere-key:hover:not(:disabled),
.mot-mystere-key:focus-visible {
  border-color: var(--mot-mystere-blue-dark);
  background: var(--mot-mystere-blue-dark);
  outline: none;
}

.mot-mystere-key.is-correct {
  border-color: var(--mot-mystere-green);
  background: #fff;
  color: var(--mot-mystere-green);
}

.mot-mystere-key.is-incorrect {
  border-color: var(--mot-mystere-red);
  background: #fff;
  color: var(--mot-mystere-red);
}

.mot-mystere-key.is-solution {
  border-color: var(--mot-mystere-yellow);
  background: var(--mot-mystere-yellow-bg);
  color: #6a4d08;
}

.mot-mystere-key.is-disabled {
  border-color: #aeb9c5;
  background: #aeb9c5;
  color: #fff;
}

.mot-mystere-key:disabled {
  cursor: not-allowed;
}

.mot-mystere-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  padding-left: 20px;
  padding-right: 20px;
  border-top: 1px solid #e7eef6;
  grid-area: item3;
}

@media (max-width: 780px) {
  .mot-mystere-actions {
    flex-direction: row;
  }
}

.mot-mystere-actions button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--mot-mystere-blue-dark);
  border-radius: 8px;
  background: var(--mot-mystere-blue);
  color: #fff;
  cursor: pointer;
  font: 400 16px/1.1 Arial, system-ui, sans-serif;
}

.mot-mystere-actions button:hover:not(:disabled) {
  filter: brightness(0.95);
}

.mot-mystere-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.mot-mystere-actions .mot-mystere-retry {
  border-color: var(--mot-mystere-border);
  background: #f0f3f6;
  color: var(--mot-mystere-blue-ink);
}

.mot-mystere-actions .mot-mystere-solution:hover:not(:disabled),
.mot-mystere-actions .mot-mystere-solution.is-active {
  border-color: var(--mot-mystere-yellow);
  background: var(--mot-mystere-yellow-bg);
  color: #6a4d08;
}

.mot-mystere-score {
  margin-left: auto;
  padding: 8px 4px;
  color: var(--mot-mystere-blue-ink);
  font-weight: 800;
}

.mot-mystere-config-error {
  padding: 14px;
  border: 2px solid var(--mot-mystere-red);
  border-radius: 10px;
  background: #fff0f0;
}

@media (max-width: 480px) {
  .mot-mystere-word {
    gap: 4px;
  }

  .mot-mystere-letter {
    width: 34px;
    height: 38px;
    font-size: 17px;
  }

  .mot-mystere-keyboard {
    max-width: 280px;
    gap: 4px;
  }

  .mot-mystere-key {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .mot-mystere-score {
    width: 100%;
    margin-left: 0;
    text-align: right;
  }
}
