/*!
 * YLP - torneo "migliori carte" (inc/gioco.css)
 * Pagina /vota-{slug} (vota_pokemon.php + inc/gioco.js). Mobile prima di tutto.
 */

/* ---------------------------------------------------------------------------
   Pagina a tutto schermo (niente testata e piè di pagina del sito)
   ------------------------------------------------------------------------- */
html, body.gx-pagina { height: 100%; }
body.gx-pagina {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #163577;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.gx-app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Barra in alto: logo (home), titolo, suoni, uscita */
.gx-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
  color: #fff;
  pointer-events: none;
}
.gx-top > * { pointer-events: auto; }
.gx-logo {
  flex: 0 0 auto;
  display: block;
  padding: 3px 8px;
  border-radius: 12px;
  background: #fff;
  line-height: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.gx-logo img { width: 56px; height: auto; }
.gx-top-titolo {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.gx-audio, .gx-esci {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.gx-esci { font-size: 22px; font-weight: 700; }
.gx-esci:hover { color: #fff; background: rgba(255, 255, 255, .32); }
.gx-audio:active, .gx-esci:active { transform: scale(.92); }
.gx-audio:focus-visible, .gx-esci:focus-visible, .gx-logo:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Area di gioco: riempie lo schermo, il colore cambia a ogni turno */
.gx {
  --gx-a: #4f8ff0;
  --gx-b: #1a3c8a;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color: #fff;
  background: radial-gradient(circle at 50% -10%, var(--gx-a), var(--gx-b) 72%) fixed;
  transition: background .6s ease;
}
.gx[data-turno="1"] { --gx-a: #4f8ff0; --gx-b: #163577; }
.gx[data-turno="2"] { --gx-a: #a46cf5; --gx-b: #3a1677; }
.gx[data-turno="3"] { --gx-a: #ff8a4c; --gx-b: #9b1f10; }
.gx[data-turno="4"] { --gx-a: #ffd23f; --gx-b: #8a3b00; }
.gx[data-turno="5"] { --gx-a: #ffe27a; --gx-b: #b04a00; }

/* Puntini a stelle che scorrono piano sullo sfondo (fissi: non allungano lo scorrimento) */
.gx::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .22) 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, .12) 1px, transparent 1.5px);
  background-size: 46px 46px, 23px 23px;
  background-position: 0 0, 11px 11px;
  animation: gx-cielo 40s linear infinite;
  pointer-events: none;
}
@keyframes gx-cielo { to { background-position: 46px 92px, 57px 103px; } }

.gx-palco {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------------------------------------------------------------------------
   Pulsanti
   ------------------------------------------------------------------------- */
.gx-btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 14px 30px;
  background: #ffcb05;
  color: #1b2440;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 5px 0 #c99a00, 0 8px 18px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.gx-btn:hover { color: #1b2440; transform: translateY(-1px); }
.gx-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c99a00, 0 3px 8px rgba(0, 0, 0, .25); }
.gx-btn:disabled { opacity: .6; cursor: wait; }
.gx-btn:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.gx-btn-chiaro { background: #fff; box-shadow: 0 5px 0 #c6cfe0, 0 8px 18px rgba(0, 0, 0, .2); }
.gx-btn-chiaro:active { box-shadow: 0 1px 0 #c6cfe0; }

/* ---------------------------------------------------------------------------
   Introduzione
   ------------------------------------------------------------------------- */
.gx-schermo {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 18px 28px;
}
.gx-h1 {
  margin: 6px 0 4px;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -.5px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.gx-sub { margin: 0 0 14px; font-size: 1.08rem; opacity: .95; }
.gx-emoji { font-size: 64px; margin: 0; }

.gx-ventaglio {
  position: relative;
  width: 260px;
  height: 160px;
  margin: 4px auto 8px;
}
.gx-ventaglio img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92px;
  height: auto;
  margin-left: -46px;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  transform-origin: 50% 120%;
  transform: rotate(calc((var(--i) - 2) * 14deg));
  animation: gx-distribuisci .7s cubic-bezier(.2, 1.3, .4, 1) both;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes gx-distribuisci {
  from { transform: translateY(80px) rotate(0deg) scale(.6); opacity: 0; }
}

.gx-regole {
  list-style: none;
  margin: 4px 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.gx-regole li {
  background: rgba(255, 255, 255, .16);
  border-radius: 14px;
  padding: 9px 14px;
  font-weight: 600;
}
.gx-regole li span { display: inline-block; width: 1.6em; }
.gx-btn-start { font-size: 1.35rem; padding: 16px 44px; animation: gx-respira 1.8s ease-in-out infinite; }
@keyframes gx-respira { 50% { transform: scale(1.06); } }
.gx-ricomincia {
  margin-top: 14px;
  background: none;
  border: 0;
  color: #fff;
  text-decoration: underline;
  opacity: .85;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Turni e sfide (in alto)
   ------------------------------------------------------------------------- */
.gx-testa { padding: 14px 10px 0; text-align: center; }
.gx-turni {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
}
.gx-turni li {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  font-size: .8rem;
  font-weight: 700;
  opacity: .75;
}
.gx-turni li.fatto { background: rgba(255, 255, 255, .3); opacity: 1; }
.gx-turni li.ora { background: #fff; color: #1b2440; opacity: 1; transform: scale(1.08); }

.gx-pallini { display: flex; justify-content: center; gap: 7px; min-height: 12px; }
.gx-pallini span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  transition: all .3s;
}
.gx-pallini span.fatto { background: #ffcb05; }
.gx-pallini span.ora { background: #fff; transform: scale(1.4); box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); }
.gx-pallini-finale { font-weight: 800; font-size: .95rem; letter-spacing: .5px; text-transform: uppercase; }

/* ---------------------------------------------------------------------------
   Duello
   ------------------------------------------------------------------------- */
.gx-duello {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 8px 4px;
}

.gx-carta {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  perspective: 800px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .45s cubic-bezier(.2, 1.4, .4, 1), opacity .45s ease, filter .45s ease;
}
.gx-sx { animation: gx-entra-sx .5s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.gx-dx { animation: gx-entra-dx .5s cubic-bezier(.2, 1.2, .4, 1) backwards; }
@keyframes gx-entra-sx { from { transform: translateX(-60%) rotate(-12deg); opacity: 0; } }
@keyframes gx-entra-dx { from { transform: translateX(60%) rotate(12deg); opacity: 0; } }

.gx-carta-img {
  position: relative;
  display: block;
  width: min(100%, 340px, 44vh);
  width: min(100%, 340px, 44dvh);
  aspect-ratio: 500 / 698;
  border-radius: 4.5% / 3.3%;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .15s ease-out, box-shadow .3s ease;
  animation: gx-galleggia 3.2s ease-in-out infinite;
}
.gx-dx .gx-carta-img { animation-delay: -1.6s; }
@keyframes gx-galleggia { 50% { translate: 0 -6px; } }

.gx-carta-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
/* Riflesso che segue il puntatore (solo mouse) */
.gx-luce {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.gx-carta:hover .gx-luce { opacity: 1; }
.gx-carta:hover .gx-carta-img { box-shadow: 0 0 0 3px rgba(255, 255, 255, .7), 0 16px 30px rgba(0, 0, 0, .4); }
.gx-carta:focus-visible { outline: none; }
.gx-carta:focus-visible .gx-carta-img { outline: 4px solid #fff; outline-offset: 4px; }

.gx-pollice {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: clamp(44px, 14vw, 84px);
  line-height: 1;
  transform: translate(-50%, -50%) scale(0);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35));
  pointer-events: none;
}

.gx-carta-nome {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  margin-top: 10px;
  font-weight: 800;
  font-size: clamp(.9rem, 3.6vw, 1.15rem);
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.gx-carta-info { font-size: .78rem; opacity: .8; }

/* Scelta e scartata */
.gx-carta.scelta { transform: scale(1.06) translateY(-6px); z-index: 2; }
.gx-carta.scelta .gx-carta-img {
  animation: none;
  box-shadow: 0 0 0 4px #ffe066, 0 0 40px 12px rgba(255, 224, 102, .8);
}
.gx-carta.scelta .gx-pollice { animation: gx-pollice .6s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes gx-pollice {
  60% { transform: translate(-50%, -50%) scale(1.25) rotate(-10deg); }
  to { transform: translate(-50%, -50%) scale(1) rotate(0); }
}
.gx-carta.scartata { transform: scale(.86) rotate(-5deg) translateY(18px); opacity: .45; filter: grayscale(1); }
.gx-dx.scartata { transform: scale(.86) rotate(5deg) translateY(18px); }
.gx-carta:disabled { cursor: default; }

/* VS */
.gx-vs {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffcb05;
  color: #d22b10;
  font-weight: 900;
  font-size: 1.25rem;
  font-style: italic;
  box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(0, 0, 0, .35);
  animation: gx-vs .6s .25s cubic-bezier(.2, 1.8, .4, 1) both, gx-pulsa 1.4s 1s ease-in-out infinite;
  z-index: 1;
}
@keyframes gx-vs { from { transform: scale(0) rotate(-180deg); } }
@keyframes gx-pulsa { 50% { transform: scale(1.1); } }

.gx-istruzione {
  margin: 10px 0 16px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  opacity: .92;
}

/* ---------------------------------------------------------------------------
   Esito della sfida (pannello dal basso con il grafico)
   ------------------------------------------------------------------------- */
.gx-esito {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 4;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 18px;
  border-radius: 22px;
  background: #fff;
  color: #1b2440;
  text-align: center;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .3);
  transform: translateY(130%);
  transition: transform .45s cubic-bezier(.2, 1.25, .4, 1);
}
.gx-esito.su { transform: none; }
.gx-esito-titolo { margin: 0 0 2px; font-size: 1.2rem; font-weight: 800; }
.gx-esito-msg { margin: 0 0 10px; font-size: 1rem; color: #4a5372; min-height: 1.5em; }

.gx-grafico { margin: 0 0 14px; text-align: left; }
.gx-grafico-titolo {
  margin: 0 0 6px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #7a83a3;
}
.gx-riga {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4em;
  align-items: center;
  column-gap: 8px;
  margin-bottom: 8px;
}
.gx-riga-nome {
  grid-column: 1 / -1;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gx-riga-nome small { font-weight: 500; color: #7a83a3; }
.gx-traccia {
  position: relative;
  display: block;
  height: 22px;
  border-radius: 11px;
  background: #edf1f8;
  overflow: hidden;
}
.gx-pieno {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fb3e8, #3d7dca);
  transition: width 1s cubic-bezier(.2, 1, .3, 1);
}
.gx-mia .gx-pieno { background: linear-gradient(90deg, #ffe066, #ff9f1c); }
.gx-perc { font-weight: 900; font-size: 1.05rem; text-align: right; font-variant-numeric: tabular-nums; }
.gx-mia .gx-perc { color: #e07b00; }

/* Barre in attesa della risposta */
.gx-attesa .gx-riga { grid-template-columns: 1fr; }
.gx-attesa .gx-traccia {
  background: linear-gradient(90deg, #edf1f8 25%, #dfe6f3 50%, #edf1f8 75%);
  background-size: 200% 100%;
  animation: gx-carica 1s linear infinite;
}
@keyframes gx-carica { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------
   Annuncio del turno
   ------------------------------------------------------------------------- */
.gx-splash {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: radial-gradient(circle, var(--gx-a), var(--gx-b) 75%);
  text-align: center;
  cursor: pointer;
  transition: opacity .3s;
}
.gx-splash.via { opacity: 0; }
.gx-splash-emoji { font-size: 72px; animation: gx-zoom .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.gx-splash-titolo {
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  animation: gx-zoom .6s .1s cubic-bezier(.2, 1.6, .4, 1) both;
}
.gx-splash-sub { font-size: 1.2rem; font-weight: 700; opacity: .9; animation: gx-sale .5s .35s ease both; }
@keyframes gx-zoom { from { transform: scale(0) rotate(-8deg); opacity: 0; } }
@keyframes gx-sale { from { transform: translateY(20px); opacity: 0; } }

/* ---------------------------------------------------------------------------
   Campione
   ------------------------------------------------------------------------- */
.gx-campione { position: relative; padding-top: 18px; }
.gx-raggi {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 640px;
  height: 640px;
  margin-left: -320px;
  z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, .16) 0 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  animation: gx-gira 24s linear infinite;
  pointer-events: none;
}
@keyframes gx-gira { to { transform: rotate(360deg); } }

.gx-campione-sopra {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
  animation: gx-sale .5s ease both;
}
.gx-campione-carta {
  position: relative;
  display: block;
  width: min(250px, 62vw);
  aspect-ratio: 500 / 698;
  border-radius: 4.5% / 3.3%;
  overflow: hidden;
  box-shadow: 0 0 0 5px #ffe066, 0 0 50px 16px rgba(255, 224, 102, .7), 0 18px 40px rgba(0, 0, 0, .4);
  animation: gx-arriva .9s .15s cubic-bezier(.2, 1.3, .4, 1) both;
}
.gx-campione-carta img { display: block; width: 100%; height: 100%; object-fit: contain; }
@keyframes gx-arriva { from { transform: scale(.2) rotate(-200deg); opacity: 0; } }
/* Lampo olografico che attraversa la carta */
.gx-holo {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .65) 48%, rgba(255, 200, 255, .35) 52%, transparent 65%);
  background-size: 250% 100%;
  mix-blend-mode: overlay;
  animation: gx-holo 2.8s 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gx-holo { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.gx-campione .gx-h1 { margin-top: 14px; }
.gx-campione .gx-h1 a { color: inherit; text-decoration: none; }
.gx-campione .gx-sub { margin-bottom: 12px; }

/* Riquadri bianchi della schermata finale (acquisto, condivisione, commento) */
.gx-blocco {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  color: #1b2440;
  text-align: center;
}
.gx-blocco p { margin: 0 0 8px; }
.gx-blocco-titolo { font-weight: 800; font-size: 1.05rem; }
.gx-compra p { font-weight: 700; }
.gx-compra .input-group { justify-content: center; flex-wrap: nowrap; }
.gx-compra .add-cart { font-weight: 800; }
.gx-compra-link { display: inline-block; margin-top: 8px; font-weight: 700; }

.gx-cond-grandi { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 10px; }
.gx-cond-grandi .gx-btn { font-size: 1rem; padding: 11px 20px; }
.gx-condividi .gx-btn-chiaro { background: #eef3fb; box-shadow: 0 4px 0 #c6cfe0; }
.gx-cond-piccoli { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gx-mini {
  display: inline-block;
  border: 2px solid #dfe6f3;
  border-radius: 999px;
  padding: 6px 14px;
  background: #fff;
  color: #1d4f91;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}
.gx-mini:hover { background: #f2f6fd; color: #1d4f91; }

.gx-commento { text-align: left; }
.gx-commento .gx-blocco-titolo { text-align: center; }
.gx-commento textarea, .gx-commento input[type="text"] {
  width: 100%;
  border: 2px solid #dfe6f3;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: #1b2440;
  background: #f8faff;
}
.gx-commento textarea { resize: vertical; min-height: 84px; margin-bottom: 8px; }
.gx-commento textarea:focus, .gx-commento input:focus { outline: none; border-color: #3d7dca; background: #fff; }
.gx-comm-riga { display: flex; gap: 8px; }
.gx-comm-riga input { flex: 1 1 auto; min-width: 0; }
.gx-comm-riga .gx-btn { flex: 0 0 auto; padding: 10px 20px; font-size: 1rem; box-shadow: 0 4px 0 #c99a00; }
.gx-comm-info { margin: 8px 0 0 !important; font-size: .75rem; color: #6b7491; }
.gx-comm-esito { margin: 6px 0 0 !important; font-weight: 700; color: #b03a1c; min-height: 0; }
.gx-comm-esito:empty { display: none; }
.gx-trappola { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.gx-altri { text-align: left; }
.gx-altri .gx-blocco-titolo { text-align: center; }
.gx-altro { margin: 0 0 8px; padding: 8px 12px; border-left: 4px solid #ffcb05; border-radius: 0 10px 10px 0; background: #f6f8fc; }
.gx-altro blockquote { margin: 0; font-size: .95rem; }
.gx-altro figcaption { font-size: .78rem; color: #6b7491; }

.gx-amico-esito { margin: -4px 0 12px; font-weight: 800; }

.gx-podio { width: 100%; max-width: 420px; margin: 4px auto 16px; }
.gx-podio-titolo { margin: 0 0 8px; font-weight: 800; text-transform: uppercase; font-size: .8rem; letter-spacing: .6px; opacity: .9; }
.gx-podio ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}
.gx-podio a { color: #fff; text-decoration: none; display: block; }
.gx-podio img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .3);
}
.gx-podio span {
  display: block;
  margin-top: 5px;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gx-azioni { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------------------------------------------------------------------------
   Effetti
   ------------------------------------------------------------------------- */
.gx-scintilla {
  position: fixed;
  z-index: 10050;
  left: 0;
  top: 0;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  will-change: transform, opacity;
}
.gx-scintilla.gx-punto { width: 10px; height: 10px; border-radius: 50%; }
.gx-anello {
  position: fixed;
  z-index: 10049;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #ffe066;
  border-radius: 50%;
  pointer-events: none;
}
.gx-coriandoli { position: fixed; inset: 0; z-index: 10040; pointer-events: none; }

/* Durante il torneo il carrellino flottante non copre i pulsanti */
body.gx-in-gioco .ylp-fab { display: none !important; }


/* ---------------------------------------------------------------------------
   Torneo Master, modalità veloce, invito dell'amico
   ------------------------------------------------------------------------- */
.gx-master-turno { margin: 0 0 6px; font-weight: 700; font-size: .95rem; }
.gx-master-turno span { background: #fff; color: #1b2440; border-radius: 999px; padding: 2px 10px; font-weight: 800; }
.gx-master-barra {
  width: min(420px, 86%);
  height: 10px;
  margin: 0 auto 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
}
.gx-master-barra span { display: block; height: 100%; border-radius: inherit; background: #ffcb05; transition: width .4s ease; }
.gx-master-conto { margin: 0; font-size: .8rem; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }

.gx-veloce {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
  font-weight: 700;
  cursor: pointer;
}
.gx-veloce input { width: 20px; height: 20px; accent-color: #ffcb05; }
.gx-veloce small { font-weight: 500; opacity: .8; }

.gx-link-master {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
}
.gx-link-master:hover { color: #fff; background: rgba(0, 0, 0, .3); }

.gx-amico {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .16);
  text-align: left;
  animation: gx-sale .5s ease both;
}
.gx-amico img { flex: 0 0 auto; width: 60px; height: auto; border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.gx-amico p { margin: 0; font-weight: 600; }

.gx-splash-nota { margin-top: 10px; max-width: 320px; font-size: .95rem; font-weight: 600; opacity: .9; animation: gx-sale .5s .6s ease both; }

.gx-avviso {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10060;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 24, 40, .88);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  transform: translate(-50%, 160%);
  transition: transform .3s cubic-bezier(.2, 1.3, .4, 1);
  pointer-events: none;
}
.gx-avviso.su { transform: translate(-50%, 0); }

/* ---------------------------------------------------------------------------
   Schermi grandi e piccoli
   ------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .gx-logo img { width: 70px; }
  .gx-top-titolo { font-size: 1.05rem; }
  .gx-duello { gap: 20px; padding: 18px 30px 6px; }
  .gx-vs { width: 68px; height: 68px; font-size: 1.5rem; }
  .gx-ventaglio { width: 340px; height: 200px; }
  .gx-ventaglio img { width: 116px; margin-left: -58px; }
}
@media (max-width: 767.98px) {
  /* Telefono: "Inizia!" e "AGGIUNGI" restano nel primo schermo */
  .gx-schermo { padding: 16px 14px 20px; }
  .gx-ventaglio { width: 220px; height: 118px; margin-bottom: 2px; }
  .gx-ventaglio img { width: 74px; margin-left: -37px; }
  .gx-regole { margin-bottom: 16px; gap: 6px; }
  .gx-regole li { padding: 7px 12px; font-size: .95rem; }
  .gx-campione { padding-top: 10px; }
  .gx-campione-carta { width: min(200px, 50vw); }
  .gx-campione .gx-h1 { margin-top: 10px; font-size: 1.7rem; }
  .gx-campione .gx-sub { font-size: .95rem; }
}
@media (max-width: 380px) {
  .gx-vs { width: 40px; height: 40px; font-size: 1rem; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0, 0, 0, .35); }
  .gx-btn { padding: 12px 22px; font-size: 1.05rem; }
  .gx-turni li { padding: 3px 8px; font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gx *, .gx::before, .gx *::before { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------------
   Top 8 nella schermata finale e invito al commento
   ------------------------------------------------------------------------- */
.gx-top8 { max-width: 460px; }
.gx-top8 ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 8px; }
.gx-top8 li { width: calc(33.333% - 6px); }
.gx-top8 li:nth-child(n+4) { width: calc(25% - 6px); }
.gx-top8 li:nth-child(n+4) span { font-size: .72rem; }
.gx-top8 small { display: block; font-size: .68rem; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .4px; }
.gx-comm-invito { margin: -2px 0 10px !important; text-align: center; color: #4a5372; }

/* Le top 8 già sbloccate su questo dispositivo (pagina iniziale) */
.gx-mie-top8 { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; }
.gx-mie-top8 p { width: 100%; margin: 0; font-weight: 800; font-size: .9rem; }
.gx-mie-top8 a {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #1b2440;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .15);
}
.gx-mie-top8 a small { font-weight: 500; opacity: .7; }
