/* ============================================================================
   GUIDE « PARENTS ET ENSEIGNANTS » — le texte explicatif de chaque jeu
   (niveau, programme, règles, idées d'usage).

   Deux présentations :
     .cab-guide              dans le fil de la page, sous le jeu
                             (jeux dont la page défile)
     .cab-guide.is-overlay   panneau plein écran, ouvert par un bouton
                             [data-guide-open] de l'écran d'accueil
                             (jeux plein écran, voir shared/guide.js)

   Les couleurs sont fixées ici, sans dépendre du jeu : le texte reste
   lisible sur tous les fonds (crème, espace, néon, royaume…).
   ========================================================================== */

.cab-guide {
  --g-ink: #2E2A4D;
  --g-muted: #6a6486;
  --g-accent: #B4501A;
  --g-line: #EFE3CF;
  box-sizing: border-box;
  max-width: 820px;
  margin: 2.5rem auto 1rem;
  padding: 0 16px;
  color: var(--g-ink);
  font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}
.cab-guide *, .cab-guide *::before, .cab-guide *::after { box-sizing: inherit; }
.cab-guide[hidden] { display: none !important; }

.cab-guide-card {
  position: relative;
  background: #FFFDF8;
  border: 3px solid var(--g-line);
  border-radius: 24px;
  padding: 26px 30px 22px;
  box-shadow: 0 10px 28px rgba(46, 42, 77, .10);
}

.cab-guide-kicker {
  margin: 0 0 .3rem;
  color: var(--g-muted);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cab-guide h2 {
  margin: 0 0 .8rem;
  color: var(--g-ink);
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
.cab-guide h3 {
  margin: 1.2rem 0 .3rem;
  color: var(--g-accent);
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
.cab-guide p { margin: 0 0 .6rem; }
.cab-guide strong { font-weight: 700; }
.cab-guide-lead { font-size: 1.05rem; }

/* ---------- Panneau plein écran ---------- */
.cab-guide.is-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: none;
  margin: 0;
  padding: 24px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: rgba(20, 16, 36, .62);
  -webkit-overflow-scrolling: touch;
  user-select: text;
  -webkit-user-select: text;
}
.cab-guide.is-overlay .cab-guide-card {
  width: 100%;
  max-width: 760px;
  margin: auto 0;
  padding-top: 30px;
}

.cab-guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--g-line);
  color: var(--g-ink);
  font: 700 18px/1 system-ui, sans-serif;
  cursor: pointer;
}
.cab-guide-close:hover, .cab-guide-close:focus-visible { background: #E5D3B5; }

/* ---------- Boutons qui ouvrent le panneau ---------- */
.cab-guide-line { margin: 14px 0 0; text-align: center; }
.cab-guide-btn {
  display: inline-block;
  padding: 7px 16px;
  border: 2px solid #E5D3B5;
  border-radius: 999px;
  background: #FFF6E9;
  color: #2E2A4D;
  font: 700 14px/1.3 'Quicksand', system-ui, sans-serif;
  cursor: pointer;
}
.cab-guide-btn:hover, .cab-guide-btn:focus-visible { background: #FFEBCF; }
.cab-guide-btn.is-dark {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
}
.cab-guide-btn.is-dark:hover, .cab-guide-btn.is-dark:focus-visible { background: rgba(255, 255, 255, .18); }
.cab-guide-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 560px) {
  .cab-guide { margin-top: 2rem; font-size: 15px; }
  .cab-guide-card { padding: 22px 18px 16px; border-radius: 20px; }
  .cab-guide.is-overlay { padding: 12px 10px; }
  .cab-guide h2 { font-size: 1.25rem; padding-right: 36px; }
}
