body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: url('images/bg.jpg');
    background-size: contain;
    background-position: center;
    font-family: Arial, sans-serif;
    background-repeat: no-repeat;
    background-color: black;
    overflow: hidden;
}

.game-wrapper {
    position: relative;
    width: 320px;
    height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reel-container {
   width: 350px;       
    height: 300px;        
    overflow: hidden;     
    border-radius: 15px;
    padding: 0;           
    position: absolute;
    top: 41%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: content-box;
}

.reels-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 10px;
    transition: background-color 0.5s; 
}

.reel-window {
    width: 33.33%;
    height: 100%; 
    overflow: hidden; 
    position: relative;
    border: 3px solid white; 
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3); 
}

.reel-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reel-col img {
    width: 100%;          
    height: 100px;        
    object-fit: contain;  
    padding: 8px;        
    box-sizing: border-box; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: block;      
    transition: opacity 0.5s, filter 0.5s; 
}


.reels-wrapper.dimmed .reel-col img {
    opacity: 0.7;
    filter: grayscale(40%) brightness(80%);
}

.reels-wrapper.dimmed .reel-col img.winner-effect {
    opacity: 1 !important;
    filter: none !important;
    z-index: 50;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); 
}

@keyframes winPulse {
    0% {
        box-shadow: inset 0 0 0 2px rgb(248, 248, 248), inset 0 0 10px rgba(255, 255, 255, 0.5);
        background-color: rgba(255, 255, 0, 0.1);
    }
    50% {
        box-shadow: inset 0 0 0 5px rgb(255, 255, 255), inset 0 0 20px rgba(255, 255, 255, 0.6);
        background-color: rgba(255, 255, 255, 0.4); 
    }
    100% {
        box-shadow: inset 0 0 0 2px rgb(255, 255, 255), inset 0 0 10px rgba(255, 255, 255, 0.5);
        background-color: rgba(255, 255, 0, 0.1);
    }
}

.winner-effect {
    animation: winPulse 0.8s infinite;
    border-radius: 5px;
    position: relative;
    background-color: white;
}

.winner-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 100px;        
    background-color: rgba(255, 215, 0, 0.05);
    z-index: 10;
    pointer-events: none;
    box-sizing: border-box;
}

.spinning {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
    width: 100%;
    text-align: center;
}

#spinBtn {
    max-width: 250px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.1s;
    margin: 0 auto;
}

#spinBtn:active { transform: scale(0.95); }


.popup {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.try-popup-1, .try-popup-2, .win-popup {
    display: none; position: relative; width: 90%; max-width: 400px; text-align: center;
}
.popup-banner { width: 100%; display: block; }
.popup-btn {
    width: 50%; max-width: 180px; display: block;
    margin: -50% auto 0 auto; position: relative;
    cursor: pointer; z-index: 101;
}

.popup a{
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 100%;
}

@media(min-width:1400px){
  .reel-container{
      width: 395px;
      left: 49%;
  }
  .spinning{top: 109%;}
}
@media(max-width:500px){
    .reel-container{ left: 48%; }
    .spinning img{max-width: 200px!important;}
    body{
      background-size: cover;
    }
}
@media screen and (max-width: 340px) {
    .game-wrapper { transform: scale(0.85); }
}
@media screen and (max-height: 600px) {
    .game-wrapper { transform: scale(0.7); }
}