* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-family: sans-serif;
}

header {
  background-color: #eee;
}

h1 {
  text-align: center;
  margin-bottom: 1em;
  padding: 0.5em;
}

button {
  outline: none;
}

.modal {
  display: none;
  z-index: 1000;
}

.modal-bg {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  height: 12em;
  width: 20em;
  padding: 0.5em;
  padding-top: 1em;
  background-color: #fefefe;
  border: 1px solid #eee;
  border-radius: 6px;
  z-index: 1000;
  position: relative;
  overflow: hidden;
}

.modal-box-content {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}

.modal-box-message {
  font-weight: 300;
  z-index: 1000;
}

.modal-box-share-link {
  display: none;
  font-size: 12px;
  background-color: #eee;
  padding: 3px;
}

.modal-enter-name {
  display: none;
  padding: 0.3em;
  font-size: 1em;
}

.modal-box-button,
.modal-box-button-next,
.modal-box-button-start {
  background-color: blue;
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 1em 1.5em;
  cursor: pointer;
  z-index: 1000;
}

.modal-box-button-next,
.modal-box-button-start {
  display: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.player-names {
  margin: 2em;

  display: flex;
  justify-content: space-around;
  align-items: center;
}

.player1,
.player2 {
  letter-spacing: 1px;
  padding: 0.7em 1em;
  border-radius: 5px;
  border: 2px solid black;
  background-color: #eee;
  opacity: 0.4;
  transition: all 0.5s;
}

.name-active {
  background-color: #e1dfff;
  border-color: #1717ff;
  color: #1717ff;
  opacity: 1;
}

.rules-heading {
  text-align: center;
  margin: 0.4em;
}

.rules-list-item {
  padding: 0.3em;
}

.game {
  margin-bottom: 3em;
}

.game-grid {
  height: 30em;
  width: 30em;
  border: 1px solid #333;

  display: grid;
  grid-template-rows: repeat(3, 1fr);
  grid-template-columns: repeat(3, 1fr);
}

.square {
  border: 1px solid #333;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
  z-index: 100;
}

.square:hover {
  background-color: #f1f1f1;
}

.cross,
.cross::after {
  width: 6em;
  height: 5px;
  background-color: #333;
}

.cross {
  transform: rotate(45deg) translateX(4.7em) translateY(2em);
}

.cross::after {
  content: "";
  transform: rotate(90deg) translateX(-1px) translateY(0.25em);
  position: absolute;
}

.nought {
  height: 5em;
  width: 5em;
  border: 5px solid #333;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}

.nought,
.cross,
.cross::after {
  pointer-events: none;
}

footer {
  background-color: #eee;
}

.footer {
  height: 9em;

  display: grid;
  grid-template-rows: 1fr 2.5em;
  grid-template-columns: 1fr max-content 1fr;
  justify-items: center;
  align-content: center;
}

.footer-copyright {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

.footer-link {
  grid-column: 2;
}

@media only screen and (max-width: 550px) {
  .game-grid {
    font-size: 10px;
  }
  .player-names {
    margin: 2em 0.3em;
  }
  .rules-list {
    margin: 1.5em;
  }
}

/**************************************************/

.top-right {
  position: absolute;
  right: 0;
  top: 0;
}

.top-left {
  position: absolute;
  left: 0;
  top: 0;
}

.image-devil,
.image-angel {
  height: 3em;
  margin-right: 1em;
  opacity: 0;
  transition: all 0.3s ease 0.4s;
}

.image-devil {
  transform: scaleX(-1);
  filter: FlipH;
}

.image-angel {
}

.image-devil:hover,
.image-angel:hover {
  opacity: 1;
}

.mod-list {
  position: absolute;
  right: 5em;
  top: 19em;
  padding: 1em;
  background-color: #fff;
  height: 30em;
  width: 20em;
  border: 1px solid #000;
  border-radius: 5px;
  opacity: 0;
}

.mod-list:hover {
  opacity: 1;
}

.mod-list > label,
.mod-list > h2,
.mod-list > h3 {
  padding-bottom: 0.7em;
}

.mod-list > input {
  margin-right: 0.3em;
}

h3 {
  margin-top: 1em;
}

.move-square-left-2 {
  transform: translateX(-20em);
}

.move-square-left-3 {
  transform: translateX(-30em);
}

.move-square-right-2 {
  transform: translateX(20em);
}

.highlight-square,
.highlight-square:hover {
  background-color: #f77e7e;
}

.modal-box-ad {
  height: 20em;
  width: 24.1em;
  background-image: url("../images/ad.png");
  background-size: cover;
}
