@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;900&family=Josefin+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #fff;
    --first-color: #FAA916;
    --body-color: linear-gradient(to right, #665687, #2e1655);
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--body-color);
    height: 100vh; 
}

header{
    text-align: center;
}

.select-box, .play-board , .result-box, .play, .menu, .modo{
    position:absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    transition: all 0.3s ease;
}

.menu{
    z-index: 1;
}

.menu,
.modo{
    background: var(--primary-color);
    padding: 20px 25px 25px;
    border-radius: 5px;
    max-width: 330px;
    width: 100%;
}

.menu.hide,
.modo.hide{
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%,-50%) scale(0.9);
}

.select-box{
    background: var(--primary-color);
    padding: 20px 25px 25px;
    border-radius: 5px;
    max-width: 330px;
    width: 100%; 
    display: none;

}

.menu header,
.modo header,
.select-box header {
    font-size: 23px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.menu .title,
.modo .title,
.select-box .title{
    font-size: 18px;
    font-weight: 500;
    margin: 20px 0;
    text-align: center;
}

.menu .option,
.modo .option,
.select-box .option{
    display: flex;
    width: 100%;
}

.option button{
    width: 100%;
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    margin: 3px;
    border: none;
    outline: none;
    background: var(--first-color);
    border-radius: 5px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option button:hover,
.result-box .btn button:hover{
    transform: scale(1.05);
}

.option .opS,
.option .playerX{
    margin-right: 5px;
}

.option .opN,
.option .playerO{
    margin-left: 5px;
}


.play-board{
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%,-50%) scale(0.9);
   
}

.play-board.show{
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%,-50%) scale(1);
   
}

.play-board .details,
.play-board .scoreboard{
    background: var(--primary-color);
    padding: 7px;
    border-radius: 5px;
}

.play-board .details .players,
.play-board .scoreboard .points{
    display: flex;
    width: 100%;
    position:relative;
    justify-content: space-around;
}

.scoreboard .points span{
    background-color: var(--first-color);
    color:  var(--primary-color);
    width: 100%;
    border-radius: 5px;
    padding: 7px 0;
    margin: 0 5px 0 5px;
    font-size: 19px;
    font-weight: 500;
    cursor: default;
    text-align: center;
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}

.play-board .details span{
   color: var(--first-color);
    width: 100%;
    border-radius: 5px;
    padding: 7px 0;
    font-size: 19px;
    font-weight: 500;
    cursor: default;
    text-align: center;
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}

.details span:first-child{
    color: var(--primary-color);
}

.details .slider{
    position: absolute;
    top:0;
    left: 0;
    height: 100%;
    width: 50%;
    background: var(--first-color);
    border-radius: 5px;
    z-index: 2;
    transition: all 0.3s ease;
}

.players.active span:first-child{
    color: var(--first-color);
}

.players.active span:nth-child(2){
    color: var(--primary-color);
}

.players.active .slider{
    left: 50%;
}

.play-board .play-area{
    margin-top: 20px;
}

.play-board section{
    display: flex;
}

.play-board section span{
    display: block;
    margin: 2px;
    height: 80px;
    width: 80px;
    background: var(--primary-color);
    border-radius: 5px;
    font-size: 40px;
    text-align: center;
    line-height: 80px;
    color: var(--first-color);
}

.result-box{
    background: var(--primary-color);
    padding: 20px;
    border-radius: 5px;
    max-width: 350px;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50% , -50%) scale(0.9);
}

.result-box.show{
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%,-50%) scale(1);
}

.result-box .won-text{
    font-size: 25px;
    font-weight: 500;
    display: flex;
    justify-content: center;
}

.result-box .won-text p {
    font-weight: 600;
    margin: 0 3px;
}

.result-box .btn {
    display: flex;
    margin-top: 20px;
    justify-content: center;
}

.result-box .btn button {
    width: 100%;
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    margin: 3px;
    border: none;
    outline: none;
    background: var(--first-color);
    border-radius: 5px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .menu,
    .modo,
    .select-box,
    .play-board,
    .result-box {
        max-width: 80%;
        justify-content: center;
    }
    .option .playerO,
    .option .playerX{
        font-size: 15px;
    }
    .result-box .won-text{
        font-size: 20px;
        font-weight: 500;
        display: flex;
        justify-content: center;
    }
}