*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;   
}
body{
    background-color: #e6d5e6;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
}
.title{
    font-size: 50px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.60);
}
.container{
    width: 550px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    margin-top: 10px;
}
.container .win{
    display: flex;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    border-radius: 7px;
}
.container .win div{
    width: 50%;
    padding: 15px 0;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    font-family: 'Gemunu Libre', sans-serif;   
}
.container .win div span{
    margin: 0 5px;
}
.container .win .o-wins{
    background-color: #a80d2a;
    border-radius: 7px 0px 0px 7px;
}
.container .win .x-wins{
    background-color: #183153;
    border-radius: 0 7px 7px 0;
}
.container .start{
    width: 100%;
    padding: 25px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    margin-top: 30px;
    border-radius: 10px;
    font-family: 'Gemunu Libre', sans-serif;
    display: flex;  
    flex-direction: column;
    align-items: center;
    justify-content: center;
    display: block; 
}
.container .start h2{
    font-size: 30px;
    text-align: center;
}
.start .button{
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 30px;
}
.start .button button{
    padding: 20px 30px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    font-size: 25px;
    border-radius: 10px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    transition: 0.5s;
}
.start .button button:first-child{
  background-color: #a80d2a;
}
.start .button button:last-child{
    background-color: #183153;
}
.start .button button:hover{
    transform: scale(0.90) ;
}
.container .main{
    margin-top: 30px;
    display: none;
}
.container .main .border{
    padding: 25px;
    margin-top: 30px;
    width: 100%;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    position: relative;
}
.container .main .border .turn-button{
    display: flex;
    height: 60px;
    width: 310px;
    margin: auto;
    border-radius: 7px;
    box-shadow: 0 0 15px rgba(31, 38, 135, 0.37);
    position: relative;   
}
.container .main .border .turn-button button{
    height: 100%;
    width: 50%;
    border-radius: 7px;
    outline: none;
    border: none;
    background: transparent;
    font-size: 25px;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.60);
}
.container .main .border .turn-button .o-turn{
    left: 155px;
    z-index: 3;
    color: #000;
}
.container .main .border .turn-button .showChange{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    border-radius: 7px;
    background-color: #183153;
    z-index: 1;
    transition: 0.2s;
}
.border .btns{
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    width: 100%;
}
.border .btns .btn{
    width: calc(500px/3 - 25px);
    height: calc(500px/3 - 25px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    font-weight: bold;
    color: #fff;
    transition: 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    background-color: rgba(255, 255, 255, 0.15);
}
.border .btns.x .btn:hover::before{
    content: 'X'
}
.border .btns.x .btn:hover{
    background-color: #183153;
    color: #fff;
}
.border .btns.o .btn:hover::before{
    content: 'O'
}
.border .btns.o .btn:hover{
    background-color: #a80d2a;
    color: #fff;
}

.container .winner{
    width: 100%;
    padding: 25px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    margin-top: 30px;
    border-radius: 10px;
    font-family: 'Gemunu Libre', sans-serif;
    display: flex;  
    flex-direction: column;
    align-items: center;
    justify-content: center;
    display: none;
}
.winner h2{
    font-size: 35px;
    font-family: 'Gemunu Libre', sans-serif;
}
.winner h2 .winnerText{
    font-size: 50px;
    color: #183153;
}
.winner .button{
    width: 100%;
    text-align: center;
    margin-top: 25px;
}
.winner button{
    background-color: #a80d2a;
    color: #fff;
    padding: 15px 30px;
    border: none;
    border-radius: 7px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 35, 0.37);
    font-size: 20px;
    transition: 0.2s;
}
.winner button:hover{
    transform: scale(0.90);
}


.container .main .border .timer{
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 5px;
    background-color: #183153;
    animation: animate 4s linear forwards;  /* ..... */
}
@keyframes animate{
  from{
    width: 0%;
  }
  to{
    width: 100%;
  }
}
@media (max-width: 500px) {
    .container{
        width: 95%;
    }
    .container .win .o-wins{
        font-size: 17px;
    }
    .container .win .x-wins{
        font-size: 17px;
    }
    .start .button {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px; /* مسافة بين الأزرار */
    }
    .start .button button {
        width: 80%; /* تصغير عرض الزر */
        max-width: 200px;
    }
    .border .btns {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    .border .btns .btn {
        width: 100%;
        height: 100px; /* ارتفاع مناسب */
        font-size: 40px; /* تصغير حجم الخط */
    }
    .container .main .border .turn-button {
        width: 90%;
        max-width: 300px;
    }
    .container .main .border .turn-button .o-turn {
        left: 50%;
        transform: translateX(-50%);
    }
    .title {
        font-size: 25px;
    }
    .winner h2 {
        font-size: 22px;
    }
    .winner h2 .winnerText {
        font-size: 30px;
    }
    
    .container .main .border .turn-button .o-turn{
        left: 180px;
        z-index: 3;
        color: #000;
    }
    .container .main .border .turn-button .showChange{
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 50%;
        border-radius: 7px;
        background-color: #183153;
        z-index: 1;
        transition: 0.2s;
    }   
}    