body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #111827;
  color: #ffffff;
}

h2 {
  margin: 0 0 10px 0;
  color: #ffffff;
}

#panel {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#infoTurno {
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 10px;
  background: #1f2937;
  border: 2px solid #374151;
}

#modoActual {
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 10px;
  background: #facc15;
  color: #111827;
}

#economiaPanel {
  margin: 10px 0 16px 0;
}

.economia-box {
  display: inline-block;
  padding: 10px 14px;
  background: #020617;
  border: 2px solid #475569;
  border-radius: 14px;
  font-weight: bold;
  box-shadow: 0 0 12px rgba(0,0,0,0.35);
}

button {
  cursor: pointer;
  padding: 9px 12px;
  border: 2px solid #475569;
  background: linear-gradient(180deg, #334155, #0f172a);
  color: #ffffff;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 3px 0 #020617;
}

button:hover {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #020617;
}

button.activo {
  background: linear-gradient(180deg, #f97316, #b45309);
  border-color: #fed7aa;
  color: #fff7ed;
}

#tablero {
  display: grid;
  grid-template-columns: repeat(20, 30px);
  grid-template-rows: repeat(20, 30px);
  gap: 1px;
  background: #ffffff;
  width: max-content;
  padding: 4px;
  border: 3px solid #475569;
  border-radius: 8px;
}

.celda {
  width: 30px;
  height: 30px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
}

.celda img {
  width: 100%;
  height: 100%;
  display: block;
}

.celda.seleccionada {
  outline: 3px solid #ffffff;
  z-index: 2;
}

.celda.no-seleccionable {
  cursor: not-allowed;
}

.celda.usada {
  opacity: 0.4;
}

.badge-defensa {
  position: absolute;
  right: 1px;
  bottom: 1px;
  background: #000000;
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 4px;
}

.badge-ataque {
  position: absolute;
  left: 1px;
  top: 1px;
  background: #dc2626;
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 4px;
}

.j1 { background: rgba(255,255,0,0.5); }
.j2 { background: rgba(0,255,255,0.5); }
.j3 { background: rgba(255,0,0,0.5); }
.j4 { background: rgba(0,255,0,0.5); }
/*
========================
CASILLAS TÁCTICAS
========================
*/

.casilla-movimiento {
  background:
    radial-gradient(circle, rgba(34,197,94,0.85) 0%, rgba(22,101,52,0.85) 100%) !important;

  box-shadow:
    inset 0 0 0 2px #dcfce7,
    0 0 10px rgba(34,197,94,0.8);

  animation: pulsoMovimiento 1.2s infinite;
}

.casilla-ataque {
  background:
    radial-gradient(circle, rgba(239,68,68,0.9) 0%, rgba(127,29,29,0.9) 100%) !important;

  box-shadow:
    inset 0 0 0 2px #fecaca,
    0 0 12px rgba(239,68,68,0.9);

  animation: pulsoAtaque 0.9s infinite;
}

.casilla-construccion {
  background:
    radial-gradient(circle, rgba(59,130,246,0.9) 0%, rgba(30,64,175,0.9) 100%) !important;

  box-shadow:
    inset 0 0 0 2px #bfdbfe,
    0 0 12px rgba(59,130,246,0.9);

  animation: pulsoConstruccion 1.3s infinite;
}

@keyframes pulsoMovimiento {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes pulsoAtaque {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes pulsoConstruccion {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.celda-hover {
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.celda-hover:hover {
  transform: scale(1.08);
  z-index: 5;
}