/* =========================================================
   ARENA UI — GAMES GRID COMPONENT
   Estratto da arena-ui.css e ottimizzato
   Mobile-first • Zero modifiche estetiche
========================================================= */


/* ---------------------------------------------------------
   1) BASE GRID (mobile-first)
--------------------------------------------------------- */

.ar-game-grid {
  max-width: 1100px;
  margin: 0 auto;

  padding: 0 16px 64px;

  display: grid;
  gap: 18px;

  grid-template-columns: 1fr; /* mobile */
}


/* ---------------------------------------------------------
   2) TABLET GRID (= 640px)
--------------------------------------------------------- */

@media (min-width: 640px) {
  .ar-game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ---------------------------------------------------------
   3) DESKTOP GRID (= 1024px)
--------------------------------------------------------- */

@media (min-width: 1024px) {
  .ar-game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   HOME — GAMES SECTION WRAPPER (Arena UI v17)
   Serve solo a rimuovere Tailwind dal wrapper di #giochi
========================================================= */

.ar-games-section{
  position: relative;
  overflow: hidden;

  /* equivalente del bg-slate-950/70 */
  background: rgba(2,6,23,0.70);

  /* in home hai anche un override inline che mette z-index:25 su #giochi */
  z-index: 25;

  /* niente bordo: in home c'è già un override che lo rimuove */
  border-top: none;
}

/* equivalente di: mx-auto max-w-6xl px-4 pt-16 */
.ar-games-head{
  padding-top: 64px;
}

/* equivalente di: mb-8 max-w-2xl */
.ar-games-intro{
  max-width: 42rem; /* ~ max-w-2xl */
  margin-bottom: 32px; /* ~ mb-8 */
}

/* =========================================================
   COMPONENT — GAME CAROUSEL (ex inline in game_carousel.html)
   Obiettivo: zero CSS inline/scope, tutto in Arena UI v17
========================================================= */

.games-shell{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

.games-carousel{
  position: relative;
  overflow: hidden;
}

.games-track{
  display: flex;
  gap: 16px;
  will-change: transform;
  transition: transform .4s cubic-bezier(.33, .69, .24, 1);
  padding-block: 32px;
}

/* Base: mobile, 1 card per volta */
.game-card{
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  border: 1px solid rgba(148,163,184,.22);
  background:
    radial-gradient(circle at 0 0, rgba(34,211,238,.16), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(79,70,229,.22), transparent 55%),
    rgba(2,6,23,.95);

  min-height: 340px;
  flex: 0 0 100%;

  /* ? fondamentale: i wrapper interni ora riempiono la min-height */
  display: flex;
  align-items: stretch;

  box-shadow: none !important;
  opacity: 1;
  transition: opacity .35s ease, border-color .35s ease;
}

/* Tablet */
@media (min-width: 768px){
  .game-card{
    flex: 0 0 calc((100% - 16px) / 2);
    min-height: 380px;
  }
}

/* Desktop — 3 card, centrale più grande, laterali più piccole */
@media (min-width: 1200px){
  .game-card{
    flex: 0 0 calc((100% - 32px) / 3);
    min-height: 420px;
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
  }
  .game-card:not(.is-center){
    opacity: 0.6;
    transform: scale(0.8);
    outline: none;
  }
  .game-card.is-center{
    opacity: 1;
    transform: scale(1.05);
    outline: 3px solid rgba(34,211,238,0.8);
    outline-offset: 0;
    border-color: rgba(34,211,238,0.7);
    z-index: 2;
  }
}

.game-card::before{
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 20% 0, rgba(56,189,248,.35), transparent 55%);
  opacity: .25;
  mix-blend-mode: screen;
}
  /* Tilt wrapper: la card esterna resta scalabile (is-center), tilt vive qui */
.game-tilt{
  position: relative;

  /* ? riempie la card (che ora è flex) */
  flex: 1 1 auto;
  min-height: inherit;

  border-radius: inherit;
  overflow: hidden;
}

/* FX wrapper: qui possiamo fare reveal senza toccare la scale della card */
.game-fx{
  position: relative;
  width: 100%;
  height: 100%;
}

.game-card:hover .game-bg{
  transform: scale(1.04);
  filter: brightness(1.12) saturate(1.18);
}

.game-card::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 160% at 50% 120%, rgba(2,6,23,.9), transparent 60%);
  pointer-events: none;
}

.game-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: .96;

  transform: scale(1.1);
  filter: brightness(1.02) saturate(1.08);
  transition: transform .9s ease, opacity .9s ease, filter .9s ease;
}

.game-overlay{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(2,6,23,.05) 0%,
      rgba(2,6,23,.55) 45%,
      rgba(2,6,23,.97) 100%);
  mix-blend-mode: multiply;
}


.game-content{
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.game-meta-badges{
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: 10px;
}

.game-title{
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #e5e7eb;
  margin: 0;
}

.game-desc{
  margin-top: .35rem;
  font-size: .82rem;
  color: #cbd5e1;
}

.game-footer{
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}
.game-footer .game-meta-badges .ar-game-badge{
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(14rem, 56vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-footer .btn{
  flex: 0 0 auto;
}
.game-footer .game-meta-badges .ar-game-badge{
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(14rem, 56vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* ? badge lunghi non spingono il bottone */
}
.games-cta-wrap{
  margin-top: 32px;
  display:flex;
  justify-content:center;
}
