@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

html {
  font-size: 62.5%;
}

body {
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.title {
  margin: 2rem 0;
  font-size: 3rem;
  letter-spacing: 0.8px;
}

.name-container {
  width: 80%;
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 1rem;
}

.name-container label {
  font-size: 1.8rem;
  font-weight: 600;
}

.name-input {
  border: none;
  border-radius: 0.6rem;
  padding: 1rem;
  background-color: #ededed;
  margin-bottom: 1.6rem;
  font-size: 1.6rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.bottom-buttons {
  width: 80%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.start-game-btn,
.restart-game-btn,
.finish-game-btn {
  margin: 0 auto;
  border: none;
  border-radius: 6px;
  padding: 1rem 2rem;
  font-weight: bold;
  font-size: 1.7rem;
  cursor: pointer;
  background-color: #1f1f1f;
  color: #ededed;
  transition: transform 0.3s ease-out, opacity 0.15s ease-out;
}

.restart-game-btn,
.finish-game-btn {
  margin: 2rem 0;
}

.start-game-btn:hover,
.restart-game-btn:hover,
.finish-game-btn:hover {
  opacity: 0.92;
}

.start-game-btn:active,
.restart-game-btn:active,
.finish-game-btn:active {
  transform: scale(0.97);
}

.game-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
}

.player__container {
  width: 80%;
  flex-direction: column;
}

.player__container-name,
.computer__container-name {
  text-align: center;
  margin-bottom: 1.6rem;
}

.player__container-board,
.computer__container-board {
  border: 1px solid #ededed;
  border-radius: 0.6rem;
  padding: 1rem;
  grid-template-columns: repeat(10, 1fr);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.computer__container {
  width: 80%;
  flex-direction: column;
}

.cell {
  border: 1px solid #cccccc;
  width: 100%;
  aspect-ratio: 1 /1;
}

.cell:hover {
  background-color: #d6d6d6;
  cursor: pointer;
}

.cell-empty {
  background-color: #fafafa;
}

.cell-ship {
  background-color: darkgreen;
}

.cell-miss {
  background-color: #d6d6d6;
}

.cell-hit {
  background-image: url('../icons/fire.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Responsive Design */
@media screen and (min-width: 640px) {
  .game-container {
    width: 80%;
  }

  .name-container {
    max-width: 70rem;
  }
}

@media screen and (min-width: 768px) {
  .game-container {
    width: 90%;
    flex-direction: row;
  }

  .bottom-buttons {
    width: 90%;
    justify-content: start;
    gap: 1rem;
  }
}

@media screen and (min-width: 1024px) {
  .game-container {
    flex-direction: row;
    max-width: 100rem;
  }

  .bottom-buttons {
    width: 40rem;
    justify-content: space-between;
    gap: 1rem;
  }
}
