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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #0b3d91, #1a6fb5);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 860px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
  font-size: 18px;
}

/* Setup */
.setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-size: 16px;
}

.setup input {
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  width: 200px;
  text-align: center;
}

.placement {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.placement-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #fff;
  min-width: 180px;
}

#shipInfo {
  font-size: 14px;
  min-height: 18px;
}

.ship-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ship-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.ship-item.done {
  background: #2e7d32;
  text-decoration: line-through;
  opacity: 0.7;
}

.cell.preview {
  background: #66bb6a;
}

.cell.preview-invalid {
  background: #e53935;
}

#startBtn:disabled {
  background: #757575;
  cursor: not-allowed;
}

button {
  background: #ff9800;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #ffb74d;
}

/* Boards */
.boards {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.board-wrap {
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 340px;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px;
  border-radius: 10px;
}

.cell {
  aspect-ratio: 1;
  background: #164a7a;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  transition: background 0.15s;
}

.cell:hover {
  background: #2a6bb5;
}

#playerBoard .cell.ship {
  background: #4a4a4a;
}

.cell.ship {
  background: #4a4a4a;
}

.cell.hit {
  background: #d32f2f;
}

.cell.miss {
  background: #90caf9;
  opacity: 0.6;
}

.cell.sunk {
  background: #8e24aa;
}

#enemyBoard .cell {
  background: #0d3b66;
}

#enemyBoard .cell:hover {
  background: #ff9800;
}

#enemyBoard .cell.hit {
  background: #d32f2f;
}

#enemyBoard .cell.miss {
  background: #e0e0e0;
  opacity: 0.6;
}

#enemyBoard .cell.sunk {
  background: #8e24aa;
}

#playerBoard .cell.hit {
  background: #d32f2f;
}

#playerBoard .cell.miss {
  background: #e0e0e0;
  opacity: 0.6;
}

#playerBoard .cell.sunk {
  background: #8e24aa;
}

/* Status */
.status {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-size: 16px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.overlay-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 400px;
}

.overlay-box h2 {
  color: #333;
  margin-bottom: 12px;
}

.overlay-box p {
  color: #555;
  margin-bottom: 20px;
}

.hidden {
  display: none;
}
