/* MASCOTA ANIMADA — Wheel Big Winner
   Personaje con 4 estados (idle / win / bonus / lose) en vídeo con transparencia.
   - Escritorio: a la derecha de la consola, sobre las monedas (no tapa ningún control).
   - Móvil vertical: ocupa la franja superior entre el título y los rodillos.
   La caja del personaje es amplia (los clips ya llevan margen) para que ningún salto se corte. */

#wbw-mascot {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  /* escritorio / landscape: junto al rodillo derecho, de pie sobre su plataforma,
     entre el panel GANANCIA y el botón GIRAR (zona del pilar/campana) */
  right: 1.2vw;
  bottom: 22vh;
  width: clamp(110px, 17vh, 240px);
  aspect-ratio: 518 / 900;
  transform-origin: bottom center;
  overflow: visible;
  transition: opacity .4s ease;
}

/* ───────── PLATAFORMA (pedestal dorado) ─────────
   Elipse 3D bajo los pies, centrada con el personaje. Los clips llevan ~7% de aire
   bajo los pies, así que la plataforma se asienta en ese punto. */
#wbw-mascot .wbw-platform {
  position: absolute;
  left: 50%;
  bottom: 1.5%;
  width: 82%;
  height: 11%;
  transform: translateX(-50%);
  z-index: 0;
}
#wbw-mascot .wbw-platform::before {
  /* lateral del pedestal */
  content: "";
  position: absolute;
  left: 4%; right: 4%; top: 42%; bottom: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, #c98a0a 0%, #7a4d03 55%, #3a2300 100%);
  box-shadow: 0 10px 18px rgba(0,0,0,.6);
}
#wbw-mascot .wbw-platform::after {
  /* tapa superior: azul real con borde dorado y brillo */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 78%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255,255,255,.35), rgba(255,255,255,0) 45%),
    radial-gradient(ellipse at 50% 50%, #2546c7 0%, #0f2a8a 55%, #081a5e 100%);
  border: 3px solid #f2c14e;
  box-shadow:
    inset 0 0 0 2px #7a4d03,
    inset 0 -6px 12px rgba(0,0,0,.45),
    0 0 14px rgba(255, 215, 94, .55);
  box-sizing: border-box;
}
#wbw-mascot .wbw-platform-glow {
  position: absolute;
  left: 50%; top: 40%;
  width: 160%; height: 120%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,215,94,.35), rgba(255,215,94,0) 65%);
  animation: wbw-platform-pulse 2.4s ease-in-out infinite;
}
@keyframes wbw-platform-pulse {
  0%, 100% { opacity: .6; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;  transform: translate(-50%, -50%) scale(1.08); }
}

#wbw-mascot .wbw-mascot-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity .25s ease;
}
#wbw-mascot .wbw-mascot-media.is-active { opacity: 1; }

/* Bocadillo de texto */
#wbw-mascot .wbw-bubble {
  position: absolute;
  z-index: 2;
  right: 78%;
  bottom: 72%;
  max-width: 190px;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(180deg, #fff8e1, #ffe9a8);
  color: #2b1d4e;
  font: 800 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  letter-spacing: .3px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 0 2px #e0a800;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px) scale(.9);
  transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
#wbw-mascot .wbw-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 6px;
  border: 8px solid transparent;
  border-left-color: #ffe9a8;
  border-bottom: 0;
}
#wbw-mascot .wbw-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#wbw-mascot .wbw-bubble.win   { background: linear-gradient(180deg, #fff3b0, #ffc93c); }
#wbw-mascot .wbw-bubble.bonus { background: linear-gradient(180deg, #d9f0ff, #8fd3ff); color: #0b2a6b; box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 0 0 2px #2d7bd6; }
#wbw-mascot .wbw-bubble.bonus::after { border-left-color: #8fd3ff; }

/* ───────── MÓVIL VERTICAL: franja dedicada arriba de los rodillos ─────────
   El juego baja y ocupa el 76% inferior; el 24% superior es el escenario del personaje
   (con el mismo fondo del juego desenfocado detrás). Así nunca tapa rodillos ni paneles. */
@media (orientation: portrait) {
  html body #root {
    position: absolute !important;
    left: 0 !important;
    top: 24vh !important;
    width: 100% !important;
    height: 76vh !important;
    min-height: 0 !important; /* responsive-games.css fuerza min-height:100dvh */
  }
  html body #root .app-container,
  html body #root .slot-frame-container {
    height: 100% !important;
    width: 100% !important;
  }
  /* overlays del juego (bonus/big win) a pantalla completa real */
  html body .bonus-overlay, html body .big-win-overlay, html body .settings-overlay {
    position: fixed !important; inset: 0 !important;
  }

  #wbw-mascot-stage {
    position: fixed;
    left: 0; top: 0;
    width: 100%; height: 24.5vh;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    background: #020414;
  }
  #wbw-mascot-stage::before {
    content: "";
    position: absolute; inset: -12%;
    background: radial-gradient(circle at 50% 70%, rgba(255,215,0,.18), rgba(30,64,175,.35) 40%, rgba(2,4,20,.95) 80%),
                url("../frame_official.jpg") center 20% / cover no-repeat;
    filter: blur(14px) saturate(1.3) brightness(.85);
  }
  #wbw-mascot-stage::after {
    /* suelo brillante sobre el que se apoya el personaje */
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #ffd75e 30%, #fff 50%, #ffd75e 70%, transparent);
    box-shadow: 0 0 12px 3px rgba(255, 215, 94, .6);
  }

  #wbw-mascot {
    right: auto;
    bottom: auto;
    left: 50%;
    top: 0.8vh;
    height: 23vh;
    width: auto;
    aspect-ratio: 518 / 900;
    transform: translateX(-50%);
    transform-origin: top center;
  }
  #wbw-mascot .wbw-platform { width: 88%; height: 10%; bottom: 1%; }
  #wbw-mascot .wbw-mascot-media { filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }

  /* bocadillo a la izquierda del personaje (la barra de addons va arriba a la derecha) */
  #wbw-mascot .wbw-bubble {
    right: 72%;
    bottom: auto;
    top: 18%;
    max-width: 38vw;
    white-space: normal;
    font-size: 12px;
    border-radius: 14px 14px 4px 14px;
  }
  #wbw-mascot .wbw-bubble::after {
    right: -8px; bottom: 6px; left: auto; margin: 0;
    border: 8px solid transparent; border-left-color: #ffe9a8; border-bottom: 0;
  }
  #wbw-mascot .wbw-bubble.bonus::after { border-left-color: #8fd3ff; }
  #wbw-mascot .wbw-bubble.show { transform: translateY(0) scale(1); }
}

/* Tablets en vertical: más alto disponible, personaje más grande */
@media (orientation: portrait) and (min-width: 700px) {
  #wbw-mascot .wbw-bubble { font-size: 15px; max-width: 30vw; }
}

/* Móvil horizontal (poca altura): personaje más pequeño en la esquina (layout.css lo pone a la izquierda) */
@media (orientation: landscape) and (max-height: 500px) {
  #wbw-mascot { width: clamp(80px, 22vh, 130px); bottom: 24vh; right: 0.6vw; }
  #wbw-mascot .wbw-bubble { font-size: 10px; max-width: 120px; padding: 5px 8px; }
}

/* Oculto cuando la tabla de pagos está abierta o lo pide el juego */
#wbw-mascot.hidden { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  #wbw-mascot .wbw-bubble { transition: none; }
}
