/* EFECTOS VISUALES — Wheel Big Winner
   Capa de luces y brillos por CSS (barata, GPU) + canvas de partículas (fx.js).
   Todo con pointer-events:none; nunca bloquea los controles. */

/* ─── Canvas de partículas (monedas, chispas, polvo dorado, rayos de luz) ─── */
#wbw-fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7000;          /* sobre el juego, bajo overlays (8000) y mascota (9000) */
  pointer-events: none;
}

/* ─── Marquesina: luces que recorren el borde del marco de los rodillos ─── */
#wbw-fx-marquee {
  position: absolute;
  z-index: 6;             /* dentro del slot-frame-container, sobre el marco (1) y bajo overlays nativos */
  pointer-events: none;
  border-radius: 10px;
  /* caja de los rodillos: left 19% → 81.15%, top 31.46% → 79.64% (coordenadas del bundle) */
  left: 17.4%; top: 29.2%; width: 65.3%; height: 52.8%;
  box-shadow:
    0 0 26px 4px rgba(255, 215, 94, .45),
    inset 0 0 28px rgba(255, 215, 94, .22);
  animation: wbw-marquee-glow 2.4s ease-in-out infinite;
}
#wbw-fx-marquee::before,
#wbw-fx-marquee::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  padding: 5px;
  background: conic-gradient(from var(--wbw-angle, 0deg),
    transparent 0 62%, rgba(255, 236, 160, .95) 80%, #fff 88%, rgba(255, 236, 160, .95) 94%, transparent 100%);
  filter: drop-shadow(0 0 8px rgba(255, 240, 180, .95)) drop-shadow(0 0 18px rgba(255, 215, 94, .8));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: wbw-marquee-run 3.2s linear infinite;
  opacity: .9;
}
#wbw-fx-marquee::after { animation-delay: -1.6s; opacity: .7; }

/* Lámparas en las 4 esquinas del marco de rodillos */
.wbw-fx-lamp {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  width: 2.2%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe9a8 30%, rgba(255,215,94,.6) 55%, rgba(255,215,94,0) 75%);
  animation: wbw-lamp 1.2s ease-in-out infinite;
  transform: translate(-50%, -50%);
}
.wbw-fx-lamp:nth-child(odd) { animation-delay: .6s; }
@keyframes wbw-lamp { 0%,100% { opacity: .35; transform: translate(-50%,-50%) scale(.8); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.25); } }
body.wbw-spinning .wbw-fx-lamp { animation-duration: .35s; }
body.wbw-bonus .wbw-fx-lamp { background: radial-gradient(circle, #fff 0%, #bfe4ff 30%, rgba(120,200,255,.6) 55%, rgba(120,200,255,0) 75%); }
@property --wbw-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes wbw-marquee-run { to { --wbw-angle: 360deg; } }
@keyframes wbw-marquee-glow {
  0%, 100% { box-shadow: 0 0 18px 2px rgba(255,215,94,.30), inset 0 0 22px rgba(255,215,94,.12); }
  50%      { box-shadow: 0 0 30px 6px rgba(255,215,94,.55), inset 0 0 30px rgba(255,215,94,.22); }
}
/* Girando: recorrido más rápido · Bonus: luces azules · Premio: luces blancas intensas */
body.wbw-spinning #wbw-fx-marquee::before,
body.wbw-spinning #wbw-fx-marquee::after { animation-duration: 1.1s; }
body.wbw-bonus #wbw-fx-marquee { box-shadow: 0 0 26px 4px rgba(120, 200, 255, .55), inset 0 0 30px rgba(120, 200, 255, .25); animation: none; }
body.wbw-bonus #wbw-fx-marquee::before,
body.wbw-bonus #wbw-fx-marquee::after {
  background: conic-gradient(from var(--wbw-angle, 0deg), transparent 0 62%, rgba(160,220,255,.95) 80%, #fff 88%, rgba(160,220,255,.95) 94%, transparent 100%);
  filter: drop-shadow(0 0 8px rgba(190,230,255,.95)) drop-shadow(0 0 18px rgba(120,200,255,.8));
}
body.wbw-win #wbw-fx-marquee { animation: wbw-marquee-win .5s ease-in-out infinite; }
@keyframes wbw-marquee-win {
  0%, 100% { box-shadow: 0 0 24px 4px rgba(255,215,94,.6), inset 0 0 30px rgba(255,255,255,.25); }
  50%      { box-shadow: 0 0 48px 12px rgba(255,255,255,.85), inset 0 0 40px rgba(255,215,94,.45); }
}

/* ─── Barrido de luz sobre el título (marquesina superior) ─── */
#wbw-fx-title-sheen {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  left: 21.7%; top: 0; width: 55.1%; height: 17.4%;
  overflow: hidden;
  mix-blend-mode: screen;
}
#wbw-fx-title-sheen::before {
  content: "";
  position: absolute;
  top: -20%; bottom: -20%; width: 18%;
  left: -30%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.0) 35%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 65%, transparent 100%);
  transform: skewX(-18deg);
  animation: wbw-sheen 5.5s ease-in-out infinite;
}
@keyframes wbw-sheen { 0%, 70% { left: -30%; } 100% { left: 130%; } }

/* ─── Botón GIRAR: halo pulsante cuando está disponible ─── */
#wbw-fx-spin-halo {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  left: 75.39%; top: 78.82%; width: 15.88%; height: 20.68%;
  display: flex; align-items: center; justify-content: center;
}
#wbw-fx-spin-halo::before, #wbw-fx-spin-halo::after {
  content: "";
  position: absolute;
  width: 92%; aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 236, 160, .95);
  box-shadow: 0 0 22px 4px rgba(255, 215, 94, .9), inset 0 0 22px rgba(255,215,94,.5);
  animation: wbw-halo 1.8s ease-out infinite;
  opacity: 0;
}
#wbw-fx-spin-halo::after { animation-delay: .9s; }
@keyframes wbw-halo {
  0%   { transform: scale(.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
body.wbw-spinning #wbw-fx-spin-halo { display: none; }

/* ─── Símbolos ganadores: anillo de luz sobre cada celda ─── */
.wbw-fx-cell {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(255, 236, 160, .95), 0 0 24px 8px rgba(255, 215, 94, .75), inset 0 0 26px rgba(255, 255, 255, .45);
  animation: wbw-cell-pop .55s cubic-bezier(.2,1.5,.4,1) both, wbw-cell-glow 1s ease-in-out .5s infinite;
}
@keyframes wbw-cell-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wbw-cell-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,236,160,.95), 0 0 24px 8px rgba(255,215,94,.75), inset 0 0 26px rgba(255,255,255,.45); }
  50%      { box-shadow: 0 0 0 3px #fff, 0 0 40px 14px rgba(255,215,94,.95), inset 0 0 36px rgba(255,255,255,.7); }
}

/* ─── Flash de pantalla al caer un premio grande / bonus ─── */
#wbw-fx-flash {
  position: fixed; inset: 0; z-index: 7500; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.9), rgba(255,215,94,.5) 40%, rgba(255,215,94,0) 75%);
  opacity: 0;
}
#wbw-fx-flash.go { animation: wbw-flash .7s ease-out 1; }
#wbw-fx-flash.bonus { background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.9), rgba(140,210,255,.55) 40%, rgba(140,210,255,0) 75%); }
@keyframes wbw-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ─── Sacudida sutil de pantalla en MEGA/SUPER ─── */
body.wbw-shake #root { animation: wbw-shake .5s ease-in-out 1; }
@keyframes wbw-shake {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-4px,2px); } 40% { transform: translate(4px,-2px); }
  60% { transform: translate(-3px,-2px); } 80% { transform: translate(3px,2px); }
}

/* ─── Viñeta ambiental: oscurece bordes y realza el centro ─── */
#wbw-fx-vignette {
  position: fixed; inset: 0; z-index: 6500; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 55%, rgba(2,4,20,.45) 100%);
  transition: background .6s ease;
}
body.wbw-bonus #wbw-fx-vignette { background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 50%, rgba(10,30,90,.55) 100%); }

/* Móvil vertical: el juego ocupa el 76% inferior → los elementos absolutos siguen dentro del root (ok).
   Reducimos el coste: sin sheen ni viñeta en pantallas pequeñas. */
@media (max-width: 700px) {
  #wbw-fx-title-sheen, #wbw-fx-vignette { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #wbw-fx-marquee::before, #wbw-fx-marquee::after, #wbw-fx-title-sheen::before, #wbw-fx-spin-halo::before, #wbw-fx-spin-halo::after { animation: none; }
}
