/* PixelRealm — deux carrousels latéraux et sélection fixe */

#prgFeaturedGrid.prg-restored-layout {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: start !important;
}

.prg-restored-panel {
  min-width: 0;
  padding: 15px 14px 12px;
  background: #101a2b;
  border: 1px solid #283750;
  border-radius: 14px;
}

.prg-restored-panel h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #f4efff;
}

.prg-restored-viewport {
  width: 100%;
  overflow: hidden;
}

.prg-restored-track {
  display: flex;
  transition: transform 1100ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}

.prg-restored-slide {
  display: grid;
  flex: 0 0 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prg-restored-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #17243a;
  border: 1px solid #30415f;
  border-radius: 10px;
  transition: border-color .2s, transform .2s;
}

.prg-restored-card:hover {
  border-color: #aa84f4;
  transform: translateY(-2px);
}

.prg-restored-picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #101827;
}

.prg-restored-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}

.prg-restored-card-title {
  display: block;
  padding: 7px 6px;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prg-restored-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.prg-restored-arrow {
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform .2s, filter .2s;
}

.prg-restored-arrow:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.prg-restored-crystal {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 5px rgba(183,124,255,.5));
}

.prg-restored-progress {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 100px;
  background: #302747;
}

.prg-restored-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7546c7, #d2a5ff);
  box-shadow: 0 0 8px #a777ff;
  transition: width 900ms ease;
}

@media (max-width: 1050px) {
  #prgFeaturedGrid.prg-restored-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .prg-restored-center {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  #prgFeaturedGrid.prg-restored-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .prg-restored-center {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prg-restored-track,
  .prg-restored-progress-fill,
  .prg-restored-card {
    transition: none !important;
  }
}

/* Sélection centrale : quatre cartes équilibrées */
#prgFeaturedGrid .prg-restored-center .prg-restored-slide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-editor-pick {
  grid-column: auto;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-picture,
#prgFeaturedGrid .prg-restored-center
.prg-restored-editor-pick .prg-restored-picture {
  aspect-ratio: 16 / 10;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-card {
  min-width: 0;
  height: auto;
}

/* Conserver la géométrie des carrousels */
#prgFeaturedGrid .prg-restored-viewport {
  overflow: hidden;
}

#prgFeaturedGrid .prg-restored-track {
  display: flex;
  width: 100%;
}

#prgFeaturedGrid .prg-restored-track > .prg-restored-slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Alignement des panneaux */
#prgFeaturedGrid.prg-restored-layout {
  align-items: stretch !important;
}

#prgFeaturedGrid .prg-restored-panel {
  display: flex;
  flex-direction: column;
}

#prgFeaturedGrid .prg-restored-navigation {
  margin-top: auto;
  padding-top: 12px;
}

@media (max-width: 600px) {
  #prgFeaturedGrid .prg-restored-center .prg-restored-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



/* PIXELREALM FEATURED FINAL ALIGNMENT */

/* Les trois panneaux gardent une géométrie cohérente. */
#prgFeaturedGrid.prg-restored-layout {
  align-items: stretch !important;
}

#prgFeaturedGrid .prg-restored-panel {
  min-width: 0;
  overflow: hidden;
}

/* Le carrousel ne doit jamais exposer ses pages voisines. */
#prgFeaturedGrid .prg-restored-viewport {
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 round 9px);
}

#prgFeaturedGrid .prg-restored-track {
  display: flex;
  width: 100%;
}

#prgFeaturedGrid .prg-restored-track > .prg-restored-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Quatre jeux centraux compacts, en grille 2 x 2. */
#prgFeaturedGrid .prg-restored-center .prg-restored-slide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: 12px;
  flex: none;
  width: 100%;
  align-content: start;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-card,
#prgFeaturedGrid .prg-restored-center .prg-restored-editor-pick {
  display: block;
  grid-column: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  align-self: start;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-picture,
#prgFeaturedGrid .prg-restored-center
.prg-restored-editor-pick .prg-restored-picture {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#prgFeaturedGrid .prg-restored-center .prg-restored-card-title {
  padding: 6px;
  line-height: 1.25;
}

/* Conserver les commandes en bas des panneaux latéraux. */
#prgFeaturedGrid .prg-restored-navigation {
  margin-top: auto;
  padding-top: 12px;
}


/* ========================================================
   PixelRealm Games — finition des trois colonnes
   ======================================================== */

/* Empêcher les carrousels de déborder sur les côtés */
#prgFeaturedGrid.prg-restored-layout {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
}

#prgFeaturedGrid .prg-restored-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#prgFeaturedGrid .prg-restored-viewport {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: 9px;
}

#prgFeaturedGrid .prg-restored-track {
    width: 100% !important;
    min-width: 0 !important;
}

#prgFeaturedGrid .prg-restored-track > .prg-restored-slide {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#prgFeaturedGrid .prg-restored-slide {
    min-width: 0 !important;
}

#prgFeaturedGrid .prg-restored-card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Quatre jeux centraux : grille équilibrée 2 x 2 */
#prgFeaturedGrid .prg-restored-center > .prg-restored-slide {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px !important;
    width: 100% !important;
}

/* Annuler l'ancien agrandissement asymétrique */
#prgFeaturedGrid .prg-restored-center
.prg-restored-editor-pick {
    grid-column: auto !important;
    grid-row: auto !important;
}

/* Même format pour les quatre illustrations */
#prgFeaturedGrid .prg-restored-center
.prg-restored-card .prg-restored-picture,
#prgFeaturedGrid .prg-restored-center
.prg-restored-editor-pick .prg-restored-picture {
    width: 100% !important;
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
}

#prgFeaturedGrid .prg-restored-center
.prg-restored-card .prg-restored-picture img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Titres cohérents, sans allonger les cartes */
#prgFeaturedGrid .prg-restored-center
.prg-restored-card-title {
    padding: 8px 6px !important;
    line-height: 1.35 !important;
    min-height: 30px;
    box-sizing: border-box;
}

/* Les commandes latérales restent visibles */
#prgFeaturedGrid .prg-restored-navigation {
    width: 100%;
    box-sizing: border-box;
}

#prgFeaturedGrid .prg-restored-progress {
    min-width: 0;
}

/* Tablettes */
@media (min-width: 601px) and (max-width: 1050px) {
    #prgFeaturedGrid.prg-restored-layout {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    #prgFeaturedGrid .prg-restored-center {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }
}

/* Mobiles */
@media (max-width: 600px) {
    #prgFeaturedGrid.prg-restored-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #prgFeaturedGrid .prg-restored-center {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}
