*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --seablue: #03a4ff;
  --yellow: #fdae2b;
  --purple: #e705be;
  --green: #00ae3d;
  --orange: #ff493e;
  --cream: #f3d6ea;
  --grey: #5d6864;
}
* {
  font-family: "Syne Mono", monospace;
}
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
  margin: 0;
}
body {
  line-height: 1.5;
  min-height: 100vh;
  background-color: snow;
}
header {
  min-height: 5rem;
  text-align: center;
  background-color: var(--seablue);
}
header h1 {
  padding: 0.5rem;
  color: white;
  font-size: 2.5rem;
}
main {
  min-height: calc(100vh - 5rem - 3rem);
  margin-bottom: 1.5rem;
  animation: fadeIn 500ms ease-in-out;
}
.gameBoard {
  margin-top: 2rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
}
.gameBoard h2 {
  color: white;
  border: 1px solid white;
  background-color: var(--seablue);
  width: 30rem;
  text-align: center;
}
.gameBoard h2:first-child {
  font-size: 2rem;
  letter-spacing: 4px;
  border-radius: 1rem 1rem 0 0;
}
.gameBoard h2:last-child {
  border-radius: 0 0 1rem 1rem;
  text-indent: 100%;
}
.table {
  display: none;
  flex-direction: column;
  animation: fadeIn 700ms ease-in-out;
}
.board {
  width: 30rem;
  height: 30rem;
  display: none;
  background-color: var(--seablue);
  grid-template-columns: repeat(10, 2fr);
  grid-template-rows: repeat(10, 2fr);
}
.piece {
  border: 2px solid white;
  transition: background-color 300ms ease-in-out;
}
.opponent .piece:hover {
  background-color: var(--green);
}
.pop {
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}
.replacement {
  display: grid;
}
.rotate {
  font-size: 2rem;
  background-color: var(--yellow);
  padding: 0.5rem;
  color: white;
  outline: none;
  border: none;
  cursor: pointer;
  transition: background-color 500ms ease-in-out;
}
.rotate:hover {
  background-color: var(--green);
}
.ship {
  background-color: var(--yellow);
}
.shot {
  background-color: var(--orange);
}
.hit {
  background-color: var(--green);
}
.sunked {
  background-color: var(--grey);
}
.hide {
  background-color: var(--seablue);
}
.pie {
  border: 2px solid white;
}
.hvr {
  background-color: var(--yellow);
}
.disable {
  cursor: not-allowed;
  pointer-events: none;
}
.piece.ship.shot:hover {
  background-color: var(--orange);
}
.piece.ship.shot.sunked:hover {
  background-color: var(--grey);
}
.winnerPop {
  display: none;
  justify-content: center;
  flex-direction: column;
  padding: 4rem;
  position: fixed;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  gap: 2rem;
  z-index: 6;
  background-color: var(--seablue);
  border: 5px solid var(--yellow);
  animation: fadeIn 700ms ease-in-out;
}
.winnerPop h1 {
  font-size: 3rem;
  color: white;
}
.winnerPop button {
  padding: 0.5rem;
  font-size: 1.3rem;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: var(--yellow);
  color: white;
  transition: background-color 700ms ease-in-out;
}
.winnerPop button:hover {
  background-color: var(--green);
}
.show {
  display: flex;
}
footer {
  bottom: 0;
  width: 100%;
  height: 3rem;
  background-color: var(--seablue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: white;
}
.fab {
  color: white;
  cursor: pointer;
  font-size: 5vh;
  transition: color 500ms ease-in-out;
}
.fab:hover {
  color: var(--yellow);
}
.overlay-active {
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 5;
  background-color: rgba(0, 0, 0, 0.7);
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@media screen and (max-width: 980px) {
  .board {
    width: 25rem;
    height: 25rem;
  }
  .gameBoard h2 {
    width: 25rem;
  }
}
@media screen and (max-width: 820px) {
  .gameBoard {
    flex-direction: column;
    align-items: center;
  }
  .playerNames {
    flex-direction: column;
  }
  .board {
    width: 30rem;
    height: 30rem;
  }
  .gameBoard h2 {
    width: 30rem;
  }
}
@media screen and (max-width: 500px) {
  .board {
    width: 25rem;
    height: 25rem;
  }
  .gameBoard h2 {
    width: 25rem;
  }
}
@media screen and (max-width: 425px) {
  .board {
    width: 20rem;
    height: 20rem;
  }
  .gameBoard h2 {
    width: 20rem;
  }
}
