:root {
  --accent: #72b52b;
  --bg: #fafafa;
  --card: #009ccb;
  --muted: #657785;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Jost, system-ui, Arial, sans-serif;
  background: var(--bg);
  color: #0b1720;
}
.topbar {
  font-weight: 600;
  color: #8c3200;
  display: flex;
  align-items: center;
  padding-left: 8px;
  gap: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap; /* permet de passer à la ligne si nécessaire */
  justify-content: center;
}
.topbar > * {
  min-width: 0;
  flex-shrink: 1;
}

.topbar h1 {
  font-size: clamp(0.8px, 1.8em, 2.5em);
}

main {
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.action-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1rem;
  margin: 0.5rem;
  height: fit-content;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 33%));
  gap: 12px;
}
.card,
.container {
  padding: 10px;
  background: var(--card);
  border-radius: 12px;
  /* overflow: hidden; */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card {
  justify-content: space-between; /* Pousse le 1er en haut, le 2e en bas */
}

.card img,
.card video {
  background: var(--card);
  border-color: var(--card);
  border-radius: 12px;
  object-fit: fill;
  /* max-height: 50vh; */
  max-width: 100%;
  height: auto;
}

.label {
  display: flex;
  justify-content: center; /* centre horizontalement */
  align-items: center;
  color: #ff9800;
  align-self: center;
  flex-wrap: wrap; /* permet de passer à la ligne si nécessaire */
}

.container {
  width: fit-content;
  height: fit-content;
  margin: 10px auto; /* optionnel : centrer sur la page */
  align-items: center; /* pour centrer les éléments */
}

.centered-items {
  display: flex;
  flex-direction: column;
  align-items: center; /* (Optionnel) centre horizontalement */
}

.speakBtn {
  align-self: center;
  min-width: 3em; /* Taille du bouton */
  min-height: 3em;
}

#mediaContainer {
  width: fit-content;
  height: fit-content;
  margin: 10px;
}

.media {
  display: block;
  max-width: 60vw; /* FIXER la taille de l’image */
  max-height: 50vh; /* FIXER la taille de l’image */

  height: auto; /* la hauteur s’ajuste automatiquement */
  border-radius: 12px;
}
.term {
  font-size: 2rem;
  letter-spacing: 0.2rem;
  color: #ff9800;
  margin: 10px 0;
  text-align: center;
}
.cursor {
  border-left: 2px solid black;
  animation: blink 1s infinite;
}
@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.result,
#result {
  font-size: 2rem;
  color: #8c3200;
}

.score_count {
  display: flex;
  flex-direction: row;
  margin: 5px;
  color: #8c3200;
  font-weight: 600;
  font-size: 0.8rem;
}

.input_cache {
  opacity: 0;
  height: 0px;
}

.back_button {
  background-image: url("../common_rsrc/left.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  border: none;
  margin: 10px;
  width: 48px;
  height: 48px;
  align-self: center;
  border-radius: 6px;
}

.solutionBtn {
  background-image: url("solution.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  background-color: transparent;
  border-radius: 50%;
  border: none;
  margin-left: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Ombre légère */
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.solutionBtn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.solutionBtn:active {
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
}

.back_button:active {
  box-shadow: 2px 2px 5px #f08700;
}

@media (max-width: 768px),
  /* Smartphones portrait */ (max-width: 1024px) and (orientation: portrait) {
  /* Tablettes portrait */
  /* Place ici tes styles adaptés aux petits écrans */
  body {
    font-size: 16px;
    padding: 1rem;
  }
  nav {
    display: block;
  }
  /* etc. */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 47%));
    gap: 6px;
  }
  .term {
    font-size: 1.2rem;
    margin: 5px 0;
  }
  .result,
  #result {
    font-size: 0.8rem;
  }
}
