* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 1.5rem;
  background-image: radial-gradient(rgb(233, 207, 137), rgb(156, 136, 85));
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  margin: auto;
  min-height: 100vh;
  width: min(100vw, 40rem);
  border-left: 2px solid rgb(77, 65, 1);
  border-right: 2px solid rgb(77, 65, 1);
  background-color: #F5F5DC;
  box-shadow: 0px 0px 10px 4px rgb(0 0 0 / 20%);
}

.remove_decoration{
  text-decoration: none;
  color: black;
}

h1 a{
  display: inline-block;
}

h1 a:hover{
  transform: scale(1.2);
  color: #C49A00;
}

.last{
  font-size: .6rem;
  padding: 1.5em 1.5em 1em;
  text-align: center;
}

.center{
  display: flex;
  flex-direction: column;

  align-items: center;
  gap: 3rem;
}

body p,
body ol{
  margin: 0rem 10%;
  text-indent: 1rem;
}

.begin {
  font-size: 5rem;
  border: 3px solid rgb(77, 65, 1);
  width: 12rem;
  height: 12rem;
  display: grid;
  place-content: center;
  margin: 10% auto;
  background-color: bisque;
  border-radius: 30%;
  box-shadow: 0px 0px 10px 4px rgb(0 0 0 / 20%);
  text-decoration: none;
}

.begin:hover{
  box-shadow: 0px 0px 10px 12px rgb(0 0 0 / 20%);
  transform: scale(1.02);
}

.begin::after{
  position: relative;
  font-size: .5rem;
  content: "designed by freepik";
  text-decoration: none;
  color: black;
  top: 2rem;
  left: 3rem;
}

body h1 {
  text-align: center;
  padding-top: 2rem;
}

.board{
  /*min-width: 30vw;*/
  width: min(90%, 30rem);
  aspect-ratio: 1/1;
  margin: 4% 13%;
  border: 2px solid rgb(0, 0, 0);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.buttons{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: min(90%, 30rem);
  margin: 0% 13%;
  padding-bottom: .5rem;
}

.buttons.end{
  margin-top: 9rem;
}

.buttons a,
.buttons button{
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid rgb(124, 112, 0);
  padding: 5px;
  border-radius: .5rem;
  color: black;
  background: whitesmoke;
}

.buttons a:hover,
.buttons button:hover{
  background: rgba(56, 42, 2, 0.24);
}

.square{
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  justify-items: center; /* horizontally center */
  align-items: center;   /* vertically center */
}

.square img{
  width: 100%;
  height: 100%;
  z-index: 2;
  
}

.square.white{
  background-color: antiquewhite;
}

.square.black{
  background-color: #B65A2D;
}

.square.ai_selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(255, 136, 0, 0.3); /* translucent orange */
  pointer-events: none; /* allow clicks to pass through */
  z-index: 1;
}

.square.CHECK::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(255, 0, 0, 0.651); /* translucent red */
  pointer-events: none; /* allow clicks to pass through */
  z-index: 1;
}

/*cascading rules makes our click have yellow priority*/
.square.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 0, 0.336); /* translucent yellow */
  pointer-events: none; /* allow clicks to pass through */
  z-index: 1;
}

.square:hover{
  outline: 3px solid red;
  z-index: 1;
  border-radius: .3rem;
}

.popup{
  border: 2px solid rgb(124, 112, 0);
  width: min(90%, 36rem);
  height: 40vh;
  border-radius: 70px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: 200ms ease-in-out;
  background-color: aliceblue;
  z-index: 5;
}

.popup.active{
  transform: translate(-50%, -50%) scale(1);
}

#overlay{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.63);
  transition: 200ms ease-in-out;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

#overlay.active{
  pointer-events: all;
  opacity: 1;
}

.popup .header{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 2.3rem 2rem 0rem 2rem;
  font-size: 1.5rem;
  font-weight: 400;
}

.popup .close{
  font-size: 3rem;
  font-weight: 900;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

.popup .pieces{
  display: flex;
  flex-direction: row;
  gap: 3vw;
  padding: 1.5rem 2rem 1.5rem 2rem;
}

.popup .pieces button{
  flex-grow: 1;
  aspect-ratio: 1/1;
  border-radius: 10%;  
  
}

.popup .pieces button:hover{
  background-color: hsl(0, 0%, 70%); 
}

.popup img{
  width: 100%;
}



