/* ============================================================================
   Ale Store — ganadores.css  (ganadores.html)
   TOP 5 DEL MES: escenario 3D (js/gl/*.js) con botón de pantalla completa.
   Ya no hay podio en CSS: solo queda una lista de texto accesible (.gw-podium),
   oculta a la vista salvo que el navegador no admita WebGL2.
   Depende de las variables de css/v2.css (--v-bg, --v-text, --v-pink…).
   ========================================================================== */

/* ----------------------------------------------------------- volver */
body.v2 .gw-crumb { margin: 0 0 12px; }
body.v2 .gw-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--v-text-2);
  font: 600 var(--v-fs-sm)/1 var(--v-body);
  text-decoration: none;
}
body.v2 .gw-crumb a:hover { color: var(--v-text); }

/* ----------------------------------------------------------- escenario */
body.v2 .gw {
  --gw-floor: #1a0a22;
  position: relative;
  padding: clamp(14px, 4vw, 34px) 0 clamp(26px, 6vw, 56px);
  border-radius: var(--v-r-xl);
  background:
    radial-gradient(120% 70% at 50% 108%, rgba(255, 105, 180, .30), transparent 62%),
    radial-gradient(90% 60% at 12% 4%, rgba(190, 150, 255, .20), transparent 60%),
    radial-gradient(90% 60% at 88% 4%, rgba(255, 120, 190, .22), transparent 60%),
    linear-gradient(180deg, #2a1033 0%, var(--gw-floor) 100%);
  border: 1px solid rgba(255, 150, 210, .28);
  overflow: hidden;
}

/* Marco de neón de las esquinas (decorativo, como el flyer). */
body.v2 .gw::before,
body.v2 .gw::after {
  content: "";
  position: absolute;
  width: clamp(44px, 9vw, 92px);
  height: clamp(44px, 9vw, 92px);
  pointer-events: none;
}
body.v2 .gw::before {
  top: 10px; left: 10px;
  border-top: 2px solid rgba(95, 227, 255, .55);
  border-left: 2px solid rgba(95, 227, 255, .55);
  border-radius: 14px 0 0 0;
  box-shadow: -2px -2px 16px rgba(95, 227, 255, .35);
}
body.v2 .gw::after {
  right: 10px; bottom: 10px;
  border-bottom: 2px solid rgba(255, 63, 145, .55);
  border-right: 2px solid rgba(255, 63, 145, .55);
  border-radius: 0 0 14px 0;
  box-shadow: 2px 2px 16px rgba(255, 63, 145, .35);
}

/* ----------------------------------------------------------- título neón */
body.v2 .gw-title {
  position: relative;
  z-index: 1;
  margin: 0 auto clamp(6px, 1.6vw, 12px);
  padding: 0 clamp(12px, 4vw, 28px);
  text-align: center;
  font: 800 clamp(30px, 10vw, 76px)/1 var(--v-display);
  letter-spacing: .5px;
  text-transform: uppercase;
}
body.v2 .gw-title i { font-style: normal; }
body.v2 .gw-title .gw-t1 {
  color: #ff5fae;
  text-shadow: 0 0 6px rgba(255, 95, 174, .9), 0 0 22px rgba(255, 63, 145, .75), 0 3px 0 #7d0f44;
}
body.v2 .gw-title .gw-t2 {
  color: #6fe3ff;
  text-shadow: 0 0 6px rgba(111, 227, 255, .9), 0 0 22px rgba(95, 227, 255, .7), 0 3px 0 #0b5d75;
}
body.v2 .gw-title .gw-t3 {
  color: #fbf0f7;
  text-shadow: 0 0 6px rgba(255, 255, 255, .8), 0 0 20px rgba(226, 204, 255, .6), 0 3px 0 #3a2550;
}
body.v2 .gw-sub {
  position: relative;
  z-index: 1;
  margin: 0 auto clamp(14px, 3.4vw, 26px);
  max-width: 46ch;
  padding: 0 var(--v-pad);
  text-align: center;
  color: var(--v-text-2);
  font-size: var(--v-fs-sm);
}
body.v2 .gw-sub b { color: var(--v-text); }

/* ----------------------------------------------------------- estados y pie */
body.v2 .gw-state {
  position: relative;
  z-index: 1;
  margin: 10px clamp(12px, 4vw, 28px) 0;
  padding: 18px;
  border: 1px dashed var(--v-line-2);
  border-radius: var(--v-r-lg);
  text-align: center;
  color: var(--v-text-2);
  font-size: var(--v-fs-sm);
}
body.v2 .gw-note {
  margin: clamp(14px, 3vw, 22px) auto 0;
  max-width: 52ch;
  padding: 0 var(--v-pad);
  text-align: center;
  color: var(--v-text-3);
  font-size: var(--v-fs-xs);
}
body.v2 .gw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: clamp(16px, 4vw, 26px);
}

/* Botón «Ver ganadores» de comunidad.html */
body.v2 .rank-cta { margin: 14px 0 2px; }
body.v2 .rank-cta .btn { width: 100%; }
@media (min-width: 560px) {
  body.v2 .rank-cta .btn { width: auto; }
}

/* ===========================================================================
   ESCENARIO 3D (js/gl/*.js) y PANTALLA COMPLETA.
   =========================================================================== */
body.v2 .gw-stage {
  position: relative;
  z-index: 1;
  margin: 0 clamp(4px, 1.5vw, 14px) 6px;
  border-radius: var(--v-r-lg);
  overflow: hidden;
  background: radial-gradient(90% 70% at 50% 100%, rgba(255, 105, 180, .16), transparent 60%), #14061c;
  border: 1px solid var(--v-line);
}
body.v2 .gw-stage #gw3d {
  display: block;
  width: 100%;
  /* En celular casi cuadrado para que los cinco podios se lean; ancho en pantallas grandes. */
  aspect-ratio: 10 / 9;
  touch-action: pan-y;
}
@media (min-width: 560px) { body.v2 .gw-stage #gw3d { aspect-ratio: 3 / 2; } }
@media (min-width: 900px) { body.v2 .gw-stage #gw3d { aspect-ratio: 2 / 1; } }

body.v2 .gw-hint {
  margin: 0;
  padding: 4px 12px 10px;
  text-align: center;
  color: var(--v-text-3);
  font-size: var(--v-fs-xs);
}

/* Botón de pantalla completa: abajo a la derecha del escenario */
body.v2 .gw-fs {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 2px solid #ff2e9a;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 46, 154, .5);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .2s, box-shadow .2s;
}
body.v2 .gw-fs:hover { background: rgba(255, 46, 154, .4); box-shadow: 0 0 24px rgba(255, 46, 154, .7); }
body.v2 .gw-fs:active { transform: scale(.92); }
body.v2 .gw-fs svg { width: 24px; height: 24px; }
body.v2 .gw-fs .gw-fs-out { display: none; }
body.v2 .gw-stage.is-fs .gw-fs .gw-fs-in { display: none; }
body.v2 .gw-stage.is-fs .gw-fs .gw-fs-out { display: block; }
/* El botón solo se ve cuando el 3D está montado */
body.v2 .gw-stage:not(.is-on) .gw-fs { display: none; }

/* --- pantalla completa (nativa o «a mano») ---
   El escenario cubre TODA el área visible: position:fixed + inset:0 (sin vh/dvh, que en los celulares no coinciden con lo que se ve).
   Girado en celular vertical, js/ganadores3d.js mide la ventana real y la deja en --gw-w / --gw-h. */
html.gw-lock, html.gw-lock body { overflow: hidden; overscroll-behavior: none; }
body.v2 .gw-stage.is-fs {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  margin: 0;
  border: 0;
  border-radius: 0;
  width: auto;
  height: auto;
  background: #05020b;
}
body.v2 .gw-stage.is-fs #gw3d { width: 100%; height: 100%; aspect-ratio: auto; touch-action: none; }
body.v2 .gw-stage.is-fs .gw-fs { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }

/* Celular vertical: se gira el escenario 90° para verlo horizontal (iPhone no puede bloquear la orientación). */
body.v2 .gw-stage.is-fs.is-rot {
  inset: auto;
  top: 0;
  left: 0;
  width: var(--gw-h, 100vh);
  height: var(--gw-w, 100vw);
  transform-origin: top left;
  transform: translateX(var(--gw-w, 100vw)) rotate(90deg);
}

/* --- lista de texto (respaldo accesible) --- */
body.v2 .gw-podium {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;                     /* oculta a la vista, la leen los lectores de pantalla */
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
body.v2 .gw-podium.is-fallback {          /* sin WebGL2: se ve como lista sencilla */
  position: static;
  width: auto; height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  display: grid;
  gap: 8px;
  margin: 10px clamp(12px, 4vw, 28px) 0;
}
body.v2 .gw-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 10px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: var(--v-r-md);
  background: var(--v-bg-3);
  border: 1px solid var(--v-line);
}
body.v2 .gw-row.is-me { border-color: var(--v-pink-2); }
body.v2 .gw-rpos { grid-row: span 3; font: 800 22px/1 var(--v-display); color: var(--v-pink-2); }
body.v2 .gw-rname { font-weight: 700; color: var(--v-text); }
body.v2 .gw-rinfo { font-size: var(--v-fs-xs); color: var(--v-text-3); }
body.v2 .gw-rprize { font-size: var(--v-fs-xs); font-weight: 700; color: var(--v-gem); }
