/* ===========================================================================
   MisterGames : habillage du site (en-tête, pied, accueil, nouveautés).
   Chargé après games.css (utilitaires communs aux jeux). Les pages de jeux
   n'héritent que de l'en-tête, du pied, du fond et du style du titre (h1).
   Polices Google (Madimi One, Outfit, Pinyon Script) : chargées par header.php
   =========================================================================== */

:root {
  --header-height: 80px;
  --mg-encre: #17142e;
  --mg-encre-2: #262050;
  --mg-texte: #25233d;
  --mg-doux: #6c6a88;
  --mg-fond: #f4f3fb;
  --mg-carte: #fff;
  --mg-bord: rgba(35, 33, 61, 0.09);
  --mg-violet: #7c5cff;
  --mg-rose: #ff4f9a;
  --mg-orange: #ffb547;
  --mg-degrade: linear-gradient(100deg, #ffb547 0%, #ff4f9a 45%, #7c5cff 100%);
  --mg-ombre: 0 1px 2px rgba(23, 20, 46, 0.06), 0 10px 28px -12px rgba(23, 20, 46, 0.18);
  --mg-ombre-forte: 0 2px 6px rgba(23, 20, 46, 0.08), 0 28px 56px -20px rgba(23, 20, 46, 0.38);
  --mg-police: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mg-ressort: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  margin: 0;
  background-color: var(--mg-fond);
  color: #333;
  padding: var(--header-height) 4vw 60px 4vw;
  overflow-x: hidden;
}

::selection {
  background: rgba(124, 92, 255, 0.25);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Police du site sur l'habillage (games.css impose « sans-serif » à tout élément) */
.mg-header,
.mg-header *,
.mg-footer,
.mg-footer *,
.accueil,
.accueil *,
.hero,
.hero *,
.news-liste,
.news-liste *,
.roulette,
.roulette *,
.menu-news-bulle {
  font-family: var(--mg-police);
}

/* ===============================
   Fond animé (taches de couleur floues)
   =============================== */
.mg-fond {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.mg-fond span {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  animation: mg-derive 28s ease-in-out infinite alternate;
}
.mg-fond span:nth-child(1) {
  top: -18vmax;
  right: -12vmax;
  background: #b9a8ff;
}
.mg-fond span:nth-child(2) {
  top: 30vh;
  left: -22vmax;
  background: #ffb3d4;
  animation-delay: -9s;
  animation-duration: 34s;
}
.mg-fond span:nth-child(3) {
  bottom: -26vmax;
  right: 18vw;
  background: #ffd9a0;
  animation-delay: -17s;
}
/* Pages de jeux : fond plus discret, le jeu reste au premier plan */
.page-jeu .mg-fond span,
.page-admin .mg-fond span {
  opacity: 0.16;
}
@keyframes mg-derive {
  to {
    transform: translate(6vmax, 5vmax) scale(1.12);
  }
}

/* ===============================
   En-tête
   =============================== */
.mg-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4vw;
  background: rgba(23, 20, 46, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.3s, background-color 0.3s;
}
/* Liseré dégradé en bas du bandeau */
.mg-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--mg-degrade);
  background-size: 200% 100%;
  opacity: 0.85;
  animation: mg-glisse 8s linear infinite;
}
.mg-header.defile {
  background: rgba(23, 20, 46, 0.94);
  box-shadow: 0 10px 30px -12px rgba(23, 20, 46, 0.55);
}
@keyframes mg-glisse {
  to {
    background-position: 200% 0;
  }
}

/* Nom du site : h1 sur l'accueil, simple paragraphe ailleurs (le h1 est alors le nom du jeu) */
.mg-header .logo {
  margin: 0;
  flex: none;
  font-size: 28px;
  font-weight: normal;
  line-height: 1;
}
.mg-header .logo a,
.mg-header .logo a:hover {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.mg-header .logo-icone {
  display: flex;
  filter: drop-shadow(0 4px 10px rgba(255, 79, 154, 0.45));
  transition: transform 0.5s var(--mg-ressort);
}
.mg-header .logo a:hover .logo-icone {
  transform: rotate(-12deg) scale(1.12);
}
.mg-header .logo-texte {
  font-family: "Madimi One", cursive;
  letter-spacing: 0.5px;
}
.mg-header .logo-texte span {
  font-family: inherit;
  background: var(--mg-degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Barre de l'en-tête : catégories, favoris, recherche */
.mg-outils {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.mg-filtres {
  display: flex;
  align-items: center;
  /* départ à gauche : la règle « nav » d'origine (en bas du fichier) aligne à droite,
     ce qui rendrait les premières catégories inaccessibles quand la rangée déborde */
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  /* marge pour que les pastilles de survol et d'ombre ne soient pas rognées */
  padding: 6px 2px;
  margin: -6px 0;
}
.mg-filtres::-webkit-scrollbar {
  display: none;
}
.mg-filtres .filtre {
  --c: var(--mg-violet);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 42px;
  padding: 0 10px 0 7px;
  box-sizing: border-box;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8e6ff;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.25s var(--mg-ressort),
    box-shadow 0.2s;
}
.mg-filtres .filtre-tous {
  padding-left: 12px;
}
.mg-filtres .filtre-fav {
  --c: var(--mg-rose);
  padding-left: 11px;
}
.mg-filtres .filtre img {
  width: 28px;
  height: 28px;
  padding: 3px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  display: block;
  transition: transform 0.35s var(--mg-ressort);
}
.mg-filtres .filtre:hover {
  background: color-mix(in srgb, var(--c) 26%, transparent);
  border-color: color-mix(in srgb, var(--c) 70%, transparent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}
.mg-filtres .filtre:hover img {
  transform: rotate(-8deg) scale(1.08);
}
.mg-filtres .filtre:active {
  transform: scale(0.95);
}
.mg-filtres .filtre.actif {
  background: var(--c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px -8px var(--c);
}
.mg-filtres .filtre:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 1px;
}
.filtre-nb {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.filtre.actif .filtre-nb {
  background: rgba(0, 0, 0, 0.18);
}
.filtre-fav svg {
  color: var(--mg-rose);
  transition: transform 0.3s var(--mg-ressort);
}
.filtre-fav.actif svg {
  color: #fff;
}
.filtre-fav.secoue svg {
  animation: mg-battement 0.5s var(--mg-ressort);
}

.mg-recherche {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  width: 230px;
  height: 42px;
  padding: 0 8px 0 12px;
  box-sizing: border-box;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a9a6cf;
  cursor: text;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background-color 0.2s,
    width 0.35s var(--mg-ressort);
}
.mg-recherche:hover {
  background: rgba(255, 255, 255, 0.12);
}
.mg-recherche:focus-within {
  width: 300px;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--mg-violet);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.3);
  color: #fff;
}
.mg-recherche input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
}
.mg-recherche input::placeholder {
  color: #9e9bc4;
}
.mg-recherche input::-webkit-search-cancel-button {
  cursor: pointer;
  filter: invert(1);
}
.mg-recherche kbd {
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #c9c6ea;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}
.mg-recherche:focus-within kbd {
  display: none;
}
/* Le raccourci « / » n'existe que sur l'accueil et les catégories */
body:not(.page-accueil) .mg-recherche kbd {
  display: none;
}

/* Bouton « journal » */
.menu-news {
  position: relative;
  z-index: 1; /* l'infobulle passe au-dessus du liseré dégradé du bandeau */
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8e6ff;
  transition:
    background-color 0.2s,
    transform 0.25s var(--mg-ressort);
}
.menu-news:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: translateY(-2px);
}
.menu-news:active {
  transform: scale(0.96);
}
.page-news .menu-news {
  background: var(--mg-violet);
  color: #fff;
}
/* Pastille : une nouveauté n'a pas encore été lue (js/site.js) */
.menu-news-point {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mg-rose);
  box-shadow: 0 0 0 2px var(--mg-encre);
  display: none;
}
.menu-news.a-lire .menu-news-point {
  display: block;
  animation: mg-pulse 2s ease-out infinite;
}
@keyframes mg-pulse {
  0% {
    box-shadow:
      0 0 0 2px var(--mg-encre),
      0 0 0 2px rgba(255, 79, 154, 0.7);
  }
  100% {
    box-shadow:
      0 0 0 2px var(--mg-encre),
      0 0 0 10px rgba(255, 79, 154, 0);
  }
}
/* Infobulle sous le bouton, alignée à droite (le bouton est en bord d'écran) */
.menu-news-bulle {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  padding: 7px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgba(23, 20, 46, 0.35);
  color: var(--mg-texte);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.menu-news-bulle::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 17px;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
}
.menu-news:hover .menu-news-bulle,
.menu-news:focus-visible .menu-news-bulle {
  opacity: 1;
  transform: none;
}

/* ===============================
   Titre des pages (jeux, catégories, nouveautés)
   =============================== */
body h1.titre-page {
  font-family: "Madimi One", sans-serif;
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.15;
  margin: 26px 0 14px;
  background: var(--mg-degrade);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mg-glisse-lent 10s ease-in-out infinite alternate;
}
@keyframes mg-glisse-lent {
  to {
    background-position: 100% 0;
  }
}
body h1.titre-page .b-h2 {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--c, var(--mg-violet));
  -webkit-text-fill-color: #fff;
  color: #fff;
  font: 700 14px/1.2 var(--mg-police);
  letter-spacing: 0.02em;
  transform: translateY(-4px);
}

/* ===============================
   Pied de page
   =============================== */
.mg-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 4px 0 3px;
  background: rgba(23, 20, 46, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #aeabd0;
  font-size: 11.5px;
  text-align: center;
}
.mg-footer p {
  margin: 0;
}
.mg-footer .footer-nom {
  font-weight: 700;
  background: var(--mg-degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Cadenas discret vers l'administration */
.mg-footer .footer-admin {
  display: inline-block;
  margin-left: 6px;
  padding: 0 3px;
  color: #6f6b97;
  vertical-align: -1px;
  transition: color 0.15s;
}
.mg-footer .footer-admin:hover {
  color: #fff;
}
.mg-footer .footer-admin svg {
  display: block;
}

/* ===============================
   Boutons communs de l'habillage
   =============================== */
.btn-hasard,
.btn-secondaire {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  box-sizing: border-box;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s var(--mg-ressort),
    box-shadow 0.25s,
    background-color 0.2s,
    color 0.2s;
}
.btn-hasard {
  padding-left: 16px;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: var(--mg-encre);
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(23, 20, 46, 0.7);
}
.btn-hasard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--mg-degrade);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-hasard:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(255, 79, 154, 0.7);
}
.btn-hasard:hover::before {
  opacity: 1;
}
.btn-hasard:active {
  transform: scale(0.97);
}
.btn-hasard-de {
  display: flex;
  transition: transform 0.6s var(--mg-ressort);
}
.btn-hasard:hover .btn-hasard-de {
  transform: rotate(200deg);
}
.btn-secondaire {
  border: 1px solid var(--mg-bord);
  background: #fff;
  color: var(--mg-encre);
  box-shadow: var(--mg-ombre);
}
.btn-secondaire:hover {
  color: var(--mg-violet);
  text-decoration: none;
  transform: translateY(-2px);
}
.btn-secondaire span {
  display: inline-block;
  transition: transform 0.3s;
}
.btn-secondaire:hover span {
  transform: translateY(3px);
}
/* « Les nouveaux jeux » : nombre de jeux dans une pastille */
.btn-nouveaux-nb {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--mg-rose);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.btn-hasard:focus-visible,
.btn-secondaire:focus-visible {
  outline: 3px solid var(--mg-violet);
  outline-offset: 3px;
}

/* ===============================
   Bandeau d'accueil
   =============================== */
.accueil {
  max-width: 1440px;
  margin: 0 auto;
  color: var(--mg-texte);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(28px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
}
.hero[hidden] {
  display: none;
}
/* Bandeau masqué (une catégorie ou les favoris sont affichés) : un peu d'air sous l'en-tête */
.accueil.sans-hero {
  padding-top: clamp(20px, 3vw, 36px);
}
.hero-sur {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--mg-bord);
  color: var(--mg-doux);
  font-size: 13.5px;
  font-weight: 600;
}
.hero-sur a {
  color: var(--mg-violet);
}
.hero-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: mg-pulse-vert 2s ease-out infinite;
}
@keyframes mg-pulse-vert {
  from {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  to {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}
.hero-titre {
  margin: 20px 0 18px;
  color: var(--mg-encre);
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.degrade {
  background: var(--mg-degrade);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mg-glisse-lent 6s ease-in-out infinite alternate;
}
.accueil .intro-accueil,
.hero .intro-accueil {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--mg-doux);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  text-align: left;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-stats {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  margin-top: 34px;
}
.hero-stats div {
  display: flex;
  flex-direction: column;
}
.hero-stats strong {
  color: var(--mg-encre);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hero-stats span {
  color: var(--mg-doux);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ----- Vitrine « À la une » ----- */
.vitrine {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 28px;
  isolation: isolate;
  background: var(--mg-encre);
  box-shadow:
    var(--mg-ombre-forte),
    0 40px 90px -40px var(--vc, var(--mg-violet));
  transform: perspective(1200px) rotateY(-6deg) rotateX(3deg);
  transition:
    transform 0.8s var(--mg-ressort),
    box-shadow 0.8s;
}
.vitrine:hover {
  transform: none;
}
/* Cadres décalés derrière la vitrine */
.vitrine::before,
.vitrine::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  transition: transform 0.8s var(--mg-ressort);
}
.vitrine::before {
  background: var(--mg-degrade);
  transform: rotate(4deg) translate(14px, 6px);
  opacity: 0.55;
}
.vitrine::after {
  background: var(--vc, var(--mg-violet));
  transform: rotate(-3deg) translate(-12px, 10px);
  opacity: 0.25;
}
.vitrine:hover::before {
  transform: rotate(6deg) translate(22px, 8px);
}
.vitrine:hover::after {
  transform: rotate(-5deg) translate(-20px, 14px);
}
.vitrine-piste {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}
.vitrine-slide {
  position: absolute;
  inset: 0;
  display: block;
  color: #fff;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.8s ease,
    visibility 0s 0.8s;
}
.vitrine-slide.actif {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: opacity 0.8s ease;
}
.vitrine-slide:hover {
  color: #fff;
  text-decoration: none;
}
.vitrine-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.1);
  transition: transform 7s ease-out;
}
.vitrine-slide.actif img {
  transform: scale(1);
}
.vitrine-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 12, 34, 0.92) 0%, rgba(15, 12, 34, 0.35) 45%, transparent 70%);
}
.vitrine-legende {
  position: absolute;
  left: clamp(18px, 3vw, 30px);
  right: 100px;
  bottom: clamp(18px, 3vw, 28px);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.vitrine-etiquette {
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--c);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vitrine-titre {
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}
.vitrine-sous {
  max-width: 30em;
  font-size: 14.5px;
  opacity: 0.85;
  line-height: 1.4;
}
.vitrine-slide.actif .vitrine-legende > * {
  animation: mg-monte 0.7s var(--mg-ressort) both;
}
.vitrine-slide.actif .vitrine-legende > :nth-child(2) {
  animation-delay: 0.08s;
}
.vitrine-slide.actif .vitrine-legende > :nth-child(3) {
  animation-delay: 0.16s;
}
@keyframes mg-monte {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
.vitrine-jouer {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--mg-encre);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.4);
  transform: translateY(-6px);
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.35s var(--mg-ressort);
}
.vitrine-jouer span {
  color: var(--c);
}
.vitrine-slide:hover .vitrine-jouer,
.vitrine-slide:focus-visible .vitrine-jouer {
  opacity: 1;
  transform: none;
}
.vitrine-points {
  position: absolute;
  right: clamp(16px, 2.5vw, 26px);
  bottom: clamp(20px, 3vw, 32px);
  z-index: 2;
  display: flex;
  gap: 6px;
}
.vitrine-points button {
  width: 22px;
  height: 18px;
  padding: 7px 0;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  transition: width 0.3s;
}
.vitrine-points button span {
  position: relative;
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.vitrine-points button.actif {
  width: 40px;
}
.vitrine-points button span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.vitrine-points button.actif span::after {
  animation: mg-progres var(--duree, 5.5s) linear forwards;
}
.vitrine.pause .vitrine-points button.actif span::after {
  animation-play-state: paused;
}
@keyframes mg-progres {
  to {
    transform: scaleX(1);
  }
}

/* ----- Bandeau d'une catégorie ou des nouveautés ----- */
.hero-cat,
.hero-news {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  padding-bottom: 28px;
}
.hero-cat .hero-texte,
.hero-news .hero-texte {
  flex: 1;
  min-width: 0;
}
.hero-cat h1.titre-page,
.hero-news h1.titre-page {
  margin: 14px 0 8px;
  font-size: clamp(34px, 4.6vw, 56px);
}
.hero-cat h1.titre-page {
  background: linear-gradient(100deg, var(--c), color-mix(in srgb, var(--c) 55%, var(--mg-encre)));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-cat .intro-accueil,
.hero-news .intro-accueil {
  margin-bottom: 0;
}
.hero-cat-icone {
  flex: none;
  width: clamp(72px, 9vw, 108px);
  height: auto;
  aspect-ratio: 1;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 28px;
  background: #fff;
  box-shadow:
    var(--mg-ombre),
    0 20px 40px -18px var(--c);
  object-fit: contain;
  animation: mg-flotte 5s ease-in-out infinite;
}
@keyframes mg-flotte {
  50% {
    transform: translateY(-8px) rotate(-4deg);
  }
}
.hero-news {
  max-width: 820px;
  margin: 0 auto;
}

/* Début de la liste des jeux */
.mg-ancre {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ===============================
   Rayons (une catégorie de jeux)
   =============================== */
.rayon {
  margin-bottom: 48px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.rayon[hidden] {
  display: none;
}
.rayon-tete {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.rayon-icone {
  width: 44px;
  height: 44px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    var(--mg-ombre),
    inset 0 0 0 2px color-mix(in srgb, var(--c, var(--mg-violet)) 25%, transparent);
  object-fit: contain;
}
.rayon-icone-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mg-violet);
}
.accueil .rayon-tete h2 {
  margin: 0;
  color: var(--mg-encre);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.accueil .lien-categorie,
.accueil .lien-categorie:hover {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(var(--c), var(--c)) no-repeat 0 100% / 0 3px;
  transition: background-size 0.35s;
}
.accueil .lien-categorie:hover {
  background-size: 100% 3px;
}
.rayon-nb {
  padding: 3px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c, var(--mg-violet)) 13%, #fff);
  color: color-mix(in srgb, var(--c, var(--mg-violet)) 80%, #000);
  font-size: 13px;
  font-weight: 700;
}
.rayon-tout,
.rayon-effacer {
  margin-left: auto;
  color: var(--mg-doux);
  font-size: 14px;
  font-weight: 600;
}
.rayon-tout:hover {
  color: var(--c);
  text-decoration: none;
}
.rayon-tout span {
  display: inline-block;
  transition: transform 0.3s var(--mg-ressort);
}
.rayon-tout:hover span {
  transform: translateX(5px);
}
.accueil .rayon-effacer {
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.accueil .rayon-effacer:hover {
  background: rgba(23, 20, 46, 0.06);
  color: var(--mg-encre);
}
/* « Tout afficher » puis « Effacer », côte à côte à droite */
.rayon-voir-tout + .rayon-effacer {
  margin-left: 0;
}
.rayon-voir-tout[hidden] + .rayon-effacer {
  margin-left: auto;
}

.grille-jeux {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: clamp(14px, 1.8vw, 24px);
}

/* Vue « Favoris » : les rayons sont fondus en une seule grille alphabétique */
.mode-favoris .rayons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: clamp(14px, 1.8vw, 24px);
  margin-bottom: 48px;
}
.mode-favoris .rayons .rayon:not([hidden]),
.mode-favoris .rayons .grille-jeux {
  display: contents;
}
.mode-favoris .rayons .rayon-tete {
  display: none;
}
.mode-favoris .rayons .jeu {
  order: var(--ordre, 0);
}
.tete-favoris {
  --c: var(--mg-rose);
}
.tete-favoris[hidden] {
  display: none;
}
.tete-favoris .rayon-icone-svg {
  color: var(--mg-rose);
}
.tete-nouveaux .rayon-icone-svg {
  color: #f59e0b;
}
.accueil .tete-favoris h2 {
  margin: 0;
  color: var(--mg-encre);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ===============================
   Carte d'un jeu
   =============================== */
.jeu {
  position: relative;
  border-radius: 22px;
  background: var(--mg-carte);
  box-shadow: var(--mg-ombre);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition:
    transform 0.45s var(--mg-ressort),
    box-shadow 0.35s,
    opacity 0.5s,
    translate 0.6s var(--mg-ressort);
}
.jeu[hidden] {
  display: none;
}
.jeu:hover,
.jeu:focus-within {
  --ty: -6px;
  box-shadow:
    0 2px 6px rgba(23, 20, 46, 0.06),
    0 26px 46px -22px color-mix(in srgb, var(--c) 75%, transparent);
}
/* Pendant l'inclinaison (js/accueil.js) : suivi immédiat de la souris */
.jeu.incline {
  transition:
    transform 0.12s linear,
    box-shadow 0.35s;
}
/* Apparition au défilement */
.jeu.a-reveler {
  opacity: 0;
  translate: 0 28px;
}
.jeu.a-reveler.vu {
  opacity: 1;
  translate: 0 0;
  transition-delay: 0s, 0s, var(--d, 0s), var(--d, 0s);
}
/* Réapparition après un filtrage */
.jeu.entre {
  animation: mg-entre 0.5s var(--mg-ressort) both;
  animation-delay: var(--d, 0s);
}
@keyframes mg-entre {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(14px);
  }
}

.jeu-lien {
  display: block;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}
.jeu-lien:hover {
  color: inherit;
  text-decoration: none;
}
.jeu-lien:focus-visible {
  outline: 3px solid var(--c);
  outline-offset: 3px;
}
.jeu-visuel {
  position: relative;
  display: block;
  margin: 8px 8px 0;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  isolation: isolate;
}
.jeu-visuel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.jeu:hover .jeu-visuel img {
  transform: scale(1.08);
}
.jeu-jouer {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding-left: 2px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  color: var(--c);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
  transition:
    opacity 0.25s,
    transform 0.45s var(--mg-ressort);
}
.jeu:hover .jeu-jouer,
.jeu-lien:focus-visible .jeu-jouer {
  opacity: 1;
  transform: none;
}
/* « ? » qui ouvre la description du jeu (js/fiche-jeu.js) */
.jeu-aide {
  padding-left: 0;
  font: 800 22px/1 var(--mg-police);
  cursor: help;
}
.jeu-aide:hover {
  background: var(--c);
  color: #fff;
}
/* Écrans tactiles (sans survol) : le « ? » est toujours visible */
@media (hover: none) {
  .jeu-aide {
    opacity: 1;
    transform: none;
  }
}
/* Reflet qui suit la souris */
.jeu-reflet {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.45), transparent 50%);
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.jeu.incline .jeu-reflet {
  opacity: 1;
}
.jeu-infos {
  display: block;
  padding: 12px 52px 15px 16px;
}
.accueil .jeu-titre {
  margin: 0 0 3px;
  color: var(--mg-encre);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.jeu:hover .jeu-titre {
  color: color-mix(in srgb, var(--c) 85%, #000);
}
.jeu-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mg-doux);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.jeu-cat::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}
.jeu-badge {
  position: absolute;
  top: 17px;
  left: 17px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: auto;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45);
}
.jeu-badge-nouveau {
  background: var(--mg-degrade);
  background-size: 200% 100%;
  color: #fff;
  animation: mg-glisse 3s linear infinite;
}
.jeu-badge-maj {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--mg-encre);
}
.jeu-badge-maj::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}
/* Rangée « Reprendre » : croix pour retirer un jeu, à gauche du cœur */
.accueil .jeu-retirer {
  position: absolute;
  right: 48px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c3c1d6;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.25s var(--mg-ressort);
}
.jeu-retirer svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.accueil .jeu-retirer:hover {
  background: rgba(23, 20, 46, 0.07);
  color: var(--mg-texte);
  transform: scale(1.1);
}
.accueil .jeu-retirer:focus-visible {
  outline: 3px solid var(--mg-violet);
  outline-offset: 1px;
}
/* Place de la croix sous le titre (en plus de celle du cœur) */
.grille-reprendre .jeu-infos {
  padding-right: 90px;
}
/* Favori */
.accueil .jeu-fav {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c3c1d6;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.25s var(--mg-ressort);
}
.jeu-fav svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  overflow: visible;
  transition: fill 0.2s;
}
.accueil .jeu-fav:hover {
  background: rgba(255, 79, 154, 0.1);
  color: var(--mg-rose);
  transform: scale(1.1);
}
.accueil .jeu-fav:focus-visible {
  outline: 3px solid var(--mg-rose);
  outline-offset: 1px;
}
.accueil .jeu-fav[aria-pressed="true"] {
  color: var(--mg-rose);
}
.jeu-fav[aria-pressed="true"] svg {
  fill: currentColor;
}
.jeu-fav.pop svg {
  animation: mg-battement 0.55s var(--mg-ressort);
}
.jeu-fav.pop::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid var(--mg-rose);
  animation: mg-onde 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes mg-battement {
  30% {
    transform: scale(1.45);
  }
  60% {
    transform: scale(0.9);
  }
}
@keyframes mg-onde {
  from {
    transform: scale(0.6);
    opacity: 1;
  }
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

/* Fiche de description complète, au survol d'une carte (js/fiche-jeu.js ; base dans games.css) */
.fiche-jeu {
  width: 340px;
  padding: 16px 18px 14px;
  border: 0;
  border-radius: 18px;
  border-top: 4px solid var(--c, var(--mg-violet));
  box-shadow: var(--mg-ombre-forte);
  color: var(--mg-texte);
  font-family: var(--mg-police);
}
.fiche-jeu * {
  font-family: var(--mg-police);
}
.fiche-jeu.droite::before,
.fiche-jeu.gauche::before {
  border: 0;
  box-shadow: -2px 2px 4px rgba(23, 20, 46, 0.06);
}
.fiche-jeu.gauche::before {
  box-shadow: 2px -2px 4px rgba(23, 20, 46, 0.06);
}
.fiche-cat {
  padding: 2px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c, var(--mg-violet)) 14%, #fff);
  color: color-mix(in srgb, var(--c, var(--mg-violet)) 80%, #000);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.fiche-titre {
  margin: 8px 0 6px;
  font-family: var(--mg-police);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mg-encre);
}
.fiche-desc {
  color: var(--mg-texte);
  font-size: 14.5px;
  line-height: 1.55;
}
.fiche-jouer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--mg-bord);
  color: var(--c, var(--mg-violet));
  font-size: 13px;
  font-weight: 700;
}

/* Aucun résultat */
.mg-vide {
  padding: 60px 20px 80px;
  text-align: center;
}
.mg-vide[hidden] {
  display: none;
}
.mg-vide-titre {
  margin: 0 0 6px;
  color: var(--mg-encre);
  font-size: 24px;
  font-weight: 800;
}
.mg-vide-texte {
  margin: 0 0 22px;
  color: var(--mg-doux);
}
.mg-vide::before {
  content: "🕹️";
  display: block;
  margin-bottom: 12px;
  font-size: 56px;
  animation: mg-flotte 3s ease-in-out infinite;
}

/* ===============================
   Roulette du « jeu au hasard »
   =============================== */
.roulette {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 20, 46, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: mg-fondu 0.25s ease both;
}
.roulette[hidden] {
  display: none;
}
@keyframes mg-fondu {
  from {
    opacity: 0;
  }
}
.roulette-boite {
  width: min(380px, 100%);
  padding: 22px 22px 24px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--mg-ombre-forte);
  text-align: center;
  animation: mg-entre 0.45s var(--mg-ressort) both;
}
.roulette-sur {
  margin: 0 0 14px;
  color: var(--mg-doux);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.roulette-visuel {
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  background: var(--mg-fond);
}
.roulette-visuel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roulette.tourne .roulette-visuel img {
  filter: blur(1.5px) saturate(1.2);
}
.roulette-titre {
  min-height: 1.2em;
  margin: 16px 0 0;
  color: var(--mg-encre);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.roulette.fini .roulette-boite {
  animation: mg-tada 0.6s var(--mg-ressort);
}
.roulette.fini .roulette-titre {
  background: var(--mg-degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes mg-tada {
  40% {
    transform: scale(1.06) rotate(-1.5deg);
  }
  70% {
    transform: scale(0.98) rotate(1deg);
  }
}

/* ===============================
   Page des nouveautés (frise)
   =============================== */
.news-liste {
  position: relative;
  max-width: 820px;
  margin: 0 auto 40px;
  padding-left: 40px;
  color: var(--mg-texte);
}
/* Fil de la frise */
.news-liste::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--mg-rose), var(--mg-violet) 40%, rgba(124, 92, 255, 0.1));
}
.news-bloc {
  position: relative;
  margin-bottom: 22px;
  padding: 20px 24px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--mg-ombre);
  transition:
    opacity 0.6s,
    translate 0.6s var(--mg-ressort),
    box-shadow 0.3s;
}
.news-bloc:hover {
  box-shadow: var(--mg-ombre-forte);
}
.news-bloc.a-reveler {
  opacity: 0;
  translate: 0 26px;
}
.news-bloc.a-reveler.vu {
  opacity: 1;
  translate: 0 0;
}
/* Jalon sur le fil */
.news-bloc::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 24px;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--mg-violet);
}
.news-recent::before {
  background: var(--mg-rose);
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--mg-rose);
  animation: mg-pulse-rose 2.2s ease-out infinite;
}
@keyframes mg-pulse-rose {
  0% {
    box-shadow:
      0 0 0 3px var(--mg-rose),
      0 0 0 3px rgba(255, 79, 154, 0.5);
  }
  100% {
    box-shadow:
      0 0 0 3px var(--mg-rose),
      0 0 0 14px rgba(255, 79, 154, 0);
  }
}
.news-date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--mg-encre);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.news-dernier {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--mg-degrade);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.news-bloc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.news-bloc p {
  margin: 4px 0;
  line-height: 1.5;
}
.news-bloc li.news-titre {
  margin: 12px 0 6px;
  color: var(--mg-doux);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.news-bloc li.news-titre:first-child {
  margin-top: 4px;
}
.news-bloc li.news-sous {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 4px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--mg-fond);
  line-height: 1.4;
  transition:
    transform 0.25s var(--mg-ressort),
    background-color 0.2s;
}
.news-bloc li.news-sous:hover {
  transform: translateX(4px);
  background: #ecebf7;
}
.news-bloc li.news-simple {
  position: relative;
  margin: 6px 0;
  padding-left: 18px;
  line-height: 1.45;
}
.news-bloc li.news-simple::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mg-degrade);
}
.news-bloc li.news-simple:first-letter {
  text-transform: uppercase;
}
.news-bloc strong {
  color: var(--mg-encre);
  font-weight: 700;
}
.news-jeu {
  color: inherit;
}
.news-jeu:hover {
  color: var(--mg-violet);
}
.news-italique {
  color: var(--mg-doux);
  font-style: italic;
  font-weight: normal;
}
.news-cat {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c, var(--mg-violet)) 14%, #fff);
  color: color-mix(in srgb, var(--c, var(--mg-violet)) 80%, #000);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.news-cat:hover {
  background: var(--c, var(--mg-violet));
  color: #fff;
  text-decoration: none;
}
.news-vide {
  text-align: center;
  color: var(--mg-doux);
}

/* ===============================
   Écrans moyens et petits
   =============================== */
/* Titres des catégories remplacés par leur icône (gardés pour les lecteurs d'écran) */
@media (max-width: 1540px) {
  .mg-filtres .filtre:not(.filtre-tous) .filtre-titre {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .mg-filtres .filtre {
    padding-right: 8px;
  }
}
@media (max-width: 1120px) {
  .mg-recherche {
    width: 170px;
  }
  .mg-recherche:focus-within {
    width: 240px;
  }
}

/* Deux lignes : logo, recherche, nouveautés / catégories */
@media (max-width: 1100px) {
  :root {
    --header-height: 114px;
  }
  .mg-header {
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 10px;
  }
  .mg-outils {
    display: contents;
  }
  .mg-header .logo {
    order: 1;
  }
  .mg-recherche,
  .mg-recherche:focus-within {
    order: 2;
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .menu-news {
    order: 3;
  }
  .mg-filtres {
    order: 4;
    flex: 0 0 100%;
    box-sizing: border-box;
    /* fondu au bord droit : on devine qu'il y a d'autres catégories à faire défiler */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    padding-right: 28px;
  }
  .mg-filtres .filtre,
  .mg-recherche {
    height: 40px;
  }
  /* Rangée pleine largeur : les noms des catégories tiennent de nouveau */
  .mg-filtres .filtre:not(.filtre-tous) .filtre-titre {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}
@media (max-width: 700px) {
  .mg-filtres .filtre:not(.filtre-tous) .filtre-titre {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .vitrine {
    transform: none;
    max-width: 620px;
    width: 100%;
    margin: 6px auto 0;
  }
  .hero-cat {
    flex-wrap: wrap;
  }
  .hero-cat .btn-hasard {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .mg-header {
    gap: 10px;
  }
  .mg-header .logo {
    font-size: 23px;
  }
  .mg-header .logo-icone svg {
    width: 26px;
    height: 26px;
  }
  .menu-news {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .mg-filtres {
    gap: 5px;
  }
  .mg-recherche kbd {
    display: none;
  }
  .hero-stats strong {
    font-size: 26px;
  }
  .hero-actions > * {
    flex: 1;
    padding: 0 14px;
    font-size: 15px;
  }
  .vitrine-points {
    top: 14px;
    bottom: auto;
  }
  .vitrine-legende {
    right: 18px;
  }
  .grille-jeux,
  .mode-favoris .rayons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .jeu {
    border-radius: 18px;
  }
  .jeu-visuel {
    margin: 6px 6px 0;
    border-radius: 13px;
  }
  .jeu-infos {
    padding: 10px 40px 12px 12px;
  }
  .accueil .jeu-titre {
    font-size: 14.5px;
  }
  .jeu-cat {
    font-size: 10.5px;
  }
  .accueil .jeu-fav {
    right: 4px;
    bottom: 8px;
  }
  .accueil .jeu-retirer {
    right: 38px;
    bottom: 8px;
  }
  .grille-reprendre .jeu-infos {
    padding-right: 74px;
  }
  .jeu-badge {
    top: 12px;
    left: 12px;
    font-size: 9.5px;
    padding: 3px 8px;
  }
  .rayon-tout {
    display: none;
  }
  .news-liste {
    padding-left: 28px;
  }
  .news-liste::before {
    left: 7px;
  }
  .news-bloc {
    padding: 16px 16px 14px;
  }
  .news-bloc::before {
    left: -28px;
  }
}

@media (max-width: 440px) {
  .mg-header .logo-texte {
    display: none;
  }
}

/* Moins d'animations pour qui le demande (habillage seulement : les jeux gèrent les leurs) */
@media (prefers-reduced-motion: reduce) {
  .mg-header *,
  .mg-header::after,
  .mg-fond span,
  .accueil *,
  .accueil *::before,
  .accueil *::after,
  .hero *,
  .news-liste *,
  .news-liste *::before,
  .roulette,
  .roulette *,
  body h1.titre-page {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .jeu.a-reveler,
  .news-bloc.a-reveler {
    opacity: 1;
    translate: none;
  }
}

/* ===============================
   Compatibilité : règles d'origine dont certains jeux dépendent encore
   (drapeaux : <nav> ; jeu de la vie, pac-man, tycoon : <main>)
   =============================== */
nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 18px;
  align-items: center;
  justify-content: end;
  max-width: 100%;
}
nav > a {
  display: block;
  position: relative;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
nav ul li {
  display: inline-block;
  margin: 0 10px;
}
nav ul li a {
  text-decoration: none;
  color: #bfc5cc;
  font-size: 14px;
  font-weight: normal;
}
nav ul li a:hover {
  color: #ffffff;
}
main {
  padding: calc(var(--header-height) + 24px) 40px 60px 40px;
}

@media print {
  .mg-header,
  .mg-footer,
  .mg-fond {
    display: none;
  }
  body {
    padding-top: 0;
  }
}
