/* ---- Batalla Naval: tablero 10x10 y colocación de flota ---- */

.bn-board { margin: 10px auto 4px; max-width: 380px; }
.bn-board-mini { max-width: 260px; }

.bn-grid {
  display: grid;
  grid-template-columns: 18px repeat(10, 1fr);
  grid-template-rows: 18px repeat(10, 1fr);
  aspect-ratio: 1;
  gap: 2px;
}
.bn-board-mini .bn-grid { grid-template-columns: 14px repeat(10, 1fr); grid-template-rows: 14px repeat(10, 1fr); }

.bn-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  min-width: 0;
  min-height: 0;
}
.bn-head { color: var(--muted); font-size: 9.5px; user-select: none; }
.bn-corner { background: transparent; }

.bn-slot {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 3px;
  cursor: pointer;
  transition: background .12s;
}
.bn-slot:hover { background: rgba(255,255,255,.14); }
.bn-slot.bn-ship { background: var(--gold); border-color: var(--gold-light); cursor: default; }
.bn-slot.bn-hit { background: var(--red); border-color: #E05A45; cursor: default; }
.bn-slot.bn-miss { background: rgba(255,255,255,.16); cursor: default; }
.bn-slot.bn-miss::after { content: '·'; color: var(--muted); font-size: 16px; }
.bn-slot.bn-sunk { background: #2A1414; border-color: var(--red); cursor: default; }
.bn-slot.bn-sunk::after { content: '×'; color: #E05A45; font-weight: 900; }

.bn-board-disabled { opacity: .55; pointer-events: none; }

.bn-board-label { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }

.bn-ship-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.bn-ship-chip {
  padding: 7px 11px; border-radius: 9px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.05); color: var(--white); font-size: 12.5px; cursor: pointer;
  font-family: 'Work Sans', sans-serif;
}
.bn-ship-chip .bn-ship-size { color: var(--muted); font-size: 11px; }
.bn-ship-chip.bn-ship-placed { border-color: var(--gold); color: var(--gold-light); }
.bn-ship-chip.bn-ship-armed { background: var(--gold); color: var(--felt-dark); border-color: var(--gold-light); font-weight: 700; }

.bn-target-tabs { display: flex; gap: 6px; margin-bottom: 4px; justify-content: center; flex-wrap: wrap; }
.bn-target-tab {
  padding: 6px 13px; border-radius: 20px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.05); color: var(--white); font-size: 12px; cursor: pointer;
  font-family: 'Work Sans', sans-serif;
}
.bn-target-tab-active { background: var(--gold); color: var(--felt-dark); border-color: var(--gold-light); font-weight: 700; }
.bn-target-tab-out { opacity: .45; text-decoration: line-through; }

.bn-own-mini-wrap { margin-top: 16px; text-align: center; }

@media (max-width: 480px) {
  .bn-board { max-width: 320px; }
  .bn-board-mini { max-width: 220px; }
  .bn-ship-chip { font-size: 11.5px; padding: 6px 9px; }
}

/* ---- Sprites de barcos (reemplazan las celdas de color) ---- */
.bn-ship-sprite {
  width: 100%; height: 100%;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
}
.bn-ship-sprite.bn-ship-sunk { filter: grayscale(1) brightness(.45) drop-shadow(0 0 4px rgba(224,90,69,.8)); }

.bn-cell-marker { pointer-events: none; position: relative; display: flex; align-items: center; justify-content: center; z-index: 3; }
.bn-cell-marker.bn-mark-hit::after,
.bn-cell-marker.bn-mark-sunk::after { content: ''; width: 62%; height: 62%; border-radius: 50%; background: radial-gradient(circle, #fff2c2 0%, #ff6b3d 45%, #c0392b 75%, rgba(192,57,43,0) 100%); }
.bn-cell-marker.bn-mark-sunk::after { background: radial-gradient(circle, #ffd9c2 0%, #7a1f1f 55%, rgba(122,31,31,0) 80%); }
.bn-cell-marker.bn-mark-miss::before { content: '✕'; color: #fff; font-weight: 900; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* ---- Fondo de agua animada: solo dentro del tablero, no en toda la pantalla ---- */
.bn-board {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  padding: 4px;
}
.bn-board::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: url('/client/games/batalla-naval/assets/water-bg.gif') center/160px repeat;
  opacity: .55;
}
.bn-board::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(10,31,61,.35) 0%, rgba(10,31,61,.55) 100%);
}
.bn-board > * { position: relative; z-index: 1; }

/* ---- Personaje sobre el tablero propio ---- */
.bn-own-mini-wrap { margin-top: 16px; text-align: center; position: relative; }
.bn-gunner {
  width: 92px; height: auto; margin-bottom: -14px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
  transform: scaleX(-1); /* mira hacia el tablero, a la derecha */
}

/* ---- Animación de disparo: haz de luz + explosión ---- */
.bn-fx-beam {
  position: fixed; height: 4px; top: 0; left: 0;
  background: linear-gradient(90deg, rgba(255,247,194,0) 0%, #fff7c2 45%, #ffffff 100%);
  box-shadow: 0 0 10px 3px rgba(255,240,150,.85);
  border-radius: 3px; pointer-events: none; z-index: 500;
  transform-origin: 0 50%; opacity: 0;
  transition: transform .22s linear, opacity .18s linear;
}
.bn-fx-boom {
  position: fixed; width: 14px; height: 14px; margin-left: -7px; margin-top: -7px;
  border-radius: 50%; pointer-events: none; z-index: 500;
  animation: bn-boom .5s ease-out forwards;
}
.bn-fx-boom-red { background: radial-gradient(circle, #fff2c2 0%, #ff6b3d 35%, #c0392b 65%, rgba(192,57,43,0) 100%); }
.bn-fx-boom-white { background: radial-gradient(circle, #ffffff 0%, #dbeeff 45%, rgba(219,238,255,0) 100%); }
@keyframes bn-boom { 0% { transform: scale(.2); opacity: 1; } 55% { transform: scale(2.6); opacity: .95; } 100% { transform: scale(3.6); opacity: 0; } }

/* ---- Equipos ---- */
.bn-target-tab-ally { opacity: .55; cursor: not-allowed; border-style: dashed; }
