:root {
  /* Thème clair par défaut (style SaaS, mais pas trop pétant) */
  --pb-bg: #E5E7EB;
  /* fond général gris très clair */
  --pb-bg-alt: #F3F4F6;
  /* fond alternatif / sections */
  --pb-card: #F9FAFB;
  /* cartes quasi blanches */
  --pb-primary: #3B82F6;
  /* bleu principal */
  --pb-text: #111827;
  /* texte principal (presque noir) */
  --pb-text-muted: #6B7280;
  /* texte secondaire */
  --pb-border: #D1D5DB;
  /* bordures plus douces */
}

/* plus de prefers-color-scheme: dark :
   les couleurs sont désormais identiques sur tous les appareils */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100vh;            /* occupe au moins toute la hauteur de la fenêtre */
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Fond clair, pro, avec une légère touche de bleu/violet pour le côté jeu */
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18) 0, transparent 45%),
    radial-gradient(circle at top right, rgba(129, 140, 248, 0.16) 0, transparent 40%),
    linear-gradient(to bottom, #FFFFFF 0, #F5F7FB 45%, #E5E7EB 100%);
  color: var(--pb-text);
}

a {
  color: #60A5FA;
  text-decoration: none;
}

a:hover {
  color: var(--pb-primary);
}

.pb-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* HEADER – liquid glass + glow léger */
.pb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(200 205 216 / 50%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(139, 142, 150, 0.35);
  overflow: hidden;
}

.pb-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right,
      rgba(96, 165, 250, 0.30),
      transparent 55%);
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

.pb-header-inner {
  position: relative; /* pour accrocher le menu mobile */
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
}

/* Item de menu "compte" avec avatar + nom */
.pb-menu-account-logged-in .pb-menu-account-link,
.pb-menu-account-guest .pb-menu-account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

/* Avatar rond dans le menu */
.pb-menu-account-avatar img {
  border-radius: 50%;
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
}

/* Texte du compte */
.pb-menu-account-text {
  font-size: 1rem;
  white-space: nowrap;
}

/* Sur mobile, on peut raccourcir un peu le texte si besoin */
@media (max-width: 900px) {
  .pb-menu-account-text {
    font-size: 0.85rem;
  }
}

.pb-logo img {
  display: block;
  max-height: 50px;
  width: 110px;
}

/* nav poussée à droite + alignement vertical des items */
.pb-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.pb-logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pb-text);
}

.pb-logo-text span {
  color: var(--pb-primary);
}

/* MENU : tous les items sur la même ligne et alignés */
.pb-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.pb-menu > li {
  display: flex;
  align-items: center;
}

/* Tous les liens du menu ont le même style que pb-menu-account-link */
.pb-menu .menu-item > a,
.pb-menu-account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  line-height: 1;
}

/* couelurs des liens de menu */
.pb-menu a {
  color: var(--pb-text);
}

/* hover cohérent */
.pb-menu a:hover {
  color: var(--pb-primary);
}

/* état actif du menu (page courante) */
.pb-menu li.current-menu-item > a,
.pb-menu li.current_page_item > a {
  color: var(--pb-primary);
  font-weight: 600;
  position: relative;
}

.pb-menu li.current-menu-item > a::after,
.pb-menu li.current_page_item > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.20rem;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

/* Bouton menu burger (mobile / tablette) */
.pb-menu-toggle {
  display: none;                /* caché par défaut (desktop) */
  border: none;
  background: rgba(15, 23, 42, 0.06);
  padding: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;

  /* ⚠️ ne remets PAS de display ici */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;

  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.pb-menu-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #0f172a;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

/* État ouvert : bouton + barres */
.pb-menu-open .pb-menu-toggle {
  background: rgba(15, 23, 42, 0.90);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.45);
}

.pb-menu-open .pb-menu-toggle-bar {
  background: #e5e7eb;
}

/* Animation burger -> croix */
.pb-menu-open .pb-menu-toggle-bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.pb-menu-open .pb-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.pb-menu-open .pb-menu-toggle-bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Le wrapper principal prend toute la hauteur entre header et footer */
.pb-site-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Contenu principal : se dilate pour pousser le footer en bas */
.pb-main {
  padding: 2.5rem 0;
  flex: 1 0 auto;
}

/* FOOTER – liquid glass + glow léger */
.pb-footer {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.45);
  overflow: hidden;
  color: #E5E7EB;
  flex-shrink: 0;
}

.pb-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at bottom left,
      rgba(129, 140, 248, 0.28),
      transparent 55%);
  opacity: 0.28;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: pbFooterGlow 30s ease-in-out infinite alternate;
}

.pb-footer-inner {
  position: relative;
  z-index: 1;
  padding: 0.9rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.pb-footer a {
  color: #E5E7EB;
}

.pb-footer a:hover {
  color: #BFDBFE;
}

.pb-section {
  padding: 2.5rem 0 1rem;
}

.pb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

.pb-section-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--pb-text);
}

.pb-section-subtitle {
  font-size: 0.9rem;
  color: var(--pb-text-muted);
}

.pb-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 0 2rem;
}

.pb-hero-title {
  font-size: 2.4rem;
  margin-bottom: .75rem;
  color: var(--pb-text);
}

.pb-hero-subtitle {
  color: var(--pb-text-muted);
  margin-bottom: 1.5rem;
}

.pb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.pb-btn-primary {
  background: linear-gradient(135deg, var(--pb-primary), #60A5FA);
  border-radius: 999px;
  border: none;
  padding: .7rem 1.6rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}

/* transitions boutons */
.pb-btn-primary,
.pb-btn-secondary,
.pb-btn-ghost {
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    background-color 0.18s ease-out,
    border-color 0.18s ease-out,
    color 0.18s ease-out;
}

.pb-btn-secondary,
.pb-btn-ghost {
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--pb-border);
  padding: .7rem 1.4rem;
  color: var(--pb-text);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}

.pb-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.pb-tag,
.pb-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  background: #f3f4f6;
  color: #111827;
}

/* Badges top (temps + brain) */
.pb-badge--time {
  background: #dcd6ff;
  /* jaune doux */
  color: #92400e;
}

.pb-badge--brain {
  background: #e0e7ff;
  /* bleu/violet doux */
  color: #3730a3;
}

/* Badges types de jeux – styles spécifiques */

.pb-badge--type {
  /* style commun si tu veux */
}

/* 🧠 Logique */
.pb-badge--type-logique {
  background: #dcfce7;
  /* vert clair */
  color: #166534;
}

/* 🧮 Calcul */
.pb-badge--type-calcul {
  background: #e0f2fe;
  /* bleu clair */
  color: #075985;
}

/* 🔤 Vocabulaire */
.pb-badge--type-vocabulaire {
  background: #fae8ff;
  /* violet/rose clair */
  color: #6b21a8;
}

/* 🧩 Mémoire */
.pb-badge--type-memoire {
  background: #fee2e2;
  /* rouge rosé doux */
  color: #b91c1c;
}

.pb-hero-slide-types {
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Card hero (en haut) */
.pb-hero-card {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.10), var(--pb-card));
  border-radius: 1.5rem;
  padding: 1.75rem;
  border: 1px solid var(--pb-border);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
  color: var(--pb-text);
}

.pb-hero-grid-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .25rem;
  margin-bottom: 1rem;
}

/* Petites cases de la grille hero */
.pb-hero-grid-cell {
  aspect-ratio: 1 / 1;
  border-radius: .35rem;
  background: var(--pb-bg-alt);
  border: 1px solid var(--pb-border);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.pb-parcours-grid,
.pb-jeux-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* Cards génériques */
.pb-card {
  background: var(--pb-card);
  border-radius: 1rem;
  border: 1px solid var(--pb-border);
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
  color: var(--pb-text);
}

.pb-card-title {
  font-weight: 600;
  margin-bottom: .3rem;
}

.pb-card-desc {
  font-size: .9rem;
  color: var(--pb-text-muted);
  margin-bottom: .85rem;
}

.pb-card-desc-sub {
  font-weight: 100;
  font-style: italic;
  color: grey;
}

/* Centrer le header de la section "Choisis ta pause" */
.pb-section-header--center {
  text-align: center;
  display: flex;
  justify-content: center;
}

.pb-section-header--center .pb-section-header-inner {
  max-width: 640px;
}

/* Séparateur entre le titre et les cartes */
.pb-parcours-separator {
  width: max(240px, 70%);
  height: 2px;
  margin: 1.5rem auto 2rem;
  background: linear-gradient(to right,
      transparent,
      rgba(0, 0, 0, 0.12),
      transparent);
}

.pb-jeu-card-title {
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--pb-text);
}

.pb-jeu-card-meta {
  font-size: .8rem;
  color: var(--pb-text-muted);
  margin-bottom: .55rem;
}

.pb-jeu-card-desc {
  font-size: .85rem;
  color: var(--pb-text-muted);
  margin-bottom: .9rem;
}

.pb-leaderboard-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.pb-leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pb-leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
  font-size: .9rem;
  color: var(--pb-text);
}

.pb-leaderboard-score {
  color: #60A5FA;
}

/* Encadré pub / info */
.pb-ad {
  margin: 1.5rem 0;
  border-radius: .75rem;
  background: var(--pb-card);
  border: 1px dashed var(--pb-border);
  padding: 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--pb-text-muted);
}

/* Shell du jeu */
.pb-game-shell {
  background: var(--pb-card);
  border-radius: 1.25rem;
  border: 1px solid var(--pb-border);
  padding: 1.5rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  margin-bottom: 1.5rem;
  color: var(--pb-text);
}

.pb-game-topbar {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--pb-text-muted);
  margin-bottom: .75rem;
}

#pb-game-container {
  min-height: 260px;
  border-radius: .75rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  padding: 1rem;
}

.pb-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.pb-game-notice {
  font-size: .85rem;
  color: var(--pb-text-muted);
  margin-top: .75rem;
}

.pb-parcours-popup {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  max-width: 320px;
  font-family: inherit;
}

.pb-parcours-popup-inner {
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pb-parcours-popup-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pb-parcours-popup-emoji {
  font-size: 1.3rem;
}

.pb-parcours-popup-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
}

.pb-parcours-popup-body {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.75rem;
}

.pb-parcours-popup-body strong {
  font-weight: 600;
  color: #0f172a;
}

.pb-parcours-popup-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pb-parcours-popup-btn {
  border-radius: 999px;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}

.pb-parcours-popup-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.pb-parcours-popup-btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

/* Animations liquid glass footer (header désactivé côté anim) */
@keyframes pbFooterGlow {
  0% {
    transform: translate3d(4%, 0, 0);
    opacity: 0.20;
  }

  50% {
    transform: translate3d(0, -2%, 0);
    opacity: 0.32;
  }

  100% {
    transform: translate3d(-4%, 1%, 0);
    opacity: 0.24;
  }
}

/* Effet de lévitation léger sur les cards */
.pb-card,
.pb-hero-card,
.pb-game-shell {
  transform: translateY(0) scale(1);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out,
    background-color 0.18s ease-out;
}

.pb-single-jeu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Survol (desktop, trackpad, etc.) */
@media (hover: hover) and (pointer: fine) {

  .pb-card:hover,
  .pb-hero-card:hover,
  .pb-game-shell:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
    /* léger highlight bleu */
    background-color: #FFFFFF;
    /* un chouïa plus clair que var(--pb-card) */
  }

  .pb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #2563EB, #60A5FA);
  }

  .pb-btn-secondary:hover,
  .pb-btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    border-color: rgba(59, 130, 246, 0.55);
  }

  .pb-hero-grid-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
    border-color: rgba(59, 130, 246, 0.5);
  }

  .pb-menu-toggle:hover {
    background: rgba(15, 23, 42, 0.10);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
    transform: translateY(-1px);
  }
}

.pb-game-shell {
  position: relative;
}

.pb-game-transition {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pb-game-transition--visible {
  opacity: 1;
  pointer-events: auto;
}

.pb-game-transition-inner {
  background: rgba(15, 23, 42, 0.98);
  color: #ffffff;
  border-radius: 18px;
  padding: 24px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.65);
}

.pb-game-transition-title {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

.pb-game-transition-text {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.pb-game-transition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pb-game-transition-countdown {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Mobiles + tablettes en VERTICAL (≤ 900px) */
@media (max-width: 900px) {
  main,
  .site-main,
  .pb-main,
  .pb-hero,
  .pb-footer-inner {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
  }

  .pb-header {
    overflow: visible; /* pour laisser sortir le dropdown */
  }

  .pb-header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    position: relative; /* ancre du menu mobile */
  }

  .pb-logo {
    margin-left: 0;
  }

  .pb-logo img {
    max-height: 50px;
    width: 100px;
  }

  /* Afficher le bouton burger sur mobile / tablette */
  .pb-menu-toggle {
    display: inline-flex;
  }

  /* 🔻 Menu accroché à pb-header-inner, sous le burger, à droite */
  .pb-nav {
    position: absolute;
    top: calc(100% + 0.35rem);   /* juste sous le header-inner */
    right: 0;                    /* collé à droite du header-inner */
    left: auto;
    width: min(260px, 88vw);     /* largeur fixe mais responsive */
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    margin-top: 0;
    display: none;
    z-index: 40;
    text-align: right;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.45);
  }

  /* Quand on ouvre le menu (classe sur <body>) */
  .pb-menu-open .pb-nav {
    display: block;
  }

  .pb-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;        /* les liens prennent toute la largeur du menu */
    justify-content: flex-start;
    gap: 0.15rem;
    font-size: 0.9rem;
    padding: 0.55rem 0.4rem 0.65rem;
  }

  .pb-menu > li {
    width: 100%;
    text-align: right;
  }

  .pb-menu .menu-item > a,
  .pb-menu-account-link {
    width: 100%;
    justify-content: flex-end;   /* texte/icone alignés à droite */
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
  }

  .pb-menu a {
    color: #e5e7eb;
  }

  .pb-menu a:hover {
    color: #bfdbfe;
    background: rgba(15, 23, 42, 0.9);
  }

  .pb-hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .pb-hero-actions,
  .pb-hero-tags {
    margin: 20px auto 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
    max-width: 450px;
  }
}

/* Tablettes en HORIZONTAL (ex : iPad 1024px, petits laptops) */
@media (min-width: 901px) and (max-width: 1200px) {
  main,
  .site-main,
  .pb-main,
  .pb-hero,
  .pb-footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
  }

  .pb-header-inner {
    padding: 0.6rem 1.8rem;
  }

  .pb-hero-actions {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .pb-logo {
    margin-left: 0;
  }

  .pb-menu {
    justify-content: flex-end;
  }
}

/* Footer encore plus compact sur petits écrans */
@media (max-width: 600px) {
  .pb-footer-inner {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }
}
