/*
We want to have the game div in the middle of the screen.

height&width 100vh makes the body take the full viewport.
[margin: 0] and [padding: 0]removes default margins&paddings.
Flexbox centers it both horizontally and vertically

It is possible to use instead:
[display: grid; place-items: center;]
The flexbox approach is probably more widely supported,
while the Grid approach with place-items: center is more concise.
*/
body {
  background-color: rgb(250, 250, 250);
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed !important;
  display: flex;
  justify-content: center;
  align-items: center;
}
/*
min(100vw, 100vh) ensures the square fits within both screen dimensions.
If your game isn't square, you can change the aspect ratio, see [aspect-ratio: 1].
We give it [position: relative] so that the inside elements can be [position:absolute].
*/
.game {
  width: min(100vw, 100vh);
  height: min(100vw, 100vh);
  aspect-ratio: 1;
  position: relative;
}

/* To prevent long-press that will bring up copy-paste dialog.
user-select: none prevents text selection
-webkit-touch-callout: none specifically prevents the iOS long-press callout
-webkit-tap-highlight-color: transparent removes tap highlights on mobile
*/
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -moz-touch-callout: none;
  -ms-touch-callout: none;
  outline: 0; /* To prevent blue-box outline after click: http://stackoverflow.com/questions/21719306/getting-rid-of-a-blue-box-around-button-when-pressed */
}
textarea,
input {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* For tictactoe, to make a right/bottom border.
E.g., to make:

X| |
-----
 | |
-----
O| |

We add right&bottom borders to the top-left cell (with X),
but only right borrder to the bottom-left cell (with O), etc.
*/
.border_right {
  border-right: min(1vw, 1vh) solid black;
}
.border_bottom {
  border-bottom: min(1vw, 1vh) solid black;
}
.row {
  position: absolute;
  left: 0%;
  width: 100%;
}
.column {
  position: absolute;
  top: 0;
  height: 100%;
}

.max_size {
  width: 100%;
  height: 100%;
}

svg {
  width: 100%;
  height: 100%;
}

/* CSS animations to make the X/O appear slowly
   (the opacity will change from 0.1 to 1 in 0.5s). */
.slowly_appear {
  animation: slowly_appear 0.5s linear;
}

@keyframes slowly_appear {
  from {
    opacity: 0.1;
  }
  to {
    opacity: 1;
  }
}
