/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Cacher et positionner la modale */
#help-modal.modal {
  position: fixed;
  width: 100%;
  height: 100%;
  inset: 0;
  z-index: 6000; /* Plus haut que l'end_screen_container */
  background: rgba(0,0,0,0.25); /* léger fond sombre */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Par défaut : visible si pas .hidden */
}
#help-modal.modal.hidden {
  display: none;
}


/* ====== MODALE COEUR / SOUTENIR ====== */
.help-big-modal {
  width: min(100vw, 56.25vh);   /* 100vh × 9/16 = 56.25vw */
  height: min(100vh, 177.78vw); /* 100vw × 16/9 = 177.78vw */
  aspect-ratio: 9 / 16;
  padding-left: 15px;
  padding-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  container-type: inline-size;
}

.help-modal-content {
  width: 100%;
  aspect-ratio: 8.9 / 9;
  background: var(--color-popup);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(0,0,0,0.14);
  font-family: 'Nunito', Arial, sans-serif;
  animation: fade-in 0.0s ease-out;
}

.help-modal-header {
  width: 100%;
  display: flex;
  padding: 5px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--color-border);
}

.help-modal-header-text {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-modal-title {
  width: 100%;
  font-size: clamp(8px, 6cqw, 70px);
  font-weight: 700;
  color: var(--color-secondary);
  flex: 1;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.help-modal-close-btn {
  width: clamp(20px, 9cqw, 50px);        /* Ou clamp(28px, 8cqw, 44px) si tu veux du responsive ! */
  height: clamp(20px, 9cqw, 50px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-close);
  border: none;
  border-radius: 7px;
  padding: 0;         /* Mets à zéro pour un carré parfait */
  cursor: pointer;
  transition: background 0.15s;
  margin-left: 8px;   /* Garde la marge si tu veux séparer du titre */
}

.help-modal-close-btn .modal-close {
  width: clamp(12px, 7cqw, 44px);
  height: clamp(12px, 7cqw, 44px);
  display: block;
  transition: transform 0.28s cubic-bezier(.62,.18,.21,.97);
}
.help-modal-close-btn:hover .modal-close {
  transform: rotate(90deg);
}
.help-modal-close-btn:active {
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* ==== MODAL BODY ==== */
.help-modal-body {
  width: 100%;
  aspect-ratio: 10.3 / 9;
  color: #33363f;
  font-size: 1.05rem;
  text-align: justify;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.help-block-message_1 {
  font-size: clamp(8px, 5cqw, 50px);
  color: var(--color-secondary);
  padding-left: 5px;
  padding-right: 5px;
  line-height: 1.2;
}
.help-block-message_2 {
  font-size: clamp(8px, 5cqw, 50px);
  color: var(--color-secondary);
  padding-left: 5px;
  padding-right: 5px;
  line-height: 1.2;
}

.help-modal-formula-img-wrap {
  width: 100%;
  aspect-ratio: 50 / 9;
  display: flex;
  padding-left: 5px;
  padding-right: 5px;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden; /* évite que l'image dépasse si besoin */
}
.help-modal-formula-img {
  height: 100%;       /* prend toute la hauteur du conteneur */
  width: auto;        /* largeur auto pour garder le ratio natif */
  object-fit: contain;/* évite de déformer */
  display: block;
  /* Si tu veux un petit padding à gauche : */
  /* margin-left: 0; */
}

/* ==== LÉGENDE SCORE ==== */
.help-modal-score-legend-block {
  width: 100%;
  aspect-ratio: 38 / 9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden; /* évite que l'image dépasse si besoin */
}
.help-modal-score-legend-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
}
.help-modal-score-legend-item {
  width: 18%;
  gap: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.help-modal-score-color {
  width: clamp(5px, 11cqw, 200px);
  height: clamp(5px, 11cqw, 200px);
  border-radius: 8px;
}
.help-modal-score-color.exact   { background: var(--color-green);}
.help-modal-score-color.blue    { background: var(--color-darkgreen);}
.help-modal-score-color.yellow  { background: var(--color-yellow);}
.help-modal-score-color.red     { background: var(--color-red);}
.help-modal-score-color.gray    { background: var(--color-gray); border: 1px solid var(--color-helpborder); }
.help-modal-score-label {
  font-size: clamp(5px, 4cqw, 50px);
  color: var(--text-black);
  text-align: center;
  font-family: var(--font-family-nunito);
  font-weight: 500;
  margin: 0;
}

/* {
  outline: 1px dashed red;
}