/* --- GLOBAL STYLES START --- */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Baloo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;

}

body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    background-image: url("./../img/garden2.jpg");
    background-size: cover;
    background-repeat: repeat;
    min-height: 100vh;

}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Disable right-click context menu */
body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

table {
    background: white;
}

table tr td {
    padding: 8px;
}

button {
    padding: 8px;
}

/* --- GLOBAL STYLES END --- */


.menu__container {
    position: relative;
    top: 130%;
    padding: 20px;
    width: 360px;
    display: flex;
    gap: 15px;
    flex-direction: column;
    z-index: 99;
}


@media (max-width: 768px) {
    .menu__container {
        padding: 15px;
        gap: 10px;

        width: 260px;

    }
}

@media (max-width: 480px) {
    .menu__container {
        padding: 10px;
        gap: 5px;
        width: 100%;
        width: 160px;

    }
}


.menu__container button {
    padding: 16px;
    background: rgb(43, 139, 19);
    color: white;
    text-transform: uppercase;
    box-shadow: none;
    transform: skew(0deg, 0deg);
    font-size: 1.4em;
}


#playground {
    position: relative;
    display: none;
    width: 100%;
    z-index: 99;
}


#boardWrapper {
    position: relative;
    height: 0px;
    padding-top: 100%;
    background-color: blue;
}

#gameBoard {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("./../img/bg.jpg");
    background-repeat: no-repeat;
    background-size: cover;
}

#gameBoard::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: saddlebrown;
    z-index: -1;
    transform: scale(1.075);
    border-radius: 8px;
}



.controller {
    position: fixed;
    top: 0px;
    left: 0px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: saddlebrown;
    padding: 10px;
    border-radius: 10px;
}

.controller button {
    width: 80%;
    height: 80%;
    border-radius: 50%;
}

.controller button:disabled {
    opacity: 0.25;
}

#gameController {
    position: absolute;
    bottom: 0px;
    right: -110px;
    background-color: saddlebrown;
    padding: 15px;
    border-radius: 10px;
}

#gamePodium {

    display: none;
    gap: 15px;
    flex-direction: column;
    position: absolute;
    top: -10px;
    left: -110px;
    /* background-color: rgba(255, 255, 255, 0.85); */
    background: linear-gradient(0deg, saddlebrown, saddlebrown);
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 5px;
    border: 5px solid saddlebrown;
}

#gamePodium .podium {
    position: static !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}




#superplay:disabled {
    opacity: 0;
}

#startingLinePlayers {
    position: absolute;
    background-color: saddlebrown;
}


#superplay {
    width: 50px;
    height: 50px;
    border: none;
    padding: 0;
    background-color: transparent;
    border-radius: 5px;

}

#dice1,
#dice2 {
    width: 50px;
    height: 50px;
    background-image: url("./../img/dice.webp");
    background-position: 380px 110px;
    background-size: 396px;
    border-radius: 5px;
    border: 1px solid black;
}

.tray1 {
    /* position: absolute;
    bottom: -110px;
    left: -10px;
    width: 200px;
    height: 80px;
    padding: 20px;

    background-color: #c98a47;
    border: 0px solid #82532a;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; */

    position: absolute;
    bottom: -25%;
    left: -10px;
    width: 60%;
    height: 20%;
    padding: 20px;
    background-color: #c98a47;
    border: 0px solid #82532a;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}



.tray2 {

    position: absolute;
    top: -25%;
    right: -10px;
    width: 60%;
    height: 20%;
    padding: 20px;

    background-color: #c98a47;
    border: 0px solid #82532a;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* .playerImg1 {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
} */

.playerImg1 {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 2% 4%;
    /* Adjust padding as a percentage of the parent container */
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 0.8em;
    /* Font size relative to the parent element */
    margin: 1% 0.5%;
    /* Adjust margin as a percentage */
    cursor: pointer;
    border-radius: 0.5em;
    /* Border radius relative to font size */
    box-shadow: 0 0.2em 0.5em rgba(0, 0, 0, 0.1);
    /* Box shadow relative to font size */
    transition: all 0.2s ease-in-out;
}


/* .player {
    position: absolute;
    bottom: -95px;
    left: 0px;
    background-image: url("./../img/pieces.jpg");
    background-repeat: no-repeat;
    background-size: 195px 120px;
    background-position: 0px 0px; 
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transform: scale(0.7);
    border-radius: 50%; */
/* animation-name: rotate;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear; */
/* z-index: 1;
    
} */

.player {
    width: 8vw;
    /* Width relative to viewport width */
    height: 8vw;
    /* Height relative to viewport width */
    position: absolute;
    bottom: -20%;
    /* Position relative to parent */
    left: 0;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    border-radius: 50%;
    transform: scale(0.7);
    z-index: 1;

}

.player .player-name {
    position: absolute;
    top: -25px;
    left: 0;
    padding: 2px;
    background: white;
    border-radius: 5px;
}

.player::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;

}

.player.active {
    box-shadow: 0px 0px 7px 4px goldenrod;
    animation-name: animate;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes animate {
    0% {
        /* transform: scale(0.7) rotate(0deg); */
        box-shadow: 0px 0px 0px 0px goldenrod;
        transform: scale(0.7);
    }


    50% {
        box-shadow: 0px 0px 5px 6px goldenrod;
        transform: scale(0.6);

    }

    100% {
        /* transform: scale(0.7) rotate(360deg); */
        box-shadow: 0px 0px 0px 0px goldenrod;
        transform: scale(0.7);
    }
}

@keyframes rotate {
    0% {
        transform: scale(0.7) rotate(0deg);
    }

    100% {
        transform: scale(0.7) rotate(360deg);
    }
}


#red {
    background: red;
    border: 1px solid white;
}

#green {
    background: green;
    border: 1px solid white;
}

/* 
#blue {
    background: blue;
    border: 1px solid white;
}

#yellow {
    background: yellow;
    border: 1px solid white;
} */

#computer {
    background: black;
    border: 1px solid white;
}

#resetBtn {
    position: fixed;
    border: 1px solid rgb(206 212 204);
    background-color: rgb(206 212 204);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    left: 10px;
    top: 15px;
    opacity: 0;
    z-index: 100;
}

#redPlayerPiece {
    /* background-position-y: -70px; */
    background-image: url("./../img/red.jpg");

    /* background-size: 120px 90px; */
}

#greenPlayerPiece {
    /* background-position-y: -70px;
    background-position-x: -70px;
    left: 50px; */
    background-image: url("./../img/green.jpg");

}

#computerPlayerPiece {
    /* left: 50px;
    display: none; */
    background-image: url("./../img/green.jpg");

}



@media screen and (min-width: 0px) {
    #playground {
        padding: 95px 20px;
        max-width: 340px;
        min-width: 175px;
    }


    #redPlayerPiece {
        width: 10%;
        height: 10%;
        position: absolute;
        bottom: -95px;
        left: 0px;
        background-image: url("./../img/red.jpg");
        background-repeat: no-repeat;
        background-size: contain;
        /* Auto-scale background image to fit the element */
        background-position: center;
        /* Center the background image */
        border-radius: 50%;
        transform: scale(0.7);
        z-index: 1;
    }

    #greenPlayerPiece {
        position: absolute;
        bottom: -95px;
        left: 0px;
        background-image: url("./../img/green.jpg");
        background-repeat: no-repeat;
        background-size: contain;
        /* Auto-scale background image to fit the element */
        background-position: center;
        /* Center the background image */
        border-radius: 50%;
        transform: scale(0.7);
        z-index: 1;
        width: 10%;
        height: 10%;

    }



    #computerPlayerPiece {

        width: 10%;
        height: 10%;
        position: absolute;
        bottom: -95px;
        left: 0px;
        background-image: url("./../img/green.jpg");
        background-repeat: no-repeat;
        background-size: contain;
        /* Auto-scale background image to fit the element */
        background-position: center;
        /* Center the background image */
        border-radius: 50%;
        transform: scale(0.7);
        z-index: 1;
    }


    .controller {
        /* position: absolute;
        flex-direction: row;
        left: 50%;
        top: unset;
        bottom: -80px;
        transform: translateX(-50%);
        justify-content: center;
        gap: 15px; */

        position: absolute;
        flex-direction: row;
        left: 80%;
        top: unset;
        bottom: 5.4%;
        transform: translateX(-60%);
        justify-content: center;
        gap: 10%;
    }

    #gameController {
        display: flex;
        align-items: center;
        right: -17px;
        bottom: -110px;
        gap: 10px;
        flex-direction: row-reverse;
        width: 107%;
    }

    #gamePodium {
        flex-direction: row;
        left: -20px;
        top: -110px;
    }

}



/* Ensure the body covers the full viewport */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    /* Optional: hides scrollbars during loading */
}

/* Loader styles */
.loader {
    /* border: 16px solid #f3f3f3; */
    /* Light grey */
    /* border-top: 16px solid #3498db; */
    /* Blue */
    /* border-radius: 50%; */
    /* width: 120px; */
    /* height: 120px; */
    font-size: 1.8em;
    position: fixed;
    color: white;
    /* top: 50%;
    left: 50%; */
    /* transform: translate(-50%, -50%); */
    /* animation: spin 1.5s linear infinite; */
    z-index: 1000;
    /* Ensure it is above other content */
    display: none;
    /* Hide loader initially */
}


#loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 70%);
    /* Dark transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Ensure it is above other content */
    display: none;
    /* Initially hide the loader */
}


/* Full screen white background during loading */

/* Show loader when body has 'loading' class */
.loader-container,
.loader {
    display: block;
}



.popup {

    opacity: 0;
    transition: opacity 0.3s ease;

    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    /* Change to fixed for better responsiveness */
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.5); */
    background-color: rgb(0 0 0 / 75%);
    z-index: 10000;
    top: 0;
    left: 0;


}

.popup-content {
    background-color: white;
    border-radius: 10px;
    padding: 5%;
    /* Increased padding for better spacing */
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    /* position: relative; */
    /* max-width: 80%; */
    max-width: 600px;
    /* Ensure it doesn't exceed viewport width */
    /* max-height: 90%; */
    /* Ensure it doesn't exceed viewport height */
    overflow: auto;
    /* Handle overflow within the popup */
    /* width: 300px; */
    width: 85%;

    /* Default width */
    /* height: 200px; */
    height: auto;

    /* Default height */



  
}

.checkmark {
    margin-bottom: 20px;
}

.popup-content p {
    color: #8b5e5e;
    font-size: 1.5em;
    padding: 3%;
    /* Percentage padding */
    margin: 10% 0;
    /* margin: 50px 0; */
    /* Adjusted margins for smaller screens */
}

.close-btn {
    background-color: #ddd;
    color: black;
    /* padding: 10px 20px; */
    padding: 3%;
    /* Percentage padding */
    margin: 10% 0;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    cursor: pointer;
}

.close-btn:hover {
    background-color: #333;
}





.popupBack {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.5);    */
     background-color: rgb(0 0 0 / 75%);

    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.popupBack-content {
    background-color: white;
    padding: 5%;
    /* Percentage padding */
    border-radius: 10px;
    /* Rounded corners */
    text-align: center;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 85%;
    /* Percentage width */
    max-width: 500px;
    /* Optional max-width */
    height: auto;
    /* Height will adjust according to content */
}

.popupBack-button {
    background-color: #ddd;
    color: black;
    padding: 3%;
    /* Percentage padding */
    margin: 10% 0;
    /* Percentage margins */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    /* Relative font size */
    width: 100%;
    /* Button takes full width of popupBack-content */
}

/* .popupBack-button:active {
    background-color: green;
    color: white;
} */