@import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto:wght@400;500&display=swap');

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

body{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #3C3744;
}

.wrapper{
    height: 100%;
    width: 100%;
    display: grid;
    gap: 20px;
    grid-template-rows: 0.2fr 0.2fr 0.2fr 2fr 1fr;
    align-items: center;
    justify-items: center;
}

.wrapper .header{
    width: 60%;
}

.header .title{
    color: #FBFFF1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0 1rem 0;
    font-size: clamp(1rem, 6vw, 2rem);
    font-weight: bold;
}

.difficulty{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 30%;
    padding: 10px;
}

.difficulty p {
    height: 1rem;
}

.difficulty button{
    border: 1px solid #FBFFF1;
    width: 7rem;
    border-radius: 10px;
    padding: 0.5rem 1rem 0.5rem 1rem;
    background: none;
    color: #FBFFF1;
}

.difficulty button:hover{
    background: #FBFFF1;
    color: #3C3744;
}

.turn{
    color: #FBFFF1;
}

.game-board{
    display: grid;
    grid-template-columns: repeat(3,90px);
    grid-template-rows: repeat(3, 90px);
}

.block{
    border: 2px solid #FBFFF1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.block:hover{
    background: #5b5763;
}

.block-0{
    border-top: none;
    border-left: none;
}
.block-3{
    border-left: none;
}
.block-6{
    border-left: none;
    border-bottom: none;
}

.block-1{
    border-top: none;
}

.block-7{
    border-bottom: none;
}

.block-2{
    border-top: none;
    border-right: none;
}

.block-5{
    border-right: none;
}

.block-8{
    border-right: none;
    border-bottom: none;
}

.game-start-dialog{
    display: grid;
    justify-items: center;
    align-items: center;
    border: none;
    top: 10%;
    border-radius: 10px;
    height: 30%;
    width: 30rem;
    margin: 0 auto 0 auto;
    background: #FBFFF1;
}

.game-start-dialog form{
    display: grid;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    gap: 20px;
}

.game-start-dialog form main{
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-start-dialog form footer{
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 20px;
}

.game-start-dialog form footer button{
    padding: 0.5rem 2rem 0.5rem 2rem;
    width: 10rem;
    border: none;
    border-radius: 10px;
    background: #3C3744;
    color:#FBFFF1;
    cursor: pointer;
}

.game-start-dialog form footer button:hover{
    background: #5b5763;
}

.game-end-dialog:not([open]){
    pointer-events: none;
    opacity: 0;
}

.game-end-dialog{
    display: grid;
    top: 42%;
    margin: 0 auto 0 auto;
    padding: 20px;
    width: 40%;
    border-radius: 10px;
    border: none;
    background: #FBFFF1;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.game-end-dialog form{
    display: grid;
    justify-items: center;
    align-items: center;
    grid-template-rows: 1fr 1fr 2fr;
    gap: 10px;
    width: 100%;
}

.game-end-dialog .txt{
    display: grid;
    width: 100%;
    height: 100%;
    text-align: center;
    align-items: center;
}

.game-end-dialog .btns{
    width: 100%;
    height: 100%;
    display: grid;
    justify-items: center;
    align-items: center;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.game-end-dialog button{
    width: 6rem;
    height: 2rem;
}

.game-end-dialog .reset-btn{
    border: 1px solid #3C3744;
    background: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.5s ease-out;
}

.game-end-dialog button:hover{
    border: none;
    background: #3C3744;
    color: #FBFFF1;
}

.game-end-dialog .no-btn{
    background: none;
    border: 1px solid #FD5635;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.5s ease-out;
}

.game-end-dialog .yes-btn{
    background: none;
    border: 1px solid #A0DF01;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.5s ease-out;
}

.players-name-input{
    display: none;
    position: absolute;
    height: 20rem;
    width: 20rem;
    border: none;
    border-radius: 10px;
    background: #FBFFF1;
    margin: auto;
}

.players-name-input form{ 
    display: grid;
    justify-items: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
}

.players-name-input form main{
    display: grid;
    gap: 10px;
}

.players-name-input form .player-one-container, .players-name-input form .player-two-container{
    display: grid;
    gap: 5px;
} 

.players-name-input form input[type='text']{
    border: none;
    border-radius: 10px;
    background: #3C3744;
    color: #FBFFF1;
    text-indent: 10px;
}

.players-name-input form button{
    padding: 10px 1rem 10px 1rem;
    background: #3C3744;
    border: none;
    border-radius: 10px;
    color: #FBFFF1;
    cursor: pointer;
}

.players-name-input form button:hover{
    background: #5b5763;
}

.not-clicked{
    width: 20rem;
    text-align: center;
}

@media screen and (max-width: 960px) {
    .game-start-dialog{
        height: 37%;
        width: 20rem;
    }
    .game-start-dialog form footer{
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 0px;
    }
}

@media screen and (min-width: 686px) and (max-width: 989px) {
    .reset-btn{
        grid-column: 1/3;
    }
}

@media screen and (max-width: 683px) {

    .game-end-dialog{
        width: 270px;
    }

}
  
.footer{
    width: 100%;
    display: flex;
    justify-content: center;
    align-self: flex-end;
    gap: 15px;
    padding-bottom: 20px;
}