body{
  height: 100%;
  background-color: rgb(46, 43, 43);
  margin-top: 20px;
    background-size: cover;       /* Make it cover the whole screen */
    background-repeat: no-repeat; /* Don't repeat */
    background-position: center;  /* Center it */
    height: 100vh;  
    
                  /* Ensure body takes full viewport height */
}

html{
  height: 100%;

}

.tictactoegrid{

  border: solid rgb(65, 59, 59);
  height: 100%;
  width: 550px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr ;
  opacity: 0.67;
}

.tictactoediv{
 
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 20px; /* spacing above grid */
  
}


.tictactoebutton:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}

.tictactoebutton2:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton3:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton4:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton5:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton6:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton7:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton8:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}
.tictactoebutton9:hover{
  transform: scale(1.1);
  border: solid rgb(255, 255, 255);
}

#X{
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
}
#X2{
  width: 100%;
  height: 100%;
  opacity: 0;
}
#X3
{
  width: 100%;
  height: 100%;
  opacity: 0;
}
#X4
{
    width: 100%;
  height: 100%;
  opacity: 0;
}
#X5
{
    width: 100%;
  height: 100%;
  opacity: 0;
}
#X6
{
    width: 100%;
  height: 100%;
  opacity: 0;
}
#X7
{
    width: 100%;
  height: 100%;
  opacity: 0;
}
#X8
{
    width: 100%;
  height: 100%;
  opacity: 0;
}
#X9
{
    width: 100%;
  height: 100%;
  opacity: 0;
}

.O{
   width: 100%;
  height: 100%;
}

.tictactoebutton{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
 
}

.tictactoebutton2{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}
.tictactoebutton3{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}
.tictactoebutton4{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

.tictactoebutton5{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

.tictactoebutton6{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

.tictactoebutton7{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

.tictactoebutton8{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

.tictactoebutton9{
  background-color: rgb(77, 68, 68);
  border: solid rgb(163, 136, 136);
  transition: all 0.2s;
}

#firstplayerwins {
display: flex;
align-self: center;
position: absolute;
left: 20%;
font-size: 35px;
text-shadow: 0px 0px 10px white;
color: white;

}

#secondplayerwins{
  position: absolute;
  right: 20%;
  display: flex;
  align-self: center;
  font-size: 35px;
  color: rgba(255, 255, 255, 0.808);
  text-shadow: 0px 0px 10px white;
}


.resetbutton{
  bottom: 0px;
 position: fixed;
 right: 48%;
 bottom: 10%;
 padding: 10px;
 border-radius: 4px;
 cursor: pointer;
 background-color: rgba(221, 204, 204, 0.199);
 box-shadow: 0px 0px 10px black;
 color: white;
 padding: 15px;
 text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.582);
 border: solid white 3px;
 transition: all 0.3s;
}

.resetbutton:hover{
  box-shadow: 2px 2px 3px rgba(255, 255, 255, 0.548);
  transform: scale(1.1)
}

#namewin1{
  position: absolute;
    position: absolute;
  top: 250px;
  left: 300px;
  color: rgba(255, 255, 255, 0.767);
  text-shadow: 0px 0px 5px;
  font-size: 25px;
  
}

#namewin2{
   position: absolute;
  right: 300px;
  top: 250px;
   color: rgba(255, 255, 255, 0.767);
  text-shadow: 0px 0px 5px;
  font-size: 25px;

}

@media(max-width:1072px){
.tictactoegrid{
  width: 400px;
  height: 400px;
}

#namewin1{
    left: 5%;
    top: 60%;
  }

    #namewin2{
    right: 5%;
    top: 60%;
  }


}

.container{
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering */
  align-items: center;     /* horizontal centering */
             /* full viewport height */
}

@media(max-width: 1400px)
{

  #namewin1{
    left: 15%;
    top: 50%;
  }

    #namewin2{
    right: 15%;
    top: 50%;
  }




}

@media(max-width:780px){

  .tictactoediv{
    
    width: 100%;
    grid-row: 1;
    grid-column: 2/3;
    align-items: center;
    justify-content: center;
    
    
  }
  html{
    height: 100%;
  }
  body{
    height: 100%;
  }

  .container{
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    display: grid;
      height: 100%;
  }

  #firstplayerwins{
    top: 70%;
  }
  
  #secondplayerwins{
   
    top: 70%;
  }
  
  #namewin1{
    left: 5%;
    top: 60%;
  }

    #namewin2{
    right: 5%;
    top: 60%;
  }

  .resetbutton{
    left: 48%;
    width: 60px;
    text-align: center;
    padding: 10px;
  }

  .tictactoegrid{
    grid-column: 2;
    grid-row: 1;
  }

}


.gamemodesdiv{
 left: 0;
 position: fixed;
  top: 25px;
  bottom: 25px;
  width: 200px;
 padding: 10px;
 border-radius: 4px;
  display: flex;
 background-color: rgba(221, 204, 204, 0.199);
 box-shadow: 0px 0px 10px black;
 color: white;
 padding: 15px;
 text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.582);
 border: solid white 3px;
 transition: all 0.3s;
  flex-direction: column;
  
}

.gamemodetitle{
  background-color: rgba(42, 41, 41, 0.936);
  height: 35px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 25px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.677);
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;   
}

.gamemodes{
  background-color: black;
  display: inline-block;
  height: 100%;
 background-color: rgba(30, 27, 27, 0.435);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
 justify-content: space-around;

}


.gamemode1{
  display: flex;
  justify-content: center;
  grid-row: 1;
    height: 45px;
    align-items: center;
  cursor: pointer;
  margin-top: 30px;
  background-color: rgb(175, 173, 173);
  box-shadow: 0px 0px 10px rgba(97, 85, 85, 0.622);
  padding: 15px;
  transition: all 0.3s;
  border: solid 1px rgb(146, 134, 134);
  font-family:Verdana, Geneva, Tahoma, sans-serif;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.527), rgba(0, 0, 0, 0.087))
}

.gamemode1:hover{
  transform: scale(1.1);
  box-shadow: 3px 3px 10px rgba(255, 255, 255, 0.437);
}

.gamemode2{
  display: flex;
  justify-content: center;
  grid-row: 2;
    height: 45px;
    align-items: center;
  cursor: pointer;
  margin-top: 30px;
  background-color: rgb(175, 173, 173);
  box-shadow: 0px 0px 10px rgba(97, 85, 85, 0.622);
  padding: 15px;
  transition: all 0.3s;
  border: solid 1px rgb(146, 134, 134);
  font-family:Verdana, Geneva, Tahoma, sans-serif;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.527), rgba(0, 0, 0, 0.087));
  transition: all 0.3s;
  
}

.gamemode2:hover{
    transform: scale(1.1);
  box-shadow: 3px 3px 10px rgba(255, 255, 255, 0.437);
}