/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  background-color: #000;
  font-family: "Inter", sans-serif;
  /* Fallback for text elements */
}

/* Main Layout Container */
.container {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

.background {
  position: relative;
  width: 100%;
  max-width: 500px;
  /* Standard mobile ad width */
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.background > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Slot Machine Section */
.slots-container {
  position: absolute;
  top: 48%;
  /* Adjusted to match the visual center of the FAFA88 background */
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 280px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 10;
}

.slot {
  position: relative;
  width: 30%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 5px;
}

.slot-frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.slot-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 75%;
  overflow: hidden;
  z-index: 2;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
}

.slot-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: calc(50% - 60px);
  will-change: transform;
}

.slot-item {
  width: 95%;
  height: 220px;
  padding: 10px 0;
  box-sizing: border-box;
  object-fit: contain;
  flex-shrink: 0;
}

/* Spinning Animation Effect */
.slot-strip.blur {
  filter: blur(3px) brightness(1.2);
}

/* Slot Positioning (Matches video depth) */
.left-slot,
.right-slot {
  transform: scale(0.85);
  opacity: 0.9;
}

.center-slot {
  transform: scale(1.1);
  z-index: 15;
}
/* Main Spin Button (CTA) */
.spin-button {
  position: absolute;
  bottom: 8%;
  width: 220px;
  cursor: pointer;
  z-index: 20;
  animation: pulse 1.5s infinite;
}

.spin-button img {
  width: 100%;
  transition: transform 0.1s;
}

.spin-button:active {
  transform: scale(0.9);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

/* Popup Overlay */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  /* Controlled by JS .show class */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.show {
  display: flex;
}

/* Popup Animations */
@keyframes zoomIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Win Popup Styles */
.popup-content-win {
  position: relative;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.win-img {
  width: 100%;
  height: auto;
  drop-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.win-buttons {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  width: 90%;
}

.win-buttons img {
  width: 48%;
  cursor: pointer;
}
.popup2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  /* Controlled by JS .show class */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.popup2.show {
  display: flex;
}

/* Lose Popup Styles */
.popup-content-lose {
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: zoomIn 0.3s ease-out;
}

.lose-img {
  width: 100%;
}

.lose-btn {
  width: 200px;
  cursor: pointer;
  animation: pulse 1.5s infinite;
}

/* Responsive Adjustments for small screens */
@media (max-height: 700px) {
  .slots-container {
    height: 220px;
    top: 45%;
  }

  .spin-button {
    width: 180px;
    bottom: 5%;
  }
}

/* Horizontal Spin Animation */
@keyframes spinHorizontal {
  0% {
    transform: translateX(150%);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(-150%);
    opacity: 0;
  }
}

.spinning .slot-item {
  animation: spinHorizontal 0.7s linear infinite;
  filter: blur(1px);
}
