/* ============================================================
   BATALHA NAVAL
   ============================================================ */
.naval-main {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 50px 24px 80px;
}
.naval-cabecalho { text-align: center; margin-bottom: 32px; }
.naval-titulo {
  font-family: "Poppins", sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15;
  letter-spacing: -0.01em; margin: 18px 0 12px; color: #ffffff;
}
.naval-titulo em {
  font-family: "Lora", serif; font-style: italic; font-weight: 500;
  background: linear-gradient(120deg, #2dd4bf, #38bdf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.naval-lead { color: #cbc4d9; font-size: 1rem; margin: 0; }

.escondido { display: none !important; }

/* FASE POSICIONAR */
.naval-fase-titulo {
  font-family: "Poppins", sans-serif; font-size: 1.3rem;
  font-weight: 700; color: #ffffff; text-align: center; margin: 0 0 24px;
}
.naval-posicionar-info {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 720px) { .naval-posicionar-info { grid-template-columns: 1fr; } }

.naval-frota {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.naval-navio-info {
  display: flex; justify-content: space-between;
  font-size: 0.92rem; padding: 6px 4px;
  color: #cbc4d9; transition: opacity 0.2s;
}
.naval-navio-info.colocado { opacity: 0.4; text-decoration: line-through; }
.naval-navio-info.atual {
  color: #2dd4bf; font-weight: 700;
  border-bottom: 1px solid rgba(45, 212, 191, 0.3);
}
.naval-navio-tam { font-size: 0.82rem; color: #aea7c0; }

.naval-controles {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.naval-instr { color: #cbc4d9; font-size: 0.95rem; margin: 0; }
.naval-instr strong { color: #ffffff; }

.naval-tabuleiro-wrap { text-align: center; }
.naval-tabuleiro-titulo {
  font-family: "Poppins", sans-serif; font-weight: 700;
  font-size: 1rem; color: #ffffff; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.naval-tag {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700; color: #2dd4bf;
  padding: 3px 10px;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 999px;
}

.naval-tabuleiro {
  display: grid; grid-template-columns: repeat(8, 1fr);
  width: min(440px, 92vw); aspect-ratio: 1/1; margin: 0 auto;
  /* Mar 3D: gradiente vertical com ondas animadas */
  background:
    radial-gradient(ellipse at 30% 20%, rgba(125, 211, 252, 0.2), transparent 60%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.03) 0 3px, transparent 3px 9px),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.05) 0 4px, transparent 4px 10px),
    linear-gradient(180deg, #0e7490 0%, #0c4a6e 50%, #082f49 100%);
  border: 14px solid;
  border-color: #78350f #5c2c0a #3f1c05 #5c2c0a;
  border-radius: 10px;
  padding: 8px; gap: 3px;
  /* Inclinação 3D suave + sombra dramática */
  transform: perspective(1500px) rotateX(10deg);
  transform-style: preserve-3d;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.7),
    0 12px 24px rgba(0,0,0,0.5),
    inset 0 0 0 2px rgba(255,255,255,0.06),
    inset 0 8px 20px rgba(0,0,0,0.6),
    inset 0 -4px 10px rgba(125, 211, 252, 0.08);
  transition: transform 0.4s ease;
}
.naval-tabuleiro:hover {
  transform: perspective(1500px) rotateX(5deg);
}
.naval-combate .naval-tabuleiro:hover {
  transform: perspective(1500px) rotateX(8deg);
}
.naval-tabuleiro.pequeno { width: min(280px, 70vw); }
.naval-celula {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(96,165,250,0.08), rgba(30, 58, 138, 0.25));
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: "Poppins", sans-serif;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 2px rgba(0,0,0,0.3);
}
.naval-celula:hover:not(.tirado):not(.preview-erro) {
  background: radial-gradient(ellipse at 30% 30%, rgba(96,165,250,0.4), rgba(30, 58, 138, 0.5));
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 12px rgba(56, 189, 248, 0.4);
}
.naval-celula.navio {
  /* Deck do navio — aço naval cinza-azulado */
  background:
    linear-gradient(180deg, #94a3b8 0%, #64748b 35%, #475569 70%, #334155 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -3px 4px rgba(0,0,0,0.55),
    inset 0 0 0 1px #1e293b,
    inset -2px 0 3px rgba(0,0,0,0.25),
    /* Sombra projetada — casco elevado sobre a água */
    0 2px 6px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}
/* Linhas do convés (ranhuras transversais) */
.naval-celula.navio::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* Linhas de painel do deck */
    repeating-linear-gradient(90deg,
      transparent 0 25%,
      rgba(0,0,0,0.18) 25%,
      rgba(0,0,0,0.18) 26%,
      transparent 26% 50%);
  pointer-events: none;
}
/* Torreta com canhão (centro da casa) */
.naval-celula.navio::after {
  content: '';
  position: absolute;
  top: 25%; left: 30%;
  width: 40%; height: 50%;
  background:
    radial-gradient(ellipse at 30% 30%, #475569 0%, #1e293b 70%, #0c0a18 100%);
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.3),
    inset 0 -1px 2px rgba(0,0,0,0.6),
    0 1px 2px rgba(0,0,0,0.5);
  /* Cano do canhão sai do topo */
}
/* Pequena antena em cima da torreta — usando filter pra dar "brilho de radar" */
.naval-celula.navio { filter: drop-shadow(0 0 1px rgba(56, 189, 248, 0.15)); }
.naval-celula.preview { background: rgba(45, 212, 191, 0.5); }
.naval-celula.preview-erro {
  background: rgba(248, 113, 113, 0.5);
  cursor: not-allowed;
}
/* ÁGUA — splash animado */
.naval-celula.tirado.agua {
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.5), rgba(14, 116, 144, 0.3));
  cursor: default;
  animation: navalSplash 0.7s ease-out;
  position: relative;
}
.naval-celula.tirado.agua::before { content: none; }
.naval-celula.tirado.agua::after {
  content: '💧';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  animation: navalSplashIcon 0.6s ease-out;
}
@keyframes navalSplash {
  0%   { background: radial-gradient(circle, #fff, transparent); transform: scale(0.8); }
  30%  { background: radial-gradient(circle, rgba(125,211,252,0.9), rgba(56,189,248,0.6)); transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes navalSplashIcon {
  0%   { transform: translateY(-30px) scale(0.5); opacity: 0; }
  60%  { transform: translateY(-8px) scale(1.4); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ACERTO — explosão dramática */
.naval-celula.tirado.acerto {
  background:
    radial-gradient(circle, #fef3c7 0%, #f97316 30%, #b91c1c 70%, #450a0a 100%);
  cursor: default;
  animation: navalExplosao 0.8s ease-out;
  box-shadow:
    0 0 40px rgba(251, 146, 60, 0.9),
    inset 0 0 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: visible;
  z-index: 5;
}
.naval-celula.tirado.acerto::before { content: none; }
.naval-celula.tirado.acerto::after {
  content: '💥';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  animation: navalExplosaoIcon 0.6s ease-out;
  filter: drop-shadow(0 0 8px #fbbf24);
}
@keyframes navalExplosao {
  0%   { transform: scale(1); box-shadow: 0 0 0 rgba(251, 146, 60, 0); }
  20%  { transform: scale(1.6); box-shadow: 0 0 60px rgba(251, 146, 60, 1); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes navalExplosaoIcon {
  0%   { transform: scale(0) rotate(0deg); opacity: 0; }
  30%  { transform: scale(2) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

/* AFUNDADO — fogo persistente */
.naval-celula.tirado.afundado {
  background:
    radial-gradient(ellipse at center, #ef4444 0%, #7f1d1d 60%, #0c0a18 100%);
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.7),
    0 0 25px rgba(239, 68, 68, 0.6);
  animation: navalAfundadoBg 1.6s ease-in-out infinite alternate;
}
.naval-celula.tirado.afundado::before { content: none; }
.naval-celula.tirado.afundado::after {
  content: '🔥';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  animation: navalFogo 0.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 4px #fbbf24);
}
@keyframes navalAfundadoBg {
  0%   { box-shadow: inset 0 0 20px rgba(0,0,0,0.7), 0 0 20px rgba(239, 68, 68, 0.5); }
  100% { box-shadow: inset 0 0 20px rgba(0,0,0,0.7), 0 0 35px rgba(251, 146, 60, 0.8); }
}
@keyframes navalFogo {
  0%   { transform: scale(0.95) translateY(0); }
  100% { transform: scale(1.1) translateY(-2px); }
}

/* Tremor do tabuleiro quando tem hit */
.naval-tabuleiro.tremor {
  animation: navalTremor 0.4s ease-in-out;
}
@keyframes navalTremor {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -3px); }
  80% { transform: translate(2px, 3px); }
}

/* FASE COMBATE */
.naval-status-combate {
  text-align: center; margin: 0 auto 24px;
  font-family: "Poppins", sans-serif; font-weight: 700;
  font-size: 1.1rem; color: #ffffff;
  min-height: 1.5em;
}
.naval-status-combate.acerto { color: #2dd4bf; }
.naval-status-combate.erro { color: #94a3b8; }
.naval-status-combate.vit { color: #fbbf24; font-size: 1.4rem; }
.naval-status-combate.derr { color: #f87171; font-size: 1.4rem; }
.naval-combate {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  margin-bottom: 24px; align-items: start;
}
@media (max-width: 720px) {
  .naval-combate { grid-template-columns: 1fr; }
}
.naval-combate .naval-tabuleiro-wrap:nth-child(1) { order: 2; }
.naval-combate .naval-tabuleiro-wrap:nth-child(2) { order: 1; }

#naval-novo {
  display: block;
  margin: 0 auto;
}
