@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");

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

body {
  font-family: "Poppins", sans-serif;
  text-align: center;
  background-color: #f1c2cc;
}

#game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

h1 {
  font-weight: 900;
  color: #1f1e1e;
  text-shadow: 0px 1px 3px #69afec;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 15px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  background-color: #444;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 10px;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px,
    rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

button:hover {
  background-color: #87ceeb;
  color: #000000;
  font-weight: 700;
  box-shadow: 5px 5px 5px grey inset;
}

#boards {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 20px;
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 30px);
  grid-template-rows: repeat(10, 30px);
  gap: 2px;
}

.cell {
  width: 30px;
  height: 30px;
  background-color: #87ceeb;
  border: 1px solid #000;
  cursor: pointer;
}

.cell.ship {
  background-color: #444;
}

.cell.hit {
  background-color: red !important;
}

.cell.missed {
  background-color: white;
}

h1,
h2 {
  margin: 10px 0;
}

#status {
  margin-top: 20px;
  font-size: 1.2em;
  font-weight: bold;
}

#fleet-container {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ship-piece {
  display: flex;
  gap: 2px;
  margin: 5px;
  cursor: grab;
}

.ship-piece.vertical {
  flex-direction: column;
}

.ship-piece.dragging {
  opacity: 0.5;
}

.ship-cell {
  width: 30px;
  height: 30px;
  background-color: #444;
  border: 1px solid black;
  margin: 1px;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  width: 500px;
}

.close {
  float: right;
  cursor: pointer;
  font-size: 20px;
}

@media (max-width: 786px) {
  #game {
    margin-bottom: 40px;
  }

  #boards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    margin-top: 20px;
  }

  .board {
    grid-template-columns: repeat(10, 30px);
    grid-template-rows: repeat(10, 30px);
  }

  .cell,
  .ship-cell {
    width: 40px;
    height: 40px;
  }

  #fleet-container {
    flex-wrap: wrap;
  }
}
