
/* ═══════════════════════════════════════════
   PAGE / GAME WRAPPER
════════════════════════════════════════════ */
.page {
  position: relative;
  display: flex;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  scrollbar-width: none;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
  background-image: url(../../assets/images/backgrounds/bg-desktop.gif);
}

@media (max-width: 767px) {
  .page { background-image: url(../../assets/images/backgrounds/bg-mobile.gif); }
}

.game {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
  justify-content: center;
}

.game__stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  padding: 0 16px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════
   GAME HEADER (CuatroBet brand + game logo)
════════════════════════════════════════════ */
.game-header {
  position: relative;
  z-index: var(--z-brand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0 auto;
  padding-top: 1.5em;
  padding-bottom: 6px;
  width: 100%;
  max-width: var(--max-width-desktop);
}

.brand-logo {
  display: block;
  width: clamp(180px, 22vw, 320px);
  height: auto;
}

.game-logo {
  display: block;
  max-width: clamp(180px, 26vw, 320px);
  height: auto;
  margin-bottom: -6px;
}

/* ═══════════════════════════════════════════
   CHARACTER
════════════════════════════════════════════ */
.character {
  position: absolute;
  z-index: var(--z-character);
  width: 93em;
  left: calc(50% + 75em);
  top: 50%;
  transform: translate(-50%, -30%);
  will-change: transform;
}
.character__image { display: block; width: 100%; height: auto; }

@media (max-width: 1023px) {
  .character {
    left: calc(50dvw - 20em);
    top: auto; bottom: 0;
    transform: translate(-50%, 30%) scaleX(-1);
    width: 70em;
  }
}
@media (max-width: 356px) { .character { width: 50em; } }

/* ═══════════════════════════════════════════
   DECOR
════════════════════════════════════════════ */
.decor {
  position: absolute;
  inset: 0;
  animation: decor-float 2s ease-in-out infinite;
}
.decor__item { position: absolute; }

.decor__item--left {
  aspect-ratio: 357/752;
  width: 50em;
  right: calc(50% + 75em);
  top: 50%;
  transform: translate(50%, -50%);
}
.decor__item--right { display: none; }

@media (max-width: 1023px) { .decor__item--left { display: none; } }

.is--modal-open #slot,
.is--modal-open .game-header,
.is--modal-open .character { display: none; }

.is--modal-open .decor__item--left { display: block; }

@media (max-width: 1023px) {
  .is--modal-open .decor__item--left { display: none; }
}

.is--modal-open .game-actions { z-index: 0; opacity: 0; }

/* ═══════════════════════════════════════════
   FULLSCREEN BOOM EFFECT
════════════════════════════════════════════ */
.effects-overlay {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
  mix-blend-mode: screen;
  z-index: var(--z-effects-boom);
  pointer-events: none;
}

.effects-overlay__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter:
    hue-rotate(50deg)
    saturate(1.4)
    brightness(1.05);
  pointer-events: none;
}

.effects-overlay__image.is-active {
  animation: bonusFlash 1.8s ease-out forwards;
}

@keyframes bonusFlash {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}
