/* === CHOIX DE L'AVANCEMENT (popup + badges, voir shared/js/avancement.js) ===
   Couleurs écrites en dur : la feuille sert aussi sur l'accueil, qui ne charge pas base.css. */

.avc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.avc-overlay.hidden { display: none !important; }

.avc-box {
  position: relative;
  width: 100%;
  max-width: 27rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1.75rem;
  background: #0f1f34;
  border: 1px solid rgba(182, 216, 242, 0.3);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', -apple-system, sans-serif;
  color: #f1f5f9;
  text-align: left;
}
.avc-box h3 { font-size: 1.15rem; font-weight: 800; color: #B6D8F2; padding-right: 2rem; margin: 0; }
.avc-intro { font-size: 0.85rem; color: #94a3b8; line-height: 1.5; margin: 0.5rem 0 1.1rem; }

.avc-close {
  position: absolute;
  top: 0.875rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
}
.avc-close:hover { color: #f1f5f9; }
.avc-close.hidden { display: none; }

/* Liste des choix : défile à l'intérieur de la popup, jamais plus haute que l'écran */
.avc-list {
  position: relative; /* repère des offsetTop, pour faire défiler jusqu'au choix actuel */
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: min(19rem, calc(100vh - 17rem));
  max-height: min(19rem, calc(100dvh - 17rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.4rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.avc-list-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0.55rem 0.5rem 0.15rem;
}
.avc-option {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.avc-option:hover { background: rgba(182, 216, 242, 0.08); color: #f1f5f9; }
.avc-option-main { font-weight: 700; color: #f1f5f9; }
.avc-option.selected {
  background: rgba(182, 216, 242, 0.14);
  border-color: rgba(182, 216, 242, 0.55);
  color: #B6D8F2;
  font-weight: 700;
}
.avc-option.selected::after { content: '✓'; font-weight: 800; }

.avc-submit {
  display: block;
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.65rem 1.25rem;
  background: #B6D8F2;
  color: #0f172a;
  border: none;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.avc-submit:hover { background: #9dc8e8; }

/* Badge « Avancement : Thriller Bark » (ouvre la popup) */
.avc-badge {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #334155;
  border-radius: 20px;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.avc-badge strong { color: #B6D8F2; font-weight: 700; }
.avc-badge:hover:not(:disabled) { border-color: #B6D8F2; color: #f1f5f9; }
.avc-badge:disabled { opacity: 0.45; cursor: default; }
.avc-badge:empty { display: none; }

@media (max-width: 700px) {
  .avc-badge { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
  .avc-box { padding: 1.25rem 1.1rem; }
}
