body {
  margin: 0;
  background: black;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

/* Core layout containers (previously Tailwind classes) */
.game-wrap {
  position: relative;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  height: 100vh;
}

.bg-game {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 550px;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}

.man-bg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 550px;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}
.play-button{
  position: fixed;
  top: 80%;
  left: 40%;
  transform: translateX(-50%,-50%);
  width: 30%;
  max-width: 400px;
  height: 100px;
  z-index: 10;
}
.play-button img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-top {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  max-width: 200px;
  z-index: 20;
}

.promo-text {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 300px;
  z-index: 20;
}

.frame-game {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 550px;
  z-index: 10;
  object-fit: contain;
}

.line-pint {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  z-index: 10;
  object-fit: contain;
}

.reels-container {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 420px;
  z-index: 10;
}

/* Apply both animations to the logo */
#faFa178Image {
  animation: floatLogo 3s ease-in-out infinite, glowLogo 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

/* ✨ Floating + glow animation for FAFA178 logo */
@keyframes floatLogo {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, -10px);
  }
}

@keyframes glowLogo {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
  }

  50% {
    filter: drop-shadow(0 0 25px rgba(255, 255, 100, 0.9));
  }
}



/* Overlay image in the center reel */
.center-overlay-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hidden {
  display: none;
}

/* Slot Machine Grid - 3 column reels */
.slot-machine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 0 10px;
  position: relative;
  width: 100%;
}

/* Individual reel column */
.reel-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Viewport that shows 3 visible symbols */
.reel-viewport {
  height: 330px;
  /* 3 symbols × 110px each */
  overflow: hidden;
  position: relative;
  border-radius: 8px;
  width: 100%;
}

/* Reel container that scrolls */
.reel {
  position: relative;
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translateY(0);
}

/* Individual reel item */
.reel-item {
  height: 100px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.reel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s ease;
}

/* ==================== SPINNING ANIMATION ==================== */
/* Smooth reel spinning effect during animation */
.reel {
  transition: transform 3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Blur effect during fast spinning */
.reel-item img {
  transition: filter 0.3s ease;
}

.reel.spinning .reel-item img {
  filter: blur(2px) brightness(0.9);
}

/* Golden frame light border overlay - matches the image */
.golden-frame-overlay {
  position: absolute;
 
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 15;
  transition: opacity 0.5s ease;
}

.golden-frame-overlay.show {
  opacity: 1;
  animation: frame-entrance 0.6s ease-out;
}

/* Main golden rectangular border around row 2 (middle row) */
.golden-frame-overlay::before {
  content: '';
  position: absolute;
  /* Centered on the 2nd (middle) horizontal row only */
  top: 33%;
  left: 0%;
  width: 100%;
  height: 34%;
  border: 3px solid rgba(255, 215, 0, 1);
  border-radius: 16px;
  box-shadow:
    /* Bright outer glow layers */
    0 0 20px rgba(255, 215, 0, 1),
    0 0 40px rgba(255, 215, 0, 0.9),
    0 0 60px rgba(255, 180, 0, 0.7),
    0 0 80px rgba(255, 150, 0, 0.5),
    0 0 100px rgba(255, 100, 0, 0.3),
    /* Inner glow */
    inset 0 0 20px rgba(255, 215, 0, 0.6),
    inset 0 0 40px rgba(255, 180, 0, 0.3);
  animation: golden-border-pulse 2s ease-in-out infinite;
}

/* Corner sparkle highlights */
.golden-frame-overlay::after {
  content: '';
  position: absolute;
  /* Match the same area as ::before so glow is only on row 2 */
  top: 33%;
  left: 0%;
  width: 100%;
  height: 34%;
  border-radius: 16px;
  background:
    /* 4 corner sparkles - brighter and larger */
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
  animation: corner-shine 1.5s ease-in-out infinite;
}

/* Frame entrance animation */
@keyframes frame-entrance {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.03);
  }

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

/* Golden border pulsing animation */
@keyframes golden-border-pulse {

  0%,
  100% {
    border-width: 3px;
    box-shadow:
      0 0 15px rgba(255, 215, 0, 1),
      0 0 30px rgba(255, 215, 0, 0.9),
      0 0 50px rgba(255, 180, 0, 0.7),
      0 0 70px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
  }

  50% {
    border-width: 4px;
    box-shadow:
      0 0 25px rgba(255, 215, 0, 1),
      0 0 50px rgba(255, 215, 0, 1),
      0 0 75px rgba(255, 180, 0, 0.9),
      0 0 100px rgba(255, 150, 0, 0.7),
      0 0 130px rgba(255, 100, 0, 0.5),
      inset 0 0 30px rgba(255, 215, 0, 0.8),
      inset 0 0 50px rgba(255, 180, 0, 0.5);
  }
}

/* Corner shine animation */
@keyframes corner-shine {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

/* Winning slot highlight effect */
.slot-item.winner-slot {
  position: relative;
  z-index: 10;
  animation: winner-glow 1.5s ease-in-out infinite;
}

.slot-item.winner-slot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 12px;

  animation: winner-border-pulse 1s ease-in-out infinite;
  pointer-events: none;
}

.slot-item.winner-pulse {
  animation: winner-scale-pulse 0.8s ease-in-out;
}

/* Winner glow animation */
@keyframes winner-glow {

  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
  }

  50% {
    filter: brightness(1.3) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  }
}

/* Winner border pulse */
@keyframes winner-border-pulse {

  0%,
  100% {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow:
      0 0 20px rgba(255, 215, 0, 0.6),
      0 0 40px rgba(255, 100, 0, 0.4),
      inset 0 0 20px rgba(255, 215, 0, 0.3);
  }

  50% {
    border-color: rgba(255, 100, 0, 1);
    box-shadow:
      0 0 30px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 100, 0, 0.7),
      inset 0 0 30px rgba(255, 215, 0, 0.5);
  }
}

/* Winner scale pulse (initial pop) */
@keyframes winner-scale-pulse {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.15);
  }

  50% {
    transform: scale(0.95);
  }

  70% {
    transform: scale(1.05);
  }

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

.center-overlay-image {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 850px;
  height: auto;
  border-radius: 6px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
}

.center-overlay-image.show {
  opacity: 1;
}

.center-overlay-image {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
  opacity: 0;
}

.center-overlay-image.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.alert {
  position: fixed;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  z-index: 9999;
  opacity: 0;
  transition: all 0.6s ease;
}

.alert.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.alert img {
  width: 250px;
  border-radius: 10px;
}

/* 💰 Coin Rain Effect */
.coin-rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100000;
  overflow: hidden;
}

.falling-coin {
  position: absolute;
  top: -100px;
  left: 50%;
  width: 50px;
  height: 50px;
  object-fit: contain;
  animation: coin-dropdown 2.5s cubic-bezier(0.33, 0.0, 0.2, 1) forwards;
  opacity: 0;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 25px rgba(255, 180, 0, 0.6));
  transform-origin: center center;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Smooth dropdown burst effect - coins explode from center then fall naturally */
@keyframes coin-dropdown {
  0% {
    transform: translate(-50%, -80px) scale(0.5) rotate(0deg);
    opacity: 0;
  }

  8% {
    transform: translate(-50%, 0px) scale(1) rotate(90deg);
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--drift, 0) * 200px),
        110vh) scale(0.8) rotate(var(--rotation, 1080deg));
    opacity: 0;
  }
}

/* 🎉 Win Alert - Appears 1 second after spin stops */
.win-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 100000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.win-alert.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: win-bounce 0.6s ease-out;
}

.win-text {
  font-size: 80px;
  font-weight: 900;
  color: #FFD700;
  text-shadow:
    0 0 20px rgba(255, 215, 0, 1),
    0 0 40px rgba(255, 215, 0, 0.8),
    0 0 60px rgba(255, 180, 0, 0.6),
    0 0 80px rgba(255, 150, 0, 0.4),
    3px 3px 0 rgba(255, 100, 0, 0.8),
    6px 6px 0 rgba(200, 50, 0, 0.6);
  letter-spacing: 8px;
  display: block;
  animation: text-glow-pulse 0.3s ease-in-out infinite alternate;
}

@keyframes win-bounce {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
  }

  70% {
    transform: translate(-50%, -50%) scale(0.9) rotate(-5deg);
  }

  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes text-glow-pulse {
  0% {
    text-shadow:
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.8),
      0 0 60px rgba(255, 180, 0, 0.6),
      0 0 80px rgba(255, 150, 0, 0.4),
      3px 3px 0 rgba(255, 100, 0, 0.8),
      6px 6px 0 rgba(200, 50, 0, 0.6);
  }

  100% {
    text-shadow:
      0 0 30px rgba(255, 255, 255, 1),
      0 0 50px rgba(255, 215, 0, 1),
      0 0 70px rgba(255, 180, 0, 0.8),
      0 0 100px rgba(255, 150, 0, 0.6),
      3px 3px 0 rgba(255, 100, 0, 1),
      6px 6px 0 rgba(200, 50, 0, 0.8);
  }
}

/* 🏆 Winner popup */
.alert_winner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  z-index: 99998;
  opacity: 0;
  transition: all 0.6s ease;
  transition: transform 0.3s ease;
  animation: text-glow-pulse 0.3s ease-in-out infinite alternate;
}

.alert_winner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.alert_winner #winner1 {
  width: 450px;
  display: block;
  margin: auto;
  margin-bottom: 30px;
}

.alert_winner #winner2 {
  width: 600px;
  display: block;
  margin: auto;
}

/* ✨ Floating animation for both characters */
@keyframes winnerFloatUpDown {

  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-15px);
  }
}

/* 🌟 Glow effect for extra life */
@keyframes winnerglowPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(148, 202, 253, 0.459));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(252, 146, 208, 0.9));
  }
}



#spinNowButton {
  cursor: pointer;
}
#spinNowButton img{
  width: 60%;
  height: 100%;
  object-fit: contain;
}
#spinButtonWrapper {
  position: absolute;
  bottom: 5%;
  left: 35%;
  transform: translateX(-50%,-50%);
  z-index: 50;
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#chara {
  z-index: 9999;
  top: 75%;
  left: 21%;
  transform: translate(-50%, -50%);
  position: absolute;
  width: 100px;
  height: 100px;
  animation: floatUpDown 3s ease-in-out infinite, glowPulse 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

#chara_right {
  z-index: 9999;
  top: 75%;
  left: 82%;
  transform: translate(-50%, -50%);
  position: absolute;
  width: 100px;
  height: 100px;
  animation: floatUpDown 3s ease-in-out infinite, glowPulse 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

/* ✨ Floating animation for both characters */
@keyframes floatUpDown {

  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-15px);
  }
}

/* 🌟 Glow effect for extra life */
@keyframes glowPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 100, 0.9));
  }
}

/* ✨ Sweet pulse animation for popup */
@keyframes sweetPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
  }
}

/* ✨ Sparkle effect */
.sparkle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #fff 0%, #ffd700 50%, transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  animation: sparkleFade 1s ease-out forwards;
  animation-delay: var(--delay, 0s);
  box-shadow: 
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(255, 215, 0, 0.6),
    0 0 30px rgba(255, 215, 0, 0.4);
}

@keyframes sparkleFade {
  0% {
    opacity: 1;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.5) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg);
  }
}

/* ===========================
    📱 RESPONSIVE MOBILE STYLES
    =========================== */
 
/* For iPhone 17 Pro (440px) */
@media (max-width: 440px) {


  #gameWrap {
    max-width: 570px;
  }
  #reelFrame{
    height: 33%;
  }

  /* Make backgroundnext.png full-screen responsive on ~428px devices */
  .bg-game {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: none;
    height: 100vh;
    object-fit: cover;
  }


  #playButton {
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 100px;

  }

  #playButton #spinNowButton {
    width: 130px;
  }

  #chara,
  #chara_right {
    width: 80px;
    top: 70%;
  }

  .reels-container {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 420px;
    
    z-index: 10;
  }
  .line-pint{
    margin-top: -9px;
    width: 120%;
  }

  .slot-machine-grid {
    gap: 10px;
    padding: 0 10px;
  }

  .reel-viewport {
    height: 250px;
    width: 90%;
  }

  .reel-item {
    height: 90px;
    margin-bottom: 0px;
  }

  /* 🏆 Winner popup */
  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 520px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }

  .alert_winner #winner1 {
    width: 500px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 500px;
    display: block;
    margin: auto;
  }
 

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Only cover 2nd horizontal row */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Match 2nd-row area */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }
}
    
@media (max-width: 430px) {


  /* Make backgroundnext.png full-screen responsive on ~428px devices */
  .bg-game {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: none;
    height: 100vh;
    object-fit: cover;
  }


  #playButton {
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 100px;

  }

  #playButton #spinNowButton {
    width: 130px;
  }

  #chara,
  #chara_right {
    width: 80px;
    top: 70%;
  }

  .reels-container {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 420px;
    
    z-index: 10;
  }
  .line-pint{
    margin-top: -5px;
    width: 120%;
  }

  .slot-machine-grid {
    gap: 10px;
    padding: 0 10px;
  }

  .reel-viewport {
    height: 260px;
    width: 70%;
  }

  .reel-item {
    height: 74px;
    margin-bottom: 10px;
  }

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Only cover 2nd horizontal row */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Match 2nd-row area */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }
}
@media (max-width: 428px) {


  #gameWrap {
    max-width: 570px;
  }

  /* Make backgroundnext.png full-screen responsive on ~428px devices */
  .bg-game {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: none;
    height: 100vh;
    object-fit: cover;
  }


  #playButton {
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 100px;

  }

  #playButton #spinNowButton {
    width: 130px;
  }

  #chara,
  #chara_right {
    width: 80px;
    top: 70%;
  }

  .reels-container {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 420px;
    
    z-index: 10;
  }
  .line-pint{
    margin-top: -9px;
    width: 120%;
  }

  .slot-machine-grid {
    gap: 10px;
    padding: 0 10px;
  }

  .reel-viewport {
    height: 250px;
    width: 90%;
  }

  .reel-item {
    height: 90px;
    margin-bottom: 0px;
  }

  /* 🏆 Winner popup */
  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 520px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }

  .alert_winner #winner1 {
    width: 500px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 500px;
    display: block;
    margin: auto;
  }
 

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Only cover 2nd horizontal row */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Match 2nd-row area */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }
}
/* For devices ≤ 414px (iPhone 14, 13, etc.) */
@media (max-width: 414px) {
  #reelFrame {
    max-width: 500px;
  }

  #gameWrap {
    max-width: 414px;
  }

  #playButton {
    top: 80%;
    left: 54%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 70%;
    height: 100px;

  }
  .line-pint{
    margin-top: -20px;
    width: 120%;
  }

  #playButton #spinNowButton {
    width: 110px;
  }

  #chara,
  #chara_right {
    width: 75px;
    top: 85%;
  }

  #reelsContainer {
    top: 32%;
    width: 80%;
  }

  .slot-machine-grid {
    gap: 8px;
    padding: 0 0px;
    width: 95%;
  }

  .reel-viewport {
    height:200px;
    width: 90%;
  }

  .reel-item {
    height: 92px;
    margin-bottom: -5px;
  }

  /* Golden frame light border overlay - matches the image */
  .golden-frame-overlay {
    position: absolute;
    top: 35%;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 15;
    transition: opacity 0.5s ease;
  }

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    top: 1%;
    left: 0%;
    width: 100%;
    height: 25%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    top: 1%;
    left: 0%;
    width: 100%;
    height: 25%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }

  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 500px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }

  .alert_winner #winner1 {
    width: 450px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 480px;
    display: block;
    margin: auto;
  }
}

/* For devices ≤ 390px (Pixel, iPhone 12 mini) */
@media (max-width: 390px) {

  #reelFrame {
    height: 38%;
  }
  #gameWrap {
    max-width: 400px;
  }

  #playButton {
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 100px;
  }

  #playButton #spinNowButton {
    width: 90px;
  }

  #chara,
  #chara_right {
    width: 70px;
    top: 85%;
  }

  #reelsContainer {
    top: 34%;
    width: 90%;
  }

  /* Golden frame light border overlay - matches the image */
  .golden-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 15;
    transition: opacity 0.5s ease;
  }

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Align with only the second row */
    top: 33%;
    left: 2%;
    width: 98%;
    height: 30%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Same area as ::before so glow is only on row 2 */
    top: 33%;
    left: 2%;
    width: 98%;
    height: 30%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }

  .slot-machine-grid {
    gap: 10px;
    padding: 0 0px;
  }
  .line-pint{
    margin-top: -10px;
    width: 120%;
  }
  .reel-viewport {
    height: 100px;
    width: 80%;
    left: 52%;
    transform: translateX(-50%);
  }

  .reel-item {
    height: 60px;
    margin-bottom: -8px;
  }

  .alert img,
  .alert_winner img {
    width: 220px;
  }

  /* 🏆 Winner popup */
  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 550px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .alert_winner #winner1 {
    width: 300px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 450px;
    display: block;
    margin: auto;
  }
}

/* For devices ≤ 360px (small Android) */
@media (max-width: 360px) {
  #reelFrame {
    top: 24%;
    max-width: 470px;
  }

  #gameWrap {
    max-width: 360px;
  }

  #reelsContainer {
    top: 35%;
    width: 80%;
    left: 51%;
    transform: translateX(-50%);
  }
  .man-bg{
    top: 0;
    height: 100%;
    width: 100%;
  }
  .line-pint{
    margin-top: -9px;
    width: 120%;
  }

  .bg-game{
    height: 100%;
    width: 100%;
  }
  .frame-game{
    margin-top: 12%;
    left: 50%;
  
  }

  #playButton {
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 150px;

  }

  #playButton #spinNowButton {
    width: 70px;
  }

  #chara,
  #chara_right {
    width: 60px;
    top: 85%;
  }
  #spinNowButton img{
    width: 55%;
  }


  /* Golden frame light border overlay - matches the image */
  .golden-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 15;
    transition: opacity 0.5s ease;
  }

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Only cover the middle row on very small screens */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(97, 92, 62, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Same vertical slice as ::before */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }

  .slot-machine-grid {
    gap: -10px;
   
  }

  .reel-viewport {
    top: -4%;
    height: 200px;
    width: 90%;
  }


  .alert img,
  .alert_winner img {
    width: 200px;
  }

  /* 🏆 Winner popup */
  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 500px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .alert_winner #winner1 {
    width: 300px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 400px;
    display: block;
    margin: auto;
  }
}
/* For devices ≤ 360px (small Android) */
@media (max-height: 880px) {
  #reelFrame {
    top: 25%;
    max-width: 470px;
  }

  #gameWrap {
    max-width: 360px;
  }

  #reelsContainer {
    top: 33%;
    width: 80%;
    left: 51%;
    transform: translateX(-50%);
  }
  .man-bg{
    top: 0;
    height: 100%;
    width: 100%;
  }
  .line-pint{
    top: 36%;
  }

  .bg-game{
    height: 100%;
    width: 100%;
  }
  .frame-game{
    margin-top: 12%;
    left: 50%;
  
  }

  #playButton {
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    width: 200px;
    height: 150px;

  }

  #playButton #spinNowButton {
    width: 70px;
  }

  #chara,
  #chara_right {
    width: 70px;
    top: 85%;
  }
  #spinNowButton img{
    width: 55%;
  }


  /* Golden frame light border overlay - matches the image */
  .golden-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 15;
    transition: opacity 0.5s ease;
  }

  .golden-frame-overlay.show {
    opacity: 1;
    animation: frame-entrance 0.6s ease-out;
  }

  /* Main golden rectangular border around row 2 (middle row) */
  .golden-frame-overlay::before {
    content: '';
    position: absolute;
    /* Only cover the middle row on short screens */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border: 3px solid rgba(255, 215, 0, 1);
    border-radius: 16px;
    box-shadow:
      /* Bright outer glow layers */
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(97, 92, 62, 0.9),
      0 0 60px rgba(255, 180, 0, 0.7),
      0 0 80px rgba(255, 150, 0, 0.5),
      0 0 100px rgba(255, 100, 0, 0.3),
      /* Inner glow */
      inset 0 0 20px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 180, 0, 0.3);
    animation: golden-border-pulse 2s ease-in-out infinite;
  }

  /* Corner sparkle highlights */
  .golden-frame-overlay::after {
    content: '';
    position: absolute;
    /* Same middle-row band as ::before */
    top: 33%;
    left: 0%;
    width: 100%;
    height: 34%;
    border-radius: 16px;
    background:
      /* 4 corner sparkles - brighter and larger */
      radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%),
      radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 1) 0%, rgba(255, 215, 0, 1) 3%, transparent 8%);
    animation: corner-shine 1.5s ease-in-out infinite;
  }

  .slot-machine-grid {
    gap: -10px;
    padding: 0 8px;
  }

  .reel-viewport {
    top: -4%;
    height: 230px;
    width: 90%;
  }

  .reel-item {
    height: 80px;
  }

  .alert img,
  .alert_winner img {
    width: 200px;
  }

  /* 🏆 Winner popup */
  .alert_winner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    z-index: 99998;
    opacity: 0;
    width: 500px;
    transition: all 0.6s ease;
    animation: winnerFloatUpDown 0s ease-in-out infinite, winnerglowPulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
  }

  .alert_winner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .alert_winner #winner1 {
    width: 300px;
    display: block;
    margin: auto;
    margin-bottom: 30px;
  }

  .alert_winner #winner2 {
    width: 400px;
    display: block;
    margin: auto;
  }
}